All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 3/3] drm/i915: Collect aux ch vfunc setup into intel_dp_aux_init()
Date: Tue, 20 Feb 2018 11:35:56 -0800	[thread overview]
Message-ID: <20180220193556.GF27433@intel.com> (raw)
In-Reply-To: <20180220170524.12303-3-ville.syrjala@linux.intel.com>

On Tue, Feb 20, 2018 at 07:05:24PM +0200, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Collect all the aux ch vfunc assignments into intel_dp_aux_init()
> instead of having it spread around.

Makes sense and seems cleaner and right.

> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

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


> ---
>  drivers/gpu/drm/i915/intel_dp.c | 53 +++++++++++++++++++----------------------
>  1 file changed, 24 insertions(+), 29 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index ea414766f82b..005735a7fc29 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -1500,9 +1500,20 @@ static i915_reg_t skl_aux_data_reg(struct intel_dp *intel_dp, int index)
>  	}
>  }
>  
> -static void intel_aux_reg_init(struct intel_dp *intel_dp)
> +static void
> +intel_dp_aux_fini(struct intel_dp *intel_dp)
> +{
> +	kfree(intel_dp->aux.name);
> +}
> +
> +static void
> +intel_dp_aux_init(struct intel_dp *intel_dp)
>  {
>  	struct drm_i915_private *dev_priv = to_i915(intel_dp_to_dev(intel_dp));
> +	struct intel_encoder *encoder = &dp_to_dig_port(intel_dp)->base;
> +
> +	intel_dp->aux_ch = intel_aux_ch(intel_dp);
> +	intel_dp->aux_power_domain = intel_aux_power_domain(intel_dp);
>  
>  	if (INTEL_GEN(dev_priv) >= 9) {
>  		intel_dp->aux_ch_ctl_reg = skl_aux_ctl_reg;
> @@ -1514,23 +1525,21 @@ static void intel_aux_reg_init(struct intel_dp *intel_dp)
>  		intel_dp->aux_ch_ctl_reg = g4x_aux_ctl_reg;
>  		intel_dp->aux_ch_data_reg = g4x_aux_data_reg;
>  	}
> -}
>  
> -static void
> -intel_dp_aux_fini(struct intel_dp *intel_dp)
> -{
> -	kfree(intel_dp->aux.name);
> -}
> -
> -static void
> -intel_dp_aux_init(struct intel_dp *intel_dp)
> -{
> -	struct intel_encoder *encoder = &dp_to_dig_port(intel_dp)->base;
> +	if (INTEL_GEN(dev_priv) >= 9)
> +		intel_dp->get_aux_clock_divider = skl_get_aux_clock_divider;
> +	else if (IS_BROADWELL(dev_priv) || IS_HASWELL(dev_priv))
> +		intel_dp->get_aux_clock_divider = hsw_get_aux_clock_divider;
> +	else if (HAS_PCH_SPLIT(dev_priv))
> +		intel_dp->get_aux_clock_divider = ilk_get_aux_clock_divider;
> +	else
> +		intel_dp->get_aux_clock_divider = g4x_get_aux_clock_divider;
>  
> -	intel_dp->aux_ch = intel_aux_ch(intel_dp);
> -	intel_dp->aux_power_domain = intel_aux_power_domain(intel_dp);
> +	if (INTEL_GEN(dev_priv) >= 9)
> +		intel_dp->get_aux_send_ctl = skl_get_aux_send_ctl;
> +	else
> +		intel_dp->get_aux_send_ctl = g4x_get_aux_send_ctl;
>  
> -	intel_aux_reg_init(intel_dp);
>  	drm_dp_aux_init(&intel_dp->aux);
>  
>  	/* Failure to allocate our preferred name is not critical */
> @@ -6338,20 +6347,6 @@ intel_dp_init_connector(struct intel_digital_port *intel_dig_port,
>  	intel_dp->active_pipe = INVALID_PIPE;
>  
>  	/* intel_dp vfuncs */
> -	if (INTEL_GEN(dev_priv) >= 9)
> -		intel_dp->get_aux_clock_divider = skl_get_aux_clock_divider;
> -	else if (IS_HASWELL(dev_priv) || IS_BROADWELL(dev_priv))
> -		intel_dp->get_aux_clock_divider = hsw_get_aux_clock_divider;
> -	else if (HAS_PCH_SPLIT(dev_priv))
> -		intel_dp->get_aux_clock_divider = ilk_get_aux_clock_divider;
> -	else
> -		intel_dp->get_aux_clock_divider = g4x_get_aux_clock_divider;
> -
> -	if (INTEL_GEN(dev_priv) >= 9)
> -		intel_dp->get_aux_send_ctl = skl_get_aux_send_ctl;
> -	else
> -		intel_dp->get_aux_send_ctl = g4x_get_aux_send_ctl;
> -
>  	if (HAS_DDI(dev_priv))
>  		intel_dp->prepare_link_retrain = intel_ddi_prepare_link_retrain;
>  
> -- 
> 2.13.6
> 
> _______________________________________________
> 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

  parent reply	other threads:[~2018-02-20 19:35 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-20 17:05 [PATCH 1/3] drm/i915: Add enum aux_ch and clean up the aux init to use it Ville Syrjala
2018-02-20 17:05 ` [PATCH 2/3] drm/i915: Nuke aux regs from intel_dp Ville Syrjala
2018-02-20 17:30   ` Chris Wilson
2018-02-20 17:49     ` Ville Syrjälä
2018-02-20 17:57       ` Chris Wilson
2018-02-20 19:00   ` [PATCH v2 " Ville Syrjala
2018-02-22  7:16     ` Pandiyan, Dhinakaran
2018-02-22 12:43       ` Ville Syrjälä
2018-02-22 20:38         ` Pandiyan, Dhinakaran
2018-02-20 17:05 ` [PATCH 3/3] drm/i915: Collect aux ch vfunc setup into intel_dp_aux_init() Ville Syrjala
2018-02-20 17:25   ` Chris Wilson
2018-02-20 19:35   ` Rodrigo Vivi [this message]
2018-02-20 17:28 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/3] drm/i915: Add enum aux_ch and clean up the aux init to use it Patchwork
2018-02-20 17:43 ` ✓ Fi.CI.BAT: success " Patchwork
2018-02-20 17:47 ` [PATCH 1/3] " Chris Wilson
2018-02-20 19:31 ` Rodrigo Vivi
2018-02-22  7:25   ` Pandiyan, Dhinakaran
2018-02-22 12:48     ` Ville Syrjälä
2018-02-22 16:29   ` Ville Syrjälä
2018-02-22  6:12 ` Pandiyan, Dhinakaran

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=20180220193556.GF27433@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=ville.syrjala@linux.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.