ODROID-U3 xorg-server debian package fork :
[deb_xorg-server.git] / debian / patches / xf86-fixup-detection.patch
1 --- a/hw/xfree86/common/xf86pciBus.c
2 +++ b/hw/xfree86/common/xf86pciBus.c
3 @@ -546,6 +546,15 @@ xf86PciProbeDev(DriverPtr drvp)
4 for (k = 0; k < xf86NumEntities; k++) {
5 EntityPtr pEnt = xf86Entities[k];
6
7 +#ifdef XSERVER_PLATFORM_BUS
8 + if (pEnt->bus.type == BUS_PLATFORM &&
9 + pEnt->bus.id.plat->pdev &&
10 + MATCH_PCI_DEVICES(pEnt->bus.id.plat->pdev, pPci)) {
11 + foundScreen = TRUE;
12 + break;
13 + }
14 +#endif
15 +
16 if (pEnt->bus.type != BUS_PCI)
17 continue;
18 if (pEnt->bus.id.pci == pPci) {
19 --- a/hw/xfree86/common/xf86platformBus.c
20 +++ b/hw/xfree86/common/xf86platformBus.c
21 @@ -167,11 +167,12 @@ xf86_check_platform_slot(const struct xf
22 for (i = 0; i < xf86NumEntities; i++) {
23 const EntityPtr u = xf86Entities[i];
24
25 - if (pd->pdev && u->bus.type == BUS_PCI)
26 - return !MATCH_PCI_DEVICES(pd->pdev, u->bus.id.pci);
27 - if ((u->bus.type == BUS_PLATFORM) && (pd == u->bus.id.plat)) {
28 + if (pd->pdev && u->bus.type == BUS_PCI &&
29 + MATCH_PCI_DEVICES(pd->pdev, u->bus.id.pci))
30 + return FALSE;
31 +
32 + if ((u->bus.type == BUS_PLATFORM) && (pd == u->bus.id.plat))
33 return FALSE;
34 - }
35 }
36 return TRUE;
37 }
38 @@ -302,6 +303,11 @@ static Bool doPlatformProbe(struct xf86_
39 for (nent = 0; nent < xf86NumEntities; nent++) {
40 EntityPtr pEnt = xf86Entities[nent];
41
42 + if (dev->pdev && pEnt->bus.type == BUS_PCI &&
43 + MATCH_PCI_DEVICES(dev->pdev, pEnt->bus.id.pci)) {
44 + return FALSE;
45 + }
46 +
47 if (pEnt->bus.type != BUS_PLATFORM)
48 continue;
49 if (pEnt->bus.id.plat == dev) {
50 @@ -368,18 +374,15 @@ xf86platformProbeDev(DriverPtr drvp)
51 /* for non-seat0 servers assume first device is the master */
52 if (ServerIsNotSeat0())
53 break;
54 - if (xf86_platform_devices[j].pdev) {
55 - if (xf86IsPrimaryPlatform(&xf86_platform_devices[j]))
56 - break;
57 - }
58 - else {
59 + if (xf86IsPrimaryPlatform(&xf86_platform_devices[j]))
60 + break;
61 + else
62 /* there's no way to handle real platform devices at this point,
63 * as there's no valid busID to be used, so try to move forward
64 * in case there's only one platform device, and see if the
65 * driver's probe succeeds or not at least once */
66 if ((xf86_num_platform_devices == 1) && (!foundScreen))
67 break;
68 - }
69 }
70 }
71
72 @@ -398,6 +401,7 @@ xf86platformProbeDev(DriverPtr drvp)
73 }
74 }
75
76 + free(devList);
77 return foundScreen;
78 }
79