git-fixes.patch 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390
  1. From 339fb3bc032b9f35b07b90480ae82a0fd352e078 Mon Sep 17 00:00:00 2001
  2. From: Jan Lindemann <jan@jannet.de>
  3. Date: Thu, 30 Aug 2012 18:09:10 +0000
  4. Subject: Replace xf86UnMapVidMem with pci_device_unmap_range
  5. Mixing pci_device_map_range with xf86UnMapVidMem doesn't work too well.
  6. X.Org bug#18028 <https://bugs.freedesktop.org/show_bug.cgi?id=18028>
  7. Bug found by Bryan Henderson <bryanh@giraffe-data.com>
  8. Signed-off-by: Julien Cristau <jcristau@debian.org>
  9. ---
  10. diff --git a/src/sis_driver.c b/src/sis_driver.c
  11. index 61e8075..4c9b9cb 100644
  12. --- a/src/sis_driver.c
  13. +++ b/src/sis_driver.c
  14. @@ -7344,7 +7344,11 @@ SISUnmapMem(ScrnInfoPtr pScrn)
  15. if(pSiSEnt->MapCountIOBase) {
  16. pSiSEnt->MapCountIOBase--;
  17. if((pSiSEnt->MapCountIOBase == 0) || (pSiSEnt->forceUnmapIOBase)) {
  18. +#ifndef XSERVER_LIBPCIACCESS
  19. xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pSiSEnt->IOBase, (pSiS->mmioSize * 1024));
  20. +#else
  21. + pci_device_unmap_range(pSiS->PciInfo, pSiSEnt->IOBase, (pSiS->mmioSize * 1024));
  22. +#endif
  23. pSiSEnt->IOBase = NULL;
  24. pSiSEnt->MapCountIOBase = 0;
  25. pSiSEnt->forceUnmapIOBase = FALSE;
  26. @@ -7355,7 +7359,11 @@ SISUnmapMem(ScrnInfoPtr pScrn)
  27. if(pSiSEnt->MapCountIOBaseDense) {
  28. pSiSEnt->MapCountIOBaseDense--;
  29. if((pSiSEnt->MapCountIOBaseDense == 0) || (pSiSEnt->forceUnmapIOBaseDense)) {
  30. +#ifndef XSERVER_LIBPCIACCESS
  31. xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pSiSEnt->IOBaseDense, (pSiS->mmioSize * 1024));
  32. +#else
  33. + pci_device_unmap_range(pSiS->PciInfo, (pointer)pSiSEnt->IOBaseDense, (pSiS->mmioSize * 1024));
  34. +#endif
  35. pSiSEnt->IOBaseDense = NULL;
  36. pSiSEnt->MapCountIOBaseDense = 0;
  37. pSiSEnt->forceUnmapIOBaseDense = FALSE;
  38. @@ -7366,7 +7374,11 @@ SISUnmapMem(ScrnInfoPtr pScrn)
  39. if(pSiSEnt->MapCountFbBase) {
  40. pSiSEnt->MapCountFbBase--;
  41. if((pSiSEnt->MapCountFbBase == 0) || (pSiSEnt->forceUnmapFbBase)) {
  42. +#ifndef XSERVER_LIBPCIACCESS
  43. xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pSiSEnt->RealFbBase, pSiS->FbMapSize);
  44. +#else
  45. + pci_device_unmap_range(pSiS->PciInfo, (pointer)pSiSEnt->RealFbBase, pSiS->FbMapSize);
  46. +#endif
  47. pSiSEnt->FbBase = pSiSEnt->RealFbBase = NULL;
  48. pSiSEnt->MapCountFbBase = 0;
  49. pSiSEnt->forceUnmapFbBase = FALSE;
  50. @@ -7376,13 +7388,25 @@ SISUnmapMem(ScrnInfoPtr pScrn)
  51. }
  52. } else {
  53. #endif
  54. +#ifndef XSERVER_LIBPCIACCESS
  55. xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pSiS->IOBase, (pSiS->mmioSize * 1024));
  56. +#else
  57. + pci_device_unmap_range(pSiS->PciInfo, (pointer)pSiS->IOBase, (pSiS->mmioSize * 1024));
  58. +#endif
  59. pSiS->IOBase = NULL;
  60. #ifdef __alpha__
  61. +#ifndef XSERVER_LIBPCIACCESS
  62. xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pSiS->IOBaseDense, (pSiS->mmioSize * 1024));
  63. +#else
  64. + pci_device_unmap_range(pSiS->PciInfo, (pointer)pSiS->IOBaseDense, (pSiS->mmioSize * 1024));
  65. +#endif
  66. pSiS->IOBaseDense = NULL;
  67. #endif
  68. +#ifndef XSERVER_LIBPCIACCESS
  69. xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pSiS->RealFbBase, pSiS->FbMapSize);
  70. +#else
  71. + pci_device_unmap_range(pSiS->PciInfo, (pointer)pSiS->RealFbBase, pSiS->FbMapSize);
  72. +#endif
  73. pSiS->FbBase = pSiS->RealFbBase = NULL;
  74. #ifdef SISDUALHEAD
  75. }
  76. --
  77. cgit v0.9.0.2-2-gbebe
  78. From 926d4f655c8491b68a338f50c810f6729686ec9f Mon Sep 17 00:00:00 2001
  79. From: Adam Jackson <ajax@redhat.com>
  80. Date: Tue, 25 Sep 2012 12:54:51 +0000
  81. Subject: Remove mibstore.h
  82. Signed-off-by: Adam Jackson <ajax@redhat.com>
  83. ---
  84. diff --git a/src/sis_driver.c b/src/sis_driver.c
  85. index 4c9b9cb..46cfefd 100644
  86. --- a/src/sis_driver.c
  87. +++ b/src/sis_driver.c
  88. @@ -57,7 +57,6 @@
  89. #include "fb.h"
  90. #include "micmap.h"
  91. #include "mipointer.h"
  92. -#include "mibstore.h"
  93. #include "edid.h"
  94. #define SIS_NEED_inSISREG
  95. @@ -8883,7 +8882,6 @@ SISScreenInit(SCREEN_INIT_ARGS_DECL)
  96. }
  97. pSiS->SiSFastVidCopyDone = TRUE;
  98. - miInitializeBackingStore(pScreen);
  99. xf86SetBackingStore(pScreen);
  100. xf86SetSilkenMouse(pScreen);
  101. --
  102. cgit v0.9.0.2-2-gbebe
  103. From 7d4402786b758de3e6ce2641e15a39d612d5c518 Mon Sep 17 00:00:00 2001
  104. From: Adam Jackson <ajax@redhat.com>
  105. Date: Mon, 15 Oct 2012 23:11:30 +0000
  106. Subject: Stop including xf86Priv.h
  107. As the name might suggest, it's server-private.
  108. Signed-off-by: Adam Jackson <ajax@redhat.com>
  109. ---
  110. diff --git a/src/sis.h b/src/sis.h
  111. index 46fca2a..20e6134 100644
  112. --- a/src/sis.h
  113. +++ b/src/sis.h
  114. @@ -75,7 +75,6 @@
  115. #include "compiler.h"
  116. #include "xf86Pci.h"
  117. -#include "xf86Priv.h"
  118. #include "xf86_OSproc.h"
  119. #if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 6
  120. #include "xf86Resources.h"
  121. diff --git a/src/sis_driver.c b/src/sis_driver.c
  122. index 46cfefd..cefe503 100644
  123. --- a/src/sis_driver.c
  124. +++ b/src/sis_driver.c
  125. @@ -93,6 +93,10 @@
  126. #include "dri.h"
  127. #endif
  128. +#ifndef DEFAULT_DPI
  129. +#define DEFAULT_DPI 96
  130. +#endif
  131. +
  132. /*
  133. * LookupWindow was removed with video abi 11.
  134. */
  135. --
  136. cgit v0.9.0.2-2-gbebe
  137. From 0a4336efaafac4c34d4287b5df586bbb418f7f76 Mon Sep 17 00:00:00 2001
  138. From: Alan Coopersmith <alan.coopersmith@oracle.com>
  139. Date: Sat, 26 Oct 2013 14:27:17 -0700
  140. Subject: Fix HDisplay/VDisplay typos
  141. Found by gcc -Wlogicalops:
  142. sis_driver.c: In function 'SiS_CheckModeCRT2':
  143. sis_driver.c:13754:5: warning: logical 'and' of mutually exclusive tests is always false [-Wlogical-op]
  144. sis_driver.c:13755:6: warning: logical 'and' of mutually exclusive tests is always false [-Wlogical-op]
  145. sis_driver.c:13756:6: warning: logical 'and' of mutually exclusive tests is always false [-Wlogical-op]
  146. sis_driver.c:13758:5: warning: logical 'and' of mutually exclusive tests is always false [-Wlogical-op]
  147. sis_driver.c:13759:6: warning: logical 'and' of mutually exclusive tests is always false [-Wlogical-op]
  148. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
  149. Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
  150. diff --git a/src/sis_driver.c b/src/sis_driver.c
  151. index cefe503..80b8d51 100644
  152. --- a/src/sis_driver.c
  153. +++ b/src/sis_driver.c
  154. @@ -13751,12 +13751,12 @@ SiS_CheckModeCRT2(ScrnInfoPtr pScrn, DisplayModePtr mode, unsigned int VBFlags,
  155. if( ((mode->HDisplay <= pSiS->LCDwidth) &&
  156. (mode->VDisplay <= pSiS->LCDheight)) ||
  157. ((pSiS->SiS_Pr->SiS_CustomT == CUT_PANEL848) &&
  158. - (((mode->HDisplay == 1360) && (mode->HDisplay == 768)) ||
  159. - ((mode->HDisplay == 1024) && (mode->HDisplay == 768)) ||
  160. - ((mode->HDisplay == 800) && (mode->HDisplay == 600)))) ||
  161. + (((mode->HDisplay == 1360) && (mode->VDisplay == 768)) ||
  162. + ((mode->HDisplay == 1024) && (mode->VDisplay == 768)) ||
  163. + ((mode->HDisplay == 800) && (mode->VDisplay == 600)))) ||
  164. ((pSiS->SiS_Pr->SiS_CustomT == CUT_PANEL856) &&
  165. - (((mode->HDisplay == 1024) && (mode->HDisplay == 768)) ||
  166. - ((mode->HDisplay == 800) && (mode->HDisplay == 600)))) ) {
  167. + (((mode->HDisplay == 1024) && (mode->VDisplay == 768)) ||
  168. + ((mode->HDisplay == 800) && (mode->VDisplay == 600)))) ) {
  169. ModeIndex = SiS_GetModeID_LCD(pSiS->VGAEngine, VBFlags, mode->HDisplay, mode->VDisplay, i,
  170. pSiS->FSTN, pSiS->SiS_Pr->SiS_CustomT, pSiS->LCDwidth, pSiS->LCDheight,
  171. --
  172. cgit v0.10.2
  173. From 49796d6a3274adc0250ee07faa6bc63e41c98740 Mon Sep 17 00:00:00 2001
  174. From: Peter Hutterer <peter.hutterer@who-t.net>
  175. Date: Fri, 22 Nov 2013 08:21:18 +1000
  176. Subject: Fix format-security warnings
  177. sis_driver.c: In function 'SISErrorLog':
  178. sis_driver.c:432:5: error: format not a string literal and no format arguments [-Werror=format-security]
  179. xf86DrvMsg(pScrn->scrnIndex, X_ERROR, str);
  180. ^
  181. sis_driver.c:439:5: error: format not a string literal and no format arguments [-Werror=format-security]
  182. xf86DrvMsg(pScrn->scrnIndex, X_ERROR, str);
  183. ^
  184. sis_driver.c: In function 'SiSUpdateXineramaScreenInfo':
  185. sis_driver.c:1917:4: error: format not a string literal and no format arguments [-Werror=format-security]
  186. xf86DrvMsg(pScrn1->scrnIndex, X_INFO, rectxine);
  187. ^
  188. sis_driver.c:1924:8: error: format not a string literal and no format arguments [-Werror=format-security]
  189. xf86DrvMsg(pScrn1->scrnIndex, X_INFO, rectxine);
  190. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
  191. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
  192. diff --git a/src/sis_driver.c b/src/sis_driver.c
  193. index 80b8d51..bd9c4e1 100644
  194. --- a/src/sis_driver.c
  195. +++ b/src/sis_driver.c
  196. @@ -429,14 +429,14 @@ SISErrorLog(ScrnInfoPtr pScrn, const char *format, ...)
  197. static const char *str = "**************************************************\n";
  198. va_start(ap, format);
  199. - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, str);
  200. + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "%s", str);
  201. xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
  202. " ERROR:\n");
  203. xf86VDrvMsgVerb(pScrn->scrnIndex, X_ERROR, 1, format, ap);
  204. va_end(ap);
  205. xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
  206. " END OF MESSAGE\n");
  207. - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, str);
  208. + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "%s", str);
  209. }
  210. static void
  211. @@ -1914,14 +1914,14 @@ SiSUpdateXineramaScreenInfo(ScrnInfoPtr pScrn1)
  212. if(infochanged && !usenonrect) {
  213. xf86DrvMsg(pScrn1->scrnIndex, X_INFO,
  214. "Virtual screen size does not match maximum display modes...\n");
  215. - xf86DrvMsg(pScrn1->scrnIndex, X_INFO, rectxine);
  216. + xf86DrvMsg(pScrn1->scrnIndex, X_INFO, "%s", rectxine);
  217. }
  218. } else if(infochanged && usenonrect) {
  219. usenonrect = FALSE;
  220. xf86DrvMsg(pScrn1->scrnIndex, X_INFO,
  221. "Only clone modes available for this virtual screen size...\n");
  222. - xf86DrvMsg(pScrn1->scrnIndex, X_INFO, rectxine);
  223. + xf86DrvMsg(pScrn1->scrnIndex, X_INFO, "%s", rectxine);
  224. }
  225. if(pSiS->maxCRT1_X1) { /* Means we have at least one non-clone mode */
  226. --
  227. cgit v0.10.2
  228. From d0550de19cacab3e591641ba358a72fbc798b231 Mon Sep 17 00:00:00 2001
  229. From: Dave Airlie <airlied@redhat.com>
  230. Date: Mon, 22 Sep 2014 12:45:02 +1000
  231. Subject: sis: fix build against latest xserver
  232. diff --git a/src/sis.h b/src/sis.h
  233. index 20e6134..385b784 100644
  234. --- a/src/sis.h
  235. +++ b/src/sis.h
  236. @@ -1004,7 +1004,9 @@ typedef struct {
  237. ScrnInfoPtr pScrn;
  238. pciVideoPtr PciInfo;
  239. int PciBus, PciDevice, PciFunc;
  240. +#ifndef XSERVER_LIBPCIACCESS
  241. PCITAG PciTag;
  242. +#endif
  243. EntityInfoPtr pEnt;
  244. int Chipset;
  245. unsigned char ChipType;
  246. diff --git a/src/vstruct.h b/src/vstruct.h
  247. index 88f7eb6..5d7a98d 100644
  248. --- a/src/vstruct.h
  249. +++ b/src/vstruct.h
  250. @@ -237,8 +237,10 @@ struct SiS_Private
  251. unsigned char ChipType;
  252. unsigned char ChipRevision;
  253. #ifdef SIS_XORG_XF86
  254. +#ifndef XSERVER_LIBPCIACCESS
  255. PCITAG PciTag;
  256. #endif
  257. +#endif
  258. #ifdef SIS_LINUX_KERNEL
  259. void *ivideo;
  260. #endif
  261. --
  262. cgit v0.10.2
  263. From d2597696ba81862d80ec17b978d8370c58572e27 Mon Sep 17 00:00:00 2001
  264. From: Dave Airlie <airlied@redhat.com>
  265. Date: Wed, 12 Nov 2014 08:04:21 +1000
  266. Subject: sis: more build fixes against master X server.
  267. diff --git a/src/sis_driver.c b/src/sis_driver.c
  268. index bd9c4e1..125eee7 100644
  269. --- a/src/sis_driver.c
  270. +++ b/src/sis_driver.c
  271. @@ -3279,9 +3279,11 @@ SISPreInit(ScrnInfoPtr pScrn, int flags)
  272. pSiS->PciDevice = PCI_CFG_DEV(pSiS->PciInfo); /*SIS_PCI_DEVICE(pSiS->PciInfo);*/
  273. pSiS->PciFunc = PCI_CFG_FUNC(pSiS->PciInfo); /*SIS_PCI_FUNC(pSiS->PciInfo);*/
  274. +#ifndef XSERVER_LIBPCIACCESS
  275. pSiS->PciTag = pciTag(PCI_DEV_BUS(pSiS->PciInfo),
  276. PCI_DEV_DEV(pSiS->PciInfo),
  277. PCI_DEV_FUNC(pSiS->PciInfo));
  278. +#endif
  279. #ifdef SIS_NEED_MAP_IOP
  280. /********************************************/
  281. @@ -3905,7 +3907,9 @@ SISPreInit(ScrnInfoPtr pScrn, int flags)
  282. if(pSiSEnt) pSiSEnt->SiS_Pr = pSiS->SiS_Pr;
  283. #endif
  284. memset(pSiS->SiS_Pr, 0, sizeof(struct SiS_Private));
  285. +#ifndef XSERVER_LIBPCIACCESS
  286. pSiS->SiS_Pr->PciTag = pSiS->PciTag;
  287. +#endif
  288. pSiS->SiS_Pr->ChipType = pSiS->ChipType;
  289. pSiS->SiS_Pr->ChipRevision = pSiS->ChipRev;
  290. pSiS->SiS_Pr->SiS_Backup70xx = 0xff;
  291. @@ -7134,7 +7138,9 @@ static Bool
  292. SISMapMem(ScrnInfoPtr pScrn)
  293. {
  294. SISPtr pSiS = SISPTR(pScrn);
  295. +#ifndef XSERVER_LIBPCIACCESS
  296. int mmioFlags = VIDMEM_MMIO;
  297. +#endif
  298. #ifdef SISDUALHEAD
  299. SISEntPtr pSiSEnt = pSiS->entityPrivate;
  300. #endif
  301. @@ -7144,9 +7150,11 @@ SISMapMem(ScrnInfoPtr pScrn)
  302. * (For Alpha, we need to map SPARSE memory, since we need
  303. * byte/short access.)
  304. */
  305. +#ifndef XSERVER_LIBPCIACCESS
  306. #if defined(__alpha__)
  307. mmioFlags |= VIDMEM_SPARSE;
  308. #endif
  309. +#endif
  310. #ifdef SISDUALHEAD
  311. if(pSiS->DualHeadMode) {
  312. @@ -14017,6 +14025,7 @@ SiS_GetSetBIOSScratch(ScrnInfoPtr pScrn, UShort offset, UChar value)
  313. break;
  314. }
  315. +#ifndef XSERVER_LIBPCIACCESS
  316. #ifdef SIS_USE_BIOS_SCRATCH
  317. if(SISPTR(pScrn)->Primary) {
  318. base = xf86MapVidMem(pScrn->scrnIndex, VIDMEM_MMIO, 0, 0x2000);
  319. @@ -14035,6 +14044,7 @@ SiS_GetSetBIOSScratch(ScrnInfoPtr pScrn, UShort offset, UChar value)
  320. xf86UnMapVidMem(pScrn->scrnIndex, base, 0x2000);
  321. }
  322. #endif
  323. +#endif
  324. return ret;
  325. }
  326. --
  327. cgit v0.10.2
  328. From 0f50f8c3db2b9f1c9d4ecab8ad278e9db6418a92 Mon Sep 17 00:00:00 2001
  329. From: Dave Airlie <airlied@redhat.com>
  330. Date: Wed, 12 Nov 2014 09:27:33 +1000
  331. Subject: sis: force build, who uses this crazy code anyways
  332. diff --git a/src/sis_driver.c b/src/sis_driver.c
  333. index 125eee7..854cb54 100644
  334. --- a/src/sis_driver.c
  335. +++ b/src/sis_driver.c
  336. @@ -9385,6 +9385,7 @@ SISMergedPointerMoved(SCRN_ARG_TYPE arg, int x, int y)
  337. }
  338. }
  339. if(doit) {
  340. +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 20 /* screw it */
  341. sigstate = xf86BlockSIGIO();
  342. #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 15
  343. {
  344. @@ -9402,6 +9403,7 @@ SISMergedPointerMoved(SCRN_ARG_TYPE arg, int x, int y)
  345. miPointerAbsoluteCursor(x, y, currentTime.milliseconds);
  346. #endif
  347. xf86UnblockSIGIO(sigstate);
  348. +#endif
  349. return;
  350. }
  351. }
  352. --
  353. cgit v0.10.2