public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Daniel Stone <daniels@collabora.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH igt] igt/kms_atomic: Match CRTC harder for special planes
Date: Tue, 13 Dec 2016 18:15:45 +0000	[thread overview]
Message-ID: <20161213181545.78889-1-daniels@collabora.com> (raw)

Our heuristic for finding planes was previously matching the type, and
ensuring that the plane was valid for that CRTC. However, VC4 now has
primary/cursor planes which can wander multiple CRTCs, so we could pick
a PRIMARY plane which was not the kernel's idea of crtc->primary,
causing plane_primary_legacy to fail; ditto for cursor.

Make find_plane try harder, by preferring to return planes which are
already on the requested CRTC.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reported-by: Robert Foss <robert.foss@collabora.com>
Cc: Eric Anholt <eric@anholt.net>
---
 tests/kms_atomic.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/tests/kms_atomic.c b/tests/kms_atomic.c
index 1441fdf..e6d71c3 100644
--- a/tests/kms_atomic.c
+++ b/tests/kms_atomic.c
@@ -451,6 +451,7 @@ static struct kms_atomic_plane_state *
 find_plane(struct kms_atomic_state *state, enum plane_type type,
 	   struct kms_atomic_crtc_state *crtc)
 {
+	struct kms_atomic_plane_state *ret = NULL;
 	int i;
 
 	for (i = 0; i < state->num_planes; i++) {
@@ -464,10 +465,18 @@ find_plane(struct kms_atomic_state *state, enum plane_type type,
 			continue;
 
 		plane_get_current_state(plane);
-		return plane;
+
+		/* Try to find a plane that's already on this CRTC. In
+		 * particular, this ensures that for special (primary/cursor)
+		 * planes that can be on multiple CRTCs, we find the same
+		 * one that the legacy ioctls will. */
+		if (!crtc || plane->crtc_id == crtc->obj)
+			return plane;
+
+		ret = plane;
 	}
 
-	return NULL;
+	return ret;
 }
 
 static void crtc_populate_req(struct kms_atomic_crtc_state *crtc,
-- 
2.10.2

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

             reply	other threads:[~2016-12-13 18:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-13 18:15 Daniel Stone [this message]
2016-12-14  7:15 ` [PATCH igt] igt/kms_atomic: Match CRTC harder for special planes Robert Foss
2016-12-14  9:25 ` Robert Foss

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=20161213181545.78889-1-daniels@collabora.com \
    --to=daniels@collabora.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