[PATCH] drm: Parse Colorimetry data block from EDID
abhinavk at codeaurora.org
abhinavk at codeaurora.org
Mon Jan 27 20:42:03 UTC 2020
Hi Stephen
On 2020-01-27 10:46, Stephen Boyd wrote:
> Quoting Abhinav Kumar (2020-01-23 14:40:45)
>> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
>> index 99769d6..148bfa4 100644
>> --- a/drivers/gpu/drm/drm_edid.c
>> +++ b/drivers/gpu/drm/drm_edid.c
>> @@ -4199,6 +4200,57 @@ static void
>> fixup_detailed_cea_mode_clock(struct drm_display_mode *mode)
>> mode->clock = clock;
>> }
>>
>> +static bool cea_db_is_hdmi_colorimetry_data_block(const u8 *db)
>> +{
>> + if (cea_db_tag(db) != USE_EXTENDED_TAG)
>> + return false;
>> +
>> + if (db[1] != COLORIMETRY_DATA_BLOCK)
>> + return false;
>> +
>> + if (cea_db_payload_len(db) < 2)
>> + return false;
>> +
>> + return true;
>> +}
>> +
>> +static void
>> +drm_parse_colorimetry_data_block(struct drm_connector *connector,
>> const u8 *db)
>> +{
>> + struct drm_hdmi_info *info = &connector->display_info.hdmi;
>> +
>> + /* As per CEA 861-G spec */
>> + /* Byte 3 Bit 0: xvYCC_601 */
>> + if (db[2] & BIT(0))
>
> Why not use the defines added in drm_edid.h in this patch? Then the
> comments can be removed because the code would look like
>
> if (db[2] & DRM_EDID_CLRMETRY_xvYCC_601)
[Abhinav] Sure, will make the change and upload a v2
More information about the dri-devel
mailing list