summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2009-03-02 15:38:35 -0500
committerAlex Deucher <alexdeucher@gmail.com>2009-03-02 15:38:35 -0500
commit4ad1c4decfee653dbbc1ea2ca4270487be622382 (patch)
tree5b1e0daf500a88110249ef939eb358d91901ffa1
parentb7164ac4ad55e5d0fc474df8ae762b469b91ba30 (diff)
R6xx/R7xx EXA: cleanup composite texture setup
-rw-r--r--src/r600_exa.c45
1 files changed, 18 insertions, 27 deletions
diff --git a/src/r600_exa.c b/src/r600_exa.c
index f4066308..b7e9e51c 100644
--- a/src/r600_exa.c
+++ b/src/r600_exa.c
@@ -1102,6 +1102,16 @@ static Bool R600TextureSetup(PicturePtr pPict, PixmapPtr pPix,
CLEAR (tex_res);
CLEAR (tex_samp);
+ accel_state->src_mc_addr[unit] = exaGetPixmapOffset(pPix) + info->fbLocation + pScrn->fbOffset;
+ accel_state->src_pitch[unit] = exaGetPixmapPitch(pPix) / (pPix->drawable.bitsPerPixel / 8);
+ accel_state->src_size[unit] = exaGetPixmapPitch(pPix) * pPix->drawable.height;
+
+ if (accel_state->src_pitch[1] & 7)
+ RADEON_FALLBACK(("Bad pitch %d 0x%x\n", (int)accel_state->src_pitch[unit], unit));
+
+ if (accel_state->src_mc_addr[1] & 0xff)
+ RADEON_FALLBACK(("Bad offset %d 0x%x\n", (int)accel_state->src_mc_addr[unit], unit));
+
for (i = 0; i < sizeof(R600TexFormats) / sizeof(R600TexFormats[0]); i++) {
if (R600TexFormats[i].fmt == pPict->format)
break;
@@ -1330,22 +1340,12 @@ static Bool R600PrepareComposite(int op, PicturePtr pSrcPicture,
accel_state->dst_pitch = exaGetPixmapPitch(pDst) / (pDst->drawable.bitsPerPixel / 8);
accel_state->dst_size = exaGetPixmapPitch(pDst) * pDst->drawable.height;
- accel_state->src_mc_addr[0] = exaGetPixmapOffset(pSrc) + info->fbLocation + pScrn->fbOffset;
- accel_state->src_pitch[0] = exaGetPixmapPitch(pSrc) / (pSrc->drawable.bitsPerPixel / 8);
- accel_state->src_size[0] = exaGetPixmapPitch(pSrc) * pSrc->drawable.height;
-
if (accel_state->dst_pitch & 7)
RADEON_FALLBACK(("Bad dst pitch 0x%x\n", (int)accel_state->dst_pitch));
if (accel_state->dst_mc_addr & 0xff)
RADEON_FALLBACK(("Bad destination offset 0x%x\n", (int)accel_state->dst_mc_addr));
- if (accel_state->src_pitch[0] & 7)
- RADEON_FALLBACK(("Bad src pitch 0x%x\n", (int)accel_state->src_pitch[0]));
-
- if (accel_state->src_mc_addr[0] & 0xff)
- RADEON_FALLBACK(("Bad src offset 0x%x\n", (int)accel_state->src_mc_addr[0]));
-
if (!R600GetDestFormat(pDstPicture, &dst_format))
return FALSE;
@@ -1353,16 +1353,6 @@ static Bool R600PrepareComposite(int op, PicturePtr pSrcPicture,
int src_a, src_r, src_g, src_b;
int mask_a, mask_r, mask_g, mask_b;
- accel_state->src_mc_addr[1] = exaGetPixmapOffset(pMask) + info->fbLocation + pScrn->fbOffset;
- accel_state->src_pitch[1] = exaGetPixmapPitch(pMask) / (pMask->drawable.bitsPerPixel / 8);
- accel_state->src_size[1] = exaGetPixmapPitch(pMask) * pMask->drawable.height;
-
- if (accel_state->src_pitch[1] & 7)
- RADEON_FALLBACK(("Bad mask pitch 0x%x\n", (int)accel_state->src_pitch[1]));
-
- if (accel_state->src_mc_addr[1] & 0xff)
- RADEON_FALLBACK(("Bad mask offset 0x%x\n", (int)accel_state->src_mc_addr[1]));
-
/* setup pixel shader */
if (PICT_FORMAT_RGB(pSrcPicture->format) == 0) {
src_r = SQ_SEL_0;
@@ -1484,17 +1474,18 @@ static Bool R600PrepareComposite(int op, PicturePtr pSrcPicture,
EREG(accel_state->ib, PA_CL_VTE_CNTL, VTX_XY_FMT_bit);
EREG(accel_state->ib, PA_CL_CLIP_CNTL, CLIP_DISABLE_bit);
- /* fix me if false discard buffer! */
- if (!R600TextureSetup(pSrcPicture, pSrc, 0))
+ if (!R600TextureSetup(pSrcPicture, pSrc, 0)) {
+ R600IBDiscard(pScrn, accel_state->ib);
return FALSE;
+ }
- if (pMask != NULL) {
- /* fix me if false discard buffer! */
- if (!R600TextureSetup(pMaskPicture, pMask, 1))
+ if (pMask) {
+ if (!R600TextureSetup(pMaskPicture, pMask, 1)) {
+ R600IBDiscard(pScrn, accel_state->ib);
return FALSE;
- } else {
+ }
+ } else
accel_state->is_transform[1] = FALSE;
- }
/* VS bool constant */
if (pMask)