Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: "Nautiyal, Ankit K" <ankit.k.nautiyal@intel.com>,
	dri-devel@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH v2 03/25] drm/edid: add struct drm_edid container
Date: Mon, 16 May 2022 11:11:59 +0300	[thread overview]
Message-ID: <87v8u5hp68.fsf@intel.com> (raw)
In-Reply-To: <0d36849d-fb09-c507-894a-f5c5e5340997@intel.com>

On Tue, 10 May 2022, "Nautiyal, Ankit K" <ankit.k.nautiyal@intel.com> wrote:
> LGTM.
>
> Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>

Thanks for the review, pushed the lot already on Friday.

BR,
Jani.

>
> Regards,
>
> Ankit
>
> On 5/9/2022 5:33 PM, Jani Nikula wrote:
>> Introduce new opaque type struct drm_edid to encapsulate the EDID data
>> and the size allocated for it. The contents will be private to
>> drm_edid.c.
>>
>> There are a number of reasons for adding a container around struct edid:
>>
>> * struct edid is a raw blob pointer to data that usually originates
>>    outside of the kernel. Its size is contained within the structure.
>>
>> * There's no way to attach meta information (such as allocated memory
>>    size) to struct edid.
>>
>> * Validation of the EDID blob and its size become crucial, and it's
>>    spread all over the subsystem, with varying levels of accuracy.
>>
>> * HDMI Forum has introduced an HF-EEODB extension that defines an
>>    override EDID size within an EDID extension. The size allocated for an
>>    EDID depends on whether the allocator understands the HF-EEODB
>>    extension. Given a struct edid *, it's impossible to know how much
>>    memory was actually allocated for it.
>>
>> There are also some reasons for making the container type struct
>> drm_edid opaque and private to drm_edid.c:
>>
>> * Have only one place for creating and parsing the EDID, to avoid
>>    duplicating bugs.
>>
>> * Prepare for reading a pure DisplayID 2.0 from its own DDC address, and
>>    adding it within the same struct drm_edid container, transparently,
>>    and for all drivers.
>>
>> * With the idea that the drm_edid objects are immutable during their
>>    lifetimes, it will be possible to refcount them and reduce EDID
>>    copying everywhere (this is left for future work).
>>
>> Initially, just add the type. In follow-up, we'll start converting the
>> guts of drm_edid.c to use it, and finally add interfaces around it.
>>
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>> ---
>>   drivers/gpu/drm/drm_edid.c | 9 +++++++++
>>   1 file changed, 9 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
>> index dcef92c8887a..480fd9fbe412 100644
>> --- a/drivers/gpu/drm/drm_edid.c
>> +++ b/drivers/gpu/drm/drm_edid.c
>> @@ -1567,6 +1567,15 @@ static const struct drm_display_mode edid_4k_modes[] = {
>>   
>>   /*** DDC fetch and block validation ***/
>>   
>> +/*
>> + * The opaque EDID type, internal to drm_edid.c.
>> + */
>> +struct drm_edid {
>> +	/* Size allocated for edid */
>> +	size_t size;
>> +	const struct edid *edid;
>> +};
>> +
>>   static int edid_extension_block_count(const struct edid *edid)
>>   {
>>   	return edid->extensions;

-- 
Jani Nikula, Intel Open Source Graphics Center

  reply	other threads:[~2022-05-16  8:12 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-09 12:02 [Intel-gfx] [PATCH v2 00/25] drm/edid: introduce struct drm_edid Jani Nikula
2022-05-09 12:03 ` [Intel-gfx] [PATCH v2 01/25] drm/edid: use else-if in CTA extension parsing Jani Nikula
2022-05-09 12:03 ` [Intel-gfx] [PATCH v2 02/25] drm/edid: convert drm_for_each_detailed_block() to edid iter Jani Nikula
2022-05-09 12:03 ` [Intel-gfx] [PATCH v2 03/25] drm/edid: add struct drm_edid container Jani Nikula
2022-05-10  6:26   ` Nautiyal, Ankit K
2022-05-16  8:11     ` Jani Nikula [this message]
2022-05-09 12:03 ` [Intel-gfx] [PATCH v2 04/25] drm/edid: start propagating drm_edid to lower levels Jani Nikula
2022-05-10  6:23   ` Nautiyal, Ankit K
2022-05-09 12:03 ` [Intel-gfx] [PATCH v2 05/25] drm/edid: keep propagating drm_edid to display info Jani Nikula
2022-05-10  6:15   ` Nautiyal, Ankit K
2022-05-11  9:21   ` [Intel-gfx] [PATCH v3] " Jani Nikula
2022-05-09 12:03 ` [Intel-gfx] [PATCH v2 06/25] drm/edid: propagate drm_edid to drm_edid_to_eld() Jani Nikula
2022-05-10  6:31   ` Nautiyal, Ankit K
2022-05-11  9:23   ` [Intel-gfx] [PATCH v3] " Jani Nikula
2022-05-09 12:03 ` [Intel-gfx] [PATCH v2 07/25] drm/edid: convert drm_edid_connector_update() to drm_edid fully Jani Nikula
2022-05-10  6:45   ` Nautiyal, Ankit K
2022-05-11  9:26   ` [Intel-gfx] [PATCH v3] " Jani Nikula
2022-05-09 12:03 ` [Intel-gfx] [PATCH v2 08/25] drm/edid: convert struct detailed_mode_closure to drm_edid Jani Nikula
2022-05-10  7:14   ` Nautiyal, Ankit K
2022-05-09 12:03 ` [Intel-gfx] [PATCH v2 09/25] drm/edid: convert drm_mode_detailed() " Jani Nikula
2022-05-10  8:57   ` Nautiyal, Ankit K
2022-05-09 12:03 ` [Intel-gfx] [PATCH v2 10/25] drm/edid: convert drm_dmt_modes_for_range() " Jani Nikula
2022-05-10  9:04   ` Nautiyal, Ankit K
2022-05-09 12:03 ` [Intel-gfx] [PATCH v2 11/25] drm/edid: convert drm_gtf_modes_for_range() " Jani Nikula
2022-05-10  9:05   ` Nautiyal, Ankit K
2022-05-09 12:03 ` [Intel-gfx] [PATCH v2 12/25] drm/edid: convert drm_cvt_modes_for_range() " Jani Nikula
2022-05-10  9:11   ` Nautiyal, Ankit K
2022-05-09 12:03 ` [Intel-gfx] [PATCH v2 13/25] drm/edid: convert drm_mode_std() and children " Jani Nikula
2022-05-10  9:18   ` Nautiyal, Ankit K
2022-05-09 12:03 ` [Intel-gfx] [PATCH v2 14/25] drm/edid: convert mode_in_range() and drm_monitor_supports_rb() " Jani Nikula
2022-05-10  9:22   ` Nautiyal, Ankit K
2022-05-09 12:03 ` [Intel-gfx] [PATCH v2 15/25] drm/edid: convert get_monitor_name() " Jani Nikula
2022-05-10  9:29   ` Nautiyal, Ankit K
2022-05-09 12:03 ` [Intel-gfx] [PATCH v2 16/25] drm/edid: convert drm_for_each_detailed_block() " Jani Nikula
2022-05-10  9:36   ` Nautiyal, Ankit K
2022-05-09 12:03 ` [Intel-gfx] [PATCH v2 17/25] drm/edid: add drm_edid helper for drm_edid_to_sad() Jani Nikula
2022-05-10  9:55   ` Nautiyal, Ankit K
2022-05-09 12:03 ` [Intel-gfx] [PATCH v2 18/25] drm/edid: add drm_edid helper for drm_edid_to_speaker_allocation() Jani Nikula
2022-05-10 10:08   ` Nautiyal, Ankit K
2022-05-09 12:03 ` [Intel-gfx] [PATCH v2 19/25] drm/edid: add drm_edid helper for drm_detect_hdmi_monitor() Jani Nikula
2022-05-10 10:15   ` Nautiyal, Ankit K
2022-05-09 12:03 ` [Intel-gfx] [PATCH v2 20/25] drm/edid: add drm_edid helper for drm_detect_monitor_audio() Jani Nikula
2022-05-10 10:17   ` Nautiyal, Ankit K
2022-05-09 12:03 ` [Intel-gfx] [PATCH v2 21/25] drm/edid: convert cea_db_iter_edid_begin() to drm_edid Jani Nikula
2022-05-10 10:21   ` Nautiyal, Ankit K
2022-05-09 12:03 ` [Intel-gfx] [PATCH v2 22/25] drm/edid: convert drm_edid_iter_begin() " Jani Nikula
2022-05-10 10:25   ` Nautiyal, Ankit K
2022-05-09 12:03 ` [Intel-gfx] [PATCH v2 23/25] drm/edid: add drm_edid helper for drm_update_tile_info() Jani Nikula
2022-05-10 10:28   ` Nautiyal, Ankit K
2022-05-09 12:03 ` [Intel-gfx] [PATCH v2 24/25] drm/displayid: convert to drm_edid Jani Nikula
2022-05-10 12:04   ` Nautiyal, Ankit K
2022-05-09 12:03 ` [Intel-gfx] [PATCH v2 25/25] drm/edid: convert version_greater() " Jani Nikula
2022-05-10 12:07   ` Nautiyal, Ankit K
2022-05-09 19:16 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/edid: introduce struct drm_edid (rev3) Patchwork
2022-05-09 19:37 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-05-10  6:29 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2022-05-11 10:21 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/edid: introduce struct drm_edid (rev6) Patchwork
2022-05-11 10:42 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-05-11 14:29 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2022-05-11 17:35 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/edid: introduce struct drm_edid (rev7) Patchwork
2022-05-11 18:01 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-05-11 22:01 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87v8u5hp68.fsf@intel.com \
    --to=jani.nikula@intel.com \
    --cc=ankit.k.nautiyal@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox