mesa: Branch 'master' - 2 commits

Thomas Hellstrom thomash at kemper.freedesktop.org
Tue Jan 23 08:07:08 UTC 2007


 src/mesa/drivers/dri/i915tex/intel_batchbuffer.c |    2 +-
 src/mesa/drivers/dri/i915tex/intel_batchbuffer.h |    2 +-
 src/mesa/drivers/dri/i915tex/intel_context.c     |   22 ++++++++++++++++++++--
 src/mesa/drivers/dri/i915tex/intel_context.h     |    9 +++++++++
 4 files changed, 31 insertions(+), 4 deletions(-)

New commits:
diff-tree d46093b8d56f6d89b341d7437c5185ca6be597af (from fe9fef2cec2f9ed13370612a9a58df04b0075f15)
Author: Thomas Hellstrom <thomas-at-tungstengraphics-dot-com>
Date:   Tue Jan 23 09:04:58 2007 +0100

    i915tex: Relocation fixes:
    
    Increase the number of allowed relocations per batchbuffer.
    Fix an assert to avoid an array index overflow.
    (Reported by Steve Wilkins)

diff --git a/src/mesa/drivers/dri/i915tex/intel_batchbuffer.c b/src/mesa/drivers/dri/i915tex/intel_batchbuffer.c
index be2750d..c92b83b 100644
--- a/src/mesa/drivers/dri/i915tex/intel_batchbuffer.c
+++ b/src/mesa/drivers/dri/i915tex/intel_batchbuffer.c
@@ -311,7 +311,7 @@ intel_batchbuffer_emit_reloc(struct inte
                              struct _DriBufferObject *buffer,
                              GLuint flags, GLuint mask, GLuint delta)
 {
-   assert(batch->nr_relocs <= MAX_RELOCS);
+   assert(batch->nr_relocs < MAX_RELOCS);
 
    driBOAddListItem(&batch->list, buffer, flags, mask);
 
diff --git a/src/mesa/drivers/dri/i915tex/intel_batchbuffer.h b/src/mesa/drivers/dri/i915tex/intel_batchbuffer.h
index a83dbf4..59261f7 100644
--- a/src/mesa/drivers/dri/i915tex/intel_batchbuffer.h
+++ b/src/mesa/drivers/dri/i915tex/intel_batchbuffer.h
@@ -9,7 +9,7 @@ struct intel_context;
 #define BATCH_SZ 16384
 #define BATCH_RESERVED 16
 
-#define MAX_RELOCS 100
+#define MAX_RELOCS 400
 
 #define INTEL_BATCH_NO_CLIPRECTS 0x1
 #define INTEL_BATCH_CLIPRECTS    0x2
diff-tree fe9fef2cec2f9ed13370612a9a58df04b0075f15 (from 60c28739aa4afe543e0293c15a7aaf84ec2183ea)
Author: Thomas Hellstrom <thomas-at-tungstengraphics-dot-com>
Date:   Tue Jan 23 08:57:38 2007 +0100

    i915tex: Fix randr resizing. Rotation still broken.

diff --git a/src/mesa/drivers/dri/i915tex/intel_context.c b/src/mesa/drivers/dri/i915tex/intel_context.c
index c77d365..c7ab621 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 *i
    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 
        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 
 
       /* 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 7654e4e..96b9115 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:



More information about the mesa-commit mailing list