summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/virtio/virtgpu_drv.h
diff options
context:
space:
mode:
authorDavid Stevens <stevensd@chromium.org>2021-08-13 02:54:41 +0200
committerGerd Hoffmann <kraxel@redhat.com>2021-08-16 14:09:40 +0200
commitea5ea3d8a117517a75c2af30faa399671444a1ea (patch)
tree1bbca8681e58404ba3f066e8d3218d2b42699b48 /drivers/gpu/drm/virtio/virtgpu_drv.h
parentdma-buf: WARN on dmabuf release with pending attachments (diff)
downloadlinux-ea5ea3d8a117517a75c2af30faa399671444a1ea.tar.xz
linux-ea5ea3d8a117517a75c2af30faa399671444a1ea.zip
drm/virtio: support mapping exported vram
Implement virtgpu specific map_dma_buf callback to support mapping exported vram object dma-bufs. The dma-buf callback is used directly, as vram objects don't have backing pages and thus can't implement the drm_gem_object_funcs.get_sg_table callback. Signed-off-by: David Stevens <stevensd@chromium.org> Link: http://patchwork.freedesktop.org/patch/msgid/20210813005441.608293-1-stevensd@chromium.org Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/virtio/virtgpu_drv.h')
-rw-r--r--drivers/gpu/drm/virtio/virtgpu_drv.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.h b/drivers/gpu/drm/virtio/virtgpu_drv.h
index d4e610a44e12..0c4810982530 100644
--- a/drivers/gpu/drm/virtio/virtgpu_drv.h
+++ b/drivers/gpu/drm/virtio/virtgpu_drv.h
@@ -26,6 +26,7 @@
#ifndef VIRTIO_DRV_H
#define VIRTIO_DRV_H
+#include <linux/dma-direction.h>
#include <linux/virtio.h>
#include <linux/virtio_ids.h>
#include <linux/virtio_config.h>
@@ -459,4 +460,11 @@ bool virtio_gpu_is_vram(struct virtio_gpu_object *bo);
int virtio_gpu_vram_create(struct virtio_gpu_device *vgdev,
struct virtio_gpu_object_params *params,
struct virtio_gpu_object **bo_ptr);
+struct sg_table *virtio_gpu_vram_map_dma_buf(struct virtio_gpu_object *bo,
+ struct device *dev,
+ enum dma_data_direction dir);
+void virtio_gpu_vram_unmap_dma_buf(struct device *dev,
+ struct sg_table *sgt,
+ enum dma_data_direction dir);
+
#endif