@@ -1820,30 +1820,20 @@ static bool edid_block_is_zero(const void *edid)
1820
1820
return !memchr_inv (edid , 0 , EDID_LENGTH );
1821
1821
}
1822
1822
1823
- /**
1824
- * drm_edid_are_equal - compare two edid blobs.
1825
- * @edid1: pointer to first blob
1826
- * @edid2: pointer to second blob
1827
- * This helper can be used during probing to determine if
1828
- * edid had changed.
1829
- */
1830
- static bool drm_edid_are_equal (const struct edid * edid1 , const struct edid * edid2 )
1823
+ static bool drm_edid_eq (const struct drm_edid * drm_edid ,
1824
+ const void * raw_edid , size_t raw_edid_size )
1831
1825
{
1832
- int edid1_len , edid2_len ;
1833
- bool edid1_present = edid1 != NULL ;
1834
- bool edid2_present = edid2 != NULL ;
1826
+ bool edid1_present = drm_edid && drm_edid -> edid && drm_edid -> size ;
1827
+ bool edid2_present = raw_edid && raw_edid_size ;
1835
1828
1836
1829
if (edid1_present != edid2_present )
1837
1830
return false;
1838
1831
1839
- if (edid1 ) {
1840
- edid1_len = edid_size (edid1 );
1841
- edid2_len = edid_size (edid2 );
1842
-
1843
- if (edid1_len != edid2_len )
1832
+ if (edid1_present ) {
1833
+ if (drm_edid -> size != raw_edid_size )
1844
1834
return false;
1845
1835
1846
- if (memcmp (edid1 , edid2 , edid1_len ))
1836
+ if (memcmp (drm_edid -> edid , raw_edid , drm_edid -> size ))
1847
1837
return false;
1848
1838
}
1849
1839
@@ -6936,15 +6926,14 @@ static int _drm_edid_connector_property_update(struct drm_connector *connector,
6936
6926
int ret ;
6937
6927
6938
6928
if (connector -> edid_blob_ptr ) {
6939
- const struct edid * old_edid = connector -> edid_blob_ptr -> data ;
6940
-
6941
- if (old_edid ) {
6942
- if (!drm_edid_are_equal (drm_edid ? drm_edid -> edid : NULL , old_edid )) {
6943
- connector -> epoch_counter ++ ;
6944
- drm_dbg_kms (dev , "[CONNECTOR:%d:%s] EDID changed, epoch counter %llu\n" ,
6945
- connector -> base .id , connector -> name ,
6946
- connector -> epoch_counter );
6947
- }
6929
+ const void * old_edid = connector -> edid_blob_ptr -> data ;
6930
+ size_t old_edid_size = connector -> edid_blob_ptr -> length ;
6931
+
6932
+ if (old_edid && !drm_edid_eq (drm_edid , old_edid , old_edid_size )) {
6933
+ connector -> epoch_counter ++ ;
6934
+ drm_dbg_kms (dev , "[CONNECTOR:%d:%s] EDID changed, epoch counter %llu\n" ,
6935
+ connector -> base .id , connector -> name ,
6936
+ connector -> epoch_counter );
6948
6937
}
6949
6938
}
6950
6939
0 commit comments