Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Melissa Wen <mwen@igalia.com>
To: igt-dev@lists.freedesktop.org,
	Petri Latvala <adrinael@adrinael.net>,
	Arkadiusz Hiler <arek@hiler.eu>,
	Kamil Konieczny <kamil.konieczny@linux.intel.com>,
	Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>,
	Bhanuprakash Modem <bhanuprakash.modem@intel.com>,
	Ashutosh Dixit <ashutosh.dixit@intel.com>
Cc: Philipp Zabel <p.zabel@pengutronix.de>,
	Tomeu Vizoso <tomeu.vizoso@collabora.com>,
	kernel-dev@igalia.com
Subject: [igt-dev] [PATCH i-g-t] tests/kms_atomic: check zpos is mutable before test mutable zpos
Date: Thu, 24 Aug 2023 15:33:02 -0100	[thread overview]
Message-ID: <20230824163302.15121-1-mwen@igalia.com> (raw)

plane-primary-overlay-mutable-zpos only works if both plane types have
mutable zpos property. However, drivers usually set primary zpos as
immutable and the test case just fails. Create a helper to check if a
plane have mutable zpos and skip the test case if zpos changes are not
allowed.

Signed-off-by: Melissa Wen <mwen@igalia.com>
---

Hi,

I don't know what drivers currently use this test case (imx?), but
besides this requirement check, the test case seems to use an uncommon
format for overlay plane (ARGB1555). From drm_info[1], I think a more
generic option would be ARGB8888 for alpha blending tests, but a primary
plane with mutable zpos doesn't seem a common case too.

Let me know your thoughts

[1] https://drmdb.emersion.fr/formats?plane=0

 lib/igt_kms.c      | 17 +++++++++++++++++
 lib/igt_kms.h      |  2 ++
 tests/kms_atomic.c |  3 +++
 3 files changed, 22 insertions(+)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index e0959ccff..42dc66fcd 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -3827,6 +3827,23 @@ void igt_plane_set_prop_enum(igt_plane_t *plane,
 	igt_assert(igt_plane_try_prop_enum(plane, prop, val));
 }
 
+bool igt_plane_check_prop_is_mutable(igt_plane_t *plane,
+				     enum igt_atomic_plane_properties igt_prop)
+{
+	drmModePropertyPtr prop;
+	uint64_t value;
+	bool has_prop;
+
+	has_prop = kmstest_get_property(plane->pipe->display->drm_fd,
+					plane->drm_plane->plane_id,
+					DRM_MODE_OBJECT_PLANE,
+				        igt_plane_prop_names[igt_prop], NULL,
+					&value, &prop);
+	igt_assert(has_prop);
+
+	return !(prop->flags & DRM_MODE_PROP_IMMUTABLE);
+}
+
 /**
  * igt_plane_replace_prop_blob:
  * @plane: plane to set property on.
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index 91355c910..4b4ec6c5a 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -734,6 +734,8 @@ extern void igt_plane_replace_prop_blob(igt_plane_t *plane,
 					enum igt_atomic_plane_properties prop,
 					const void *ptr, size_t length);
 
+extern bool igt_plane_check_prop_is_mutable(igt_plane_t *plane,
+					    enum igt_atomic_plane_properties igt_prop);
 /**
  * igt_output_has_prop:
  * @output: Output to check.
diff --git a/tests/kms_atomic.c b/tests/kms_atomic.c
index 3289219f9..22ddf5633 100644
--- a/tests/kms_atomic.c
+++ b/tests/kms_atomic.c
@@ -1463,7 +1463,10 @@ igt_main
 		igt_require(overlay);
 
 		igt_require(igt_plane_has_prop(primary, IGT_PLANE_ZPOS));
+		igt_require(igt_plane_check_prop_is_mutable(primary, IGT_PLANE_ZPOS));
+
 		igt_require(igt_plane_has_prop(overlay, IGT_PLANE_ZPOS));
+		igt_require(igt_plane_check_prop_is_mutable(overlay, IGT_PLANE_ZPOS));
 
 		igt_require(igt_plane_has_format_mod(primary, format_primary, 0x0));
 		igt_require(igt_plane_has_format_mod(overlay, format_overlay, 0x0));
-- 
2.40.1

             reply	other threads:[~2023-08-24 16:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-24 16:33 Melissa Wen [this message]
2023-08-24 18:25 ` [igt-dev] ✗ GitLab.Pipeline: warning for tests/kms_atomic: check zpos is mutable before test mutable zpos Patchwork
2023-08-24 19:03 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2023-08-24 19:15 ` [igt-dev] ✗ CI.xeBAT: failure " Patchwork
2023-08-25  7:29 ` [igt-dev] ✓ Fi.CI.IGT: success " Patchwork
2023-08-28 15:39 ` [igt-dev] [PATCH i-g-t] " Kamil Konieczny
2023-08-29 10:50   ` Melissa Wen

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=20230824163302.15121-1-mwen@igalia.com \
    --to=mwen@igalia.com \
    --cc=adrinael@adrinael.net \
    --cc=arek@hiler.eu \
    --cc=ashutosh.dixit@intel.com \
    --cc=bhanuprakash.modem@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=juhapekka.heikkila@gmail.com \
    --cc=kamil.konieczny@linux.intel.com \
    --cc=kernel-dev@igalia.com \
    --cc=p.zabel@pengutronix.de \
    --cc=tomeu.vizoso@collabora.com \
    /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