xf86-video-intel: 2 commits - src/sna/gen3_render.c src/sna/kgem.c src/sna/kgem.h

Chris Wilson ickle at kemper.freedesktop.org
Fri Jan 20 17:19:41 PST 2012


 src/sna/gen3_render.c |    3 +++
 src/sna/kgem.c        |    1 +
 src/sna/kgem.h        |    1 +
 3 files changed, 5 insertions(+)

New commits:
commit 8a91c7d85740a5adc25d2a9b1972c367780ce714
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sat Jan 21 01:18:17 2012 +0000

    sna: Give kgem_create_buffer_2d a unique id
    
    The gen3, among others, backend uses the unique id of a buffer to track
    the currently attached buffer and uses 0 as the invalid value. Linear
    buffers as created by kgem_create_buffer_2d were not being assigned a
    unique id causing mayhem when they were then being passed to the
    backends as render targets and sources. In particular, gen3 did not
    notice the switch in render target and did not emit commands to change
    the GPU target nor attach the buffer to the batch, causing the
    sna_read_boxes to fail and for us to trigger an assertion for an
    uncomsumed read buffer.
    
    Reported-by: Clemens Eisserer <linuxhippy at gmail.com>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42718
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 52e5bff..3b4db90 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -3178,6 +3178,7 @@ struct kgem_bo *kgem_create_buffer_2d(struct kgem *kgem,
 	}
 
 	bo->pitch = stride;
+	bo->unique_id = kgem_get_unique_id(kgem);
 	return bo;
 }
 
commit d21e80433f2574fe96036ad1d563515406a1946f
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sat Jan 21 01:17:39 2012 +0000

    sna/gen3: Add DBG markup for tracking target state
    
    In particular for when we switch to a new destination and mark it dirty.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/gen3_render.c b/src/sna/gen3_render.c
index f749afb..4b61f65 100644
--- a/src/sna/gen3_render.c
+++ b/src/sna/gen3_render.c
@@ -1298,6 +1298,9 @@ static void gen3_emit_target(struct sna *sna,
 	if (bo->unique_id != state->current_dst) {
 		uint32_t v;
 
+		DBG(("%s: setting new target id=%d, handle=%d\n",
+		     __FUNCTION__, bo->unique_id, bo->handle));
+
 		OUT_BATCH(_3DSTATE_BUF_INFO_CMD);
 		OUT_BATCH(BUF_3D_ID_COLOR_BACK |
 			  gen3_buf_tiling(bo->tiling) |
diff --git a/src/sna/kgem.h b/src/sna/kgem.h
index b85625f..6800b64 100644
--- a/src/sna/kgem.h
+++ b/src/sna/kgem.h
@@ -421,6 +421,7 @@ static inline bool kgem_bo_is_dirty(struct kgem_bo *bo)
 
 static inline void kgem_bo_mark_dirty(struct kgem_bo *bo)
 {
+	DBG_HDR(("%s: handle=%d\n", __FUNCTION__, bo->handle));
 	if (bo->proxy)
 		bo = bo->proxy;
 	bo->dirty = true;


More information about the xorg-commit mailing list