Commit 9c3951ec authored by Tvrtko Ursulin's avatar Tvrtko Ursulin Committed by Maxime Ripard

drm/v3d: Fix perfmon build error/warning

Move static const array into the source file to fix the "defined but not
used" errors.

The fix is perhaps not the prettiest due hand crafting the array sizes
in v3d_performance_counters.h, but I did add some build time asserts to
validate the counts look sensible, so hopefully it is good enough for a
quick fix.
Signed-off-by: default avatarTvrtko Ursulin <tvrtko.ursulin@igalia.com>
Fixes: 3cbcbe01 ("drm/v3d: Add Performance Counters descriptions for V3D 4.2 and 7.1")
Reported-by: default avatarkernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202405211137.hueFkLKG-lkp@intel.com/Cc: Maíra Canal <mcanal@igalia.com>
Cc: Iago Toral Quiroga <itoral@igalia.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Ashutosh Dixit <ashutosh.dixit@intel.com>
Reviewed-by: default avatarIago Toral Quiroga <itoral@igalia.com>
Signed-off-by: default avatarMaxime Ripard <mripard@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20240604160210.24073-1-tursulin@igalia.com
parent 35e7a72a
...@@ -299,9 +299,9 @@ static int v3d_platform_drm_probe(struct platform_device *pdev) ...@@ -299,9 +299,9 @@ static int v3d_platform_drm_probe(struct platform_device *pdev)
WARN_ON(v3d->cores > 1); /* multicore not yet implemented */ WARN_ON(v3d->cores > 1); /* multicore not yet implemented */
if (v3d->ver >= 71) if (v3d->ver >= 71)
v3d->max_counters = ARRAY_SIZE(v3d_v71_performance_counters); v3d->max_counters = V3D_V71_NUM_PERFCOUNTERS;
else if (v3d->ver >= 42) else if (v3d->ver >= 42)
v3d->max_counters = ARRAY_SIZE(v3d_v42_performance_counters); v3d->max_counters = V3D_V42_NUM_PERFCOUNTERS;
else else
v3d->max_counters = 0; v3d->max_counters = 0;
......
...@@ -351,9 +351,6 @@ struct v3d_timestamp_query { ...@@ -351,9 +351,6 @@ struct v3d_timestamp_query {
struct drm_syncobj *syncobj; struct drm_syncobj *syncobj;
}; };
/* Maximum number of performance counters supported by any version of V3D */
#define V3D_MAX_COUNTERS ARRAY_SIZE(v3d_v71_performance_counters)
/* Number of perfmons required to handle all supported performance counters */ /* Number of perfmons required to handle all supported performance counters */
#define V3D_MAX_PERFMONS DIV_ROUND_UP(V3D_MAX_COUNTERS, \ #define V3D_MAX_PERFMONS DIV_ROUND_UP(V3D_MAX_COUNTERS, \
DRM_V3D_MAX_PERF_COUNTERS) DRM_V3D_MAX_PERF_COUNTERS)
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment