[PATCH i-g-t 33/39] tests/vkms_configfs: Test enabling a device without connectors
Louis Chauvet
louis.chauvet at bootlin.com
Thu Feb 27 15:15:28 UTC 2025
Le 18/02/2025 à 17:50, José Expósito a écrit :
> Enable a VKMS device without adding connectors and test that it is
> created with the specified configuration.
>
> Signed-off-by: José Expósito <jose.exposito89 at gmail.com>
Reviewed-by: Louis Chauvet <louis.chauvet at boolin.com>
> ---
> tests/vkms/vkms_configfs.c | 39 ++++++++++++++++++++++++++++++++++++++
> 1 file changed, 39 insertions(+)
>
> diff --git a/tests/vkms/vkms_configfs.c b/tests/vkms/vkms_configfs.c
> index e003e0ca0..3ad3df584 100644
> --- a/tests/vkms/vkms_configfs.c
> +++ b/tests/vkms/vkms_configfs.c
> @@ -1328,6 +1328,44 @@ static void test_enable_crtc_no_encoder(void)
> igt_vkms_device_destroy(dev);
> }
>
> +/**
> + * SUBTEST: enable-no-connectors
> + * Description: Try to enable a VKMS device without adding connectors and test
> + * that it fails.
> + */
> +
> +static void test_enable_no_connectors(void)
> +{
> + igt_vkms_t *dev;
> +
> + igt_vkms_config_t cfg = {
> + .device_name = __func__,
> + .planes = {
> + {
> + .name = "plane0",
> + .type = DRM_PLANE_TYPE_PRIMARY,
> + .possible_crtcs = { "crtc0"},
> + },
> + },
> + .crtcs = {
> + { .name = "crtc0" },
> + },
> + .encoders = {
> + { .name = "encoder0", .possible_crtcs = { "crtc0" } },
> + },
> + .connectors = { },
> + };
> +
> + 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 {
> @@ -1363,6 +1401,7 @@ igt_main
> { "enable-too-many-encoders", test_enable_too_many_encoders },
> { "enable-encoder-no-crtcs", test_enable_encoder_no_crtcs },
> { "enable-crtc-no-encoder", test_enable_crtc_no_encoder },
> + { "enable-no-connectors", test_enable_no_connectors },
> };
>
> igt_fixture {
--
Louis Chauvet, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
More information about the igt-dev
mailing list