[PATCH 02/13] drm/amd/display: use drm_edid_product_id for parsing EDID product info

Melissa Wen mwen at igalia.com
Thu Apr 17 13:27:03 UTC 2025



On 15/04/2025 06:32, Michel Dänzer wrote:
> On 2025-04-11 22:08, Melissa Wen wrote:
>> Since [1], we can use drm_edid_product_id to get debug info from
>> drm_edid instead of directly parsing EDID.
>>
>> Link: https://lore.kernel.org/dri-devel/cover.1712655867.git.jani.nikula@intel.com/ [1]
>> Signed-off-by: Melissa Wen <mwen at igalia.com>
>> ---
>>   .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c    | 16 +++++++++-------
>>   1 file changed, 9 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
>> index 62954b351ebd..e93adb7e48a5 100644
>> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
>> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
>> [...]
>> @@ -122,13 +124,13 @@ enum dc_edid_status dm_helpers_parse_edid_caps(
>>   	if (!drm_edid_is_valid(edid_buf))
>>   		result = EDID_BAD_CHECKSUM;
>>   
>> -	edid_caps->manufacturer_id = (uint16_t) edid_buf->mfg_id[0] |
>> -					((uint16_t) edid_buf->mfg_id[1])<<8;
>> -	edid_caps->product_id = (uint16_t) edid_buf->prod_code[0] |
>> -					((uint16_t) edid_buf->prod_code[1])<<8;
>> -	edid_caps->serial_number = edid_buf->serial;
>> -	edid_caps->manufacture_week = edid_buf->mfg_week;
>> -	edid_caps->manufacture_year = edid_buf->mfg_year;
>> +	drm_edid_get_product_id(drm_edid, &product_id);
>> +
>> +	edid_caps->manufacturer_id = le16_to_cpu(product_id.manufacturer_name);
> struct drm_edid_product_id has
>
> 	__be16 manufacturer_name;
>
> so shouldn't this use be16_to_cpu? (Though I see that would be a change in behaviour from the existing code...)
Hi Michel, thanks for reviewing this patch.

It changes the behaviour, yes. But as you pointed it out I realized I 
can just assign product_id.manufacturer_name directly.
It also noticed that I screwed up on rebasing and there is a patch 
missing here [1], let me fix all these things in the next version.

[1] https://lore.kernel.org/amd-gfx/20250308142650.35920-3-mwen@igalia.com

Melissa

>
>



More information about the amd-gfx mailing list