mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 04:10:18 +09:00
UPSTREAM: drm/edid: cleanup patch for CEA extended-tag macro
CEA-861-F introduces extended tag codes for EDID extension blocks,
which indicates the actual type of the data block. The code for
using exteded tag is 0x7, whereas in the existing code, the
corresponding macro is named as "VIDEO_CAPABILITY_BLOCK"
This patch renames the macro and usages from "VIDEO_CAPABILITY_BLOCK"
to "USE_EXTENDED_TAG"
V2: Add extended tag code check for video capabilitiy block (ville)
V3: Ville:
- Use suggested names for macros
- Check the block length first, before checking the extended tag
V4: Fix commit message (David)
V5: Introduced this patch into HDMI-YCBCR-output series
V6: Rebase
V7: Rebase
Change-Id: I7564a9fd9b5a44be0a10394b14ff3d21d9b1e0d5
Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
Signed-off-by: Shashank Sharma <shashank.sharma@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1499960000-9232-5-git-send-email-shashank.sharma@intel.com
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
(cherry picked from commit 87563fc030)
This commit is contained in:
committed by
Huang, Tao
parent
7bc1cf6e81
commit
9460b2bf90
@@ -2717,7 +2717,8 @@ add_detailed_modes(struct drm_connector *connector, struct edid *edid,
|
||||
#define VIDEO_BLOCK 0x02
|
||||
#define VENDOR_BLOCK 0x03
|
||||
#define SPEAKER_BLOCK 0x04
|
||||
#define VIDEO_CAPABILITY_BLOCK 0x07
|
||||
#define USE_EXTENDED_TAG 0x07
|
||||
#define EXT_VIDEO_CAPABILITY_BLOCK 0x00
|
||||
#define VIDEO_DATA_BLOCK_420 0x0E
|
||||
#define VIDEO_CAP_BLOCK_420 0x0F
|
||||
#define EDID_BASIC_AUDIO (1 << 6)
|
||||
@@ -3430,18 +3431,18 @@ cea_db_payload_len(const u8 *db)
|
||||
return db[0] & 0x1f;
|
||||
}
|
||||
|
||||
static int
|
||||
cea_db_tag(const u8 *db)
|
||||
{
|
||||
return db[0] >> 5;
|
||||
}
|
||||
|
||||
static int
|
||||
cea_db_extended_tag(const u8 *db)
|
||||
{
|
||||
return db[1];
|
||||
}
|
||||
|
||||
static int
|
||||
cea_db_tag(const u8 *db)
|
||||
{
|
||||
return db[0] >> 5;
|
||||
}
|
||||
|
||||
static int
|
||||
cea_revision(const u8 *cea)
|
||||
{
|
||||
@@ -3495,7 +3496,7 @@ static bool cea_db_is_hdmi_vsdb(const u8 *db)
|
||||
|
||||
static bool cea_db_is_hdmi_vdb420(const u8 *db)
|
||||
{
|
||||
if (cea_db_tag(db) != VIDEO_CAPABILITY_BLOCK)
|
||||
if (cea_db_tag(db) != USE_EXTENDED_TAG)
|
||||
return false;
|
||||
|
||||
if (cea_db_extended_tag(db) != VIDEO_DATA_BLOCK_420)
|
||||
@@ -3506,7 +3507,7 @@ static bool cea_db_is_hdmi_vdb420(const u8 *db)
|
||||
|
||||
static bool cea_db_is_hdmi_vcb420(const u8 *db)
|
||||
{
|
||||
if (cea_db_tag(db) != VIDEO_CAPABILITY_BLOCK)
|
||||
if (cea_db_tag(db) != USE_EXTENDED_TAG)
|
||||
return false;
|
||||
|
||||
if (cea_db_extended_tag(db) != VIDEO_CAP_BLOCK_420)
|
||||
@@ -4052,8 +4053,10 @@ bool drm_rgb_quant_range_selectable(struct edid *edid)
|
||||
return false;
|
||||
|
||||
for_each_cea_db(edid_ext, i, start, end) {
|
||||
if (cea_db_tag(&edid_ext[i]) == VIDEO_CAPABILITY_BLOCK &&
|
||||
cea_db_payload_len(&edid_ext[i]) == 2) {
|
||||
if (cea_db_tag(&edid_ext[i]) == USE_EXTENDED_TAG &&
|
||||
cea_db_payload_len(&edid_ext[i]) == 2 &&
|
||||
cea_db_extended_tag(&edid_ext[i]) ==
|
||||
EXT_VIDEO_CAPABILITY_BLOCK) {
|
||||
DRM_DEBUG_KMS("CEA VCDB 0x%02x\n", edid_ext[i + 2]);
|
||||
return edid_ext[i + 2] & EDID_CEA_VCDB_QS;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user