dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Hsin-Yi Wang <hsinyi@chromium.org>,
	Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
	Douglas Anderson <dianders@chromium.org>
Cc: 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 v4 3/5] drm/edid: Match edid quirks with identity
Date: Wed, 06 Mar 2024 11:18:26 +0200	[thread overview]
Message-ID: <87plw7zpjx.fsf@intel.com> (raw)
In-Reply-To: <20240306004347.974304-4-hsinyi@chromium.org>

On Tue, 05 Mar 2024, Hsin-Yi Wang <hsinyi@chromium.org> wrote:
> Currently edid quirks are matched by panel id only.
>
> Modify it to match with identity so it's easier to be extended
> for more complex matching if required.
>
> Suggested-by: Jani Nikula <jani.nikula@linux.intel.com>
> Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>

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

> ---
> v4: new
> Per discussion https://lore.kernel.org/lkml/87a5nd4tsg.fsf@intel.com/
> ---
>  drivers/gpu/drm/drm_edid.c | 13 ++++++++-----
>  1 file changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 5e7e69e0e345..93a49b262dbe 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -114,13 +114,15 @@ struct drm_edid_ident_closure {
>  
>  #define EDID_QUIRK(vend_chr_0, vend_chr_1, vend_chr_2, product_id, _quirks) \
>  { \
> -	.panel_id = drm_edid_encode_panel_id(vend_chr_0, vend_chr_1, vend_chr_2, \
> -					     product_id), \
> +	.ident = { \
> +		.panel_id = drm_edid_encode_panel_id(vend_chr_0, vend_chr_1, \
> +						     vend_chr_2, product_id), \
> +	}, \
>  	.quirks = _quirks \
>  }
>  
>  static const struct edid_quirk {
> -	u32 panel_id;
> +	const struct drm_edid_ident ident;
>  	u32 quirks;
>  } edid_quirk_list[] = {
>  	/* Acer AL1706 */
> @@ -2921,16 +2923,17 @@ EXPORT_SYMBOL(drm_edid_duplicate);
>   * @drm_edid: EDID to process
>   *
>   * This tells subsequent routines what fixes they need to apply.
> + *
> + * Return: A u32 represents the quirks to apply.
>   */
>  static u32 edid_get_quirks(const struct drm_edid *drm_edid)
>  {
> -	u32 panel_id = edid_extract_panel_id(drm_edid->edid);
>  	const struct edid_quirk *quirk;
>  	int i;
>  
>  	for (i = 0; i < ARRAY_SIZE(edid_quirk_list); i++) {
>  		quirk = &edid_quirk_list[i];
> -		if (quirk->panel_id == panel_id)
> +		if (drm_edid_match_identity(drm_edid, &quirk->ident))
>  			return quirk->quirks;
>  	}

-- 
Jani Nikula, Intel

  reply	other threads:[~2024-03-06  9:18 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-06  0:34 [PATCH v4 0/5] Match panel with identity Hsin-Yi Wang
2024-03-06  0:34 ` [PATCH v4 1/5] drm_edid: Add a function to get EDID base block Hsin-Yi Wang
2024-03-06  8:43   ` Jani Nikula
2024-03-06  0:34 ` [PATCH v4 2/5] drm/edid: Add a function to match EDID with identity Hsin-Yi Wang
2024-03-06  9:16   ` Jani Nikula
2024-03-06 19:08     ` Hsin-Yi Wang
2024-03-06  0:34 ` [PATCH v4 3/5] drm/edid: Match edid quirks " Hsin-Yi Wang
2024-03-06  9:18   ` Jani Nikula [this message]
2024-03-06  0:34 ` [PATCH v4 4/5] drm/panel-edp: Match edp_panels with panel identity Hsin-Yi Wang
2024-03-06  9:23   ` Jani Nikula
2024-03-06 18:48     ` Hsin-Yi Wang
2024-03-06  0:34 ` [PATCH v4 5/5] drm/panel-edp: Fix AUO 0x405c panel naming and add a variant Hsin-Yi Wang

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=87plw7zpjx.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).