summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/nouveau/nouveau_bufferobj.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2011-12-23 14:03:49 +1000
committerBen Skeggs <bskeggs@redhat.com>2012-04-14 02:56:12 +1000
commit2e47d01c9e5325906cf3bb979279599991c6328e (patch)
tree03f161f671bf350d5455669679c98c46192f9be6 /src/mesa/drivers/dri/nouveau/nouveau_bufferobj.c
parent7308b6e75fe64f4e3f318bc7b5d276585e4f6957 (diff)
downloadexternal_mesa3d-2e47d01c9e5325906cf3bb979279599991c6328e.zip
external_mesa3d-2e47d01c9e5325906cf3bb979279599991c6328e.tar.gz
external_mesa3d-2e47d01c9e5325906cf3bb979279599991c6328e.tar.bz2
nouveau/vieux: switch to libdrm_nouveau-2.0
Diffstat (limited to 'src/mesa/drivers/dri/nouveau/nouveau_bufferobj.c')
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_bufferobj.c28
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 f7ad895..1782714 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;