[PATCH i-g-t 25/39] tests/vkms_configfs: Test adding multiple cursor planes
José Expósito
jose.exposito89 at gmail.com
Tue Feb 18 16:49:57 UTC 2025
Try to enable a VKMS device with multiple cursor planes for one of its
CRTCs and test that it fails.
Signed-off-by: José Expósito <jose.exposito89 at gmail.com>
---
tests/vkms/vkms_configfs.c | 61 ++++++++++++++++++++++++++++++++++++++
1 file changed, 61 insertions(+)
diff --git a/tests/vkms/vkms_configfs.c b/tests/vkms/vkms_configfs.c
index c93ebadb3..dcd0bb5ec 100644
--- a/tests/vkms/vkms_configfs.c
+++ b/tests/vkms/vkms_configfs.c
@@ -944,6 +944,66 @@ static void test_enable_multiple_primary_planes(void)
igt_vkms_device_destroy(dev);
}
+/**
+ * SUBTEST: enable-multiple-cursor-planes
+ * Description: Try to enable a VKMS device with multiple cursor planes for one
+ * of its CRTCs and test that it fails.
+ */
+
+static void test_enable_multiple_cursor_planes(void)
+{
+ igt_vkms_t *dev;
+
+ igt_vkms_config_t cfg = {
+ .device_name = __func__,
+ .planes = {
+ {
+ .name = "plane0",
+ .type = DRM_PLANE_TYPE_PRIMARY,
+ .possible_crtcs = { "crtc0" },
+ },
+ {
+ .name = "plane1",
+ .type = DRM_PLANE_TYPE_PRIMARY,
+ .possible_crtcs = { "crtc1" },
+ },
+ {
+ .name = "plane2",
+ .type = DRM_PLANE_TYPE_CURSOR,
+ .possible_crtcs = { "crtc1" },
+ },
+ {
+ .name = "plane3",
+ .type = DRM_PLANE_TYPE_CURSOR,
+ .possible_crtcs = { "crtc1" },
+ },
+ },
+ .crtcs = {
+ { .name = "crtc0" },
+ { .name = "crtc1" },
+ },
+ .encoders = {
+ { .name = "encoder0", .possible_crtcs = { "crtc0" } },
+ { .name = "encoder1", .possible_crtcs = { "crtc1" } },
+ },
+ .connectors = {
+ {
+ .name = "connector0",
+ .possible_encoders = { "encoder0", "encoder1" },
+ },
+ },
+ };
+
+ dev = igt_vkms_device_create_from_config(&cfg);
+ igt_assert(dev);
+
+ igt_vkms_device_set_enabled(dev, true);
+ igt_assert(!igt_vkms_device_is_enabled(dev));
+ igt_assert(!device_exists(__func__));
+
+ igt_vkms_device_destroy(dev);
+}
+
igt_main
{
struct {
@@ -971,6 +1031,7 @@ igt_main
{ "enable-too-many-planes", test_enable_too_many_planes },
{ "enable-no-primary-plane", test_enable_no_primary_plane },
{ "enable-multiple-primary-planes", test_enable_multiple_primary_planes },
+ { "enable-multiple-cursor-planes", test_enable_multiple_cursor_planes },
};
igt_fixture {
--
2.48.1
More information about the igt-dev
mailing list