diff options
author | Jesse Barnes <jbarnes@jbarnes-t61.(none)> | 2008-06-24 10:44:23 -0700 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2008-06-24 10:46:21 -0700 |
commit | 1056d79809a3765f81113f3988bd948c1f9c673a (patch) | |
tree | 05fd6109148eaf902151ae343fc84c89faad6fff | |
parent | 65eee25d7d2ca979205f3776d620dbb36bf68a13 (diff) |
Fix back buffer damage handler for 965+ chips
When page flipping is enabled, we need to make sure any changes to the front
buffer are reflected in the back buffer(s) or corruption might occur at page
flip time. So make the damage handler work on 965 by adding appropriate tiling
flags and pitch adjustments.
-rw-r--r-- | src/i830_dri.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/i830_dri.c b/src/i830_dri.c index 4361ad0b..57fb0a47 100644 --- a/src/i830_dri.c +++ b/src/i830_dri.c @@ -996,26 +996,35 @@ static void I830DRIDoRefreshArea (ScrnInfoPtr pScrn, int num, BoxPtr pbox, uint32_t dst) { I830Ptr pI830 = I830PTR(pScrn); - int i, cmd, br13 = (pScrn->displayWidth * pI830->cpp) | (0xcc << 16); + unsigned int i, cmd, pitch, flags; + + pitch = pScrn->displayWidth * pI830->cpp; + flags = 0xcc << 16; /* ROP_S */ if (pScrn->bitsPerPixel == 32) { cmd = (XY_SRC_COPY_BLT_CMD | XY_SRC_COPY_BLT_WRITE_ALPHA | XY_SRC_COPY_BLT_WRITE_RGB); - br13 |= 3 << 24; + flags |= 3 << 24; } else { cmd = (XY_SRC_COPY_BLT_CMD); - br13 |= 1 << 24; + flags |= 1 << 24; + } + + /* We can assume tiled buffers if page flipping is on */ + if (IS_I965G(pI830)) { + cmd |= XY_SRC_COPY_BLT_DST_TILED | XY_SRC_COPY_BLT_SRC_TILED; + pitch >>= 2; } for (i = 0 ; i < num ; i++, pbox++) { BEGIN_BATCH(8); OUT_BATCH(cmd); - OUT_BATCH(br13); + OUT_BATCH(flags | pitch); OUT_BATCH((pbox->y1 << 16) | pbox->x1); OUT_BATCH((pbox->y2 << 16) | pbox->x2); OUT_BATCH(dst); OUT_BATCH((pbox->y1 << 16) | pbox->x1); - OUT_BATCH(br13 & 0xffff); + OUT_BATCH(pitch); OUT_BATCH(pI830->front_buffer->offset); ADVANCE_BATCH(); } |