summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2009-01-19 20:24:20 -0800
committerEric Anholt <eric@anholt.net>2009-02-24 12:21:00 -0800
commit11a420003252c4158b16aece08bc33170f938183 (patch)
treebf2bfcbb417b8de39993b7e79792a9853258131a
parentb6c6310da1f6bb7b4011246759c559f18956acab (diff)
downloadxf86-video-intel-11a420003252c4158b16aece08bc33170f938183.tar.gz
xf86-video-intel-11a420003252c4158b16aece08bc33170f938183.tar.bz2
xf86-video-intel-11a420003252c4158b16aece08bc33170f938183.zip
Move filter computation from emit_batch_header to prepare_composite.
(cherry picked from commit 013e2adfbf955cb21450b610091542ebd54392c2)
-rw-r--r--src/i965_render.c52
1 files changed, 31 insertions, 21 deletions
diff --git a/src/i965_render.c b/src/i965_render.c
index 821be40a9..f4ad29c3f 100644
--- a/src/i965_render.c
+++ b/src/i965_render.c
@@ -502,6 +502,10 @@ typedef struct gen4_composite_op {
PixmapPtr mask;
PixmapPtr dest;
drm_intel_bo *binding_table_bo;
+ sampler_state_filter_t src_filter;
+ sampler_state_filter_t mask_filter;
+ sampler_state_extend_t src_extend;
+ sampler_state_extend_t mask_extend;
} gen4_composite_op;
/** Private data for gen4 render accel implementation. */
@@ -982,8 +986,10 @@ _emit_batch_header_for_composite_internal (ScrnInfoPtr pScrn, Bool check_twice)
PixmapPtr pMask = composite_op->mask;
PixmapPtr pDst = composite_op->dest;
uint32_t sf_state_offset;
- sampler_state_filter_t src_filter, mask_filter;
- sampler_state_extend_t src_extend, mask_extend;
+ sampler_state_filter_t src_filter = composite_op->src_filter;
+ sampler_state_filter_t mask_filter = composite_op->mask_filter;
+ sampler_state_extend_t src_extend = composite_op->src_extend;
+ sampler_state_extend_t mask_extend = composite_op->mask_extend;
Bool is_affine_src, is_affine_mask, is_affine;
int urb_vs_start, urb_vs_size;
int urb_gs_start, urb_gs_size;
@@ -1061,25 +1067,6 @@ _emit_batch_header_for_composite_internal (ScrnInfoPtr pScrn, Bool check_twice)
i965_get_blend_cntl(op, pMaskPicture, pDstPicture->format,
&src_blend, &dst_blend);
- src_filter = sampler_state_filter_from_picture (pSrcPicture->filter);
- if (src_filter < 0)
- I830FALLBACK ("Bad src filter 0x%x\n", pSrcPicture->filter);
- src_extend = sampler_state_extend_from_picture (pSrcPicture->repeatType);
- if (src_extend < 0)
- I830FALLBACK ("Bad src repeat 0x%x\n", pSrcPicture->repeatType);
-
- if (pMaskPicture) {
- mask_filter = sampler_state_filter_from_picture (pMaskPicture->filter);
- if (mask_filter < 0)
- I830FALLBACK ("Bad mask filter 0x%x\n", pMaskPicture->filter);
- mask_extend = sampler_state_extend_from_picture (pMaskPicture->repeatType);
- if (mask_extend < 0)
- I830FALLBACK ("Bad mask repeat 0x%x\n", pMaskPicture->repeatType);
- } else {
- mask_filter = SAMPLER_STATE_FILTER_NEAREST;
- mask_extend = SAMPLER_STATE_EXTEND_NONE;
- }
-
/* Begin the long sequence of commands needed to set up the 3D
* rendering pipe
*/
@@ -1331,6 +1318,27 @@ i965_prepare_composite(int op, PicturePtr pSrcPicture,
uint32_t *binding_table;
drm_intel_bo *binding_table_bo, *surface_state_bo;
+ if (composite_op->src_filter < 0)
+ I830FALLBACK("Bad src filter 0x%x\n", pSrcPicture->filter);
+ composite_op->src_extend =
+ sampler_state_extend_from_picture(pSrcPicture->repeatType);
+ if (composite_op->src_extend < 0)
+ I830FALLBACK("Bad src repeat 0x%x\n", pSrcPicture->repeatType);
+
+ if (pMaskPicture) {
+ composite_op->mask_filter =
+ sampler_state_filter_from_picture(pMaskPicture->filter);
+ if (composite_op->mask_filter < 0)
+ I830FALLBACK("Bad mask filter 0x%x\n", pMaskPicture->filter);
+ composite_op->mask_extend =
+ sampler_state_extend_from_picture(pMaskPicture->repeatType);
+ if (composite_op->mask_extend < 0)
+ I830FALLBACK("Bad mask repeat 0x%x\n", pMaskPicture->repeatType);
+ } else {
+ composite_op->mask_filter = SAMPLER_STATE_FILTER_NEAREST;
+ composite_op->mask_extend = SAMPLER_STATE_EXTEND_NONE;
+ }
+
/* Set up the surface states. */
surface_state_bo = dri_bo_alloc(pI830->bufmgr, "surface_state",
3 * sizeof (brw_surface_state_padded),
@@ -1394,6 +1402,8 @@ i965_prepare_composite(int op, PicturePtr pSrcPicture,
composite_op->dest = pDst;
drm_intel_bo_unreference(composite_op->binding_table_bo);
composite_op->binding_table_bo = binding_table_bo;
+ composite_op->src_filter =
+ sampler_state_filter_from_picture(pSrcPicture->filter);
/* Fallback if we can't make this operation fit. */
return _emit_batch_header_for_composite_check_twice (pScrn);