diff options
author | Sunny <sunny.sun@arm.com> | 2014-07-15 09:38:47 +0800 |
---|---|---|
committer | Gerrit Code Review <gerrit@mpd-gerrit.cambridge.arm.com> | 2014-07-17 13:07:24 +0100 |
commit | d5df209d6ca1a11fabc22a0c5b1d12628198c946 (patch) | |
tree | 990c83855db4edb52511f88ba07e9c7ca4e80d6f | |
parent | 0abde2d6003b4245c1234a35d79d4ef3db0c8224 (diff) |
XServer crash with multiple applications running at the same time
armsoc ddx only allows two calls to ARMSOCDRI2ScheduleSwap
before SwapComplete arrives, if you are running three applications at one time,
each process should wait other two processes which is impossible.
Change-Id: Ia630e23ac64878328c675be6773f97ec9d839911
-rw-r--r-- | src/armsoc_dri2.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/armsoc_dri2.c b/src/armsoc_dri2.c index c0870b1..013cb82 100644 --- a/src/armsoc_dri2.c +++ b/src/armsoc_dri2.c @@ -655,14 +655,14 @@ ARMSOCDRI2SwapComplete(struct ARMSOCDRISwapCmd *cmd) /* swap chain drops ref on original dst bo */ armsoc_bo_unreference(cmd->old_dst_bo); - if (cmd->type == DRI2_FLIP_COMPLETE) + if (cmd->type == DRI2_FLIP_COMPLETE) { pARMSOC->pending_flips--; - - /* Free the swap cmd and remove it from the swap chain. */ - idx = cmd->swap_id % pARMSOC->swap_chain_size; - assert(pARMSOC->swap_chain[idx] == cmd); + /* Free the swap cmd and remove it from the swap chain. */ + idx = cmd->swap_id % pARMSOC->swap_chain_size; + assert(pARMSOC->swap_chain[idx] == cmd); + pARMSOC->swap_chain[idx] = NULL; + } free(cmd); - pARMSOC->swap_chain[idx] = NULL; } /** @@ -740,12 +740,6 @@ ARMSOCDRI2ScheduleSwap(ClientPtr client, DrawablePtr pDraw, /* Swap chain takes a ref on original dst bo */ armsoc_bo_reference(cmd->old_dst_bo); - /* Add swap operation to the swap chain */ - cmd->swap_id = pARMSOC->swap_chain_count++; - idx = cmd->swap_id % pARMSOC->swap_chain_size; - assert(NULL == pARMSOC->swap_chain[idx]); - pARMSOC->swap_chain[idx] = cmd; - DEBUG_MSG("SWAP %d SCHEDULED : %d -> %d ", cmd->swap_id, pSrcBuffer->attachment, pDstBuffer->attachment); @@ -789,6 +783,12 @@ ARMSOCDRI2ScheduleSwap(ClientPtr client, DrawablePtr pDraw, if (do_flip) { DEBUG_MSG("FLIPPING: FB%d -> FB%d", src_fb_id, dst_fb_id); cmd->type = DRI2_FLIP_COMPLETE; + + /* Add swap operation to the swap chain */ + cmd->swap_id = pARMSOC->swap_chain_count++; + idx = cmd->swap_id % pARMSOC->swap_chain_size; + assert(NULL == pARMSOC->swap_chain[idx]); + pARMSOC->swap_chain[idx] = cmd; /* TODO: MIDEGL-1461: Handle rollback if multiple CRTC flip is * only partially successful */ |