diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2019-02-27 17:44:41 +0300 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2019-02-28 11:09:02 +0300 |
commit | 98f41dc3b3eeabfc80d5d5eb1c1a6294ff59b4ec (patch) | |
tree | 3249125249e83bbd2813222f7e4264ff5af44e1e /drivers/gpu/drm/virtio/virtgpu_drv.c | |
parent | 873f51d43439d554f7299e88edfb208924bef6eb (diff) | |
download | linux-98f41dc3b3eeabfc80d5d5eb1c1a6294ff59b4ec.tar.xz |
drm/virtio: implement prime export
Just run drm_prime_pages_to_sg() on the ttm pages list to get an
sg_table for export. The pages list is created at object initialization
time, so there should be no need to handle an unpopulated page list.
Add a sanity check nevertheless.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Noralf Trønnes <noralf@tronnes.org>
Link: http://patchwork.freedesktop.org/patch/msgid/20190227144441.6755-4-kraxel@redhat.com
Diffstat (limited to 'drivers/gpu/drm/virtio/virtgpu_drv.c')
-rw-r--r-- | drivers/gpu/drm/virtio/virtgpu_drv.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.c b/drivers/gpu/drm/virtio/virtgpu_drv.c index 40e7ce000505..7c2893181ba4 100644 --- a/drivers/gpu/drm/virtio/virtgpu_drv.c +++ b/drivers/gpu/drm/virtio/virtgpu_drv.c @@ -205,8 +205,10 @@ static struct drm_driver driver = { #if defined(CONFIG_DEBUG_FS) .debugfs_init = virtio_gpu_debugfs_init, #endif + .prime_handle_to_fd = drm_gem_prime_handle_to_fd, .gem_prime_export = drm_gem_prime_export, .gem_prime_import = drm_gem_prime_import, + .gem_prime_get_sg_table = virtgpu_gem_prime_get_sg_table, .gem_prime_vmap = virtgpu_gem_prime_vmap, .gem_prime_vunmap = virtgpu_gem_prime_vunmap, .gem_prime_mmap = virtgpu_gem_prime_mmap, |