Gerd Hoffmann
2018-Dec-19 12:27 UTC
[PATCH 10/10] drm/virtio: ditch virtio_gpu_object_attach() calls
With virtio_gpu_object_create() being called earlier ttm_bo_init() will handle the virtio_gpu_object_attach() (via backend binding), so we can drop the extra calls now. Signed-off-by: Gerd Hoffmann <kraxel at redhat.com> --- drivers/gpu/drm/virtio/virtgpu_gem.c | 9 --------- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 2 -- 2 files changed, 11 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_gem.c b/drivers/gpu/drm/virtio/virtgpu_gem.c index ca84990382..4b01e5655c 100644 --- a/drivers/gpu/drm/virtio/virtgpu_gem.c +++ b/drivers/gpu/drm/virtio/virtgpu_gem.c @@ -82,9 +82,7 @@ int virtio_gpu_mode_dumb_create(struct drm_file *file_priv, struct drm_device *dev, struct drm_mode_create_dumb *args) { - struct virtio_gpu_device *vgdev = dev->dev_private; struct drm_gem_object *gobj; - struct virtio_gpu_object *obj; struct virtio_gpu_object_params params = { .pinned = false, }; @@ -108,13 +106,6 @@ int virtio_gpu_mode_dumb_create(struct drm_file *file_priv, if (ret) goto fail; - obj = gem_to_virtio_gpu_obj(gobj); - - /* attach the object to the resource */ - ret = virtio_gpu_object_attach(vgdev, obj, NULL); - if (ret) - goto fail; - args->pitch = pitch; return ret; diff --git a/drivers/gpu/drm/virtio/virtgpu_ioctl.c b/drivers/gpu/drm/virtio/virtgpu_ioctl.c index e5bd1fed56..90b3955b6f 100644 --- a/drivers/gpu/drm/virtio/virtgpu_ioctl.c +++ b/drivers/gpu/drm/virtio/virtgpu_ioctl.c @@ -319,8 +319,6 @@ static int virtio_gpu_resource_create_ioctl(struct drm_device *dev, void *data, return PTR_ERR(qobj); obj = &qobj->gem_base; - ret = virtio_gpu_object_attach(vgdev, qobj, NULL); - ret = drm_gem_handle_create(file_priv, obj, &handle); if (ret) { drm_gem_object_release(obj); -- 2.9.3
Apparently Analagous Threads
- [PATCH 09/10] drm/virtio: move virtio_gpu_cmd_create_resource call into virtio_gpu_object_create
- [PATCH 06/10] drm/virtio: params struct for virtio_gpu_cmd_create_resource()
- [PATCH v3 3/5] drm/virtio: params struct for virtio_gpu_cmd_create_resource()
- [PATCH v3 5/5] drm/virtio: rework resource creation workflow.
- [PATCH 05/10] drm/virtio: use struct to pass params to virtio_gpu_object_create()