summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Clark <rob@ti.com>2012-04-12 17:38:39 -0500
committerRob Clark <rob@ti.com>2012-04-13 20:12:53 -0500
commita6762ef8c9830a6e2c3a18456f5c7ad5c7de9361 (patch)
treefbe1eac0b8cd1bfe132133be11de34a59f38b10a
parent99ab80d5efe1de10d3945bdcf7d5bb896a2875e7 (diff)
dri2: send proper swap-type back to client
The dri2 client needs to know if we flipped or blit so it can properly keep track of which buffer is the active back buffer.
-rw-r--r--src/omap_dri2.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/omap_dri2.c b/src/omap_dri2.c
index cd2147b..3cb94f1 100644
--- a/src/omap_dri2.c
+++ b/src/omap_dri2.c
@@ -311,6 +311,7 @@ OMAPDRI2GetMSC(DrawablePtr pDraw, CARD64 *ust, CARD64 *msc)
}
struct _OMAPDRISwapCmd {
+ int type;
ClientPtr client;
DrawablePtr pDraw;
DRI2BufferPtr pDstBuffer;
@@ -330,7 +331,8 @@ OMAPDRI2SwapComplete(OMAPDRISwapCmd *cmd)
exchangebufs(cmd->pDraw, cmd->pSrcBuffer, cmd->pDstBuffer);
- DRI2SwapComplete(cmd->client, cmd->pDraw, 0, 0, 0, 0, cmd->func, cmd->data);
+ DRI2SwapComplete(cmd->client, cmd->pDraw, 0, 0, 0,
+ cmd->type, cmd->func, cmd->data);
free(cmd);
}
@@ -370,9 +372,11 @@ OMAPDRI2ScheduleSwap(ClientPtr client, DrawablePtr pDraw,
if (src->fb_id && dst->fb_id) {
DEBUG_MSG("can flip: %d -> %d", src->fb_id, dst->fb_id);
+ cmd->type = DRI2_FLIP_COMPLETE;
drmmode_page_flip(pDraw, src->fb_id, cmd);
} else if (canexchange(pDraw, pSrcBuffer, pDstBuffer)) {
/* we can get away w/ pointer swap.. yah! */
+ cmd->type = DRI2_EXCHANGE_COMPLETE;
OMAPDRI2SwapComplete(cmd);
} else {
/* fallback to blit: */
@@ -385,6 +389,7 @@ OMAPDRI2ScheduleSwap(ClientPtr client, DrawablePtr pDraw,
RegionRec region;
RegionInit(&region, &box, 0);
OMAPDRI2CopyRegion(pDraw, &region, pDstBuffer, pSrcBuffer);
+ cmd->type = DRI2_BLIT_COMPLETE;
OMAPDRI2SwapComplete(cmd);
}