summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri
diff options
context:
space:
mode:
authorMichel Dänzer <michel@daenzer.net>2006-09-28 14:10:47 +0000
committerMichel Dänzer <michel@daenzer.net>2006-09-28 14:10:47 +0000
commitaf866291da0856482bd10d1c8e7ee907af2a0d39 (patch)
tree27dff950630d41ae1b4ccca95b156530dcac342e /src/mesa/drivers/dri
parent4abf2706e938a2c5d68c66985140bcad360eba3c (diff)
Synchronize drawable to the pipe where the bigger part can be visible.
This requires the DDX driver to set the corresponding fields in the SAREA, so check its minor version.
Diffstat (limited to 'src/mesa/drivers/dri')
-rw-r--r--src/mesa/drivers/dri/i915/intel_context.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i915/intel_context.c b/src/mesa/drivers/dri/i915/intel_context.c
index 45d8fb32616..480b442211d 100644
--- a/src/mesa/drivers/dri/i915/intel_context.c
+++ b/src/mesa/drivers/dri/i915/intel_context.c
@@ -572,6 +572,36 @@ void intelWindowMoved( intelContextPtr intel )
{
GLcontext *ctx = &intel->ctx;
+ if (intel->intelScreen->driScrnPriv->ddxMinor >= 7) {
+ drmI830Sarea *sarea = intel->sarea;
+ drm_clip_rect_t drw_rect = { .x1 = dPriv->x, .x2 = dPriv->x + dPriv->w,
+ .y1 = dPriv->y, .y2 = dPriv->y + dPriv->h };
+ drm_clip_rect_t pipeA_rect = { .x1 = sarea->pipeA_x,
+ .x2 = sarea->pipeA_x + sarea->pipeA_w,
+ .y1 = sarea->pipeA_y,
+ .y2 = sarea->pipeA_y + sarea->pipeA_h };
+ drm_clip_rect_t pipeB_rect = { .x1 = sarea->pipeB_x,
+ .x2 = sarea->pipeB_x + sarea->pipeB_w,
+ .y1 = sarea->pipeB_y,
+ .y2 = sarea->pipeB_y + sarea->pipeB_h };
+ GLint areaA = driIntersectArea( drw_rect, pipeA_rect );
+ GLint areaB = driIntersectArea( drw_rect, pipeB_rect );
+ GLuint flags = intel->vblank_flags;
+
+ if (areaB > areaA || (areaA > 0 && areaB > 0)) {
+ flags = intel->vblank_flags | VBLANK_FLAG_SECONDARY;
+ } else {
+ flags = intel->vblank_flags & ~VBLANK_FLAG_SECONDARY;
+ }
+
+ if (flags != intel->vblank_flags) {
+ intel->vblank_flags = flags;
+ driGetCurrentVBlank(dPriv, intel->vblank_flags, &intel->vbl_seq);
+ }
+ } else {
+ intel->vblank_flags &= ~VBLANK_FLAG_SECONDARY;
+ }
+
ctx->Driver.Scissor( ctx, ctx->Scissor.X, ctx->Scissor.Y,
ctx->Scissor.Width, ctx->Scissor.Height );