105_nvidia_fglrx_autodetect.patch 1.8 KB

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