summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2007-09-28 12:02:27 +1000
committerDave Airlie <[email protected]>2007-09-28 12:02:27 +1000
commitb3fc9a1585f390274fa26b3e3f80bc6d16f4388a (patch)
treef8c8899bb7f8de242ae34382dd70b414a778ca4e
parent2a86a449ca0b3765ee13735d77e1be121f06cabc (diff)
i965: fix vblank on 965gm laptops by bringing in code from i915
jbarnes has better fixes for this in 7.1, but for 7.0.2 this seems like the best plan, for distros to pick it up.
-rw-r--r--src/mesa/drivers/dri/i965/intel_buffers.c36
-rw-r--r--src/mesa/drivers/dri/i965/server/i830_common.h10
2 files changed, 45 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_buffers.c b/src/mesa/drivers/dri/i965/intel_buffers.c
index d155c039d77..de6a867cca4 100644
--- a/src/mesa/drivers/dri/i965/intel_buffers.c
+++ b/src/mesa/drivers/dri/i965/intel_buffers.c
@@ -31,7 +31,9 @@
#include "intel_regions.h"
#include "intel_batchbuffer.h"
#include "context.h"
+#include "utils.h"
#include "framebuffer.h"
+#include "vblank.h"
#include "macros.h"
#include "swrast/swrast.h"
@@ -190,8 +192,40 @@ void intelWindowMoved( struct intel_context *intel )
}
}
+ {
+ if (intel->intelScreen->driScrnPriv->ddxMinor >= 7) {
+ volatile 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;
+ }
+ }
_mesa_resize_framebuffer(&intel->ctx,
- (GLframebuffer*)dPriv->driverPrivate,
+ (GLframebuffer*)dPriv->driverPrivate,
dPriv->w, dPriv->h);
/* Set state we know depends on drawable parameters:
diff --git a/src/mesa/drivers/dri/i965/server/i830_common.h b/src/mesa/drivers/dri/i965/server/i830_common.h
index f320378c2a5..fe2b8e8b5d4 100644
--- a/src/mesa/drivers/dri/i965/server/i830_common.h
+++ b/src/mesa/drivers/dri/i965/server/i830_common.h
@@ -119,6 +119,16 @@ typedef struct {
unsigned int depth_tiled;
unsigned int rotated_tiled;
unsigned int rotated2_tiled;
+
+ int pipeA_x;
+ int pipeA_y;
+ int pipeA_w;
+ int pipeA_h;
+ int pipeB_x;
+ int pipeB_y;
+ int pipeB_w;
+ int pipeB_h;
+
} drmI830Sarea;
/* Flags for perf_boxes