intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tests/kms_psr_sink_crc: commit before querying mode
@ 2016-09-20  0:21 Rodrigo Vivi
  2016-09-20  9:29 ` Maarten Lankhorst
  0 siblings, 1 reply; 2+ messages in thread
From: Rodrigo Vivi @ 2016-09-20  0:21 UTC (permalink / raw)
  To: intel-gfx; +Cc: Rodrigo Vivi, Mika Kuoppala

From: Mika Kuoppala <mika.kuoppala@intel.com>

Commit to a mode before querying it.

Tested-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=97172
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@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;
+		}
+
 		data->crtc_id = output->config.crtc->crtc_id;
 		data->output = output;
 		data->mode = igt_output_get_mode(output);
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] tests/kms_psr_sink_crc: commit before querying mode
  2016-09-20  0:21 [PATCH] tests/kms_psr_sink_crc: commit before querying mode Rodrigo Vivi
@ 2016-09-20  9:29 ` Maarten Lankhorst
  0 siblings, 0 replies; 2+ messages in thread
From: Maarten Lankhorst @ 2016-09-20  9:29 UTC (permalink / raw)
  To: Rodrigo Vivi, intel-gfx; +Cc: Mika Kuoppala

Op 20-09-16 om 02:21 schreef Rodrigo Vivi:
> From: Mika Kuoppala <mika.kuoppala@intel.com>
>
> Commit to a mode before querying it.
>
> Tested-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> References: https://bugs.freedesktop.org/show_bug.cgi?id=97172
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@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)



_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-09-20  9:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-20  0:21 [PATCH] tests/kms_psr_sink_crc: commit before querying mode Rodrigo Vivi
2016-09-20  9:29 ` Maarten Lankhorst

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).