diff options
Diffstat (limited to 'src/mesa/drivers/dri/nouveau/nouveau_bufferobj.c')
-rw-r--r-- | src/mesa/drivers/dri/nouveau/nouveau_bufferobj.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_bufferobj.c b/src/mesa/drivers/dri/nouveau/nouveau_bufferobj.c index f7ad895ac9a..17827146522 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_bufferobj.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_bufferobj.c @@ -31,7 +31,8 @@ #include "main/bufferobj.h" static inline char * -get_bufferobj_map(struct gl_buffer_object *obj, unsigned flags) +get_bufferobj_map(struct gl_context *ctx, struct gl_buffer_object *obj, + unsigned flags) { struct nouveau_bufferobj *nbo = to_nouveau_bufferobj(obj); void *map = NULL; @@ -39,9 +40,8 @@ get_bufferobj_map(struct gl_buffer_object *obj, unsigned flags) if (nbo->sys) { map = nbo->sys; } else if (nbo->bo) { - nouveau_bo_map(nbo->bo, flags); + nouveau_bo_map(nbo->bo, flags, context_client(ctx)); map = nbo->bo->map; - nouveau_bo_unmap(nbo->bo); } return map; @@ -96,12 +96,12 @@ nouveau_bufferobj_data(struct gl_context *ctx, GLenum target, GLsizeiptrARB size /* Get a hardware BO */ ret = nouveau_bo_new(context_dev(ctx), NOUVEAU_BO_GART | NOUVEAU_BO_MAP, 0, - size, &nbo->bo); + size, NULL, &nbo->bo); assert(!ret); } if (data) - memcpy(get_bufferobj_map(obj, NOUVEAU_BO_WR), data, size); + memcpy(get_bufferobj_map(ctx, obj, NOUVEAU_BO_WR), data, size); return GL_TRUE; } @@ -111,7 +111,7 @@ nouveau_bufferobj_subdata(struct gl_context *ctx, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data, struct gl_buffer_object *obj) { - memcpy(get_bufferobj_map(obj, NOUVEAU_BO_WR) + offset, data, size); + memcpy(get_bufferobj_map(ctx, obj, NOUVEAU_BO_WR) + offset, data, size); } static void @@ -119,7 +119,7 @@ nouveau_bufferobj_get_subdata(struct gl_context *ctx, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data, struct gl_buffer_object *obj) { - memcpy(data, get_bufferobj_map(obj, NOUVEAU_BO_RD) + offset, size); + memcpy(data, get_bufferobj_map(ctx, obj, NOUVEAU_BO_RD) + offset, size); } static void * @@ -132,14 +132,14 @@ nouveau_bufferobj_map_range(struct gl_context *ctx, GLintptr offset, assert(!obj->Pointer); - if (access & GL_MAP_READ_BIT) - flags |= NOUVEAU_BO_RD; - if (access & GL_MAP_WRITE_BIT) - flags |= NOUVEAU_BO_WR; - if (access & GL_MAP_UNSYNCHRONIZED_BIT) - flags |= NOUVEAU_BO_NOSYNC; + if (!(access & GL_MAP_UNSYNCHRONIZED_BIT)) { + if (access & GL_MAP_READ_BIT) + flags |= NOUVEAU_BO_RD; + if (access & GL_MAP_WRITE_BIT) + flags |= NOUVEAU_BO_WR; + } - map = get_bufferobj_map(obj, flags); + map = get_bufferobj_map(ctx, obj, flags); if (!map) return NULL; |