mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 23:03:57 -04:00
drm/virtio: switch from ttm to gem shmem helpers
virtio-gpu basically needs a sg_table for the bo, to tell the host where the backing pages for the object are. So the gem shmem helpers are a perfect fit. Some drm_gem_object_funcs need thin wrappers to update the host state, but otherwise the helpers handle everything just fine. Once the fencing was sorted the switch was surprisingly easy and for the most part just removing the ttm code. v4: fix drm_gem_object_funcs name. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Chia-I Wu <olvaffe@gmail.com> Link: http://patchwork.freedesktop.org/patch/msgid/20190829103301.3539-15-kraxel@redhat.com
This commit is contained in:
@@ -173,12 +173,6 @@ int virtio_gpu_init(struct drm_device *dev)
|
||||
goto err_vbufs;
|
||||
}
|
||||
|
||||
ret = virtio_gpu_ttm_init(vgdev);
|
||||
if (ret) {
|
||||
DRM_ERROR("failed to init ttm %d\n", ret);
|
||||
goto err_ttm;
|
||||
}
|
||||
|
||||
/* get display info */
|
||||
virtio_cread(vgdev->vdev, struct virtio_gpu_config,
|
||||
num_scanouts, &num_scanouts);
|
||||
@@ -210,8 +204,6 @@ int virtio_gpu_init(struct drm_device *dev)
|
||||
return 0;
|
||||
|
||||
err_scanouts:
|
||||
virtio_gpu_ttm_fini(vgdev);
|
||||
err_ttm:
|
||||
virtio_gpu_free_vbufs(vgdev);
|
||||
err_vbufs:
|
||||
vgdev->vdev->config->del_vqs(vgdev->vdev);
|
||||
@@ -242,7 +234,6 @@ void virtio_gpu_deinit(struct drm_device *dev)
|
||||
vgdev->vdev->config->del_vqs(vgdev->vdev);
|
||||
|
||||
virtio_gpu_modeset_fini(vgdev);
|
||||
virtio_gpu_ttm_fini(vgdev);
|
||||
virtio_gpu_free_vbufs(vgdev);
|
||||
virtio_gpu_cleanup_cap_cache(vgdev);
|
||||
kfree(vgdev->capsets);
|
||||
|
||||
Reference in New Issue
Block a user