lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87plw7zpjx.fsf@intel.com>
Date: Wed, 06 Mar 2024 11:18:26 +0200
From: Jani Nikula <jani.nikula@...ux.intel.com>
To: Hsin-Yi Wang <hsinyi@...omium.org>, Dmitry Baryshkov
 <dmitry.baryshkov@...aro.org>, Douglas Anderson <dianders@...omium.org>
Cc: Neil Armstrong <neil.armstrong@...aro.org>, Jessica Zhang
 <quic_jesszhan@...cinc.com>, Sam Ravnborg <sam@...nborg.org>, Maarten
 Lankhorst <maarten.lankhorst@...ux.intel.com>, Maxime Ripard
 <mripard@...nel.org>, Thomas Zimmermann <tzimmermann@...e.de>, David
 Airlie <airlied@...il.com>, Daniel Vetter <daniel@...ll.ch>,
 dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 3/5] drm/edid: Match edid quirks with identity

On Tue, 05 Mar 2024, Hsin-Yi Wang <hsinyi@...omium.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@...ux.intel.com>
> Signed-off-by: Hsin-Yi Wang <hsinyi@...omium.org>

Reviewed-by: Jani Nikula <jani.nikula@...el.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ