summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno/freedreno_util.h
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2014-10-03 12:48:31 -0400
committerRob Clark <[email protected]>2014-10-03 14:19:52 -0400
commit7297bdbd50eb039878fe9e472dc736e1259710fb (patch)
tree053bf7c1259f187b79ad300c1ca87f4ef12d661a /src/gallium/drivers/freedreno/freedreno_util.h
parenta262c601d363aea2e6680df527e207cc9d5e235f (diff)
freedreno: query fixes
Fixes a few issues, including a potential empty-IB (which triggers gpu hangs in piglit occlusion_query_meta_no_fragments) Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/freedreno_util.h')
-rw-r--r--src/gallium/drivers/freedreno/freedreno_util.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_util.h b/src/gallium/drivers/freedreno/freedreno_util.h
index a762c8f0575..f1a1e6e7c55 100644
--- a/src/gallium/drivers/freedreno/freedreno_util.h
+++ b/src/gallium/drivers/freedreno/freedreno_util.h
@@ -209,6 +209,10 @@ static inline void
OUT_IB(struct fd_ringbuffer *ring, struct fd_ringmarker *start,
struct fd_ringmarker *end)
{
+ uint32_t dwords = fd_ringmarker_dwords(start, end);
+
+ assert(dwords > 0);
+
/* for debug after a lock up, write a unique counter value
* to scratch6 for each IB, to make it easier to match up
* register dumps to cmdstream. The combination of IB and
@@ -219,7 +223,7 @@ OUT_IB(struct fd_ringbuffer *ring, struct fd_ringmarker *start,
OUT_PKT3(ring, CP_INDIRECT_BUFFER_PFD, 2);
fd_ringbuffer_emit_reloc_ring(ring, start, end);
- OUT_RING(ring, fd_ringmarker_dwords(start, end));
+ OUT_RING(ring, dwords);
emit_marker(ring, 6);
}