From 0427c1f669ea9b71a9c417f558fcff1666a045e3 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Tue, 1 Feb 2022 14:36:52 +0100 Subject: [PATCH] tests: use drmModeGetConnectorTypeName Drop util_lookup_connector_type_name and use drmModeGetConnectorTypeName instead. Signed-off-by: Simon Ser --- tests/modeprint/modeprint.c | 2 +- tests/modetest/modetest.c | 2 +- tests/proptest/proptest.c | 2 +- tests/util/kms.c | 27 --------------------------- tests/util/kms.h | 1 - 5 files changed, 3 insertions(+), 31 deletions(-) diff --git a/tests/modeprint/modeprint.c b/tests/modeprint/modeprint.c index 9372ad92..0f644c74 100644 --- a/tests/modeprint/modeprint.c +++ b/tests/modeprint/modeprint.c @@ -135,7 +135,7 @@ static int printConnector(int fd, drmModeResPtr res, drmModeConnectorPtr connect drmModePropertyPtr props; const char *connector_type_name = NULL; - connector_type_name = util_lookup_connector_type_name(connector->connector_type); + connector_type_name = drmModeGetConnectorTypeName(connector->connector_type); if (connector_type_name) printf("Connector: %s-%d\n", connector_type_name, diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c index d6ab9dc8..8ff6c80d 100644 --- a/tests/modetest/modetest.c +++ b/tests/modetest/modetest.c @@ -656,7 +656,7 @@ static struct resources *get_resources(struct device *dev) int num; num = asprintf(&connector->name, "%s-%u", - util_lookup_connector_type_name(conn->connector_type), + drmModeGetConnectorTypeName(conn->connector_type), conn->connector_type_id); if (num < 0) goto error; diff --git a/tests/proptest/proptest.c b/tests/proptest/proptest.c index 88bed10b..97cb01fa 100644 --- a/tests/proptest/proptest.c +++ b/tests/proptest/proptest.c @@ -192,7 +192,7 @@ static void listConnectorProperties(void) } printf("Connector %u (%s-%u)\n", c->connector_id, - util_lookup_connector_type_name(c->connector_type), + drmModeGetConnectorTypeName(c->connector_type), c->connector_type_id); listObjectProperties(c->connector_id, diff --git a/tests/util/kms.c b/tests/util/kms.c index 39a93866..680e21ac 100644 --- a/tests/util/kms.c +++ b/tests/util/kms.c @@ -96,33 +96,6 @@ const char *util_lookup_connector_status_name(unsigned int status) ARRAY_SIZE(connector_status_names)); } -static const struct type_name connector_type_names[] = { - { DRM_MODE_CONNECTOR_Unknown, "unknown" }, - { DRM_MODE_CONNECTOR_VGA, "VGA" }, - { DRM_MODE_CONNECTOR_DVII, "DVI-I" }, - { DRM_MODE_CONNECTOR_DVID, "DVI-D" }, - { DRM_MODE_CONNECTOR_DVIA, "DVI-A" }, - { DRM_MODE_CONNECTOR_Composite, "composite" }, - { DRM_MODE_CONNECTOR_SVIDEO, "s-video" }, - { DRM_MODE_CONNECTOR_LVDS, "LVDS" }, - { DRM_MODE_CONNECTOR_Component, "component" }, - { DRM_MODE_CONNECTOR_9PinDIN, "9-pin DIN" }, - { DRM_MODE_CONNECTOR_DisplayPort, "DP" }, - { DRM_MODE_CONNECTOR_HDMIA, "HDMI-A" }, - { DRM_MODE_CONNECTOR_HDMIB, "HDMI-B" }, - { DRM_MODE_CONNECTOR_TV, "TV" }, - { DRM_MODE_CONNECTOR_eDP, "eDP" }, - { DRM_MODE_CONNECTOR_VIRTUAL, "Virtual" }, - { DRM_MODE_CONNECTOR_DSI, "DSI" }, - { DRM_MODE_CONNECTOR_DPI, "DPI" }, -}; - -const char *util_lookup_connector_type_name(unsigned int type) -{ - return util_lookup_type_name(type, connector_type_names, - ARRAY_SIZE(connector_type_names)); -} - static const char * const modules[] = { "i915", "amdgpu", diff --git a/tests/util/kms.h b/tests/util/kms.h index dde2ed2c..f79f4617 100644 --- a/tests/util/kms.h +++ b/tests/util/kms.h @@ -28,7 +28,6 @@ const char *util_lookup_encoder_type_name(unsigned int type); const char *util_lookup_connector_status_name(unsigned int type); -const char *util_lookup_connector_type_name(unsigned int type); int util_open(const char *device, const char *module);