* [PATCH 1/3] drm/virtio: random virtgpu_drv.h cleanups
@ 2020-03-24 16:43 Gurchetan Singh
2020-03-24 16:43 ` [PATCH 2/3] drm/virtio: delete notify after virtio_gpu_cmd_context_create Gurchetan Singh
2020-03-24 16:44 ` [PATCH 3/3] drm/virtio: delete notify in virtio_gpu_object_create Gurchetan Singh
0 siblings, 2 replies; 8+ messages in thread
From: Gurchetan Singh @ 2020-03-24 16:43 UTC (permalink / raw)
To: dri-devel; +Cc: kraxel, Gurchetan Singh
- Static-ify virtio_gpu_gem_create
- Delete unused prototypes
- Point to current implementation files
Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org>
---
drivers/gpu/drm/virtio/virtgpu_drv.h | 26 +++++++++-----------------
drivers/gpu/drm/virtio/virtgpu_gem.c | 10 +++++-----
2 files changed, 14 insertions(+), 22 deletions(-)
diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.h b/drivers/gpu/drm/virtio/virtgpu_drv.h
index 824f9f15926c..79ad176aca5a 100644
--- a/drivers/gpu/drm/virtio/virtgpu_drv.h
+++ b/drivers/gpu/drm/virtio/virtgpu_drv.h
@@ -218,26 +218,18 @@ struct virtio_gpu_fpriv {
struct mutex context_lock;
};
-/* virtio_ioctl.c */
+/* virtgpu_ioctl.c */
#define DRM_VIRTIO_NUM_IOCTLS 10
extern struct drm_ioctl_desc virtio_gpu_ioctls[DRM_VIRTIO_NUM_IOCTLS];
-/* virtio_kms.c */
+/* virtgpu_kms.c */
int virtio_gpu_init(struct drm_device *dev);
void virtio_gpu_deinit(struct drm_device *dev);
void virtio_gpu_release(struct drm_device *dev);
int virtio_gpu_driver_open(struct drm_device *dev, struct drm_file *file);
void virtio_gpu_driver_postclose(struct drm_device *dev, struct drm_file *file);
-/* virtio_gem.c */
-void virtio_gpu_gem_free_object(struct drm_gem_object *gem_obj);
-int virtio_gpu_gem_init(struct virtio_gpu_device *vgdev);
-void virtio_gpu_gem_fini(struct virtio_gpu_device *vgdev);
-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);
+/* virtgpu_gem.c */
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,
@@ -263,7 +255,7 @@ void virtio_gpu_array_put_free_delayed(struct virtio_gpu_device *vgdev,
struct virtio_gpu_object_array *objs);
void virtio_gpu_array_put_free_work(struct work_struct *work);
-/* virtio vg */
+/* virtgpu_vq.c */
int virtio_gpu_alloc_vbufs(struct virtio_gpu_device *vgdev);
void virtio_gpu_free_vbufs(struct virtio_gpu_device *vgdev);
void virtio_gpu_cmd_create_resource(struct virtio_gpu_device *vgdev,
@@ -343,17 +335,17 @@ void virtio_gpu_dequeue_fence_func(struct work_struct *work);
void virtio_gpu_notify(struct virtio_gpu_device *vgdev);
-/* virtio_gpu_display.c */
+/* virtgpu_display.c */
void virtio_gpu_modeset_init(struct virtio_gpu_device *vgdev);
void virtio_gpu_modeset_fini(struct virtio_gpu_device *vgdev);
-/* virtio_gpu_plane.c */
+/* virtgpu_plane.c */
uint32_t virtio_gpu_translate_format(uint32_t drm_fourcc);
struct drm_plane *virtio_gpu_plane_init(struct virtio_gpu_device *vgdev,
enum drm_plane_type type,
int index);
-/* virtio_gpu_fence.c */
+/* virtgpu_fence.c */
struct virtio_gpu_fence *virtio_gpu_fence_alloc(
struct virtio_gpu_device *vgdev);
void virtio_gpu_fence_emit(struct virtio_gpu_device *vgdev,
@@ -362,7 +354,7 @@ void virtio_gpu_fence_emit(struct virtio_gpu_device *vgdev,
void virtio_gpu_fence_event_process(struct virtio_gpu_device *vdev,
u64 last_seq);
-/* virtio_gpu_object */
+/* virtgpu_object.c */
void virtio_gpu_cleanup_object(struct virtio_gpu_object *bo);
struct drm_gem_object *virtio_gpu_create_object(struct drm_device *dev,
size_t size);
@@ -378,7 +370,7 @@ struct drm_gem_object *virtgpu_gem_prime_import_sg_table(
struct drm_device *dev, struct dma_buf_attachment *attach,
struct sg_table *sgt);
-/* virgl debugfs */
+/* virtgpu_debugfs.c */
void virtio_gpu_debugfs_init(struct drm_minor *minor);
#endif
diff --git a/drivers/gpu/drm/virtio/virtgpu_gem.c b/drivers/gpu/drm/virtio/virtgpu_gem.c
index 0d6152c99a27..90c0a8ea1708 100644
--- a/drivers/gpu/drm/virtio/virtgpu_gem.c
+++ b/drivers/gpu/drm/virtio/virtgpu_gem.c
@@ -28,11 +28,11 @@
#include "virtgpu_drv.h"
-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)
+static 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;
--
2.25.1.696.g5e7596f4ac-goog
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/3] drm/virtio: delete notify after virtio_gpu_cmd_context_create
2020-03-24 16:43 [PATCH 1/3] drm/virtio: random virtgpu_drv.h cleanups Gurchetan Singh
@ 2020-03-24 16:43 ` Gurchetan Singh
2020-03-24 16:44 ` [PATCH 3/3] drm/virtio: delete notify in virtio_gpu_object_create Gurchetan Singh
1 sibling, 0 replies; 8+ messages in thread
From: Gurchetan Singh @ 2020-03-24 16:43 UTC (permalink / raw)
To: dri-devel; +Cc: kraxel, Gurchetan Singh
The first 3D ioctl will take care of notification.
Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org>
---
drivers/gpu/drm/virtio/virtgpu_ioctl.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/gpu/drm/virtio/virtgpu_ioctl.c b/drivers/gpu/drm/virtio/virtgpu_ioctl.c
index 336cc9143205..867c5e239d55 100644
--- a/drivers/gpu/drm/virtio/virtgpu_ioctl.c
+++ b/drivers/gpu/drm/virtio/virtgpu_ioctl.c
@@ -47,7 +47,6 @@ static void virtio_gpu_create_context(struct drm_device *dev,
get_task_comm(dbgname, current);
virtio_gpu_cmd_context_create(vgdev, vfpriv->ctx_id,
strlen(dbgname), dbgname);
- virtio_gpu_notify(vgdev);
vfpriv->context_created = true;
out_unlock:
--
2.25.1.696.g5e7596f4ac-goog
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 3/3] drm/virtio: delete notify in virtio_gpu_object_create
2020-03-24 16:43 [PATCH 1/3] drm/virtio: random virtgpu_drv.h cleanups Gurchetan Singh
2020-03-24 16:43 ` [PATCH 2/3] drm/virtio: delete notify after virtio_gpu_cmd_context_create Gurchetan Singh
@ 2020-03-24 16:44 ` Gurchetan Singh
2020-03-24 22:11 ` Chia-I Wu
1 sibling, 1 reply; 8+ messages in thread
From: Gurchetan Singh @ 2020-03-24 16:44 UTC (permalink / raw)
To: dri-devel; +Cc: kraxel, Gurchetan Singh
- For dumb buffers, virtio_gpu_gem_create can notify.
- For 3D buffers, virtio_gpu_gem_object_open can notify.
Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org>
---
drivers/gpu/drm/virtio/virtgpu_gem.c | 1 +
drivers/gpu/drm/virtio/virtgpu_object.c | 1 -
2 files changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/virtio/virtgpu_gem.c b/drivers/gpu/drm/virtio/virtgpu_gem.c
index 90c0a8ea1708..aa14dd12928e 100644
--- a/drivers/gpu/drm/virtio/virtgpu_gem.c
+++ b/drivers/gpu/drm/virtio/virtgpu_gem.c
@@ -49,6 +49,7 @@ static int virtio_gpu_gem_create(struct drm_file *file,
return ret;
}
+ virtio_gpu_notify(vgdev);
*obj_p = &obj->base.base;
/* drop reference from allocate - handle holds it now */
diff --git a/drivers/gpu/drm/virtio/virtgpu_object.c b/drivers/gpu/drm/virtio/virtgpu_object.c
index d9039bb7c5e3..51a8da7d5ef3 100644
--- a/drivers/gpu/drm/virtio/virtgpu_object.c
+++ b/drivers/gpu/drm/virtio/virtgpu_object.c
@@ -241,7 +241,6 @@ int virtio_gpu_object_create(struct virtio_gpu_device *vgdev,
return ret;
}
- virtio_gpu_notify(vgdev);
*bo_ptr = bo;
return 0;
--
2.25.1.696.g5e7596f4ac-goog
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 3/3] drm/virtio: delete notify in virtio_gpu_object_create
2020-03-24 16:44 ` [PATCH 3/3] drm/virtio: delete notify in virtio_gpu_object_create Gurchetan Singh
@ 2020-03-24 22:11 ` Chia-I Wu
2020-03-25 0:41 ` [PATCH] " Gurchetan Singh
0 siblings, 1 reply; 8+ messages in thread
From: Chia-I Wu @ 2020-03-24 22:11 UTC (permalink / raw)
To: Gurchetan Singh; +Cc: Gerd Hoffmann, ML dri-devel
On Wed, Mar 25, 2020 at 12:44 AM Gurchetan Singh
<gurchetansingh@chromium.org> wrote:
>
> - For dumb buffers, virtio_gpu_gem_create can notify.
> - For 3D buffers, virtio_gpu_gem_object_open can notify.
Hmm, I feel this is a bit complex. virtio_gpu_gem_object_open may not
notify, and the caller needs to know about it.
Can we change it to virtio_gpu_object_create never notifies and
virtio_gpu_gem_object_open always notifies?
>
> Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org>
> ---
> drivers/gpu/drm/virtio/virtgpu_gem.c | 1 +
> drivers/gpu/drm/virtio/virtgpu_object.c | 1 -
> 2 files changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/virtio/virtgpu_gem.c b/drivers/gpu/drm/virtio/virtgpu_gem.c
> index 90c0a8ea1708..aa14dd12928e 100644
> --- a/drivers/gpu/drm/virtio/virtgpu_gem.c
> +++ b/drivers/gpu/drm/virtio/virtgpu_gem.c
> @@ -49,6 +49,7 @@ static int virtio_gpu_gem_create(struct drm_file *file,
> return ret;
> }
>
> + virtio_gpu_notify(vgdev);
> *obj_p = &obj->base.base;
>
> /* drop reference from allocate - handle holds it now */
> diff --git a/drivers/gpu/drm/virtio/virtgpu_object.c b/drivers/gpu/drm/virtio/virtgpu_object.c
> index d9039bb7c5e3..51a8da7d5ef3 100644
> --- a/drivers/gpu/drm/virtio/virtgpu_object.c
> +++ b/drivers/gpu/drm/virtio/virtgpu_object.c
> @@ -241,7 +241,6 @@ int virtio_gpu_object_create(struct virtio_gpu_device *vgdev,
> return ret;
> }
>
> - virtio_gpu_notify(vgdev);
> *bo_ptr = bo;
> return 0;
>
> --
> 2.25.1.696.g5e7596f4ac-goog
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] drm/virtio: delete notify in virtio_gpu_object_create
2020-03-24 22:11 ` Chia-I Wu
@ 2020-03-25 0:41 ` Gurchetan Singh
2020-03-25 21:31 ` Chia-I Wu
0 siblings, 1 reply; 8+ messages in thread
From: Gurchetan Singh @ 2020-03-25 0:41 UTC (permalink / raw)
To: dri-devel; +Cc: Gurchetan Singh
For 3D buffers, virtio_gpu_gem_object_open notifies.
We can have the same behavior for dumb buffer. We just
need to make sure the first open notifies the host for
dumb buffers.
v2: virtio_gpu_gem_object_open always notifies
Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org>
---
drivers/gpu/drm/virtio/virtgpu_drv.h | 1 +
drivers/gpu/drm/virtio/virtgpu_gem.c | 10 ++++++++--
drivers/gpu/drm/virtio/virtgpu_object.c | 1 -
3 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.h b/drivers/gpu/drm/virtio/virtgpu_drv.h
index 79ad176aca5a8..842200e01d785 100644
--- a/drivers/gpu/drm/virtio/virtgpu_drv.h
+++ b/drivers/gpu/drm/virtio/virtgpu_drv.h
@@ -71,6 +71,7 @@ struct virtio_gpu_object {
uint32_t hw_res_handle;
bool dumb;
bool created;
+ bool notified;
};
#define gem_to_virtio_gpu_obj(gobj) \
container_of((gobj), struct virtio_gpu_object, base.base)
diff --git a/drivers/gpu/drm/virtio/virtgpu_gem.c b/drivers/gpu/drm/virtio/virtgpu_gem.c
index 90c0a8ea1708c..597ddb7391fb9 100644
--- a/drivers/gpu/drm/virtio/virtgpu_gem.c
+++ b/drivers/gpu/drm/virtio/virtgpu_gem.c
@@ -111,10 +111,13 @@ int virtio_gpu_gem_object_open(struct drm_gem_object *obj,
{
struct virtio_gpu_device *vgdev = obj->dev->dev_private;
struct virtio_gpu_fpriv *vfpriv = file->driver_priv;
+ struct virtio_gpu_object *bo = gem_to_virtio_gpu_obj(obj);
struct virtio_gpu_object_array *objs;
- if (!vgdev->has_virgl_3d)
- return 0;
+ if (!vgdev->has_virgl_3d && !bo->notified)
+ goto out_notify;
+ else if (!vgdev->has_virgl_3d)
+ goto out;
objs = virtio_gpu_array_alloc(1);
if (!objs)
@@ -123,7 +126,10 @@ int virtio_gpu_gem_object_open(struct drm_gem_object *obj,
virtio_gpu_cmd_context_attach_resource(vgdev, vfpriv->ctx_id,
objs);
+out_notify:
+ bo->notified = true;
virtio_gpu_notify(vgdev);
+out:
return 0;
}
diff --git a/drivers/gpu/drm/virtio/virtgpu_object.c b/drivers/gpu/drm/virtio/virtgpu_object.c
index d9039bb7c5e37..51a8da7d5ef3b 100644
--- a/drivers/gpu/drm/virtio/virtgpu_object.c
+++ b/drivers/gpu/drm/virtio/virtgpu_object.c
@@ -241,7 +241,6 @@ int virtio_gpu_object_create(struct virtio_gpu_device *vgdev,
return ret;
}
- virtio_gpu_notify(vgdev);
*bo_ptr = bo;
return 0;
--
2.24.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] drm/virtio: delete notify in virtio_gpu_object_create
2020-03-25 0:41 ` [PATCH] " Gurchetan Singh
@ 2020-03-25 21:31 ` Chia-I Wu
2020-03-25 23:10 ` Gurchetan Singh
0 siblings, 1 reply; 8+ messages in thread
From: Chia-I Wu @ 2020-03-25 21:31 UTC (permalink / raw)
To: Gurchetan Singh; +Cc: Gerd Hoffmann, ML dri-devel
On Wed, Mar 25, 2020 at 8:41 AM Gurchetan Singh
<gurchetansingh@chromium.org> wrote:
>
> For 3D buffers, virtio_gpu_gem_object_open notifies.
> We can have the same behavior for dumb buffer. We just
> need to make sure the first open notifies the host for
> dumb buffers.
virtio_gpu_notify is cheap and does not kick unless there is a need.
I probably won't bother with adding `bool notified', which adds a
(harmless) data race.
>
> v2: virtio_gpu_gem_object_open always notifies
>
> Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org>
> ---
> drivers/gpu/drm/virtio/virtgpu_drv.h | 1 +
> drivers/gpu/drm/virtio/virtgpu_gem.c | 10 ++++++++--
> drivers/gpu/drm/virtio/virtgpu_object.c | 1 -
> 3 files changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.h b/drivers/gpu/drm/virtio/virtgpu_drv.h
> index 79ad176aca5a8..842200e01d785 100644
> --- a/drivers/gpu/drm/virtio/virtgpu_drv.h
> +++ b/drivers/gpu/drm/virtio/virtgpu_drv.h
> @@ -71,6 +71,7 @@ struct virtio_gpu_object {
> uint32_t hw_res_handle;
> bool dumb;
> bool created;
> + bool notified;
> };
> #define gem_to_virtio_gpu_obj(gobj) \
> container_of((gobj), struct virtio_gpu_object, base.base)
> diff --git a/drivers/gpu/drm/virtio/virtgpu_gem.c b/drivers/gpu/drm/virtio/virtgpu_gem.c
> index 90c0a8ea1708c..597ddb7391fb9 100644
> --- a/drivers/gpu/drm/virtio/virtgpu_gem.c
> +++ b/drivers/gpu/drm/virtio/virtgpu_gem.c
> @@ -111,10 +111,13 @@ int virtio_gpu_gem_object_open(struct drm_gem_object *obj,
> {
> struct virtio_gpu_device *vgdev = obj->dev->dev_private;
> struct virtio_gpu_fpriv *vfpriv = file->driver_priv;
> + struct virtio_gpu_object *bo = gem_to_virtio_gpu_obj(obj);
> struct virtio_gpu_object_array *objs;
>
> - if (!vgdev->has_virgl_3d)
> - return 0;
> + if (!vgdev->has_virgl_3d && !bo->notified)
> + goto out_notify;
> + else if (!vgdev->has_virgl_3d)
> + goto out;
>
> objs = virtio_gpu_array_alloc(1);
> if (!objs)
> @@ -123,7 +126,10 @@ int virtio_gpu_gem_object_open(struct drm_gem_object *obj,
>
> virtio_gpu_cmd_context_attach_resource(vgdev, vfpriv->ctx_id,
> objs);
> +out_notify:
> + bo->notified = true;
> virtio_gpu_notify(vgdev);
> +out:
> return 0;
> }
>
> diff --git a/drivers/gpu/drm/virtio/virtgpu_object.c b/drivers/gpu/drm/virtio/virtgpu_object.c
> index d9039bb7c5e37..51a8da7d5ef3b 100644
> --- a/drivers/gpu/drm/virtio/virtgpu_object.c
> +++ b/drivers/gpu/drm/virtio/virtgpu_object.c
> @@ -241,7 +241,6 @@ int virtio_gpu_object_create(struct virtio_gpu_device *vgdev,
> return ret;
> }
>
> - virtio_gpu_notify(vgdev);
> *bo_ptr = bo;
> return 0;
>
> --
> 2.24.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] drm/virtio: delete notify in virtio_gpu_object_create
2020-03-25 21:31 ` Chia-I Wu
@ 2020-03-25 23:10 ` Gurchetan Singh
2020-03-25 23:35 ` Chia-I Wu
0 siblings, 1 reply; 8+ messages in thread
From: Gurchetan Singh @ 2020-03-25 23:10 UTC (permalink / raw)
To: dri-devel; +Cc: Gurchetan Singh
For 3D buffers, virtio_gpu_gem_object_open notifies.
We can have the same behavior for dumb buffer.
v2: virtio_gpu_gem_object_open always notifies
v3: avoid boolean variable
Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org>
---
drivers/gpu/drm/virtio/virtgpu_gem.c | 3 ++-
drivers/gpu/drm/virtio/virtgpu_object.c | 1 -
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/virtio/virtgpu_gem.c b/drivers/gpu/drm/virtio/virtgpu_gem.c
index 90c0a8ea1708c..1025658be4df2 100644
--- a/drivers/gpu/drm/virtio/virtgpu_gem.c
+++ b/drivers/gpu/drm/virtio/virtgpu_gem.c
@@ -114,7 +114,7 @@ int virtio_gpu_gem_object_open(struct drm_gem_object *obj,
struct virtio_gpu_object_array *objs;
if (!vgdev->has_virgl_3d)
- return 0;
+ goto out_notify;
objs = virtio_gpu_array_alloc(1);
if (!objs)
@@ -123,6 +123,7 @@ int virtio_gpu_gem_object_open(struct drm_gem_object *obj,
virtio_gpu_cmd_context_attach_resource(vgdev, vfpriv->ctx_id,
objs);
+out_notify:
virtio_gpu_notify(vgdev);
return 0;
}
diff --git a/drivers/gpu/drm/virtio/virtgpu_object.c b/drivers/gpu/drm/virtio/virtgpu_object.c
index d9039bb7c5e37..51a8da7d5ef3b 100644
--- a/drivers/gpu/drm/virtio/virtgpu_object.c
+++ b/drivers/gpu/drm/virtio/virtgpu_object.c
@@ -241,7 +241,6 @@ int virtio_gpu_object_create(struct virtio_gpu_device *vgdev,
return ret;
}
- virtio_gpu_notify(vgdev);
*bo_ptr = bo;
return 0;
--
2.24.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] drm/virtio: delete notify in virtio_gpu_object_create
2020-03-25 23:10 ` Gurchetan Singh
@ 2020-03-25 23:35 ` Chia-I Wu
0 siblings, 0 replies; 8+ messages in thread
From: Chia-I Wu @ 2020-03-25 23:35 UTC (permalink / raw)
To: Gurchetan Singh; +Cc: ML dri-devel
On Thu, Mar 26, 2020 at 7:10 AM Gurchetan Singh
<gurchetansingh@chromium.org> wrote:
>
> For 3D buffers, virtio_gpu_gem_object_open notifies.
> We can have the same behavior for dumb buffer.
>
> v2: virtio_gpu_gem_object_open always notifies
> v3: avoid boolean variable
Series is
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
>
> Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org>
> ---
> drivers/gpu/drm/virtio/virtgpu_gem.c | 3 ++-
> drivers/gpu/drm/virtio/virtgpu_object.c | 1 -
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/virtio/virtgpu_gem.c b/drivers/gpu/drm/virtio/virtgpu_gem.c
> index 90c0a8ea1708c..1025658be4df2 100644
> --- a/drivers/gpu/drm/virtio/virtgpu_gem.c
> +++ b/drivers/gpu/drm/virtio/virtgpu_gem.c
> @@ -114,7 +114,7 @@ int virtio_gpu_gem_object_open(struct drm_gem_object *obj,
> struct virtio_gpu_object_array *objs;
>
> if (!vgdev->has_virgl_3d)
> - return 0;
> + goto out_notify;
>
> objs = virtio_gpu_array_alloc(1);
> if (!objs)
> @@ -123,6 +123,7 @@ int virtio_gpu_gem_object_open(struct drm_gem_object *obj,
>
> virtio_gpu_cmd_context_attach_resource(vgdev, vfpriv->ctx_id,
> objs);
> +out_notify:
> virtio_gpu_notify(vgdev);
> return 0;
> }
> diff --git a/drivers/gpu/drm/virtio/virtgpu_object.c b/drivers/gpu/drm/virtio/virtgpu_object.c
> index d9039bb7c5e37..51a8da7d5ef3b 100644
> --- a/drivers/gpu/drm/virtio/virtgpu_object.c
> +++ b/drivers/gpu/drm/virtio/virtgpu_object.c
> @@ -241,7 +241,6 @@ int virtio_gpu_object_create(struct virtio_gpu_device *vgdev,
> return ret;
> }
>
> - virtio_gpu_notify(vgdev);
> *bo_ptr = bo;
> return 0;
>
> --
> 2.24.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2020-03-25 23:36 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-24 16:43 [PATCH 1/3] drm/virtio: random virtgpu_drv.h cleanups Gurchetan Singh
2020-03-24 16:43 ` [PATCH 2/3] drm/virtio: delete notify after virtio_gpu_cmd_context_create Gurchetan Singh
2020-03-24 16:44 ` [PATCH 3/3] drm/virtio: delete notify in virtio_gpu_object_create Gurchetan Singh
2020-03-24 22:11 ` Chia-I Wu
2020-03-25 0:41 ` [PATCH] " Gurchetan Singh
2020-03-25 21:31 ` Chia-I Wu
2020-03-25 23:10 ` Gurchetan Singh
2020-03-25 23:35 ` Chia-I Wu
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).