diff options
author | Daniel Stone <daniels@collabora.com> | 2016-12-14 04:21:20 -0500 |
---|---|---|
committer | Robert Foss <robert.foss@collabora.com> | 2016-12-14 04:21:20 -0500 |
commit | 40769d7925d9b28cc7e71564e2378aebf20efbf8 (patch) | |
tree | c346f91d45df8de21c7212401271457c1ab98de8 /tests/kms_atomic.c | |
parent | f83ec418c40a428a96019f250f680d69e66588f9 (diff) | |
download | platform_external_igt-gpu-tools-40769d7925d9b28cc7e71564e2378aebf20efbf8.tar.gz platform_external_igt-gpu-tools-40769d7925d9b28cc7e71564e2378aebf20efbf8.tar.bz2 platform_external_igt-gpu-tools-40769d7925d9b28cc7e71564e2378aebf20efbf8.zip |
igt/kms_atomic: Match CRTC harder for special planes
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>
Signed-off-by: Robert Foss <robert.foss@collabora.com>
Diffstat (limited to 'tests/kms_atomic.c')
-rw-r--r-- | tests/kms_atomic.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/kms_atomic.c b/tests/kms_atomic.c index 1441fdfd..e6d71c31 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, |