summaryrefslogtreecommitdiff
path: root/extra/source/tigervnc/patches/xorg-server/0001-xfree86-use-modesetting-driver-by-default-on-GeForce.patch
diff options
context:
space:
mode:
authorPatrick J Volkerding <volkerdi@slackware.com>2019-11-18 20:14:57 +0000
committerEric Hameleers <alien@slackware.com>2019-11-19 08:59:51 +0100
commitfa3f92ac782f8531079bf9584fe6714fc3d7c5ed (patch)
tree77d560418b6292229dc9d6cce590db01d5b278c2 /extra/source/tigervnc/patches/xorg-server/0001-xfree86-use-modesetting-driver-by-default-on-GeForce.patch
parentf5de7b702347679403ef7dd832c42e913c931d23 (diff)
downloadcurrent-fa3f92ac782f8531079bf9584fe6714fc3d7c5ed.tar.gz
Mon Nov 18 20:14:57 UTC 201920191118201457
a/kernel-firmware-20191118_9581f15-noarch-1.txz: Upgraded. ap/rpm-4.15.1-x86_64-1.txz: Upgraded. ap/vim-8.1.2318-x86_64-1.txz: Upgraded. d/ccache-3.7.6-x86_64-1.txz: Upgraded. d/vala-0.46.5-x86_64-1.txz: Upgraded. l/imagemagick-7.0.9_5-x86_64-1.txz: Upgraded. l/libssh-0.9.2-x86_64-1.txz: Upgraded. x/xterm-351-x86_64-1.txz: Upgraded. xap/vim-gvim-8.1.2318-x86_64-1.txz: Upgraded. extra/tigervnc/tigervnc-1.10.0-x86_64-1.txz: Upgraded.
Diffstat (limited to 'extra/source/tigervnc/patches/xorg-server/0001-xfree86-use-modesetting-driver-by-default-on-GeForce.patch')
-rw-r--r--extra/source/tigervnc/patches/xorg-server/0001-xfree86-use-modesetting-driver-by-default-on-GeForce.patch47
1 files changed, 47 insertions, 0 deletions
diff --git a/extra/source/tigervnc/patches/xorg-server/0001-xfree86-use-modesetting-driver-by-default-on-GeForce.patch b/extra/source/tigervnc/patches/xorg-server/0001-xfree86-use-modesetting-driver-by-default-on-GeForce.patch
new file mode 100644
index 00000000..87b28779
--- /dev/null
+++ b/extra/source/tigervnc/patches/xorg-server/0001-xfree86-use-modesetting-driver-by-default-on-GeForce.patch
@@ -0,0 +1,47 @@
+From aa2f34d80ef3118eae0cce73b610c36cdcb978fe Mon Sep 17 00:00:00 2001
+From: Ben Skeggs <bskeggs@redhat.com>
+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 <bskeggs@redhat.com>
+---
+ hw/xfree86/common/xf86pciBus.c | 20 ++++++++++++++++++++
+ 1 file changed, 20 insertions(+)
+
+--- ./hw/xfree86/common/xf86pciBus.c.orig 2019-02-26 13:28:50.000000000 -0600
++++ ./hw/xfree86/common/xf86pciBus.c 2019-02-26 17:16:04.131096857 -0600
+@@ -37,6 +37,7 @@
+ #include <unistd.h>
+ #include <X11/X.h>
+ #include <pciaccess.h>
++#include <xf86drm.h>
+ #include "os.h"
+ #include "Pci.h"
+ #include "xf86.h"
+@@ -1191,6 +1192,25 @@
+ int idx = 0;
+
+ #if defined(__linux__) || defined(__NetBSD__)
++ 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";