diff options
author | Eric Anholt <[email protected]> | 2014-11-18 12:16:55 -0800 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2014-11-18 12:46:55 -0800 |
commit | 82e919d33bbe508b3e1ba883a01ef2512dbc8f72 (patch) | |
tree | b39b3b8e5ad91e33b786f440cb74b06f748d2904 /src/gallium/drivers/vc4/vc4_context.c | |
parent | 05f165b62d1adce60b18783407c80b9fa2efa533 (diff) |
vc4: Emit semaphore instructions for new kernel ABI.
Previously, the kernel would dispatch thread 0, wait, then dispatch thread
1. By insisting that the thread contents use semaphores in the right
place, the kernel can sleep for longer by dispatching both threads at
once.
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_context.c')
-rw-r--r-- | src/gallium/drivers/vc4/vc4_context.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/gallium/drivers/vc4/vc4_context.c b/src/gallium/drivers/vc4/vc4_context.c index b1f0f353fcc..a6becaf73fc 100644 --- a/src/gallium/drivers/vc4/vc4_context.c +++ b/src/gallium/drivers/vc4/vc4_context.c @@ -203,6 +203,12 @@ vc4_setup_rcl(struct vc4_context *vc4) */ vc4_tile_coordinates(vc4, x, y, &coords_emitted); + /* Wait for the binner before jumping to the first + * tile's lists. + */ + if (x == 0 && y == 0) + cl_u8(&vc4->rcl, VC4_PACKET_WAIT_ON_SEMAPHORE); + cl_start_reloc(&vc4->rcl, 1); cl_u8(&vc4->rcl, VC4_PACKET_BRANCH_TO_SUB_LIST); cl_reloc(vc4, &vc4->rcl, vc4->tile_alloc, @@ -269,12 +275,14 @@ vc4_flush(struct pipe_context *pctx) if (!vc4->needs_flush) return; + /* Increment the semaphore indicating that binning is done and + * unblocking the render thread. Note that this doesn't act until the + * FLUSH completes. + */ + cl_u8(&vc4->bcl, VC4_PACKET_INCREMENT_SEMAPHORE); /* The FLUSH caps all of our bin lists with a VC4_PACKET_RETURN. */ cl_u8(&vc4->bcl, VC4_PACKET_FLUSH); - cl_u8(&vc4->bcl, VC4_PACKET_NOP); - cl_u8(&vc4->bcl, VC4_PACKET_HALT); - vc4_setup_rcl(vc4); if (vc4_debug & VC4_DEBUG_CL) { |