diff options
author | Rob Clark <robclark@freedesktop.org> | 2016-05-20 17:19:04 -0400 |
---|---|---|
committer | Rob Clark <robclark@freedesktop.org> | 2016-07-20 19:42:21 -0400 |
commit | 2ca73c666aca726d9f6b6ddc2b5ee1d28513320f (patch) | |
tree | b8e62aacdec8b6c272e9b347bdcdd972e44d2610 /freedreno | |
parent | 73db0a0421006d7b4af837c7a77dacbb005b800f (diff) | |
download | libdrm-2ca73c666aca726d9f6b6ddc2b5ee1d28513320f.tar.gz libdrm-2ca73c666aca726d9f6b6ddc2b5ee1d28513320f.tar.bz2 libdrm-2ca73c666aca726d9f6b6ddc2b5ee1d28513320f.zip |
freedreno: add simpler ring-reloc
Provide a way to insert a reference (ie. OUT_IB()) to a target ring,
executing all the cmds in the target ring from the start.
Sometimes the ringmarker stuff is just overkill. And it will won't
really work properly once we support multiple physical cmdstream buffers
per fd_ringbuffer. So in the future the old ringmarker related APIs
will be deprecated in a few releases.
Signed-off-by: Rob Clark <robclark@freedesktop.org>
Diffstat (limited to 'freedreno')
-rw-r--r-- | freedreno/freedreno_drmif.h | 9 | ||||
-rw-r--r-- | freedreno/freedreno_ringbuffer.c | 12 | ||||
-rw-r--r-- | freedreno/freedreno_ringbuffer.h | 14 |
3 files changed, 28 insertions, 7 deletions
diff --git a/freedreno/freedreno_drmif.h b/freedreno/freedreno_drmif.h index 02dcfd25..15ae0756 100644 --- a/freedreno/freedreno_drmif.h +++ b/freedreno/freedreno_drmif.h @@ -32,6 +32,15 @@ #include <xf86drm.h> #include <stdint.h> +#if defined(__GNUC__) +# define deprecated __attribute__((__deprecated__)) +#else +# define deprecated +#endif + +/* an empty marker for things that will be deprecated in the future: */ +#define will_be_deprecated + struct fd_bo; struct fd_pipe; struct fd_device; diff --git a/freedreno/freedreno_ringbuffer.c b/freedreno/freedreno_ringbuffer.c index 9d987aaf..be802965 100644 --- a/freedreno/freedreno_ringbuffer.c +++ b/freedreno/freedreno_ringbuffer.c @@ -112,6 +112,16 @@ fd_ringbuffer_emit_reloc_ring(struct fd_ringbuffer *ring, ring->funcs->emit_reloc_ring(ring, target->ring, submit_offset, size); } +uint32_t +fd_ringbuffer_emit_reloc_ring_full(struct fd_ringbuffer *ring, + struct fd_ringbuffer *target, uint32_t cmd_idx) +{ + uint32_t size = offset_bytes(target->cur, target->start); + assert(cmd_idx == 0); + ring->funcs->emit_reloc_ring(ring, target, 0, size); + return size; +} + struct fd_ringmarker * fd_ringmarker_new(struct fd_ringbuffer *ring) { struct fd_ringmarker *marker = NULL; @@ -124,7 +134,7 @@ struct fd_ringmarker * fd_ringmarker_new(struct fd_ringbuffer *ring) marker->ring = ring; - fd_ringmarker_mark(marker); + marker->cur = marker->ring->cur; return marker; } diff --git a/freedreno/freedreno_ringbuffer.h b/freedreno/freedreno_ringbuffer.h index 578cdb24..643f50b7 100644 --- a/freedreno/freedreno_ringbuffer.h +++ b/freedreno/freedreno_ringbuffer.h @@ -75,14 +75,16 @@ struct fd_reloc { }; void fd_ringbuffer_reloc(struct fd_ringbuffer *ring, const struct fd_reloc *reloc); -void fd_ringbuffer_emit_reloc_ring(struct fd_ringbuffer *ring, +will_be_deprecated void fd_ringbuffer_emit_reloc_ring(struct fd_ringbuffer *ring, struct fd_ringmarker *target, struct fd_ringmarker *end); +uint32_t fd_ringbuffer_emit_reloc_ring_full(struct fd_ringbuffer *ring, + struct fd_ringbuffer *target, uint32_t cmd_idx); -struct fd_ringmarker * fd_ringmarker_new(struct fd_ringbuffer *ring); -void fd_ringmarker_del(struct fd_ringmarker *marker); -void fd_ringmarker_mark(struct fd_ringmarker *marker); -uint32_t fd_ringmarker_dwords(struct fd_ringmarker *start, +will_be_deprecated struct fd_ringmarker * fd_ringmarker_new(struct fd_ringbuffer *ring); +will_be_deprecated void fd_ringmarker_del(struct fd_ringmarker *marker); +will_be_deprecated void fd_ringmarker_mark(struct fd_ringmarker *marker); +will_be_deprecated uint32_t fd_ringmarker_dwords(struct fd_ringmarker *start, struct fd_ringmarker *end); -int fd_ringmarker_flush(struct fd_ringmarker *marker); +will_be_deprecated int fd_ringmarker_flush(struct fd_ringmarker *marker); #endif /* FREEDRENO_RINGBUFFER_H_ */ |