From: Gerd Hoffmann <kraxel@redhat.com>
To: dri-devel@lists.freedesktop.org
Cc: olvaffe@gmail.com, gurchetansingh@chromium.org,
Gerd Hoffmann <kraxel@redhat.com>,
David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
virtualization@lists.linux-foundation.org (open list:VIRTIO GPU
DRIVER), linux-kernel@vger.kernel.org (open list)
Subject: [PATCH v7 15/18] drm/virtio: remove virtio_gpu_alloc_object
Date: Fri, 2 Aug 2019 15:12:22 +0200 [thread overview]
Message-ID: <20190802131225.17760-16-kraxel@redhat.com> (raw)
In-Reply-To: <20190802131225.17760-1-kraxel@redhat.com>
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>
---
drivers/gpu/drm/virtio/virtgpu_drv.h | 4 ----
drivers/gpu/drm/virtio/virtgpu_gem.c | 23 ++++-------------------
drivers/gpu/drm/virtio/virtgpu_ioctl.c | 6 +++---
3 files changed, 7 insertions(+), 26 deletions(-)
diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.h b/drivers/gpu/drm/virtio/virtgpu_drv.h
index 1d6e4ffee7d1..d4d82679d83a 100644
--- a/drivers/gpu/drm/virtio/virtgpu_drv.h
+++ b/drivers/gpu/drm/virtio/virtgpu_drv.h
@@ -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);
diff --git a/drivers/gpu/drm/virtio/virtgpu_gem.c b/drivers/gpu/drm/virtio/virtgpu_gem.c
index 0cba78bcf39c..33cc5ab31356 100644
--- a/drivers/gpu/drm/virtio/virtgpu_gem.c
+++ b/drivers/gpu/drm/virtio/virtgpu_gem.c
@@ -28,35 +28,20 @@
#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) {
diff --git a/drivers/gpu/drm/virtio/virtgpu_ioctl.c b/drivers/gpu/drm/virtio/virtgpu_ioctl.c
index 865b3b8400ed..890bc55183cc 100644
--- a/drivers/gpu/drm/virtio/virtgpu_ioctl.c
+++ b/drivers/gpu/drm/virtio/virtgpu_ioctl.c
@@ -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, ¶ms, fence);
+ ret = virtio_gpu_object_create(vgdev, ¶ms, &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);
--
2.18.1
next prev parent reply other threads:[~2019-08-02 13:13 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20190802131225.17760-1-kraxel@redhat.com>
2019-08-02 13:12 ` [PATCH v7 01/18] drm/virtio: pass gem reservation object to ttm init Gerd Hoffmann
2019-08-02 13:12 ` [PATCH v7 02/18] drm/virtio: switch virtio_gpu_wait_ioctl() to gem helper Gerd Hoffmann
2019-08-02 13:12 ` [PATCH v7 03/18] drm/virtio: simplify cursor updates Gerd Hoffmann
2019-08-02 13:12 ` [PATCH v7 04/18] drm/virtio: remove virtio_gpu_object_wait Gerd Hoffmann
2019-08-02 13:12 ` [PATCH v7 05/18] drm/virtio: drop no_wait argument from virtio_gpu_object_reserve Gerd Hoffmann
2019-08-02 13:12 ` [PATCH v7 06/18] drm/virtio: remove ttm calls from in virtio_gpu_object_{reserve,unreserve} Gerd Hoffmann
2019-08-02 13:12 ` [PATCH v7 07/18] drm/virtio: add virtio_gpu_object_array & helpers Gerd Hoffmann
2019-08-02 13:12 ` [PATCH v7 08/18] drm/virtio: rework virtio_gpu_execbuffer_ioctl fencing Gerd Hoffmann
2019-08-02 13:12 ` [PATCH v7 09/18] drm/virtio: rework virtio_gpu_object_create fencing Gerd Hoffmann
2019-08-02 13:12 ` [PATCH v7 10/18] drm/virtio: rework virtio_gpu_transfer_from_host_ioctl fencing Gerd Hoffmann
2019-08-02 13:12 ` [PATCH v7 11/18] drm/virtio: rework virtio_gpu_transfer_to_host_ioctl fencing Gerd Hoffmann
2019-08-02 13:12 ` [PATCH v7 12/18] drm/virtio: rework virtio_gpu_cmd_context_{attach,detach}_resource Gerd Hoffmann
2019-08-02 13:12 ` [PATCH v7 13/18] drm/virtio: drop virtio_gpu_object_list_validate/virtio_gpu_unref_list Gerd Hoffmann
2019-08-02 13:12 ` [PATCH v7 14/18] drm/virtio: switch from ttm to gem shmem helpers Gerd Hoffmann
2019-08-02 13:12 ` Gerd Hoffmann [this message]
2019-08-02 13:12 ` [PATCH v7 16/18] drm/virtio: drop virtio_gpu_object_{ref,unref} Gerd Hoffmann
2019-08-02 13:12 ` [PATCH v7 17/18] drm/virtio: drop virtio_gpu_object_{reserve,unreserve} Gerd Hoffmann
2019-08-02 13:12 ` [PATCH v7 18/18] drm/virtio: add fence sanity check Gerd Hoffmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190802131225.17760-16-kraxel@redhat.com \
--to=kraxel@redhat.com \
--cc=airlied@linux.ie \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=gurchetansingh@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=olvaffe@gmail.com \
--cc=virtualization@lists.linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).