[Intel-gfx] [Intel-xe] [PATCH 1/5] drm/i915: Split display locks init from i915_driver_early_probe()

Rodrigo Vivi rodrigo.vivi at intel.com
Mon Apr 3 18:34:18 UTC 2023


On Mon, Apr 03, 2023 at 02:10:26PM -0400, Souza, Jose wrote:
> On Mon, 2023-04-03 at 13:03 -0400, Rodrigo Vivi wrote:
> > On Mon, Apr 03, 2023 at 09:46:11AM -0700, José Roberto de Souza wrote:
> > > No behavior changes here, just adding a function to make clear
> > > what locks initialized here are display related or not.
> > > 
> > > Cc: intel-gfx at lists.freedesktop.org
> > > Signed-off-by: José Roberto de Souza <jose.souza at intel.com>
> > > ---
> > >  drivers/gpu/drm/i915/i915_driver.c | 23 +++++++++++++++--------
> > >  1 file changed, 15 insertions(+), 8 deletions(-)
> > > 
> > > diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c
> > > index 066d79c2069c4..224cb4cb43335 100644
> > > --- a/drivers/gpu/drm/i915/i915_driver.c
> > > +++ b/drivers/gpu/drm/i915/i915_driver.c
> > > @@ -188,6 +188,20 @@ static void sanitize_gpu(struct drm_i915_private *i915)
> > >  	}
> > >  }
> > >  
> > > +static void
> > > +i915_driver_display_early_probe(struct drm_i915_private *dev_priv)
> > > +{
> > > +	spin_lock_init(&dev_priv->display.fb_tracking.lock);
> > > +	spin_lock_init(&dev_priv->display.wm.dsparb_lock);
> > > +	mutex_init(&dev_priv->display.backlight.lock);
> > > +
> > > +	mutex_init(&dev_priv->display.audio.mutex);
> > > +	mutex_init(&dev_priv->display.wm.wm_mutex);
> > > +	mutex_init(&dev_priv->display.pps.mutex);
> > > +	mutex_init(&dev_priv->display.hdcp.comp_mutex);
> > > +	spin_lock_init(&dev_priv->display.dkl.phy_lock);
> > > +}
> > > +
> > 
> > hmmm... I like that, however Jani had indicated in another series [1]
> > that he would prefer the wm mutex inside the wm code for instance...
> > 
> > So, should we move all of these to their own components instead of this
> > move?
> > 
> > [1] https://patchwork.freedesktop.org/series/115675/
> > 
> > I checked and for a few components it is simple to move them to their
> > own init functions. However for a few we would need to create new init
> > functions and call them here.
> > 
> > Jani, more thoughts?
> 
> Forgot to CC you two in the new version: https://patchwork.freedesktop.org/series/116039/
> 
> display.wm.dsparb_lock is not used anywhere.

it currently doesn't exist on drm-intel. Not sure how it appeared in drm-xe...
Probably a !fixup needed on initial display patches.

Please notice that my series on the link I sent earlier re-introduce it with a proper
usage. Ville had already reviewed the code, but I hold the push because Jani
asked about a better placement.

What I tried to say earlier here is that this patch is probably not following
Jani's vision on how to organize the initialization of these many locks.

> Moved display.dkl.phy_lock, will leave the rest to someone to take over.
> 
> 
> > 
> > >  /**
> > >   * i915_driver_early_probe - setup state not requiring device access
> > >   * @dev_priv: device private
> > > @@ -213,18 +227,11 @@ static int i915_driver_early_probe(struct drm_i915_private *dev_priv)
> > >  
> > >  	spin_lock_init(&dev_priv->irq_lock);
> > >  	spin_lock_init(&dev_priv->gpu_error.lock);
> > > -	spin_lock_init(&dev_priv->display.fb_tracking.lock);
> > > -	spin_lock_init(&dev_priv->display.wm.dsparb_lock);
> > > -	mutex_init(&dev_priv->display.backlight.lock);
> > >  
> > >  	mutex_init(&dev_priv->sb_lock);
> > >  	cpu_latency_qos_add_request(&dev_priv->sb_qos, PM_QOS_DEFAULT_VALUE);
> > >  
> > > -	mutex_init(&dev_priv->display.audio.mutex);
> > > -	mutex_init(&dev_priv->display.wm.wm_mutex);
> > > -	mutex_init(&dev_priv->display.pps.mutex);
> > > -	mutex_init(&dev_priv->display.hdcp.comp_mutex);
> > > -	spin_lock_init(&dev_priv->display.dkl.phy_lock);
> > > +	i915_driver_display_early_probe(dev_priv);
> > >  
> > >  	i915_memcpy_init_early(dev_priv);
> > >  	intel_runtime_pm_init_early(&dev_priv->runtime_pm);
> > > -- 
> > > 2.40.0
> > > 
> 


More information about the Intel-gfx mailing list