[Intel-gfx] [PATCH 3/4] drm/i915: dont save/restore VGA state for kms

Ville Syrjälä ville.syrjala at linux.intel.com
Fri Jan 25 20:09:58 CET 2013


On Fri, Jan 25, 2013 at 05:53:21PM +0100, Daniel Vetter wrote:
> The only thing we really care about that it is off. To do so, reuse
> the recently created i915_redisable_vga function, which is already
> used to put obnoxious firmware into check on lid reopening.
> 
> Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
> ---
>  drivers/gpu/drm/i915/i915_drv.h      |  1 +
>  drivers/gpu/drm/i915/i915_suspend.c  | 48 +++++++++++++++++++-----------------
>  drivers/gpu/drm/i915/intel_display.c |  2 +-
>  3 files changed, 28 insertions(+), 23 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 953060c..0ce7c8a 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -1788,6 +1788,7 @@ extern void intel_modeset_cleanup(struct drm_device *dev);
>  extern int intel_modeset_vga_set_state(struct drm_device *dev, bool state);
>  extern void intel_modeset_setup_hw_state(struct drm_device *dev,
>  					 bool force_restore);
> +extern void i915_redisable_vga(struct drm_device *dev);
>  extern bool intel_fbc_enabled(struct drm_device *dev);
>  extern void intel_disable_fbc(struct drm_device *dev);
>  extern bool ironlake_set_drps(struct drm_device *dev, u8 val);
> diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c
> index 056bd12..edcbfaf 100644
> --- a/drivers/gpu/drm/i915/i915_suspend.c
> +++ b/drivers/gpu/drm/i915/i915_suspend.c
> @@ -69,6 +69,15 @@ static void i915_save_vga(struct drm_device *dev)
>  	int i;
>  	u16 cr_index, cr_data, st01;
>  
> +	/* VGA state */
> +	dev_priv->regfile.saveVGA0 = I915_READ(VGA0);
> +	dev_priv->regfile.saveVGA1 = I915_READ(VGA1);
> +	dev_priv->regfile.saveVGA_PD = I915_READ(VGA_PD);

BTW these three don't seem to exist on PCH platforms at all. I guess
gen <= 4 would be the most appropriate check since VLV doesn't have
them either, but in this code it doesn't matter much if the check is
for non-PCH instead. I'll include a patch for this in my 
IS_DISPLAYREG() series.

-- 
Ville Syrjälä
Intel OTC



More information about the Intel-gfx mailing list