Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: Jani Nikula <jani.nikula@intel.com>, dri-devel@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Subject: Re: [REBASE 5/7] drm/edid: avoid drm_edid_find_extension() internally
Date: Tue, 16 Apr 2024 14:19:05 +0200	[thread overview]
Message-ID: <fb57c317-25ec-4001-abb4-cb52b0aff741@suse.de> (raw)
In-Reply-To: <9fa366147b06a28304527be48f1b363c3484c8a3.1713259151.git.jani.nikula@intel.com>

Hi

Am 16.04.24 um 11:19 schrieb Jani Nikula:
> Prefer the EDID iterators over drm_edid_find_extension() in
> drm_edid_has_cta_extension(), even if this leads to more code. The key
> is to use the same patterns as much as possible.

Should this patch go before patch 4? That would limit the impact of the 
latter.

Why is this instance different than the one in 
drm_find_displayid_extension()? Best regards Thomas
>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>   drivers/gpu/drm/drm_edid.c | 14 ++++++++++++--
>   1 file changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index c29f31dcc818..4b3ad42a8f95 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -4230,11 +4230,21 @@ static bool drm_edid_has_cta_extension(const struct drm_edid *drm_edid)
>   {
>   	const struct displayid_block *block;
>   	struct displayid_iter iter;
> -	int ext_index = 0;
> +	struct drm_edid_iter edid_iter;
> +	const u8 *ext;
>   	bool found = false;
>   
>   	/* Look for a top level CEA extension block */
> -	if (drm_edid_find_extension(drm_edid, CEA_EXT, &ext_index))
> +	drm_edid_iter_begin(drm_edid, &edid_iter);
> +	drm_edid_iter_for_each(ext, &edid_iter) {
> +		if (ext[0] == CEA_EXT) {
> +			found = true;
> +			break;
> +		}
> +	}
> +	drm_edid_iter_end(&edid_iter);
> +
> +	if (found)
>   		return true;
>   
>   	/* CEA blocks can also be found embedded in a DisplayID block */

-- 
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)


  reply	other threads:[~2024-04-16 12:19 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-16  9:19 [REBASE 0/7] drm/edid: cleanups, rebase Jani Nikula
2024-04-16  9:19 ` [REBASE 1/7] drm/displayid: move drm_displayid.h to drm_displayd_internal.h Jani Nikula
2024-04-16  9:19 ` [REBASE 2/7] drm/edid: move all internal declarations to drm_crtc_internal.h Jani Nikula
2024-04-16  9:19 ` [REBASE 3/7] drm/edid: group struct drm_edid based declarations together Jani Nikula
2024-04-16  9:19 ` [REBASE 4/7] drm/edid: rename drm_find_edid_extension() to drm_edid_find_extension() Jani Nikula
2024-04-16  9:19 ` [REBASE 5/7] drm/edid: avoid drm_edid_find_extension() internally Jani Nikula
2024-04-16 12:19   ` Thomas Zimmermann [this message]
2024-04-16 12:24     ` Jani Nikula
2024-04-16  9:19 ` [REBASE 6/7] drm/edid: make drm_edid_are_equal() static Jani Nikula
2024-04-16  9:20 ` [REBASE 7/7] drm/edid: make drm_edid_are_equal() more convenient for its single user Jani Nikula
2024-04-16 12:21   ` Thomas Zimmermann
2024-04-16 12:27     ` Jani Nikula
2024-04-16 12:47       ` Thomas Zimmermann
2024-04-17  8:21         ` Jani Nikula
2024-04-17 11:13           ` Thomas Zimmermann
2024-04-17 15:20             ` Jani Nikula
2024-04-16 10:13 ` ✗ Fi.CI.CHECKPATCH: warning for drm/edid: cleanups, rebase Patchwork
2024-04-16 10:13 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-04-16 10:21 ` ✗ Fi.CI.BAT: 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=fb57c317-25ec-4001-abb4-cb52b0aff741@suse.de \
    --to=tzimmermann@suse.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jani.nikula@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox