summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2011-12-28 11:48:36 +0100
committerMichel Dänzer <michel.daenzer@amd.com>2011-12-28 11:48:36 +0100
commitae45d7e6d8e6844cd4586c9ee97c21b257fa788f (patch)
tree221516664102bac508833f09ba0d3e6ad124d58e
parentaacbd629b02cbee3f9e6a0ee452b4e3f21376bd3 (diff)
DRI2: Can't use page flipping for pixmaps. (bug #42913)
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=42913 . Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
-rw-r--r--src/radeon_dri2.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/radeon_dri2.c b/src/radeon_dri2.c
index 52f2b827..5a7ebd41 100644
--- a/src/radeon_dri2.c
+++ b/src/radeon_dri2.c
@@ -751,6 +751,16 @@ can_exchange(ScrnInfoPtr pScrn, DrawablePtr draw,
return TRUE;
}
+static Bool
+can_flip(ScrnInfoPtr pScrn, DrawablePtr draw,
+ DRI2BufferPtr front, DRI2BufferPtr back)
+{
+ return draw->type == DRAWABLE_WINDOW &&
+ RADEONPTR(pScrn)->allowPageFlip &&
+ DRI2CanFlip(draw) &&
+ can_exchange(pScrn, draw, front, back);
+}
+
static void
radeon_dri2_exchange_buffers(DrawablePtr draw, DRI2BufferPtr front, DRI2BufferPtr back)
{
@@ -790,7 +800,6 @@ void radeon_dri2_frame_event_handler(unsigned int frame, unsigned int tv_sec,
unsigned int tv_usec, void *event_data)
{
DRI2FrameEventPtr event = event_data;
- RADEONInfoPtr info;
DrawablePtr drawable;
ScreenPtr screen;
ScrnInfoPtr scrn;
@@ -809,13 +818,10 @@ void radeon_dri2_frame_event_handler(unsigned int frame, unsigned int tv_sec,
screen = drawable->pScreen;
scrn = xf86Screens[screen->myNum];
- info = RADEONPTR(scrn);
switch (event->type) {
case DRI2_FLIP:
- if (info->allowPageFlip &&
- DRI2CanFlip(drawable) &&
- can_exchange(scrn, drawable, event->front, event->back) &&
+ if (can_flip(scrn, drawable, event->front, event->back) &&
radeon_dri2_schedule_flip(scrn,
event->client,
drawable,
@@ -1190,9 +1196,7 @@ static int radeon_dri2_schedule_swap(ClientPtr client, DrawablePtr draw,
current_msc = vbl.reply.sequence;
/* Flips need to be submitted one frame before */
- if (info->allowPageFlip &&
- DRI2CanFlip(draw) &&
- can_exchange(scrn, draw, front, back)) {
+ if (can_flip(scrn, draw, front, back)) {
swap_type = DRI2_FLIP;
flip = 1;
}