Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Keith Packard and committed by
Dave Airlie
7b832b56 a36b7dcc

+16 -4
+2
drivers/char/drm/i915_drv.h
··· 566 566 #define XY_SRC_COPY_BLT_CMD ((2<<29)|(0x53<<22)|6) 567 567 #define XY_SRC_COPY_BLT_WRITE_ALPHA (1<<21) 568 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 572 #define MI_BATCH_BUFFER ((0x30<<23)|1) 571 573 #define MI_BATCH_BUFFER_START (0x31<<23)
+14 -4
drivers/char/drm/i915_irq.c
··· 57 57 XY_SRC_COPY_BLT_WRITE_ALPHA | 58 58 XY_SRC_COPY_BLT_WRITE_RGB) 59 59 : XY_SRC_COPY_BLT_CMD; 60 - u32 pitchropcpp = (sarea_priv->pitch * cpp) | (0xcc << 16) | 61 - (cpp << 23) | (1 << 24); 60 + u32 src_pitch = sarea_priv->pitch * cpp; 61 + u32 dst_pitch = sarea_priv->pitch * cpp; 62 + u32 ropcpp = (0xcc << 16) | ((cpp - 1) << 24); 62 63 RING_LOCALS; 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 + } 63 73 64 74 DRM_DEBUG("\n"); 65 75 ··· 204 194 BEGIN_LP_RING(8); 205 195 206 196 OUT_RING(cmd); 207 - OUT_RING(pitchropcpp); 197 + OUT_RING(ropcpp | dst_pitch); 208 198 OUT_RING((y1 << 16) | rect->x1); 209 199 OUT_RING((y2 << 16) | rect->x2); 210 200 OUT_RING(sarea_priv->front_offset); 211 201 OUT_RING((y1 << 16) | rect->x1); 212 - OUT_RING(pitchropcpp & 0xffff); 202 + OUT_RING(src_pitch); 213 203 OUT_RING(sarea_priv->back_offset); 214 204 215 205 ADVANCE_LP_RING();