mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 14:53:58 -04:00
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
This commit is contained in:
committed by
Dmitry Osipenko
parent
7d2faa8dbb
commit
c85021f35a
@@ -99,21 +99,6 @@ fail:
|
||||
return ret;
|
||||
}
|
||||
|
||||
int virtio_gpu_mode_dumb_mmap(struct drm_file *file_priv,
|
||||
struct drm_device *dev,
|
||||
uint32_t handle, uint64_t *offset_p)
|
||||
{
|
||||
struct drm_gem_object *gobj;
|
||||
|
||||
BUG_ON(!offset_p);
|
||||
gobj = drm_gem_object_lookup(file_priv, handle);
|
||||
if (gobj == NULL)
|
||||
return -ENOENT;
|
||||
*offset_p = drm_vma_node_offset_addr(&gobj->vma_node);
|
||||
drm_gem_object_put(gobj);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int virtio_gpu_gem_object_open(struct drm_gem_object *obj,
|
||||
struct drm_file *file)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user