|
|
1
|
+>From aa2f34d80ef3118eae0cce73b610c36cdcb978fe Mon Sep 17 00:00:00 2001
|
|
|
2
|
+From: Ben Skeggs <bskeggs@redhat.com>
|
|
|
3
|
+Date: Sat, 22 Apr 2017 02:26:28 +1000
|
|
|
4
|
+Subject: [PATCH xserver] xfree86: use modesetting driver by default on GeForce
|
|
|
5
|
+ 8 and newer
|
|
|
6
|
+
|
|
|
7
|
+Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
|
|
|
8
|
+---
|
|
|
9
|
+ hw/xfree86/common/xf86pciBus.c | 20 ++++++++++++++++++++
|
|
|
10
|
+ 1 file changed, 20 insertions(+)
|
|
|
11
|
+
|
|
|
12
|
+diff --git a/hw/xfree86/common/xf86pciBus.c b/hw/xfree86/common/xf86pciBus.c
|
|
|
13
|
+index 8158c2b62..78d1c947d 100644
|
|
|
14
|
+--- a/hw/xfree86/common/xf86pciBus.c
|
|
|
15
|
++++ b/hw/xfree86/common/xf86pciBus.c
|
|
|
16
|
+@@ -37,6 +37,7 @@
|
|
|
17
|
+ #include <unistd.h>
|
|
|
18
|
+ #include <X11/X.h>
|
|
|
19
|
+ #include <pciaccess.h>
|
|
|
20
|
++#include <xf86drm.h>
|
|
|
21
|
+ #include "os.h"
|
|
|
22
|
+ #include "Pci.h"
|
|
|
23
|
+ #include "xf86.h"
|
|
|
24
|
+@@ -1190,6 +1191,25 @@ xf86VideoPtrToDriverList(struct pci_device *dev,
|
|
|
25
|
+ int idx = 0;
|
|
|
26
|
+
|
|
|
27
|
+ #ifdef __linux__
|
|
|
28
|
++ char busid[32];
|
|
|
29
|
++ int fd;
|
|
|
30
|
++
|
|
|
31
|
++ snprintf(busid, sizeof(busid), "pci:%04x:%02x:%02x.%d",
|
|
|
32
|
++ dev->domain, dev->bus, dev->dev, dev->func);
|
|
|
33
|
++
|
|
|
34
|
++ /* 'modesetting' is preferred for GeForce 8 and newer GPUs */
|
|
|
35
|
++ fd = drmOpenWithType("nouveau", busid, DRM_NODE_RENDER);
|
|
|
36
|
++ if (fd >= 0) {
|
|
|
37
|
++ uint64_t args[] = { 11 /* NOUVEAU_GETPARAM_CHIPSET_ID */, 0 };
|
|
|
38
|
++ int ret = drmCommandWriteRead(fd, 0 /* DRM_NOUVEAU_GETPARAM */,
|
|
|
39
|
++ &args, sizeof(args));
|
|
|
40
|
++ drmClose(fd);
|
|
|
41
|
++ if (ret == 0) {
|
|
|
42
|
++ if (args[1] == 0x050 || args[1] >= 0x80)
|
|
|
43
|
++ break;
|
|
|
44
|
++ }
|
|
|
45
|
++ }
|
|
|
46
|
++
|
|
|
47
|
+ driverList[idx++] = "nouveau";
|
|
|
48
|
+ #endif
|
|
|
49
|
+ driverList[idx++] = "nv";
|
|
|
50
|
+--
|
|
|
51
|
+2.12.2
|
|
|
52
|
+
|