All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: sashiko-reviews@lists.linux.dev
Cc: dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org,
	intel-xe@lists.freedesktop.org
Subject: Re: [PATCH 2/2] drm/i915/bios: Attempt to match the VBT PnP ID against DisplayID first
Date: Wed, 25 Nov 2026 01:06:36 +0200	[thread overview]
Message-ID: <awYYfMeH42kZGZh-@intel.com> (raw)
In-Reply-To: <sashiko-outbox-232179@kernel.org>

On Tue, Nov 24, 2026 at 10:56:48PM +0000, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential
> issue to consider:
> - [High] drm/i915/bios: false VBT match in
>   pnpid_displayid_get_panel_type()
> --
> 
> commit b621730b3ac12390341a723bfb91f30971b56f98
> Author: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> drm/i915/bios: Attempt to match the VBT PnP ID against DisplayID first
> 
> This commit attempts to match the VBT PnP ID against the DisplayID product ID
> block before falling back to the base EDID vendor/product ID.
> 
> > diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c
> > index 7b6a6f8c3cf19..8fbabf2e8b6f8 100644
> > --- a/drivers/gpu/drm/i915/display/intel_bios.c
> > +++ b/drivers/gpu/drm/i915/display/intel_bios.c
> [ ... ]
> > @@ -732,6 +727,48 @@ static int pnpid_get_panel_type(struct intel_display *display,
> >  	return best;
> >  }
> >  
> > +static int pnpid_edid_get_panel_type(struct intel_display *display,
> > +				     const struct intel_bios_encoder_data *devdata,
> > +				     const struct drm_edid *drm_edid, bool use_fallback)
> > +{
> > +	struct drm_edid_product_id product_id;
> > +
> > +	if (!drm_edid)
> > +		return -1;
> > +
> > +	drm_edid_get_product_id(drm_edid, &product_id);
> > +
> > +	return pnpid_get_panel_type(display, &product_id, "EDID");
> > +}
> > +
> > +static int pnpid_displayid_get_panel_type(struct intel_display *display,
> > +					  const struct intel_bios_encoder_data *devdata,
> > +					  const struct drm_edid *drm_edid, bool use_fallback)
> > +{
> > +	struct drm_displayid_product_id displayid_id;
> > +	struct drm_edid_product_id product_id;
> > +
> > +	if (!drm_edid)
> > +		return -1;
> > +
> > +	drm_displayid_get_product_id(drm_edid, &displayid_id);
> > +
> > +	/*
> > +	 * Only the first two bytes of the OUI get
> > +	 * smashed into the old EISA/PNPID field, and
> > +	 * that gets matched against what's in the VBT.
> > +	 */
> > +	product_id.manufacturer_name =
> > +		cpu_to_be16((displayid_id.vendor_id[0] << 8) |
> > +			    displayid_id.vendor_id[1]);
> > +	product_id.product_code = displayid_id.product_code;
> > +	product_id.serial_number = displayid_id.serial_number;
> > +	product_id.week_of_manufacture = displayid_id.week_of_manufacture;
> > +	product_id.year_of_manufacture = displayid_id.year_of_manufacture;
> > +
> > +	return pnpid_get_panel_type(display, &product_id, "DisplayID");
> > +}
> 
> [Severity: High]
> Can pnpid_displayid_get_panel_type() falsely match an unpopulated VBT PnP ID
> entry when the EDID has no DisplayID Product ID block?

I don't think we've ever seen an all zeroes pnpid in the VBT. But I
suppose I should have drm_displayid_get_product_id() return whether
it found something. It would at least prevent pnpid_get_panel_type()
from printing the all zeroes product ID into the log.

> 
> drm_displayid_get_product_id() zeroes displayid_id up front and leaves it
> zero-filled if no DisplayID Product ID block is present. Passing the resulting
> all-zero product_id into pnpid_get_panel_type() will match the first unused
> (all-zero) slot among the 16 entries in BDB_LFP_DATA, causing get_panel_type()
> to select that unpopulated VBT panel index via PANEL_TYPE_PNPID_DISPLAYID
> instead of falling back to PANEL_TYPE_PNPID_EDID.
> 
> -- 
> Sashiko AI review · https://sashiko.dev/#/patchset/20261124224621.6506-2-ville.syrjala@linux.intel.com?part=2

-- 
Ville Syrjälä
Intel

  reply	other threads:[~2026-11-24 23:07 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-24 22:46 [PATCH 0/2] drm/i915: Implement DisplayID based VBT panel type detection Ville Syrjala
2026-11-24 22:46 ` [PATCH 1/2] drm/edid: Introduce drm_edid_get_displayid_product_id() Ville Syrjala
2026-11-24 22:51   ` sashiko-bot
2026-11-24 23:02     ` Ville Syrjälä
2026-11-27 15:55       ` Jani Nikula
2026-11-27 15:45   ` Jani Nikula
2026-11-27 15:59   ` Jani Nikula
2026-11-24 22:46 ` [PATCH 2/2] drm/i915/bios: Attempt to match the VBT PnP ID against DisplayID first Ville Syrjala
2026-11-24 22:56   ` sashiko-bot
2026-11-24 23:06     ` Ville Syrjälä [this message]
2026-11-27 16:29   ` Jani Nikula
2026-11-27 16:55     ` Ville Syrjälä
2026-11-27 18:08       ` Jani Nikula
2026-11-25  0:13 ` ✗ CI.checkpatch: warning for drm/i915: Implement DisplayID based VBT panel type detection Patchwork
2026-11-25  0:16 ` ✓ CI.KUnit: success " Patchwork
2026-11-25  0:55 ` ✗ Xe.CI.BAT: failure " Patchwork
2026-11-25  4:05 ` ✗ Xe.CI.FULL: " Patchwork
2026-11-25  5:48 ` ✓ i915.CI.BAT: success " Patchwork
2026-11-26  2:23 ` ✓ i915.CI.Full: " 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=awYYfMeH42kZGZh-@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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.