gnu: upower: Enable GObject introspection.
[jackhill/guix/guix.git] / gnu / packages / patches / xf86-video-sis-update-api.patch
CommitLineData
7007aeb2
MW
1Update xf86-video-sis to the current xorg-server API.
2
3Copied from: http://pkgs.fedoraproject.org/cgit/xorg-x11-drv-sis.git/tree/sis-0.10.7-git.patch?id=2705859f0ddc7ee7a3b07f21b442ebeab5df1276
4Commit log: http://pkgs.fedoraproject.org/cgit/xorg-x11-drv-sis.git/log/sis-0.10.7-git.patch
5
6Patch by Adam Jackson <ajax@redhat.com>
7
8diff --git a/src/sis.h b/src/sis.h
9index 46fca2a..20e6134 100644
10--- a/src/sis.h
11+++ b/src/sis.h
12@@ -75,7 +75,6 @@
13
14 #include "compiler.h"
15 #include "xf86Pci.h"
16-#include "xf86Priv.h"
17 #include "xf86_OSproc.h"
18 #if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 6
19 #include "xf86Resources.h"
20diff --git a/src/sis_driver.c b/src/sis_driver.c
21index 61e8075..0fd83d7 100644
22--- a/src/sis_driver.c
23+++ b/src/sis_driver.c
24@@ -57,7 +57,6 @@
25 #include "fb.h"
26 #include "micmap.h"
27 #include "mipointer.h"
28-#include "mibstore.h"
29 #include "edid.h"
30
31 #define SIS_NEED_inSISREG
32@@ -94,6 +93,10 @@
33 #include "dri.h"
34 #endif
35
36+#ifndef DEFAULT_DPI
37+#define DEFAULT_DPI 96
38+#endif
39+
40 /*
41 * LookupWindow was removed with video abi 11.
42 */
43@@ -7344,7 +7347,11 @@ SISUnmapMem(ScrnInfoPtr pScrn)
44 if(pSiSEnt->MapCountIOBase) {
45 pSiSEnt->MapCountIOBase--;
46 if((pSiSEnt->MapCountIOBase == 0) || (pSiSEnt->forceUnmapIOBase)) {
47+#ifndef XSERVER_LIBPCIACCESS
48 xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pSiSEnt->IOBase, (pSiS->mmioSize * 1024));
49+#else
50+ pci_device_unmap_range(pSiS->PciInfo, pSiSEnt->IOBase, (pSiS->mmioSize * 1024));
51+#endif
52 pSiSEnt->IOBase = NULL;
53 pSiSEnt->MapCountIOBase = 0;
54 pSiSEnt->forceUnmapIOBase = FALSE;
55@@ -7355,7 +7362,11 @@ SISUnmapMem(ScrnInfoPtr pScrn)
56 if(pSiSEnt->MapCountIOBaseDense) {
57 pSiSEnt->MapCountIOBaseDense--;
58 if((pSiSEnt->MapCountIOBaseDense == 0) || (pSiSEnt->forceUnmapIOBaseDense)) {
59+#ifndef XSERVER_LIBPCIACCESS
60 xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pSiSEnt->IOBaseDense, (pSiS->mmioSize * 1024));
61+#else
62+ pci_device_unmap_range(pSiS->PciInfo, (pointer)pSiSEnt->IOBaseDense, (pSiS->mmioSize * 1024));
63+#endif
64 pSiSEnt->IOBaseDense = NULL;
65 pSiSEnt->MapCountIOBaseDense = 0;
66 pSiSEnt->forceUnmapIOBaseDense = FALSE;
67@@ -7366,7 +7377,11 @@ SISUnmapMem(ScrnInfoPtr pScrn)
68 if(pSiSEnt->MapCountFbBase) {
69 pSiSEnt->MapCountFbBase--;
70 if((pSiSEnt->MapCountFbBase == 0) || (pSiSEnt->forceUnmapFbBase)) {
71+#ifndef XSERVER_LIBPCIACCESS
72 xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pSiSEnt->RealFbBase, pSiS->FbMapSize);
73+#else
74+ pci_device_unmap_range(pSiS->PciInfo, (pointer)pSiSEnt->RealFbBase, pSiS->FbMapSize);
75+#endif
76 pSiSEnt->FbBase = pSiSEnt->RealFbBase = NULL;
77 pSiSEnt->MapCountFbBase = 0;
78 pSiSEnt->forceUnmapFbBase = FALSE;
79@@ -7376,13 +7391,25 @@ SISUnmapMem(ScrnInfoPtr pScrn)
80 }
81 } else {
82 #endif
83+#ifndef XSERVER_LIBPCIACCESS
84 xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pSiS->IOBase, (pSiS->mmioSize * 1024));
85+#else
86+ pci_device_unmap_range(pSiS->PciInfo, (pointer)pSiS->IOBase, (pSiS->mmioSize * 1024));
87+#endif
88 pSiS->IOBase = NULL;
89 #ifdef __alpha__
90+#ifndef XSERVER_LIBPCIACCESS
91 xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pSiS->IOBaseDense, (pSiS->mmioSize * 1024));
92+#else
93+ pci_device_unmap_range(pSiS->PciInfo, (pointer)pSiS->IOBaseDense, (pSiS->mmioSize * 1024));
94+#endif
95 pSiS->IOBaseDense = NULL;
96 #endif
97+#ifndef XSERVER_LIBPCIACCESS
98 xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pSiS->RealFbBase, pSiS->FbMapSize);
99+#else
100+ pci_device_unmap_range(pSiS->PciInfo, (pointer)pSiS->RealFbBase, pSiS->FbMapSize);
101+#endif
102 pSiS->FbBase = pSiS->RealFbBase = NULL;
103 #ifdef SISDUALHEAD
104 }
105@@ -8859,7 +8886,6 @@ SISScreenInit(SCREEN_INIT_ARGS_DECL)
106 }
107 pSiS->SiSFastVidCopyDone = TRUE;
108
109- miInitializeBackingStore(pScreen);
110 xf86SetBackingStore(pScreen);
111 xf86SetSilkenMouse(pScreen);
112
113@@ -9352,7 +9378,14 @@ SISMergedPointerMoved(SCRN_ARG_TYPE arg, int x, int y)
114 }
115 if(doit) {
116 sigstate = xf86BlockSIGIO();
117-#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 15
118+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 18
119+ {
120+ double dx = x, dy = y;
121+ miPointerSetPosition(inputInfo.pointer, Absolute, &dx, &dy, NULL, NULL);
122+ x = (int)dx;
123+ y = (int)dy;
124+ }
125+#elif GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 15
126 {
127 double dx = x, dy = y;
128 miPointerSetPosition(inputInfo.pointer, Absolute, &dx, &dy);