Re: [PATCH 4/5] drm/i915: Pull intel_init_power_well() out of intel_modeset_init_hw()

Ville Syrjälä
2013-09-13T20:26:23Z

On Fri, Sep 13, 2013 at 05:19:34PM -0300, Paulo Zanoni wrote:
> 2013/9/12 <ville.syrjala@linux.intel.com>:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > The init and resume codepaths want to handel the power well in slightly
> > different ways, so pull the power well init out from
> > intel_modeset_init_hw() which gets called in both cases.
>
> Can you please explain more? Where's the slight difference?

See patch 5. We want to keep the power well powered until we've finished
the vgacon->fbcon handoff, so we need to grab an extra power well
reference between intel_init_power_well() and first ->global_resources()
which would otherwise disable the power well.

>
> (also, I'm not sure if this code will change due to my comment in patch 1/5)
>
> >
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> > drivers/gpu/drm/i915/i915_dma.c | 2 ++
> > drivers/gpu/drm/i915/i915_drv.c | 2 ++
> > drivers/gpu/drm/i915/intel_display.c | 2 --
> > 3 files changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
> > index 9b265a4..e5c7b10 100644
> > --- a/drivers/gpu/drm/i915/i915_dma.c
> > +++ b/drivers/gpu/drm/i915/i915_dma.c
> > @@ -1324,6 +1324,8 @@ static int i915_load_modeset_init(struct drm_device *dev)
> >
> > INIT_WORK(&dev_priv->console_resume_work, intel_console_resume);
> >
> > + intel_init_power_well(dev);
> > +
> > intel_modeset_gem_init(dev);
> >
> > /* Always safe in the mode setting case. */
> > diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> > index ec690ca..cd5a66d 100644
> > --- a/drivers/gpu/drm/i915/i915_drv.c
> > +++ b/drivers/gpu/drm/i915/i915_drv.c
> > @@ -596,6 +596,8 @@ static int __i915_drm_thaw(struct drm_device *dev)
> > /* We need working interrupts for modeset enabling ... */
> > drm_irq_install(dev);
> >
> > + intel_init_power_well(dev);
> > +
> > intel_modeset_init_hw(dev);
> >
> > drm_modeset_lock_all(dev);
> > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > index d06e3b4..53f5a1f 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -10343,8 +10343,6 @@ void i915_disable_vga_mem(struct drm_device *dev)
> >
> > void intel_modeset_init_hw(struct drm_device *dev)
> > {
> > - intel_init_power_well(dev);
> > -
> > intel_prepare_ddi(dev);
> >
> > intel_init_clock_gating(dev);
> > --
> > 1.8.1.5
> >
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/intel-gfx
>
>
>
> --
> Paulo Zanoni

--
Ville Syrjälä
Intel OTC