[PATCH i-g-t 24/39] tests/vkms_configfs: Test adding multiple primary planes
Louis Chauvet
louis.chauvet at bootlin.com
Thu Feb 27 15:00:08 UTC 2025
Le 18/02/2025 à 17:49, José Expósito a écrit :
> Try to enable a VKMS device with multiple primary planes for one of its
> CRTCs and test that it fails.
>
> Signed-off-by: José Expósito <jose.exposito89 at gmail.com>
Reviewed-by: Louis Chauvet <louis.chauvet at bootlin.com>
> ---
> tests/vkms/vkms_configfs.c | 56 ++++++++++++++++++++++++++++++++++++++
> 1 file changed, 56 insertions(+)
>
> diff --git a/tests/vkms/vkms_configfs.c b/tests/vkms/vkms_configfs.c
> index fa20a364f..c93ebadb3 100644
> --- a/tests/vkms/vkms_configfs.c
> +++ b/tests/vkms/vkms_configfs.c
> @@ -889,6 +889,61 @@ static void test_enable_no_primary_plane(void)
> igt_vkms_device_destroy(dev);
> }
>
> +/**
> + * SUBTEST: enable-multiple-primary-planes
> + * Description: Try to enable a VKMS device with multiple primary planes for one
> + * of its CRTCs and test that it fails.
> + */
> +
> +static void test_enable_multiple_primary_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_PRIMARY,
> + .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 {
> @@ -915,6 +970,7 @@ igt_main
> { "enable-no-planes", test_enable_no_planes },
> { "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 },
> };
>
> igt_fixture {
--
Louis Chauvet, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
More information about the igt-dev
mailing list