From d00350fd0d301bb73f5e72d7e36ae8f6f698cecf Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Wed, 22 May 2024 21:04:54 +0200 Subject: drop obsolete check for REGION_NULL Since we're depending on at least 1.18, we can rely on it being present. Signed-off-by: Enrico Weigelt, metux IT consult --- src/gx_video.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/gx_video.c') diff --git a/src/gx_video.c b/src/gx_video.c index cc69dc2..847ca83 100644 --- a/src/gx_video.c +++ b/src/gx_video.c @@ -416,11 +416,7 @@ GXSetupImageVideo(ScreenPtr pScrn) #endif /* gotta uninit this someplace */ -#if defined(REGION_NULL) REGION_NULL(pScrn, &pPriv->clip); -#else - REGION_INIT(pScrn, &pPriv->clip, NullBox, 0); -#endif pGeode->adaptor = adapt; -- cgit v1.2.3 From 1bd62d4e151931e41e879ea4cb28b3a6a0600978 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Mon, 27 May 2024 18:02:54 +0200 Subject: drop obsolete XAA support Since recent commits require xserver-1.18.0 or later to build against, there's no reason leaving behind big chunks of code that can only build against the XAA support removed in xserver-1.13.0 (released in 2012). Signed-off-by: Enrico Weigelt, metux IT consult --- src/gx_video.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/gx_video.c') diff --git a/src/gx_video.c b/src/gx_video.c index 847ca83..4eae44f 100644 --- a/src/gx_video.c +++ b/src/gx_video.c @@ -54,10 +54,6 @@ #include "geode.h" #include "xf86xv.h" #include -#ifdef HAVE_XAA_H -#include "xaa.h" -#include "xaalocal.h" -#endif #include "dixstruct.h" #include "fourcc.h" #include "geode_fourcc.h" -- cgit v1.2.3 From e46b0b9a39ec00dd8006d9927aaa21440b30b7bc Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Tue, 28 May 2024 14:49:08 +0200 Subject: drop old compat macros There's used to have separate versions for older Xserver versions, but no anymore, so these aren't needed anymore. Signed-off-by: Enrico Weigelt, metux IT consult --- src/gx_video.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/gx_video.c') diff --git a/src/gx_video.c b/src/gx_video.c index 4eae44f..8b40456 100644 --- a/src/gx_video.c +++ b/src/gx_video.c @@ -1314,14 +1314,13 @@ GeodeQueryImageAttributes(ScrnInfoPtr pScrni, static void GXBlockHandler(BLOCKHANDLER_ARGS_DECL) { - SCREEN_PTR(arg); - ScrnInfoPtr pScrni = xf86ScreenToScrn(pScrn); + ScrnInfoPtr pScrni = xf86ScreenToScrn(pScreen); GeodeRec *pGeode = GEODEPTR(pScrni); GeodePortPrivRec *pPriv = GET_PORT_PRIVATE(pScrni); - pScrn->BlockHandler = pGeode->BlockHandler; - (*pScrn->BlockHandler) (BLOCKHANDLER_ARGS); - pScrn->BlockHandler = GXBlockHandler; + pScreen->BlockHandler = pGeode->BlockHandler; + (*pScreen->BlockHandler) (BLOCKHANDLER_ARGS); + pScreen->BlockHandler = GXBlockHandler; if (pPriv->videoStatus & TIMER_MASK) { GXAccelSync(pScrni); @@ -1350,7 +1349,7 @@ GXBlockHandler(BLOCKHANDLER_ARGS_DECL) if (pPriv->area) { #ifdef XF86EXA if (pGeode->useEXA) - exaOffscreenFree(pScrn, pPriv->area); + exaOffscreenFree(pScrni, pPriv->area); #endif if (!pGeode->useEXA) xf86FreeOffscreenArea(pPriv->area); -- cgit v1.2.3 From 9fbd276f1de0f695f2b884d0778db7a0e12bdc56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin-=C3=89ric=20Racine?= Date: Mon, 24 Jun 2024 10:25:06 +0300 Subject: Remove all deprecated xf86PciInfo.h includes. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We have PCI_VENDOR_ID and PCI_CHIP defined in geode.h. Signed-off-by: Martin-Éric Racine --- src/gx_video.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src/gx_video.c') diff --git a/src/gx_video.c b/src/gx_video.c index 8b40456..70c0410 100644 --- a/src/gx_video.c +++ b/src/gx_video.c @@ -46,7 +46,6 @@ #include "xf86.h" #include "xf86_OSproc.h" #include "compiler.h" -#include "xf86PciInfo.h" #include "xf86Pci.h" #include "xf86fbman.h" #include "regionstr.h" -- cgit v1.2.3 From 224f565dec708eb0f85964e2b74c31b87c3e1808 Mon Sep 17 00:00:00 2001 From: Connor Behan Date: Sun, 23 Jun 2024 22:24:44 -0300 Subject: Suppress majority of compiler warnings This applies some obvious changes to stop gcc from complaining about dead code, shadow declarations, differing signedness and sections that mix declarations with code. The warning about discarding const qualifiers is more annoying because we pass string literals to some functions which accept non-const pointers. Currently, this takes the following approach. If the function *needs* to accept non-const pointers, cast the string literal as char *. Otherwise, change the function to only accept a const pointer. To anticipate future use cases though, I could also leave function definitions as they are and just always cast string literals. Alternatively, if this is more trouble that it is worth, we could just put up with the warnings. Signed-off-by: Connor Behan --- src/gx_video.c | 56 +++++++++++++++++++++++++++----------------------------- 1 file changed, 27 insertions(+), 29 deletions(-) (limited to 'src/gx_video.c') diff --git a/src/gx_video.c b/src/gx_video.c index 70c0410..7c0c162 100644 --- a/src/gx_video.c +++ b/src/gx_video.c @@ -105,8 +105,6 @@ void GXSetVideoPosition(int x, int y, int width, int height, short src_w, short src_h, short drw_w, short drw_h, int id, int offset, ScrnInfoPtr pScrni); -extern void GXAccelSync(ScrnInfoPtr pScrni); - extern int DeltaX, DeltaY; unsigned long graphics_lut[256]; @@ -224,11 +222,11 @@ static XF86VideoFormatRec Formats[NUM_FORMATS] = { static XF86AttributeRec Attributes[NUM_ATTRIBUTES] = { #if DBUF - {XvSettable | XvGettable, 0, 1, "XV_DOUBLE_BUFFER"}, + {XvSettable | XvGettable, 0, 1, (char *)"XV_DOUBLE_BUFFER"}, #endif - {XvSettable | XvGettable, 0, (1 << 24) - 1, "XV_COLORKEY"}, - {XvSettable | XvGettable, 0, 1, "XV_FILTER"}, - {XvSettable | XvGettable, 0, 1, "XV_COLORKEYMODE"} + {XvSettable | XvGettable, 0, (1 << 24) - 1, (char *)"XV_COLORKEY"}, + {XvSettable | XvGettable, 0, 1, (char *)"XV_FILTER"}, + {XvSettable | XvGettable, 0, 1, (char *)"XV_COLORKEYMODE"} }; #define NUM_IMAGES 8 @@ -759,11 +757,11 @@ GXAllocateMemory(ScrnInfoPtr pScrni, void **memp, int numlines) return 0; } -static BoxRec dstBox; +static BoxRec global_dstBox; static int srcPitch = 0, srcPitch2 = 0, dstPitch = 0, dstPitch2 = 0; static INT32 Bx1, Bx2, By1, By2; static int top, left, npixels, nlines; -static int offset, s1offset = 0, s2offset = 0, s3offset = 0; +static int global_offset, s1offset = 0, s2offset = 0, s3offset = 0; static unsigned char *dst_start; static int d2offset = 0, d3offset = 0; @@ -1074,15 +1072,15 @@ GXPutImage(ScrnInfoPtr pScrni, if ((Bx1 >= Bx2) || (By1 >= By2)) return Success; - dstBox.x1 = drw_x; - dstBox.x2 = drw_x + drw_w; - dstBox.y1 = drw_y; - dstBox.y2 = drw_y + drw_h; + global_dstBox.x1 = drw_x; + global_dstBox.x2 = drw_x + drw_w; + global_dstBox.y1 = drw_y; + global_dstBox.y2 = drw_y + drw_h; - dstBox.x1 -= pScrni->frameX0; - dstBox.x2 -= pScrni->frameX0; - dstBox.y1 -= pScrni->frameY0; - dstBox.y2 -= pScrni->frameY0; + global_dstBox.x1 -= pScrni->frameX0; + global_dstBox.x2 -= pScrni->frameX0; + global_dstBox.y1 -= pScrni->frameY0; + global_dstBox.y2 -= pScrni->frameY0; switch (id) { case FOURCC_YV12: @@ -1138,13 +1136,13 @@ GXPutImage(ScrnInfoPtr pScrni, top &= ~1; - offset = pPriv->offset + (top * dstPitch); + global_offset = pPriv->offset + (top * dstPitch); #if DBUF if (pPriv->doubleBuffer && pPriv->currentBuffer) - offset += (new_h >> 1) * pGeode->Pitch; + global_offset += (new_h >> 1) * pGeode->Pitch; #endif - dst_start = pGeode->FBBase + offset + left; + dst_start = pGeode->FBBase + global_offset + left; tmp = ((top >> 1) * srcPitch2) + (left >> 1); s2offset += tmp; s3offset += tmp; @@ -1164,13 +1162,13 @@ GXPutImage(ScrnInfoPtr pScrni, left <<= 1; buf += (top * srcPitch) + left; nlines = By2 - top; - offset = (pPriv->offset) + (top * dstPitch); + global_offset = (pPriv->offset) + (top * dstPitch); #if DBUF if (pPriv->doubleBuffer && pPriv->currentBuffer) - offset += (new_h >> 1) * pGeode->Pitch; + global_offset += (new_h >> 1) * pGeode->Pitch; #endif - dst_start = pGeode->FBBase + offset + left; + dst_start = pGeode->FBBase + global_offset + left; break; } s1offset = (top * srcPitch) + left; @@ -1182,8 +1180,8 @@ GXPutImage(ScrnInfoPtr pScrni, xf86XVFillKeyHelper(pScrni->pScreen, pPriv->colorKey, clipBoxes); } - GXDisplayVideo(pScrni, id, offset, width, height, dstPitch, - Bx1, By1, Bx2, By2, &dstBox, src_w, src_h, drw_w, drw_h); + GXDisplayVideo(pScrni, id, global_offset, width, height, dstPitch, + Bx1, By1, Bx2, By2, &global_dstBox, src_w, src_h, drw_w, drw_h); } #endif switch (id) { @@ -1216,8 +1214,8 @@ GXPutImage(ScrnInfoPtr pScrni, REGION_NUM_RECTS(clipBoxes), REGION_RECTS(clipBoxes)); } - GXDisplayVideo(pScrni, id, offset, width, height, dstPitch, - Bx1, By1, Bx2, By2, &dstBox, src_w, src_h, drw_w, drw_h); + GXDisplayVideo(pScrni, id, global_offset, width, height, dstPitch, + Bx1, By1, Bx2, By2, &global_dstBox, src_w, src_h, drw_w, drw_h); #endif #if XV_PROFILE @@ -1400,7 +1398,7 @@ GXAllocateSurface(ScrnInfoPtr pScrni, fbpitch = pScrni->bitsPerPixel * pScrni->displayWidth >> 3; numlines = ((pitch * h) + fbpitch - 1) / fbpitch; - if (!(offset = GXAllocateMemory(pScrni, &area, numlines))) + if (!(global_offset = GXAllocateMemory(pScrni, &area, numlines))) return BadAlloc; surface->width = w; @@ -1421,14 +1419,14 @@ GXAllocateSurface(ScrnInfoPtr pScrni, } pPriv->area = area; - pPriv->offset = offset; + pPriv->offset = global_offset; pPriv->isOn = FALSE; surface->pScrn = pScrni; surface->id = id; surface->pitches[0] = pitch; - surface->offsets[0] = offset; + surface->offsets[0] = global_offset; surface->devPrivate.ptr = (pointer) pPriv; return Success; -- cgit v1.2.3 From c1a96d05ef0f76e933a8c002c75f548de8c2f14b Mon Sep 17 00:00:00 2001 From: Connor Behan Date: Sun, 23 Jun 2024 02:05:29 -0300 Subject: Fix exaOffscreenFree call --- src/gx_video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gx_video.c') diff --git a/src/gx_video.c b/src/gx_video.c index 7c0c162..4cc2836 100644 --- a/src/gx_video.c +++ b/src/gx_video.c @@ -1346,7 +1346,7 @@ GXBlockHandler(BLOCKHANDLER_ARGS_DECL) if (pPriv->area) { #ifdef XF86EXA if (pGeode->useEXA) - exaOffscreenFree(pScrni, pPriv->area); + exaOffscreenFree(pScrni->pScreen, pPriv->area); #endif if (!pGeode->useEXA) xf86FreeOffscreenArea(pPriv->area); -- cgit v1.2.3