Source-Changes-HG archive

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

[src/trunk]: src/sys/external/bsd/drm2/radeon apply several changes from inte...



details:   https://anonhg.NetBSD.org/src/rev/358d299ca70d
branches:  trunk
changeset: 803796:358d299ca70d
user:      chs <chs%NetBSD.org@localhost>
date:      Wed Nov 12 16:07:17 2014 +0000

description:
apply several changes from intelfb.c revs 1.7 through 1.9:
 - provide a setmode callback for genfb
 - add a pmf shutdown handler to switch genfb into polling mode
 - no need to call drm_fb_helper_set_config after genfb attaches,
   as the setmode callback is called by genfb_attach

diffstat:

 sys/external/bsd/drm2/radeon/radeondrmkmsfb.c |  35 ++++++++++++++++++++++++--
 1 files changed, 32 insertions(+), 3 deletions(-)

diffs (74 lines):

diff -r 11db67fa76ec -r 358d299ca70d sys/external/bsd/drm2/radeon/radeondrmkmsfb.c
--- a/sys/external/bsd/drm2/radeon/radeondrmkmsfb.c     Wed Nov 12 15:08:52 2014 +0000
+++ b/sys/external/bsd/drm2/radeon/radeondrmkmsfb.c     Wed Nov 12 16:07:17 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: radeondrmkmsfb.c,v 1.3 2014/07/26 07:02:13 riastradh Exp $     */
+/*     $NetBSD: radeondrmkmsfb.c,v 1.4 2014/11/12 16:07:17 chs Exp $   */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: radeondrmkmsfb.c,v 1.3 2014/07/26 07:02:13 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radeondrmkmsfb.c,v 1.4 2014/11/12 16:07:17 chs Exp $");
 
 #ifdef _KERNEL_OPT
 #include "vga.h"
@@ -88,6 +88,12 @@
 static paddr_t radeonfb_genfb_mmap(void *, void *, off_t, int);
 static int     radeonfb_genfb_enable_polling(void *);
 static int     radeonfb_genfb_disable_polling(void *);
+static bool    radeonfb_genfb_shutdown(device_t, int);
+static bool    radeonfb_genfb_setmode(struct genfb_softc *, int);
+
+static const struct genfb_mode_callback radeonfb_genfb_mode_callback = {
+       .gmc_setmode = radeonfb_genfb_setmode,
+};
 
 CFATTACH_DECL_NEW(radeondrmkmsfb, sizeof(struct radeonfb_softc),
     radeonfb_match, radeonfb_attach, radeonfb_detach, NULL);
@@ -172,6 +178,9 @@
        prop_dictionary_set_uint64(dict, "virtual_address",
            (uint64_t)(uintptr_t)rfa->rfa_fb_ptr);
 
+       prop_dictionary_set_uint64(dict, "mode_callback",
+           (uint64_t)(uintptr_t)&radeonfb_genfb_mode_callback);
+
        /* XXX Whattakludge!  */
 #if NVGA > 0
        if (vga_is_console(rfa->rfa_fb_helper->dev->pdev->pd_pa.pa_iot, -1)) {
@@ -203,7 +212,8 @@
        }
        sc->sc_attached = true;
 
-       drm_fb_helper_set_config(sc->sc_rfa.rfa_fb_helper);
+       pmf_device_register1(sc->sc_dev, NULL, NULL,
+           radeonfb_genfb_shutdown);
 
        /* Success!  */
        sc->sc_scheduled = false;
@@ -344,3 +354,22 @@
 
        return drm_fb_helper_debug_leave_fb(sc->sc_rfa.rfa_fb_helper);
 }
+
+static bool
+radeonfb_genfb_shutdown(device_t self, int flags)
+{
+       genfb_enable_polling(self);
+       return true;
+}
+
+static bool
+radeonfb_genfb_setmode(struct genfb_softc *genfb, int mode)
+{
+       struct radeonfb_softc *sc = (struct radeonfb_softc *)genfb;
+
+       if (mode == WSDISPLAYIO_MODE_EMUL) {
+               drm_fb_helper_set_config(sc->sc_rfa.rfa_fb_helper);
+       }
+
+       return true;
+}



Home | Main Index | Thread Index | Old Index