[Intel-gfx] [PATCH i-g-t v2 03/15] kms_psr_sink_crc: Use for_each_pipe_with_valid_output to find a valid config.

Ander Conselvan De Oliveira conselvan2 at gmail.com
Wed Jul 20 12:17:57 UTC 2016


On Wed, 2016-07-20 at 09:53 +0200, Maarten Lankhorst wrote:
> Op 19-07-16 om 15:58 schreef Ander Conselvan De Oliveira:
> > 
> > On Fri, 2016-07-15 at 14:15 +0300, Ander Conselvan De Oliveira wrote:
> > > 
> > > On Wed, 2016-07-06 at 11:55 +0200, Maarten Lankhorst wrote:
> > > > 
> > > > This is the only time PIPE_ANY was used to mean something other than
> > > > unassign this output from a pipe. Without this PIPE_ANY can be aliased
> > > > to PIPE_NONE.
> > > > 
> > > > Signed-off-by: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
> > > Reviewed-by: Ander Conselvan de Oliveira <conselvan2 at gmail.com>
> > Actually, kms_sink_crc_basic needs the same treatment.
> Indeed, how does this fixup look to the patch? Will probably send
> kms_sink_crc_basic out as separate patch.
> The DRM_MODE_CONNECTED check is implied by for_each_connected_output and
> for_each_pipe_with_valid_output,
> it can be killed.

True, kmstest_get_connector_config() already tests for that, so it is enough to
check output->valid.

> diff --git a/tests/kms_psr_sink_crc.c b/tests/kms_psr_sink_crc.c
> index d7bce3bb7855..8aafedb03614 100644
> --- a/tests/kms_psr_sink_crc.c
> +++ b/tests/kms_psr_sink_crc.c
> @@ -108,8 +108,7 @@ static void setup_output(data_t *data)
>  	for_each_pipe_with_valid_output(display, pipe, output) {
>  		drmModeConnectorPtr c = output->config.connector;
>  
> -		if (c->connector_type != DRM_MODE_CONNECTOR_eDP ||
> -		    c->connection != DRM_MODE_CONNECTED)
> +		if (c->connector_type != DRM_MODE_CONNECTOR_eDP)
>  			continue;
>  
>  		igt_output_set_pipe(output, pipe);
> 
> And for kms_sink_crc_basic:
> 
> diff --git a/tests/kms_sink_crc_basic.c b/tests/kms_sink_crc_basic.c
> index 9fac958f2142..c332eb1e39c2 100644
> --- a/tests/kms_sink_crc_basic.c
> +++ b/tests/kms_sink_crc_basic.c
> @@ -112,15 +112,15 @@ static void run_test(data_t *data)
>  	igt_display_t *display = &data->display;
>  	igt_output_t *output;
>  	drmModeModeInfo *mode;
> +	enum pipe pipe;
>  
> -	for_each_connected_output(display, output) {
> +	for_each_pipe_with_valid_output(display, pipe, output) {
>  		drmModeConnectorPtr c = output->config.connector;
>  
> -		if (c->connector_type != DRM_MODE_CONNECTOR_eDP ||
> -		    c->connection != DRM_MODE_CONNECTED)
> +		if (c->connector_type != DRM_MODE_CONNECTOR_eDP)
>  			continue;
>  
> -		igt_output_set_pipe(output, PIPE_ANY);
> +		igt_output_set_pipe(output, pipe);
>  
>  		mode = igt_output_get_mode(output);

Both look good. Feel free to slap my R-b on it.

Ander



More information about the Intel-gfx mailing list