[Intel-gfx] [PATCH] tests/kms_psr_sink_crc: commit before querying mode

Maarten Lankhorst maarten.lankhorst at linux.intel.com
Tue Sep 20 09:29:57 UTC 2016


Op 20-09-16 om 02:21 schreef Rodrigo Vivi:
> From: Mika Kuoppala <mika.kuoppala at intel.com>
>
> Commit to a mode before querying it.
>
> Tested-by: Rodrigo Vivi <rodrigo.vivi at intel.com>
> References: https://bugs.freedesktop.org/show_bug.cgi?id=97172
> Cc: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
> Signed-off-by: Mika Kuoppala <mika.kuoppala at intel.com>
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi at intel.com>
> ---
>  tests/kms_psr_sink_crc.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/tests/kms_psr_sink_crc.c b/tests/kms_psr_sink_crc.c
> index 8aafedb..68310d8 100644
> --- a/tests/kms_psr_sink_crc.c
> +++ b/tests/kms_psr_sink_crc.c
> @@ -112,6 +112,14 @@ static void setup_output(data_t *data)
>  			continue;
>  
>  		igt_output_set_pipe(output, pipe);
> +		igt_display_commit(display);
> +
> +		if (!output->valid) {
> +			igt_output_set_pipe(output, PIPE_ANY);
> +			igt_display_commit(display);
> +			continue;
> +		}

Could you be more verbose? I'm trying to get rid of this requirement, in particular the output->valid branch will never happen here.
To be compatible with atomic, igt_display_commit should not be called until the setup is completed, with fb's set etc.

Quick hack below, does this also fix the issue?

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 7d53360359ef..86884466c5c4 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -1215,13 +1215,16 @@ static void igt_display_log_shift(igt_display_t *display, int shift)
 	igt_assert(display->log_shift >= 0);
 }
 
-static void igt_output_refresh(igt_output_t *output)
+static void igt_output_refresh(igt_output_t *output, bool final)
 {
 	igt_display_t *display = output->display;
 	unsigned long crtc_idx_mask;
 
+	crtc_idx_mask = output->pending_crtc_idx_mask;
+
 	/* we mask out the pipes already in use */
-	crtc_idx_mask = output->pending_crtc_idx_mask & ~display->pipes_in_use;
+	if (final)
+		crtc_idx_mask &= ~display->pipes_in_use;
 
 	kmstest_free_connector_config(&output->config);
 
@@ -1504,7 +1507,7 @@ void igt_display_init(igt_display_t *display, int drm_fd)
 		output->id = resources->connectors[i];
 		output->display = display;
 
-		igt_output_refresh(output);
+		igt_output_refresh(output, false);
 
 		output->config.pipe_changed = true;
 	}
@@ -1591,7 +1594,7 @@ static void igt_display_refresh(igt_display_t *display)
 	for (i = 0; i < display->n_outputs; i++) {
 		igt_output_t *output = &display->outputs[i];
 
-		igt_output_refresh(output);
+		igt_output_refresh(output, true);
 	}
 }
 
@@ -2462,6 +2465,8 @@ void igt_output_set_pipe(igt_output_t *output, enum pipe pipe)
 
 	if (pipe != output->config.pipe)
 		output->config.pipe_changed = true;
+
+	igt_output_refresh(output, false);
 }
 
 void igt_output_set_scaling_mode(igt_output_t *output, uint64_t scaling_mode)





More information about the Intel-gfx mailing list