diff mbox series

[libdrm,2/2] modeprint: print encoder type

Message ID 20180905180025.13282-4-stefan@agner.ch (mailing list archive)
State New, archived
Headers show
Series None | expand

Commit Message

Stefan Agner Sept. 5, 2018, 6 p.m. UTC
Print encoder types similar to connector types.

Signed-off-by: Stefan Agner <stefan@agner.ch>
---
 tests/modeprint/modeprint.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/tests/modeprint/modeprint.c b/tests/modeprint/modeprint.c
index 1d62270f..ad727e12 100644
--- a/tests/modeprint/modeprint.c
+++ b/tests/modeprint/modeprint.c
@@ -186,7 +186,13 @@  static int printConnector(int fd, drmModeResPtr res, drmModeConnectorPtr connect
 
 static int printEncoder(int fd, drmModeResPtr res, drmModeEncoderPtr encoder, uint32_t id)
 {
-	printf("Encoder\n");
+	const char *encoder_name;
+
+	encoder_name = util_lookup_encoder_type_name(encoder->encoder_type);
+	if (encoder_name)
+		printf("Encoder: %s\n", encoder_name);
+	else
+		printf("Encoder\n");
 	printf("\tid     :%i\n", id);
 	printf("\tcrtc_id   :%d\n", encoder->crtc_id);
 	printf("\ttype   :%d\n", encoder->encoder_type);