[PATCH 09/13] tests/intel/xe_oa: Test oa buffer sizes
Dixit, Ashutosh
ashutosh.dixit at intel.com
Sat Feb 22 03:14:38 UTC 2025
On Fri, 14 Feb 2025 17:06:24 -0800, Umesh Nerlige Ramappa wrote:
>
> Introduce oa buffer size test separately. Pick a random valid buffer
> size for the test.
As discussed, all execution times are under 3 seconds, so ok. Or, to be
safe we could trim 64 M and 128 M sizes from the array.
Either case this is:
Reviewed-by: Ashutosh Dixit <ashutosh.dixit at intel.com>
> Signed-off-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa at intel.com>
> ---
> tests/intel/xe_oa.c | 30 ++++++++++++++++++++++++++++++
> 1 file changed, 30 insertions(+)
>
> diff --git a/tests/intel/xe_oa.c b/tests/intel/xe_oa.c
> index 03d223df4..ee87b7338 100644
> --- a/tests/intel/xe_oa.c
> +++ b/tests/intel/xe_oa.c
> @@ -93,6 +93,23 @@ struct accumulator {
> uint64_t deltas[MAX_RAW_OA_COUNTERS];
> };
>
> +struct oa_buf_size {
> + char name[12];
> + uint32_t size;
> +} buf_sizes[] = {
> + { "128K", SZ_128K },
> + { "256K", SZ_256K },
> + { "512K", SZ_512K },
> + { "1M", SZ_1M },
> + { "2M", SZ_2M },
> + { "4M", SZ_4M },
> + { "8M", SZ_8M },
> + { "16M", SZ_16M },
> + { "32M", SZ_32M },
> + { "64M", SZ_64M },
> + { "128M", SZ_128M },
> +};
> +
> /* OA unit types */
> enum {
> OAG,
> @@ -305,6 +322,7 @@ static struct intel_mmio_data mmio_data;
> static igt_render_copyfunc_t render_copy;
> static uint32_t rc_width, rc_height;
> static uint32_t buffer_fill_size;
> +static uint32_t num_buf_sizes;
>
> static struct intel_xe_perf_metric_set *metric_set(const struct drm_xe_engine_class_instance *hwe)
> {
> @@ -1094,6 +1112,7 @@ init_sys_info(void)
> rc_width = 1920;
> rc_height = 1080;
> buffer_fill_size = SZ_16M;
> + num_buf_sizes = ARRAY_SIZE(buf_sizes);
> oa_exponent_default = max_oa_exponent_for_period_lte(1000000);
>
> default_oa_buffer_size = get_default_oa_buffer_size(drm_fd);
> @@ -4805,6 +4824,17 @@ igt_main
> __for_one_hwe_in_oag(hwe)
> test_buffer_fill(hwe);
>
> + /**
> + * SUBTEST: buffer-size
> + * Description: Test various OA buffer sizes
> + */
> + igt_subtest_with_dynamic("buffer-size") {
> + long k = random() % num_buf_sizes;
> +
> + __for_one_hwe_in_oag_w_arg(hwe, buf_sizes[k].name)
> + test_non_zero_reason(hwe, buf_sizes[k].size);
> + }
> +
> igt_subtest_with_dynamic("non-zero-reason")
> __for_one_hwe_in_oag(hwe)
> test_non_zero_reason(hwe, 0);
> --
> 2.34.1
>
More information about the igt-dev
mailing list