drm/virtio: Use generic dumb_map_offset implementation
authorPeter Shkenev <mustela@erminea.space>
Thu, 7 Nov 2024 14:10:05 +0000 (17:10 +0300)
committerDmitry Osipenko <dmitry.osipenko@collabora.com>
Mon, 18 Nov 2024 11:08:37 +0000 (14:08 +0300)
commitc85021f35ace0081081b3fcbd0b411ad085dc091
tree19f8c5438a135f8cea4e5bf246fbe3b22a0956b2
parent7d2faa8dbb7055a115fe0cd6068d7090094a573d
drm/virtio: Use generic dumb_map_offset implementation

Currently, virtio uses its own dumb_map_offset implementation,
virtio_gpu_mode_dumb_mmap. It works similarly to generic implementation,
drm_gem_dumb_map_offset, and using the generic implementation is
preferable (and making drivers to do so is a task stated on the DRM
subsystem's TODO list).

Thus, make driver use the generic implementation. This includes
VIRTGPU_MAP ioctl so it cannot be used to circumvent rules imposed by
drm_gem_dumb_map_offset (imported objects cannot be mapped).

Signed-off-by: Peter Shkenev <mustela@erminea.space>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
[dmitry.osipenko@collabora.com: cosmetic code improvements]
Link: https://patchwork.freedesktop.org/patch/msgid/20241107141133.13624-1-mustela@erminea.space
drivers/gpu/drm/virtio/virtgpu_drv.c
drivers/gpu/drm/virtio/virtgpu_drv.h
drivers/gpu/drm/virtio/virtgpu_gem.c
drivers/gpu/drm/virtio/virtgpu_ioctl.c