diff options
-rw-r--r-- | src/amd.h | 40 | ||||
-rw-r--r-- | src/amd_gx_accel.c | 64 | ||||
-rw-r--r-- | src/amd_gx_cursor.c | 4 | ||||
-rw-r--r-- | src/amd_gx_dcon.c | 2 | ||||
-rw-r--r-- | src/amd_gx_driver.c | 17 | ||||
-rw-r--r-- | src/amd_gx_video.c | 2 | ||||
-rw-r--r-- | src/amd_lx_cursor.c | 5 | ||||
-rw-r--r-- | src/amd_lx_driver.c | 23 | ||||
-rw-r--r-- | src/amd_lx_exa.c | 7 | ||||
-rw-r--r-- | src/amd_lx_rotate.c | 5 | ||||
-rw-r--r-- | src/amd_lx_video.c | 16 | ||||
-rw-r--r-- | src/amd_msr.c | 1 |
12 files changed, 103 insertions, 83 deletions
@@ -34,6 +34,7 @@ #include "vgaHW.h" #include "xf86int10.h" +#include <X11/extensions/randr.h> #include "xf86xv.h" @@ -482,4 +483,43 @@ int GeodeCalculatePitchBytes(unsigned int width, unsigned int bpp); int GeodeReadMSR(unsigned long addr, unsigned long *lo, unsigned long *hi); int GeodeWriteMSR(unsigned long addr, unsigned long lo, unsigned long hi); +/* amd_gx_cursor.c */ +Bool GXHWCursorInit(ScreenPtr pScrn); +void GXLoadCursorImage(ScrnInfoPtr pScrni, unsigned char *src); +void GXHideCursor(ScrnInfoPtr pScrni); +void GXShowCursor(ScrnInfoPtr pScrni); + +/* amd_gx_randr.c */ +Rotation GXGetRotation(ScreenPtr pScreen); +Bool GXRandRInit(ScreenPtr pScreen, int rotation); + +/* amd_gx_rotate.c */ +Bool GXRotate(ScrnInfoPtr pScrni, DisplayModePtr mode); + +/* amd_gx_accel.c */ +Bool GXAccelInit(ScreenPtr pScrn); + +/* amd_gx_video.c */ +void GXInitVideo(ScreenPtr pScrn); + +/* amd_lx_cursor.c */ +Bool LXHWCursorInit(ScreenPtr pScrn); +void LXLoadCursorImage(ScrnInfoPtr pScrni, unsigned char *src); +void LXHideCursor(ScrnInfoPtr pScrni); +void LXShowCursor(ScrnInfoPtr pScrni); + +/* amd_lx_randr.c */ +Rotation LXGetRotation(ScreenPtr pScreen); +Bool LXRandRInit(ScreenPtr pScreen, int rotation); + +/* amd_lx_rotate.c */ +Bool LXSetRotatePitch(ScrnInfoPtr pScrni); +Bool LXRotate(ScrnInfoPtr pScrni, DisplayModePtr mode); + +/* amd_lx_exa.c */ +Bool LXExaInit(ScreenPtr pScreen); + +/* amd_lx_video.c */ +void LXInitVideo(ScreenPtr pScrn); + #endif /* _AMD_GEODE_H_ */ diff --git a/src/amd_gx_accel.c b/src/amd_gx_accel.c index 798f26f..84281f1 100644 --- a/src/amd_gx_accel.c +++ b/src/amd_gx_accel.c @@ -438,9 +438,8 @@ static void GXSubsequentMono8x8PatternFillRect(ScrnInfoPtr pScrni, int patx, int paty, int x, int y, int w, int h) { - DBLOG(2, - "GXSubsequentMono8x8PatternFillRect() pat %#x,%#x at %d,%d %dx%d\n", - patx, paty, x, y, w, h); + DEBUGMSG(1, (0, X_INFO, "%s() pat %#x,%#x at %d,%d %dx%d\n", + __func__, patx, paty, x, y, w, h)); #ifndef OPT_ACCEL gfx_pattern_fill(x, y, w, h); #else @@ -481,8 +480,8 @@ static void GXSetupForScreenToScreenCopy(ScrnInfoPtr pScrni, int xdir, int ydir, int rop, uint planemask, int trans_color) { - DBLOG(2, "GXSetupForScreenToScreenCopy() xd%d yd%d rop %#x %#x %#x\n", - xdir, ydir, rop, planemask, trans_color); + DEBUGMSG(1, (0, X_INFO, "%s() xd%d yd%d rop %#x %#x %#x\n", + __func__, xdir, ydir, rop, planemask, trans_color)); rop &= 0x0F; #ifndef OPT_ACCEL { @@ -542,8 +541,8 @@ static void GXSubsequentScreenToScreenCopy(ScrnInfoPtr pScrni, int x1, int y1, int x2, int y2, int w, int h) { - DBLOG(2, "GXSubsequentScreenToScreenCopy() from %d,%d to %d,%d %dx%d\n", - x1, y1, x2, y2, w, h); + DEBUGMSG(1, (0, X_INFO, "%s() from %d,%d to %d,%d %dx%d\n", + __func__, x1, y1, x2, y2, w, h)); #ifndef OPT_ACCEL { int flags = 0; @@ -617,8 +616,8 @@ GXSetupForScanlineImageWrite(ScrnInfoPtr pScrni, int rop, uint planemask, { GeodeRec *pGeode = GEODEPTR(pScrni); - DBLOG(2, "GXSetupForScanlineImageWrite() rop %#x %#x %#x %d %d\n", - rop, planemask, trans_color, bpp, depth); + DEBUGMSG(1, (0, X_INFO, "%s() rop %#x %#x %#x %d %d\n", + __func__, rop, planemask, trans_color, bpp, depth)); rop &= 0x0F; /* transparency is a parameter to set_rop, but set...pattern clears * transparency */ @@ -651,8 +650,8 @@ static void GXSubsequentScanlineImageWriteRect(ScrnInfoPtr pScrni, int x, int y, int w, int h, int skipleft) { - DBLOG(2, "GXSubsequentScanlineImageWriteRect() rop %d,%d %dx%d %d\n", x, - y, w, h, skipleft); + DEBUGMSG(1, (0, X_INFO, "%s() rop %d,%d %dx%d %d\n", + __func__, x, y, w, h, skipleft)); giwr.x = x; giwr.y = y; giwr.w = w; @@ -691,7 +690,7 @@ GXSubsequentImageWriteScanline(ScrnInfoPtr pScrni, int bufno) #endif #if GX_ONE_LINE_AT_A_TIME - DBLOG(3, "GXSubsequentImageWriteScanline() %d\n", bufno); + DEBUGMSG(1, (0, X_INFO, "%s() %d\n", __func__, bufno)); #if !GX_USE_OFFSCRN_MEM offset = pGeode->AccelImageWriteBuffers[bufno] - pGeode->FBBase; gfx2_screen_to_screen_blt(offset, CALC_FBOFFSET(giwr.x, giwr.y), giwr.w, @@ -704,7 +703,7 @@ GXSubsequentImageWriteScanline(ScrnInfoPtr pScrni, int bufno) #else /* if GX_ONE_LINE_AT_A_TIME */ int blt_height; - DBLOG(3, "GXSubsequentImageWriteScanline() %d\n", bufno); + DEBUGMSG(1, (0, X_INFO, "%s() %d\n", __func__, bufno)); if ((blt_height = pGeode->NoOfImgBuffers) > giwr.h) blt_height = giwr.h; @@ -752,9 +751,8 @@ GXSetupForScanlineCPUToScreenColorExpandFill(ScrnInfoPtr pScrni, GeodeRec *pGeode = GEODEPTR(pScrni); ulong srcpitch; - DBLOG(2, - "GXSetupForScanlineCPUToScreenColorExpandFill() fg %#x bg %#x " - "rop %#x %#x\n", fg, bg, rop, planemask); + DEBUGMSG(1, (0, X_INFO, "%s() fg %#x bg %#x rop %#x %#x\n", + __func__, fg, bg, rop, planemask)); rop &= 0x0F; srcpitch = ((pGeode->Pitch + 31) >> 5) << 2; #ifndef OPT_ACCEL @@ -803,9 +801,8 @@ static void GXSubsequentScanlineCPUToScreenColorExpandFill(ScrnInfoPtr pScrni, int x, int y, int w, int h, int skipleft) { - DBLOG(2, - "GXSubsequentScanlineCPUToScreenColorExpandFill() %d,%d %dx%d %d\n", - x, y, w, h, skipleft); + DEBUGMSG(1, (0, X_INFO, "%s() %d,%d %dx%d %d\n", + __func__, x, y, w, h, skipleft)); gc2s.x = x; gc2s.y = y; gc2s.w = w; @@ -845,7 +842,7 @@ GXSubsequentColorExpandScanline(ScrnInfoPtr pScrni, int bufno) { GeodeRec *pGeode = GEODEPTR(pScrni); - DBLOG(3, "GXSubsequentColorExpandScanline() %d\n", bufno); + DEBUGMSG(1, (0, X_INFO, "%s() %d\n", __func__, bufno)); #ifndef OPT_ACCEL { #if GX_ONE_LINE_AT_A_TIME @@ -929,9 +926,8 @@ static void GXSetupForScreenToScreenColorExpandFill(ScrnInfoPtr pScrni, int fg, int bg, int rop, uint planemask) { - DBLOG(2, - "GXSetupForScreenToScreenColorExpandFill() fg %#x bg %#x " - "rop %#x %#x\n", fg, bg, rop, planemask); + DEBUGMSG(1, (0, X_INFO, "%s() fg %#x bg %#x rop %#x %#x\n", + __func__, fg, bg, rop, planemask)); rop &= 0x0F; #ifndef OPT_ACCEL { @@ -983,9 +979,8 @@ static void GXSubsequentScreenToScreenColorExpandFill(ScrnInfoPtr pScrni, int x, int y, int w, int h, int srcx, int srcy, int offset) { - DBLOG(2, - "GXSubsequentScreenToScreenColorExpandFill() %d,%d %dx%d %d,%d %d\n", - x, y, w, h, srcx, srcy, offset); + DEBUGMSG(1, (0, X_INFO, "%s() %d,%d %dx%d %d,%d %d\n", + __func__, x, y, w, h, srcx, srcy, offset)); #ifndef OPT_ACCEL gfx2_mono_expand_blt(CALC_FBOFFSET(srcx, srcy), offset, 0, CALC_FBOFFSET(x, y), w, h, 0); @@ -1047,7 +1042,8 @@ static unsigned short vmode[] = { static void GXSetupForSolidLine(ScrnInfoPtr pScrni, int color, int rop, uint planemask) { - DBLOG(2, "GXSetupForSolidLine() %#x %#x %#x\n", color, rop, planemask); + DEBUGMSG(1, (0, X_INFO, "%s() %#x %#x %#x\n", + __func__, color, rop, planemask)); rop &= 0x0F; #ifndef OPT_ACCEL gfx_set_solid_pattern(color); @@ -1098,8 +1094,8 @@ GXSubsequentSolidBresenhamLine(ScrnInfoPtr pScrni, int x1, int y1, { long axial, diagn; - DBLOG(2, "GXSubsequentSolidBresenhamLine() %d,%d %d %d, %d %d, %d\n", - x1, y1, absmaj, absmin, err, len, octant); + DEBUGMSG(1, (0, X_INFO, "%s() %d,%d %d %d, %d %d, %d\n", + __func__, x1, y1, absmaj, absmin, err, len, octant)); if (len <= 0) return; axial = absmin; @@ -1145,8 +1141,8 @@ GXSubsequentSolidTwoPointLine(ScrnInfoPtr pScrni, int x0, int y0, long dx, dy, dmaj, dmin, octant, bias; long axial, diagn, err, len; - DBLOG(2, "GXSubsequentSolidTwoPointLine() %d,%d %d,%d, %#x\n", - x0, y0, x1, y1, flags); + DEBUGMSG(1, (0, X_INFO, "%s() %d,%d %d,%d, %#x\n", + __func__, x0, y0, x1, y1, flags)); if ((dx = x1 - x0) < 0) dx = -dx; @@ -1216,7 +1212,8 @@ static void GXSubsequentSolidHorVertLine(ScrnInfoPtr pScrni, int x, int y, int len, int dir) { - DBLOG(2, "GXSubsequentHorVertLine() %d,%d %d %d\n", x, y, len, dir); + DEBUGMSG(1, (0, X_INFO, "%s() %d,%d %d %d\n", + __func__, x, y, len, dir)); #ifndef OPT_ACCEL if (dir == DEGREES_0) gfx_pattern_fill(x, y, len, 1); @@ -1680,7 +1677,6 @@ static Bool amd_gx_exa_CheckComposite(int op, PicturePtr pSrc, PicturePtr pMsk, PicturePtr pDst) { - amd_gx_exa_fmt_t *sfp, *dfp; GeodeRec *pGeode = GEODEPTR_FROM_PICTURE(pDst); if (op > gxPictOpMAX) @@ -1741,7 +1737,7 @@ amd_gx_exa_Composite(PixmapPtr pxDst, int srcX, int srcY, int maskX, int op, current_line, max_lines, lines, pass, scratchPitch; unsigned int srcOffset, srcOfs, srcPitch, srcPch, srcBpp; unsigned int dstOffset, dstOfs, dstPitch, dstPch, dstBpp; - unsigned int sizes, strides, blt_mode, rop, pitch; + unsigned int sizes, strides, blt_mode, rop; GeodeRec *pGeode = GEODEPTR_FROM_PIXMAP(pxDst); //ErrorF("amd_gx_exa_Composite() from %d,%d to %d,%d %dx%d\n", diff --git a/src/amd_gx_cursor.c b/src/amd_gx_cursor.c index 68b8f79..461b774 100644 --- a/src/amd_gx_cursor.c +++ b/src/amd_gx_cursor.c @@ -42,12 +42,8 @@ #include "amd.h" /* Forward declarations of the functions */ -Bool GXHWCursorInit(ScreenPtr pScrn); static void GXSetCursorColors(ScrnInfoPtr pScrni, int bg, int fg); static void GXSetCursorPosition(ScrnInfoPtr pScrni, int x, int y); -void GXLoadCursorImage(ScrnInfoPtr pScrni, unsigned char *src); -void GXHideCursor(ScrnInfoPtr pScrni); -void GXShowCursor(ScrnInfoPtr pScrni); static Bool GXUseHWCursor(ScreenPtr pScrn, CursorPtr pCurs); extern void GXSetVideoPosition(int x, int y, int width, int height, short src_w, short src_h, short drw_w, diff --git a/src/amd_gx_dcon.c b/src/amd_gx_dcon.c index 8058025..a3c5b2c 100644 --- a/src/amd_gx_dcon.c +++ b/src/amd_gx_dcon.c @@ -98,7 +98,7 @@ eccmd(ScrnInfoPtr pScrni, unsigned char cmd) static int boardrev(ScrnInfoPtr pScrni) { - int i, ret; + int ret; ret = eccmd(pScrni, 0x09); diff --git a/src/amd_gx_driver.c b/src/amd_gx_driver.c index eacf2b5..fcb8874 100644 --- a/src/amd_gx_driver.c +++ b/src/amd_gx_driver.c @@ -39,6 +39,7 @@ #include "xf86cmap.h" #include "compiler.h" #include "mipointer.h" +#include "shadow.h" #include <X11/extensions/randr.h> #include "fb.h" #include "miscstruct.h" @@ -294,10 +295,11 @@ GXAllocateMemory(ScreenPtr pScrn, ScrnInfoPtr pScrni, int rotate) xf86DrvMsg(pScrni->scrnIndex, X_INFO, "Cache disabled - no offscreen memory available.\n"); } else - xf86DrvMsgp(pScrni->scrnIndex, X_INFO, + xf86DrvMsg(pScrni->scrnIndex, X_INFO, "XAA offscreen memory has already been allocated.\n"); } } + return ret; } static Bool @@ -353,7 +355,7 @@ GXMapMem(ScrnInfoPtr pScrni) if (!pGeode->NoAccel && pGeode->useEXA) pGeode->pExa->memoryBase = pGeode->FBBase; - xf86DrvMsg(index, X_INFO, "Found Geode %lx %p\n", + xf86DrvMsg(index, X_INFO, "Found Geode %x %p\n", pGeode->FBAvail, pGeode->FBBase); return TRUE; @@ -366,14 +368,14 @@ GXMapMem(ScrnInfoPtr pScrni) static Bool GXCheckVGA(ScrnInfoPtr pScrni) { - char *vgasig = "IBM VGA Compatible"; + const char *vgasig = "IBM VGA Compatible"; vgaHWPtr pvgaHW = VGAHWPTR(pScrni); int ret; if (!vgaHWMapMem(pScrni)) return FALSE; - ret = memcmp(pvgaHW->Base + 0x1E, "IBM VGA Compatible", 18); + ret = memcmp(pvgaHW->Base + 0x1E, vgasig, strlen(vgasig)); vgaHWUnmapMem(pScrni); return ret ? FALSE : TRUE; @@ -389,9 +391,7 @@ GXPreInit(ScrnInfoPtr pScrni, int flags) QQ_WORD msrValue; rgb defaultWeight = { 0, 0, 0 }; int modecnt; - int maj, min; char *s, *panelgeo; - char **modes; pGeode = pScrni->driverPrivate = xnfcalloc(sizeof(GeodeRec), 1); @@ -559,7 +559,7 @@ GXPreInit(ScrnInfoPtr pScrni, int flags) pGeode->Panel = TRUE; } else if (pGeode->Panel) { if (panelgeo != NULL) { - if (GXGetFPInfo(panelgeo, &pGeode->PanelX, &pGeode->PanelY)) + if (GeodeGetFPGeometry(panelgeo, &pGeode->PanelX, &pGeode->PanelY)) pGeode->Panel = FALSE; } #ifdef PNL_SUP @@ -1188,7 +1188,6 @@ GXScreenInit(int scrnIndex, ScreenPtr pScrn, int argc, char **argv) GeodeRec *pGeode = GEODEPTR(pScrni); XF86ModReqInfo shadowReq; int maj, min, ret, rotate; - BOOL shadowfb = TRUE; pGeode->starting = TRUE; @@ -1453,7 +1452,7 @@ GXSetupChipsetFPtr(ScrnInfoPtr pScrn) } /* ====== Common functions ====== -/* These are all the common functions that we use for both GX and LX - They live here + * These are all the common functions that we use for both GX and LX - They live here * because most of them came along for the GX first, and then were adapted to the LX. * We could move these to a common function, but there is no hurry * ============================== */ diff --git a/src/amd_gx_video.c b/src/amd_gx_video.c index 86f2e07..9322da4 100644 --- a/src/amd_gx_video.c +++ b/src/amd_gx_video.c @@ -92,7 +92,6 @@ GXSetVideoPosition() #else #define DBUF 1 -void GXInitVideo(ScreenPtr pScrn); void GXResetVideo(ScrnInfoPtr pScrni); static XF86VideoAdaptorPtr GXSetupImageVideo(ScreenPtr); static void GXInitOffscreenImages(ScreenPtr); @@ -684,7 +683,6 @@ GXCopyData422(unsigned char *src, unsigned char *dst, static void GXVideoSave(ScreenPtr pScreen, ExaOffscreenArea *area) { ScrnInfoPtr pScrni = xf86Screens[pScreen->myNum]; - GeodeRec *pGeode = GEODEPTR(pScrni); GeodePortPrivRec *pPriv = GET_PORT_PRIVATE(pScrni); if (area == pPriv->area) diff --git a/src/amd_lx_cursor.c b/src/amd_lx_cursor.c index f66f62d..1e49822 100644 --- a/src/amd_lx_cursor.c +++ b/src/amd_lx_cursor.c @@ -35,12 +35,8 @@ #include "amd.h" /* Forward declarations of the functions */ -Bool LXHWCursorInit(ScreenPtr pScrn); static void LXSetCursorColors(ScrnInfoPtr pScrni, int bg, int fg); static void LXSetCursorPosition(ScrnInfoPtr pScrni, int x, int y); -void LXLoadCursorImage(ScrnInfoPtr pScrni, unsigned char *src); -void LXHideCursor(ScrnInfoPtr pScrni); -void LXShowCursor(ScrnInfoPtr pScrni); static Bool LXUseHWCursor(ScreenPtr pScrn, CursorPtr pCurs); extern void LXSetVideoPosition(int x, int y, int width, int height, short src_w, short src_h, short drw_w, @@ -84,7 +80,6 @@ LXSetCursorColors(ScrnInfoPtr pScrni, int bg, int fg) static void LXSetCursorPosition(ScrnInfoPtr pScrni, int x, int y) { - static unsigned long panOffset = 0; GeodeRec *pGeode = GEODEPTR(pScrni); int savex, savey; int newX, newY; diff --git a/src/amd_lx_driver.c b/src/amd_lx_driver.c index cfaa0b9..252a4ce 100644 --- a/src/amd_lx_driver.c +++ b/src/amd_lx_driver.c @@ -65,6 +65,7 @@ #include "cim_defs.h" #include "cim_regs.h" #include "amd.h" +#include "shadow.h" /* Bring in VGA functions */ #include "amd_lx_vga.c" @@ -176,7 +177,6 @@ static int lx_set_custom_mode(GeodeRec *pGeode, DisplayModePtr pMode, int bpp) { VG_DISPLAY_MODE mode; - int flags = 0; memset(&mode, 0, sizeof(mode)); @@ -450,7 +450,7 @@ LXMapMem(ScrnInfoPtr pScrni) if (!pGeode->NoAccel) pGeode->pExa->memoryBase = pGeode->FBBase; - xf86DrvMsg(index, X_INFO, "Geode LX video memory %lx bytes at %p\n", + xf86DrvMsg(index, X_INFO, "Geode LX video memory %x bytes at %p\n", pGeode->FBAvail, pGeode->FBBase); return TRUE; @@ -465,14 +465,14 @@ LXCheckVGA(ScrnInfoPtr pScrni) { char bfr[19]; - char *vgasig = "IBM VGA Compatible"; + const char *vgasig = "IBM VGA Compatible"; vgaHWPtr pvgaHW = VGAHWPTR(pScrni); int ret; if (!vgaHWMapMem(pScrni)) return FALSE; - ret = memcmp(pvgaHW->Base + 0x1E, "IBM VGA Compatible", 18); + ret = memcmp(pvgaHW->Base + 0x1E, vgasig, strlen(vgasig)); memcpy(bfr, pvgaHW->Base + 0x1E, 18); vgaHWUnmapMem(pScrni); @@ -487,14 +487,10 @@ LXPreInit(ScrnInfoPtr pScrni, int flags) GeodePtr pGeode; ClockRangePtr GeodeClockRange; OptionInfoRec *GeodeOptions = &LX_GeodeOptions[0]; - int ret; - unsigned long cpuver, cpurev; - QQ_WORD msrValue; + unsigned long cpuver; rgb defaultWeight = { 0, 0, 0 }; int modecnt; - int maj, min; char *s, *panelgeo = NULL; - char **modes; pGeode = pScrni->driverPrivate = xnfcalloc(sizeof(GeodeRec), 1); @@ -534,7 +530,7 @@ LXPreInit(ScrnInfoPtr pScrni, int flags) /* Set up the Cimarron MSR tables */ msr_init_table(); - if (cpuver & 0xFF != CIM_CPU_GEODELX) + if ((cpuver & 0xFF) != CIM_CPU_GEODELX) xf86DrvMsg(pScrni->scrnIndex, X_ERROR, "No Geode LX chipset was detected.\n"); @@ -683,10 +679,10 @@ LXPreInit(ScrnInfoPtr pScrni, int flags) if (pGeode->FBAvail == 0) { unsigned long value; - OUTW(0xAC1C, 0xFC53); - OUTW(0xAC1C, 0x0200); + cim_outw(0xAC1C, 0xFC53); + cim_outw(0xAC1C, 0x0200); - value = (unsigned long)(INW(0xAC1E)) & 0xFE; + value = (unsigned long)(cim_inw(0xAC1E)) & 0xFE; pGeode->FBAvail = value << 20; } @@ -1210,7 +1206,6 @@ LXScreenInit(int scrnIndex, ScreenPtr pScrn, int argc, char **argv) GeodeRec *pGeode = GEODEPTR(pScrni); XF86ModReqInfo shadowReq; int maj, min, ret, rotate; - BOOL shadowfb = TRUE; pGeode->starting = TRUE; diff --git a/src/amd_lx_exa.c b/src/amd_lx_exa.c index 92d5547..4b25908 100644 --- a/src/amd_lx_exa.c +++ b/src/amd_lx_exa.c @@ -287,7 +287,6 @@ static unsigned int lx_get_source_color(PicturePtr pSrc, int x, int y, int dstFo static Bool lx_prepare_solid(PixmapPtr pxMap, int alu, Pixel planemask, Pixel fg) { - GeodeRec *pGeode = GEODEPTR_FROM_PIXMAP(pxMap); int pitch = exaGetPixmapPitch(pxMap); int op = (planemask == ~0U) ? SDfn[alu] : SDfn_PM[alu]; @@ -304,6 +303,7 @@ lx_prepare_solid(PixmapPtr pxMap, int alu, Pixel planemask, Pixel fg) gp_set_solid_source(fg); gp_set_strides(pitch, pitch); gp_write_parameters(); + return TRUE; } static void @@ -321,7 +321,6 @@ static Bool lx_prepare_copy( PixmapPtr pxSrc, PixmapPtr pxDst, int dx, int dy, int alu, Pixel planemask) { - GeodeRec *pGeode = GEODEPTR_FROM_PIXMAP(pxDst); int dpitch = exaGetPixmapPitch(pxDst); int op = (planemask == ~0U) ? SDfn[alu] : SDfn_PM[alu]; @@ -341,6 +340,7 @@ lx_prepare_copy( PixmapPtr pxSrc, PixmapPtr pxDst, int dx, int dy, gp_set_strides(dpitch, exaScratch.srcPitch); gp_write_parameters(); + return TRUE; } static void @@ -513,7 +513,6 @@ static Bool lx_prepare_composite(int op, PicturePtr pSrc, PicturePtr pMsk, { GeodeRec *pGeode = GEODEPTR_FROM_PIXMAP(pxDst); const struct exa_format_t *srcFmt, *dstFmt; - int apply; /* Get the formats for the source and destination */ @@ -656,7 +655,7 @@ int lx_get_bpp_from_format(int format) { * are the same */ -static lx_set_source_format(int srcFormat, int dstFormat) +static void lx_set_source_format(int srcFormat, int dstFormat) { if (!(srcFormat & 0x10) && (dstFormat & 0x10)) gp_set_source_format(srcFormat | 0x10); diff --git a/src/amd_lx_rotate.c b/src/amd_lx_rotate.c index 4a9c97e..4458a96 100644 --- a/src/amd_lx_rotate.c +++ b/src/amd_lx_rotate.c @@ -61,8 +61,6 @@ LXUpdateFunc(ScreenPtr pScreen, shadowBufPtr pBuf) ScrnInfoPtr pScrni = xf86Screens[pScreen->myNum]; GeodeRec *pGeode = GEODEPTR(pScrni); - unsigned int srcBase; - fbGetDrawable (&pShadow->drawable, shaBits, shaStride, shaBpp, shaXoff, shaYoff); @@ -145,11 +143,12 @@ Bool LXSetRotatePitch(ScrnInfoPtr pScrni) pScrni->displayWidth = pGeode->displayWidth; if (pGeode->Compression) - pGeode->Pitch = LXCalculatePitchBytes(pScrni->displayWidth, + pGeode->Pitch = GeodeCalculatePitchBytes(pScrni->displayWidth, pScrni->bitsPerPixel); else pGeode->Pitch = (pScrni->displayWidth * (pScrni->bitsPerPixel >> 3)); + return TRUE; } Bool diff --git a/src/amd_lx_video.c b/src/amd_lx_video.c index 414b5e4..13129c0 100644 --- a/src/amd_lx_video.c +++ b/src/amd_lx_video.c @@ -123,7 +123,6 @@ LXVideoSave(ScreenPtr pScreen, ExaOffscreenArea *area) { ScrnInfoPtr pScrni = xf86Screens[pScreen->myNum]; - GeodeRec *pGeode = GEODEPTR(pScrni); GeodePortPrivRec *pPriv = GET_PORT_PRIVATE(pScrni); if (area == pPriv->area) @@ -134,7 +133,6 @@ LXVideoSave(ScreenPtr pScreen, ExaOffscreenArea *area) static unsigned int LXAllocateVidMem(ScrnInfoPtr pScrni, void **memp, int size) { - GeodeRec *pGeode = GEODEPTR(pScrni); ExaOffscreenArea *area = *memp; if (area != NULL) { @@ -359,7 +357,8 @@ LXCopyPacked(ScrnInfoPtr pScrni, int id, unsigned char *buf, return TRUE; } - + +void LXDisplayVideo(ScrnInfoPtr pScrni, int id, short width, short height, BoxPtr dstBox, short srcW, short srcH, short drawW, short drawH) { @@ -762,7 +761,6 @@ LXDisplaySurface(XF86SurfacePtr surface, ScrnInfoPtr pScrni = surface->pScrn; GeodePortPrivRec *portPriv = GET_PORT_PRIVATE(pScrni); - INT32 x1, y1, x2, y2; BoxRec dstBox; dstBox.x1 = drawX; @@ -770,7 +768,7 @@ LXDisplaySurface(XF86SurfacePtr surface, dstBox.y1 = drawY; dstBox.y2 = drawY + drawH; - if (drawW <= 0 | drawH <=0) + if ((drawW <= 0) | (drawH <=0)) return Success; /* Is this still valid? */ @@ -806,7 +804,7 @@ LXAllocateSurface(ScrnInfoPtr pScrni, int id, unsigned short w, { GeodeRec *pGeode = GEODEPTR(pScrni); void * area = NULL; - int pitch, fbpitch, lines; + int pitch, lines; unsigned offset; struct OffscreenPrivRec *pPriv; @@ -819,8 +817,12 @@ LXAllocateSurface(ScrnInfoPtr pScrni, int id, unsigned short w, pitch = ((w << 1) + 15) & ~15; lines = ((pitch * h) + (pGeode->Pitch - 1)) / pGeode->Pitch; - if (!(offset = LXVidAllocMem(pScrni, &area, lines))) + offset = LXAllocateVidMem(pScrni, &area, lines); + + if (offset == 0) { + ErrorF("Error while allocating an offscreen region.\n"); return BadAlloc; + } surface->width = w; surface->height = h; diff --git a/src/amd_msr.c b/src/amd_msr.c index b50134e..12b9f73 100644 --- a/src/amd_msr.c +++ b/src/amd_msr.c @@ -4,6 +4,7 @@ #include <fcntl.h> #include <sys/types.h> #include <sys/errno.h> +#include "os.h" static int _msr_open(void) { |