aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorPaulo Zanoni <paulo.r.zanoni@intel.com>2012-11-23 09:09:26 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-11-29 05:42:37 -0500
commit374a868a726eb8a1cb28ba88805e51ce34222f8d (patch)
treec6d63768af759869d9b196571d5a5c74640ccd2e /drivers/gpu/drm
parent2ff4aeac39dbdcac934694413767f09a27965e11 (diff)
drm: add drm_mode_cea_vic
This function returns the VIC of the mode. This value can be used when creating AVI InfoFrames. Cc: Thierry Reding <thierry.reding@avionic-design.de> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=50371 Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Reviewed-by: Thierry Reding <thierry.reding@avionic-design.de> Acked-by: Dave Airlie <airlied@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/drm_edid.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 164820003546..011bd4f4635e 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -2079,3 +2079,22 @@ int drm_add_modes_noedid(struct drm_connector *connector,
2079 return num_modes; 2079 return num_modes;
2080} 2080}
2081EXPORT_SYMBOL(drm_add_modes_noedid); 2081EXPORT_SYMBOL(drm_add_modes_noedid);
2082
2083/**
2084 * drm_mode_cea_vic - return the CEA-861 VIC of a given mode
2085 * @mode: mode
2086 *
2087 * RETURNS:
2088 * The VIC number, 0 in case it's not a CEA-861 mode.
2089 */
2090uint8_t drm_mode_cea_vic(const struct drm_display_mode *mode)
2091{
2092 uint8_t i;
2093
2094 for (i = 0; i < drm_num_cea_modes; i++)
2095 if (drm_mode_equal(mode, &edid_cea_modes[i]))
2096 return i + 1;
2097
2098 return 0;
2099}
2100EXPORT_SYMBOL(drm_mode_cea_vic);