drm/vkms: Allow to configure connector status

Allow to store the connector status in vkms_config_connector and add a
getter and a setter functions as well a KUnit test.

This change only adds the configuration, the connector status is not
used yet.

Tested-by: Mark Yacoub <markyacoub@google.com>
Reviewed-by: Louis Chauvet <louis.chauvet@bootlin.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
Link: https://lore.kernel.org/r/20251016175618.10051-15-jose.exposito89@gmail.com
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
This commit is contained in:
José Expósito
2025-10-16 19:56:16 +02:00
committed by Luca Ceresoli
parent 085dadb310
commit 6f00987f5c
3 changed files with 56 additions and 2 deletions

View File

@@ -957,6 +957,29 @@ static void vkms_config_test_connector_get_possible_encoders(struct kunit *test)
vkms_config_destroy(config);
}
static void vkms_config_test_connector_status(struct kunit *test)
{
struct vkms_config *config;
struct vkms_config_connector *connector_cfg;
enum drm_connector_status status;
config = vkms_config_create("test");
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, config);
connector_cfg = vkms_config_create_connector(config);
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, connector_cfg);
status = vkms_config_connector_get_status(connector_cfg);
KUNIT_EXPECT_EQ(test, status, connector_status_connected);
vkms_config_connector_set_status(connector_cfg,
connector_status_disconnected);
status = vkms_config_connector_get_status(connector_cfg);
KUNIT_EXPECT_EQ(test, status, connector_status_disconnected);
vkms_config_destroy(config);
}
static struct kunit_case vkms_config_test_cases[] = {
KUNIT_CASE(vkms_config_test_empty_config),
KUNIT_CASE_PARAM(vkms_config_test_default_config,
@@ -978,6 +1001,7 @@ static struct kunit_case vkms_config_test_cases[] = {
KUNIT_CASE(vkms_config_test_plane_get_possible_crtcs),
KUNIT_CASE(vkms_config_test_encoder_get_possible_crtcs),
KUNIT_CASE(vkms_config_test_connector_get_possible_encoders),
KUNIT_CASE(vkms_config_test_connector_status),
{}
};