checkpoint: intel_renderbuffer removal (move vbl_pending field into intel_framebuffer
authorBrian <brian@i915.localnet.net>
Thu, 9 Aug 2007 16:39:19 +0000 (10:39 -0600)
committerBrian <brian@i915.localnet.net>
Thu, 9 Aug 2007 20:26:02 +0000 (14:26 -0600)
src/mesa/drivers/dri/intel_winsys/intel_buffers.c
src/mesa/drivers/dri/intel_winsys/intel_context.c
src/mesa/drivers/dri/intel_winsys/intel_fbo.h

index ce217ceb568f4bf7f379015ac84f171a0a0b2997..33e4b16a5cfa40b116a7cc441322e8d8f901b8a7 100644 (file)
@@ -241,11 +241,11 @@ intelWindowMoved(struct intel_context *intel)
 
         for (i = 0; i < intel_fb->pf_num_pages; i++) {
            if (!intel_fb->color_rb[i] ||
-               (intel_fb->vbl_waited - intel_fb->color_rb[i]->vbl_pending) <=
+               (intel_fb->vbl_waited - intel_fb->vbl_pending[i]) <=
                (1<<23))
               continue;
 
-           vbl.request.sequence = intel_fb->color_rb[i]->vbl_pending;
+           vbl.request.sequence = intel_fb->vbl_pending[i];
            drmWaitVBlank(intel->driFd, &vbl);
         }
 
@@ -255,7 +255,7 @@ intelWindowMoved(struct intel_context *intel)
 
         for (i = 0; i < intel_fb->pf_num_pages; i++) {
            if (intel_fb->color_rb[i])
-              intel_fb->color_rb[i]->vbl_pending = intel_fb->vbl_waited;
+              intel_fb->vbl_pending[i] = intel_fb->vbl_waited;
         }
       }
    }
@@ -420,10 +420,14 @@ intelScheduleSwap(const __DRIdrawablePrivate * dPriv, GLboolean *missed_target)
       swap.sequence -= target;
       *missed_target = swap.sequence > 0 && swap.sequence <= (1 << 23);
 
+#if 1
+      intel_fb->vbl_pending[1] = intel_fb->vbl_pending[0] = intel_fb->vbl_seq;
+#else
       intel_get_renderbuffer(&intel_fb->Base, BUFFER_BACK_LEFT)->vbl_pending =
         intel_get_renderbuffer(&intel_fb->Base,
                                BUFFER_FRONT_LEFT)->vbl_pending =
         intel_fb->vbl_seq;
+#endif
 
       if (swap.seqtype & DRM_VBLANK_FLIP) {
         intel_flip_renderbuffers(intel_fb);
index c1d541199f9eba0ab775d5744b92ee3b8dfa52ad..5c184d5c8d7f78cdf5d0e765f22fa1c813afd353 100644 (file)
@@ -574,8 +574,12 @@ intelMakeCurrent(__DRIcontextPrivate * driContextPriv,
               intel_fb->vbl_waited = intel_fb->vbl_seq;
 
               for (i = 0; i < 2; i++) {
+#if 1
+                  intel_fb->vbl_pending[i] = intel_fb->vbl_seq;
+#else
                  if (intel_fb->color_rb[i])
                     intel_fb->color_rb[i]->vbl_pending = intel_fb->vbl_seq;
+#endif
               }
            }
         }
@@ -663,24 +667,31 @@ void LOCK_HARDWARE( struct intel_context *intel )
 {
     char __ret=0;
     struct intel_framebuffer *intel_fb = NULL;
+#if 0
     struct intel_renderbuffer *intel_rb = NULL;
+#else
+    int curbuf;
+#endif
     _glthread_LOCK_MUTEX(lockMutex);
     assert(!intel->locked);
 
     if (intel->driDrawable) {
        intel_fb = intel->driDrawable->driverPrivate;
-
+#if 0
        if (intel_fb)
          intel_rb =
             intel_get_renderbuffer(&intel_fb->Base,
                                    intel_fb->Base._ColorDrawBufferMask[0] ==
                                    BUFFER_BIT_FRONT_LEFT ? BUFFER_FRONT_LEFT :
                                    BUFFER_BACK_LEFT);
+#endif
     }
 
-    if (intel_rb && intel_fb->vblank_flags &&
+    curbuf = 0; /* current draw buf: 0 = front, 1 = back */
+
+    if (intel_fb && intel_fb->vblank_flags &&
        !(intel_fb->vblank_flags & VBLANK_FLAG_NO_IRQ) &&
-       (intel_fb->vbl_waited - intel_rb->vbl_pending) > (1<<23)) {
+       (intel_fb->vbl_waited - intel_fb->vbl_pending[curbuf]) > (1<<23)) {
        drmVBlank vbl;
 
        vbl.request.type = DRM_VBLANK_ABSOLUTE;
@@ -689,7 +700,7 @@ void LOCK_HARDWARE( struct intel_context *intel )
            vbl.request.type |= DRM_VBLANK_SECONDARY;
        }
 
-       vbl.request.sequence = intel_rb->vbl_pending;
+       vbl.request.sequence = intel_fb->vbl_pending[curbuf];
        drmWaitVBlank(intel->driFd, &vbl);
        intel_fb->vbl_waited = vbl.reply.sequence;
     }
index 35587f364a1e7b8b7fbafa93f88e6a942d733968..63afa6df896c553c8152f49a0a6ec694c730f40a 100644 (file)
@@ -64,6 +64,8 @@ struct intel_framebuffer
 
    GLuint swap_count;
    GLuint swap_missed_count;
+
+   GLuint vbl_pending[3];  /**< [number of color buffers] */
 };
 
 
@@ -86,9 +88,9 @@ struct intel_renderbuffer
    GLuint PairedStencil; /**< only used if this is a stencil renderbuffer */
 
    GLuint pf_pending;  /**< sequence number of pending flip */
-#endif
 
    GLuint vbl_pending;   /**< vblank sequence number of pending flip */
+#endif
 
    struct intel_surface *surface;
 };