From 8dd7ccf37e2de6d80b556e6d18af244cefc1e417 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 16 Jul 2009 11:40:51 -0700 Subject: Fix 915-class Render after the 8xx-class Render fix. The two shared i830_composite.c, so giving i830 atomic batch support triggered anger about starting i830's atomic area while in i915's atomic area. Instead, split the emit-a-primitive stuff from the state emission. --- src/i830.h | 3 +++ src/i830_render.c | 45 +++++++++++++++++++++++++++++---------------- src/i915_render.c | 3 ++- 3 files changed, 34 insertions(+), 17 deletions(-) diff --git a/src/i830.h b/src/i830.h index ec576620..54dddd84 100644 --- a/src/i830.h +++ b/src/i830.h @@ -788,6 +788,9 @@ i830_transform_is_affine (PictTransformPtr t); void i830_composite(PixmapPtr pDst, int srcX, int srcY, int maskX, int maskY, int dstX, int dstY, int w, int h); +void i830_emit_composite_primitive(PixmapPtr pDst, int srcX, int srcY, + int maskX, int maskY, int dstX, int dstY, + int w, int h); void i830_done_composite(PixmapPtr pDst); /* i915_render.c */ Bool i915_check_composite(int op, PicturePtr pSrc, PicturePtr pMask, diff --git a/src/i830_render.c b/src/i830_render.c index ecee6f2a..c5196ccd 100644 --- a/src/i830_render.c +++ b/src/i830_render.c @@ -581,14 +581,10 @@ i830_emit_composite_state(ScrnInfoPtr pScrn) } } -/** - * Do a single rectangle composite operation. - * - * This function is shared between i830 and i915 generation code. - */ void -i830_composite(PixmapPtr pDst, int srcX, int srcY, int maskX, int maskY, - int dstX, int dstY, int w, int h) +i830_emit_composite_primitive(PixmapPtr pDst, int srcX, int srcY, + int maskX, int maskY, + int dstX, int dstY, int w, int h) { ScrnInfoPtr pScrn = xf86Screens[pDst->drawable.pScreen->myNum]; I830Ptr pI830 = I830PTR(pScrn); @@ -670,15 +666,6 @@ i830_composite(PixmapPtr pDst, int srcX, int srcY, int maskX, int maskY, num_floats = 3 * per_vertex; - intel_batch_start_atomic(pScrn, - 58 + /* invarient */ - 24 + /* setup */ - 20 + /* 2 * setup_texture */ - 6 + num_floats /* verts */); - - if (pI830->needs_render_state_emit) - i830_emit_composite_state(pScrn); - BEGIN_BATCH(6 + num_floats); OUT_BATCH(MI_NOOP); @@ -740,6 +727,32 @@ i830_composite(PixmapPtr pDst, int srcX, int srcY, int maskX, int maskY, } ADVANCE_BATCH(); +} + + +/** + * Do a single rectangle composite operation. + * + * This function is shared between i830 and i915 generation code. + */ +void +i830_composite(PixmapPtr pDst, int srcX, int srcY, int maskX, int maskY, + int dstX, int dstY, int w, int h) +{ + ScrnInfoPtr pScrn = xf86Screens[pDst->drawable.pScreen->myNum]; + I830Ptr pI830 = I830PTR(pScrn); + + intel_batch_start_atomic(pScrn, + 58 + /* invarient */ + 24 + /* setup */ + 20 + /* 2 * setup_texture */ + 6 + 30 /* verts */); + + if (pI830->needs_render_state_emit) + i830_emit_composite_state(pScrn); + + i830_emit_composite_primitive(pDst, srcX, srcY, maskX, maskY, dstX, dstY, + w, h); intel_batch_end_atomic(pScrn); diff --git a/src/i915_render.c b/src/i915_render.c index ab04e9c9..2d119862 100644 --- a/src/i915_render.c +++ b/src/i915_render.c @@ -556,7 +556,8 @@ i915_composite(PixmapPtr pDst, int srcX, int srcY, int maskX, int maskY, if (pI830->i915_render_state.needs_emit) i915_emit_composite_setup(pScrn); - i830_composite(pDst, srcX, srcY, maskX, maskY, dstX, dstY, w, h); + i830_emit_composite_primitive(pDst, srcX, srcY, maskX, maskY, dstX, dstY, + w, h); intel_batch_end_atomic(pScrn); } -- cgit v1.2.3