diff mbox series

[v2,5/7] drm/i915: Get first crtc instead of PIPE_A crtc

Message ID 20200211172532.14287-6-anshuman.gupta@intel.com (mailing list archive)
State New, archived
Headers show
Series 3 display pipes combination system support | expand

Commit Message

Gupta, Anshuman Feb. 11, 2020, 5:25 p.m. UTC
intel_plane_fb_max_stride should return the max stride of
primary plane for first available pipe in intel device info
pipe_mask.
Similarly glk_force_audio_cdclk() should also use the first
available CRTC instead of pipe 'A' crtc to force the cdclk
changes.

changes since RFC:
- Introduced a helper to get first intel_crtc intel_get_first_crtc. [Ville]
v1:
- Used intel_get_first_crtc() instead of PIPE_A crtc in
  glk_force_audio_cdclk(). [Ville]

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
---
 drivers/gpu/drm/i915/display/intel_audio.c         | 2 +-
 drivers/gpu/drm/i915/display/intel_display.c       | 5 +++--
 drivers/gpu/drm/i915/display/intel_display_types.h | 6 ++++++
 3 files changed, 10 insertions(+), 3 deletions(-)

Comments

Gupta, Anshuman Feb. 17, 2020, 5:22 a.m. UTC | #1
On 2020-02-11 at 22:55:30 +0530, Anshuman Gupta wrote:
> intel_plane_fb_max_stride should return the max stride of
> primary plane for first available pipe in intel device info
> pipe_mask.
> Similarly glk_force_audio_cdclk() should also use the first
> available CRTC instead of pipe 'A' crtc to force the cdclk
> changes.
> 
> changes since RFC:
> - Introduced a helper to get first intel_crtc intel_get_first_crtc. [Ville]
> v1:
> - Used intel_get_first_crtc() instead of PIPE_A crtc in
>   glk_force_audio_cdclk(). [Ville]
Hi Ville,
You had provided your RB on earlier revision
https://patchwork.freedesktop.org/patch/351873/?series=72468&rev=2
later u have provided the above review comment, as current
patch fixes the above review comment.
can i use your RB for this patch, if current patch is ok.
Thanks,
Anshuman Gupta. 
> 
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_audio.c         | 2 +-
>  drivers/gpu/drm/i915/display/intel_display.c       | 5 +++--
>  drivers/gpu/drm/i915/display/intel_display_types.h | 6 ++++++
>  3 files changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_audio.c b/drivers/gpu/drm/i915/display/intel_audio.c
> index 30fb7c887ff0..19bf206037c2 100644
> --- a/drivers/gpu/drm/i915/display/intel_audio.c
> +++ b/drivers/gpu/drm/i915/display/intel_audio.c
> @@ -844,7 +844,7 @@ static void glk_force_audio_cdclk(struct drm_i915_private *dev_priv,
>  	struct intel_crtc *crtc;
>  	int ret;
>  
> -	crtc = intel_get_crtc_for_pipe(dev_priv, PIPE_A);
> +	crtc = intel_get_first_crtc(dev_priv);
>  	if (!crtc)
>  		return;
>  
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index 5ba0b40fbfde..6fdaeb019fef 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -2715,9 +2715,10 @@ u32 intel_plane_fb_max_stride(struct drm_i915_private *dev_priv,
>  
>  	/*
>  	 * We assume the primary plane for pipe A has
> -	 * the highest stride limits of them all.
> +	 * the highest stride limits of them all,
> +	 * if in case pipe A is disabled, use the first pipe from pipe_mask.
>  	 */
> -	crtc = intel_get_crtc_for_pipe(dev_priv, PIPE_A);
> +	crtc = intel_get_first_crtc(dev_priv);
>  	if (!crtc)
>  		return 0;
>  
> diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
> index d359f1636ba8..359eaa6703a8 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_types.h
> +++ b/drivers/gpu/drm/i915/display/intel_display_types.h
> @@ -1403,6 +1403,12 @@ vlv_pipe_to_channel(enum pipe pipe)
>  	}
>  }
>  
> +static inline struct intel_crtc *
> +intel_get_first_crtc(struct drm_i915_private *dev_priv)
> +{
> +	return to_intel_crtc(drm_crtc_from_index(&dev_priv->drm, 0));
> +}
> +
>  static inline struct intel_crtc *
>  intel_get_crtc_for_pipe(struct drm_i915_private *dev_priv, enum pipe pipe)
>  {
> -- 
> 2.24.0
>
Ville Syrjälä Feb. 17, 2020, 2:17 p.m. UTC | #2
On Mon, Feb 17, 2020 at 10:52:28AM +0530, Anshuman Gupta wrote:
> On 2020-02-11 at 22:55:30 +0530, Anshuman Gupta wrote:
> > intel_plane_fb_max_stride should return the max stride of
> > primary plane for first available pipe in intel device info
> > pipe_mask.
> > Similarly glk_force_audio_cdclk() should also use the first
> > available CRTC instead of pipe 'A' crtc to force the cdclk
> > changes.
> > 
> > changes since RFC:
> > - Introduced a helper to get first intel_crtc intel_get_first_crtc. [Ville]
> > v1:
> > - Used intel_get_first_crtc() instead of PIPE_A crtc in
> >   glk_force_audio_cdclk(). [Ville]
> Hi Ville,
> You had provided your RB on earlier revision
> https://patchwork.freedesktop.org/patch/351873/?series=72468&rev=2
> later u have provided the above review comment, as current
> patch fixes the above review comment.
> can i use your RB for this patch, if current patch is ok.

Yes, this patch looks ok.

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

> Thanks,
> Anshuman Gupta. 
> > 
> > Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
> > ---
> >  drivers/gpu/drm/i915/display/intel_audio.c         | 2 +-
> >  drivers/gpu/drm/i915/display/intel_display.c       | 5 +++--
> >  drivers/gpu/drm/i915/display/intel_display_types.h | 6 ++++++
> >  3 files changed, 10 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/display/intel_audio.c b/drivers/gpu/drm/i915/display/intel_audio.c
> > index 30fb7c887ff0..19bf206037c2 100644
> > --- a/drivers/gpu/drm/i915/display/intel_audio.c
> > +++ b/drivers/gpu/drm/i915/display/intel_audio.c
> > @@ -844,7 +844,7 @@ static void glk_force_audio_cdclk(struct drm_i915_private *dev_priv,
> >  	struct intel_crtc *crtc;
> >  	int ret;
> >  
> > -	crtc = intel_get_crtc_for_pipe(dev_priv, PIPE_A);
> > +	crtc = intel_get_first_crtc(dev_priv);
> >  	if (!crtc)
> >  		return;
> >  
> > diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> > index 5ba0b40fbfde..6fdaeb019fef 100644
> > --- a/drivers/gpu/drm/i915/display/intel_display.c
> > +++ b/drivers/gpu/drm/i915/display/intel_display.c
> > @@ -2715,9 +2715,10 @@ u32 intel_plane_fb_max_stride(struct drm_i915_private *dev_priv,
> >  
> >  	/*
> >  	 * We assume the primary plane for pipe A has
> > -	 * the highest stride limits of them all.
> > +	 * the highest stride limits of them all,
> > +	 * if in case pipe A is disabled, use the first pipe from pipe_mask.
> >  	 */
> > -	crtc = intel_get_crtc_for_pipe(dev_priv, PIPE_A);
> > +	crtc = intel_get_first_crtc(dev_priv);
> >  	if (!crtc)
> >  		return 0;
> >  
> > diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
> > index d359f1636ba8..359eaa6703a8 100644
> > --- a/drivers/gpu/drm/i915/display/intel_display_types.h
> > +++ b/drivers/gpu/drm/i915/display/intel_display_types.h
> > @@ -1403,6 +1403,12 @@ vlv_pipe_to_channel(enum pipe pipe)
> >  	}
> >  }
> >  
> > +static inline struct intel_crtc *
> > +intel_get_first_crtc(struct drm_i915_private *dev_priv)
> > +{
> > +	return to_intel_crtc(drm_crtc_from_index(&dev_priv->drm, 0));
> > +}
> > +
> >  static inline struct intel_crtc *
> >  intel_get_crtc_for_pipe(struct drm_i915_private *dev_priv, enum pipe pipe)
> >  {
> > -- 
> > 2.24.0
> >
Gupta, Anshuman Feb. 18, 2020, 11:57 a.m. UTC | #3
On 2020-02-17 at 16:17:22 +0200, Ville Syrjälä wrote:
> On Mon, Feb 17, 2020 at 10:52:28AM +0530, Anshuman Gupta wrote:
> > On 2020-02-11 at 22:55:30 +0530, Anshuman Gupta wrote:
> > > intel_plane_fb_max_stride should return the max stride of
> > > primary plane for first available pipe in intel device info
> > > pipe_mask.
> > > Similarly glk_force_audio_cdclk() should also use the first
> > > available CRTC instead of pipe 'A' crtc to force the cdclk
> > > changes.
> > > 
> > > changes since RFC:
> > > - Introduced a helper to get first intel_crtc intel_get_first_crtc. [Ville]
> > > v1:
> > > - Used intel_get_first_crtc() instead of PIPE_A crtc in
> > >   glk_force_audio_cdclk(). [Ville]
> > Hi Ville,
> > You had provided your RB on earlier revision
> > https://patchwork.freedesktop.org/patch/351873/?series=72468&rev=2
> > later u have provided the above review comment, as current
> > patch fixes the above review comment.
> > can i use your RB for this patch, if current patch is ok.
> 
> Yes, this patch looks ok.
> 
> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Thanks Ville for RB.
> 
> > Thanks,
> > Anshuman Gupta. 
> > > 
> > > Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
> > > ---
> > >  drivers/gpu/drm/i915/display/intel_audio.c         | 2 +-
> > >  drivers/gpu/drm/i915/display/intel_display.c       | 5 +++--
> > >  drivers/gpu/drm/i915/display/intel_display_types.h | 6 ++++++
> > >  3 files changed, 10 insertions(+), 3 deletions(-)
> > > 
> > > diff --git a/drivers/gpu/drm/i915/display/intel_audio.c b/drivers/gpu/drm/i915/display/intel_audio.c
> > > index 30fb7c887ff0..19bf206037c2 100644
> > > --- a/drivers/gpu/drm/i915/display/intel_audio.c
> > > +++ b/drivers/gpu/drm/i915/display/intel_audio.c
> > > @@ -844,7 +844,7 @@ static void glk_force_audio_cdclk(struct drm_i915_private *dev_priv,
> > >  	struct intel_crtc *crtc;
> > >  	int ret;
> > >  
> > > -	crtc = intel_get_crtc_for_pipe(dev_priv, PIPE_A);
> > > +	crtc = intel_get_first_crtc(dev_priv);
> > >  	if (!crtc)
> > >  		return;
> > >  
> > > diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> > > index 5ba0b40fbfde..6fdaeb019fef 100644
> > > --- a/drivers/gpu/drm/i915/display/intel_display.c
> > > +++ b/drivers/gpu/drm/i915/display/intel_display.c
> > > @@ -2715,9 +2715,10 @@ u32 intel_plane_fb_max_stride(struct drm_i915_private *dev_priv,
> > >  
> > >  	/*
> > >  	 * We assume the primary plane for pipe A has
> > > -	 * the highest stride limits of them all.
> > > +	 * the highest stride limits of them all,
> > > +	 * if in case pipe A is disabled, use the first pipe from pipe_mask.
> > >  	 */
> > > -	crtc = intel_get_crtc_for_pipe(dev_priv, PIPE_A);
> > > +	crtc = intel_get_first_crtc(dev_priv);
> > >  	if (!crtc)
> > >  		return 0;
> > >  
> > > diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
> > > index d359f1636ba8..359eaa6703a8 100644
> > > --- a/drivers/gpu/drm/i915/display/intel_display_types.h
> > > +++ b/drivers/gpu/drm/i915/display/intel_display_types.h
> > > @@ -1403,6 +1403,12 @@ vlv_pipe_to_channel(enum pipe pipe)
> > >  	}
> > >  }
> > >  
> > > +static inline struct intel_crtc *
> > > +intel_get_first_crtc(struct drm_i915_private *dev_priv)
> > > +{
> > > +	return to_intel_crtc(drm_crtc_from_index(&dev_priv->drm, 0));
> > > +}
> > > +
> > >  static inline struct intel_crtc *
> > >  intel_get_crtc_for_pipe(struct drm_i915_private *dev_priv, enum pipe pipe)
> > >  {
> > > -- 
> > > 2.24.0
> > > 
> 
> -- 
> Ville Syrjälä
> Intel
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_audio.c b/drivers/gpu/drm/i915/display/intel_audio.c
index 30fb7c887ff0..19bf206037c2 100644
--- a/drivers/gpu/drm/i915/display/intel_audio.c
+++ b/drivers/gpu/drm/i915/display/intel_audio.c
@@ -844,7 +844,7 @@  static void glk_force_audio_cdclk(struct drm_i915_private *dev_priv,
 	struct intel_crtc *crtc;
 	int ret;
 
-	crtc = intel_get_crtc_for_pipe(dev_priv, PIPE_A);
+	crtc = intel_get_first_crtc(dev_priv);
 	if (!crtc)
 		return;
 
diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index 5ba0b40fbfde..6fdaeb019fef 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -2715,9 +2715,10 @@  u32 intel_plane_fb_max_stride(struct drm_i915_private *dev_priv,
 
 	/*
 	 * We assume the primary plane for pipe A has
-	 * the highest stride limits of them all.
+	 * the highest stride limits of them all,
+	 * if in case pipe A is disabled, use the first pipe from pipe_mask.
 	 */
-	crtc = intel_get_crtc_for_pipe(dev_priv, PIPE_A);
+	crtc = intel_get_first_crtc(dev_priv);
 	if (!crtc)
 		return 0;
 
diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
index d359f1636ba8..359eaa6703a8 100644
--- a/drivers/gpu/drm/i915/display/intel_display_types.h
+++ b/drivers/gpu/drm/i915/display/intel_display_types.h
@@ -1403,6 +1403,12 @@  vlv_pipe_to_channel(enum pipe pipe)
 	}
 }
 
+static inline struct intel_crtc *
+intel_get_first_crtc(struct drm_i915_private *dev_priv)
+{
+	return to_intel_crtc(drm_crtc_from_index(&dev_priv->drm, 0));
+}
+
 static inline struct intel_crtc *
 intel_get_crtc_for_pipe(struct drm_i915_private *dev_priv, enum pipe pipe)
 {