[Intel-gfx] [PATCH 4/7] drm/i915: Fix wrongly populated plane possible_crtcs bit mask
Ville Syrjälä
ville.syrjala at linux.intel.com
Tue Feb 4 16:44:32 UTC 2020
On Tue, Feb 04, 2020 at 04:30:16PM +0200, Ville Syrjälä wrote:
> On Tue, Feb 04, 2020 at 04:59:24PM +0530, Anshuman Gupta wrote:
> > As a disabled pipe in pipe_mask is not having a valid intel crtc,
> > driver wrongly populates the possible_crtcs mask while initializing
> > the plane for a CRTC. Fixing up the plane possible_crtc mask.
> >
> > changes since RFC:
> > - Simplify the possible_crtcs initialization. [Ville]
> >
> > Cc: Ville Syrjälä <ville.syrjala at linux.intel.com>
> > Signed-off-by: Anshuman Gupta <anshuman.gupta at intel.com>
> > ---
> > drivers/gpu/drm/i915/display/intel_display.c | 12 ++++++++++++
> > drivers/gpu/drm/i915/display/intel_sprite.c | 2 --
> > 2 files changed, 12 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> > index cf36c3d0f8fc..7c51eb3faeb3 100644
> > --- a/drivers/gpu/drm/i915/display/intel_display.c
> > +++ b/drivers/gpu/drm/i915/display/intel_display.c
> > @@ -16407,6 +16407,17 @@ static void intel_crtc_free(struct intel_crtc *crtc)
> > kfree(crtc);
> > }
> >
> > +static void intel_plane_possible_crtc_init(struct drm_i915_private *dev_priv)
> > +{
> > + struct intel_crtc *crtc;
>
> Move this declaration into the loop body.
>
> With that
> Reviewed-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
>
> > + struct intel_plane *plane;
> > +
> > + for_each_intel_plane(&dev_priv->drm, plane) {
> > + crtc = intel_get_crtc_for_pipe(dev_priv, plane->pipe);
> > + plane->base.possible_crtcs = drm_crtc_mask(&crtc->base);
> > + }
> > +}
> > +
> > static int intel_crtc_init(struct drm_i915_private *dev_priv, enum pipe pipe)
> > {
> > struct intel_plane *primary, *cursor;
> > @@ -17546,6 +17557,7 @@ int intel_modeset_init(struct drm_i915_private *i915)
> > }
> > }
> >
> > + intel_plane_possible_crtc_init(i915);
> > intel_shared_dpll_init(dev);
> > intel_update_fdi_pll_freq(i915);
> >
> > diff --git a/drivers/gpu/drm/i915/display/intel_sprite.c b/drivers/gpu/drm/i915/display/intel_sprite.c
> > index fca77ec1e0dd..4a5b192678bf 100644
> > --- a/drivers/gpu/drm/i915/display/intel_sprite.c
> > +++ b/drivers/gpu/drm/i915/display/intel_sprite.c
> > @@ -3023,8 +3023,6 @@ skl_universal_plane_create(struct drm_i915_private *dev_priv,
> > else
> > plane_type = DRM_PLANE_TYPE_OVERLAY;
> >
> > - possible_crtcs = BIT(pipe);
> > -
Actually that now contains stack garbage. Pls remove the variable
entire and just pass zero to the thing.
> > ret = drm_universal_plane_init(&dev_priv->drm, &plane->base,
> > possible_crtcs, plane_funcs,
> > formats, num_formats, modifiers,
> > --
> > 2.24.0
>
> --
> Ville Syrjälä
> Intel
--
Ville Syrjälä
Intel
More information about the Intel-gfx
mailing list