History

drm/syncobj: Add a reset ioctl (v3)

This just resets the dma_fence to NULL so it looks like it's never been signaled. This will be useful once we add the new wait API for allowing wait on "submit and signal" behavior. v2: - Take an array of sync objects (Dave Airlie) v3: - Throw -EINVAL if pad != 0

Jason Ekstrand committed 9 years ago

Commit aa4035d1 parent 3e6fb724 files · +44 −0Browse files

Unified · Split

4 files
  1. drivers/gpu/drm/drm_internal.h +2 −0
  2. drivers/gpu/drm/drm_ioctl.c +2 −0
  3. drivers/gpu/drm/drm_syncobj.c +33 −0
  4. include/uapi/drm/drm.h +7 −0
drivers/gpu/drm/drm_internal.h+2−0
@@ -169,3 +169,5 @@ int drm_syncobj_fd_to_handle_ioctl(struct drm_device *dev, void *data, · 168 unmodified lines
169169 struct drm_file *file_private);
170170 int drm_syncobj_wait_ioctl(struct drm_device *dev, void *data,
171171 struct drm_file *file_private);
172+int drm_syncobj_reset_ioctl(struct drm_device *dev, void *data,
173+ struct drm_file *file_private);
drivers/gpu/drm/drm_ioctl.c+2−0
@@ -659,6 +659,8 @@ static const struct drm_ioctl_desc drm_ioctls[] = { · 658 unmodified lines
659659 DRM_UNLOCKED|DRM_RENDER_ALLOW),
660660 DRM_IOCTL_DEF(DRM_IOCTL_SYNCOBJ_WAIT, drm_syncobj_wait_ioctl,
661661 DRM_UNLOCKED|DRM_RENDER_ALLOW),
662+ DRM_IOCTL_DEF(DRM_IOCTL_SYNCOBJ_RESET, drm_syncobj_reset_ioctl,
663+ DRM_UNLOCKED|DRM_RENDER_ALLOW),
662664 };
663665
664666 #define DRM_CORE_IOCTL_COUNT ARRAY_SIZE( drm_ioctls )
drivers/gpu/drm/drm_syncobj.c+33−0
@@ -885,3 +885,36 @@ drm_syncobj_wait_ioctl(struct drm_device *dev, void *data, · 884 unmodified lines
885885
886886 return ret;
887887 }
888+
889+int
890+drm_syncobj_reset_ioctl(struct drm_device *dev, void *data,
891+ struct drm_file *file_private)
892+{
893+ struct drm_syncobj_array *args = data;
894+ struct drm_syncobj **syncobjs;
895+ uint32_t i;
896+ int ret;
897+
898+ if (!drm_core_check_feature(dev, DRIVER_SYNCOBJ))
899+ return -ENODEV;
900+
901+ if (args->pad != 0)
902+ return -EINVAL;
903+
904+ if (args->count_handles == 0)
905+ return -EINVAL;
906+
907+ ret = drm_syncobj_array_find(file_private,
908+ u64_to_user_ptr(args->handles),
909+ args->count_handles,
910+ &syncobjs);
911+ if (ret < 0)
912+ return ret;
913+
914+ for (i = 0; i < args->count_handles; i++)
915+ drm_syncobj_replace_fence(syncobjs[i], NULL);
916+
917+ drm_syncobj_array_free(syncobjs, args->count_handles);
918+
919+ return 0;
920+}
include/uapi/drm/drm.h+7−0
@@ -731,6 +731,12 @@ struct drm_syncobj_wait { · 730 unmodified lines
731731 __u32 pad;
732732 };
733733
734+struct drm_syncobj_array {
735+ __u64 handles;
736+ __u32 count_handles;
737+ __u32 pad;
738+};
739+
734740 #if defined(__cplusplus)
735741 }
736742 #endif
@@ -854,6 +860,7 @@ extern "C" { · 117 unmodified lines
854860 #define DRM_IOCTL_SYNCOBJ_HANDLE_TO_FD DRM_IOWR(0xC1, struct drm_syncobj_handle)
855861 #define DRM_IOCTL_SYNCOBJ_FD_TO_HANDLE DRM_IOWR(0xC2, struct drm_syncobj_handle)
856862 #define DRM_IOCTL_SYNCOBJ_WAIT DRM_IOWR(0xC3, struct drm_syncobj_wait)
863+#define DRM_IOCTL_SYNCOBJ_RESET DRM_IOWR(0xC4, struct drm_syncobj_array)
857864
858865 /**
859866 * Device specific ioctls should only be in their respective headers

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t