diff options
author | Wang Zhenyu <zhenyu.z.wang@intel.com> | 2007-05-18 10:10:34 +0800 |
---|---|---|
committer | Wang Zhenyu <zhenyu.z.wang@intel.com> | 2007-05-18 10:10:34 +0800 |
commit | 4120a20626998272424225261f2cf7960b7ec0ca (patch) | |
tree | a9373564cc59d7f125e2029d68d884d4471aeaa9 | |
parent | 8db28aeaa6e908017b40bd9180f144a2972f6278 (diff) |
EXA: add render enter helper function
That notify mesa rendering is smashing the state, and check last 3d
operation to do sync after we're swapped in or others.
-rw-r--r-- | src/i830.h | 2 | ||||
-rw-r--r-- | src/i830_exa.c | 16 | ||||
-rw-r--r-- | src/i830_render.c | 10 | ||||
-rw-r--r-- | src/i915_render.c | 6 | ||||
-rw-r--r-- | src/i965_render.c | 10 |
5 files changed, 23 insertions, 21 deletions
@@ -695,6 +695,8 @@ void i830_get_transformed_coordinates(int x, int y, PictTransformPtr transform, float *x_out, float *y_out); +void i830_enter_render(ScrnInfoPtr); + extern const int I830PatternROP[16]; extern const int I830CopyROP[16]; diff --git a/src/i830_exa.c b/src/i830_exa.c index 17417327..ff21fbb6 100644 --- a/src/i830_exa.c +++ b/src/i830_exa.c @@ -270,6 +270,22 @@ I830EXADoneCopy(PixmapPtr pDstPixmap) #endif } +void +i830_enter_render(ScrnInfoPtr pScrn) +{ + I830Ptr pI830 = I830PTR(pScrn); +#ifdef XF86DRI + if (pI830->directRenderingEnabled) { + drmI830Sarea *pSAREAPriv = DRIGetSAREAPrivate(pScrn->pScreen); + pSAREAPriv->ctxOwner = DRIGetContext(pScrn->pScreen); + } +#endif + if (pI830->last_3d != LAST_3D_RENDER) { + i830WaitSync(pScrn); + pI830->last_3d = LAST_3D_RENDER; + } +} + #define xFixedToFloat(val) \ ((float)xFixedToInt(val) + ((float)xFixedFrac(val) / 65536.0)) diff --git a/src/i830_render.c b/src/i830_render.c index 077afa1a..957953e7 100644 --- a/src/i830_render.c +++ b/src/i830_render.c @@ -400,12 +400,12 @@ i830_prepare_composite(int op, PicturePtr pSrcPicture, I830Ptr pI830 = I830PTR(pScrn); CARD32 dst_format, dst_offset, dst_pitch; + i830_enter_render(pScrn); + i830_get_dest_format(pDstPicture, &dst_format); dst_offset = intel_get_pixmap_offset(pDst); dst_pitch = intel_get_pixmap_pitch(pDst); - pI830->last_3d = LAST_3D_RENDER; - if (!i830_texture_setup(pSrcPicture, pSrc, 0)) I830FALLBACK("fail to setup src texture\n"); if (pMask != NULL) { @@ -632,9 +632,5 @@ i830_composite(PixmapPtr pDst, int srcX, int srcY, int maskX, int maskY, void i830_done_composite(PixmapPtr pDst) { -#if ALWAYS_SYNC - ScrnInfoPtr pScrn = xf86Screens[pDst->drawable.pScreen->myNum]; - - I830Sync(pScrn); -#endif + /* NO-OP */ } diff --git a/src/i915_render.c b/src/i915_render.c index 5b2ed891..d5a8579a 100644 --- a/src/i915_render.c +++ b/src/i915_render.c @@ -315,11 +315,7 @@ i915_prepare_composite(int op, PicturePtr pSrcPicture, CARD32 dst_format, dst_offset, dst_pitch; CARD32 blendctl; -#ifdef I830DEBUG - ErrorF("Enter i915 prepareComposite\n"); -#endif - - pI830->last_3d = LAST_3D_RENDER; + i830_enter_render(pScrn); i915_get_dest_format(pDstPicture, &dst_format); dst_offset = intel_get_pixmap_offset(pDst); diff --git a/src/i965_render.c b/src/i965_render.c index bfbb77ea..848774e9 100644 --- a/src/i965_render.c +++ b/src/i965_render.c @@ -404,15 +404,7 @@ i965_prepare_composite(int op, PicturePtr pSrcPicture, CARD32 dst_format, dst_offset, dst_pitch; Bool rotation_program = FALSE; -#ifdef XF86DRI - if (pI830->directRenderingEnabled) { - drmI830Sarea *pSAREAPriv = DRIGetSAREAPrivate(pScrn->pScreen); - - pSAREAPriv->ctxOwner = DRIGetContext(pScrn->pScreen); - } -#endif - - pI830->last_3d = LAST_3D_RENDER; + i830_enter_render(pScrn); src_offset = intel_get_pixmap_offset(pSrc); src_pitch = intel_get_pixmap_pitch(pSrc); |