From b12bc035fb8ee40bb382e66604e869b729270189 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 22 Apr 2014 12:30:29 +0100 Subject: [PATCH] sna: Add a DBG aide to disable hardware execution Submit a dummy batch so that we still build, submit batches and perform relocations, but do not actually invoke the GPU. This can be useful when looking at mysterious hardware hangs. References: https://bugs.freedesktop.org/show_bug.cgi?id=77263 Signed-off-by: Chris Wilson --- src/sna/kgem.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/sna/kgem.c b/src/sna/kgem.c index 5d777999..82199a1d 100644 --- a/src/sna/kgem.c +++ b/src/sna/kgem.c @@ -61,6 +61,7 @@ static struct kgem_bo * search_snoop_cache(struct kgem *kgem, unsigned int num_pages, unsigned flags); #define DBG_NO_HW 0 +#define DBG_NO_EXEC 0 #define DBG_NO_TILING 0 #define DBG_NO_CACHE 0 #define DBG_NO_CACHE_LEVEL 0 @@ -2743,6 +2744,14 @@ static int kgem_batch_write(struct kgem *kgem, uint32_t handle, uint32_t size) ASSERT_IDLE(kgem, handle); +#if DBG_NO_EXEC + { + uint32_t batch[] = { MI_BATCH_BUFFER_END, 0}; + return gem_write(kgem->fd, handle, 0, sizeof(batch), batch); + } +#endif + + retry: /* If there is no surface data, just upload the batch */ if (kgem->surface == kgem->batch_size) {