Message ID | 20190416125750.31370-1-lionel.g.landwerlin@intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [v2] drm: introduce a capability flag for syncobj timeline support | expand |
Reviewed-by: Chunming Zhou <david1.zhou@amd.com> for series. -------- Original Message -------- Subject: [PATCH v2] drm: introduce a capability flag for syncobj timeline support From: Lionel Landwerlin To: dri-devel@lists.freedesktop.org CC: Lionel Landwerlin ,"Koenig, Christian" ,Dave Airlie ,Daniel Vetter ,"Zhou, David(ChunMing)" Unfortunately userspace users of this API cannot be publicly disclosed yet. This commit effectively disables timeline syncobj ioctls for all drivers. Each driver wishing to support this feature will need to expose DRIVER_SYNCOBJ_TIMELINE. v2: Add uAPI capability check (Christian) Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Christian König <christian.koenig@amd.com> (v1) Cc: Dave Airlie <airlied@redhat.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Christian König <christian.koenig@amd.com> Cc: Chunming Zhou <david1.zhou@amd.com> --- drivers/gpu/drm/drm_ioctl.c | 3 +++ drivers/gpu/drm/drm_syncobj.c | 10 +++++----- include/drm/drm_drv.h | 7 +++++++ include/uapi/drm/drm.h | 1 + 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c index d337f161909c..15ca94338d55 100644 --- a/drivers/gpu/drm/drm_ioctl.c +++ b/drivers/gpu/drm/drm_ioctl.c @@ -245,6 +245,9 @@ static int drm_getcap(struct drm_device *dev, void *data, struct drm_file *file_ case DRM_CAP_SYNCOBJ: req->value = drm_core_check_feature(dev, DRIVER_SYNCOBJ); return 0; + case DRM_CAP_SYNCOBJ_TIMELINE: + req->value = drm_core_check_feature(dev, DRIVER_SYNCOBJ_TIMELINE); + return 0; } /* Other caps only work with KMS drivers */ diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c index fb65f13d25cf..72a38ff6e3e4 100644 --- a/drivers/gpu/drm/drm_syncobj.c +++ b/drivers/gpu/drm/drm_syncobj.c @@ -755,7 +755,7 @@ drm_syncobj_transfer_ioctl(struct drm_device *dev, void *data, struct drm_syncobj_transfer *args = data; int ret; - if (!drm_core_check_feature(dev, DRIVER_SYNCOBJ)) + if (!drm_core_check_feature(dev, DRIVER_SYNCOBJ_TIMELINE)) return -EOPNOTSUPP; if (args->pad) @@ -1106,7 +1106,7 @@ drm_syncobj_timeline_wait_ioctl(struct drm_device *dev, void *data, struct drm_syncobj **syncobjs; int ret = 0; - if (!drm_core_check_feature(dev, DRIVER_SYNCOBJ)) + if (!drm_core_check_feature(dev, DRIVER_SYNCOBJ_TIMELINE)) return -EOPNOTSUPP; if (args->flags & ~(DRM_SYNCOBJ_WAIT_FLAGS_WAIT_ALL | @@ -1210,7 +1210,7 @@ drm_syncobj_timeline_signal_ioctl(struct drm_device *dev, void *data, uint32_t i, j; int ret; - if (!drm_core_check_feature(dev, DRIVER_SYNCOBJ)) + if (!drm_core_check_feature(dev, DRIVER_SYNCOBJ_TIMELINE)) return -EOPNOTSUPP; if (args->pad != 0) @@ -1281,8 +1281,8 @@ int drm_syncobj_query_ioctl(struct drm_device *dev, void *data, uint32_t i; int ret; - if (!drm_core_check_feature(dev, DRIVER_SYNCOBJ)) - return -ENODEV; + if (!drm_core_check_feature(dev, DRIVER_SYNCOBJ_TIMELINE)) + return -EOPNOTSUPP; if (args->pad != 0) return -EINVAL; diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h index 5cc7f728ec73..68ca736c548d 100644 --- a/include/drm/drm_drv.h +++ b/include/drm/drm_drv.h @@ -91,6 +91,13 @@ enum drm_driver_feature { * submission. */ DRIVER_SYNCOBJ = BIT(5), + /** + * @DRIVER_SYNCOBJ_TIMELINE: + * + * Driver supports the timeline flavor of &drm_syncobj for explicit + * synchronization of command submission. + */ + DRIVER_SYNCOBJ_TIMELINE = BIT(6), /* IMPORTANT: Below are all the legacy flags, add new ones above. */ diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h index 236b01a1fabf..661d73f9a919 100644 --- a/include/uapi/drm/drm.h +++ b/include/uapi/drm/drm.h @@ -649,6 +649,7 @@ struct drm_gem_open { #define DRM_CAP_PAGE_FLIP_TARGET 0x11 #define DRM_CAP_CRTC_IN_VBLANK_EVENT 0x12 #define DRM_CAP_SYNCOBJ 0x13 +#define DRM_CAP_SYNCOBJ_TIMELINE 0x14 /** DRM_IOCTL_GET_CAP ioctl argument type */ struct drm_get_cap { -- 2.21.0.392.gf8f6787159e <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta name="Generator" content="Microsoft Exchange Server"> <!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style> </head> <body> <div>Reviewed-by: Chunming Zhou <david1.zhou@amd.com> for series.<br> <br> -------- Original Message --------<br> Subject: [PATCH v2] drm: introduce a capability flag for syncobj timeline support<br> From: Lionel Landwerlin <br> To: dri-devel@lists.freedesktop.org<br> CC: Lionel Landwerlin ,"Koenig, Christian" ,Dave Airlie ,Daniel Vetter ,"Zhou, David(ChunMing)" <br> <br> </div> <font size="2"><span style="font-size:11pt;"> <div class="PlainText">Unfortunately userspace users of this API cannot be publicly disclosed<br> yet.<br> <br> This commit effectively disables timeline syncobj ioctls for all<br> drivers. Each driver wishing to support this feature will need to<br> expose DRIVER_SYNCOBJ_TIMELINE.<br> <br> v2: Add uAPI capability check (Christian)<br> <br> Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com><br> Reviewed-by: Christian König <christian.koenig@amd.com> (v1)<br> Cc: Dave Airlie <airlied@redhat.com><br> Cc: Daniel Vetter <daniel.vetter@ffwll.ch><br> Cc: Christian König <christian.koenig@amd.com><br> Cc: Chunming Zhou <david1.zhou@amd.com><br> ---<br> drivers/gpu/drm/drm_ioctl.c | 3 +++<br> drivers/gpu/drm/drm_syncobj.c | 10 +++++-----<br> include/drm/drm_drv.h | 7 +++++++<br> include/uapi/drm/drm.h | 1 +<br> 4 files changed, 16 insertions(+), 5 deletions(-)<br> <br> diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c<br> index d337f161909c..15ca94338d55 100644<br> --- a/drivers/gpu/drm/drm_ioctl.c<br> +++ b/drivers/gpu/drm/drm_ioctl.c<br> @@ -245,6 +245,9 @@ static int drm_getcap(struct drm_device *dev, void *data, struct drm_file *file_<br> case DRM_CAP_SYNCOBJ:<br> req->value = drm_core_check_feature(dev, DRIVER_SYNCOBJ);<br> return 0;<br> + case DRM_CAP_SYNCOBJ_TIMELINE:<br> + req->value = drm_core_check_feature(dev, DRIVER_SYNCOBJ_TIMELINE);<br> + return 0;<br> }<br> <br> /* Other caps only work with KMS drivers */<br> diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c<br> index fb65f13d25cf..72a38ff6e3e4 100644<br> --- a/drivers/gpu/drm/drm_syncobj.c<br> +++ b/drivers/gpu/drm/drm_syncobj.c<br> @@ -755,7 +755,7 @@ drm_syncobj_transfer_ioctl(struct drm_device *dev, void *data,<br> struct drm_syncobj_transfer *args = data;<br> int ret;<br> <br> - if (!drm_core_check_feature(dev, DRIVER_SYNCOBJ))<br> + if (!drm_core_check_feature(dev, DRIVER_SYNCOBJ_TIMELINE))<br> return -EOPNOTSUPP;<br> <br> if (args->pad)<br> @@ -1106,7 +1106,7 @@ drm_syncobj_timeline_wait_ioctl(struct drm_device *dev, void *data,<br> struct drm_syncobj **syncobjs;<br> int ret = 0;<br> <br> - if (!drm_core_check_feature(dev, DRIVER_SYNCOBJ))<br> + if (!drm_core_check_feature(dev, DRIVER_SYNCOBJ_TIMELINE))<br> return -EOPNOTSUPP;<br> <br> if (args->flags & ~(DRM_SYNCOBJ_WAIT_FLAGS_WAIT_ALL |<br> @@ -1210,7 +1210,7 @@ drm_syncobj_timeline_signal_ioctl(struct drm_device *dev, void *data,<br> uint32_t i, j;<br> int ret;<br> <br> - if (!drm_core_check_feature(dev, DRIVER_SYNCOBJ))<br> + if (!drm_core_check_feature(dev, DRIVER_SYNCOBJ_TIMELINE))<br> return -EOPNOTSUPP;<br> <br> if (args->pad != 0)<br> @@ -1281,8 +1281,8 @@ int drm_syncobj_query_ioctl(struct drm_device *dev, void *data,<br> uint32_t i;<br> int ret;<br> <br> - if (!drm_core_check_feature(dev, DRIVER_SYNCOBJ))<br> - return -ENODEV;<br> + if (!drm_core_check_feature(dev, DRIVER_SYNCOBJ_TIMELINE))<br> + return -EOPNOTSUPP;<br> <br> if (args->pad != 0)<br> return -EINVAL;<br> diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h<br> index 5cc7f728ec73..68ca736c548d 100644<br> --- a/include/drm/drm_drv.h<br> +++ b/include/drm/drm_drv.h<br> @@ -91,6 +91,13 @@ enum drm_driver_feature {<br> * submission.<br> */<br> DRIVER_SYNCOBJ = BIT(5),<br> + /**<br> + * @DRIVER_SYNCOBJ_TIMELINE:<br> + *<br> + * Driver supports the timeline flavor of &drm_syncobj for explicit<br> + * synchronization of command submission.<br> + */<br> + DRIVER_SYNCOBJ_TIMELINE = BIT(6),<br> <br> /* IMPORTANT: Below are all the legacy flags, add new ones above. */<br> <br> diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h<br> index 236b01a1fabf..661d73f9a919 100644<br> --- a/include/uapi/drm/drm.h<br> +++ b/include/uapi/drm/drm.h<br> @@ -649,6 +649,7 @@ struct drm_gem_open {<br> #define DRM_CAP_PAGE_FLIP_TARGET 0x11<br> #define DRM_CAP_CRTC_IN_VBLANK_EVENT 0x12<br> #define DRM_CAP_SYNCOBJ 0x13<br> +#define DRM_CAP_SYNCOBJ_TIMELINE 0x14<br> <br> /** DRM_IOCTL_GET_CAP ioctl argument type */<br> struct drm_get_cap {<br> -- <br> 2.21.0.392.gf8f6787159e<br> <br> </div> </span></font> </body> </html>
I can't judge if that UAPI is actually sufficient, but the rest still looks good to me. Acked-by: Christian König <christian.koenig@amd.com> Christian. Am 16.04.19 um 15:15 schrieb Zhou, David(ChunMing): > Reviewed-by: Chunming Zhou <david1.zhou@amd.com> for series. > > -------- Original Message -------- > Subject: [PATCH v2] drm: introduce a capability flag for syncobj > timeline support > From: Lionel Landwerlin > To: dri-devel@lists.freedesktop.org > CC: Lionel Landwerlin ,"Koenig, Christian" ,Dave Airlie ,Daniel Vetter > ,"Zhou, David(ChunMing)" > > Unfortunately userspace users of this API cannot be publicly disclosed > yet. > > This commit effectively disables timeline syncobj ioctls for all > drivers. Each driver wishing to support this feature will need to > expose DRIVER_SYNCOBJ_TIMELINE. > > v2: Add uAPI capability check (Christian) > > Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> > Reviewed-by: Christian König <christian.koenig@amd.com> (v1) > Cc: Dave Airlie <airlied@redhat.com> > Cc: Daniel Vetter <daniel.vetter@ffwll.ch> > Cc: Christian König <christian.koenig@amd.com> > Cc: Chunming Zhou <david1.zhou@amd.com> > --- > drivers/gpu/drm/drm_ioctl.c | 3 +++ > drivers/gpu/drm/drm_syncobj.c | 10 +++++----- > include/drm/drm_drv.h | 7 +++++++ > include/uapi/drm/drm.h | 1 + > 4 files changed, 16 insertions(+), 5 deletions(-) > > diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c > index d337f161909c..15ca94338d55 100644 > --- a/drivers/gpu/drm/drm_ioctl.c > +++ b/drivers/gpu/drm/drm_ioctl.c > @@ -245,6 +245,9 @@ static int drm_getcap(struct drm_device *dev, void > *data, struct drm_file *file_ > case DRM_CAP_SYNCOBJ: > req->value = drm_core_check_feature(dev, DRIVER_SYNCOBJ); > return 0; > + case DRM_CAP_SYNCOBJ_TIMELINE: > + req->value = drm_core_check_feature(dev, > DRIVER_SYNCOBJ_TIMELINE); > + return 0; > } > > /* Other caps only work with KMS drivers */ > diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c > index fb65f13d25cf..72a38ff6e3e4 100644 > --- a/drivers/gpu/drm/drm_syncobj.c > +++ b/drivers/gpu/drm/drm_syncobj.c > @@ -755,7 +755,7 @@ drm_syncobj_transfer_ioctl(struct drm_device *dev, > void *data, > struct drm_syncobj_transfer *args = data; > int ret; > > - if (!drm_core_check_feature(dev, DRIVER_SYNCOBJ)) > + if (!drm_core_check_feature(dev, DRIVER_SYNCOBJ_TIMELINE)) > return -EOPNOTSUPP; > > if (args->pad) > @@ -1106,7 +1106,7 @@ drm_syncobj_timeline_wait_ioctl(struct > drm_device *dev, void *data, > struct drm_syncobj **syncobjs; > int ret = 0; > > - if (!drm_core_check_feature(dev, DRIVER_SYNCOBJ)) > + if (!drm_core_check_feature(dev, DRIVER_SYNCOBJ_TIMELINE)) > return -EOPNOTSUPP; > > if (args->flags & ~(DRM_SYNCOBJ_WAIT_FLAGS_WAIT_ALL | > @@ -1210,7 +1210,7 @@ drm_syncobj_timeline_signal_ioctl(struct > drm_device *dev, void *data, > uint32_t i, j; > int ret; > > - if (!drm_core_check_feature(dev, DRIVER_SYNCOBJ)) > + if (!drm_core_check_feature(dev, DRIVER_SYNCOBJ_TIMELINE)) > return -EOPNOTSUPP; > > if (args->pad != 0) > @@ -1281,8 +1281,8 @@ int drm_syncobj_query_ioctl(struct drm_device > *dev, void *data, > uint32_t i; > int ret; > > - if (!drm_core_check_feature(dev, DRIVER_SYNCOBJ)) > - return -ENODEV; > + if (!drm_core_check_feature(dev, DRIVER_SYNCOBJ_TIMELINE)) > + return -EOPNOTSUPP; > > if (args->pad != 0) > return -EINVAL; > diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h > index 5cc7f728ec73..68ca736c548d 100644 > --- a/include/drm/drm_drv.h > +++ b/include/drm/drm_drv.h > @@ -91,6 +91,13 @@ enum drm_driver_feature { > * submission. > */ > DRIVER_SYNCOBJ = BIT(5), > + /** > + * @DRIVER_SYNCOBJ_TIMELINE: > + * > + * Driver supports the timeline flavor of &drm_syncobj for > explicit > + * synchronization of command submission. > + */ > + DRIVER_SYNCOBJ_TIMELINE = BIT(6), > > /* IMPORTANT: Below are all the legacy flags, add new ones > above. */ > > diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h > index 236b01a1fabf..661d73f9a919 100644 > --- a/include/uapi/drm/drm.h > +++ b/include/uapi/drm/drm.h > @@ -649,6 +649,7 @@ struct drm_gem_open { > #define DRM_CAP_PAGE_FLIP_TARGET 0x11 > #define DRM_CAP_CRTC_IN_VBLANK_EVENT 0x12 > #define DRM_CAP_SYNCOBJ 0x13 > +#define DRM_CAP_SYNCOBJ_TIMELINE 0x14 > > /** DRM_IOCTL_GET_CAP ioctl argument type */ > struct drm_get_cap { > -- > 2.21.0.392.gf8f6787159e > > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> </head> <body text="#000000" bgcolor="#FFFFFF"> <div class="moz-cite-prefix">I can't judge if that UAPI is actually sufficient, but the rest still looks good to me.<br> <br> Acked-by: Christian König <a class="moz-txt-link-rfc2396E" href="mailto:christian.koenig@amd.com"><christian.koenig@amd.com></a><br> <br> Christian.<br> <br> Am 16.04.19 um 15:15 schrieb Zhou, David(ChunMing):<br> </div> <blockquote type="cite" cite="mid:g473ssb6g9in1c36xw9ju8l5wdtvp-gvzol4w0y5mw-vlv3bo-vpqqv0-zerdqu2r22c19rx4b444q5wxby0nnbgied56objhf-84ko14jpv2kg-7irzs22147wm852jmw-8a0k7hka8nozq4k7d5.1555420499452@email.android.com"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <meta name="Generator" content="Microsoft Exchange Server"> <!-- converted from text --> <style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style> <div>Reviewed-by: Chunming Zhou <a class="moz-txt-link-rfc2396E" href="mailto:david1.zhou@amd.com"><david1.zhou@amd.com></a> for series.<br> <br> -------- Original Message --------<br> Subject: [PATCH v2] drm: introduce a capability flag for syncobj timeline support<br> From: Lionel Landwerlin <br> To: <a class="moz-txt-link-abbreviated" href="mailto:dri-devel@lists.freedesktop.org">dri-devel@lists.freedesktop.org</a><br> CC: Lionel Landwerlin ,"Koenig, Christian" ,Dave Airlie ,Daniel Vetter ,"Zhou, David(ChunMing)" <br> <br> </div> <font size="2"><span style="font-size:11pt;"> <div class="PlainText">Unfortunately userspace users of this API cannot be publicly disclosed<br> yet.<br> <br> This commit effectively disables timeline syncobj ioctls for all<br> drivers. Each driver wishing to support this feature will need to<br> expose DRIVER_SYNCOBJ_TIMELINE.<br> <br> v2: Add uAPI capability check (Christian)<br> <br> Signed-off-by: Lionel Landwerlin <a class="moz-txt-link-rfc2396E" href="mailto:lionel.g.landwerlin@intel.com"><lionel.g.landwerlin@intel.com></a><br> Reviewed-by: Christian König <a class="moz-txt-link-rfc2396E" href="mailto:christian.koenig@amd.com"><christian.koenig@amd.com></a> (v1)<br> Cc: Dave Airlie <a class="moz-txt-link-rfc2396E" href="mailto:airlied@redhat.com"><airlied@redhat.com></a><br> Cc: Daniel Vetter <a class="moz-txt-link-rfc2396E" href="mailto:daniel.vetter@ffwll.ch"><daniel.vetter@ffwll.ch></a><br> Cc: Christian König <a class="moz-txt-link-rfc2396E" href="mailto:christian.koenig@amd.com"><christian.koenig@amd.com></a><br> Cc: Chunming Zhou <a class="moz-txt-link-rfc2396E" href="mailto:david1.zhou@amd.com"><david1.zhou@amd.com></a><br> ---<br> drivers/gpu/drm/drm_ioctl.c | 3 +++<br> drivers/gpu/drm/drm_syncobj.c | 10 +++++-----<br> include/drm/drm_drv.h | 7 +++++++<br> include/uapi/drm/drm.h | 1 +<br> 4 files changed, 16 insertions(+), 5 deletions(-)<br> <br> diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c<br> index d337f161909c..15ca94338d55 100644<br> --- a/drivers/gpu/drm/drm_ioctl.c<br> +++ b/drivers/gpu/drm/drm_ioctl.c<br> @@ -245,6 +245,9 @@ static int drm_getcap(struct drm_device *dev, void *data, struct drm_file *file_<br> case DRM_CAP_SYNCOBJ:<br> req->value = drm_core_check_feature(dev, DRIVER_SYNCOBJ);<br> return 0;<br> + case DRM_CAP_SYNCOBJ_TIMELINE:<br> + req->value = drm_core_check_feature(dev, DRIVER_SYNCOBJ_TIMELINE);<br> + return 0;<br> }<br> <br> /* Other caps only work with KMS drivers */<br> diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c<br> index fb65f13d25cf..72a38ff6e3e4 100644<br> --- a/drivers/gpu/drm/drm_syncobj.c<br> +++ b/drivers/gpu/drm/drm_syncobj.c<br> @@ -755,7 +755,7 @@ drm_syncobj_transfer_ioctl(struct drm_device *dev, void *data,<br> struct drm_syncobj_transfer *args = data;<br> int ret;<br> <br> - if (!drm_core_check_feature(dev, DRIVER_SYNCOBJ))<br> + if (!drm_core_check_feature(dev, DRIVER_SYNCOBJ_TIMELINE))<br> return -EOPNOTSUPP;<br> <br> if (args->pad)<br> @@ -1106,7 +1106,7 @@ drm_syncobj_timeline_wait_ioctl(struct drm_device *dev, void *data,<br> struct drm_syncobj **syncobjs;<br> int ret = 0;<br> <br> - if (!drm_core_check_feature(dev, DRIVER_SYNCOBJ))<br> + if (!drm_core_check_feature(dev, DRIVER_SYNCOBJ_TIMELINE))<br> return -EOPNOTSUPP;<br> <br> if (args->flags & ~(DRM_SYNCOBJ_WAIT_FLAGS_WAIT_ALL |<br> @@ -1210,7 +1210,7 @@ drm_syncobj_timeline_signal_ioctl(struct drm_device *dev, void *data,<br> uint32_t i, j;<br> int ret;<br> <br> - if (!drm_core_check_feature(dev, DRIVER_SYNCOBJ))<br> + if (!drm_core_check_feature(dev, DRIVER_SYNCOBJ_TIMELINE))<br> return -EOPNOTSUPP;<br> <br> if (args->pad != 0)<br> @@ -1281,8 +1281,8 @@ int drm_syncobj_query_ioctl(struct drm_device *dev, void *data,<br> uint32_t i;<br> int ret;<br> <br> - if (!drm_core_check_feature(dev, DRIVER_SYNCOBJ))<br> - return -ENODEV;<br> + if (!drm_core_check_feature(dev, DRIVER_SYNCOBJ_TIMELINE))<br> + return -EOPNOTSUPP;<br> <br> if (args->pad != 0)<br> return -EINVAL;<br> diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h<br> index 5cc7f728ec73..68ca736c548d 100644<br> --- a/include/drm/drm_drv.h<br> +++ b/include/drm/drm_drv.h<br> @@ -91,6 +91,13 @@ enum drm_driver_feature {<br> * submission.<br> */<br> DRIVER_SYNCOBJ = BIT(5),<br> + /**<br> + * @DRIVER_SYNCOBJ_TIMELINE:<br> + *<br> + * Driver supports the timeline flavor of &drm_syncobj for explicit<br> + * synchronization of command submission.<br> + */<br> + DRIVER_SYNCOBJ_TIMELINE = BIT(6),<br> <br> /* IMPORTANT: Below are all the legacy flags, add new ones above. */<br> <br> diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h<br> index 236b01a1fabf..661d73f9a919 100644<br> --- a/include/uapi/drm/drm.h<br> +++ b/include/uapi/drm/drm.h<br> @@ -649,6 +649,7 @@ struct drm_gem_open {<br> #define DRM_CAP_PAGE_FLIP_TARGET 0x11<br> #define DRM_CAP_CRTC_IN_VBLANK_EVENT 0x12<br> #define DRM_CAP_SYNCOBJ 0x13<br> +#define DRM_CAP_SYNCOBJ_TIMELINE 0x14<br> <br> /** DRM_IOCTL_GET_CAP ioctl argument type */<br> struct drm_get_cap {<br> -- <br> 2.21.0.392.gf8f6787159e<br> <br> </div> </span></font> <br> <fieldset class="mimeAttachmentHeader"></fieldset> <pre class="moz-quote-pre" wrap="">_______________________________________________ dri-devel mailing list <a class="moz-txt-link-abbreviated" href="mailto:dri-devel@lists.freedesktop.org">dri-devel@lists.freedesktop.org</a> <a class="moz-txt-link-freetext" href="https://lists.freedesktop.org/mailman/listinfo/dri-devel">https://lists.freedesktop.org/mailman/listinfo/dri-devel</a></pre> </blockquote> <br> </body> </html>
On Tue, 16 Apr 2019 at 22:58, Lionel Landwerlin <lionel.g.landwerlin@intel.com> wrote: > > Unfortunately userspace users of this API cannot be publicly disclosed > yet. > > This commit effectively disables timeline syncobj ioctls for all > drivers. Each driver wishing to support this feature will need to > expose DRIVER_SYNCOBJ_TIMELINE. > > v2: Add uAPI capability check (Christian) > > Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> > Reviewed-by: Christian König <christian.koenig@amd.com> (v1) > Cc: Dave Airlie <airlied@redhat.com> > Cc: Daniel Vetter <daniel.vetter@ffwll.ch> > Cc: Christian König <christian.koenig@amd.com> > Cc: Chunming Zhou <david1.zhou@amd.com> LGTM, Reviewed-by: Dave Airlie <airlied@redhat.com> Not sure if I'm due anymore misc-next pulls, if so would be good to have it go that way, but otherwise I can pull it into -next when I get some time. Dave.
On 16/04/2019 20:53, Dave Airlie wrote: > On Tue, 16 Apr 2019 at 22:58, Lionel Landwerlin > <lionel.g.landwerlin@intel.com> wrote: >> Unfortunately userspace users of this API cannot be publicly disclosed >> yet. >> >> This commit effectively disables timeline syncobj ioctls for all >> drivers. Each driver wishing to support this feature will need to >> expose DRIVER_SYNCOBJ_TIMELINE. >> >> v2: Add uAPI capability check (Christian) >> >> Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> >> Reviewed-by: Christian König <christian.koenig@amd.com> (v1) >> Cc: Dave Airlie <airlied@redhat.com> >> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> >> Cc: Christian König <christian.koenig@amd.com> >> Cc: Chunming Zhou <david1.zhou@amd.com> > LGTM, > > Reviewed-by: Dave Airlie <airlied@redhat.com> > > Not sure if I'm due anymore misc-next pulls, if so would be good to > have it go that way, but otherwise I can pull it into -next when I get > some time. > > Dave. > Christian, Dave, Who should pull these patches in? Thanks, -Lionel
diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c index d337f161909c..15ca94338d55 100644 --- a/drivers/gpu/drm/drm_ioctl.c +++ b/drivers/gpu/drm/drm_ioctl.c @@ -245,6 +245,9 @@ static int drm_getcap(struct drm_device *dev, void *data, struct drm_file *file_ case DRM_CAP_SYNCOBJ: req->value = drm_core_check_feature(dev, DRIVER_SYNCOBJ); return 0; + case DRM_CAP_SYNCOBJ_TIMELINE: + req->value = drm_core_check_feature(dev, DRIVER_SYNCOBJ_TIMELINE); + return 0; } /* Other caps only work with KMS drivers */ diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c index fb65f13d25cf..72a38ff6e3e4 100644 --- a/drivers/gpu/drm/drm_syncobj.c +++ b/drivers/gpu/drm/drm_syncobj.c @@ -755,7 +755,7 @@ drm_syncobj_transfer_ioctl(struct drm_device *dev, void *data, struct drm_syncobj_transfer *args = data; int ret; - if (!drm_core_check_feature(dev, DRIVER_SYNCOBJ)) + if (!drm_core_check_feature(dev, DRIVER_SYNCOBJ_TIMELINE)) return -EOPNOTSUPP; if (args->pad) @@ -1106,7 +1106,7 @@ drm_syncobj_timeline_wait_ioctl(struct drm_device *dev, void *data, struct drm_syncobj **syncobjs; int ret = 0; - if (!drm_core_check_feature(dev, DRIVER_SYNCOBJ)) + if (!drm_core_check_feature(dev, DRIVER_SYNCOBJ_TIMELINE)) return -EOPNOTSUPP; if (args->flags & ~(DRM_SYNCOBJ_WAIT_FLAGS_WAIT_ALL | @@ -1210,7 +1210,7 @@ drm_syncobj_timeline_signal_ioctl(struct drm_device *dev, void *data, uint32_t i, j; int ret; - if (!drm_core_check_feature(dev, DRIVER_SYNCOBJ)) + if (!drm_core_check_feature(dev, DRIVER_SYNCOBJ_TIMELINE)) return -EOPNOTSUPP; if (args->pad != 0) @@ -1281,8 +1281,8 @@ int drm_syncobj_query_ioctl(struct drm_device *dev, void *data, uint32_t i; int ret; - if (!drm_core_check_feature(dev, DRIVER_SYNCOBJ)) - return -ENODEV; + if (!drm_core_check_feature(dev, DRIVER_SYNCOBJ_TIMELINE)) + return -EOPNOTSUPP; if (args->pad != 0) return -EINVAL; diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h index 5cc7f728ec73..68ca736c548d 100644 --- a/include/drm/drm_drv.h +++ b/include/drm/drm_drv.h @@ -91,6 +91,13 @@ enum drm_driver_feature { * submission. */ DRIVER_SYNCOBJ = BIT(5), + /** + * @DRIVER_SYNCOBJ_TIMELINE: + * + * Driver supports the timeline flavor of &drm_syncobj for explicit + * synchronization of command submission. + */ + DRIVER_SYNCOBJ_TIMELINE = BIT(6), /* IMPORTANT: Below are all the legacy flags, add new ones above. */ diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h index 236b01a1fabf..661d73f9a919 100644 --- a/include/uapi/drm/drm.h +++ b/include/uapi/drm/drm.h @@ -649,6 +649,7 @@ struct drm_gem_open { #define DRM_CAP_PAGE_FLIP_TARGET 0x11 #define DRM_CAP_CRTC_IN_VBLANK_EVENT 0x12 #define DRM_CAP_SYNCOBJ 0x13 +#define DRM_CAP_SYNCOBJ_TIMELINE 0x14 /** DRM_IOCTL_GET_CAP ioctl argument type */ struct drm_get_cap {