public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Nautiyal, Ankit K" <ankit.k.nautiyal@intel.com>
To: Jani Nikula <jani.nikula@intel.com>, <intel-gfx@lists.freedesktop.org>
Cc: <jose.souza@intel.com>
Subject: Re: [Intel-gfx] [PATCH v2 1/7] drm/i915/bios: use hdmi level shift directly from child data
Date: Fri, 3 Sep 2021 14:07:08 +0530	[thread overview]
Message-ID: <7002fa19-4846-672a-4790-a7368980efb6@intel.com> (raw)
In-Reply-To: <ef22e40b01eab571ff0dc2bfffabb906d0151fb4.1630512523.git.jani.nikula@intel.com>

LGTM.

Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>

On 9/1/2021 9:39 PM, Jani Nikula wrote:
> Avoid extra caching of the data.
>
> Cc: José Roberto de Souza <jose.souza@intel.com>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>   drivers/gpu/drm/i915/display/intel_bios.c | 26 +++++++++++++----------
>   drivers/gpu/drm/i915/i915_drv.h           |  4 ----
>   2 files changed, 15 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c
> index e86e6ed2d3bf..afb5fcd9dd0c 100644
> --- a/drivers/gpu/drm/i915/display/intel_bios.c
> +++ b/drivers/gpu/drm/i915/display/intel_bios.c
> @@ -1868,6 +1868,14 @@ intel_bios_encoder_supports_edp(const struct intel_bios_encoder_data *devdata)
>   		devdata->child.device_type & DEVICE_TYPE_INTERNAL_CONNECTOR;
>   }
>   
> +static int _intel_bios_hdmi_level_shift(const struct intel_bios_encoder_data *devdata)
> +{
> +	if (!devdata || devdata->i915->vbt.version < 158)
> +		return -1;
> +
> +	return devdata->child.hdmi_level_shifter_value;
> +}
> +
>   static bool is_port_valid(struct drm_i915_private *i915, enum port port)
>   {
>   	/*
> @@ -1887,7 +1895,7 @@ static void parse_ddi_port(struct drm_i915_private *i915,
>   	const struct child_device_config *child = &devdata->child;
>   	struct ddi_vbt_port_info *info;
>   	bool is_dvi, is_hdmi, is_dp, is_edp, is_crt, supports_typec_usb, supports_tbt;
> -	int dp_boost_level, hdmi_boost_level;
> +	int dp_boost_level, hdmi_boost_level, hdmi_level_shift;
>   	enum port port;
>   
>   	port = dvo_port_to_port(i915, child->dvo_port);
> @@ -1949,15 +1957,11 @@ static void parse_ddi_port(struct drm_i915_private *i915,
>   		sanitize_aux_ch(i915, port);
>   	}
>   
> -	if (i915->vbt.version >= 158) {
> -		/* The VBT HDMI level shift values match the table we have. */
> -		u8 hdmi_level_shift = child->hdmi_level_shifter_value;
> +	hdmi_level_shift = _intel_bios_hdmi_level_shift(devdata);
> +	if (hdmi_level_shift >= 0) {
>   		drm_dbg_kms(&i915->drm,
>   			    "Port %c VBT HDMI level shift: %d\n",
> -			    port_name(port),
> -			    hdmi_level_shift);
> -		info->hdmi_level_shift = hdmi_level_shift;
> -		info->hdmi_level_shift_set = true;
> +			    port_name(port), hdmi_level_shift);
>   	}
>   
>   	if (i915->vbt.version >= 204) {
> @@ -2950,13 +2954,13 @@ int intel_bios_max_tmds_clock(struct intel_encoder *encoder)
>   	return i915->vbt.ddi_port_info[encoder->port].max_tmds_clock;
>   }
>   
> +/* This is an index in the HDMI/DVI DDI buffer translation table, or -1 */
>   int intel_bios_hdmi_level_shift(struct intel_encoder *encoder)
>   {
>   	struct drm_i915_private *i915 = to_i915(encoder->base.dev);
> -	const struct ddi_vbt_port_info *info =
> -		&i915->vbt.ddi_port_info[encoder->port];
> +	const struct intel_bios_encoder_data *devdata = i915->vbt.ddi_port_info[encoder->port].devdata;
>   
> -	return info->hdmi_level_shift_set ? info->hdmi_level_shift : -1;
> +	return _intel_bios_hdmi_level_shift(devdata);
>   }
>   
>   int intel_bios_encoder_dp_boost_level(const struct intel_bios_encoder_data *devdata)
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index be2392bbcecc..67a9f07550d4 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -641,10 +641,6 @@ struct ddi_vbt_port_info {
>   
>   	int max_tmds_clock;
>   
> -	/* This is an index in the HDMI/DVI DDI buffer translation table. */
> -	u8 hdmi_level_shift;
> -	u8 hdmi_level_shift_set:1;
> -
>   	u8 alternate_aux_channel;
>   	u8 alternate_ddc_pin;
>   

  reply	other threads:[~2021-09-03  8:37 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-01 16:09 [Intel-gfx] [PATCH v2 0/7] drm/i915/bios: remove vbt ddi_port_info caching Jani Nikula
2021-09-01 16:09 ` [Intel-gfx] [PATCH v2 1/7] drm/i915/bios: use hdmi level shift directly from child data Jani Nikula
2021-09-03  8:37   ` Nautiyal, Ankit K [this message]
2021-09-01 16:10 ` [Intel-gfx] [PATCH v2 2/7] drm/i915/bios: use max tmds clock " Jani Nikula
2021-09-03  8:38   ` Nautiyal, Ankit K
2021-09-01 16:10 ` [Intel-gfx] [PATCH v2 3/7] drm/i915/bios: use dp max link rate " Jani Nikula
2021-09-03  8:41   ` Nautiyal, Ankit K
2021-09-01 16:10 ` [Intel-gfx] [PATCH v2 4/7] drm/i915/bios: use alternate aux channel " Jani Nikula
2021-09-03  8:42   ` Nautiyal, Ankit K
2021-09-01 16:10 ` [Intel-gfx] [PATCH v2 5/7] drm/i915/bios: move ddc pin mapping code next to ddc pin sanitize Jani Nikula
2021-09-03  9:59   ` Nautiyal, Ankit K
2021-09-01 16:10 ` [Intel-gfx] [PATCH v2 6/7] drm/i915/bios: use ddc pin directly from child data Jani Nikula
2021-09-03 10:05   ` Nautiyal, Ankit K
2021-09-01 16:10 ` [Intel-gfx] [PATCH v2 7/7] drm/i915/bios: get rid of vbt ddi_port_info Jani Nikula
2021-09-03 10:05   ` Nautiyal, Ankit K
2021-09-01 18:02 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/bios: remove vbt ddi_port_info caching (rev2) Patchwork
2021-09-01 18:31 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-09-01 21:24 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2021-09-03 11:04 ` [Intel-gfx] [PATCH v2 0/7] drm/i915/bios: remove vbt ddi_port_info caching Jani Nikula
2021-09-03 20:21   ` Souza, Jose
2021-09-07  8:09     ` Jani Nikula

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=7002fa19-4846-672a-4790-a7368980efb6@intel.com \
    --to=ankit.k.nautiyal@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    --cc=jose.souza@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