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 <mark.yao@rock-chips.com>
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;