[Intel-gfx] [PATCH] drm/i915: add render standby support

Rémi Cardona remi at gentoo.org
Thu Oct 8 11:50:25 CEST 2009


Le 07/10/2009 23:41, Jesse Barnes a écrit :
> diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
> index efcfe64..76b74c6 100644
> --- a/drivers/gpu/drm/i915/i915_reg.h
> +++ b/drivers/gpu/drm/i915/i915_reg.h
> @@ -260,6 +260,8 @@
>   #define HWS_PGA		0x02080
>   #define HWS_ADDRESS_MASK	0xfffff000
>   #define HWS_START_ADDRESS_SHIFT	4
> +#define PWRCTXA		0x2088 /* 965GM+ only */
> +#define   PWRCTX_EN	(1<<0)
>   #define IPEIR		0x02088
>   #define IPEHR		0x0208c
>   #define INSTDONE	0x02090
> @@ -769,6 +771,8 @@
>
>   /** GM965 GM45 render standby register */
>   #define MCHBAR_RENDER_STANDBY	0x111B8
> +#define   RCX_SW_EXIT		(1<<23)
> +#define   RSX_STATUS_MASK	0x00700000
>   #define MCHBAR_GFXEC		0x112f4 /* Energy counter */
>   #define PEG_BAND_GAP_DATA	0x14d68

Weird indent for all 4 #defines...

> diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c
> index bd6d8d9..d561fd9 100644
> --- a/drivers/gpu/drm/i915/i915_suspend.c
> +++ b/drivers/gpu/drm/i915/i915_suspend.c
> @@ -534,8 +534,10 @@ int i915_save_state(struct drm_device *dev)
>   	pci_read_config_byte(dev->pdev, LBB,&dev_priv->saveLBB);
>
>   	/* Render Standby */
> -	if (IS_I965G(dev)&&  IS_MOBILE(dev))
> +	if (IS_I965G(dev)&&  IS_MOBILE(dev)) {
>   		dev_priv->saveRENDERSTANDBY = I915_READ(MCHBAR_RENDER_STANDBY);
> +		dev_priv->savePWRCTXA = I915_READ(PWRCTXA);
> +	}
>
>   	/* Hardware status page */
>   	dev_priv->saveHWS = I915_READ(HWS_PGA);
> @@ -588,8 +590,10 @@ int i915_restore_state(struct drm_device *dev)
>   	pci_write_config_byte(dev->pdev, LBB, dev_priv->saveLBB);
>
>   	/* Render Standby */
> -	if (IS_I965G(dev)&&  IS_MOBILE(dev))
> +	if (IS_I965G(dev)&&  IS_MOBILE(dev)) {
>   		I915_WRITE(MCHBAR_RENDER_STANDBY, dev_priv->saveRENDERSTANDBY);
> +		I915_WRITE(PWRCTXA, dev_priv->savePWRCTXA);
> +	}

Just wondering, why aren't you using I915_HAS_RC6() for saving/restoring 
PWRCTXA?

Cheers,

Rémi



More information about the Intel-gfx mailing list