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 radeon: Kick out genfb on firmw...



details:   https://anonhg.NetBSD.org/src/rev/b3945501a418
branches:  trunk
changeset: 373854:b3945501a418
user:      mrg <mrg%NetBSD.org@localhost>
date:      Tue Mar 07 09:47:48 2023 +0000

description:
radeon: Kick out genfb on firmware framebuffer before initializing.

this is the same change as nouveau_pci.c:1.37, and should fix at
least PR#56714 and i thought at least another PR i can't find right
now.  it fixes at least 2 different radeon cards for me on UEFI
booted system.

XXX: pullup-10 also include the original change:
   http://mail-index.netbsd.org/source-changes/2023/03/01/msg143606.html

diffstat:

 sys/external/bsd/drm2/radeon/radeon_pci.c |  28 ++++++++++++++++++++++++++--
 1 files changed, 26 insertions(+), 2 deletions(-)

diffs (58 lines):

diff -r 3bac38898781 -r b3945501a418 sys/external/bsd/drm2/radeon/radeon_pci.c
--- a/sys/external/bsd/drm2/radeon/radeon_pci.c Tue Mar 07 01:29:21 2023 +0000
+++ b/sys/external/bsd/drm2/radeon/radeon_pci.c Tue Mar 07 09:47:48 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: radeon_pci.c,v 1.21 2022/07/18 23:34:03 riastradh Exp $        */
+/*     $NetBSD: radeon_pci.c,v 1.22 2023/03/07 09:47:48 mrg Exp $      */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,9 +30,10 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: radeon_pci.c,v 1.21 2022/07/18 23:34:03 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radeon_pci.c,v 1.22 2023/03/07 09:47:48 mrg Exp $");
 
 #ifdef _KERNEL_OPT
+#include "genfb.h"
 #include "vga.h"
 #if defined(__arm__) || defined(__aarch64__)
 #include "opt_fdt.h"
@@ -73,6 +74,11 @@
 #include <drm/drm_fb_helper.h>
 #include <drm/drm_pci.h>
 
+#if NGENFB > 0
+#include <dev/wscons/wsdisplayvar.h>
+#include <dev/wsfb/genfbvar.h>
+#endif
+
 #include <radeon.h>
 #include "radeon_drv.h"
 #include "radeon_task.h"
@@ -273,6 +279,24 @@
        }
        sc->sc_pci_attached = true;
 
+#if NGENFB > 0
+       /*
+        * If MD initialization has selected this as the console device
+        * with a firmware-provided framebuffer address, we may have to
+        * turn it off early, before we are ready to switch the console
+        * over -- something goes wrong if we're still writing to the
+        * firmware-provided framebuffer during nouveau initialization.
+        */
+    {
+       bool is_console;
+       if (prop_dictionary_get_bool(device_properties(self), "is_console",
+               &is_console) &&
+           is_console &&
+           genfb_is_console())
+               wsdisplay_predetach();
+    }
+#endif
+
        /* XXX errno Linux->NetBSD */
        error = -drm_dev_register(sc->sc_drm_dev, flags);
        if (error) {



Home | Main Index | Thread Index | Old Index