diff options
author | Roland Scheidegger <sroland@vmware.com> | 2010-04-30 15:27:13 +0200 |
---|---|---|
committer | Roland Scheidegger <sroland@vmware.com> | 2010-04-30 15:27:13 +0200 |
commit | 7662e3519bef3802024da3050b886068281e02b1 (patch) | |
tree | bc5bf675e67febffaf9e4d1fadd139e8c253ae32 /src/gallium/winsys/svga/drm | |
parent | 9a966b93c03aecac8eb72e6133aa9a2f2c7673f3 (diff) | |
parent | 7c769bef052fc1936d7ab33e291bb4646dc5b0d1 (diff) |
Merge commit 'origin/master' into gallium-msaa
Diffstat (limited to 'src/gallium/winsys/svga/drm')
-rw-r--r-- | src/gallium/winsys/svga/drm/vmw_context.c | 17 |
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 90ffc4868f..104d03f273 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); |