From: Jani Nikula <jani.nikula@linux.intel.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>,
dri-devel@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Subject: Re: [PATCH v2 3/5] drm/edid: Have drm_edid_get_product_id() tell us if it found something
Date: Tue, 01 Dec 2026 21:43:16 +0200 [thread overview]
Message-ID: <7062a9a4552d2285a152a974fb69ca85426e6ba8@intel.com> (raw)
In-Reply-To: <20261201181426.15395-4-ville.syrjala@linux.intel.com>
On Tue, 01 Dec 2026, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> If drm_edid_get_product_id() is used on a NULL or bogus
> EDID it will just fill the product ID with zeros. Have
> it inform the caller what it did by returning an errno,
> just like drm_edid_get_displayid_product_id() does.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
> ---
> drivers/gpu/drm/drm_edid.c | 17 ++++++++++++-----
> include/drm/drm_edid.h | 4 ++--
> 2 files changed, 14 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 8faec57f70d1..51e855d34adc 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -2780,14 +2780,21 @@ EXPORT_SYMBOL(drm_edid_read);
> * drm_edid_get_product_id - Get the vendor and product identification
> * @drm_edid: EDID
> * @id: Where to place the product id
> + *
> + * Return: Zero on success, or a negative errno code otherwise.
> */
> -void drm_edid_get_product_id(const struct drm_edid *drm_edid,
> - struct drm_edid_product_id *id)
> +int drm_edid_get_product_id(const struct drm_edid *drm_edid,
> + struct drm_edid_product_id *id)
> {
> - if (drm_edid && drm_edid->edid && drm_edid->size >= EDID_LENGTH)
> + if (drm_edid && drm_edid->edid && drm_edid->size >= EDID_LENGTH) {
> memcpy(id, &drm_edid->edid->product_id, sizeof(*id));
> - else
> - memset(id, 0, sizeof(*id));
> +
> + return 0;
> + }
> +
> + memset(id, 0, sizeof(*id));
> +
> + return -EINVAL;
> }
> EXPORT_SYMBOL(drm_edid_get_product_id);
>
> diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
> index a4e5366b53ad..b075a8eafd17 100644
> --- a/include/drm/drm_edid.h
> +++ b/include/drm/drm_edid.h
> @@ -490,8 +490,8 @@ int drm_edid_connector_update(struct drm_connector *connector,
> const struct drm_edid *edid);
> int drm_edid_connector_add_modes(struct drm_connector *connector);
> bool drm_edid_is_digital(const struct drm_edid *drm_edid);
> -void drm_edid_get_product_id(const struct drm_edid *drm_edid,
> - struct drm_edid_product_id *id);
> +int drm_edid_get_product_id(const struct drm_edid *drm_edid,
> + struct drm_edid_product_id *id);
> int drm_edid_get_displayid_product_id(const struct drm_edid *drm_edid,
> struct drm_displayid_product_id *id);
> void drm_edid_print_product_id(struct drm_printer *p,
--
Jani Nikula, Intel
next prev parent reply other threads:[~2026-12-01 19:43 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-01 18:14 [PATCH v2 0/5] drm/i915: Implement DisplayID based VBT panel type detection Ville Syrjala
2026-12-01 18:14 ` [PATCH v2 1/5] drm/edid: Introduce drm_edid_get_displayid_product_id() Ville Syrjala
2026-12-02 9:48 ` Jani Nikula
2026-12-02 14:53 ` Ville Syrjälä
2026-12-01 18:14 ` [PATCH v2 2/5] drm/i915/bios: Attempt to match the VBT PnP ID against DisplayID first Ville Syrjala
2026-12-01 18:14 ` [PATCH v2 3/5] drm/edid: Have drm_edid_get_product_id() tell us if it found something Ville Syrjala
2026-12-01 19:43 ` Jani Nikula [this message]
2026-12-01 18:14 ` [PATCH v2 4/5] drm/i915/bios: Skip VBT PnP ID match if there is no EDID product ID Ville Syrjala
2026-12-01 19:44 ` Jani Nikula
2026-12-01 18:14 ` [PATCH v2 5/5] drm/i915/bios: Use is_panel_type_valid_or_pnp() for the sanity check Ville Syrjala
2026-12-01 19:46 ` Jani Nikula
2026-12-01 18:44 ` ✗ CI.checkpatch: warning for drm/i915: Implement DisplayID based VBT panel type detection (rev2) Patchwork
2026-12-01 18:46 ` ✓ CI.KUnit: success " Patchwork
2026-12-01 19:15 ` ✓ i915.CI.BAT: " Patchwork
2026-12-01 19:19 ` ✓ Xe.CI.BAT: " Patchwork
2026-12-02 14:24 ` ✗ Xe.CI.FULL: 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=7062a9a4552d2285a152a974fb69ca85426e6ba8@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=ville.syrjala@linux.intel.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.