summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i915tex
diff options
context:
space:
mode:
authorThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2007-01-23 08:57:38 +0100
committerThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2007-01-23 09:06:21 +0100
commitfe9fef2cec2f9ed13370612a9a58df04b0075f15 (patch)
tree1d502c505e73c10ec2a37225dd98c3a8a271a62d /src/mesa/drivers/dri/i915tex
parent60c28739aa4afe543e0293c15a7aaf84ec2183ea (diff)
i915tex: Fix randr resizing. Rotation still broken.
Diffstat (limited to 'src/mesa/drivers/dri/i915tex')
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_context.c22
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_context.h9
2 files changed, 29 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i915tex/intel_context.c b/src/mesa/drivers/dri/i915tex/intel_context.c
index c77d365360d..c7ab6219192 100644
--- a/src/mesa/drivers/dri/i915tex/intel_context.c
+++ b/src/mesa/drivers/dri/i915tex/intel_context.c
@@ -357,6 +357,10 @@ intelInitContext(struct intel_context *intel,
intel->driScreen = sPriv;
intel->sarea = saPriv;
+ intel->width = intelScreen->width;
+ intel->height = intelScreen->height;
+ intel->current_rotation = intelScreen->current_rotation;
+
if (!lockMutexInit) {
lockMutexInit = GL_TRUE;
_glthread_INIT_MUTEX(lockMutex);
@@ -635,12 +639,22 @@ intelContendedLock(struct intel_context *intel, GLuint flags)
sarea->rotation != intelScreen->current_rotation) {
intelUpdateScreenRotation(sPriv, sarea);
+ }
+
+ if (sarea->width != intel->width ||
+ sarea->height != intel->height ||
+ sarea->rotation != intel->current_rotation) {
- /*
+ /*
+ * FIXME: Really only need to do this when drawing to a
+ * common back- or front buffer.
+ */
+
+ /*
* This will drop the outstanding batchbuffer on the floor
- * FIXME: This should be done for all contexts?
*/
+ driBOUnmap(intel->batch->buffer);
intel_batchbuffer_reset(intel->batch);
/* lose all primitives */
@@ -653,6 +667,10 @@ intelContendedLock(struct intel_context *intel, GLuint flags)
/* force window update */
intel->lastStamp = 0;
+
+ intel->width = sarea->width;
+ intel->height = sarea->height;
+ intel->current_rotation = sarea->rotation;
}
diff --git a/src/mesa/drivers/dri/i915tex/intel_context.h b/src/mesa/drivers/dri/i915tex/intel_context.h
index 7654e4ecd51..96b911501f3 100644
--- a/src/mesa/drivers/dri/i915tex/intel_context.h
+++ b/src/mesa/drivers/dri/i915tex/intel_context.h
@@ -286,6 +286,15 @@ struct intel_context
GLuint swap_missed_count;
GLuint swap_scheduled;
+
+ /* Rotation. Need to match that of the
+ * current screen.
+ */
+
+ int width;
+ int height;
+ int current_rotation;
+
};
/* These are functions now: