NetBSD-Bugs archive

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

re: kern/58374: X stopped working



matthew green writes:
> hmm, i notice that in 2019 there were some changes to the vesa
> driver to "Refuse to run on UEFI machines running older kernels".

OK, it's almost certainly this.  we should already be skipping
devices with a drm driver present, but this case has genfb and
no drm driver.

can you test this with the vesa driver back in place?

thanks.


.mrg.


xf86-video-vesa(4): Refuse to run on NetBSD UEFI systems.

Index: src/vesa.c
===================================================================
RCS file: /cvsroot/xsrc/external/mit/xf86-video-vesa/dist/src/vesa.c,v
retrieving revision 1.12
diff -p -u -r1.12 vesa.c
--- src/vesa.c	8 Jan 2023 21:34:50 -0000	1.12
+++ src/vesa.c	29 Jun 2024 22:33:00 -0000
@@ -64,6 +64,10 @@
 #endif
 #include "compat-api.h"
 
+#if defined(__NetBSD__)
+#include <sys/sysctl.h>
+#endif
+
 /* Mandatory functions */
 static const OptionInfoRec * VESAAvailableOptions(int chipid, int busid);
 static void VESAIdentify(int flags);
@@ -485,6 +489,18 @@ VESAPciProbe(DriverPtr drv, int entity_n
         return FALSE;
     }
 #endif
+#if defined(__NetBSD__)
+    {
+	char method[10];
+	size_t len = sizeof(method);
+
+        if (sysctlbyname("machdep.bootmethod", &method, &len, NULL, 0) == 0 &&
+	    strcmp(method, "UEFI") == 0) {
+            ErrorF("vesa: Refusing to run, UEFI booted\n");
+            return FALSE;
+        }
+    }
+#endif
 
     pScrn = xf86ConfigPciEntity(NULL, 0, entity_num, NULL, 
 				NULL, NULL, NULL, NULL, NULL);


Home | Main Index | Thread Index | Old Index