linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Doug Anderson <dianders@chromium.org>,
	Hsin-Yi Wang <hsinyi@chromium.org>
Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Jessica Zhang <quic_jesszhan@quicinc.com>,
	Sam Ravnborg <sam@ravnborg.org>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 1/6] drm_edid: Add a function to get EDID base block
Date: Thu, 07 Mar 2024 14:50:17 +0200	[thread overview]
Message-ID: <87wmqew6ie.fsf@intel.com> (raw)
In-Reply-To: <CAD=FV=XcMRLvSU+_QrNMSOo4JH0hPmA-F3HFjOBj=QwHHQy_mA@mail.gmail.com>

On Wed, 06 Mar 2024, Doug Anderson <dianders@chromium.org> wrote:
> Hi,
>
> On Wed, Mar 6, 2024 at 12:04 PM Hsin-Yi Wang <hsinyi@chromium.org> wrote:
>>
>> @@ -2764,58 +2764,71 @@ static u32 edid_extract_panel_id(const struct edid *edid)
>>  }
>>
>>  /**
>> - * drm_edid_get_panel_id - Get a panel's ID through DDC
>> - * @adapter: I2C adapter to use for DDC
>> + * drm_edid_get_panel_id - Get a panel's ID from EDID
>> + * @drm_edid: EDID that contains panel ID.
>>   *
>> - * This function reads the first block of the EDID of a panel and (assuming
>> + * This function uses the first block of the EDID of a panel and (assuming
>>   * that the EDID is valid) extracts the ID out of it. The ID is a 32-bit value
>>   * (16 bits of manufacturer ID and 16 bits of per-manufacturer ID) that's
>>   * supposed to be different for each different modem of panel.
>>   *
>> + * Return: A 32-bit ID that should be different for each make/model of panel.
>> + *         See the functions drm_edid_encode_panel_id() and
>> + *         drm_edid_decode_panel_id() for some details on the structure of this
>> + *         ID.
>> + */
>> +u32 drm_edid_get_panel_id(const struct drm_edid *drm_edid)
>> +{
>
> I'd leave it up to Jani, but I'd wonder whether we need to confirm
> drm_edid->size here is at least as big as the base block. In other
> words: is there ever any chance that someone would have allocated a
> struct drm_edid but not actually read a full base block into it?

On the one hand, I've tried to make all the drm_edid based interfaces
handle all the cases (drm_edid == NULL, drm_edid->edid == NULL,
drm_edid->size < required) gracefully, but on the other hand, panel-edp
is the only user and this would go boom for you quickly if you passed in
a bogus drm_edid.

Adding the checks is definitely not wrong, but I'm not insisting.

Reviewed-by: Jani Nikula <jani.nikula@intel.com>

>
> In any case:
>
> Reviewed-by: Douglas Anderson <dianders@chromium.org>

-- 
Jani Nikula, Intel

  reply	other threads:[~2024-03-07 12:50 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-06 19:55 [PATCH v5 0/6] Match panel with identity Hsin-Yi Wang
2024-03-06 19:55 ` [PATCH v5 1/6] drm_edid: Add a function to get EDID base block Hsin-Yi Wang
2024-03-06 23:29   ` Doug Anderson
2024-03-07 12:50     ` Jani Nikula [this message]
2024-03-06 19:55 ` [PATCH v5 2/6] drm/edid: Clean up drm_edid_get_panel_id() Hsin-Yi Wang
2024-03-06 23:29   ` Doug Anderson
2024-03-07 12:51     ` Jani Nikula
2024-03-06 19:55 ` [PATCH v5 3/6] drm/edid: Add a function to match EDID with identity Hsin-Yi Wang
2024-03-06 23:29   ` Doug Anderson
2024-03-07  0:20     ` Hsin-Yi Wang
2024-03-07  0:37       ` Doug Anderson
2024-03-07 13:20         ` Jani Nikula
2024-03-07 19:34           ` Hsin-Yi Wang
2024-03-07 22:36             ` Jani Nikula
2024-03-06 19:55 ` [PATCH v5 4/6] drm/edid: Match edid quirks " Hsin-Yi Wang
2024-03-06 23:29   ` Doug Anderson
2024-03-06 19:55 ` [PATCH v5 5/6] drm/panel-edp: Match edp_panels with panel identity Hsin-Yi Wang
2024-03-06 23:30   ` Doug Anderson
2024-03-06 19:55 ` [PATCH v5 6/6] drm/panel-edp: Fix AUO 0x405c panel naming and add a variant Hsin-Yi Wang
2024-03-06 23:30   ` Doug Anderson
2024-03-07 13:28     ` Jani Nikula
2024-03-07 20:18       ` Hsin-Yi Wang
2024-03-07 20:27         ` Jani Nikula
2024-03-07 21:46           ` Doug Anderson
2024-03-07 22:35             ` Jani Nikula

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=87wmqew6ie.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=airlied@gmail.com \
    --cc=daniel@ffwll.ch \
    --cc=dianders@chromium.org \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hsinyi@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=quic_jesszhan@quicinc.com \
    --cc=sam@ravnborg.org \
    --cc=tzimmermann@suse.de \
    /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;
as well as URLs for NNTP newsgroup(s).