st/mesa: implement st_server_wait_sync properly
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Thu, 9 Nov 2017 13:34:19 +0000 (14:34 +0100)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Mon, 20 Nov 2017 17:15:07 +0000 (18:15 +0100)
commit2d8b82baaad43a41d076a5273ac0de3c03cc5a55
treea2a5ac130253a983ed9ddee7fdd25ebf6977dc84
parentce470af0b1bcb276c22dd04e627ab665e10619f7
st/mesa: implement st_server_wait_sync properly

Asynchronous flushes require a proper implementation of
st_server_wait_sync, because we could have the following with
threaded Gallium:

 Context 1 app     Context 1 driver         Context 2
 -------------     ----------------         ---------
 f = glFenceSync
 glFlush
 <-- app sync -->                           <-- app sync -->
                                            glWaitSync(f)
                                            .. draw calls ..
                   pipe_context::flush
                     for glFenceSync
                   pipe_context::flush
                     for glFlush

Reviewed-by: Andres Rodriguez <andresx7@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/mesa/state_tracker/st_cb_syncobj.c