All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: Chenyu Chen <chen-yu.chen@amd.com>,
	amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Cc: Harry Wentland <harry.wentland@amd.com>,
	Leo Li <sunpeng.li@amd.com>, Ray Wu <Ray.Wu@amd.com>,
	Limonciello Mario <Mario.Limonciello@amd.com>,
	Chenyu Chen <chen-yu.chen@amd.com>
Subject: Re: [PATCH v3 1/3] drm/edid: extract base section header processing into helper
Date: Fri, 26 Jun 2026 18:44:46 +0300	[thread overview]
Message-ID: <e559162c1eecf91493623fdc546262e9391c0821@intel.com> (raw)
In-Reply-To: <20260526030254.1460480-2-chen-yu.chen@amd.com>

On Tue, 26 May 2026, Chenyu Chen <chen-yu.chen@amd.com> wrote:
> Extract the DisplayID base section header logging and non_desktop
> detection from update_displayid_info() into a dedicated helper,
> drm_displayid_process_base_section_header(). Remove the break so the
> iterator walks through all data blocks, preparing for future patches
> that will parse additional block types within the loop.
>
> The helper is called only once for the base section via a
> base_section_header_processed flag. Since version and primary_use are
> only captured from the base section, and extension sections carry a
> primary use of zero per spec, the non_desktop logic is unaffected.
>
> No functional change.
>
> Assisted-by: Copilot:Claude-Opus-4.6
> Signed-off-by: Chenyu Chen <chen-yu.chen@amd.com>

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

> ---
>  drivers/gpu/drm/drm_edid.c | 37 +++++++++++++++++++++----------------
>  1 file changed, 21 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 8031f021d4d0..7ad3f939dbe6 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -6715,30 +6715,35 @@ static void drm_reset_display_info(struct drm_connector *connector)
>  	memset(&info->amd_vsdb, 0, sizeof(info->amd_vsdb));
>  }
>  
> +static void drm_displayid_process_base_section_header(struct drm_connector *connector,
> +						      const struct displayid_iter *iter)
> +{
> +	struct drm_display_info *info = &connector->display_info;
> +
> +	drm_dbg_kms(connector->dev,
> +		    "[CONNECTOR:%d:%s] DisplayID extension version 0x%02x, primary use 0x%02x\n",
> +		    connector->base.id, connector->name,
> +		    displayid_version(iter),
> +		    displayid_primary_use(iter));
> +	if (displayid_version(iter) == DISPLAY_ID_STRUCTURE_VER_20 &&
> +	    (displayid_primary_use(iter) == PRIMARY_USE_HEAD_MOUNTED_VR ||
> +	     displayid_primary_use(iter) == PRIMARY_USE_HEAD_MOUNTED_AR))
> +		info->non_desktop = true;
> +}
> +
>  static void update_displayid_info(struct drm_connector *connector,
>  				  const struct drm_edid *drm_edid)
>  {
> -	struct drm_display_info *info = &connector->display_info;
>  	const struct displayid_block *block;
>  	struct displayid_iter iter;
> +	bool base_section_header_processed = false;
>  
>  	displayid_iter_edid_begin(drm_edid, &iter);
>  	displayid_iter_for_each(block, &iter) {
> -		drm_dbg_kms(connector->dev,
> -			    "[CONNECTOR:%d:%s] DisplayID extension version 0x%02x, primary use 0x%02x\n",
> -			    connector->base.id, connector->name,
> -			    displayid_version(&iter),
> -			    displayid_primary_use(&iter));
> -		if (displayid_version(&iter) == DISPLAY_ID_STRUCTURE_VER_20 &&
> -		    (displayid_primary_use(&iter) == PRIMARY_USE_HEAD_MOUNTED_VR ||
> -		     displayid_primary_use(&iter) == PRIMARY_USE_HEAD_MOUNTED_AR))
> -			info->non_desktop = true;
> -
> -		/*
> -		 * We're only interested in the base section here, no need to
> -		 * iterate further.
> -		 */
> -		break;
> +		if (!base_section_header_processed) {
> +			drm_displayid_process_base_section_header(connector, &iter);
> +			base_section_header_processed = true;
> +		}
>  	}
>  	displayid_iter_end(&iter);
>  }

-- 
Jani Nikula, Intel

  parent reply	other threads:[~2026-06-26 15:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-26  2:59 [PATCH v3 0/3] drm: detect panel type from DisplayID 2.x Chenyu Chen
2026-05-26  2:59 ` [PATCH v3 1/3] drm/edid: extract base section header processing into helper Chenyu Chen
2026-05-26  3:09   ` Chen, Chen-Yu
2026-05-28  8:51   ` Chen, Chen-Yu
2026-06-26 15:44   ` Jani Nikula [this message]
2026-05-26  2:59 ` [PATCH v3 2/3] drm/edid: parse panel type from DisplayID 2.x Display Parameters Chenyu Chen
2026-05-26  3:09   ` Chen, Chen-Yu
2026-06-26 15:55   ` Jani Nikula
2026-05-26  2:59 ` [PATCH v3 3/3] drm/amd/display: use DisplayID panel type in dm_set_panel_type Chenyu Chen
2026-05-26  3:09   ` Chen, Chen-Yu

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=e559162c1eecf91493623fdc546262e9391c0821@intel.com \
    --to=jani.nikula@intel.com \
    --cc=Mario.Limonciello@amd.com \
    --cc=Ray.Wu@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=chen-yu.chen@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=harry.wentland@amd.com \
    --cc=sunpeng.li@amd.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.