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;
/*
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)
#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