xserver-xorg-video-sisusb: Changes to 'upstream-unstable'
.gitignore | 70 +++++++++++++++++++++++++++++++++++++++----
COPYING | 58 ++++++++++++++++++++++++++++++-----
ChangeLog | 57 -----------------------------------
Makefile.am | 11 ++++++
configure.ac | 50 ++++++++++++++----------------
man/.gitignore | 2 -
man/Makefile.am | 75 ++++++++++++----------------------------------
man/sisusb.man | 20 +-----------
src/.gitignore | 6 ---
src/sisusb.h | 11 +++++-
src/sisusb_dac.c | 16 ++++-----
src/sisusb_driver.c | 83 +++++++++++++++++++++++++--------------------------
src/sisusb_init.c | 6 +--
src/sisusb_opt.c | 2 -
src/sisusb_osdef.h | 12 +++----
src/sisusb_types.h | 4 +-
src/sisusb_utility.c | 48 ++++++++++++++---------------
src/sisusb_video.c | 6 +--
18 files changed, 268 insertions(+), 269 deletions(-)
New commits:
commit 02451944ba73887db9803f44a1826059d9105963
Author: Jeremy Huddleston <jeremyhu@apple.com>
Date: Tue Nov 1 23:05:45 2011 -0700
Build fix for -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
diff --git a/src/sisusb_dac.c b/src/sisusb_dac.c
index 5e3eb7f..b5c4dce 100644
--- a/src/sisusb_dac.c
+++ b/src/sisusb_dac.c
@@ -672,7 +672,7 @@ SiSUSBMemCopyToVideoRam(SISUSBPtr pSiSUSB, UChar *to, UChar *from, int size)
int num, retry = 3;
if(pSiSUSB->sisusbfatalerror) return;
do {
- lseek(pSiSUSB->sisusbdev, (int)to, SEEK_SET);
+ lseek(pSiSUSB->sisusbdev, (uintptr_t)to, SEEK_SET);
num = write(pSiSUSB->sisusbdev, from, size);
} while((num != size) && --retry);
if(!retry) SiSLostConnection(pSiSUSB);
@@ -958,7 +958,7 @@ void sisclearvram(SISUSBPtr pSiSUSB, UChar *where, unsigned int howmuch)
if(pSiSUSB->sisusbfatalerror) return;
do {
x.operation = SUCMD_CLRSCR;
- x.data3 = (CARD32)where;
+ x.data3 = (CARD32)(uintptr_t)where;
x.data0 = (howmuch >> 16) & 0xff;
x.data1 = (howmuch >> 8) & 0xff;
x.data2 = howmuch & 0xff;
@@ -990,7 +990,7 @@ void SIS_MMIO_OUT8(SISUSBPtr pSiSUSB, UChar *base, unsigned int offset, CARD8 va
int num, retry = 3;
if(pSiSUSB->sisusbfatalerror) return;
do {
- lseek(pSiSUSB->sisusbdev, (int)base + offset, SEEK_SET);
+ lseek(pSiSUSB->sisusbdev, (uintptr_t)base + offset, SEEK_SET);
num = write(pSiSUSB->sisusbdev, &val, 1);
} while((num != 1) && --retry);
if(!retry) SiSLostConnection(pSiSUSB);
@@ -1002,7 +1002,7 @@ void SIS_MMIO_OUT16(SISUSBPtr pSiSUSB, UChar *base, unsigned int offset, CARD16
CARD16 buf = sisusb_cpu_to_le16(val);
if(pSiSUSB->sisusbfatalerror) return;
do {
- lseek(pSiSUSB->sisusbdev, (int)base + offset, SEEK_SET);
+ lseek(pSiSUSB->sisusbdev, (uintptr_t)base + offset, SEEK_SET);
num = write(pSiSUSB->sisusbdev, &buf, 2);
} while((num != 2) && --retry);
if(!retry) SiSLostConnection(pSiSUSB);
@@ -1014,7 +1014,7 @@ void SIS_MMIO_OUT32(SISUSBPtr pSiSUSB, UChar *base, unsigned int offset, CARD32
CARD32 buf = sisusb_cpu_to_le32(val);
if(pSiSUSB->sisusbfatalerror) return;
do {
- lseek(pSiSUSB->sisusbdev, (int)base + offset, SEEK_SET);
+ lseek(pSiSUSB->sisusbdev, (uintptr_t)base + offset, SEEK_SET);
num = write(pSiSUSB->sisusbdev, &buf, 4);
} while((num != 4) && --retry);
if(!retry) SiSLostConnection(pSiSUSB);
@@ -1026,7 +1026,7 @@ CARD8 SIS_MMIO_IN8(SISUSBPtr pSiSUSB, UChar *base, unsigned int offset)
CARD8 tmp;
if(pSiSUSB->sisusbfatalerror) return 0;
do {
- lseek(pSiSUSB->sisusbdev, (int)base + offset, SEEK_SET);
+ lseek(pSiSUSB->sisusbdev, (uintptr_t)base + offset, SEEK_SET);
num = read(pSiSUSB->sisusbdev, &tmp, 1);
} while((num != 1) && --retry);
if(!retry) SiSLostConnection(pSiSUSB);
@@ -1039,7 +1039,7 @@ CARD16 SIS_MMIO_IN16(SISUSBPtr pSiSUSB, UChar *base, unsigned int offset)
CARD16 tmp;
if(pSiSUSB->sisusbfatalerror) return 0;
do {
- lseek(pSiSUSB->sisusbdev, (int)base + offset, SEEK_SET);
+ lseek(pSiSUSB->sisusbdev, (uintptr_t)base + offset, SEEK_SET);
num = read(pSiSUSB->sisusbdev, &tmp, 2);
} while((num != 2) && --retry);
if(!retry) SiSLostConnection(pSiSUSB);
@@ -1052,7 +1052,7 @@ CARD32 SIS_MMIO_IN32(SISUSBPtr pSiSUSB, UChar *base, unsigned int offset)
CARD32 tmp;
if(pSiSUSB->sisusbfatalerror) return 0;
do {
- lseek(pSiSUSB->sisusbdev, (int)base + offset, SEEK_SET);
+ lseek(pSiSUSB->sisusbdev, (uintptr_t)base + offset, SEEK_SET);
num = read(pSiSUSB->sisusbdev, &tmp, 4);
} while((num != 4) && --retry);
if(!retry) SiSLostConnection(pSiSUSB);
diff --git a/src/sisusb_driver.c b/src/sisusb_driver.c
index 4531e1a..032225c 100644
--- a/src/sisusb_driver.c
+++ b/src/sisusb_driver.c
@@ -1456,8 +1456,8 @@ SISUSBMapMem(ScrnInfoPtr pScrn)
{
SISUSBPtr pSiSUSB = SISUSBPTR(pScrn);
- pSiSUSB->FbBase = (UChar *)pSiSUSB->FbAddress;
- pSiSUSB->IOBase = (UChar *)pSiSUSB->IOAddress;
+ pSiSUSB->FbBase = (UChar *)(uintptr_t)pSiSUSB->FbAddress;
+ pSiSUSB->IOBase = (UChar *)(uintptr_t)pSiSUSB->IOAddress;
return TRUE;
}
commit 2901c9cf5e842cef199676e76cd0ffa532a76a9b
Author: Jeremy Huddleston <jeremyhu@apple.com>
Date: Tue Nov 1 22:57:33 2011 -0700
Use unsigned long rather than deprecated IOADDRESS
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
diff --git a/src/sisusb.h b/src/sisusb.h
index 1036d42..82ed509 100644
--- a/src/sisusb.h
+++ b/src/sisusb.h
@@ -739,7 +739,7 @@ typedef struct {
Bool skipswitchcheck;
ULong VBFlagsInit;
DisplayModePtr currentModeLast;
- IOADDRESS MyPIOOffset;
+ unsigned long MyPIOOffset;
char messagebuffer[64];
unsigned int VGAMapSize; /* SiSVGA stuff */
diff --git a/src/sisusb_osdef.h b/src/sisusb_osdef.h
index 2d938ad..500bffb 100644
--- a/src/sisusb_osdef.h
+++ b/src/sisusb_osdef.h
@@ -77,11 +77,11 @@
#define SIS315H
-#define OutPortByte(p,v) outSISREG((IOADDRESS)(p),(CARD8)(v))
-#define OutPortWord(p,v) outSISREGW((IOADDRESS)(p),(CARD16)(v))
-#define OutPortLong(p,v) outSISREGL((IOADDRESS)(p),(CARD32)(v))
-#define InPortByte(p) inSISREG((IOADDRESS)(p))
-#define InPortWord(p) inSISREGW((IOADDRESS)(p))
-#define InPortLong(p) inSISREGL((IOADDRESS)(p))
+#define OutPortByte(p,v) outSISREG((unsigned long)(p),(CARD8)(v))
+#define OutPortWord(p,v) outSISREGW((unsigned long)(p),(CARD16)(v))
+#define OutPortLong(p,v) outSISREGL((unsigned long)(p),(CARD32)(v))
+#define InPortByte(p) inSISREG((unsigned long)(p))
+#define InPortWord(p) inSISREGW((unsigned long)(p))
+#define InPortLong(p) inSISREGL((unsigned long)(p))
#endif /* _SISUSB_OSDEF_H_ */
diff --git a/src/sisusb_types.h b/src/sisusb_types.h
index df3618f..9fc6b41 100644
--- a/src/sisusb_types.h
+++ b/src/sisusb_types.h
@@ -95,7 +95,7 @@ typedef unsigned char BOOLEAN;
#define SISIOMEMTYPE
-typedef IOADDRESS SISIOADDRESS;
+typedef unsigned long SISIOADDRESS;
typedef enum _SIS_CHIP_TYPE {
SIS_VGALegacy = 0,
commit 6272e69d8519c43293192b48ff39c8b3a84635d3
Author: Jeremy Huddleston <jeremyhu@apple.com>
Date: Fri Oct 7 12:45:00 2011 -0700
Fix build failures with recent server changes to swapl and swaps
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
diff --git a/src/sisusb.h b/src/sisusb.h
index fbbebc5..1036d42 100644
--- a/src/sisusb.h
+++ b/src/sisusb.h
@@ -113,6 +113,14 @@
#include <X11/extensions/Xv.h>
#endif
+#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 12
+#define _swapl(x, n) swapl(x,n)
+#define _swaps(x, n) swaps(x,n)
+#else
+#define _swapl(x, n) swapl(x)
+#define _swaps(x, n) swaps(x)
+#endif
+
/* Platform/architecture related definitions: */
#undef SIS_PC_PLATFORM
diff --git a/src/sisusb_utility.c b/src/sisusb_utility.c
index 282f372..a9c1ee1 100644
--- a/src/sisusb_utility.c
+++ b/src/sisusb_utility.c
@@ -787,10 +787,10 @@ SiSUSBProcSiSCtrlQueryVersion(ClientPtr client)
rep.majorVersion = SISCTRL_MAJOR_VERSION;
rep.minorVersion = SISCTRL_MINOR_VERSION;
if(client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swaps(&rep.majorVersion, n);
- swaps(&rep.minorVersion, n);
+ _swaps(&rep.sequenceNumber, n);
+ _swapl(&rep.length, n);
+ _swaps(&rep.majorVersion, n);
+ _swaps(&rep.minorVersion, n);
}
WriteToClient(client, sizeof(xSiSCtrlQueryVersionReply), (char *)&rep);
return (client->noClientException);
@@ -832,15 +832,15 @@ SiSUSBProcSiSCtrlCommand(ClientPtr client)
rep.sequenceNumber = client->sequence;
if(client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.screen, n);
- swapl(&rep.sdc_id, n);
- swapl(&rep.sdc_command, n);
- swapl(&rep.sdc_result_header, n);
+ _swaps(&rep.sequenceNumber, n);
+ _swapl(&rep.length, n);
+ _swapl(&rep.screen, n);
+ _swapl(&rep.sdc_id, n);
+ _swapl(&rep.sdc_command, n);
+ _swapl(&rep.sdc_result_header, n);
for(i = 0; i < SDC_NUM_PARM_RESULT; i++) {
- swapl(&rep.sdc_parm[i], n);
- swapl(&rep.sdc_result[i], n);
+ _swapl(&rep.sdc_parm[i], n);
+ _swapl(&rep.sdc_result[i], n);
}
}
WriteToClient(client, sizeof(xSiSCtrlCommandReply), (char *)&rep);
@@ -867,7 +867,7 @@ SiSUSBSProcSiSCtrlQueryVersion(ClientPtr client)
{
REQUEST(xSiSCtrlQueryVersionReq);
register int n;
- swaps(&stuff->length, n);
+ _swaps(&stuff->length, n);
REQUEST_SIZE_MATCH(xSiSCtrlQueryVersionReq);
return SiSUSBProcSiSCtrlQueryVersion(client);
}
@@ -878,14 +878,14 @@ SiSUSBSProcSiSCtrlCommand(ClientPtr client)
REQUEST(xSiSCtrlCommandReq);
register int n;
int i;
- swaps(&stuff->length, n);
- swapl(&stuff->screen, n);
- swapl(&stuff->sdc_id, n);
- swapl(&stuff->sdc_command, n);
- swapl(&stuff->sdc_result_header, n);
+ _swaps(&stuff->length, n);
+ _swapl(&stuff->screen, n);
+ _swapl(&stuff->sdc_id, n);
+ _swapl(&stuff->sdc_command, n);
+ _swapl(&stuff->sdc_result_header, n);
for(i = 0; i < SDC_NUM_PARM_RESULT; i++) {
- swapl(&stuff->sdc_parm[i], n);
- swapl(&stuff->sdc_result[i], n);
+ _swapl(&stuff->sdc_parm[i], n);
+ _swapl(&stuff->sdc_result[i], n);
}
REQUEST_SIZE_MATCH(xSiSCtrlCommandReq);
return SiSUSBProcSiSCtrlCommand(client);
commit dc6d77656d14853b462a8792007e73c5dc07a4b1
Author: Jeremy Huddleston <jeremyhu@apple.com>
Date: Fri Oct 7 12:45:50 2011 -0700
Also use calloc rather than xcalloc
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
diff --git a/src/sisusb_driver.c b/src/sisusb_driver.c
index cb6bff5..4531e1a 100644
--- a/src/sisusb_driver.c
+++ b/src/sisusb_driver.c
@@ -1147,7 +1147,7 @@ SISUSBPreInit(ScrnInfoPtr pScrn, int flags)
#endif
if(pSiSUSB->HWCursor) {
- if(!(pSiSUSB->USBCursorBuf = xcalloc(pSiSUSB->CursorSize * 4, 1))) pSiSUSB->HWCursor = FALSE;
+ if(!(pSiSUSB->USBCursorBuf = calloc(pSiSUSB->CursorSize * 4, 1))) pSiSUSB->HWCursor = FALSE;
pSiSUSB->availMem -= (pSiSUSB->CursorSize * 2);
if(pSiSUSB->OptUseColorCursor) pSiSUSB->availMem -= (pSiSUSB->CursorSize * 2);
diff --git a/src/sisusb_utility.c b/src/sisusb_utility.c
index 3c1bff4..282f372 100644
--- a/src/sisusb_utility.c
+++ b/src/sisusb_utility.c
@@ -926,7 +926,7 @@ SiSUSBCtrlExtInit(ScrnInfoPtr pScrn)
if(!(myext = CheckExtension(SISCTRL_PROTOCOL_NAME))) {
- if(!(myctrl = xcalloc(sizeof(xSiSCtrlScreenTable), 1)))
+ if(!(myctrl = calloc(sizeof(xSiSCtrlScreenTable), 1)))
return;
if(!(myext = AddExtension(SISCTRL_PROTOCOL_NAME, 0, 0,
diff --git a/src/sisusb_video.c b/src/sisusb_video.c
index 88db5b3..1dbf4f1 100644
--- a/src/sisusb_video.c
+++ b/src/sisusb_video.c
@@ -377,7 +377,7 @@ SISUSBSetupImageVideo(ScreenPtr pScreen)
XF86VideoAdaptorPtr adapt;
SISUSBPortPrivPtr pPriv;
- if(!(adapt = xcalloc(1, sizeof(XF86VideoAdaptorRec) +
+ if(!(adapt = calloc(1, sizeof(XF86VideoAdaptorRec) +
sizeof(SISUSBPortPrivRec) +
sizeof(DevUnion))))
return NULL;
commit 3dc05f643235e78c2b9148c052a6bc45290fb34a
Author: Jeremy Huddleston <jeremyhu@apple.com>
Date: Sat Sep 24 14:02:12 2011 -0700
Use malloc/free rather than xalloc/xfree
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
diff --git a/src/sisusb_driver.c b/src/sisusb_driver.c
index c53677b..cb6bff5 100644
--- a/src/sisusb_driver.c
+++ b/src/sisusb_driver.c
@@ -186,12 +186,12 @@ SISUSBFreeRec(ScrnInfoPtr pScrn)
/* Just to make sure... */
if(!pSiSUSB) return;
- if(pSiSUSB->pstate) xfree(pSiSUSB->pstate);
+ if(pSiSUSB->pstate) free(pSiSUSB->pstate);
pSiSUSB->pstate = NULL;
- if(pSiSUSB->fonts) xfree(pSiSUSB->fonts);
+ if(pSiSUSB->fonts) free(pSiSUSB->fonts);
pSiSUSB->fonts = NULL;
- if(pSiSUSB->SiS_Pr) xfree(pSiSUSB->SiS_Pr);
+ if(pSiSUSB->SiS_Pr) free(pSiSUSB->SiS_Pr);
pSiSUSB->SiS_Pr = NULL;
if(pSiSUSB->sisusbdevopen) {
@@ -200,12 +200,12 @@ SISUSBFreeRec(ScrnInfoPtr pScrn)
}
if(pScrn->chipset) {
- xfree(pScrn->chipset);
+ free(pScrn->chipset);
pScrn->chipset = NULL;
}
if(pScrn->driverPrivate) {
- xfree(pScrn->driverPrivate);
+ free(pScrn->driverPrivate);
pScrn->driverPrivate = NULL;
}
}
@@ -248,7 +248,7 @@ SiSUSBCheckForUSBDongle(char *filename, SISUSBPtr pSiSUSB, int *filehandle)
if((myfile = open(filename, O_RDWR, 0)) != -1) {
if(!ioctl(myfile, SISUSB_GET_CONFIG_SIZE, &sisusbinfosize)) {
- if((mysisusbinfo = xalloc(sisusbinfosize))) {
+ if((mysisusbinfo = malloc(sisusbinfosize))) {
if(!ioctl(myfile, (SISUSB_GET_CONFIG | (sisusbinfosize << 16)), mysisusbinfo)) {
if(mysisusbinfo->sisusb_id == SISUSB_ID) {
sisusbversion = (mysisusbinfo->sisusb_version << 16) |
@@ -280,7 +280,7 @@ SiSUSBCheckForUSBDongle(char *filename, SISUSBPtr pSiSUSB, int *filehandle)
retval = mysisusbinfo->sisusb_minor;
}
}
- xfree(mysisusbinfo);
+ free(mysisusbinfo);
mysisusbinfo = NULL;
}
}
@@ -307,13 +307,13 @@ SiSUSBFindUSBDongle(GDevPtr dev, int *minorArray, int numDevSections, char **nam
}
if((p) && (*p) && (*p == '/')) {
gotdev = 1;
- *nameptr = xalloc(strlen(p) + 1);
+ *nameptr = malloc(strlen(p) + 1);
strcpy(*nameptr, p);
retval = SiSUSBCheckForUSBDongle(*nameptr, NULL, NULL);
} else if((p) && (*p) && (sscanf(p, "%d", &i) == 1)) {
if(i >= 0 && i <= 31) {
gotdev = 1;
- *nameptr = xalloc(32);
+ *nameptr = malloc(32);
sprintf(*nameptr, "/dev/sisusbvga%d", i);
retval = SiSUSBCheckForUSBDongle(*nameptr, NULL, NULL);
if(retval < 0) {
@@ -324,7 +324,7 @@ SiSUSBFindUSBDongle(GDevPtr dev, int *minorArray, int numDevSections, char **nam
}
}
if(!gotdev) {
- *nameptr = xalloc(32);
+ *nameptr = malloc(32);
for(i = 0; i < 64; i++) {
if(i < 32) sprintf(*nameptr, "/dev/sisusbvga%d", i);
else sprintf(*nameptr, "/dev/usb/sisusbvga%d", i);
@@ -338,7 +338,7 @@ SiSUSBFindUSBDongle(GDevPtr dev, int *minorArray, int numDevSections, char **nam
if(retval >= 0) {
xf86Msg(X_INFO, "Found SiSUSB dongle (node %s, minor %d)\n", *nameptr, retval);
} else if((*nameptr)) {
- xfree(*nameptr);
+ free(*nameptr);
*nameptr = NULL;
}
@@ -401,14 +401,14 @@ SISUSBProbe(DriverPtr drv, int flags)
*/
/* Allocate and initialize an array of ints for storing the minors */
- if(!(minorArray = (int *)xalloc(numDevSections * sizeof(int)))) {
+ if(!(minorArray = (int *)malloc(numDevSections * sizeof(int)))) {
return FALSE;
}
for(i = 0; i < numDevSections; i++) minorArray[i] = -1;
/* Allocate an array of char ptrs for storing the device node names */
- if(!(devnameArray = (char **)xalloc(numDevSections * sizeof(char *)))) {
- xfree(minorArray);
+ if(!(devnameArray = (char **)malloc(numDevSections * sizeof(char *)))) {
+ free(minorArray);
return FALSE;
}
@@ -420,20 +420,20 @@ SISUSBProbe(DriverPtr drv, int flags)
if((myminor = SiSUSBFindUSBDongle(devSections[i], minorArray, numDevSections, &nameptr)) >= 0) {
if(!SiSUSBFindDuplicate(myminor, minorArray, numDevSections)) {
minorArray[numUsed] = myminor;
- devnameArray[numUsed] = xalloc(strlen(nameptr) + 1);
+ devnameArray[numUsed] = malloc(strlen(nameptr) + 1);
strcpy(devnameArray[numUsed], nameptr);
numUsed++;
}
- xfree(nameptr);
+ free(nameptr);
}
}
/* Free the minor array, we don't need it anymore */
- xfree(minorArray);
+ free(minorArray);
if(numUsed <= 0) {
- xfree(devSections);
- xfree(devnameArray);
+ free(devSections);
+ free(devnameArray);
return FALSE;
}
@@ -470,8 +470,8 @@ SISUSBProbe(DriverPtr drv, int flags)
}
- xfree(devSections);
- xfree(devnameArray);
+ free(devSections);
+ free(devnameArray);
return foundScreen;
}
@@ -622,10 +622,10 @@ SISUSBCalculateGammaRamp(ScreenPtr pScreen, ScrnInfoPtr pScrn)
if(!(nramp = xf86GetGammaRampSize(pScreen))) return;
for(i=0; i<3; i++) {
- ramp[i] = (UShort *)xalloc(nramp * sizeof(UShort));
+ ramp[i] = (UShort *)malloc(nramp * sizeof(UShort));
if(!ramp[i]) {
- if(ramp[0]) { xfree(ramp[0]); ramp[0] = NULL; }
- if(ramp[1]) { xfree(ramp[1]); ramp[1] = NULL; }
+ if(ramp[0]) { free(ramp[0]); ramp[0] = NULL; }
+ if(ramp[1]) { free(ramp[1]); ramp[1] = NULL; }
return;
}
}
@@ -685,9 +685,9 @@ SISUSBCalculateGammaRamp(ScreenPtr pScreen, ScrnInfoPtr pScrn)
xf86ChangeGammaRamp(pScreen, nramp, ramp[0], ramp[1], ramp[2]);
- xfree(ramp[0]);
- xfree(ramp[1]);
- xfree(ramp[2]);
+ free(ramp[0]);
+ free(ramp[1]);
+ free(ramp[2]);
ramp[0] = ramp[1] = ramp[2] = NULL;
}
#endif
@@ -906,11 +906,11 @@ SISUSBPreInit(ScrnInfoPtr pScrn, int flags)
Bool gotit = FALSE;
if(!ioctl(fd, SISUSBFB_GET_INFO_SIZE, &sisfbinfosize)) {
- if((mysisfbinfo = xalloc(sisfbinfosize))) {
+ if((mysisfbinfo = malloc(sisfbinfosize))) {
if(!ioctl(fd, (SISUSBFB_GET_INFO | (sisfbinfosize << 16)), mysisfbinfo)) {
gotit = TRUE;
} else {
- xfree(mysisfbinfo);
+ free(mysisfbinfo);
mysisfbinfo = NULL;
}
}
@@ -944,7 +944,7 @@ SISUSBPreInit(ScrnInfoPtr pScrn, int flags)
}
}
- xfree(mysisfbinfo);
+ free(mysisfbinfo);
mysisfbinfo = NULL;
}
close (fd);
@@ -1811,7 +1811,7 @@ SISUSBScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
if(pSiSUSB->ShadowFB) {
pSiSUSB->ShadowPitch = BitmapBytePad(pScrn->bitsPerPixel * displayWidth);
- pSiSUSB->ShadowPtr = xalloc(pSiSUSB->ShadowPitch * height);
+ pSiSUSB->ShadowPtr = malloc(pSiSUSB->ShadowPitch * height);
if(!(FBStart = pSiSUSB->ShadowPtr)) {
SISUSBSaveScreen(pScreen, SCREEN_SAVER_OFF);
SISUSBErrorLog(pScrn, "Failed to allocate shadow framebuffer\n");
@@ -1820,7 +1820,7 @@ SISUSBScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
#if X_BYTE_ORDER == X_BIG_ENDIAN
if(pScrn->bitsPerPixel == 16) {
/* For 16bpp, we need to swap the bytes in the framebuffer */
- if(!(pSiSUSB->ShadowPtrSwap = xalloc(pSiSUSB->ShadowPitch * height))) {
+ if(!(pSiSUSB->ShadowPtrSwap = malloc(pSiSUSB->ShadowPitch * height))) {
SISUSBSaveScreen(pScreen, SCREEN_SAVER_OFF);
SISUSBErrorLog(pScrn, "Failed to allocate swap buffer for shadow framebuffer\n");
return FALSE;
@@ -2238,24 +2238,24 @@ SISUSBCloseScreen(int scrnIndex, ScreenPtr pScreen)
}
if(pSiSUSB->USBCursorBuf) {
- xfree(pSiSUSB->USBCursorBuf);
+ free(pSiSUSB->USBCursorBuf);
pSiSUSB->USBCursorBuf = NULL;
}
if(pSiSUSB->ShadowPtr) {
- xfree(pSiSUSB->ShadowPtr);
+ free(pSiSUSB->ShadowPtr);
pSiSUSB->ShadowPtr = NULL;
}
#if 0
if(pSiSUSB->PreAllocMem) {
- xfree(pSiSUSB->PreAllocMem);
+ free(pSiSUSB->PreAllocMem);
pSiSUSB->PreAllocMem = NULL;
}
#endif
if(pSiSUSB->adaptor) {
- xfree(pSiSUSB->adaptor);
+ free(pSiSUSB->adaptor);
pSiSUSB->adaptor = NULL;
pSiSUSB->ResetXv = pSiSUSB->ResetXvGamma = NULL;
}
diff --git a/src/sisusb_init.c b/src/sisusb_init.c
index ba44431..99ec519 100644
--- a/src/sisusb_init.c
+++ b/src/sisusb_init.c
@@ -1301,10 +1301,10 @@ SiSUSBBuildBuiltInModeList(ScrnInfoPtr pScrn, BOOLEAN includelcdmodes, BOOLEAN i
}
}
- if(!(new = xalloc(sizeof(DisplayModeRec)))) return first;
+ if(!(new = malloc(sizeof(DisplayModeRec)))) return first;
memset(new, 0, sizeof(DisplayModeRec));
- if(!(new->name = xalloc(10))) {
- xfree(new);
+ if(!(new->name = malloc(10))) {
+ free(new);
return first;
}
if(!first) first = new;
diff --git a/src/sisusb_opt.c b/src/sisusb_opt.c
index d4612b0..4d5cfa3 100644
--- a/src/sisusb_opt.c
+++ b/src/sisusb_opt.c
@@ -228,7 +228,7 @@ SiSUSBOptions(ScrnInfoPtr pScrn)
xf86CollectOptions(pScrn, NULL);
/* Process the options */
- if(!(pSiSUSB->Options = xalloc(sizeof(SISUSBOptions)))) return;
+ if(!(pSiSUSB->Options = malloc(sizeof(SISUSBOptions)))) return;
memcpy(pSiSUSB->Options, SISUSBOptions, sizeof(SISUSBOptions));
diff --git a/src/sisusb_utility.c b/src/sisusb_utility.c
index 8d87ee0..3c1bff4 100644
--- a/src/sisusb_utility.c
+++ b/src/sisusb_utility.c
@@ -909,7 +909,7 @@ SiSUSBCtrlResetProc(ExtensionEntry* extEntry)
{
/* Called by CloseDownExtensions() */
if(extEntry->extPrivate) {
- xfree(extEntry->extPrivate);
+ free(extEntry->extPrivate);
extEntry->extPrivate = NULL;
}
}
@@ -936,7 +936,7 @@ SiSUSBCtrlExtInit(ScrnInfoPtr pScrn)
StandardMinorOpcode))) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Failed to add SISCTRL extension\n");
- xfree(myctrl);
+ free(myctrl);
return;
}
diff --git a/src/sisusb_video.c b/src/sisusb_video.c
index bc469b0..88db5b3 100644
--- a/src/sisusb_video.c
+++ b/src/sisusb_video.c
@@ -216,7 +216,7 @@ void SISUSBInitVideo(ScreenPtr pScreen)
if(newAdaptor) size++;
- newAdaptors = xalloc(size * sizeof(XF86VideoAdaptorPtr*));
+ newAdaptors = malloc(size * sizeof(XF86VideoAdaptorPtr*));
if(newAdaptors) {
if(num_adaptors) {
memcpy(newAdaptors, adaptors, num_adaptors * sizeof(XF86VideoAdaptorPtr));
@@ -234,7 +234,7 @@ void SISUSBInitVideo(ScreenPtr pScreen)
}
if(newAdaptors) {
- xfree(newAdaptors);
+ free(newAdaptors);
}
}
commit b2fe8b0fd3b9776577a76d79a9c55ff6643040e6
Author: Jeremy Huddleston <jeremyhu@apple.com>
Date: Sat Sep 24 14:00:29 2011 -0700
Include xf86Pci.h for IOADDRESS
My previous commit incorrectly included pciaccess.h
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
diff --git a/src/sisusb_types.h b/src/sisusb_types.h
index 312f5b9..df3618f 100644
--- a/src/sisusb_types.h
+++ b/src/sisusb_types.h
@@ -51,7 +51,7 @@
#ifndef _VGATYPES_
#define _VGATYPES_
-#include <pciaccess.h>
+#include <xf86Pci.h>
#ifndef FALSE
#define FALSE 0
commit 91720979dc7e9fe068fd904dd40900ed1d19e03d
Author: Jeremy Huddleston <jeremyhu@apple.com>
Date: Thu Sep 15 14:45:25 2011 -0700
Require libpciaccess
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
diff --git a/configure.ac b/configure.ac
index 1a426b1..725d6cb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -61,7 +61,7 @@ XORG_DRIVER_CHECK_EXT(XV, videoproto)
XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto)
# Obtain compiler/linker options for the driver dependencies
-PKG_CHECK_MODULES(XORG, [xorg-server >= 1.0.99.901 xproto fontsproto $REQUIRED_MODULES])
+PKG_CHECK_MODULES(XORG, [xorg-server >= 1.0.99.901 xproto fontsproto pciaccess $REQUIRED_MODULES])
PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1],
HAVE_XEXTPROTO_71="yes"; AC_DEFINE(HAVE_XEXTPROTO_71, 1, [xextproto 7.1 available]),
HAVE_XEXTPROTO_71="no")
commit 4968496bdd96d2351ea2aec05feee41b0612140c
Author: Jeremy Huddleston <jeremyhu@apple.com>
Date: Thu Sep 15 14:42:48 2011 -0700
Add missing include for pciaccess.h
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
diff --git a/src/sisusb_types.h b/src/sisusb_types.h
index 04c7a7a..312f5b9 100644
--- a/src/sisusb_types.h
+++ b/src/sisusb_types.h
@@ -51,6 +51,8 @@
#ifndef _VGATYPES_
#define _VGATYPES_
+#include <pciaccess.h>
+
#ifndef FALSE
#define FALSE 0
#endif
commit 241dd519e910d8a07483dc9506ebcbc1fb9c9e0f
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sat Jun 4 21:00:03 2011 -0700
Convert sisusb.man from XORG_RAWCPP to using sed like other drivers
Upgrade to util-macros 1.8 for additional man page support
Use MAN_SUBST now supplied in XORG_MANPAGE_SECTIONS
The value of MAN_SUBST is the same for all X.Org packages.
Use AC_PROG_SED now supplied by XORG_DEFAULT_OPTIONS
The existing statement can now be removed from the configuration file.
Use automake provided $(AM_V_GEN) and XORG_DEFAULT_OPTIONS provided $(SED)
Enables silent rule and use platform appropriate version of sed.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
diff --git a/configure.ac b/configure.ac
index 3c7f3fb..1a426b1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -34,16 +34,15 @@ AC_CONFIG_AUX_DIR(.)
AM_INIT_AUTOMAKE([foreign dist-bzip2])
AM_MAINTAINER_MODE
-# Require xorg-macros: XORG_DEFAULT_OPTIONS
+# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
m4_ifndef([XORG_MACROS_VERSION],
- [m4_fatal([must install xorg-macros 1.3 or later before running autoconf/autogen])])
-XORG_MACROS_VERSION(1.3)
+ [m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])])
+XORG_MACROS_VERSION(1.8)
XORG_DEFAULT_OPTIONS
# Initialize libtool
AC_DISABLE_STATIC
AC_PROG_LIBTOOL
-XORG_PROG_RAWCPP
AH_TOP([#include "xorg-server.h"])
diff --git a/man/Makefile.am b/man/Makefile.am
index 1b26ac2..9ceb36f 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -31,39 +31,9 @@ EXTRA_DIST = @DRIVER_NAME@.man
CLEANFILES = $(driverman_DATA)
-SED = sed
-
-# Strings to replace in man pages
-XORGRELSTRING = @PACKAGE_STRING@
- XORGMANNAME = X Version 11
-
-MANDEFS = \
- -D__vendorversion__="\"$(XORGRELSTRING)\" \"$(XORGMANNAME)\"" \
- -D__appmansuffix__=$(APP_MAN_SUFFIX) \
- -D__filemansuffix__=$(FILE_MAN_SUFFIX) \
- -D__libmansuffix__=$(LIB_MAN_SUFFIX) \
- -D__miscmansuffix__=$(MISC_MAN_SUFFIX) \
- -D__drivermansuffix__=$(DRIVER_MAN_SUFFIX) \
- -D__adminmansuffix__=$(ADMIN_MAN_SUFFIX) \
- -D__xconfigfile__=xorg.conf \
- -D__xservername__=Xorg
-
-# Translate XCOMM into pound sign with sed, rather than passing -DXCOMM=XCOMM
-# to cpp, because that trick does not work on all ANSI C preprocessors.
-# Delete line numbers from the cpp output (-P is not portable, I guess).
-# Allow XCOMM to be preceded by whitespace and provide a means of generating
-# output lines with trailing backslashes.
-# Allow XHASH to always be substituted, even in cases where XCOMM isn't.
-
-CPP_SED_MAGIC = $(SED) -e '/^\# *[0-9][0-9]* *.*$$/d' \
- -e '/^\#line *[0-9][0-9]* *.*$$/d' \
- -e '/^[ ]*XCOMM$$/s/XCOMM/\#/' \
- -e '/^[ ]*XCOMM[^a-zA-Z0-9_]/s/XCOMM/\#/' \
- -e '/^[ ]*XHASH/s/XHASH/\#/' \
- -e '/\@\@$$/s/\@\@$$/\\/'
-
SUFFIXES = .$(DRIVER_MAN_SUFFIX) .man
+# String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure
.man.$(DRIVER_MAN_SUFFIX):
- $(RAWCPP) $(RAWCPPFLAGS) $(MANDEFS) $(EXTRAMANDEFS) < $< | $(CPP_SED_MAGIC) > $@
+ $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
diff --git a/man/sisusb.man b/man/sisusb.man
index 606c2de..6eafb8e 100644
--- a/man/sisusb.man
+++ b/man/sisusb.man
@@ -1,15 +1,5 @@
.\" shorthand for double quote that works everywhere.
.ds q \N'34'
-#ifdef __xservername__
-#define __myservername__ __xservername__
-#else
-#define __myservername__ XFree86
-#endif
-#ifdef __xconfigfile__
-#define __myxconfigfile__ __xconfigfile__
-#else
-#define __myxconfigfile__ XF86Config
-#endif
.TH SISUSB __drivermansuffix__ __vendorversion__
.SH NAME
sisusb \- SiS USB video driver
@@ -23,7 +13,7 @@ sisusb \- SiS USB video driver
.fi
.SH DESCRIPTION
.B sisusb
-is an __myservername__ driver for SiS (Silicon Integrated Systems) video chips that
+is an __xservername__ driver for SiS (Silicon Integrated Systems) video chips that
are connected via a Net2280-based USB dongle. The driver is not accelerated, but
provides support for colordepths of 8, 16 and 24 bpp as well as Render and other
extensions.
@@ -37,7 +27,7 @@ driver supports USB video cards based on the following chipsets:
The SiS315E/PRO features two CRT controllers. However, in its USB version, only
the first output, referred to as "CRT1", is being used.
.SH CONFIGURATION DETAILS
-Please refer to __myxconfigfile__(__filemansuffix__) for general configuration
+Please refer to __xconfigfile__(__filemansuffix__) for general configuration
details and to sis(__drivermansuffix__) for more information. This manpage only
covers a subset of the supported options.
.PP
@@ -79,11 +69,7 @@ for device reconnection).
.SH "KNOWN BUGS"
none.
.SH "SEE ALSO"
-#ifdef __xservername__
__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__), sis(__drivermansuffix__)
-#else
-XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__), sis(__drivermansuffix__)
-#endif
.PP
.B "http://www.winischhofer.at/linuxsisvga.shtml"
for more information and updates
commit 471636eca6e00de7daddfc7785ca90dba1eb0cb1
Author: Thierry Vignaud <thierry.vignaud@gmail.com>
Date: Fri Dec 3 09:39:58 2010 +0000
Fix compilation with -Werror=format-security (bug #31540)
Not actually a security bug, but shuts gcc up at least.
Signed-off-by: Thierry Vignaud <thierry.vignaud@gmail.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
diff --git a/src/sisusb_driver.c b/src/sisusb_driver.c
index 8ba2c33..c53677b 100644
--- a/src/sisusb_driver.c
+++ b/src/sisusb_driver.c
@@ -217,14 +217,14 @@ SISUSBErrorLog(ScrnInfoPtr pScrn, const char *format, ...)
static const char *str = "**************************************************\n";
va_start(ap, format);
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR, str);
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "%s", str);
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
" ERROR:\n");
xf86VDrvMsgVerb(pScrn->scrnIndex, X_ERROR, 1, format, ap);
va_end(ap);
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
" END OF MESSAGE\n");
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR, str);
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "%s", str);
}
static int
commit 8253e3db081656f592461a6960ce71db36b4844e
Author: Jesse Adkins <jesserayadkins@gmail.com>
Date: Tue Sep 28 13:29:51 2010 -0700
Purge cvs tags.
Signed-off-by: Jesse Adkins <jesserayadkins@gmail.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
diff --git a/man/sisusb.man b/man/sisusb.man
index 7817cb5..606c2de 100644
--- a/man/sisusb.man
+++ b/man/sisusb.man
@@ -1,5 +1,3 @@
-.\" $XFree86$
-.\" $XdotOrg$
.\" shorthand for double quote that works everywhere.
.ds q \N'34'
#ifdef __xservername__
commit 0a9d98a6effd599cffff36542c39f97728abb038
Author: Gaetan Nadon <memsize@videotron.ca>
Date: Wed Jul 21 16:49:04 2010 -0400
config: add comments for main statements
diff --git a/configure.ac b/configure.ac
index d30fdcc..3c7f3fb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -20,18 +20,18 @@
#
# Process this file with autoconf to produce a configure script
+# Initialize Autoconf
AC_PREREQ([2.60])
AC_INIT([xf86-video-sisusb],
[0.9.4],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
[xf86-video-sisusb])
-
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_AUX_DIR(.)
+# Initialize Automake
AM_INIT_AUTOMAKE([foreign dist-bzip2])
-
AM_MAINTAINER_MODE
# Require xorg-macros: XORG_DEFAULT_OPTIONS
@@ -40,27 +40,28 @@ m4_ifndef([XORG_MACROS_VERSION],
XORG_MACROS_VERSION(1.3)
XORG_DEFAULT_OPTIONS
-# Checks for programs.
+# Initialize libtool
AC_DISABLE_STATIC
AC_PROG_LIBTOOL
XORG_PROG_RAWCPP
AH_TOP([#include "xorg-server.h"])
+# Define a configure option for an alternate module directory
AC_ARG_WITH(xorg-module-dir,
AS_HELP_STRING([--with-xorg-module-dir=DIR],
[Default xorg module directory [[default=$libdir/xorg/modules]]]),
[moduledir="$withval"],
[moduledir="$libdir/xorg/modules"])
-# Checks for extensions
+# Store the list of server defined optional extensions in REQUIRED_MODULES
XORG_DRIVER_CHECK_EXT(XINERAMA, xineramaproto)
XORG_DRIVER_CHECK_EXT(RANDR, randrproto)
XORG_DRIVER_CHECK_EXT(RENDER, renderproto)
XORG_DRIVER_CHECK_EXT(XV, videoproto)
XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto)
-# Checks for pkg-config packages
+# Obtain compiler/linker options for the driver dependencies
PKG_CHECK_MODULES(XORG, [xorg-server >= 1.0.99.901 xproto fontsproto $REQUIRED_MODULES])
PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1],
HAVE_XEXTPROTO_71="yes"; AC_DEFINE(HAVE_XEXTPROTO_71, 1, [xextproto 7.1 available]),
@@ -69,7 +70,6 @@ AM_CONDITIONAL(HAVE_XEXTPROTO_71, [ test "$HAVE_XEXTPROTO_71" = "yes" ])
# Checks for libraries.
-
AC_SUBST([moduledir])
DRIVER_NAME=sisusb
commit 6a97c2386aa6c775018f5acd57b446feab6f438c
Author: Gaetan Nadon <memsize@videotron.ca>
Date: Wed Jul 21 16:07:00 2010 -0400
config: replace deprecated use of AC_OUTPUT with AC_CONFIG_FILES
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
diff --git a/configure.ac b/configure.ac
index ddb4dca..d30fdcc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -75,8 +75,9 @@ AC_SUBST([moduledir])
DRIVER_NAME=sisusb
AC_SUBST([DRIVER_NAME])
Reply to: