diff options
author | Thomas Hellstrom <thomas-at-tungstengraphics-dot-com> | 2007-02-14 11:11:23 +0100 |
---|---|---|
committer | Thomas Hellstrom <thomas-at-tungstengraphics-dot-com> | 2007-02-14 11:11:37 +0100 |
commit | bc82b44db9dbb6ea0f02c2a9a430e8d402c85bd3 (patch) | |
tree | 1de309022f75ae2dad3d56cc9d7ba410da6116dc /src/mesa/drivers/dri/i915tex | |
parent | 1e6688742e6a6e11d002c1fce5dca3da3d58594f (diff) |
i915tex: Take into account various mapping states when dropping the
batch buffer after a resolution / rotation switch.
Diffstat (limited to 'src/mesa/drivers/dri/i915tex')
-rw-r--r-- | src/mesa/drivers/dri/i915tex/intel_context.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i915tex/intel_context.c b/src/mesa/drivers/dri/i915tex/intel_context.c index aa76875a4a..a5ce08b170 100644 --- a/src/mesa/drivers/dri/i915tex/intel_context.c +++ b/src/mesa/drivers/dri/i915tex/intel_context.c @@ -643,7 +643,9 @@ intelContendedLock(struct intel_context *intel, GLuint flags) if (sarea->width != intel->width || sarea->height != intel->height || sarea->rotation != intel->current_rotation) { - + + void *batchMap = intel->batch->map; + /* * FIXME: Really only need to do this when drawing to a * common back- or front buffer. @@ -653,9 +655,18 @@ intelContendedLock(struct intel_context *intel, GLuint flags) * This will drop the outstanding batchbuffer on the floor */ - driBOUnmap(intel->batch->buffer); + if (batchMap != NULL) { + driBOUnmap(intel->batch->buffer); + intel->batch->map = NULL; + } + intel_batchbuffer_reset(intel->batch); + if (batchMap == NULL) { + driBOUnmap(intel->batch->buffer); + intel->batch->map = NULL; + } + /* lose all primitives */ intel->prim.primitive = ~0; intel->prim.start_ptr = 0; |