xf86-video-intel: 3 commits - src/i830_accel.c src/i830_exa.c src/i830.h src/i830_render.c src/i915_render.c src/i965_render.c

Zhenyu Wang zhen at kemper.freedesktop.org
Thu May 17 19:12:43 PDT 2007


 src/i830.h        |    2 ++
 src/i830_accel.c  |   17 ++++++++++-------
 src/i830_exa.c    |   16 ++++++++++++++++
 src/i830_render.c |   10 +++-------
 src/i915_render.c |   12 ++----------
 src/i965_render.c |   10 +---------
 6 files changed, 34 insertions(+), 33 deletions(-)

New commits:
diff-tree 4120a20626998272424225261f2cf7960b7ec0ca (from 8db28aeaa6e908017b40bd9180f144a2972f6278)
Author: Wang Zhenyu <zhenyu.z.wang at intel.com>
Date:   Fri May 18 10:10:34 2007 +0800

    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.

diff --git a/src/i830.h b/src/i830.h
index ab52da0..8dcc4b5 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -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 1741732..ff21fbb 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 077afa1..957953e 100644
--- a/src/i830_render.c
+++ b/src/i830_render.c
@@ -400,12 +400,12 @@ i830_prepare_composite(int op, PicturePt
     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,
 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 5b2ed89..d5a8579 100644
--- a/src/i915_render.c
+++ b/src/i915_render.c
@@ -315,11 +315,7 @@ i915_prepare_composite(int op, PicturePt
     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 bfbb77e..848774e 100644
--- a/src/i965_render.c
+++ b/src/i965_render.c
@@ -404,15 +404,7 @@ i965_prepare_composite(int op, PicturePt
     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);
diff-tree 8db28aeaa6e908017b40bd9180f144a2972f6278 (from 16e50a91dd8b3676e8ce06052c549ab27e6843b7)
Author: Wang Zhenyu <zhenyu.z.wang at intel.com>
Date:   Fri May 18 09:54:34 2007 +0800

    Fix ring debug code
    
    Use proper unsigned type for timer variables, and try to dump 965G state.

diff --git a/src/i830_accel.c b/src/i830_accel.c
index 045b3b6..5cbad44 100644
--- a/src/i830_accel.c
+++ b/src/i830_accel.c
@@ -96,10 +96,10 @@ I830WaitLpRing(ScrnInfoPtr pScrn, int n,
    I830Ptr pI830 = I830PTR(pScrn);
    I830RingBuffer *ring = pI830->LpRing;
    int iters = 0;
-   int start = 0;
-   int now = 0;
+   unsigned int start = 0;
+   unsigned int now = 0;
    int last_head = 0;
-   int first = 0;
+   unsigned int first = 0;
 
    /* If your system hasn't moved the head pointer in 2 seconds, I'm going to
     * call it crashed.
@@ -128,9 +128,12 @@ I830WaitLpRing(ScrnInfoPtr pScrn, int n,
 	 start = now;
 	 last_head = ring->head;
       } else if (now - start > timeout_millis) {
-	 ErrorF("Error in I830WaitLpRing(), now is %d, start is %d\n", now,
-		start);
-	 i830_dump_error_state(pScrn);
+	 ErrorF("Error in I830WaitLpRing(), timeout for %d seconds\n",
+		timeout_millis/1000);
+	 if (IS_I965G(pI830))
+	     i965_dump_error_state(pScrn);
+	 else
+	     i830_dump_error_state(pScrn);
 	 ErrorF("space: %d wanted %d\n", ring->space, n);
 #ifdef XF86DRI
 	 if (pI830->directRenderingEnabled) {
@@ -153,7 +156,7 @@ I830WaitLpRing(ScrnInfoPtr pScrn, int n,
    if (I810_DEBUG & DEBUG_VERBOSE_ACCEL) {
       now = GetTimeInMillis();
       if (now - first) {
-	 ErrorF("Elapsed %d ms\n", now - first);
+	 ErrorF("Elapsed %u ms\n", now - first);
 	 ErrorF("space: %d wanted %d\n", ring->space, n);
       }
    }
diff-tree 16e50a91dd8b3676e8ce06052c549ab27e6843b7 (from 12a9fcfe1b25cee850380d8ce11ef11cde9aaacb)
Author: Wang Zhenyu <zhenyu.z.wang at intel.com>
Date:   Fri May 18 09:53:36 2007 +0800

    EXA: remove a flush cmd in i915 render code

diff --git a/src/i915_render.c b/src/i915_render.c
index 4d42242..5b2ed89 100644
--- a/src/i915_render.c
+++ b/src/i915_render.c
@@ -375,7 +375,7 @@ i915_prepare_composite(int op, PicturePt
     {
 	CARD32 ss2;
 
-	BEGIN_LP_RING(18);
+	BEGIN_LP_RING(16);
 	/* color buffer
 	 * XXX: Need to add USE_FENCE if we ever tile the X Server's pixmaps or
 	 * visible screen.
@@ -408,10 +408,6 @@ i915_prepare_composite(int op, PicturePt
 	OUT_RING(S6_CBUF_BLEND_ENABLE | S6_COLOR_WRITE_ENABLE |
 		 (BLENDFUNC_ADD << S6_CBUF_BLEND_FUNC_SHIFT) | blendctl);
 
-	/* issue a flush */
-	OUT_RING(MI_FLUSH | MI_WRITE_DIRTY_STATE | MI_INVALIDATE_MAP_CACHE);
-	OUT_RING(MI_NOOP);
-
 	/* draw rect is unconditional */
 	OUT_RING(_3DSTATE_DRAW_RECT_CMD);
 	OUT_RING(0x00000000);


More information about the xorg-commit mailing list