summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Clark <robclark@freedesktop.org>2013-05-15 13:21:24 -0400
committerRob Clark <robclark@freedesktop.org>2013-05-15 15:34:15 -0400
commitacfbf394a9176ea97f114ca6c0eb8249a2220e82 (patch)
tree0a89d201fb57d333930d62fdea0212b36f0096eb
parent0b89e2730c41466e8d9c04c469679ba23d052ec9 (diff)
freedreno: add some asserts
Things are worse if we issueibcmds with bogus gpu ptrs, so it is better to just make userspace crash when things go pear shaped. Signed-off-by: Rob Clark <robclark@freedesktop.org>
-rw-r--r--freedreno/freedreno_ringbuffer.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/freedreno/freedreno_ringbuffer.c b/freedreno/freedreno_ringbuffer.c
index d20a7f55..2a9f4367 100644
--- a/freedreno/freedreno_ringbuffer.c
+++ b/freedreno/freedreno_ringbuffer.c
@@ -26,6 +26,8 @@
* Rob Clark <robclark@freedesktop.org>
*/
+#include <assert.h>
+
#include "freedreno_drmif.h"
#include "freedreno_priv.h"
#include "freedreno_ringbuffer.h"
@@ -201,7 +203,9 @@ uint32_t fd_ringbuffer_timestamp(struct fd_ringbuffer *ring)
void fd_ringbuffer_emit_reloc(struct fd_ringbuffer *ring,
struct fd_bo *bo, uint32_t offset, uint32_t or)
{
- (*ring->cur++) = fd_bo_gpuaddr(bo, offset) | or;
+ uint32_t addr = fd_bo_gpuaddr(bo, offset);
+ assert(addr);
+ (*ring->cur++) = addr | or;
fd_pipe_add_submit(ring->pipe, bo);
}
@@ -209,6 +213,7 @@ void fd_ringbuffer_emit_reloc_shift(struct fd_ringbuffer *ring,
struct fd_bo *bo, uint32_t offset, uint32_t or, int32_t shift)
{
uint32_t addr = fd_bo_gpuaddr(bo, offset);
+ assert(addr);
if (shift < 0)
addr >>= -shift;
else