diff mbox

[v3] drm/edid: rename macro for CEA extended-tag

Message ID 1499094539-7197-1-git-send-email-shashank.sharma@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Sharma, Shashank July 3, 2017, 3:08 p.m. UTC
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 "CEA_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

Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
Signed-off-by: Shashank Sharma <shashank.sharma@intel.com>
---
 drivers/gpu/drm/drm_edid.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

Comments

kernel test robot July 4, 2017, 7:10 a.m. UTC | #1
Hi Shashank,

[auto build test ERROR on drm/drm-next]
[also build test ERROR on v4.12]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Shashank-Sharma/drm-edid-rename-macro-for-CEA-extended-tag/20170704-114852
base:   git://people.freedesktop.org/~airlied/linux.git drm-next
config: x86_64-randconfig-x015-07041133 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All error/warnings (new ones prefixed by >>):

>> drivers/gpu//drm/drm_edid.c:3812:2: error: expected identifier or '(' before 'return'
     return false;
     ^~~~~~
>> drivers/gpu//drm/drm_edid.c:3813:1: error: expected identifier or '(' before '}' token
    }
    ^
   drivers/gpu//drm/drm_edid.c: In function 'drm_rgb_quant_range_selectable':
>> drivers/gpu//drm/drm_edid.c:3810:2: warning: control reaches end of non-void function [-Wreturn-type]
     }
     ^

vim +3812 drivers/gpu//drm/drm_edid.c

0f73912d1 Shashank Sharma 2017-07-03  3804  		    cea_db_payload_len(&edid_ext[i]) == 2 &&
0f73912d1 Shashank Sharma 2017-07-03  3805  		    cea_db_extended_tag(&edid_ext[i]) ==
0f73912d1 Shashank Sharma 2017-07-03  3806  			EXT_VIDEO_CAPABILITY_BLOCK)
b1edd6a6e Ville Syrjälä   2013-01-17  3807  			DRM_DEBUG_KMS("CEA VCDB 0x%02x\n", edid_ext[i + 2]);
b1edd6a6e Ville Syrjälä   2013-01-17  3808  			return edid_ext[i + 2] & EDID_CEA_VCDB_QS;
b1edd6a6e Ville Syrjälä   2013-01-17  3809  		}
b1edd6a6e Ville Syrjälä   2013-01-17 @3810  	}
b1edd6a6e Ville Syrjälä   2013-01-17  3811  
b1edd6a6e Ville Syrjälä   2013-01-17 @3812  	return false;
b1edd6a6e Ville Syrjälä   2013-01-17 @3813  }
b1edd6a6e Ville Syrjälä   2013-01-17  3814  EXPORT_SYMBOL(drm_rgb_quant_range_selectable);
b1edd6a6e Ville Syrjälä   2013-01-17  3815  
c8127cf08 Ville Syrjälä   2017-01-11  3816  /**

:::::: The code at line 3812 was first introduced by commit
:::::: b1edd6a6ecd436af33f210a5c75e0249466fd200 drm/edid: Add drm_rgb_quant_range_selectable()

:::::: TO: Ville Syrjälä <ville.syrjala@linux.intel.com>
:::::: CC: Daniel Vetter <daniel.vetter@ffwll.ch>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
diff mbox

Patch

diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 2e55599..ec2d422 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -2566,7 +2566,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 EDID_BASIC_AUDIO	(1 << 6)
 #define EDID_CEA_YCRCB444	(1 << 5)
 #define EDID_CEA_YCRCB422	(1 << 4)
@@ -3218,6 +3219,12 @@  cea_db_payload_len(const u8 *db)
 }
 
 static int
+cea_db_extended_tag(const u8 *db)
+{
+	return db[1];
+}
+
+static int
 cea_db_tag(const u8 *db)
 {
 	return db[0] >> 5;
@@ -3793,8 +3800,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;
 		}