From: Mark Yao Date: Sat, 14 Jan 2017 07:31:01 +0000 (+0800) Subject: drm/sysfs: rename connector modes' name X-Git-Tag: firefly_0821_release~739 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=93e4fff8518709a9d31bd32841ab65806ff1e1f0;p=firefly-linux-kernel-4.4.55.git 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 --- 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;