diff options
author | Ezequiel Garcia <ezequiel@collabora.com> | 2018-09-25 19:16:04 +0300 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2018-09-26 09:05:05 +0300 |
commit | 02c87cabd6f1a6de151f999690393c3b8ad07b90 (patch) | |
tree | b2eec6d89d20363a0f45c4583e836cbc70943325 /drivers/gpu/drm/virtio/virtgpu_object.c | |
parent | 9dd3cb243ddfc1408f373bf17b03aa0e2a7784c9 (diff) | |
download | linux-02c87cabd6f1a6de151f999690393c3b8ad07b90.tar.xz |
virtio: Add virtio_gpu_object_kunmap()
Implement a virtio_gpu_object_kunmap() to unmap the kernel
mapping, and use it in the TTM object destroy path.
Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20180925161606.17980-2-ezequiel@collabora.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/virtio/virtgpu_object.c')
-rw-r--r-- | drivers/gpu/drm/virtio/virtgpu_object.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gpu/drm/virtio/virtgpu_object.c b/drivers/gpu/drm/virtio/virtgpu_object.c index 9f2f470efd9b..113eae00d293 100644 --- a/drivers/gpu/drm/virtio/virtgpu_object.c +++ b/drivers/gpu/drm/virtio/virtgpu_object.c @@ -37,6 +37,8 @@ static void virtio_gpu_ttm_bo_destroy(struct ttm_buffer_object *tbo) virtio_gpu_cmd_unref_resource(vgdev, bo->hw_res_handle); if (bo->pages) virtio_gpu_object_free_sg_table(bo); + if (bo->vmap) + virtio_gpu_object_kunmap(bo); drm_gem_object_release(&bo->gem_base); kfree(bo); } @@ -99,6 +101,12 @@ int virtio_gpu_object_create(struct virtio_gpu_device *vgdev, return 0; } +void virtio_gpu_object_kunmap(struct virtio_gpu_object *bo) +{ + bo->vmap = NULL; + ttm_bo_kunmap(&bo->kmap); +} + int virtio_gpu_object_kmap(struct virtio_gpu_object *bo, void **ptr) { bool is_iomem; |