Re: [Intel-gfx] [PATCH] drm/i915: Don't initialize plane_to_crtc_mapping[] on SKL+

2018-03-16 Thread Ville Syrjälä
On Thu, Mar 15, 2018 at 11:54:26PM +, Pandiyan, Dhinakaran wrote:
> 
> 
> 
> On Mon, 2018-03-05 at 19:41 +0200, Ville Syrjala wrote:
> > From: Ville Syrjälä 
> > 
> > We don't use the enum i9xx_plane_id namespace on SKL+ anymore, so
> > do not initialize the related plane_to_crtc_mapping[] table either.
> > 
> > Actually the only remaining user of that table is the pre-g4x
> > watermark code, but no harm in initializing the table on all
> > pre-SKL platforms.
> > 
> > Signed-off-by: Ville Syrjälä 
> > ---
> >  drivers/gpu/drm/i915/intel_display.c | 15 +++
> >  1 file changed, 11 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_display.c 
> > b/drivers/gpu/drm/i915/intel_display.c
> > index fb08590b4d40..435462bfc719 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -13572,10 +13572,17 @@ static int intel_crtc_init(struct 
> > drm_i915_private *dev_priv, enum pipe pipe)
> > /* initialize shared scalers */
> > intel_crtc_init_scalers(intel_crtc, crtc_state);
> >  
> > -   BUG_ON(pipe >= ARRAY_SIZE(dev_priv->plane_to_crtc_mapping) ||
> > -  dev_priv->plane_to_crtc_mapping[primary->i9xx_plane] != NULL);
> > -   dev_priv->plane_to_crtc_mapping[primary->i9xx_plane] = intel_crtc;
> > -   dev_priv->pipe_to_crtc_mapping[intel_crtc->pipe] = intel_crtc;
> > +   BUG_ON(pipe >= ARRAY_SIZE(dev_priv->pipe_to_crtc_mapping) ||
> > +  dev_priv->pipe_to_crtc_mapping[pipe] != NULL);
> > +   dev_priv->pipe_to_crtc_mapping[pipe] = intel_crtc;
> > +
> > +   if (INTEL_GEN(dev_priv) < 9) {
> > +   enum i9xx_plane_id i9xx_plane = primary->i9xx_plane;
> > +
> > +   BUG_ON(i9xx_plane >= 
> > ARRAY_SIZE(dev_priv->plane_to_crtc_mapping) ||
> > +  dev_priv->plane_to_crtc_mapping[i9xx_plane] != NULL);
> > +   dev_priv->plane_to_crtc_mapping[i9xx_plane] = intel_crtc;
> 
> 
> Verified that plane_to_crtc_mapping[i9xx_plane] is used only in pre-gen9
> code. Patch looks harmless 
> Reviewed-by: Dhinakaran Pandiyan 
> 
> Should intel_get_crtc_for_plane be renamed to i9xx_get_crtc_for_plane()?
> and the table as i9xx_plane_to_crtc_mapping[]?

I'm going to nuke this thing entirely at some point. So I don't
think I'll bother with a rename, but if someone else wants to do
it I certainly won't object.

Thanks for the review. Patch pushed to dinq.

-- 
Ville Syrjälä
Intel OTC
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH] drm/i915: Don't initialize plane_to_crtc_mapping[] on SKL+

2018-03-15 Thread Pandiyan, Dhinakaran



On Mon, 2018-03-05 at 19:41 +0200, Ville Syrjala wrote:
> From: Ville Syrjälä 
> 
> We don't use the enum i9xx_plane_id namespace on SKL+ anymore, so
> do not initialize the related plane_to_crtc_mapping[] table either.
> 
> Actually the only remaining user of that table is the pre-g4x
> watermark code, but no harm in initializing the table on all
> pre-SKL platforms.
> 
> Signed-off-by: Ville Syrjälä 
> ---
>  drivers/gpu/drm/i915/intel_display.c | 15 +++
>  1 file changed, 11 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c 
> b/drivers/gpu/drm/i915/intel_display.c
> index fb08590b4d40..435462bfc719 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -13572,10 +13572,17 @@ static int intel_crtc_init(struct drm_i915_private 
> *dev_priv, enum pipe pipe)
>   /* initialize shared scalers */
>   intel_crtc_init_scalers(intel_crtc, crtc_state);
>  
> - BUG_ON(pipe >= ARRAY_SIZE(dev_priv->plane_to_crtc_mapping) ||
> -dev_priv->plane_to_crtc_mapping[primary->i9xx_plane] != NULL);
> - dev_priv->plane_to_crtc_mapping[primary->i9xx_plane] = intel_crtc;
> - dev_priv->pipe_to_crtc_mapping[intel_crtc->pipe] = intel_crtc;
> + BUG_ON(pipe >= ARRAY_SIZE(dev_priv->pipe_to_crtc_mapping) ||
> +dev_priv->pipe_to_crtc_mapping[pipe] != NULL);
> + dev_priv->pipe_to_crtc_mapping[pipe] = intel_crtc;
> +
> + if (INTEL_GEN(dev_priv) < 9) {
> + enum i9xx_plane_id i9xx_plane = primary->i9xx_plane;
> +
> + BUG_ON(i9xx_plane >= 
> ARRAY_SIZE(dev_priv->plane_to_crtc_mapping) ||
> +dev_priv->plane_to_crtc_mapping[i9xx_plane] != NULL);
> + dev_priv->plane_to_crtc_mapping[i9xx_plane] = intel_crtc;


Verified that plane_to_crtc_mapping[i9xx_plane] is used only in pre-gen9
code. Patch looks harmless 
Reviewed-by: Dhinakaran Pandiyan 

Should intel_get_crtc_for_plane be renamed to i9xx_get_crtc_for_plane()?
and the table as i9xx_plane_to_crtc_mapping[]?





> + }
>  
>   drm_crtc_helper_add(_crtc->base, _helper_funcs);
>  
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH] drm/i915: Don't initialize plane_to_crtc_mapping[] on SKL+

2018-03-05 Thread Ville Syrjala
From: Ville Syrjälä 

We don't use the enum i9xx_plane_id namespace on SKL+ anymore, so
do not initialize the related plane_to_crtc_mapping[] table either.

Actually the only remaining user of that table is the pre-g4x
watermark code, but no harm in initializing the table on all
pre-SKL platforms.

Signed-off-by: Ville Syrjälä 
---
 drivers/gpu/drm/i915/intel_display.c | 15 +++
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c 
b/drivers/gpu/drm/i915/intel_display.c
index fb08590b4d40..435462bfc719 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -13572,10 +13572,17 @@ static int intel_crtc_init(struct drm_i915_private 
*dev_priv, enum pipe pipe)
/* initialize shared scalers */
intel_crtc_init_scalers(intel_crtc, crtc_state);
 
-   BUG_ON(pipe >= ARRAY_SIZE(dev_priv->plane_to_crtc_mapping) ||
-  dev_priv->plane_to_crtc_mapping[primary->i9xx_plane] != NULL);
-   dev_priv->plane_to_crtc_mapping[primary->i9xx_plane] = intel_crtc;
-   dev_priv->pipe_to_crtc_mapping[intel_crtc->pipe] = intel_crtc;
+   BUG_ON(pipe >= ARRAY_SIZE(dev_priv->pipe_to_crtc_mapping) ||
+  dev_priv->pipe_to_crtc_mapping[pipe] != NULL);
+   dev_priv->pipe_to_crtc_mapping[pipe] = intel_crtc;
+
+   if (INTEL_GEN(dev_priv) < 9) {
+   enum i9xx_plane_id i9xx_plane = primary->i9xx_plane;
+
+   BUG_ON(i9xx_plane >= 
ARRAY_SIZE(dev_priv->plane_to_crtc_mapping) ||
+  dev_priv->plane_to_crtc_mapping[i9xx_plane] != NULL);
+   dev_priv->plane_to_crtc_mapping[i9xx_plane] = intel_crtc;
+   }
 
drm_crtc_helper_add(_crtc->base, _helper_funcs);
 
-- 
2.16.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx