Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 86005
b: refs/heads/master
c: 1f84e55
h: refs/heads/master
i:
  86003: 1f82916
v: v3
  • Loading branch information
Keith Packard authored and Dave Airlie committed Feb 19, 2008
1 parent 28d25de commit d0c6e20
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c0c4261b6fd80f0fc5546ed67058592469a4f5b7
refs/heads/master: 1f84e550a870bf5f5f399b611db68f3324ea7883
18 changes: 18 additions & 0 deletions trunk/drivers/char/drm/i915_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,15 @@ static int i915_suspend(struct drm_device *dev)
dev_priv->saveVCLK_POST_DIV = I915_READ(VCLK_POST_DIV);
dev_priv->saveVGACNTRL = I915_READ(VGACNTRL);

/* Clock gating state */
dev_priv->saveDSPCLK_GATE_D = I915_READ(DSPCLK_GATE_D);

/* Cache mode state */
dev_priv->saveCACHE_MODE_0 = I915_READ(CACHE_MODE_0);

/* Memory Arbitration state */
dev_priv->saveMI_ARB_STATE = I915_READ(MI_ARB_STATE);

/* Scratch space */
for (i = 0; i < 16; i++) {
dev_priv->saveSWF0[i] = I915_READ(SWF0 + (i << 2));
Expand Down Expand Up @@ -489,6 +498,15 @@ static int i915_resume(struct drm_device *dev)
I915_WRITE(VCLK_POST_DIV, dev_priv->saveVCLK_POST_DIV);
udelay(150);

/* Clock gating state */
I915_WRITE (DSPCLK_GATE_D, dev_priv->saveDSPCLK_GATE_D);

/* Cache mode state */
I915_WRITE (CACHE_MODE_0, dev_priv->saveCACHE_MODE_0 | 0xffff0000);

/* Memory arbitration state */
I915_WRITE (MI_ARB_STATE, dev_priv->saveMI_ARB_STATE | 0xffff0000);

for (i = 0; i < 16; i++) {
I915_WRITE(SWF0 + (i << 2), dev_priv->saveSWF0[i]);
I915_WRITE(SWF10 + (i << 2), dev_priv->saveSWF1[i+7]);
Expand Down
10 changes: 10 additions & 0 deletions trunk/drivers/char/drm/i915_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,9 @@ typedef struct drm_i915_private {
u32 saveIER;
u32 saveIIR;
u32 saveIMR;
u32 saveCACHE_MODE_0;
u32 saveDSPCLK_GATE_D;
u32 saveMI_ARB_STATE;
u32 saveSWF0[16];
u32 saveSWF1[16];
u32 saveSWF2[3];
Expand Down Expand Up @@ -455,6 +458,10 @@ extern int i915_wait_ring(struct drm_device * dev, int n, const char *caller);
*/
#define DMA_FADD_S 0x20d4

/* Memory Interface Arbitration State
*/
#define MI_ARB_STATE 0x20e4

/* Cache mode 0 reg.
* - Manipulating render cache behaviour is central
* to the concept of zone rendering, tuning this reg can help avoid
Expand All @@ -465,6 +472,7 @@ extern int i915_wait_ring(struct drm_device * dev, int n, const char *caller);
* bit of interest either set or cleared. EG: (BIT<<16) | BIT to set.
*/
#define Cache_Mode_0 0x2120
#define CACHE_MODE_0 0x2120
#define CM0_MASK_SHIFT 16
#define CM0_IZ_OPT_DISABLE (1<<6)
#define CM0_ZR_OPT_DISABLE (1<<5)
Expand Down Expand Up @@ -660,6 +668,8 @@ extern int i915_wait_ring(struct drm_device * dev, int n, const char *caller);
/** P1 value is 2 greater than this field */
# define VGA0_PD_P1_MASK (0x1f << 0)

#define DSPCLK_GATE_D 0x6200

/* I830 CRTC registers */
#define HTOTAL_A 0x60000
#define HBLANK_A 0x60004
Expand Down

0 comments on commit d0c6e20

Please sign in to comment.