aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/drm
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2008-04-21 02:31:10 -0400
committerDave Airlie <airlied@linux.ie>2008-04-26 03:48:54 -0400
commit7b832b56bd971348329c3f4c753ca0abfdf3a3d1 (patch)
tree38bcc4d42d03942ffc31c9024091fd7e2b75d5c0 /drivers/char/drm
parenta36b7dcc05bc4c4580f11cf78e95edfefa86b8a6 (diff)
drm/i915: Handle tiled buffers in vblank tasklet
The vblank tasklet update code must build 2D blt commands with the appropriate tiled flags Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/char/drm')
-rw-r--r--drivers/char/drm/i915_drv.h2
-rw-r--r--drivers/char/drm/i915_irq.c18
2 files changed, 16 insertions, 4 deletions
diff --git a/drivers/char/drm/i915_drv.h b/drivers/char/drm/i915_drv.h
index 675d88bda06..50cd68d6b6c 100644
--- a/drivers/char/drm/i915_drv.h
+++ b/drivers/char/drm/i915_drv.h
@@ -566,6 +566,8 @@ extern int i915_wait_ring(struct drm_device * dev, int n, const char *caller);
566#define XY_SRC_COPY_BLT_CMD ((2<<29)|(0x53<<22)|6) 566#define XY_SRC_COPY_BLT_CMD ((2<<29)|(0x53<<22)|6)
567#define XY_SRC_COPY_BLT_WRITE_ALPHA (1<<21) 567#define XY_SRC_COPY_BLT_WRITE_ALPHA (1<<21)
568#define XY_SRC_COPY_BLT_WRITE_RGB (1<<20) 568#define XY_SRC_COPY_BLT_WRITE_RGB (1<<20)
569#define XY_SRC_COPY_BLT_SRC_TILED (1<<15)
570#define XY_SRC_COPY_BLT_DST_TILED (1<<11)
569 571
570#define MI_BATCH_BUFFER ((0x30<<23)|1) 572#define MI_BATCH_BUFFER ((0x30<<23)|1)
571#define MI_BATCH_BUFFER_START (0x31<<23) 573#define MI_BATCH_BUFFER_START (0x31<<23)
diff --git a/drivers/char/drm/i915_irq.c b/drivers/char/drm/i915_irq.c
index 5a6f8309d8b..f7f16e7a8bf 100644
--- a/drivers/char/drm/i915_irq.c
+++ b/drivers/char/drm/i915_irq.c
@@ -57,10 +57,20 @@ static void i915_vblank_tasklet(struct drm_device *dev)
57 XY_SRC_COPY_BLT_WRITE_ALPHA | 57 XY_SRC_COPY_BLT_WRITE_ALPHA |
58 XY_SRC_COPY_BLT_WRITE_RGB) 58 XY_SRC_COPY_BLT_WRITE_RGB)
59 : XY_SRC_COPY_BLT_CMD; 59 : XY_SRC_COPY_BLT_CMD;
60 u32 pitchropcpp = (sarea_priv->pitch * cpp) | (0xcc << 16) | 60 u32 src_pitch = sarea_priv->pitch * cpp;
61 (cpp << 23) | (1 << 24); 61 u32 dst_pitch = sarea_priv->pitch * cpp;
62 u32 ropcpp = (0xcc << 16) | ((cpp - 1) << 24);
62 RING_LOCALS; 63 RING_LOCALS;
63 64
65 if (sarea_priv->front_tiled) {
66 cmd |= XY_SRC_COPY_BLT_DST_TILED;
67 dst_pitch >>= 2;
68 }
69 if (sarea_priv->back_tiled) {
70 cmd |= XY_SRC_COPY_BLT_SRC_TILED;
71 src_pitch >>= 2;
72 }
73
64 DRM_DEBUG("\n"); 74 DRM_DEBUG("\n");
65 75
66 INIT_LIST_HEAD(&hits); 76 INIT_LIST_HEAD(&hits);
@@ -194,12 +204,12 @@ static void i915_vblank_tasklet(struct drm_device *dev)
194 BEGIN_LP_RING(8); 204 BEGIN_LP_RING(8);
195 205
196 OUT_RING(cmd); 206 OUT_RING(cmd);
197 OUT_RING(pitchropcpp); 207 OUT_RING(ropcpp | dst_pitch);
198 OUT_RING((y1 << 16) | rect->x1); 208 OUT_RING((y1 << 16) | rect->x1);
199 OUT_RING((y2 << 16) | rect->x2); 209 OUT_RING((y2 << 16) | rect->x2);
200 OUT_RING(sarea_priv->front_offset); 210 OUT_RING(sarea_priv->front_offset);
201 OUT_RING((y1 << 16) | rect->x1); 211 OUT_RING((y1 << 16) | rect->x1);
202 OUT_RING(pitchropcpp & 0xffff); 212 OUT_RING(src_pitch);
203 OUT_RING(sarea_priv->back_offset); 213 OUT_RING(sarea_priv->back_offset);
204 214
205 ADVANCE_LP_RING(); 215 ADVANCE_LP_RING();