summaryrefslogtreecommitdiff
path: root/src/radeon_exa_render.c
diff options
context:
space:
mode:
authorEgbert Eich <eich@freedesktop.org>2008-07-10 21:49:55 -0400
committerAlex Deucher <alexdeucher@gmail.com>2008-08-25 09:42:06 -0400
commit75ef8dc214715d3c5c50996b293933842903ba65 (patch)
tree0c3c849ff66c0943f8c07354cc9adb1683a0710e /src/radeon_exa_render.c
parent71ad140fa11f3a504c38d6bddf40e3a3c0a20e60 (diff)
Cleanups from rhd port
- remove unused vars - remove static exa render vars
Diffstat (limited to 'src/radeon_exa_render.c')
-rw-r--r--src/radeon_exa_render.c116
1 files changed, 57 insertions, 59 deletions
diff --git a/src/radeon_exa_render.c b/src/radeon_exa_render.c
index ddb28be0..97199ae9 100644
--- a/src/radeon_exa_render.c
+++ b/src/radeon_exa_render.c
@@ -56,15 +56,6 @@
/* Only include the following (generic) bits once. */
#ifdef ONLY_ONCE
-static Bool is_transform[2];
-static PictTransform *transform[2];
-static Bool has_mask;
-/* Whether we are tiling horizontally and vertically */
-static Bool need_src_tile_x;
-static Bool need_src_tile_y;
-/* Size of tiles ... set to 65536x65536 if not tiling in that direction */
-static Bool src_tile_width;
-static Bool src_tile_height;
struct blendinfo {
Bool dst_alpha;
@@ -287,8 +278,10 @@ static Bool RADEONSetupSourceTile(PicturePtr pPict,
Bool canTile1d,
Bool needMatchingPitch)
{
- need_src_tile_x = need_src_tile_y = FALSE;
- src_tile_width = src_tile_height = 65536; /* "infinite" */
+ RINFO_FROM_SCREEN(pPix->drawable.pScreen);
+
+ info->accel_state->need_src_tile_x = info->accel_state->need_src_tile_y = FALSE;
+ info->accel_state->src_tile_width = info->accel_state->src_tile_height = 65536; /* "infinite" */
if (pPict->repeat) {
Bool badPitch = needMatchingPitch && !RADEONPitchMatches(pPix);
@@ -301,17 +294,19 @@ static Bool RADEONSetupSourceTile(PicturePtr pPict,
RADEON_FALLBACK(("Width %d and pitch %u not compatible for repeat\n",
w, (unsigned)exaGetPixmapPitch(pPix)));
} else {
- need_src_tile_x = (w & (w - 1)) != 0 || badPitch;
- need_src_tile_y = (h & (h - 1)) != 0;
+ info->accel_state->need_src_tile_x = (w & (w - 1)) != 0 || badPitch;
+ info->accel_state->need_src_tile_y = (h & (h - 1)) != 0;
if (!canTile1d)
- need_src_tile_x = need_src_tile_y = need_src_tile_x || need_src_tile_y;
+ info->accel_state->need_src_tile_x =
+ info->accel_state->need_src_tile_y =
+ info->accel_state->need_src_tile_x || info->accel_state->need_src_tile_y;
}
- if (need_src_tile_x)
- src_tile_width = w;
- if (need_src_tile_y)
- src_tile_height = h;
+ if (info->accel_state->need_src_tile_x)
+ info->accel_state->src_tile_width = w;
+ if (info->accel_state->need_src_tile_y)
+ info->accel_state->src_tile_height = h;
}
return TRUE;
@@ -357,7 +352,8 @@ static Bool FUNC_NAME(R100TextureSetup)(PicturePtr pPict, PixmapPtr pPix,
uint32_t txfilter, txformat, txoffset, txpitch;
int w = pPict->pDrawable->width;
int h = pPict->pDrawable->height;
- Bool repeat = pPict->repeat && !(unit == 0 && (need_src_tile_x || need_src_tile_y));
+ Bool repeat = pPict->repeat &&
+ !(unit == 0 && (info->accel_state->need_src_tile_x || info->accel_state->need_src_tile_y));
int i;
ACCEL_PREAMBLE();
@@ -427,10 +423,10 @@ static Bool FUNC_NAME(R100TextureSetup)(PicturePtr pPict, PixmapPtr pPix,
FINISH_ACCEL();
if (pPict->transform != 0) {
- is_transform[unit] = TRUE;
- transform[unit] = pPict->transform;
+ info->accel_state->is_transform[unit] = TRUE;
+ info->accel_state->transform[unit] = pPict->transform;
} else {
- is_transform[unit] = FALSE;
+ info->accel_state->is_transform[unit] = FALSE;
}
return TRUE;
@@ -538,9 +534,9 @@ static Bool FUNC_NAME(R100PrepareComposite)(int op,
return FALSE;
if (pMask)
- has_mask = TRUE;
+ info->accel_state->has_mask = TRUE;
else
- has_mask = FALSE;
+ info->accel_state->has_mask = FALSE;
pixel_shift = pDst->drawable.bitsPerPixel >> 4;
@@ -569,7 +565,7 @@ static Bool FUNC_NAME(R100PrepareComposite)(int op,
return FALSE;
pp_cntl |= RADEON_TEX_1_ENABLE;
} else {
- is_transform[1] = FALSE;
+ info->accel_state->is_transform[1] = FALSE;
}
RADEON_SWITCH_TO_3D();
@@ -670,7 +666,8 @@ static Bool FUNC_NAME(R200TextureSetup)(PicturePtr pPict, PixmapPtr pPix,
uint32_t txfilter, txformat, txoffset, txpitch;
int w = pPict->pDrawable->width;
int h = pPict->pDrawable->height;
- Bool repeat = pPict->repeat && !(unit == 0 && (need_src_tile_x || need_src_tile_y));
+ Bool repeat = pPict->repeat &&
+ !(unit == 0 && (info->accel_state->need_src_tile_x || info->accel_state->need_src_tile_y));
int i;
ACCEL_PREAMBLE();
@@ -742,10 +739,10 @@ static Bool FUNC_NAME(R200TextureSetup)(PicturePtr pPict, PixmapPtr pPix,
FINISH_ACCEL();
if (pPict->transform != 0) {
- is_transform[unit] = TRUE;
- transform[unit] = pPict->transform;
+ info->accel_state->is_transform[unit] = TRUE;
+ info->accel_state->transform[unit] = pPict->transform;
} else {
- is_transform[unit] = FALSE;
+ info->accel_state->is_transform[unit] = FALSE;
}
return TRUE;
@@ -837,9 +834,9 @@ static Bool FUNC_NAME(R200PrepareComposite)(int op, PicturePtr pSrcPicture,
return FALSE;
if (pMask)
- has_mask = TRUE;
+ info->accel_state->has_mask = TRUE;
else
- has_mask = FALSE;
+ info->accel_state->has_mask = FALSE;
pixel_shift = pDst->drawable.bitsPerPixel >> 4;
@@ -866,7 +863,7 @@ static Bool FUNC_NAME(R200PrepareComposite)(int op, PicturePtr pSrcPicture,
return FALSE;
pp_cntl |= RADEON_TEX_1_ENABLE;
} else {
- is_transform[1] = FALSE;
+ info->accel_state->is_transform[1] = FALSE;
}
RADEON_SWITCH_TO_3D();
@@ -1048,12 +1045,12 @@ static Bool FUNC_NAME(R300TextureSetup)(PicturePtr pPict, PixmapPtr pPix,
info->accel_state->texW[unit] = w;
info->accel_state->texH[unit] = h;
- if (pPict->repeat && !(unit == 0 && need_src_tile_x))
+ if (pPict->repeat && !(unit == 0 && info->accel_state->need_src_tile_x))
txfilter = R300_TX_CLAMP_S(R300_TX_CLAMP_WRAP);
else
txfilter = R300_TX_CLAMP_S(R300_TX_CLAMP_CLAMP_GL);
- if (pPict->repeat && !(unit == 0 && need_src_tile_y))
+ if (pPict->repeat && !(unit == 0 && info->accel_state->need_src_tile_y))
txfilter |= R300_TX_CLAMP_T(R300_TX_CLAMP_WRAP);
else
txfilter |= R300_TX_CLAMP_T(R300_TX_CLAMP_CLAMP_GL);
@@ -1083,10 +1080,10 @@ static Bool FUNC_NAME(R300TextureSetup)(PicturePtr pPict, PixmapPtr pPix,
FINISH_ACCEL();
if (pPict->transform != 0) {
- is_transform[unit] = TRUE;
- transform[unit] = pPict->transform;
+ info->accel_state->is_transform[unit] = TRUE;
+ info->accel_state->transform[unit] = pPict->transform;
} else {
- is_transform[unit] = FALSE;
+ info->accel_state->is_transform[unit] = FALSE;
}
return TRUE;
@@ -1198,9 +1195,9 @@ static Bool FUNC_NAME(R300PrepareComposite)(int op, PicturePtr pSrcPicture,
return FALSE;
if (pMask)
- has_mask = TRUE;
+ info->accel_state->has_mask = TRUE;
else
- has_mask = FALSE;
+ info->accel_state->has_mask = FALSE;
pixel_shift = pDst->drawable.bitsPerPixel >> 4;
@@ -1230,7 +1227,7 @@ static Bool FUNC_NAME(R300PrepareComposite)(int op, PicturePtr pSrcPicture,
return FALSE;
txenable |= R300_TEX_1_ENABLE;
} else {
- is_transform[1] = FALSE;
+ info->accel_state->is_transform[1] = FALSE;
}
RADEON_SWITCH_TO_3D();
@@ -1938,20 +1935,20 @@ static void FUNC_NAME(RadeonCompositeTile)(PixmapPtr pDst,
maskBottomRight.x = IntToxFixed(maskX + w);
maskBottomRight.y = IntToxFixed(maskY + h);
- if (is_transform[0]) {
- transformPoint(transform[0], &srcTopLeft);
- transformPoint(transform[0], &srcTopRight);
- transformPoint(transform[0], &srcBottomLeft);
- transformPoint(transform[0], &srcBottomRight);
+ if (info->accel_state->is_transform[0]) {
+ transformPoint(info->accel_state->transform[0], &srcTopLeft);
+ transformPoint(info->accel_state->transform[0], &srcTopRight);
+ transformPoint(info->accel_state->transform[0], &srcBottomLeft);
+ transformPoint(info->accel_state->transform[0], &srcBottomRight);
}
- if (is_transform[1]) {
- transformPoint(transform[1], &maskTopLeft);
- transformPoint(transform[1], &maskTopRight);
- transformPoint(transform[1], &maskBottomLeft);
- transformPoint(transform[1], &maskBottomRight);
+ if (info->accel_state->is_transform[1]) {
+ transformPoint(info->accel_state->transform[1], &maskTopLeft);
+ transformPoint(info->accel_state->transform[1], &maskTopRight);
+ transformPoint(info->accel_state->transform[1], &maskBottomLeft);
+ transformPoint(info->accel_state->transform[1], &maskBottomRight);
}
- if (has_mask)
+ if (info->accel_state->has_mask)
vtx_count = VTX_COUNT_MASK;
else
vtx_count = VTX_COUNT;
@@ -1967,7 +1964,7 @@ static void FUNC_NAME(RadeonCompositeTile)(PixmapPtr pDst,
BEGIN_RING(3 * vtx_count + 3);
OUT_RING(CP_PACKET3(RADEON_CP_PACKET3_3D_DRAW_IMMD,
3 * vtx_count + 1));
- if (has_mask)
+ if (info->accel_state->has_mask)
OUT_RING(RADEON_CP_VC_FRMT_XY |
RADEON_CP_VC_FRMT_ST0 |
RADEON_CP_VC_FRMT_ST1);
@@ -2012,7 +2009,7 @@ static void FUNC_NAME(RadeonCompositeTile)(PixmapPtr pDst,
#endif
- if (has_mask) {
+ if (info->accel_state->has_mask) {
if (info->ChipFamily >= CHIP_FAMILY_R200) {
VTX_OUT_MASK((float)dstX, (float)dstY,
xFixedToFloat(srcTopLeft.x) / info->accel_state->texW[0], xFixedToFloat(srcTopLeft.y) / info->accel_state->texH[0],
@@ -2063,8 +2060,9 @@ static void FUNC_NAME(RadeonComposite)(PixmapPtr pDst,
{
int tileSrcY, tileMaskY, tileDstY;
int remainingHeight;
-
- if (!need_src_tile_x && !need_src_tile_y) {
+ RINFO_FROM_SCREEN(pDst->drawable.pScreen);
+
+ if (!info->accel_state->need_src_tile_x && !info->accel_state->need_src_tile_y) {
FUNC_NAME(RadeonCompositeTile)(pDst,
srcX, srcY,
maskX, maskY,
@@ -2075,7 +2073,7 @@ static void FUNC_NAME(RadeonComposite)(PixmapPtr pDst,
/* Tiling logic borrowed from exaFillRegionTiled */
- modulus(srcY, src_tile_height, tileSrcY);
+ modulus(srcY, info->accel_state->src_tile_height, tileSrcY);
tileMaskY = maskY;
tileDstY = dstY;
@@ -2083,18 +2081,18 @@ static void FUNC_NAME(RadeonComposite)(PixmapPtr pDst,
while (remainingHeight > 0) {
int remainingWidth = width;
int tileSrcX, tileMaskX, tileDstX;
- int h = src_tile_height - tileSrcY;
+ int h = info->accel_state->src_tile_height - tileSrcY;
if (h > remainingHeight)
h = remainingHeight;
remainingHeight -= h;
- modulus(srcX, src_tile_width, tileSrcX);
+ modulus(srcX, info->accel_state->src_tile_width, tileSrcX);
tileMaskX = maskX;
tileDstX = dstX;
while (remainingWidth > 0) {
- int w = src_tile_width - tileSrcX;
+ int w = info->accel_state->src_tile_width - tileSrcX;
if (w > remainingWidth)
w = remainingWidth;
remainingWidth -= w;