xf86-video-intel: 5 commits - src/i830_batchbuffer.h src/i830_driver.c src/i965_video.c

Keith Packard keithp at kemper.freedesktop.org
Fri May 1 11:55:29 PDT 2009


 src/i830_batchbuffer.h |    2 +-
 src/i830_driver.c      |    5 +++--
 src/i965_video.c       |   13 ++++++++-----
 3 files changed, 12 insertions(+), 8 deletions(-)

New commits:
commit 11a853bd8e5d907fe7f5bd907453bcdac9032861
Author: Keith Packard <keithp at keithp.com>
Date:   Fri May 1 11:51:13 2009 -0700

    Hold reference to video binding table until all rects are painted.
    
    The optimization of unreferencing the binding table when the relocation is
    posted causes the object to be dereferenced for each box in the clip list,
    causing general chaos in the buffer manager. It's easier to just hold a
    reference to the object until all of the boxes are painted and then drop it.
    
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/src/i965_video.c b/src/i965_video.c
index a1f577f..d459027 100644
--- a/src/i965_video.c
+++ b/src/i965_video.c
@@ -791,7 +791,6 @@ i965_emit_video_setup(ScrnInfoPtr pScrn, drm_intel_bo *bind_bo, int n_src_surf)
     OUT_BATCH(0); /* sf */
     /* Only the PS uses the binding table */
     OUT_RELOC(bind_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 0);
-    drm_intel_bo_unreference(bind_bo);
 
     /* Blend constant color (magenta is fun) */
     OUT_BATCH(BRW_3DSTATE_CONSTANT_COLOR | 3);
@@ -1158,6 +1157,9 @@ I965DisplayVideoTextured(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, int id,
 	i965_post_draw_debug(pScrn);
     }
 
+    /* release reference once we're finished */
+    drm_intel_bo_unreference(bind_bo);
+
 #if WATCH_STATS
     i830_dump_error_state(pScrn);
 #endif
commit ed492131c13715b73c14d328d0668120acb58b40
Author: Keith Packard <keithp at keithp.com>
Date:   Fri May 1 11:50:17 2009 -0700

    3D_STATE_VERTEX_BUFFERS takes four 32-bit values, not three.
    
    The spec says this command takes an extra (mbz) 32-bit value, so let's
    provide it with one.
    
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/src/i965_video.c b/src/i965_video.c
index c25bcb3..a1f577f 100644
--- a/src/i965_video.c
+++ b/src/i965_video.c
@@ -1127,15 +1127,16 @@ I965DisplayVideoTextured(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, int id,
 
 	i965_emit_video_setup(pScrn, bind_bo, n_src_surf);
 
-	BEGIN_BATCH(10);
+	BEGIN_BATCH(12);
 	/* Set up the pointer to our vertex buffer */
-	OUT_BATCH(BRW_3DSTATE_VERTEX_BUFFERS | 2);
+	OUT_BATCH(BRW_3DSTATE_VERTEX_BUFFERS | 3);
 	/* four 32-bit floats per vertex */
 	OUT_BATCH((0 << VB0_BUFFER_INDEX_SHIFT) |
 		  VB0_VERTEXDATA |
 		  ((4 * 4) << VB0_BUFFER_PITCH_SHIFT));
 	OUT_RELOC(vb_bo, I915_GEM_DOMAIN_VERTEX, 0, 0);
 	OUT_BATCH(3); /* four corners to our rectangle */
+	OUT_BATCH(0); /* reserved */
 
 	OUT_BATCH(BRW_3DPRIMITIVE |
 		  BRW_3DPRIMITIVE_VERTEX_SEQUENTIAL |
@@ -1147,6 +1148,7 @@ I965DisplayVideoTextured(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, int id,
 	OUT_BATCH(1); /* single instance */
 	OUT_BATCH(0); /* start instance location */
 	OUT_BATCH(0); /* index buffer offset, ignored */
+	OUT_BATCH(MI_NOOP);
 	ADVANCE_BATCH();
 
 	intel_batch_end_atomic(pScrn);
commit 66d1536a2ecc7a3d44da4c0dbe6c85aaa4e05791
Author: Keith Packard <keithp at keithp.com>
Date:   Fri May 1 11:48:51 2009 -0700

    Don't bother to enable VF statistics during 965 video playback
    
    This was used while bringing up the driver to debug vertext fetches.
    
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/src/i965_video.c b/src/i965_video.c
index 1d0ed74..c25bcb3 100644
--- a/src/i965_video.c
+++ b/src/i965_video.c
@@ -772,8 +772,7 @@ i965_emit_video_setup(ScrnInfoPtr pScrn, drm_intel_bo *bind_bo, int n_src_surf)
     /* brw_debug (pScrn, "after base address modify"); */
 
     BEGIN_BATCH(38);
-    /* Enable VF statistics */
-    OUT_BATCH(BRW_3DSTATE_VF_STATISTICS | 1);
+    OUT_BATCH(MI_NOOP);
 
     /* Pipe control */
     OUT_BATCH(BRW_PIPE_CONTROL |
commit 1872869e6ffcc8e6cab820c508fe5404d7e8ff9c
Author: Keith Packard <keithp at keithp.com>
Date:   Fri May 1 11:46:51 2009 -0700

    Leave allocator running until lower-level CloseScreens are done
    
    The lower level close screen functions will free allocated objects, causing
    a crash if the allocator isn't still available.
    
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/src/i830_driver.c b/src/i830_driver.c
index 1ff5866..ff7124d 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -3079,7 +3079,6 @@ I830CloseScreen(int scrnIndex, ScreenPtr pScreen)
 
    xf86_cursors_fini (pScreen);
 
-   i830_allocator_fini(pScrn);
 
    i965_free_video(pScrn);
    free(pI830->offscreenImages);
@@ -3099,7 +3098,9 @@ I830CloseScreen(int scrnIndex, ScreenPtr pScreen)
    pScrn->vtSema = FALSE;
    pI830->closing = FALSE;
    pScreen->CloseScreen = pI830->CloseScreen;
-   return (*pScreen->CloseScreen) (scrnIndex, pScreen);
+   (*pScreen->CloseScreen) (scrnIndex, pScreen);
+   i830_allocator_fini(pScrn);
+   return TRUE;
 }
 
 static ModeStatus
commit 1142353b487c155a31011923fbd08ec67e60f505
Author: Keith Packard <keithp at keithp.com>
Date:   Fri May 1 11:44:13 2009 -0700

    intel_batch_start_atomic: fix size passed to intel_batch_require_space (*4)
    
    intel_batch_start_atomic takes an argument in 32-bit units, and so it must
    multiply that by 4 before passing it to intel_batch_require_space, which
    takes an argument in bytes.
    
    We should figure out what units we want to use and use the same everywhere...
    
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/src/i830_batchbuffer.h b/src/i830_batchbuffer.h
index 6e0aaa7..0283438 100644
--- a/src/i830_batchbuffer.h
+++ b/src/i830_batchbuffer.h
@@ -57,7 +57,7 @@ intel_batch_start_atomic(ScrnInfoPtr pScrn, unsigned int sz)
     I830Ptr pI830 = I830PTR(pScrn);
 
     assert(!pI830->in_batch_atomic);
-    intel_batch_require_space(pScrn, pI830, sz);
+    intel_batch_require_space(pScrn, pI830, sz * 4);
 
     pI830->in_batch_atomic = TRUE;
     pI830->batch_atomic_limit = pI830->batch_used + sz * 4;


More information about the xorg-commit mailing list