aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/v3d/v3d_drv.h
diff options
context:
space:
mode:
authorMaíra Canal <mcanal@igalia.com>2023-11-30 13:40:39 -0300
committerMaíra Canal <mcanal@igalia.com>2023-12-01 09:47:35 -0300
commitbae7cb5d68001a8d4ceec5964dda74bb9aab7220 (patch)
tree58ce498463e6908eb401a8108838026072b3ae15 /drivers/gpu/drm/v3d/v3d_drv.h
parentdrm/v3d: Create a CPU job extension to copy timestamp query to a buffer (diff)
downloadlinux-bae7cb5d68001a8d4ceec5964dda74bb9aab7220.tar.xz
linux-bae7cb5d68001a8d4ceec5964dda74bb9aab7220.zip
drm/v3d: Create a CPU job extension for the reset performance query job
A CPU job is a type of job that performs operations that requires CPU intervention. A reset performance query job is a job that resets the performance queries by resetting the values of the perfmons. Moreover, we also reset the syncobjs related to the availability of the query. So, create a user extension for the CPU job that enables the creation of a reset performance job. This user extension will allow the creation of a CPU job that resets the perfmons values and resets the availability syncobj. Signed-off-by: Maíra Canal <mcanal@igalia.com> Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> Link: https://patchwork.freedesktop.org/patch/msgid/20231130164420.932823-18-mcanal@igalia.com
Diffstat (limited to 'drivers/gpu/drm/v3d/v3d_drv.h')
-rw-r--r--drivers/gpu/drm/v3d/v3d_drv.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/gpu/drm/v3d/v3d_drv.h b/drivers/gpu/drm/v3d/v3d_drv.h
index 5058a354fffd..0f7f80ad8d88 100644
--- a/drivers/gpu/drm/v3d/v3d_drv.h
+++ b/drivers/gpu/drm/v3d/v3d_drv.h
@@ -321,6 +321,7 @@ enum v3d_cpu_job_type {
V3D_CPU_JOB_TYPE_TIMESTAMP_QUERY,
V3D_CPU_JOB_TYPE_RESET_TIMESTAMP_QUERY,
V3D_CPU_JOB_TYPE_COPY_TIMESTAMP_QUERY,
+ V3D_CPU_JOB_TYPE_RESET_PERFORMANCE_QUERY,
};
struct v3d_timestamp_query {
@@ -331,6 +332,18 @@ struct v3d_timestamp_query {
struct drm_syncobj *syncobj;
};
+/* Number of perfmons required to handle all supported performance counters */
+#define V3D_MAX_PERFMONS DIV_ROUND_UP(V3D_PERFCNT_NUM, \
+ DRM_V3D_MAX_PERF_COUNTERS)
+
+struct v3d_performance_query {
+ /* Performance monitor IDs for this query */
+ u32 kperfmon_ids[V3D_MAX_PERFMONS];
+
+ /* Syncobj that indicates the query availability */
+ struct drm_syncobj *syncobj;
+};
+
struct v3d_indirect_csd_info {
/* Indirect CSD */
struct v3d_csd_job *job;
@@ -362,6 +375,19 @@ struct v3d_timestamp_query_info {
u32 count;
};
+struct v3d_performance_query_info {
+ struct v3d_performance_query *queries;
+
+ /* Number of performance queries */
+ u32 count;
+
+ /* Number of performance monitors related to that query pool */
+ u32 nperfmons;
+
+ /* Number of performance counters related to that query pool */
+ u32 ncounters;
+};
+
struct v3d_copy_query_results_info {
/* Define if should write to buffer using 64 or 32 bits */
bool do_64bit;
@@ -389,6 +415,8 @@ struct v3d_cpu_job {
struct v3d_timestamp_query_info timestamp_query;
struct v3d_copy_query_results_info copy;
+
+ struct v3d_performance_query_info performance_query;
};
typedef void (*v3d_cpu_job_fn)(struct v3d_cpu_job *);