[Mesa-dev] [PATCH 0/5] st/dri,mesa: various flushing patches

Nicolai Hähnle nhaehnle at gmail.com
Sun Oct 22 19:18:07 UTC 2017


Hi all,

Two bugs that I noticed are fixed in patches #1 and #5.

Patch #2 and #4 are mostly cleanups.

Patch #3 enables asynchronous Gallium flushes in st/mesa. Section 5.3.1
(Determining Completion of Changes to an object) states that:

   "The contents of an object T are considered to have been changed
    once a command such as described in section 5.3 has completed.
    Completion of a command[1] may be determined either by calling
    Finish, or by calling FenceSync and executing a WaitSync command
    on the associated sync object. The second method does not require
    a round trip to the GL server and may be more efficient, particularly
    when changes to T in one context must be known to have completed
    before executing commands dependent on those changes in another
    context.

    [1] The GL already specifies that a single context processes
        commands in the order they are received. This means that a
        change to an object in a context at time t must be completed by
        the time a command issued in the same context at time t + 1
        uses the result of that change."

My interpretation of this is that glFlush() does *not* require the
stronger guarantees made by Gallium flushes. (glFinish() can benefit
from asynchronous flushes either way, though that's less of a win.)

The obvious advantage of asynchronous flushes is that we need to
synchronize with the driver thread in threaded Gallium less often.

This isn't a panacea: the flush via the stapi (st_context_flush) still
requires the stronger flush due to how DRI works (I think), but perhaps
we can eventually get rid of this as well by properly using Present
fences.

Please review!
Thanks,
Nicolai
--
 src/gallium/state_trackers/dri/dri_helpers.c | 11 ++++----
 src/mesa/main/context.c                      |  2 +-
 src/mesa/main/texobj.c                       |  5 ++++
 src/mesa/state_tracker/st_cb_flush.c         |  7 ++---
 src/mesa/state_tracker/st_cb_syncobj.c       | 26 ++++++++++++++++--
 src/mesa/state_tracker/st_manager.c          |  3 ++
 src/mesa/state_tracker/st_vdpau.c            |  3 ++
 7 files changed, 44 insertions(+), 13 deletions(-)



More information about the mesa-dev mailing list