summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/intel_winsys
diff options
context:
space:
mode:
authorBrian <[email protected]>2007-08-09 10:39:19 -0600
committerBrian <[email protected]>2007-08-09 14:26:02 -0600
commit4ab52c412d738bd26164236e69935c2f82035b1f (patch)
tree5740fa6edb35985233b8783db531a5f310cce995 /src/mesa/drivers/dri/intel_winsys
parent3614a9a8ae2badceca40f626c4a80f386c5d0177 (diff)
checkpoint: intel_renderbuffer removal (move vbl_pending field into intel_framebuffer
Diffstat (limited to 'src/mesa/drivers/dri/intel_winsys')
-rw-r--r--src/mesa/drivers/dri/intel_winsys/intel_buffers.c10
-rw-r--r--src/mesa/drivers/dri/intel_winsys/intel_context.c19
-rw-r--r--src/mesa/drivers/dri/intel_winsys/intel_fbo.h4
3 files changed, 25 insertions, 8 deletions
diff --git a/src/mesa/drivers/dri/intel_winsys/intel_buffers.c b/src/mesa/drivers/dri/intel_winsys/intel_buffers.c
index ce217ceb568..33e4b16a5cf 100644
--- a/src/mesa/drivers/dri/intel_winsys/intel_buffers.c
+++ b/src/mesa/drivers/dri/intel_winsys/intel_buffers.c
@@ -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);
diff --git a/src/mesa/drivers/dri/intel_winsys/intel_context.c b/src/mesa/drivers/dri/intel_winsys/intel_context.c
index c1d541199f9..5c184d5c8d7 100644
--- a/src/mesa/drivers/dri/intel_winsys/intel_context.c
+++ b/src/mesa/drivers/dri/intel_winsys/intel_context.c
@@ -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;
}
diff --git a/src/mesa/drivers/dri/intel_winsys/intel_fbo.h b/src/mesa/drivers/dri/intel_winsys/intel_fbo.h
index 35587f364a1..63afa6df896 100644
--- a/src/mesa/drivers/dri/intel_winsys/intel_fbo.h
+++ b/src/mesa/drivers/dri/intel_winsys/intel_fbo.h
@@ -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;
};