patch-hw_xfree86_os-support_linux_lnx_video_c 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. Enable the ioBase mapping code for mips, too. This is needed by
  2. xf86-video-siliconmotion.
  3. --- xorg-server-1.7.6.orig/hw/xfree86/os-support/linux/lnx_video.c 2010-03-12 05:38:22.000000000 +0100
  4. +++ xorg-server-1.7.6/hw/xfree86/os-support/linux/lnx_video.c 2010-06-05 21:46:29.659792653 +0200
  5. @@ -485,7 +485,7 @@ unmapVidMem(int ScreenNum, pointer Base,
  6. /* I/O Permissions section */
  7. /***************************************************************************/
  8. -#if defined(__powerpc__)
  9. +#if defined(__powerpc__) || defined(__mips__)
  10. volatile unsigned char *ioBase = NULL;
  11. #ifndef __NR_pciconfig_iobase
  12. @@ -497,7 +497,7 @@ volatile unsigned char *ioBase = NULL;
  13. Bool
  14. xf86EnableIO(void)
  15. {
  16. -#if defined(__powerpc__)
  17. +#if defined(__powerpc__) || defined(__mips__)
  18. int fd;
  19. unsigned int ioBase_phys;
  20. #endif
  21. @@ -505,8 +505,12 @@ xf86EnableIO(void)
  22. if (ExtendedEnabled)
  23. return TRUE;
  24. -#if defined(__powerpc__)
  25. +#if defined(__powerpc__) || defined(__mips__)
  26. +#ifdef __powerpc__
  27. ioBase_phys = syscall(__NR_pciconfig_iobase, 2, 0, 0);
  28. +#else
  29. + ioBase_phys = 0x1fd00000;
  30. +#endif
  31. fd = open("/dev/mem", O_RDWR);
  32. if (ioBase == NULL) {
  33. @@ -522,9 +526,10 @@ xf86EnableIO(void)
  34. return FALSE;
  35. }
  36. #endif
  37. + xf86Msg(X_INFO,"ioBase 0x%lx\n", (unsigned long)ioBase);
  38. }
  39. close(fd);
  40. -#elif !defined(__mc68000__) && !defined(__sparc__) && !defined(__mips__) && !defined(__sh__) && !defined(__hppa__) && !defined(__s390__) && !defined(__arm__) && !defined(__m32r__)
  41. +#elif !defined(__mc68000__) && !defined(__sparc__) && !defined(__sh__) && !defined(__hppa__) && !defined(__s390__) && !defined(__arm__) && !defined(__m32r__)
  42. if (ioperm(0, 1024, 1) || iopl(3)) {
  43. if (errno == ENODEV)
  44. ErrorF("xf86EnableIOPorts: no I/O ports found\n");
  45. @@ -548,10 +553,10 @@ xf86DisableIO(void)
  46. {
  47. if (!ExtendedEnabled)
  48. return;
  49. -#if defined(__powerpc__)
  50. +#if defined(__powerpc__) || defined(__mips__)
  51. munmap(ioBase, 0x20000);
  52. ioBase = NULL;
  53. -#elif !defined(__mc68000__) && !defined(__sparc__) && !defined(__mips__) && !defined(__sh__) && !defined(__hppa__) && !defined(__arm__) && !defined(__s390__) && !defined(__m32r__)
  54. +#elif !defined(__mc68000__) && !defined(__sparc__) && !defined(__sh__) && !defined(__hppa__) && !defined(__arm__) && !defined(__s390__) && !defined(__m32r__)
  55. iopl(0);
  56. ioperm(0, 1024, 0);
  57. #endif