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)
Unified · Split
| @@ -245,6 +245,9 @@ static int drm_getcap(struct drm_device *dev, void *data, struct drm_file *file_ · 244 unmodified lines | |||
| 245 | case DRM_CAP_SYNCOBJ: | 245 | case DRM_CAP_SYNCOBJ: |
| 246 | req->value = drm_core_check_feature(dev, DRIVER_SYNCOBJ); | 246 | req->value = drm_core_check_feature(dev, DRIVER_SYNCOBJ); |
| 247 | return 0; | 247 | return 0; |
| 248 | case DRM_CAP_SYNCOBJ_TIMELINE: | ||
| 249 | req->value = drm_core_check_feature(dev, DRIVER_SYNCOBJ_TIMELINE); | ||
| 250 | return 0; | ||
| 248 | } | 251 | } |
| 249 | 252 | ||
| 250 | /* Other caps only work with KMS drivers */ | 253 | /* Other caps only work with KMS drivers */ |
| @@ -740,7 +740,7 @@ drm_syncobj_transfer_ioctl(struct drm_device *dev, void *data, · 739 unmodified lines | |||
| 740 | struct drm_syncobj_transfer *args = data; | 740 | struct drm_syncobj_transfer *args = data; |
| 741 | int ret; | 741 | int ret; |
| 742 | 742 | ||
| 743 | if (!drm_core_check_feature(dev, DRIVER_SYNCOBJ)) | 743 | if (!drm_core_check_feature(dev, DRIVER_SYNCOBJ_TIMELINE)) |
| 744 | return -EOPNOTSUPP; | 744 | return -EOPNOTSUPP; |
| 745 | 745 | ||
| 746 | if (args->pad) | 746 | if (args->pad) |
| @@ -1091,7 +1091,7 @@ drm_syncobj_timeline_wait_ioctl(struct drm_device *dev, void *data, · 344 unmodified lines | |||
| 1091 | struct drm_syncobj **syncobjs; | 1091 | struct drm_syncobj **syncobjs; |
| 1092 | int ret = 0; | 1092 | int ret = 0; |
| 1093 | 1093 | ||
| 1094 | if (!drm_core_check_feature(dev, DRIVER_SYNCOBJ)) | 1094 | if (!drm_core_check_feature(dev, DRIVER_SYNCOBJ_TIMELINE)) |
| 1095 | return -EOPNOTSUPP; | 1095 | return -EOPNOTSUPP; |
| 1096 | 1096 | ||
| 1097 | if (args->flags & ~(DRM_SYNCOBJ_WAIT_FLAGS_WAIT_ALL | | 1097 | if (args->flags & ~(DRM_SYNCOBJ_WAIT_FLAGS_WAIT_ALL | |
| @@ -1195,7 +1195,7 @@ drm_syncobj_timeline_signal_ioctl(struct drm_device *dev, void *data, · 97 unmodified lines | |||
| 1195 | uint32_t i, j; | 1195 | uint32_t i, j; |
| 1196 | int ret; | 1196 | int ret; |
| 1197 | 1197 | ||
| 1198 | if (!drm_core_check_feature(dev, DRIVER_SYNCOBJ)) | 1198 | if (!drm_core_check_feature(dev, DRIVER_SYNCOBJ_TIMELINE)) |
| 1199 | return -EOPNOTSUPP; | 1199 | return -EOPNOTSUPP; |
| 1200 | 1200 | ||
| 1201 | if (args->pad != 0) | 1201 | if (args->pad != 0) |
| @@ -1266,8 +1266,8 @@ int drm_syncobj_query_ioctl(struct drm_device *dev, void *data, · 64 unmodified lines | |||
| 1266 | uint32_t i; | 1266 | uint32_t i; |
| 1267 | int ret; | 1267 | int ret; |
| 1268 | 1268 | ||
| 1269 | if (!drm_core_check_feature(dev, DRIVER_SYNCOBJ)) | 1269 | if (!drm_core_check_feature(dev, DRIVER_SYNCOBJ_TIMELINE)) |
| 1270 | return -ENODEV; | 1270 | return -EOPNOTSUPP; |
| 1271 | 1271 | ||
| 1272 | if (args->pad != 0) | 1272 | if (args->pad != 0) |
| 1273 | return -EINVAL; | 1273 | return -EINVAL; |
| @@ -91,6 +91,13 @@ enum drm_driver_feature { · 90 unmodified lines | |||
| 91 | * submission. | 91 | * submission. |
| 92 | */ | 92 | */ |
| 93 | DRIVER_SYNCOBJ = BIT(5), | 93 | DRIVER_SYNCOBJ = BIT(5), |
| 94 | /** | ||
| 95 | * @DRIVER_SYNCOBJ_TIMELINE: | ||
| 96 | * | ||
| 97 | * Driver supports the timeline flavor of &drm_syncobj for explicit | ||
| 98 | * synchronization of command submission. | ||
| 99 | */ | ||
| 100 | DRIVER_SYNCOBJ_TIMELINE = BIT(6), | ||
| 94 | 101 | ||
| 95 | /* IMPORTANT: Below are all the legacy flags, add new ones above. */ | 102 | /* IMPORTANT: Below are all the legacy flags, add new ones above. */ |
| 96 | 103 | ||
| @@ -649,6 +649,7 @@ struct drm_gem_open { · 648 unmodified lines | |||
| 649 | #define DRM_CAP_PAGE_FLIP_TARGET 0x11 | 649 | #define DRM_CAP_PAGE_FLIP_TARGET 0x11 |
| 650 | #define DRM_CAP_CRTC_IN_VBLANK_EVENT 0x12 | 650 | #define DRM_CAP_CRTC_IN_VBLANK_EVENT 0x12 |
| 651 | #define DRM_CAP_SYNCOBJ 0x13 | 651 | #define DRM_CAP_SYNCOBJ 0x13 |
| 652 | #define DRM_CAP_SYNCOBJ_TIMELINE 0x14 | ||
| 652 | 653 | ||
| 653 | /** DRM_IOCTL_GET_CAP ioctl argument type */ | 654 | /** DRM_IOCTL_GET_CAP ioctl argument type */ |
| 654 | struct drm_get_cap { | 655 | struct drm_get_cap { |