aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_edid.c
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2013-01-17 09:31:30 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-01-20 07:09:44 -0500
commitb1edd6a6ecd436af33f210a5c75e0249466fd200 (patch)
tree12ea6bb801282488ecd38f6a4001867b26289515 /drivers/gpu/drm/drm_edid.c
parent55bc60db5988c8366751d3d04dd690698a53412c (diff)
drm/edid: Add drm_rgb_quant_range_selectable()
drm_rgb_quant_range_selectable() will report whether the monitor claims to support for RGB quantization range selection. The information can be found in the CEA Video capability block. v2: s/quantzation/quantization/ in the comment Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Acked-by: David Airlie <airlied@linux.ie> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/drm_edid.c')
-rw-r--r--drivers/gpu/drm/drm_edid.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 5a3770fbd770..a3a3b61059ff 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -1483,9 +1483,11 @@ add_detailed_modes(struct drm_connector *connector, struct edid *edid,
1483#define VIDEO_BLOCK 0x02 1483#define VIDEO_BLOCK 0x02
1484#define VENDOR_BLOCK 0x03 1484#define VENDOR_BLOCK 0x03
1485#define SPEAKER_BLOCK 0x04 1485#define SPEAKER_BLOCK 0x04
1486#define VIDEO_CAPABILITY_BLOCK 0x07
1486#define EDID_BASIC_AUDIO (1 << 6) 1487#define EDID_BASIC_AUDIO (1 << 6)
1487#define EDID_CEA_YCRCB444 (1 << 5) 1488#define EDID_CEA_YCRCB444 (1 << 5)
1488#define EDID_CEA_YCRCB422 (1 << 4) 1489#define EDID_CEA_YCRCB422 (1 << 4)
1490#define EDID_CEA_VCDB_QS (1 << 6)
1489 1491
1490/** 1492/**
1491 * Search EDID for CEA extension block. 1493 * Search EDID for CEA extension block.
@@ -1902,6 +1904,37 @@ end:
1902EXPORT_SYMBOL(drm_detect_monitor_audio); 1904EXPORT_SYMBOL(drm_detect_monitor_audio);
1903 1905
1904/** 1906/**
1907 * drm_rgb_quant_range_selectable - is RGB quantization range selectable?
1908 *
1909 * Check whether the monitor reports the RGB quantization range selection
1910 * as supported. The AVI infoframe can then be used to inform the monitor
1911 * which quantization range (full or limited) is used.
1912 */
1913bool drm_rgb_quant_range_selectable(struct edid *edid)
1914{
1915 u8 *edid_ext;
1916 int i, start, end;
1917
1918 edid_ext = drm_find_cea_extension(edid);
1919 if (!edid_ext)
1920 return false;
1921
1922 if (cea_db_offsets(edid_ext, &start, &end))
1923 return false;
1924
1925 for_each_cea_db(edid_ext, i, start, end) {
1926 if (cea_db_tag(&edid_ext[i]) == VIDEO_CAPABILITY_BLOCK &&
1927 cea_db_payload_len(&edid_ext[i]) == 2) {
1928 DRM_DEBUG_KMS("CEA VCDB 0x%02x\n", edid_ext[i + 2]);
1929 return edid_ext[i + 2] & EDID_CEA_VCDB_QS;
1930 }
1931 }
1932
1933 return false;
1934}
1935EXPORT_SYMBOL(drm_rgb_quant_range_selectable);
1936
1937/**
1905 * drm_add_display_info - pull display info out if present 1938 * drm_add_display_info - pull display info out if present
1906 * @edid: EDID data 1939 * @edid: EDID data
1907 * @info: display info (attached to connector) 1940 * @info: display info (attached to connector)