diff options
author | Ben Skeggs <[email protected]> | 2011-01-19 15:51:57 +1000 |
---|---|---|
committer | Ben Skeggs <[email protected]> | 2011-01-19 15:51:57 +1000 |
commit | c73a1c18b2eb15b2e42a072222a5b166080a52ef (patch) | |
tree | b9d930f9119ddee83adc2eb4aa51f6fb82b0257a /src/mesa/drivers/dri | |
parent | f7bab47e6c7cf877acf6d9bb85453851e5aa7f19 (diff) |
dri/nouveau: allow multiple maps of surface buffers
Can happen during swrast fallbacks if a buffer is somehow bound as
a render target and a texture.
Fixes gnome-shell on nv20, and gets it mostly working on nv10.
Signed-off-by: Ben Skeggs <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri')
-rw-r--r-- | src/mesa/drivers/dri/nouveau/nouveau_texture.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_texture.c b/src/mesa/drivers/dri/nouveau/nouveau_texture.c index 2480b1ea500..988208ff56e 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_texture.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_texture.c @@ -113,8 +113,10 @@ nouveau_teximage_map(struct gl_context *ctx, struct gl_texture_image *ti, if (access & GL_MAP_WRITE_BIT) flags |= NOUVEAU_BO_WR; - ret = nouveau_bo_map(s->bo, flags); - assert(!ret); + if (!s->bo->map) { + ret = nouveau_bo_map(s->bo, flags); + assert(!ret); + } ti->Data = s->bo->map + y * s->pitch + x * s->cpp; } |