public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH i-g-t 05/12] lib/igt_kms: Allow setting any output property through the !atomic paths
Date: Wed, 11 Oct 2017 12:11:12 +0200	[thread overview]
Message-ID: <20171011101119.32130-6-maarten.lankhorst@linux.intel.com> (raw)
In-Reply-To: <20171011101119.32130-1-maarten.lankhorst@linux.intel.com>

Everything except CRTC_ID can be set in the legacy paths,
we even have 2, the legacy and universal path. Excercise both. :D

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
 lib/igt_kms.c | 53 +++++++++++++++++++++++++++++++++++++----------------
 1 file changed, 37 insertions(+), 16 deletions(-)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index be89632547e5..e7b9fbaba709 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -2413,6 +2413,36 @@ static int igt_pipe_commit(igt_pipe_t *pipe,
 	return 0;
 }
 
+static int igt_output_commit(igt_output_t *output,
+			     enum igt_commit_style s,
+			     bool fail_on_error)
+{
+	int i, ret;
+
+	for (i = 0; i < IGT_NUM_CONNECTOR_PROPS; i++) {
+		if (!igt_output_is_prop_changed(output, i))
+			continue;
+
+		/* CRTC_ID is set by calling drmModeSetCrtc in the legacy path. */
+		if (i == IGT_CONNECTOR_CRTC_ID)
+			continue;
+
+		igt_assert(output->props[i]);
+
+		if (s == COMMIT_LEGACY)
+			ret = drmModeConnectorSetProperty(output->display->drm_fd, output->id,
+							  output->props[i], output->values[i]);
+		else
+			ret = drmModeObjectSetProperty(output->display->drm_fd, output->id,
+						       DRM_MODE_OBJECT_CONNECTOR,
+						       output->props[i], output->values[i]);
+
+		CHECK_RETURN(ret, fail_on_error);
+	}
+
+	return 0;
+}
+
 static void
 igt_pipe_replace_blob(igt_pipe_t *pipe, enum igt_atomic_crtc_properties prop, void *ptr, size_t length)
 {
@@ -2590,10 +2620,11 @@ display_commit_changed(igt_display_t *display, enum igt_commit_style s)
 	for (i = 0; i < display->n_outputs; i++) {
 		igt_output_t *output = &display->outputs[i];
 
-		if (s == COMMIT_ATOMIC)
+		if (s != COMMIT_UNIVERSAL)
 			output->changed = 0;
-		else if (s != COMMIT_UNIVERSAL)
-			igt_output_clear_prop_changed(output, IGT_CONNECTOR_CRTC_ID);
+		else
+			/* no modeset in universal commit, no change to crtc. */
+			output->changed &= 1 << IGT_CONNECTOR_CRTC_ID;
 	}
 }
 
@@ -2610,7 +2641,7 @@ static int do_display_commit(igt_display_t *display,
 			     enum igt_commit_style s,
 			     bool fail_on_error)
 {
-	int ret;
+	int i, ret = 0;
 	enum pipe pipe;
 	LOG_INDENT(display, "commit");
 
@@ -2619,28 +2650,18 @@ static int do_display_commit(igt_display_t *display,
 	if (s == COMMIT_ATOMIC) {
 		ret = igt_atomic_commit(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
 	} else {
-		int valid_outs = 0;
-
 		for_each_pipe(display, pipe) {
 			igt_pipe_t *pipe_obj = &display->pipes[pipe];
-			igt_output_t *output = igt_pipe_get_output(pipe_obj);
-
-			if (output)
-				valid_outs++;
 
 			ret = igt_pipe_commit(pipe_obj, s, fail_on_error);
 			if (ret)
 				break;
 		}
 
-		if (valid_outs == 0) {
-			LOG_UNINDENT(display);
-
-			return -1;
-		}
+		for (i = 0; !ret && i < display->n_outputs; i++)
+			ret = igt_output_commit(&display->outputs[i], s, fail_on_error);
 	}
 
-
 	LOG_UNINDENT(display);
 	CHECK_RETURN(ret, fail_on_error);
 
-- 
2.14.1

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

  parent reply	other threads:[~2017-10-11 10:11 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-11 10:11 [PATCH i-g-t 00/12] lib/igt_kms: Rewrite property handling to better match atomic Maarten Lankhorst
2017-10-11 10:11 ` [PATCH i-g-t 01/12] lib/igt_kms: Rework connector properties to be more atomic, v2 Maarten Lankhorst
2017-10-11 10:11 ` [PATCH i-g-t 02/12] lib/igt_kms: Rework plane properties to be more atomic, v5 Maarten Lankhorst
2017-10-11 10:11 ` [PATCH i-g-t 03/12] lib/igt_kms: Rework pipe properties to be more atomic, v7 Maarten Lankhorst
2017-10-11 10:11 ` [PATCH i-g-t 04/12] lib/igt_kms: Allow setting any plane property through the universal path Maarten Lankhorst
2017-10-11 10:11 ` Maarten Lankhorst [this message]
2017-10-11 10:11 ` [PATCH i-g-t 06/12] lib/igt_kms: Export property blob functions for output/pipe/plane Maarten Lankhorst
2017-10-12 11:41   ` [PATCH i-g-t 1/2] lib/igt_kms: Export property blob functions for output/pipe/plane, v2 Maarten Lankhorst
2017-10-12 11:41     ` [PATCH i-g-t 2/2] tests/chamelium: Remove reliance on output->config.pipe Maarten Lankhorst
2017-10-11 10:11 ` [PATCH i-g-t 07/12] lib/igt_kms: Unexport broadcast rgb API Maarten Lankhorst
2017-10-11 10:11 ` [PATCH i-g-t 08/12] lib/igt_kms: Add igt_$obj_has_prop functions Maarten Lankhorst
2017-10-11 10:11 ` [PATCH i-g-t 09/12] lib/igt_kms: Add igt_$obj_get_prop functions Maarten Lankhorst
2017-10-11 10:11 ` [PATCH i-g-t 10/12] tests/kms_color: Rework tests slightly to work better with new atomic api Maarten Lankhorst
2017-10-11 10:11 ` [PATCH i-g-t 11/12] lib/igt_kms: Remove igt_pipe_get_property Maarten Lankhorst
2017-10-11 10:11 ` [PATCH i-g-t 12/12] tests/kms_atomic: Convert/rewrite tests to use igt_kms framework Maarten Lankhorst
2017-10-11 13:49 ` ✗ Fi.CI.BAT: failure for lib/igt_kms: Rewrite property handling to better match atomic Patchwork
2017-10-12 12:08 ` ✓ Fi.CI.BAT: success for lib/igt_kms: Rewrite property handling to better match atomic. (rev3) Patchwork
2017-10-12 13:52 ` ✓ Fi.CI.IGT: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171011101119.32130-6-maarten.lankhorst@linux.intel.com \
    --to=maarten.lankhorst@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox