aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2019-05-22 09:26:12 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2019-05-28 08:52:11 -0400
commit9903c64f0fe7fa4829c948fa0e742f578e084548 (patch)
tree1b87bd3d50d0559239a6f72e14d236005c998d25
parente6aff9f8bfbecd4610ce0e2f4811cea42494dc62 (diff)
tools headers UAPI: Sync drm/drm.h with the kernel
To pick up the changes in these csets: 060cebb20cdb ("drm: introduce a capability flag for syncobj timeline support") 50d1ebef79ef ("drm/syncobj: add timeline signal ioctl for syncobj v5") ea569910cbab ("drm/syncobj: add transition iotcls between binary and timeline v2") 27b575a9aa2f ("drm/syncobj: add timeline payload query ioctl v6") 01d6c3578379 ("drm/syncobj: add support for timeline point wait v8") 783195ec1cad ("drm/syncobj: disable the timeline UAPI for now v2") 48197bc564c7 ("drm: add syncobj timeline support v9") Which automagically results in the following new ioctls being recognized by the 'perf trace' ioctl cmd arg beautifier: $ tools/perf/trace/beauty/drm_ioctl.sh > /tmp/before $ cp include/uapi/drm/drm.h tools/include/uapi/drm/drm.h $ tools/perf/trace/beauty/drm_ioctl.sh > /tmp/after $ diff -u /tmp/before /tmp/after --- /tmp/before 2019-05-22 10:25:31.443151182 -0300 +++ /tmp/after 2019-05-22 10:25:46.449354819 -0300 @@ -103,6 +103,10 @@ [0xC7] = "MODE_LIST_LESSEES", [0xC8] = "MODE_GET_LEASE", [0xC9] = "MODE_REVOKE_LEASE", + [0xCA] = "SYNCOBJ_TIMELINE_WAIT", + [0xCB] = "SYNCOBJ_QUERY", + [0xCC] = "SYNCOBJ_TRANSFER", + [0xCD] = "SYNCOBJ_TIMELINE_SIGNAL", [DRM_COMMAND_BASE + 0x00] = "I915_INIT", [DRM_COMMAND_BASE + 0x01] = "I915_FLUSH", [DRM_COMMAND_BASE + 0x02] = "I915_FLIP", $ I.e. the strace like raw_tracepoint:sys_enter handler in 'perf trace' will get the cmd integer value and map it to the string. At some point it should be possible to translate from string to integer and use to filter using expressions such as: # perf trace -e ioctl/cmd==DRM_IOCTL_SYNCOBJ*/ Or some more suitable syntax to express that only these ioctls when acting on DRM fds should be shown. Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Brendan Gregg <brendan.d.gregg@gmail.com> Cc: Christian König <christian.koenig@amd.com> Cc: Chunming Zhou <david1.zhou@amd.com> Cc: Dave Airlie <airlied@redhat.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Luis Cláudio Gonçalves <lclaudio@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Link: https://lkml.kernel.org/n/tip-jrc9ogw33w4zgqc3pu7o1l3g@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--tools/include/uapi/drm/drm.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/tools/include/uapi/drm/drm.h b/tools/include/uapi/drm/drm.h
index 300f336633f2..661d73f9a919 100644
--- a/tools/include/uapi/drm/drm.h
+++ b/tools/include/uapi/drm/drm.h
@@ -649,6 +649,7 @@ struct drm_gem_open {
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 */
654struct drm_get_cap { 655struct drm_get_cap {
@@ -735,8 +736,18 @@ struct drm_syncobj_handle {
735 __u32 pad; 736 __u32 pad;
736}; 737};
737 738
739struct drm_syncobj_transfer {
740 __u32 src_handle;
741 __u32 dst_handle;
742 __u64 src_point;
743 __u64 dst_point;
744 __u32 flags;
745 __u32 pad;
746};
747
738#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_ALL (1 << 0) 748#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_ALL (1 << 0)
739#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT (1 << 1) 749#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT (1 << 1)
750#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE (1 << 2) /* wait for time point to become available */
740struct drm_syncobj_wait { 751struct drm_syncobj_wait {
741 __u64 handles; 752 __u64 handles;
742 /* absolute timeout */ 753 /* absolute timeout */
@@ -747,12 +758,33 @@ struct drm_syncobj_wait {
747 __u32 pad; 758 __u32 pad;
748}; 759};
749 760
761struct drm_syncobj_timeline_wait {
762 __u64 handles;
763 /* wait on specific timeline point for every handles*/
764 __u64 points;
765 /* absolute timeout */
766 __s64 timeout_nsec;
767 __u32 count_handles;
768 __u32 flags;
769 __u32 first_signaled; /* only valid when not waiting all */
770 __u32 pad;
771};
772
773
750struct drm_syncobj_array { 774struct drm_syncobj_array {
751 __u64 handles; 775 __u64 handles;
752 __u32 count_handles; 776 __u32 count_handles;
753 __u32 pad; 777 __u32 pad;
754}; 778};
755 779
780struct drm_syncobj_timeline_array {
781 __u64 handles;
782 __u64 points;
783 __u32 count_handles;
784 __u32 pad;
785};
786
787
756/* Query current scanout sequence number */ 788/* Query current scanout sequence number */
757struct drm_crtc_get_sequence { 789struct drm_crtc_get_sequence {
758 __u32 crtc_id; /* requested crtc_id */ 790 __u32 crtc_id; /* requested crtc_id */
@@ -909,6 +941,11 @@ extern "C" {
909#define DRM_IOCTL_MODE_GET_LEASE DRM_IOWR(0xC8, struct drm_mode_get_lease) 941#define DRM_IOCTL_MODE_GET_LEASE DRM_IOWR(0xC8, struct drm_mode_get_lease)
910#define DRM_IOCTL_MODE_REVOKE_LEASE DRM_IOWR(0xC9, struct drm_mode_revoke_lease) 942#define DRM_IOCTL_MODE_REVOKE_LEASE DRM_IOWR(0xC9, struct drm_mode_revoke_lease)
911 943
944#define DRM_IOCTL_SYNCOBJ_TIMELINE_WAIT DRM_IOWR(0xCA, struct drm_syncobj_timeline_wait)
945#define DRM_IOCTL_SYNCOBJ_QUERY DRM_IOWR(0xCB, struct drm_syncobj_timeline_array)
946#define DRM_IOCTL_SYNCOBJ_TRANSFER DRM_IOWR(0xCC, struct drm_syncobj_transfer)
947#define DRM_IOCTL_SYNCOBJ_TIMELINE_SIGNAL DRM_IOWR(0xCD, struct drm_syncobj_timeline_array)
948
912/** 949/**
913 * Device specific ioctls should only be in their respective headers 950 * Device specific ioctls should only be in their respective headers
914 * The device specific ioctl range is from 0x40 to 0x9f. 951 * The device specific ioctl range is from 0x40 to 0x9f.