diff options
author | Stephane Marchesin <marcheu@chromium.org> | 2012-11-09 20:21:05 +0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2012-11-20 09:36:56 +0400 |
commit | a4799037c3234830e9feb1823d87f905fb4d080a (patch) | |
tree | aa6bd061fe5cf66a7251105873da5367e71353e4 /drivers/gpu | |
parent | 96081cdfae35c1e332be42d89dee278c72d8915d (diff) | |
download | linux-a4799037c3234830e9feb1823d87f905fb4d080a.tar.xz |
drm: get cea video id code for a given display mode
This patch adds support for getting CEA Video ID Code for a given
display mode after matching with edid_cea_modes list. Its index in
the list added with one, gives the desired code.
This exported function will be used by hdmi drivers for composing
AVI info frame data.
Signed-off-by: Stephane Marchesin <marcheu@chromium.org>
Signed-off-by: Rahul Sharma <rahul.sharma@samsung.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/drm_edid.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index fadcd44ff196..856dcd91b3d4 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -1516,6 +1516,26 @@ u8 *drm_find_cea_extension(struct edid *edid) } EXPORT_SYMBOL(drm_find_cea_extension); +/* + * Looks for a CEA mode matching given drm_display_mode. + * Returns its CEA Video ID code, or 0 if not found. + */ +u8 drm_match_cea_mode(struct drm_display_mode *to_match) +{ + struct drm_display_mode *cea_mode; + u8 mode; + + for (mode = 0; mode < drm_num_cea_modes; mode++) { + cea_mode = (struct drm_display_mode *)&edid_cea_modes[mode]; + + if (drm_mode_equal(to_match, cea_mode)) + return mode + 1; + } + return 0; +} +EXPORT_SYMBOL(drm_match_cea_mode); + + static int do_cea_modes (struct drm_connector *connector, u8 *db, u8 len) { |