[PATCH i-g-t v2] tests/kms_cursor_crc: optimise cursor crc on simulation
Kamil Konieczny
kamil.konieczny at linux.intel.com
Mon Jun 30 12:20:42 UTC 2025
Hi Santhosh,
On 2025-06-26 at 13:31:07 +0530, Santhosh Reddy Guddati wrote:
> Reduce the number of test crc iterations on simulation to avoid timeouts
> on simulation.
>
> V2: Avoid usage of extra variable to check run_in_simuation (Pranay)
>
> Signed-off-by: Santhosh Reddy Guddati <santhosh.reddy.guddati at intel.com>
> ---
> tests/kms_cursor_crc.c | 13 ++++++++++++-
> 1 file changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
> index cacd2402c..61dd4a205 100644
> --- a/tests/kms_cursor_crc.c
> +++ b/tests/kms_cursor_crc.c
> @@ -490,9 +490,17 @@ static void test_crc_offscreen(data_t *data)
> static void test_crc_sliding(data_t *data)
> {
> int i;
> + int max;
If you need it here it is better make it simple:
int max = igt_run_in_simulation() ? 4 : 16;
> +
> + /* In simulation, we only run a few rounds to keep the test fast */
> + if (igt_run_in_simulation())
> + max = 4;
> + else
> + max = 16;
> +
> struct {
> igt_crc_t crc[3];
> - } rounds[16] = {};
> + } rounds[max];
These make a compiler warning:
[528/2012] Compiling C object tests/kms_cursor_crc.p/kms_cursor_crc.c.o
../tests/kms_cursor_crc.c: In function 'test_crc_sliding':
../tests/kms_cursor_crc.c:501:9: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
501 | struct {
| ^~~~~~
>
> /* Make sure cursor moves smoothly and pixel-by-pixel, and that there are
> * no alignment issues. Horizontal, vertical and diagonal test.
> @@ -526,6 +534,9 @@ static void test_crc_random(data_t *data)
>
> /* Random cursor placement */
>
> + if (igt_run_in_simulation())
> + max = 10;
> +
Few lines above it is set to 2, now you bump it high...
imho:
if (igt_run_in_simulation() && max > 10)
Regards,
Kamil
> /* HW test */
> cursor_enable(data);
> igt_plane_set_fb(data->primary, &data->primary_fb[HWCURSORBUFFER]);
> --
> 2.34.1
>
More information about the igt-dev
mailing list