[igt-dev] [PATCH i-g-t v3 2/7] tests/kms_cursor_legacy: Read crtc id for enable pipes

Arkadiusz Hiler arkadiusz.hiler at intel.com
Tue Jun 30 12:27:43 UTC 2020


On Thu, Jun 25, 2020 at 11:53:13AM +0530, Mohammed Khajapasha wrote:
> Read the crtc ids for enable pipes only in display.
> 
> Signed-off-by: Mohammed Khajapasha <mohammed.khajapasha at intel.com>
> ---
>  tests/kms_cursor_legacy.c | 14 +++++++++-----
>  1 file changed, 9 insertions(+), 5 deletions(-)
> 
> diff --git a/tests/kms_cursor_legacy.c b/tests/kms_cursor_legacy.c
> index 344442e8..151bd31d 100644
> --- a/tests/kms_cursor_legacy.c
> +++ b/tests/kms_cursor_legacy.c
> @@ -58,7 +58,7 @@ static void stress(igt_display_t *display,
>  	uint64_t *results;
>  	bool torture;
>  	int n;
> -	unsigned crtc_id[IGT_MAX_PIPES], num_crtcs;
> +	unsigned crtc_id[IGT_MAX_PIPES] = {0}, num_crtcs;
>  
>  	torture = false;
>  	if (num_children < 0) {
> @@ -84,8 +84,10 @@ static void stress(igt_display_t *display,
>  		}
>  	} else {
>  		num_crtcs = 1;
> -		arg.crtc_id = crtc_id[0] = display->pipes[pipe].crtc_id;
> -		do_ioctl(display->drm_fd, DRM_IOCTL_MODE_CURSOR, &arg);
> +		if(display->pipes[pipe].enabled) {
> +			arg.crtc_id = crtc_id[0] = display->pipes[pipe].crtc_id;
> +			do_ioctl(display->drm_fd, DRM_IOCTL_MODE_CURSOR, &arg);
> +		}
>  	}
>  
>  	arg.flags = mode;
> @@ -103,7 +105,8 @@ static void stress(igt_display_t *display,
>  		hars_petruska_f54_1_random_perturb(child);
>  		igt_until_timeout(timeout) {
>  			arg.crtc_id = crtc_id[hars_petruska_f54_1_random_unsafe() % num_crtcs];
> -			do_ioctl(display->drm_fd, DRM_IOCTL_MODE_CURSOR, &arg);
> +			if (arg.crtc_id)

This seems to introduce assumption that a valid crtc_id != 0, is it
true?

-- 
Cheers,
Arek

> +				do_ioctl(display->drm_fd, DRM_IOCTL_MODE_CURSOR, &arg);
>  			count++;
>  		}
>  
> @@ -1390,7 +1393,8 @@ igt_main
>  			errno = 0;
>  
>  			igt_fixture {
> -				igt_skip_on(n >= display.n_pipes);
> +				igt_require_f(display.pipes[n].enabled,
> +						"Pipe-%s not enabled\n", kmstest_pipe_name(n));
>  			}
>  
>  			igt_subtest_f("pipe-%s-single-bo", kmstest_pipe_name(n))
> -- 
> 2.24.1
> 


More information about the igt-dev mailing list