From: Jani Nikula <jani.nikula@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 1/5] drm/edid: Introduce drm_edid_get_displayid_product_id()
Date: Wed, 02 Dec 2026 11:48:21 +0200 [thread overview]
Message-ID: <bf6d910c32898f8c721e41a780328274bbf06e16@intel.com> (raw)
In-Reply-To: <20261201181426.15395-2-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>
>
> Add drm_edid_get_displayid_product_id() as the DisplayID based
> counterpart to the already existing EDID base block based
> drm_edid_get_product_id().
>
> In DisplayID the information is stored in the "Product ID"
> block (0x00 or 0x20). The layout is slightly different to the
> EDID one as the vendor ID is a three byte OUI isntead of
> the compressed ASCII EISA/PNPID of EDID. The "year of
> manufacture" is now relative to the year 2000, as opposed
> to 1990 for EDID.
>
> There is also a product ID string, but I decided to leave that
> out from the user visible struct because the variable length
> would just complicate things.
>
> v2: Call it drm_edid_get_displayid_product_id() (Jani)
> Return an error to indicate what happened (Jani)
>
> Reviewed-by: Jani Nikula <jani.nikula@intel.com>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> drivers/gpu/drm/drm_displayid_internal.h | 11 +++++
> drivers/gpu/drm/drm_edid.c | 56 ++++++++++++++++++++++++
> include/drm/drm_edid.h | 10 +++++
> 3 files changed, 77 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_displayid_internal.h b/drivers/gpu/drm/drm_displayid_internal.h
> index ef7e6c9bd4db..2177c19cae4c 100644
> --- a/drivers/gpu/drm/drm_displayid_internal.h
> +++ b/drivers/gpu/drm/drm_displayid_internal.h
> @@ -103,6 +103,17 @@ struct displayid_block {
> u8 num_bytes;
> } __packed;
>
> +struct displayid_product_id_block {
> + struct displayid_block base;
> + u8 vendor_id[3];
> + __le16 product_code;
> + __le32 serial_number;
> + u8 week_of_manufacture;
> + u8 year_of_manufacture;
> + u8 size_of_product_id_string;
> + u8 product_id_string[];
> +} __packed;
> +
> struct displayid_tiled_block {
> struct displayid_block base;
> u8 tile_cap;
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index b8f882a17c8f..8faec57f70d1 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -2791,6 +2791,62 @@ void drm_edid_get_product_id(const struct drm_edid *drm_edid,
> }
> EXPORT_SYMBOL(drm_edid_get_product_id);
>
> +static bool displayid_is_product_id_block(const struct displayid_iter *iter,
> + const struct displayid_block *block)
> +{
> + return (displayid_version(iter) < DISPLAY_ID_STRUCTURE_VER_20 &&
> + block->tag == DATA_BLOCK_PRODUCT_ID) ||
> + (displayid_version(iter) == DISPLAY_ID_STRUCTURE_VER_20 &&
> + block->tag == DATA_BLOCK_2_PRODUCT_ID);
> +}
The r-b still stands, and let's not block this series as they're
fixes. But I think this will be cleaner with [1]. I can rebase later.
[1] https://lore.kernel.org/r/2a6f7a494a37cbdc3f438c71435224ff5e978df8.1796136101.git.jani.nikula@intel.com
> +
> +/**
> + * drm_edid_get_displayid_product_id - Get the vendor and product identification from DisplayID
> + * @drm_edid: EDID
> + * @id: Where to place the product id
> + *
> + * Return: Zero on success, or a negative errno code otherwise.
> + */
> +int drm_edid_get_displayid_product_id(const struct drm_edid *drm_edid,
> + struct drm_displayid_product_id *id)
> +{
> + const struct displayid_block *block;
> + struct displayid_iter iter;
> + int ret = -ENOENT;
> +
> + memset(id, 0, sizeof(*id));
> +
> + if (!drm_edid)
> + return -EINVAL;
> +
> + displayid_iter_edid_begin(drm_edid, &iter);
> + displayid_iter_for_each(block, &iter) {
> + const struct displayid_product_id_block *prod_id =
> + (struct displayid_product_id_block *)block;
Ditto [2].
[2] https://lore.kernel.org/r/83a63743366ac41a2ed947b9d72f884b439a40be.1796136101.git.jani.nikula@intel.com
> +
> + if (!displayid_is_product_id_block(&iter, block))
> + continue;
> +
> + if (block->num_bytes < sizeof(*prod_id) - sizeof(prod_id->base))
> + continue;
> +
> + id->vendor_id[0] = prod_id->vendor_id[0];
> + id->vendor_id[1] = prod_id->vendor_id[1];
> + id->vendor_id[2] = prod_id->vendor_id[2];
> + id->product_code = prod_id->product_code;
> + id->serial_number = prod_id->serial_number;
> + id->week_of_manufacture = prod_id->week_of_manufacture;
> + id->year_of_manufacture = prod_id->year_of_manufacture;
> +
> + ret = 0;
> + break;
> + }
> + displayid_iter_end(&iter);
> +
> + return ret;
> +}
> +EXPORT_SYMBOL(drm_edid_get_displayid_product_id);
> +
> static void decode_date(struct seq_buf *s, const struct drm_edid_product_id *id)
> {
> int week = id->week_of_manufacture;
> diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
> index a2617aa34edf..a4e5366b53ad 100644
> --- a/include/drm/drm_edid.h
> +++ b/include/drm/drm_edid.h
> @@ -288,6 +288,14 @@ struct drm_edid_product_id {
> u8 year_of_manufacture;
> } __packed;
>
> +struct drm_displayid_product_id {
> + u8 vendor_id[3];
> + __le16 product_code;
> + __le32 serial_number;
> + u8 week_of_manufacture;
> + u8 year_of_manufacture;
> +} __packed;
> +
> struct edid {
> u8 header[8];
> /* Vendor & product info */
> @@ -484,6 +492,8 @@ 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_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,
> const struct drm_edid_product_id *id, bool raw);
> u32 drm_edid_get_panel_id(const struct drm_edid *drm_edid);
--
Jani Nikula, Intel
next prev parent reply other threads:[~2026-12-02 9:48 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 [this message]
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
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=bf6d910c32898f8c721e41a780328274bbf06e16@intel.com \
--to=jani.nikula@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.