i915tex: Fix randr resizing. Rotation still broken.
authorThomas Hellstrom <thomas-at-tungstengraphics-dot-com>
Tue, 23 Jan 2007 07:57:38 +0000 (08:57 +0100)
committerThomas Hellstrom <thomas-at-tungstengraphics-dot-com>
Tue, 23 Jan 2007 08:06:21 +0000 (09:06 +0100)
src/mesa/drivers/dri/i915tex/intel_context.c
src/mesa/drivers/dri/i915tex/intel_context.h

index c77d365360d6bd47f5c79800bcb558b2defb89c9..c7ab62191928ec25c4c3a6750c90b8aa27e4f3a4 100644 (file)
@@ -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;
    }
 
 
index 7654e4ecd5127fc2ee85e62c4120c056e96767d5..96b911501f3fbc8f26fb26e268668f387148e54e 100644 (file)
@@ -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: