History

drm/v3d: Add DRM_IOCTL_V3D_PERFMON_SET_GLOBAL

Add a new ioctl, DRM_IOCTL_V3D_PERFMON_SET_GLOBAL, to allow configuration of a global performance monitor (perfmon). Use the global perfmon for all jobs to ensure consistent performance tracking across submissions. This feature is needed to implement a Perfetto datasources in user-space.

Christian Gmeiner committed 1 year ago

Commit c6eabba1 parent f3c03be6 files · +85 −3Browse files

Showing the changes to include/uapi (1 of 6 files). Show all

Unified · Split

include/uapi/drm/v3d_drm.h+18−0
@@ -43,6 +43,7 @@ extern "C" { · 42 unmodified lines
4343 #define DRM_V3D_PERFMON_GET_VALUES 0x0a
4444 #define DRM_V3D_SUBMIT_CPU 0x0b
4545 #define DRM_V3D_PERFMON_GET_COUNTER 0x0c
46+#define DRM_V3D_PERFMON_SET_GLOBAL 0x0d
4647
4748 #define DRM_IOCTL_V3D_SUBMIT_CL DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_SUBMIT_CL, struct drm_v3d_submit_cl)
4849 #define DRM_IOCTL_V3D_WAIT_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_WAIT_BO, struct drm_v3d_wait_bo)
@@ -61,6 +62,8 @@ extern "C" { · 12 unmodified lines
6162 #define DRM_IOCTL_V3D_SUBMIT_CPU DRM_IOW(DRM_COMMAND_BASE + DRM_V3D_SUBMIT_CPU, struct drm_v3d_submit_cpu)
6263 #define DRM_IOCTL_V3D_PERFMON_GET_COUNTER DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_PERFMON_GET_COUNTER, \
6364 struct drm_v3d_perfmon_get_counter)
65+#define DRM_IOCTL_V3D_PERFMON_SET_GLOBAL DRM_IOW(DRM_COMMAND_BASE + DRM_V3D_PERFMON_SET_GLOBAL, \
66+ struct drm_v3d_perfmon_set_global)
6467
6568 #define DRM_V3D_SUBMIT_CL_FLUSH_CACHE 0x01
6669 #define DRM_V3D_SUBMIT_EXTENSION 0x02
@@ -766,6 +769,21 @@ struct drm_v3d_perfmon_get_counter { · 699 unmodified lines
766769 __u8 reserved[7];
767770 };
768771
772+#define DRM_V3D_PERFMON_CLEAR_GLOBAL 0x0001
773+
774+/**
775+ * struct drm_v3d_perfmon_set_global - ioctl to define a global performance
776+ * monitor
777+ *
778+ * The global performance monitor will be used for all jobs. If a global
779+ * performance monitor is defined, jobs with a self-defined performance
780+ * monitor won't be allowed.
781+ */
782+struct drm_v3d_perfmon_set_global {
783+ __u32 flags;
784+ __u32 id;
785+};
786+
769787 #if defined(__cplusplus)
770788 }
771789 #endif