Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-7]: src/sys/dev/wsfb Pull up following revision(s) (requested by ...



details:   https://anonhg.NetBSD.org/src/rev/04ad448c1c97
branches:  netbsd-7
changeset: 798391:04ad448c1c97
user:      martin <martin%NetBSD.org@localhost>
date:      Fri Oct 03 16:22:58 2014 +0000

description:
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.

diffstat:

 sys/dev/wsfb/genfb.c |  28 ++++++++++++++++++----------
 1 files changed, 18 insertions(+), 10 deletions(-)

diffs (64 lines):

diff -r 77c83b84f352 -r 04ad448c1c97 sys/dev/wsfb/genfb.c
--- a/sys/dev/wsfb/genfb.c      Thu Oct 02 14:43:59 2014 +0000
+++ b/sys/dev/wsfb/genfb.c      Fri Oct 03 16:22:58 2014 +0000
@@ -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 @@
        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 @@
                                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 @@
                        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;
 }



Home | Main Index | Thread Index | Old Index