diff options
author | Chia-I Wu <[email protected]> | 2014-07-28 09:28:05 +0800 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2014-07-28 22:57:22 +0800 |
commit | 7395432f2e792f8719b03bb39b0cf5cba8ba583b (patch) | |
tree | 4a6a726b1aad0db6f8e48463cf13db5c5f6985e8 /src/gallium/drivers/ilo/ilo_transfer.h | |
parent | 0a0e57b0705925d2350b79a32d007d29980499d6 (diff) |
ilo: try unblocking a transfer with a staging bo
When mapping a busy resource with PIPE_TRANSFER_DISCARD_RANGE or
PIPE_TRANSFER_FLUSH_EXPLICIT, we can avoid blocking by allocating and mapping
a staging bo, and emit pipelined copies at proper places. Since the staging
bo is never bound to GPU, we give it packed layout to save space.
Diffstat (limited to 'src/gallium/drivers/ilo/ilo_transfer.h')
-rw-r--r-- | src/gallium/drivers/ilo/ilo_transfer.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/gallium/drivers/ilo/ilo_transfer.h b/src/gallium/drivers/ilo/ilo_transfer.h index b346f457159..d7f4838d384 100644 --- a/src/gallium/drivers/ilo/ilo_transfer.h +++ b/src/gallium/drivers/ilo/ilo_transfer.h @@ -32,12 +32,21 @@ #include "ilo_common.h" +/* + * Direct mappings are always page aligned, but ILO_TRANSFER_MAP_STAGING is + * not. + */ +#define ILO_TRANSFER_MAP_BUFFER_ALIGNMENT 64 + enum ilo_transfer_map_method { /* map() / map_gtt() / map_unsynchronized() */ ILO_TRANSFER_MAP_CPU, ILO_TRANSFER_MAP_GTT, ILO_TRANSFER_MAP_GTT_UNSYNC, + /* use staging resource */ + ILO_TRANSFER_MAP_STAGING, + /* use staging system buffer */ ILO_TRANSFER_MAP_SW_CONVERT, ILO_TRANSFER_MAP_SW_ZS, @@ -47,7 +56,11 @@ struct ilo_transfer { struct pipe_transfer base; enum ilo_transfer_map_method method; - void *staging_sys; + /* pipe_resource, system memory, or garbage depending on the method */ + union { + struct pipe_resource *res; + void *sys; + } staging; }; struct ilo_context; |