intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Paulo Zanoni <paulo.r.zanoni@intel.com>
To: "Pandiyan, Dhinakaran" <dhinakaran.pandiyan@intel.com>
Cc: "intel-gfx@lists.freedesktop.org" <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH] drm/i915: simplify intel_ddi_pll_select()
Date: Wed, 22 Mar 2017 14:33:31 -0300	[thread overview]
Message-ID: <1490204011.25640.1.camel@intel.com> (raw)
In-Reply-To: <1490138651.13532.11.camel@dk-H97M-D3H>

Em Ter, 2017-03-21 às 23:05 +0000, Pandiyan, Dhinakaran escreveu:
> On Tue, 2017-03-21 at 18:57 -0300, Paulo Zanoni wrote:
> > 
> > Because {hsw,skl,bxt}_ddi_pll_select all pretty much do the same
> > thing
> > in slightly different ways. Replace everything with a simple copy
> > of
> > the function and inline it inside intle_ddi_pll_select().
> > 
> > Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_ddi.c | 58 +++++-----------------------
> > ------------
> >  1 file changed, 7 insertions(+), 51 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_ddi.c
> > b/drivers/gpu/drm/i915/intel_ddi.c
> > index d8214ba..bd6fd0b 100644
> > --- a/drivers/gpu/drm/i915/intel_ddi.c
> > +++ b/drivers/gpu/drm/i915/intel_ddi.c
> > @@ -1127,47 +1127,6 @@ void intel_ddi_clock_get(struct
> > intel_encoder *encoder,
> >  		bxt_ddi_clock_get(encoder, pipe_config);
> >  }
> >  
> > -static bool
> > -hsw_ddi_pll_select(struct intel_crtc *intel_crtc,
> > -		   struct intel_crtc_state *crtc_state,
> > -		   struct intel_encoder *encoder)
> > -{
> > -	struct intel_shared_dpll *pll;
> > -
> > -	pll = intel_get_shared_dpll(intel_crtc, crtc_state,
> > -				    encoder);
> 
> I have a related question, not a patch review :) Looks like we care
> only
> about the boolean returned from intel_get_shared_dpll(). Could not
> find
> any caller that uses the returned 'struct intel_shared_dpll *'.
> Should
> it's signature be simply changed to return a bool? 

There are only two callers. It would be possible to change the
signature, although I don't see many benefits from doing it now.

Perhaps it would be better to unify the error handling.

> 
> -DK
> > 
> > -	if (!pll)
> > -		DRM_DEBUG_DRIVER("failed to find PLL for pipe
> > %c\n",
> > -				 pipe_name(intel_crtc->pipe));
> > -
> > -	return pll;
> > -}
> > -
> > -static bool
> > -skl_ddi_pll_select(struct intel_crtc *intel_crtc,
> > -		   struct intel_crtc_state *crtc_state,
> > -		   struct intel_encoder *encoder)
> > -{
> > -	struct intel_shared_dpll *pll;
> > -
> > -	pll = intel_get_shared_dpll(intel_crtc, crtc_state,
> > encoder);
> > -	if (pll == NULL) {
> > -		DRM_DEBUG_DRIVER("failed to find PLL for pipe
> > %c\n",
> > -				 pipe_name(intel_crtc->pipe));
> > -		return false;
> > -	}
> > -
> > -	return true;
> > -}
> > -
> > -static bool
> > -bxt_ddi_pll_select(struct intel_crtc *intel_crtc,
> > -		   struct intel_crtc_state *crtc_state,
> > -		   struct intel_encoder *encoder)
> > -{
> > -	return !!intel_get_shared_dpll(intel_crtc, crtc_state,
> > encoder);
> > -}
> > -
> >  /*
> >   * Tries to find a *shared* PLL for the CRTC and store it in
> >   * intel_crtc->ddi_pll_sel.
> > @@ -1178,19 +1137,16 @@ bxt_ddi_pll_select(struct intel_crtc
> > *intel_crtc,
> >  bool intel_ddi_pll_select(struct intel_crtc *intel_crtc,
> >  			  struct intel_crtc_state *crtc_state)
> >  {
> > -	struct drm_i915_private *dev_priv = to_i915(intel_crtc-
> > >base.dev);
> >  	struct intel_encoder *encoder =
> >  		intel_ddi_get_crtc_new_encoder(crtc_state);
> > +	struct intel_shared_dpll *pll;
> >  
> > -	if (IS_GEN9_BC(dev_priv))
> > -		return skl_ddi_pll_select(intel_crtc, crtc_state,
> > -					  encoder);
> > -	else if (IS_GEN9_LP(dev_priv))
> > -		return bxt_ddi_pll_select(intel_crtc, crtc_state,
> > -					  encoder);
> > -	else
> > -		return hsw_ddi_pll_select(intel_crtc, crtc_state,
> > -					  encoder);
> > +	pll = intel_get_shared_dpll(intel_crtc, crtc_state,
> > encoder);
> > +	if (!pll)
> > +		DRM_DEBUG_DRIVER("failed to find PLL for pipe
> > %c\n",
> > +				  pipe_name(intel_crtc->pipe));
> > +
> > +	return pll;
> >  }
> >  
> >  void intel_ddi_set_pipe_settings(const struct intel_crtc_state
> > *crtc_state)
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-03-22 17:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-21 21:57 [PATCH] drm/i915: simplify intel_ddi_pll_select() Paulo Zanoni
2017-03-21 22:16 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-03-21 23:05 ` [PATCH] " Pandiyan, Dhinakaran
2017-03-22 17:33   ` Paulo Zanoni [this message]
2017-03-22 13:21 ` Ville Syrjälä
2017-03-22 17:40   ` Paulo Zanoni
2017-03-22 17:50     ` Ville Syrjälä
2017-03-22 18:58       ` [PATCH 1/2] " Paulo Zanoni
2017-03-22 18:58         ` [PATCH 2/2] drm/i915: kill intel_ddi_pll_select() Paulo Zanoni
2017-03-22 19:26           ` Ville Syrjälä

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=1490204011.25640.1.camel@intel.com \
    --to=paulo.r.zanoni@intel.com \
    --cc=dhinakaran.pandiyan@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /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;
as well as URLs for NNTP newsgroup(s).