Mesa (gallium-resources): i915: hook up userbuffer create

Keith Whitwell keithw at kemper.freedesktop.org
Sun Mar 14 18:29:33 UTC 2010


Module: Mesa
Branch: gallium-resources
Commit: 563ca458b548c41ca4dca559354c16ca1a80d009
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=563ca458b548c41ca4dca559354c16ca1a80d009

Author: Keith Whitwell <keithw at vmware.com>
Date:   Sun Mar 14 18:18:42 2010 +0000

i915: hook up userbuffer create

---

 src/gallium/drivers/i915/i915_resource.c         |    1 +
 src/gallium/drivers/i915/i915_resource_texture.c |    8 +++-----
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/gallium/drivers/i915/i915_resource.c b/src/gallium/drivers/i915/i915_resource.c
index 5767cb2..499233c 100644
--- a/src/gallium/drivers/i915/i915_resource.c
+++ b/src/gallium/drivers/i915/i915_resource.c
@@ -47,4 +47,5 @@ i915_init_screen_resource_functions(struct i915_screen *is)
    is->base.resource_from_handle = i915_resource_from_handle;
    is->base.resource_get_handle = u_resource_get_handle_vtbl;
    is->base.resource_destroy = u_resource_destroy_vtbl;
+   is->base.user_buffer_create = i915_user_buffer_create;
 }
diff --git a/src/gallium/drivers/i915/i915_resource_texture.c b/src/gallium/drivers/i915/i915_resource_texture.c
index 570d53c..2456511 100644
--- a/src/gallium/drivers/i915/i915_resource_texture.c
+++ b/src/gallium/drivers/i915/i915_resource_texture.c
@@ -662,7 +662,6 @@ i915_texture_transfer_map(struct pipe_context *pipe,
    enum pipe_format format = resource->format;
    unsigned offset;
    char *map;
-   boolean write = FALSE;
 
    if (resource->target == PIPE_TEXTURE_CUBE) {
       offset = tex->image_offset[sr.level][sr.face];
@@ -676,10 +675,9 @@ i915_texture_transfer_map(struct pipe_context *pipe,
       assert(box->z == 0);
    }
 
-   if (transfer->usage & PIPE_TRANSFER_WRITE)
-      write = TRUE;
-
-   map = iws->buffer_map(iws, tex->buffer, write);
+   map = iws->buffer_map(iws,
+			 tex->buffer,
+			 (transfer->usage & PIPE_TRANSFER_WRITE) ? TRUE : FALSE);
    if (map == NULL)
       return NULL;
 




More information about the mesa-commit mailing list