From de1c849ff18b41f53d003bb70bf8b1744b749af8 Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Apr 23 2017 23:26:16 +0000 Subject: Default to xf86-video-modesetting on GeForce 8 and newer. --- diff --git a/0001-xfree86-use-modesetting-driver-by-default-on-GeForce.patch b/0001-xfree86-use-modesetting-driver-by-default-on-GeForce.patch new file mode 100644 index 0000000..1b1306e --- /dev/null +++ b/0001-xfree86-use-modesetting-driver-by-default-on-GeForce.patch @@ -0,0 +1,52 @@ +From aa2f34d80ef3118eae0cce73b610c36cdcb978fe Mon Sep 17 00:00:00 2001 +From: Ben Skeggs +Date: Sat, 22 Apr 2017 02:26:28 +1000 +Subject: [PATCH xserver] xfree86: use modesetting driver by default on GeForce + 8 and newer + +Signed-off-by: Ben Skeggs +--- + hw/xfree86/common/xf86pciBus.c | 20 ++++++++++++++++++++ + 1 file changed, 20 insertions(+) + +diff --git a/hw/xfree86/common/xf86pciBus.c b/hw/xfree86/common/xf86pciBus.c +index 8158c2b62..78d1c947d 100644 +--- a/hw/xfree86/common/xf86pciBus.c ++++ b/hw/xfree86/common/xf86pciBus.c +@@ -37,6 +37,7 @@ + #include + #include + #include ++#include + #include "os.h" + #include "Pci.h" + #include "xf86.h" +@@ -1190,6 +1191,25 @@ xf86VideoPtrToDriverList(struct pci_device *dev, + int idx = 0; + + #ifdef __linux__ ++ char busid[32]; ++ int fd; ++ ++ snprintf(busid, sizeof(busid), "pci:%04x:%02x:%02x.%d", ++ dev->domain, dev->bus, dev->dev, dev->func); ++ ++ /* 'modesetting' is preferred for GeForce 8 and newer GPUs */ ++ fd = drmOpenWithType("nouveau", busid, DRM_NODE_RENDER); ++ if (fd >= 0) { ++ uint64_t args[] = { 11 /* NOUVEAU_GETPARAM_CHIPSET_ID */, 0 }; ++ int ret = drmCommandWriteRead(fd, 0 /* DRM_NOUVEAU_GETPARAM */, ++ &args, sizeof(args)); ++ drmClose(fd); ++ if (ret == 0) { ++ if (args[1] == 0x050 || args[1] >= 0x80) ++ break; ++ } ++ } ++ + driverList[idx++] = "nouveau"; + #endif + driverList[idx++] = "nv"; +-- +2.12.2 + diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 4e7deb1..d832a66 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -45,7 +45,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.19.3 -Release: 3%{?gitdate:.%{gitdate}}%{dist} +Release: 4%{?gitdate:.%{gitdate}}%{dist} URL: http://www.x.org License: MIT Group: User Interface/X @@ -110,6 +110,9 @@ Patch7027: xserver-autobind-hotplug.patch # because the display-managers are not ready yet, do not upstream Patch10000: 0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch +# Default to xf86-video-modesetting on GeForce 8 and newer +Patch10001: 0001-xfree86-use-modesetting-driver-by-default-on-GeForce.patch + %global moduledir %{_libdir}/xorg/modules %global drimoduledir %{_libdir}/dri %global sdkdir %{_includedir}/xorg @@ -602,6 +605,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Mon Apr 24 2017 Ben Skeggs - 1.19.3-4 +- Default to xf86-video-modesetting on GeForce 8 and newer + * Fri Apr 07 2017 Adam Jackson - 1.19.3-3 - Inoculate against a versioning bug with libdrm 2.4.78