From 8a91c7d85740a5adc25d2a9b1972c367780ce714 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sat, 21 Jan 2012 01:18:17 +0000 Subject: [PATCH] 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 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42718 Signed-off-by: Chris Wilson --- src/sna/kgem.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/sna/kgem.c b/src/sna/kgem.c index 52e5bffd..3b4db905 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; }