Module Name: src Committed By: martin Date: Fri Oct 3 16:22:58 UTC 2014
Modified Files: src/sys/dev/wsfb [netbsd-7]: genfb.c Log Message: Pull up following revision(s) (requested by skrll in ticket #125): sys/dev/wsfb/genfb.c: revision 1.56 handle WSDISPLAYIO_GET_EDID and WSDISPLAYIO_GET_FBINFO only if the bus frontend doesn't ( as in, returns EPASSTHROUGH or doesn't register a handler ) Now flags passed from things like bcm2835_genfb.c are actually seen by xf86-video-wsfb again and automatically disabling shadowfb works again, which results in a major speedup on this kind of hardware. To generate a diff of this commit: cvs rdiff -u -r1.55 -r1.55.2.1 src/sys/dev/wsfb/genfb.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/wsfb/genfb.c diff -u src/sys/dev/wsfb/genfb.c:1.55 src/sys/dev/wsfb/genfb.c:1.55.2.1 --- src/sys/dev/wsfb/genfb.c:1.55 Thu Jul 24 21:35:13 2014 +++ src/sys/dev/wsfb/genfb.c Fri Oct 3 16:22:58 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: genfb.c,v 1.55 2014/07/24 21:35:13 riastradh Exp $ */ +/* $NetBSD: genfb.c,v 1.55.2.1 2014/10/03 16:22:58 martin Exp $ */ /*- * Copyright (c) 2007 Michael Lorenz @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: genfb.c,v 1.55 2014/07/24 21:35:13 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: genfb.c,v 1.55.2.1 2014/10/03 16:22:58 martin Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -354,7 +354,7 @@ genfb_ioctl(void *v, void *vs, u_long cm struct wsdisplay_fbinfo *wdf; struct vcons_screen *ms = vd->active; struct wsdisplay_param *param; - int new_mode, error, val; + int new_mode, error, val, ret; switch (cmd) { case WSDISPLAYIO_GINFO: @@ -459,9 +459,22 @@ genfb_ioctl(void *v, void *vs, u_long cm return sc->sc_backlight->gpc_set_parameter( sc->sc_backlight->gpc_cookie, val); } - return EPASSTHROUGH; - + return EPASSTHROUGH; + } + ret = EPASSTHROUGH; + if (sc->sc_ops.genfb_ioctl) + ret = sc->sc_ops.genfb_ioctl(sc, vs, cmd, data, flag, l); + if (ret != EPASSTHROUGH) + return ret; + /* + * XXX + * handle these only if there either is no ioctl() handler or it didn't + * know how to deal with them. This allows bus frontends to override + * them but still provides fallback implementations + */ + switch (cmd) { case WSDISPLAYIO_GET_EDID: { + struct wsdisplayio_edid_info *d = data; return wsdisplayio_get_edid(sc->sc_dev, d); } @@ -470,11 +483,6 @@ genfb_ioctl(void *v, void *vs, u_long cm struct wsdisplayio_fbinfo *fbi = data; return wsdisplayio_get_fbinfo(&ms->scr_ri, fbi); } - - default: - if (sc->sc_ops.genfb_ioctl) - return sc->sc_ops.genfb_ioctl(sc, vs, cmd, - data, flag, l); } return EPASSTHROUGH; }