summaryrefslogtreecommitdiff
path: root/extra/xorg-server/loongson.patch
diff options
context:
space:
mode:
Diffstat (limited to 'extra/xorg-server/loongson.patch')
-rw-r--r--extra/xorg-server/loongson.patch56
1 files changed, 56 insertions, 0 deletions
diff --git a/extra/xorg-server/loongson.patch b/extra/xorg-server/loongson.patch
new file mode 100644
index 000000000..632753873
--- /dev/null
+++ b/extra/xorg-server/loongson.patch
@@ -0,0 +1,56 @@
+diff -ru xorg-server-1.14.0.orig/hw/xfree86/dri/sarea.h xorg-server-1.14.0/hw/xfree86/dri/sarea.h
+--- xorg-server-1.14.0.orig/hw/xfree86/dri/sarea.h 2013-03-19 13:50:10.838242935 +0100
++++ xorg-server-1.14.0/hw/xfree86/dri/sarea.h 2013-03-19 13:50:39.129859642 +0100
+@@ -41,6 +41,8 @@
+ /* SAREA area needs to be at least a page */
+ #if defined(__alpha__)
+ #define SAREA_MAX 0x2000
++#elif defined(__mips__)
++#define SAREA_MAX 0x4000
+ #elif defined(__ia64__)
+ #define SAREA_MAX 0x10000 /* 64kB */
+ #else
+diff -ru xorg-server-1.14.0.orig/hw/xfree86/os-support/linux/lnx_video.c xorg-server-1.14.0/hw/xfree86/os-support/linux/lnx_video.c
+--- xorg-server-1.14.0.orig/hw/xfree86/os-support/linux/lnx_video.c 2013-03-19 13:50:10.869508709 +0100
++++ xorg-server-1.14.0/hw/xfree86/os-support/linux/lnx_video.c 2013-03-19 14:02:26.536090562 +0100
+@@ -503,6 +503,40 @@
+ ioBase = NULL;
+ }
+
++#elif defined(__mips__)
++
++extern unsigned int IOPortBase;
++
++static Bool
++hwEnableIO(void)
++{
++ int fd;
++
++ fd = open("/dev/mem", O_RDWR);
++ IOPortBase = (volatile unsigned char *)mmap(0, 0x20000,
++ PROT_READ | PROT_WRITE, MAP_SHARED, fd,
++ 0x1fd00000);
++ if (IOPortBase == MAP_FAILED) {
++ xf86Msg(X_WARNING,
++ "xf86EnableIOPorts: Failed to map iobase (%s)\n",
++ strerror(errno));
++ return FALSE;
++ }
++ close(fd);
++ xf86Msg(X_WARNING,
++ "xf86EnableIOPorts: map iobase (%x)\n",
++ IOPortBase);
++
++ return IOPortBase != MAP_FAILED;
++}
++
++static void
++hwDisableIO(void)
++{
++ munmap(IOPortBase, 0x20000);
++ IOPortBase = NULL;
++}
++
+ #elif defined(__i386__) || defined(__x86_64__) || defined(__ia64__) || \
+ defined(__alpha__)
+