From 7df3da10e744d7f168ea3f30b21c434f99beae17 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 29 Jan 2014 13:06:08 +0000 Subject: sna/gen4+: Assert that the cached binding location is valid We can at least check that it is in the right region (i.e. not past where the current surface has been allocated from). References: https://bugs.freedesktop.org/show_bug.cgi?id=74176 Signed-off-by: Chris Wilson --- src/sna/gen4_render.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/sna/gen4_render.c') diff --git a/src/sna/gen4_render.c b/src/sna/gen4_render.c index 4f4a4c80..1d164b6e 100644 --- a/src/sna/gen4_render.c +++ b/src/sna/gen4_render.c @@ -514,6 +514,7 @@ gen4_bind_bo(struct sna *sna, /* After the first bind, we manage the cache domains within the batch */ offset = kgem_bo_get_binding(bo, format | is_dst << 31); if (offset) { + assert(offset >= sna->kgem.surface); if (is_dst) kgem_bo_mark_dirty(bo); return offset * sizeof(uint32_t); -- cgit v1.2.3