uint32_t size;
uint64_t offset;
void *map;
+ bool mapped;
};
static struct bo *bos;
else
data = bo->map;
- if (bo == batch_bo) {
- aub_write_trace_block(&aub_file, AUB_TRACE_TYPE_BATCH,
- GET_PTR(data), bo->size, bo->offset);
- } else {
- aub_write_trace_block(&aub_file, AUB_TRACE_TYPE_NOTYPE,
- GET_PTR(data), bo->size, bo->offset);
+ if (bo->mapped) {
+ if (bo == batch_bo) {
+ aub_write_trace_block(&aub_file, AUB_TRACE_TYPE_BATCH,
+ GET_PTR(data), bo->size, bo->offset);
+ } else {
+ aub_write_trace_block(&aub_file, AUB_TRACE_TYPE_NOTYPE,
+ GET_PTR(data), bo->size, bo->offset);
+ }
}
if (data != bo->map)
bo->size = size;
bo->map = map;
+ bo->mapped = false;
}
static void
munmap(bo->map, bo->size);
bo->size = 0;
bo->map = NULL;
+ bo->mapped = false;
}
__attribute__ ((visibility ("default"))) int
return ret;
}
+ case DRM_IOCTL_I915_GEM_MMAP: {
+ ret = libc_ioctl(fd, request, argp);
+ if (ret == 0) {
+ struct drm_i915_gem_mmap *mmap = argp;
+ struct bo *bo = get_bo(fd, mmap->handle);
+ bo->mapped = true;
+ }
+ return ret;
+ }
+
default:
return libc_ioctl(fd, request, argp);
}