OSDN Git Service

freedreno: add synchronization between mesa and ddx
authorRob Clark <robclark@freedesktop.org>
Thu, 25 Apr 2013 20:36:15 +0000 (16:36 -0400)
committerRob Clark <robclark@freedesktop.org>
Thu, 25 Apr 2013 21:33:59 +0000 (17:33 -0400)
commitb3a3a77823ada2eb37233678b5a49efaec9b75cb
treef7ca28117adf931551667fc4b020922494408987
parentec3c257eb6958da493aee6f010f51a07d7ba4160
freedreno: add synchronization between mesa and ddx

Super-cheezy way to synchronization between mesa and ddx..  the
SET_ACTIVE ioctl gives us a way to stash a 32b # w/ a GEM bo, and
GET_BUFINFO gives us a way to retrieve it.  We use this to stash
the timestamp of the last ISSUEIBCMDS on the buffer.

To avoid an obscene amount of syscalls, we:
 1) Only set the timestamp for buffers w/ an flink name, ie.
    only buffers shared across processes.  This is enough to
    catch the DRI2 buffers.
 2) Only set the timestamp for buffers submitted to the 3d ring
    and only check the timestamps on buffers submitted to the
    2d ring.  This should be enough to handle synchronizing of
    presentation blit.  We could do synchronization in the other
    direction too, but that would be problematic if we are using
    the 3d ring from DDX, since client side wouldn't know this.

The waiting on timestamp happens before flush, and setting of
timestamp happens after flush.  It is transparent to the user
of libdrm_freedreno as all the tracking of buffers happens via
_emit_reloc()..

Signed-off-by: Rob Clark <robclark@freedesktop.org>
freedreno/freedreno_bo.c
freedreno/freedreno_pipe.c
freedreno/freedreno_priv.h
freedreno/freedreno_ringbuffer.c