Use the existing ioctl path to call WSDISPLAYIO_GBORDER/WSDISPLAYIO_SBORDER

instead of a separate accessops entry. There is no need to introduce bloat
for the majority of drivers which don't implement this feature.
This should also resolve PR kern/33186 by Valeriy E. Ushakov.
This commit is contained in:
drochner 2006-04-05 15:18:25 +00:00
parent 7011c71999
commit 5b4dd527c3
2 changed files with 3 additions and 25 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: wsdisplay.c,v 1.92 2006/03/29 04:16:51 thorpej Exp $ */
/* $NetBSD: wsdisplay.c,v 1.93 2006/04/05 15:18:25 drochner Exp $ */
/*
* Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved.
@ -31,9 +31,8 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.92 2006/03/29 04:16:51 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.93 2006/04/05 15:18:25 drochner Exp $");
#include "opt_wsdisplay_border.h"
#include "opt_wsdisplay_compat.h"
#include "opt_wsmsgattrs.h"
#include "opt_compat_netbsd.h"
@ -1181,25 +1180,6 @@ wsdisplay_internal_ioctl(struct wsdisplay_softc *sc, struct wsscreen *scr,
case WSDISPLAYIO_SMSGATTRS:
return (ENODEV);
#endif
#ifdef WSDISPLAY_CUSTOM_BORDER
case WSDISPLAYIO_GBORDER:
if (!sc->sc_accessops->getborder)
return (EINVAL);
*(u_int *)data = (*sc->sc_accessops->getborder)
(scr->scr_dconf->emulcookie);
return (0);
case WSDISPLAYIO_SBORDER:
if (!sc->sc_accessops->setborder)
return (EINVAL);
return (*sc->sc_accessops->setborder)
(scr->scr_dconf->emulcookie, (*(u_int *)data));
#else /* WSDISPLAY_CUSTOM_BORDER */
case WSDISPLAYIO_GBORDER:
case WSDISPLAYIO_SBORDER:
return (ENODEV);
#endif /* WSDISPLAY_CUSTOM_BORDER */
}
/* check ioctls for display */

View File

@ -1,4 +1,4 @@
/* $NetBSD: wsdisplayvar.h,v 1.35 2006/02/19 15:10:31 jmcneill Exp $ */
/* $NetBSD: wsdisplayvar.h,v 1.36 2006/04/05 15:18:25 drochner Exp $ */
/*
* Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved.
@ -124,8 +124,6 @@ struct wsdisplay_accessops {
int (*getwschar)(void *, struct wsdisplay_char *);
int (*putwschar)(void *, struct wsdisplay_char *);
void (*scroll)(void *, void *, int);
u_int (*getborder)(void *);
int (*setborder)(void *, u_int);
};
/*