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>,
Bhanuprakash Modem <bhanuprakash.modem@intel.com>,
Ashutosh Dixit <ashutosh.dixit@intel.com>,
Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Cc: kernel-dev@igalia.com
Subject: [igt-dev] [PATCH i-g-t v2] tests/kms_atomic: skip mutable zpos test on non-mutable planes
Date: Fri, 1 Dec 2023 12:26:09 -0100 [thread overview]
Message-ID: <20231201132706.84787-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.
v1: https://patchwork.freedesktop.org/patch/554257
v2:
- document the new public function (Kamil)
- improve commit message (Kamil)
- rebase on master and replace has_zpos() by has_mutable_zpos()
Signed-off-by: Melissa Wen <mwen@igalia.com>
---
lib/igt_kms.c | 28 ++++++++++++++++++++++++++++
lib/igt_kms.h | 2 ++
tests/kms_atomic.c | 8 ++++----
3 files changed, 34 insertions(+), 4 deletions(-)
diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 28105a9ef..e4dea1a60 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -3970,6 +3970,34 @@ void igt_plane_set_prop_enum(igt_plane_t *plane,
igt_assert(igt_plane_try_prop_enum(plane, prop, val));
}
+/**
+ * igt_plane_check_prop_is_mutable:
+ * @plane: Target plane.
+ * @prop: Property to check.
+ *
+ * Check if a plane supports a given property and if this property is mutable.
+ *
+ * Returns true if the plane has the mutable property. False if the property is
+ * not support or it's immutable.
+ */
+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);
+ if (!has_prop)
+ return false;
+
+ 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 8e7801a78..b3882808b 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -812,6 +812,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 aa3af936a..96cd58571 100644
--- a/tests/kms_atomic.c
+++ b/tests/kms_atomic.c
@@ -1354,10 +1354,10 @@ static void atomic_clear(data_t *data, enum pipe pipe, igt_output_t *output)
igt_remove_fb(data->drm_fd, &data->fb);
}
-/* Returns true if plane supports zpos property. */
-static bool has_zpos(igt_plane_t *plane)
+/* Returns true if plane supports zpos property and it's mutable. */
+static bool has_mutable_zpos(igt_plane_t *plane)
{
- return igt_plane_has_prop(plane, IGT_PLANE_ZPOS);
+ return igt_plane_check_prop_is_mutable(plane, IGT_PLANE_ZPOS);
}
static bool
@@ -1457,7 +1457,7 @@ igt_main_args("e", NULL, help_str, opt_handler, NULL)
atomic_setup(&data, pipe, output);
if (!overlay)
continue;
- if (!has_zpos(data.primary) || !has_zpos(overlay))
+ if (!has_mutable_zpos(data.primary) || !has_mutable_zpos(overlay))
continue;
if (!igt_plane_has_format_mod(data.primary, DRM_FORMAT_ARGB8888, 0x0) ||
!igt_plane_has_format_mod(overlay, DRM_FORMAT_ARGB1555, 0x0))
--
2.42.0
next reply other threads:[~2023-12-01 13:27 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-01 13:26 Melissa Wen [this message]
2023-12-01 14:38 ` [igt-dev] [PATCH i-g-t v2] tests/kms_atomic: skip mutable zpos test on non-mutable planes Kamil Konieczny
2023-12-04 13:11 ` Melissa Wen
2023-12-01 15:43 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2023-12-01 16:00 ` [igt-dev] ✓ CI.xeBAT: " Patchwork
2023-12-03 1:21 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2023-12-04 10:12 ` Kamil Konieczny
2023-12-05 13:02 ` [igt-dev] ✓ Fi.CI.IGT: success " 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=20231201132706.84787-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 \
/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