intel/dump_gpu: add support for MMAP_OFFSET ioctl

Our driver started using this method to mmap the BOs and we need to
hook it to track the dirtiness of the BO.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Tested-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7528>
This commit is contained in:
Lionel Landwerlin 2020-11-10 15:03:23 +02:00 committed by Marge Bot
parent 44f2de5286
commit e3893ee204

View file

@ -708,6 +708,17 @@ ioctl(int fd, unsigned long request, ...)
return ret;
}
case DRM_IOCTL_I915_GEM_MMAP_OFFSET: {
ret = libc_ioctl(fd, request, argp);
if (ret == 0) {
struct drm_i915_gem_mmap_offset *mmap = argp;
struct bo *bo = get_bo(fd, mmap->handle);
bo->user_mapped = true;
bo->dirty = true;
}
return ret;
}
default:
return libc_ioctl(fd, request, argp);
}