diff mbox

[v3,15/22] drm/i915: Read hw state into an atomic state struct

Message ID 55655659.9060109@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Maarten Lankhorst May 27, 2015, 5:30 a.m. UTC
Hey,

Op 20-05-15 om 18:04 schreef maarten.lankhorst@linux.intel.com:
> From: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
>
> To make this work we load the new hardware state into the
> atomic_state, then swap it with the sw state.
>
> This lets us change the force restore path in setup_hw_state()
> to use a single call to intel_mode_set() to restore all the
> previous state.
>
> As a nice bonus this kills off encoder->new_encoder,
> connector->new_enabled and crtc->new_enabled. They were used only
> to restore the state after a modeset.
>
> Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/intel_atomic.c  |   2 +-
>  drivers/gpu/drm/i915/intel_display.c | 377 ++++++++++++++++++++++-------------
>  drivers/gpu/drm/i915/intel_drv.h     |  14 +-
>  3 files changed, 241 insertions(+), 152 deletions(-)
>
Small fix up. This patch may force the modeset code to no longer do a modeset on boot, causing a black screen
on Daniel Stone's machine. Fixup below disables all crtc's for the !i915.fastboot case.

Comments

Daniel Vetter May 27, 2015, 11:26 a.m. UTC | #1
On Wed, May 27, 2015 at 07:30:01AM +0200, Maarten Lankhorst wrote:
> Hey,
> 
> Op 20-05-15 om 18:04 schreef maarten.lankhorst@linux.intel.com:
> > From: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
> >
> > To make this work we load the new hardware state into the
> > atomic_state, then swap it with the sw state.
> >
> > This lets us change the force restore path in setup_hw_state()
> > to use a single call to intel_mode_set() to restore all the
> > previous state.
> >
> > As a nice bonus this kills off encoder->new_encoder,
> > connector->new_enabled and crtc->new_enabled. They were used only
> > to restore the state after a modeset.
> >
> > Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
> > Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_atomic.c  |   2 +-
> >  drivers/gpu/drm/i915/intel_display.c | 377 ++++++++++++++++++++++-------------
> >  drivers/gpu/drm/i915/intel_drv.h     |  14 +-
> >  3 files changed, 241 insertions(+), 152 deletions(-)
> >
> Small fix up. This patch may force the modeset code to no longer do a modeset on boot, causing a black screen
> on Daniel Stone's machine. Fixup below disables all crtc's for the !i915.fastboot case.

Why does this happen? It could be that we're throwing a state difference
under the rug, which wouldn't be great.
-Daniel

> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 13b09efeb2a0..b70e3890e2bf 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -14138,7 +14138,7 @@ void intel_modeset_init(struct drm_device *dev)
>  	intel_fbc_disable(dev);
>  
>  	drm_modeset_lock_all(dev);
> -	intel_modeset_setup_hw_state(dev, false);
> +	intel_modeset_setup_hw_state(dev, !i915.fastboot);
>  	drm_modeset_unlock_all(dev);
>  
>  	for_each_intel_crtc(dev, crtc) {
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 13b09efeb2a0..b70e3890e2bf 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -14138,7 +14138,7 @@  void intel_modeset_init(struct drm_device *dev)
 	intel_fbc_disable(dev);
 
 	drm_modeset_lock_all(dev);
-	intel_modeset_setup_hw_state(dev, false);
+	intel_modeset_setup_hw_state(dev, !i915.fastboot);
 	drm_modeset_unlock_all(dev);
 
 	for_each_intel_crtc(dev, crtc) {