From 93e4fff8518709a9d31bd32841ab65806ff1e1f0 Mon Sep 17 00:00:00 2001 From: Mark Yao Date: Sat, 14 Jan 2017 15:31:01 +0800 Subject: [PATCH] drm/sysfs: rename connector modes' name Most drm display mode's name is "[hdisplay]x[vdisplay]", like "1440x900", it's not a friendly name. Change-Id: I64d2fd3b00cdfc28906b31815af7e857fc88461e Signed-off-by: Mark Yao --- drivers/gpu/drm/drm_sysfs.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c index 615b7e667320..79f747296868 100644 --- a/drivers/gpu/drm/drm_sysfs.c +++ b/drivers/gpu/drm/drm_sysfs.c @@ -284,8 +284,13 @@ static ssize_t modes_show(struct device *device, int written = 0; list_for_each_entry(mode, &connector->modes, head) { - written += snprintf(buf + written, PAGE_SIZE - written, "%s\n", - mode->name); + bool interlaced = !!(mode->flags & DRM_MODE_FLAG_INTERLACE); + + written += snprintf(buf + written, PAGE_SIZE - written, + "%dx%d%s%d\n", + mode->hdisplay, mode->vdisplay, + interlaced ? "i" : "p", + drm_mode_vrefresh(mode)); } return written; -- 2.34.1