Imported Debian patch 2:1.15.1-0ubuntu2.6
[deb_xorg-server.git] / debian / patches / 105_nvidia_fglrx_autodetect.patch
1 diff --git a/hw/xfree86/common/xf86AutoConfig.c b/hw/xfree86/common/xf86AutoConfig.c
2 index 43c746b..750b425 100644
3 --- a/hw/xfree86/common/xf86AutoConfig.c
4 +++ b/hw/xfree86/common/xf86AutoConfig.c
5 @@ -75,6 +75,13 @@
6 "\tDevice\t" BUILTIN_DEVICE_NAME "\n" \
7 "EndSection\n\n"
8
9 +#define BUILTIN_SCREEN_SECTION_PROPRIETARY \
10 + "Section \"Screen\"\n" \
11 + "\tIdentifier\t" BUILTIN_SCREEN_NAME "\n" \
12 + "\tDevice\t" BUILTIN_DEVICE_NAME "\n" \
13 + "\tDefaultDepth\t24\n" \
14 + "EndSection\n\n"
15 +
16 #define BUILTIN_LAYOUT_SECTION_PRE \
17 "Section \"ServerLayout\"\n" \
18 "\tIdentifier\t\"Builtin Default Layout\"\n"
19 @@ -153,7 +160,11 @@ xf86AutoConfig(void)
20 for (p = deviceList; *p; p++) {
21 snprintf(buf, sizeof(buf), BUILTIN_DEVICE_SECTION, *p, 0, *p);
22 AppendToConfig(buf);
23 - snprintf(buf, sizeof(buf), BUILTIN_SCREEN_SECTION, *p, 0, *p, 0);
24 + if (strcmp(*p, "fglrx") == 0 || strcmp(*p, "nvidia") == 0)
25 + snprintf(buf, sizeof(buf), BUILTIN_SCREEN_SECTION_PROPRIETARY, *p,
26 + 0, *p, 0);
27 + else
28 + snprintf(buf, sizeof(buf), BUILTIN_SCREEN_SECTION, *p, 0, *p, 0);
29 AppendToConfig(buf);
30 }
31
32 diff --git a/hw/xfree86/common/xf86pciBus.c b/hw/xfree86/common/xf86pciBus.c
33 index e52f1da..bd62a7e 100644
34 --- a/hw/xfree86/common/xf86pciBus.c
35 +++ b/hw/xfree86/common/xf86pciBus.c
36 @@ -1107,7 +1107,8 @@ videoPtrToDriverList(struct pci_device *dev,
37 driverList[0] = "ast";
38 break;
39 case 0x1002:
40 - driverList[0] = "ati";
41 + driverList[0] = "fglrx";
42 + driverList[1] = "ati";
43 break;
44 case 0x102c:
45 driverList[0] = "chips";
46 @@ -1143,6 +1144,7 @@ videoPtrToDriverList(struct pci_device *dev,
47 {
48 int idx = 0;
49
50 + driverList[idx++] = "nvidia";
51 #ifdef __linux__
52 driverList[idx++] = "nouveau";
53 #endif