<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>