diff options
author | Thomas Hellstrom <thellstrom@vmware.com> | 2012-09-20 11:41:23 +0200 |
---|---|---|
committer | Thomas Hellstrom <thellstrom@vmware.com> | 2013-12-17 09:01:29 +0100 |
commit | 3e2b0f801d7c8d80f6c0d9da3813d7ed8b84e3dd (patch) | |
tree | de9926617e5b6c2a79a1a038fa726c3ff76160bb /src/gallium | |
parent | 56d920a5c1b64868e77a97604c01d3a63916a6ca (diff) | |
download | external_mesa3d-3e2b0f801d7c8d80f6c0d9da3813d7ed8b84e3dd.zip external_mesa3d-3e2b0f801d7c8d80f6c0d9da3813d7ed8b84e3dd.tar.gz external_mesa3d-3e2b0f801d7c8d80f6c0d9da3813d7ed8b84e3dd.tar.bz2 |
st/xa: Add new map flags
Replicate some of the gallium pipe transfer functionality.
Also bump minor to signal availability of this feature.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/state_trackers/xa/xa_context.c | 20 | ||||
-rw-r--r-- | src/gallium/state_trackers/xa/xa_tracker.h | 10 |
2 files changed, 21 insertions, 9 deletions
diff --git a/src/gallium/state_trackers/xa/xa_context.c b/src/gallium/state_trackers/xa/xa_context.c index 50ef469..c2dc53b 100644 --- a/src/gallium/state_trackers/xa/xa_context.c +++ b/src/gallium/state_trackers/xa/xa_context.c @@ -132,7 +132,7 @@ xa_surface_map(struct xa_context *ctx, struct xa_surface *srf, unsigned int usage) { void *map; - unsigned int transfer_direction = 0; + unsigned int gallium_usage = 0; struct pipe_context *pipe = ctx->pipe; /* @@ -142,15 +142,23 @@ xa_surface_map(struct xa_context *ctx, return NULL; if (usage & XA_MAP_READ) - transfer_direction |= PIPE_TRANSFER_READ; + gallium_usage |= PIPE_TRANSFER_READ; if (usage & XA_MAP_WRITE) - transfer_direction |= PIPE_TRANSFER_WRITE; - - if (!transfer_direction) + gallium_usage |= PIPE_TRANSFER_WRITE; + if (usage & XA_MAP_MAP_DIRECTLY) + gallium_usage |= PIPE_TRANSFER_MAP_DIRECTLY; + if (usage & XA_MAP_UNSYNCHRONIZED) + gallium_usage |= PIPE_TRANSFER_UNSYNCHRONIZED; + if (usage & XA_MAP_DONTBLOCK) + gallium_usage |= PIPE_TRANSFER_DONTBLOCK; + if (usage & XA_MAP_DISCARD_WHOLE_RESOURCE) + gallium_usage |= PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE; + + if (!(gallium_usage & (PIPE_TRANSFER_READ_WRITE))) return NULL; map = pipe_transfer_map(pipe, srf->tex, 0, 0, - transfer_direction, 0, 0, + gallium_usage, 0, 0, srf->tex->width0, srf->tex->height0, &srf->transfer); if (!map) diff --git a/src/gallium/state_trackers/xa/xa_tracker.h b/src/gallium/state_trackers/xa/xa_tracker.h index 1230dab..43e56ff 100644 --- a/src/gallium/state_trackers/xa/xa_tracker.h +++ b/src/gallium/state_trackers/xa/xa_tracker.h @@ -37,15 +37,19 @@ #include <stdint.h> #define XA_TRACKER_VERSION_MAJOR 2 -#define XA_TRACKER_VERSION_MINOR 0 +#define XA_TRACKER_VERSION_MINOR 1 #define XA_TRACKER_VERSION_PATCH 0 #define XA_FLAG_SHARED (1 << 0) #define XA_FLAG_RENDER_TARGET (1 << 1) #define XA_FLAG_SCANOUT (1 << 2) -#define XA_MAP_READ (1 << 0) -#define XA_MAP_WRITE (1 << 1) +#define XA_MAP_READ (1 << 0) +#define XA_MAP_WRITE (1 << 1) +#define XA_MAP_MAP_DIRECTLY (1 << 2) +#define XA_MAP_UNSYNCHRONIZED (1 << 3) +#define XA_MAP_DONTBLOCK (1 << 4) +#define XA_MAP_DISCARD_WHOLE_RESOURCE (1 << 5) #define XA_ERR_NONE 0 #define XA_ERR_NORES 1 |