diff mbox series

[RFC,2/3] drm: vgem: Enable SYNCOBJ and SYNCOBJ_TIMELINE on vgem driver

Message ID 20220712042258.293010-2-jstultz@google.com (mailing list archive)
State New, archived
Headers show
Series [RFC,1/3] drm: drm_syncobj: Add note in DOC about absolute timeout values | expand

Commit Message

John Stultz July 12, 2022, 4:22 a.m. UTC
Allows for basic SYNCOBJ api testing, in environments
like VMs where there may not be a supported drm driver.

Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Jason Ekstrand <jason@jlekstrand.net>
Cc: Christian König <christian.koenig@amd.com>
Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: Chunming Zhou <david1.zhou@amd.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: John Stultz <jstultz@google.com>
---
 drivers/gpu/drm/vgem/vgem_drv.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Christian König July 12, 2022, 7:45 a.m. UTC | #1
Am 12.07.22 um 06:22 schrieb John Stultz:
> Allows for basic SYNCOBJ api testing, in environments
> like VMs where there may not be a supported drm driver.
>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Maxime Ripard <mripard@kernel.org>
> Cc: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: Jason Ekstrand <jason@jlekstrand.net>
> Cc: Christian König <christian.koenig@amd.com>
> Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
> Cc: Chunming Zhou <david1.zhou@amd.com>
> Cc: David Airlie <airlied@linux.ie>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: John Stultz <jstultz@google.com>
> ---
>   drivers/gpu/drm/vgem/vgem_drv.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/vgem/vgem_drv.c b/drivers/gpu/drm/vgem/vgem_drv.c
> index c5e3e5457737..e5427d7399da 100644
> --- a/drivers/gpu/drm/vgem/vgem_drv.c
> +++ b/drivers/gpu/drm/vgem/vgem_drv.c
> @@ -109,7 +109,8 @@ static struct drm_gem_object *vgem_gem_create_object(struct drm_device *dev, siz
>   }
>   
>   static const struct drm_driver vgem_driver = {
> -	.driver_features		= DRIVER_GEM | DRIVER_RENDER,
> +	.driver_features		= DRIVER_GEM | DRIVER_RENDER |
> +					  DRIVER_SYNCOBJ | DRIVER_SYNCOBJ_TIMELINE,

Well that's rather surprising. I'm not an export on VGEM, but AFAIK you 
need to adjust the CS interface to support that stuff as well.

Christian.

>   	.open				= vgem_open,
>   	.postclose			= vgem_postclose,
>   	.ioctls				= vgem_ioctls,
John Stultz July 12, 2022, 4:50 p.m. UTC | #2
On Tue, Jul 12, 2022 at 12:46 AM Christian König
<christian.koenig@amd.com> wrote:
>
> Am 12.07.22 um 06:22 schrieb John Stultz:
> > Allows for basic SYNCOBJ api testing, in environments
> > like VMs where there may not be a supported drm driver.
> >
> > Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> > Cc: Maxime Ripard <mripard@kernel.org>
> > Cc: Thomas Zimmermann <tzimmermann@suse.de>
> > Cc: Jason Ekstrand <jason@jlekstrand.net>
> > Cc: Christian König <christian.koenig@amd.com>
> > Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
> > Cc: Chunming Zhou <david1.zhou@amd.com>
> > Cc: David Airlie <airlied@linux.ie>
> > Cc: Daniel Vetter <daniel@ffwll.ch>
> > Cc: dri-devel@lists.freedesktop.org
> > Signed-off-by: John Stultz <jstultz@google.com>
> > ---
> >   drivers/gpu/drm/vgem/vgem_drv.c | 3 ++-
> >   1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/vgem/vgem_drv.c b/drivers/gpu/drm/vgem/vgem_drv.c
> > index c5e3e5457737..e5427d7399da 100644
> > --- a/drivers/gpu/drm/vgem/vgem_drv.c
> > +++ b/drivers/gpu/drm/vgem/vgem_drv.c
> > @@ -109,7 +109,8 @@ static struct drm_gem_object *vgem_gem_create_object(struct drm_device *dev, siz
> >   }
> >
> >   static const struct drm_driver vgem_driver = {
> > -     .driver_features                = DRIVER_GEM | DRIVER_RENDER,
> > +     .driver_features                = DRIVER_GEM | DRIVER_RENDER |
> > +                                       DRIVER_SYNCOBJ | DRIVER_SYNCOBJ_TIMELINE,
>
> Well that's rather surprising. I'm not an export on VGEM, but AFAIK you
> need to adjust the CS interface to support that stuff as well.

Apologies, could you clarify a bit more what you mean here?  This was
just helpful to enable the generic userland ioctls for the example
test tool in this series.

Are you proposing to add interfaces so the vgem driver can
attach/signal syncobjs similar to the
DRM_IOCTL_VGEM_FENCE_ATTACH/DRM_IOCTL_VGEM_FENCE_SIGNAL calls?

thanks
-john
Christian König July 13, 2022, 8:02 a.m. UTC | #3
Am 12.07.22 um 18:50 schrieb John Stultz:
> On Tue, Jul 12, 2022 at 12:46 AM Christian König
> <christian.koenig@amd.com> wrote:
>> Am 12.07.22 um 06:22 schrieb John Stultz:
>>> Allows for basic SYNCOBJ api testing, in environments
>>> like VMs where there may not be a supported drm driver.
>>>
>>> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
>>> Cc: Maxime Ripard <mripard@kernel.org>
>>> Cc: Thomas Zimmermann <tzimmermann@suse.de>
>>> Cc: Jason Ekstrand <jason@jlekstrand.net>
>>> Cc: Christian König <christian.koenig@amd.com>
>>> Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
>>> Cc: Chunming Zhou <david1.zhou@amd.com>
>>> Cc: David Airlie <airlied@linux.ie>
>>> Cc: Daniel Vetter <daniel@ffwll.ch>
>>> Cc: dri-devel@lists.freedesktop.org
>>> Signed-off-by: John Stultz <jstultz@google.com>
>>> ---
>>>    drivers/gpu/drm/vgem/vgem_drv.c | 3 ++-
>>>    1 file changed, 2 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/gpu/drm/vgem/vgem_drv.c b/drivers/gpu/drm/vgem/vgem_drv.c
>>> index c5e3e5457737..e5427d7399da 100644
>>> --- a/drivers/gpu/drm/vgem/vgem_drv.c
>>> +++ b/drivers/gpu/drm/vgem/vgem_drv.c
>>> @@ -109,7 +109,8 @@ static struct drm_gem_object *vgem_gem_create_object(struct drm_device *dev, siz
>>>    }
>>>
>>>    static const struct drm_driver vgem_driver = {
>>> -     .driver_features                = DRIVER_GEM | DRIVER_RENDER,
>>> +     .driver_features                = DRIVER_GEM | DRIVER_RENDER |
>>> +                                       DRIVER_SYNCOBJ | DRIVER_SYNCOBJ_TIMELINE,
>> Well that's rather surprising. I'm not an export on VGEM, but AFAIK you
>> need to adjust the CS interface to support that stuff as well.
> Apologies, could you clarify a bit more what you mean here?  This was
> just helpful to enable the generic userland ioctls for the example
> test tool in this series.
>
> Are you proposing to add interfaces so the vgem driver can
> attach/signal syncobjs similar to the
> DRM_IOCTL_VGEM_FENCE_ATTACH/DRM_IOCTL_VGEM_FENCE_SIGNAL calls?

Yes, exactly that. I don't see how it would be useful otherwise.

Christian.

>
> thanks
> -john
diff mbox series

Patch

diff --git a/drivers/gpu/drm/vgem/vgem_drv.c b/drivers/gpu/drm/vgem/vgem_drv.c
index c5e3e5457737..e5427d7399da 100644
--- a/drivers/gpu/drm/vgem/vgem_drv.c
+++ b/drivers/gpu/drm/vgem/vgem_drv.c
@@ -109,7 +109,8 @@  static struct drm_gem_object *vgem_gem_create_object(struct drm_device *dev, siz
 }
 
 static const struct drm_driver vgem_driver = {
-	.driver_features		= DRIVER_GEM | DRIVER_RENDER,
+	.driver_features		= DRIVER_GEM | DRIVER_RENDER |
+					  DRIVER_SYNCOBJ | DRIVER_SYNCOBJ_TIMELINE,
 	.open				= vgem_open,
 	.postclose			= vgem_postclose,
 	.ioctls				= vgem_ioctls,