summaryrefslogtreecommitdiff
path: root/driver/xf86-video-chips/src
diff options
context:
space:
mode:
Diffstat (limited to 'driver/xf86-video-chips/src')
-rw-r--r--driver/xf86-video-chips/src/ct_accel.c4
-rw-r--r--driver/xf86-video-chips/src/ct_ddc.c4
-rw-r--r--driver/xf86-video-chips/src/ct_dga.c10
-rw-r--r--driver/xf86-video-chips/src/ct_driver.c49
-rw-r--r--driver/xf86-video-chips/src/ct_video.c31
5 files changed, 50 insertions, 48 deletions
diff --git a/driver/xf86-video-chips/src/ct_accel.c b/driver/xf86-video-chips/src/ct_accel.c
index 8d049ebac..3920b0a9e 100644
--- a/driver/xf86-video-chips/src/ct_accel.c
+++ b/driver/xf86-video-chips/src/ct_accel.c
@@ -1181,7 +1181,7 @@ CTNAME(CacheMonoStipple)(ScrnInfoPtr pScrn, PixmapPtr pPix)
} else funcNo = 2;
pad = (((pCache->w * bpp) + 31) >> 5) << 2;
- dstPtr = data = (unsigned char*)xalloc(pad * pCache->h);
+ dstPtr = data = malloc(pad * pCache->h);
srcPtr = (unsigned char*)pPix->devPrivate.ptr;
StippleFunc = StippleTab[funcNo];
@@ -1209,7 +1209,7 @@ CTNAME(CacheMonoStipple)(ScrnInfoPtr pScrn, PixmapPtr pPix)
pScrn, pCache->x, pCache->y, pCache->w, pCache->h, data,
pad, bpp, pScrn->depth);
- xfree(data);
+ free(data);
return pCache;
}
diff --git a/driver/xf86-video-chips/src/ct_ddc.c b/driver/xf86-video-chips/src/ct_ddc.c
index 5e86c1792..ab02d471d 100644
--- a/driver/xf86-video-chips/src/ct_ddc.c
+++ b/driver/xf86-video-chips/src/ct_ddc.c
@@ -31,7 +31,7 @@ chips_ddc1Read(ScrnInfoPtr pScrn)
register unsigned int tmp;
while ((hwp->readST01(hwp)) & 0x08){};
- while (!(hwp->readST01(hwp)) & 0x08){};
+ while (!((hwp->readST01(hwp)) & 0x08)){};
tmp = cPtr->readXR(cPtr, 0x63);
return (tmp & ddc_mask);
}
@@ -170,7 +170,7 @@ chips_i2cInit(ScrnInfoPtr pScrn)
I2CPtr->scrnIndex = pScrn->scrnIndex;
I2CPtr->I2CPutBits = chips_I2CPutBits;
I2CPtr->I2CGetBits = chips_I2CGetBits;
- I2CPtr->DriverPrivate.ptr = xalloc(sizeof(CHIPSI2CRec));
+ I2CPtr->DriverPrivate.ptr = malloc(sizeof(CHIPSI2CRec));
((CHIPSI2CPtr)(I2CPtr->DriverPrivate.ptr))->cPtr = cPtr;
if (!xf86I2CBusInit(I2CPtr))
diff --git a/driver/xf86-video-chips/src/ct_dga.c b/driver/xf86-video-chips/src/ct_dga.c
index e3c1a00bf..32f3aa3b0 100644
--- a/driver/xf86-video-chips/src/ct_dga.c
+++ b/driver/xf86-video-chips/src/ct_dga.c
@@ -95,15 +95,15 @@ CHIPSDGAInit(ScreenPtr pScreen)
while(pMode) {
if(0 /*pScrn->displayWidth != pMode->HDisplay*/) {
- newmodes = xrealloc(modes, (num + 2) * sizeof(DGAModeRec));
+ newmodes = realloc(modes, (num + 2) * sizeof(DGAModeRec));
oneMore = TRUE;
} else {
- newmodes = xrealloc(modes, (num + 1) * sizeof(DGAModeRec));
+ newmodes = realloc(modes, (num + 1) * sizeof(DGAModeRec));
oneMore = FALSE;
}
if(!newmodes) {
- xfree(modes);
+ free(modes);
return FALSE;
}
modes = newmodes;
@@ -239,8 +239,8 @@ CHIPS_SetViewport(
CHIPSPtr cPtr = CHIPSPTR(pScrn);
if (flags & DGA_FLIP_RETRACE) {
- while ((hwp->readST01(hwp)) & 0x08){};
- while (!(hwp->readST01(hwp)) & 0x08){};
+ while ((hwp->readST01(hwp)) & 0x08){};
+ while (!((hwp->readST01(hwp)) & 0x08)){};
}
CHIPSAdjustFrame(pScrn->pScreen->myNum, x, y, flags);
diff --git a/driver/xf86-video-chips/src/ct_driver.c b/driver/xf86-video-chips/src/ct_driver.c
index 28a16608c..6624b7937 100644
--- a/driver/xf86-video-chips/src/ct_driver.c
+++ b/driver/xf86-video-chips/src/ct_driver.c
@@ -111,8 +111,7 @@
#include "micmap.h"
#include "fb.h"
-#include "cfb8_16.h"
-
+#include "fboverlay.h"
/* Needed for the 1 and 4 bpp framebuffers */
#ifdef HAVE_XF1BPP
@@ -158,7 +157,9 @@ static ModeStatus CHIPSValidMode(int scrnIndex, DisplayModePtr mode,
static Bool CHIPSSaveScreen(ScreenPtr pScreen, int mode);
/* Internally used functions */
+#ifdef HAVE_ISA
static int chipsFindIsaDevice(GDevPtr dev);
+#endif
static Bool chipsClockSelect(ScrnInfoPtr pScrn, int no);
Bool chipsModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode);
static void chipsSave(ScrnInfoPtr pScrn, vgaRegPtr VgaSave,
@@ -770,7 +771,7 @@ CHIPSFreeRec(ScrnInfoPtr pScrn)
{
if (pScrn->driverPrivate == NULL)
return;
- xfree(pScrn->driverPrivate);
+ free(pScrn->driverPrivate);
pScrn->driverPrivate = NULL;
}
@@ -1332,16 +1333,6 @@ CHIPSPreInit(ScrnInfoPtr pScrn, int flags)
}
break;
#endif
- case 16:
- if (cPtr->Flags & ChipsOverlay8plus16) {
- if (xf86LoadSubModule(pScrn, "xf8_16bpp") == NULL) {
- vbeFree(cPtr->pVbe);
- cPtr->pVbe = NULL;
- CHIPSFreeRec(pScrn);
- return FALSE;
- }
- break;
- }
default:
if (xf86LoadSubModule(pScrn, "fb") == NULL) {
vbeFree(cPtr->pVbe);
@@ -1496,7 +1487,7 @@ chipsPreInitHiQV(ScrnInfoPtr pScrn, int flags)
/* Collect all of the relevant option flags (fill in pScrn->options) */
xf86CollectOptions(pScrn, NULL);
/* Process the options */
- if (!(cPtr->Options = xalloc(sizeof(ChipsHiQVOptions))))
+ if (!(cPtr->Options = malloc(sizeof(ChipsHiQVOptions))))
return FALSE;
memcpy(cPtr->Options, ChipsHiQVOptions, sizeof(ChipsHiQVOptions));
xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, cPtr->Options);
@@ -1606,7 +1597,7 @@ chipsPreInitHiQV(ScrnInfoPtr pScrn, int flags)
#endif
cPtr->IOAddress = cPtr->FbAddress + 0x400000L;
xf86DrvMsg(pScrn->scrnIndex, X_DEFAULT,
- "IOAddress is set at 0x%lX.\n",cPtr->IOAddress);
+ "IOAddress is set at 0x%lX.\n",(unsigned long)cPtr->IOAddress);
} else
xf86DrvMsg(pScrn->scrnIndex, from,
@@ -2575,7 +2566,7 @@ chipsPreInitWingine(ScrnInfoPtr pScrn, int flags)
xf86CollectOptions(pScrn, NULL);
/* Process the options */
- if (!(cPtr->Options = xalloc(sizeof(ChipsWingineOptions))))
+ if (!(cPtr->Options = malloc(sizeof(ChipsWingineOptions))))
return FALSE;
memcpy(cPtr->Options, ChipsWingineOptions, sizeof(ChipsWingineOptions));
xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, cPtr->Options);
@@ -3046,7 +3037,7 @@ chipsPreInit655xx(ScrnInfoPtr pScrn, int flags)
xf86CollectOptions(pScrn, NULL);
/* Process the options */
- if (!(cPtr->Options = xalloc(sizeof(Chips655xxOptions))))
+ if (!(cPtr->Options = malloc(sizeof(Chips655xxOptions))))
return FALSE;
memcpy(cPtr->Options, Chips655xxOptions, sizeof(Chips655xxOptions));
xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, cPtr->Options);
@@ -3904,6 +3895,18 @@ chipsLoadPalette16(ScrnInfoPtr pScrn, int numColors, int *indices,
hwp->disablePalette(hwp);
}
+static Bool
+cfb8_16ScreenInit(ScreenPtr pScreen, pointer pbits16, pointer pbits8,
+ int xsize, int ysize, int dpix, int dpiy,
+ int width16, int width8)
+{
+ return
+ (fbOverlaySetupScreen(pScreen, pbits16, pbits8, xsize, ysize,
+ dpix, dpiy, width16, width8, 16, 8) &&
+ fbOverlayFinishScreenInit(pScreen, pbits16, pbits8, xsize, ysize,
+ dpix, dpiy, width16, width8, 16, 8, 16, 8));
+}
+
/* Mandatory */
static Bool
CHIPSScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
@@ -3916,7 +3919,9 @@ CHIPSScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
int init_picture = 0;
VisualPtr visual;
int allocatebase, freespace, currentaddr;
+#ifndef XSERVER_LIBPCIACCESS
unsigned int racflag = 0;
+#endif
unsigned char *FBStart;
int height, width, displayWidth;
CHIPSEntPtr cPtrEnt = NULL;
@@ -4058,7 +4063,7 @@ CHIPSScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
if(cPtr->Flags & ChipsShadowFB) {
cPtr->ShadowPitch = BitmapBytePad(pScrn->bitsPerPixel * width);
- cPtr->ShadowPtr = xalloc(cPtr->ShadowPitch * height);
+ cPtr->ShadowPtr = malloc(cPtr->ShadowPitch * height);
displayWidth = cPtr->ShadowPitch / (pScrn->bitsPerPixel >> 3);
FBStart = cPtr->ShadowPtr;
} else {
@@ -4620,10 +4625,8 @@ CHIPSCloseScreen(int scrnIndex, ScreenPtr pScreen)
XAADestroyInfoRec(cPtr->AccelInfoRec);
if (cPtr->CursorInfoRec)
xf86DestroyCursorInfoRec(cPtr->CursorInfoRec);
- if (cPtr->ShadowPtr)
- xfree(cPtr->ShadowPtr);
- if (cPtr->DGAModes)
- xfree(cPtr->DGAModes);
+ free(cPtr->ShadowPtr);
+ free(cPtr->DGAModes);
pScrn->vtSema = FALSE;
if(cPtr->BlockHandler)
pScreen->BlockHandler = cPtr->BlockHandler;
@@ -7486,7 +7489,7 @@ chipsTestDACComp(ScrnInfoPtr pScrn, unsigned char a, unsigned char b,
hwp->writeDacWriteAddr(hwp, 0x00);
while ((hwp->readST01(hwp)) & 0x08){}; /* wait for vsync to end */
- while (!(hwp->readST01(hwp)) & 0x08){}; /* wait for new vsync */
+ while (!((hwp->readST01(hwp)) & 0x08)){}; /* wait for new vsync */
hwp->writeDacData(hwp, a); /* set pattern */
hwp->writeDacData(hwp, b);
hwp->writeDacData(hwp, c);
diff --git a/driver/xf86-video-chips/src/ct_video.c b/driver/xf86-video-chips/src/ct_video.c
index 130634b66..a68acb92d 100644
--- a/driver/xf86-video-chips/src/ct_video.c
+++ b/driver/xf86-video-chips/src/ct_video.c
@@ -70,7 +70,7 @@ CHIPSInitVideo(ScreenPtr pScreen)
adaptors = &newAdaptor;
} else {
newAdaptors = /* need to free this someplace */
- xalloc((num_adaptors + 1) * sizeof(XF86VideoAdaptorPtr*));
+ malloc((num_adaptors + 1) * sizeof(XF86VideoAdaptorPtr*));
if(newAdaptors) {
memcpy(newAdaptors, adaptors, num_adaptors *
sizeof(XF86VideoAdaptorPtr));
@@ -84,8 +84,7 @@ CHIPSInitVideo(ScreenPtr pScreen)
if(num_adaptors)
xf86XVScreenInit(pScreen, adaptors, num_adaptors);
- if(newAdaptors)
- xfree(newAdaptors);
+ free(newAdaptors);
}
/* client libraries expect an encoding */
@@ -236,9 +235,9 @@ CHIPSSetupImageVideo(ScreenPtr pScreen)
XF86VideoAdaptorPtr adapt;
CHIPSPortPrivPtr pPriv;
- if(!(adapt = xcalloc(1, sizeof(XF86VideoAdaptorRec) +
- sizeof(CHIPSPortPrivRec) +
- sizeof(DevUnion))))
+ if(!(adapt = calloc(1, sizeof(XF86VideoAdaptorRec) +
+ sizeof(CHIPSPortPrivRec) +
+ sizeof(DevUnion))))
return NULL;
adapt->type = XvWindowMask | XvInputMask | XvImageMask;
@@ -880,18 +879,18 @@ CHIPSAllocateSurface(
surface->width = w;
surface->height = h;
- if(!(surface->pitches = xalloc(sizeof(int)))) {
+ if(!(surface->pitches = malloc(sizeof(int)))) {
xf86FreeOffscreenLinear(linear);
return BadAlloc;
}
- if(!(surface->offsets = xalloc(sizeof(int)))) {
- xfree(surface->pitches);
+ if(!(surface->offsets = malloc(sizeof(int)))) {
+ free(surface->pitches);
xf86FreeOffscreenLinear(linear);
return BadAlloc;
}
- if(!(pPriv = xalloc(sizeof(OffscreenPrivRec)))) {
- xfree(surface->pitches);
- xfree(surface->offsets);
+ if(!(pPriv = malloc(sizeof(OffscreenPrivRec)))) {
+ free(surface->pitches);
+ free(surface->offsets);
xf86FreeOffscreenLinear(linear);
return BadAlloc;
}
@@ -937,9 +936,9 @@ CHIPSFreeSurface(
if(pPriv->isOn)
CHIPSStopSurface(surface);
xf86FreeOffscreenLinear(pPriv->linear);
- xfree(surface->pitches);
- xfree(surface->offsets);
- xfree(surface->devPrivate.ptr);
+ free(surface->pitches);
+ free(surface->offsets);
+ free(surface->devPrivate.ptr);
return Success;
}
@@ -1029,7 +1028,7 @@ CHIPSInitOffscreenImages(ScreenPtr pScreen)
XF86OffscreenImagePtr offscreenImages;
/* need to free this someplace */
- if(!(offscreenImages = xalloc(sizeof(XF86OffscreenImageRec))))
+ if(!(offscreenImages = malloc(sizeof(XF86OffscreenImageRec))))
return;
offscreenImages[0].image = &Images[0];