summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorZhenyu Wang <zhenyuw@linux.intel.com>2014-12-25 10:57:29 +0800
committerZhigang Gong <zhigang.gong@intel.com>2014-12-29 09:44:18 +0800
commit796bb894082a3ffc48db37cfaf3bf4acfe3715df (patch)
tree92e6097dfd12e2496ac399c699941f3206479e3f /src
parent189aa7991668448a00f2f17ac247689a4cd84409 (diff)
Add aub dump support
Use current libdrm interface to dump aub file for debug in emulator. This adds new driver environment of OCL_DUMP_AUB=1 to enable this. Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Diffstat (limited to 'src')
-rw-r--r--src/intel/intel_driver.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/intel/intel_driver.c b/src/intel/intel_driver.c
index bdfa768b..4ed1e251 100644
--- a/src/intel/intel_driver.c
+++ b/src/intel/intel_driver.c
@@ -109,13 +109,28 @@ error:
/* just used for maximum relocation number in drm_intel */
#define BATCH_SIZE 0x4000
+/* set OCL_DUMP_AUB=1 to get aub file */
+static void
+intel_driver_aub_dump(intel_driver_t *driver)
+{
+ char *val;
+ val = getenv("OCL_DUMP_AUB");
+ if (!val)
+ return;
+ if (atoi(val) != 0) {
+ drm_intel_bufmgr_gem_set_aub_filename(driver->bufmgr,
+ "beignet.aub");
+ drm_intel_bufmgr_gem_set_aub_dump(driver->bufmgr, 1);
+ }
+}
+
static void
intel_driver_memman_init(intel_driver_t *driver)
{
driver->bufmgr = drm_intel_bufmgr_gem_init(driver->fd, BATCH_SIZE);
assert(driver->bufmgr);
- //drm_intel_bufmgr_gem_set_aub_dump(driver->bufmgr, 1);
drm_intel_bufmgr_gem_enable_reuse(driver->bufmgr);
+ intel_driver_aub_dump(driver);
}
static void