aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys/svga
diff options
context:
space:
mode:
authorJakob Bornecrantz <[email protected]>2010-04-19 20:09:38 +0100
committerJakob Bornecrantz <[email protected]>2010-04-19 21:42:49 +0100
commitaa857509bd0032f636ebf45bebb143cc6a8e408e (patch)
tree4d33c8e4f3694c535b78959784de265c4fceaac1 /src/gallium/winsys/svga
parent2a5667a0082232b63a957841c4ae45a88860955e (diff)
svga: Translate svga reloc flags to pb flags
Diffstat (limited to 'src/gallium/winsys/svga')
-rw-r--r--src/gallium/winsys/svga/drm/vmw_context.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/gallium/winsys/svga/drm/vmw_context.c b/src/gallium/winsys/svga/drm/vmw_context.c
index 90ffc4868f7..104d03f2730 100644
--- a/src/gallium/winsys/svga/drm/vmw_context.c
+++ b/src/gallium/winsys/svga/drm/vmw_context.c
@@ -114,6 +114,19 @@ vmw_svga_winsys_context(struct svga_winsys_context *swc)
}
+static INLINE unsigned
+vmw_translate_to_pb_flags(unsigned flags)
+{
+ unsigned f = 0;
+ if (flags & SVGA_RELOC_READ)
+ f |= PB_USAGE_GPU_READ;
+
+ if (flags & SVGA_RELOC_WRITE)
+ f |= PB_USAGE_GPU_WRITE;
+
+ return f;
+}
+
static enum pipe_error
vmw_swc_flush(struct svga_winsys_context *swc,
struct pipe_fence_handle **pfence)
@@ -264,6 +277,7 @@ vmw_swc_region_relocation(struct svga_winsys_context *swc,
{
struct vmw_svga_winsys_context *vswc = vmw_svga_winsys_context(swc);
struct vmw_region_relocation *reloc;
+ unsigned translated_flags;
enum pipe_error ret;
assert(vswc->region.staged < vswc->region.reserved);
@@ -275,7 +289,8 @@ vmw_swc_region_relocation(struct svga_winsys_context *swc,
++vswc->region.staged;
- ret = pb_validate_add_buffer(vswc->validate, reloc->buffer, flags);
+ translated_flags = vmw_translate_to_pb_flags(flags);
+ ret = pb_validate_add_buffer(vswc->validate, reloc->buffer, translated_flags);
/* TODO: Update pipebuffer to reserve buffers and not fail here */
assert(ret == PIPE_OK);