All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Mahesh Kumar <mahesh1.kumar@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/8] drm/i915/icl: create function to identify combophy port
Date: Wed, 3 Oct 2018 10:57:36 -0700	[thread overview]
Message-ID: <20181003175736.GE9811@intel.com> (raw)
In-Reply-To: <20181003072203.12848-2-mahesh1.kumar@intel.com>

On Wed, Oct 03, 2018 at 12:51:56PM +0530, Mahesh Kumar wrote:
> This patch creates a function/wrapper to check if port is combophy port
> instead of explicitly comparing ports.
> 
> Signed-off-by: Mahesh Kumar <mahesh1.kumar@intel.com>
> Cc: Madhav Chauhan <madhav.chauhan@intel.com>
> Cc: Manasi Navare <manasi.d.navare@intel.com>

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

> ---
>  drivers/gpu/drm/i915/intel_ddi.c     | 15 ++++++++-------
>  drivers/gpu/drm/i915/intel_display.c | 11 +++++++++++
>  drivers/gpu/drm/i915/intel_drv.h     |  1 +
>  3 files changed, 20 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
> index 7f34d3955ca1..b5b8dae06cde 100644
> --- a/drivers/gpu/drm/i915/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/intel_ddi.c
> @@ -916,7 +916,7 @@ static int intel_ddi_hdmi_level(struct drm_i915_private *dev_priv, enum port por
>  	level = dev_priv->vbt.ddi_port_info[port].hdmi_level_shift;
>  
>  	if (IS_ICELAKE(dev_priv)) {
> -		if (port == PORT_A || port == PORT_B)
> +		if (intel_port_is_combophy(dev_priv, port))
>  			icl_get_combo_buf_trans(dev_priv, port,
>  						INTEL_OUTPUT_HDMI, &n_entries);
>  		else
> @@ -1535,7 +1535,7 @@ static void icl_ddi_clock_get(struct intel_encoder *encoder,
>  	uint32_t pll_id;
>  
>  	pll_id = intel_get_shared_dpll_id(dev_priv, pipe_config->shared_dpll);
> -	if (port == PORT_A || port == PORT_B) {
> +	if (intel_port_is_combophy(dev_priv, port)) {
>  		if (intel_crtc_has_type(pipe_config, INTEL_OUTPUT_HDMI))
>  			link_clock = cnl_calc_wrpll_link(dev_priv, pll_id);
>  		else
> @@ -2235,7 +2235,7 @@ u8 intel_ddi_dp_voltage_max(struct intel_encoder *encoder)
>  	int n_entries;
>  
>  	if (IS_ICELAKE(dev_priv)) {
> -		if (port == PORT_A || port == PORT_B)
> +		if (intel_port_is_combophy(dev_priv, port))
>  			icl_get_combo_buf_trans(dev_priv, port, encoder->type,
>  						&n_entries);
>  		else
> @@ -2669,9 +2669,10 @@ static void icl_ddi_vswing_sequence(struct intel_encoder *encoder,
>  				    u32 level,
>  				    enum intel_output_type type)
>  {
> +	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
>  	enum port port = encoder->port;
>  
> -	if (port == PORT_A || port == PORT_B)
> +	if (intel_port_is_combophy(dev_priv, port))
>  		icl_combo_phy_ddi_vswing_sequence(encoder, level, type);
>  	else
>  		icl_mg_phy_ddi_vswing_sequence(encoder, link_clock, level);
> @@ -2757,7 +2758,7 @@ void icl_map_plls_to_ports(struct drm_crtc *crtc,
>  		val = I915_READ(DPCLKA_CFGCR0_ICL);
>  		WARN_ON((val & DPCLKA_CFGCR0_DDI_CLK_OFF(port)) == 0);
>  
> -		if (port == PORT_A || port == PORT_B) {
> +		if (intel_port_is_combophy(dev_priv, port)) {
>  			val &= ~DPCLKA_CFGCR0_DDI_CLK_SEL_MASK(port);
>  			val |= DPCLKA_CFGCR0_DDI_CLK_SEL(pll->info->id, port);
>  			I915_WRITE(DPCLKA_CFGCR0_ICL, val);
> @@ -2810,7 +2811,7 @@ static void intel_ddi_clk_select(struct intel_encoder *encoder,
>  	mutex_lock(&dev_priv->dpll_lock);
>  
>  	if (IS_ICELAKE(dev_priv)) {
> -		if (port >= PORT_C)
> +		if (!intel_port_is_combophy(dev_priv, port))
>  			I915_WRITE(DDI_CLK_SEL(port),
>  				   icl_pll_to_ddi_pll_sel(encoder, pll));
>  	} else if (IS_CANNONLAKE(dev_priv)) {
> @@ -2852,7 +2853,7 @@ static void intel_ddi_clk_disable(struct intel_encoder *encoder)
>  	enum port port = encoder->port;
>  
>  	if (IS_ICELAKE(dev_priv)) {
> -		if (port >= PORT_C)
> +		if (!intel_port_is_combophy(dev_priv, port))
>  			I915_WRITE(DDI_CLK_SEL(port), DDI_CLK_SEL_NONE);
>  	} else if (IS_CANNONLAKE(dev_priv)) {
>  		I915_WRITE(DPCLKA_CFGCR0, I915_READ(DPCLKA_CFGCR0) |
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 4c5c2b39e65c..916eb71e78ed 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -5947,6 +5947,17 @@ enum tc_port intel_port_to_tc(struct drm_i915_private *dev_priv, enum port port)
>  	return port - PORT_C;
>  }
>  
> +bool intel_port_is_combophy(struct drm_i915_private *dev_priv, enum port port)
> +{
> +	if (port == PORT_NONE)
> +		return false;
> +
> +	if (IS_ICELAKE(dev_priv))
> +		return (port <= PORT_B);
> +
> +	return false;
> +}
> +
>  enum intel_display_power_domain intel_port_to_power_domain(enum port port)
>  {
>  	switch (port) {
> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> index cbcae246d742..86567f26138b 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -1443,6 +1443,7 @@ void icl_map_plls_to_ports(struct drm_crtc *crtc,
>  void icl_unmap_plls_to_ports(struct drm_crtc *crtc,
>  			     struct intel_crtc_state *crtc_state,
>  			     struct drm_atomic_state *old_state);
> +bool intel_port_is_combophy(struct drm_i915_private *dev_priv, enum port port);
>  
>  unsigned int intel_fb_align_height(const struct drm_framebuffer *fb,
>  				   int color_plane, unsigned int height);
> -- 
> 2.16.2
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2018-10-03 18:01 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-03  7:21 [PATCH 0/8] Refactor and Add helper function for combophy/tc ports Mahesh Kumar
2018-10-03  7:21 ` [PATCH 1/8] drm/i915/icl: create function to identify combophy port Mahesh Kumar
2018-10-03 17:57   ` Rodrigo Vivi [this message]
2018-10-03 18:03   ` Lucas De Marchi
2018-10-04  8:50     ` [PATCH v2 " Mahesh Kumar
2018-10-04 20:00       ` Lucas De Marchi
2018-10-15 21:58   ` [PATCH " Manasi Navare
2018-10-03  7:21 ` [PATCH 2/8] drm/i915/icl: use combophy/TC helper functions during display detection Mahesh Kumar
2018-10-03 17:58   ` Rodrigo Vivi
2018-10-04 21:16   ` Lucas De Marchi
2018-10-03  7:21 ` [PATCH 3/8] drm/i915/icl: Refactor get_ddi_pll using helper func Mahesh Kumar
2018-10-04 21:18   ` Lucas De Marchi
2018-10-03  7:21 ` [PATCH 4/8] drm/i915/icl: Use helper functions to classify the ports Mahesh Kumar
2018-10-03 17:59   ` Rodrigo Vivi
2018-10-04 21:21   ` Lucas De Marchi
2018-10-03  7:22 ` [PATCH 5/8] drm/i915/icl: Refactor icl pll functions Mahesh Kumar
2018-10-04 21:24   ` Lucas De Marchi
2018-10-03  7:22 ` [PATCH 6/8] drm/i915/icl: Combine all port/combophy macros at one place Mahesh Kumar
2018-10-12 22:09   ` Rodrigo Vivi
2018-10-12 23:47     ` [PATCH v2] " Lucas De Marchi
2018-10-03  7:22 ` [PATCH 7/8] drm/i915/icl: Introduce new macros to get combophy registers Mahesh Kumar
2018-10-12 22:25   ` Rodrigo Vivi
2018-10-12 22:58     ` Lucas De Marchi
2018-10-15 16:29       ` Rodrigo Vivi
2018-10-16  2:35         ` [PATCH v2] " Lucas De Marchi
2018-10-16 16:04           ` Rodrigo Vivi
2018-10-03  7:22 ` [PATCH 8/8] drm/i915/icl: Fix DDI/TC port clk_off bits Mahesh Kumar
2018-10-04 21:26   ` Lucas De Marchi
2018-10-16  2:37     ` [PATCH v2] " Lucas De Marchi
2018-10-03  7:35 ` ✗ Fi.CI.CHECKPATCH: warning for Refactor and Add helper function for combophy/tc ports Patchwork
2018-10-03  7:57 ` ✗ Fi.CI.BAT: failure " Patchwork
2018-10-03 13:51 ` ✓ Fi.CI.BAT: success " Patchwork
2018-10-03 23:15 ` ✓ Fi.CI.IGT: " Patchwork
2018-10-04  9:56 ` ✗ Fi.CI.CHECKPATCH: warning for Refactor and Add helper function for combophy/tc ports (rev2) Patchwork
2018-10-04 10:16 ` ✓ Fi.CI.BAT: success " Patchwork
2018-10-04 10:38 ` Patchwork
2018-10-04 16:36 ` ✓ Fi.CI.IGT: " Patchwork
2018-10-04 17:12 ` Patchwork
2018-10-12 23:57 ` ✗ Fi.CI.BAT: failure for Refactor and Add helper function for combophy/tc ports (rev3) Patchwork
2018-10-16  2:57 ` ✗ Fi.CI.CHECKPATCH: warning for Refactor and Add helper function for combophy/tc ports (rev5) Patchwork
2018-10-16  3:28 ` ✓ Fi.CI.BAT: success " Patchwork
2018-10-16  4:22 ` ✓ Fi.CI.IGT: " 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=20181003175736.GE9811@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=mahesh1.kumar@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 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.