diff options
author | Eric Anholt <[email protected]> | 2012-03-06 15:31:42 -0800 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2012-03-21 12:45:05 -0700 |
commit | 0247d89183e26fbd07e4176ff6f8d1b4989e24ab (patch) | |
tree | ecb275daaffd51fdd1c3911cb7cf92a296a4a156 /src/mesa/drivers/dri/intel/intel_screen.c | |
parent | 218f3a56637a189eb0163fb7c6a5d161a8b6c910 (diff) |
intel: Ask libdrm to dump an AUB file if INTEL_DEBUG=aub.
It also asks for BMPs in the aub file at SwapBuffers time.
Reviewed-by: Yuanhan Liu <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/intel/intel_screen.c')
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_screen.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c index 229eeb1f5ad..e7c45b7d907 100644 --- a/src/mesa/drivers/dri/intel/intel_screen.c +++ b/src/mesa/drivers/dri/intel/intel_screen.c @@ -129,6 +129,38 @@ intelDRI2Flush(__DRIdrawable *drawable) if (intel->batch.used) intel_batchbuffer_flush(intel); + + if (INTEL_DEBUG & DEBUG_AUB) { + struct gl_framebuffer *fb = ctx->DrawBuffer; + + for (int i = 0; i < fb->_NumColorDrawBuffers; i++) { + struct intel_renderbuffer *irb = + intel_renderbuffer(fb->_ColorDrawBuffers[i]); + + if (irb && irb->mt) { + enum aub_dump_bmp_format format; + + switch (irb->Base.Base.Format) { + case MESA_FORMAT_ARGB8888: + case MESA_FORMAT_XRGB8888: + format = AUB_DUMP_BMP_FORMAT_ARGB_8888; + break; + default: + continue; + } + + drm_intel_gem_bo_aub_dump_bmp(irb->mt->region->bo, + irb->draw_x, + irb->draw_y, + irb->Base.Base.Width, + irb->Base.Base.Height, + format, + irb->mt->region->pitch * + irb->mt->region->cpp, + 0); + } + } + } } static const struct __DRI2flushExtensionRec intelFlushExtension = { |