summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMario Kleiner <mario.kleiner@tuebingen.mpg.de>2012-03-01 19:11:14 +0100
committerBen Skeggs <bskeggs@redhat.com>2012-03-06 08:12:24 +1000
commit4da68cedbefef4f72c00bb088e179071490882c8 (patch)
tree4361730cffeebf47055a0fd81d900f0ac2cb541a
parentb0d7f4ddd94154491d04dcb9698d63d61e9240dc (diff)
downloadxorg-driver-xf86-video-nouveau-4da68cedbefef4f72c00bb088e179071490882c8.tar.gz
dri2: Fix can_exchange() to allow page-flipping on more mesa versions.
can_exchange() returns false and thereby prevents page flipping on some drawables where page flipping would work fine. This due to non-matching drawable depths values between front buffer pixmap and back buffer pixmap, because front buffer pixmaps inherit the depth of the screen, typically 24 bits, whereas the depth value of back buffer pixmaps for a given RGB8 or RGBA8 visual depends on the mesa version in use, either 24 bits or 32 bits. Use bitsPerPixel instead of depth to decide if drawable is flippable. This will still catch really incompatible formats like 32 bpp vs. 16 bpp buffers. Tested for screen DefaultDepth 24 and also 30 bits (for RGB10 framebuffers) on NV-50. The problem was fixed in the same way in the ati & intel ddx. Signed-off-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r--src/nouveau_dri2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nouveau_dri2.c b/src/nouveau_dri2.c
index 3aa5ec5..5b62425 100644
--- a/src/nouveau_dri2.c
+++ b/src/nouveau_dri2.c
@@ -160,7 +160,7 @@ can_exchange(DrawablePtr draw, PixmapPtr dst_pix, PixmapPtr src_pix)
return ((DRI2CanFlip(draw) && pNv->has_pageflip)) &&
dst_pix->drawable.width == src_pix->drawable.width &&
dst_pix->drawable.height == src_pix->drawable.height &&
- dst_pix->drawable.depth == src_pix->drawable.depth &&
+ dst_pix->drawable.bitsPerPixel == src_pix->drawable.bitsPerPixel &&
dst_pix->devKind == src_pix->devKind;
}