Merge branch 'i915tex_privbuffers' into softpipe_0_1_branch
authorKeith Whitwell <keith@tungstengraphics.com>
Tue, 31 Jul 2007 13:37:45 +0000 (14:37 +0100)
committerKeith Whitwell <keith@tungstengraphics.com>
Tue, 31 Jul 2007 13:37:45 +0000 (14:37 +0100)
Conflicts:

src/mesa/drivers/dri/i915tex/intel_buffers.c
src/mesa/drivers/dri/i915tex/intel_context.c
src/mesa/drivers/dri/i915tex/intel_fbo.c
src/mesa/drivers/dri/i915tex/intel_pixel_draw.c

1  2 
src/mesa/drivers/dri/common/dri_util.c
src/mesa/drivers/dri/i915tex/i915_vtbl.c
src/mesa/drivers/dri/i915tex/intel_buffers.c
src/mesa/drivers/dri/i915tex/intel_context.c
src/mesa/drivers/dri/i915tex/intel_fbo.c
src/mesa/drivers/dri/i915tex/intel_fbo.h

index 17b4feadf854f1d4c84b41c2018d41c06a1afd9d,4b2a4acaf98130cf9d59285647c74d8123149f00..72c7b5ae454e9df7898ac75b8a5964f0533cb024
@@@ -788,10 -583,8 +586,9 @@@ intelScheduleSwap(const __DRIdrawablePr
     drm_i915_vblank_swap_t swap;
     GLboolean ret;
  
 -   if ((intel_fb->vblank_flags & VBLANK_FLAG_NO_IRQ) ||
 -        intelScreen->drmMinor < (intel_fb->pf_active ? 9 : 6))
 +   if (!intel_fb->vblank_flags ||
 +       (intel_fb->vblank_flags & VBLANK_FLAG_NO_IRQ) ||
-        intelScreen->current_rotation != 0 ||
 +       intelScreen->drmMinor < (intel_fb->pf_active ? 9 : 6))
        return GL_FALSE;
  
     swap.seqtype = DRM_VBLANK_ABSOLUTE;
index 61842da29d9827adc3a36804eef8bd0f6d821833,f032c97dfbb02382c4fcb27e666f20066492055c..5ab919ecb60605f3409c56d33b2ff2ba4a3f34a9
@@@ -646,29 -605,22 +617,33 @@@ intelMakeCurrent(__DRIcontextPrivate * 
        if (intel->ctx.DrawBuffer == &intel_fb->Base) {
  
         if (intel->driDrawable != driDrawPriv) {
 -          intel_fb->vblank_flags = (intel->intelScreen->irq_active != 0)
 -             ? driGetDefaultVBlankFlags(&intel->optionCache)
 -             : VBLANK_FLAG_NO_IRQ;
 -          (*dri_interface->getUST) (&intel_fb->swap_ust);
 -          driDrawableInitVBlank(driDrawPriv, intel_fb->vblank_flags,
 -                                &intel_fb->vbl_seq);
 +          if (driDrawPriv->pdraw->swap_interval == (unsigned)-1) {
 +             int i;
 +
 +             intel_fb->vblank_flags = (intel->intelScreen->irq_active != 0)
 +                ? driGetDefaultVBlankFlags(&intel->optionCache)
 +               : VBLANK_FLAG_NO_IRQ;
 +
 +             (*dri_interface->getUST) (&intel_fb->swap_ust);
 +             driDrawableInitVBlank(driDrawPriv, intel_fb->vblank_flags,
 +                                   &intel_fb->vbl_seq);
 +             intel_fb->vbl_waited = intel_fb->vbl_seq;
 +
-              for (i = 0; i < (intel->intelScreen->third.handle ? 3 : 2); i++) {
++             for (i = 0; i < 2; i++) {
 +                if (intel_fb->color_rb[i])
 +                   intel_fb->color_rb[i]->vbl_pending = intel_fb->vbl_seq;
 +             }
 +          }
-           intel->driDrawable = driDrawPriv;
-           intelWindowMoved(intel);
         }
+       }
  
-        intel_draw_buffer(&intel->ctx, &intel_fb->Base);
+       if ((intel->driDrawable != driDrawPriv) ||
+         (intel->lastStamp != driDrawPriv->lastStamp)) {
+           intel->driDrawable = driDrawPriv;
+           intelWindowMoved(intel);
+           intel->lastStamp = driDrawPriv->lastStamp;
        }
     }
     else {
        _mesa_make_current(NULL, NULL, NULL);
index 5a93eb7ad1987a10739d3ac539b395314cfb5efa,04ca5ae8ba0da25c5725e82d94964f31035065f2..559788f20a9b3f053b716e90f4b86e8ced0bdd80
@@@ -383,101 -352,19 +358,21 @@@ intel_new_renderbuffer_fb(GLuint intFor
  
     switch (intFormat) {
     case GL_RGB5:
-       irb->Base._ActualFormat = GL_RGB5;
-       irb->Base._BaseFormat = GL_RGBA;
-       irb->Base.RedBits = 5;
-       irb->Base.GreenBits = 6;
-       irb->Base.BlueBits = 5;
-       irb->Base.DataType = GL_UNSIGNED_BYTE;
-       cpp = 2;
-       break;
     case GL_RGBA8:
-       irb->Base._ActualFormat = GL_RGBA8;
        irb->Base._BaseFormat = GL_RGBA;
-       irb->Base.RedBits = 8;
-       irb->Base.GreenBits = 8;
-       irb->Base.BlueBits = 8;
-       irb->Base.AlphaBits = 8;
-       irb->Base.DataType = GL_UNSIGNED_BYTE;
-       cpp = 4;
-       break;
-    case GL_STENCIL_INDEX8_EXT:
-       irb->Base._ActualFormat = GL_STENCIL_INDEX8_EXT;
-       irb->Base._BaseFormat = GL_STENCIL_INDEX;
-       irb->Base.StencilBits = 8;
-       irb->Base.DataType = GL_UNSIGNED_BYTE;
-       cpp = 1;
        break;
     case GL_DEPTH_COMPONENT16:
-       irb->Base._ActualFormat = GL_DEPTH_COMPONENT16;
        irb->Base._BaseFormat = GL_DEPTH_COMPONENT;
-       irb->Base.DepthBits = 16;
-       irb->Base.DataType = GL_UNSIGNED_SHORT;
-       cpp = 2;
-       break;
-    case GL_DEPTH_COMPONENT24:
-       irb->Base._ActualFormat = GL_DEPTH24_STENCIL8_EXT;
-       irb->Base._BaseFormat = GL_DEPTH_COMPONENT;
-       irb->Base.DepthBits = 24;
-       irb->Base.DataType = GL_UNSIGNED_INT;
-       cpp = 4;
        break;
     case GL_DEPTH24_STENCIL8_EXT:
-       irb->Base._ActualFormat = GL_DEPTH24_STENCIL8_EXT;
        irb->Base._BaseFormat = GL_DEPTH_STENCIL_EXT;
-       irb->Base.DepthBits = 24;
-       irb->Base.StencilBits = 8;
-       irb->Base.DataType = GL_UNSIGNED_INT_24_8_EXT;
-       cpp = 4;
        break;
     default:
 -      assert(0);
 +      _mesa_problem(NULL,
-                     "Unexpected intFormat in intel_create_renderbuffer");
++                  "Unexpected intFormat in intel_create_renderbuffer");
 +      return NULL;
     }
  
-    irb->Base.InternalFormat = intFormat;
-    /* intel-specific methods */
-    irb->Base.Delete = intel_delete_renderbuffer;
-    irb->Base.AllocStorage = intel_alloc_window_storage;
-    irb->Base.GetPointer = intel_get_pointer;
-    /* This sets the Get/PutRow/Value functions */
-    intel_set_span_functions(&irb->Base);
-    irb->pfMap = map;
-    irb->pfPitch = pitch / cpp;        /* in pixels */
- #if 00
-    irb->region = intel_region_create_static(intel,
-                                             DRM_MM_TT,
-                                             offset, map, cpp, width, height);
- #endif
-    return irb;
- }
- /**
-  * Create a new renderbuffer which corresponds to an X window buffer
-  * (color, depth, stencil, etc) - not a user-created GL renderbuffer.
-  * The internal format is set at creation time and does not change.
-  */
- struct gl_renderbuffer *
- intel_new_renderbuffer_fb(GLcontext * ctx, GLuint intFormat)
- {
-    struct intel_renderbuffer *irb;
-    irb = CALLOC_STRUCT(intel_renderbuffer);
-    if (!irb) {
-       _mesa_error(ctx, GL_OUT_OF_MEMORY, "creating renderbuffer");
-       return NULL;
-    }
-    _mesa_init_renderbuffer(&irb->Base, 0);
-    irb->Base.ClassID = INTEL_RB_CLASS;
-    irb->Base.InternalFormat = intFormat;
     /* intel-specific methods */
     irb->Base.Delete = intel_delete_renderbuffer;
     irb->Base.AllocStorage = intel_alloc_renderbuffer_storage;
index 86c810608451e23258ecc13266fe3df7af2bd9fc,762aac594e8acdbb7f7490459e42c7273f0c6801..7dc39675337701701ca490227bf8bbaf9f99fe21
@@@ -87,11 -82,9 +87,11 @@@ struct intel_renderbuffe
     GLuint pf_pending;  /**< sequence number of pending flip */
  
     GLuint vbl_pending;   /**< vblank sequence number of pending flip */
 +
 +   struct intel_surface *surface;
  };
  
+ #if 0
  extern struct intel_renderbuffer *intel_create_renderbuffer(GLenum intFormat,
                                                              GLsizei width,
                                                              GLsizei height,