drm/virtio: remove virtio_gpu_alloc_object
authorGerd Hoffmann <kraxel@redhat.com>
Thu, 29 Aug 2019 10:32:58 +0000 (12:32 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Wed, 4 Sep 2019 04:54:11 +0000 (06:54 +0200)
Thin wrapper around virtio_gpu_object_create(),
but calling that directly works equally well.

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-16-kraxel@redhat.com
drivers/gpu/drm/virtio/virtgpu_drv.h
drivers/gpu/drm/virtio/virtgpu_gem.c
drivers/gpu/drm/virtio/virtgpu_ioctl.c

index b67d23ef2b1112d00487ae5e78fd169eb6d48990..3e5b2d1db42d562c6c9b4341f6e8e70eb80621d5 100644 (file)
@@ -229,10 +229,6 @@ int virtio_gpu_gem_object_open(struct drm_gem_object *obj,
                               struct drm_file *file);
 void virtio_gpu_gem_object_close(struct drm_gem_object *obj,
                                 struct drm_file *file);
-struct virtio_gpu_object*
-virtio_gpu_alloc_object(struct drm_device *dev,
-                       struct virtio_gpu_object_params *params,
-                       struct virtio_gpu_fence *fence);
 int virtio_gpu_mode_dumb_create(struct drm_file *file_priv,
                                struct drm_device *dev,
                                struct drm_mode_create_dumb *args);
index fb957e3183b6a3b9388724b96c30eb52e3d651d3..b812094ae9166067c5bfc3416fe698e0b55d658f 100644 (file)
 
 #include "virtgpu_drv.h"
 
-struct virtio_gpu_object*
-virtio_gpu_alloc_object(struct drm_device *dev,
-                       struct virtio_gpu_object_params *params,
-                       struct virtio_gpu_fence *fence)
-{
-       struct virtio_gpu_device *vgdev = dev->dev_private;
-       struct virtio_gpu_object *obj;
-       int ret;
-
-       ret = virtio_gpu_object_create(vgdev, params, &obj, fence);
-       if (ret)
-               return ERR_PTR(ret);
-
-       return obj;
-}
-
 int virtio_gpu_gem_create(struct drm_file *file,
                          struct drm_device *dev,
                          struct virtio_gpu_object_params *params,
                          struct drm_gem_object **obj_p,
                          uint32_t *handle_p)
 {
+       struct virtio_gpu_device *vgdev = dev->dev_private;
        struct virtio_gpu_object *obj;
        int ret;
        u32 handle;
 
-       obj = virtio_gpu_alloc_object(dev, params, NULL);
-       if (IS_ERR(obj))
-               return PTR_ERR(obj);
+       ret = virtio_gpu_object_create(vgdev, params, &obj, NULL);
+       if (ret < 0)
+               return ret;
 
        ret = drm_gem_handle_create(file, &obj->base.base, &handle);
        if (ret) {
index 588a4ba1e7a434f51c4c799243fd0baab424e8be..f5083c538f9c4f830ada4f05fe4ca7f24ca57394 100644 (file)
@@ -256,10 +256,10 @@ static int virtio_gpu_resource_create_ioctl(struct drm_device *dev, void *data,
        fence = virtio_gpu_fence_alloc(vgdev);
        if (!fence)
                return -ENOMEM;
-       qobj = virtio_gpu_alloc_object(dev, &params, fence);
+       ret = virtio_gpu_object_create(vgdev, &params, &qobj, fence);
        dma_fence_put(&fence->f);
-       if (IS_ERR(qobj))
-               return PTR_ERR(qobj);
+       if (ret < 0)
+               return ret;
        obj = &qobj->base.base;
 
        ret = drm_gem_handle_create(file_priv, obj, &handle);