summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers/dri')
-rw-r--r--src/mesa/drivers/dri/i965/brw_metaops.c2
-rw-r--r--src/mesa/drivers/dri/intel/intel_buffers.c42
-rw-r--r--src/mesa/drivers/dri/intel/intel_buffers.h3
-rw-r--r--src/mesa/drivers/dri/intel/intel_context.c5
4 files changed, 44 insertions, 8 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_metaops.c b/src/mesa/drivers/dri/i965/brw_metaops.c
index 41bfa2e256..84d224387e 100644
--- a/src/mesa/drivers/dri/i965/brw_metaops.c
+++ b/src/mesa/drivers/dri/i965/brw_metaops.c
@@ -446,6 +446,7 @@ static void meta_draw_quad(struct intel_context *intel,
attribs[VERT_ATTRIB_POS] = &pos_array;
attribs[VERT_ATTRIB_POS]->Ptr = 0;
attribs[VERT_ATTRIB_POS]->Type = GL_FLOAT;
+ attribs[VERT_ATTRIB_POS]->Format = GL_RGBA;
attribs[VERT_ATTRIB_POS]->Enabled = 1;
attribs[VERT_ATTRIB_POS]->Size = 3;
attribs[VERT_ATTRIB_POS]->StrideB = 3 * sizeof(GLfloat);
@@ -457,6 +458,7 @@ static void meta_draw_quad(struct intel_context *intel,
attribs[VERT_ATTRIB_COLOR0] = &color_array;
attribs[VERT_ATTRIB_COLOR0]->Ptr = (const GLubyte *)sizeof(pos);
attribs[VERT_ATTRIB_COLOR0]->Type = GL_UNSIGNED_BYTE;
+ attribs[VERT_ATTRIB_COLOR0]->Format = GL_RGBA;
attribs[VERT_ATTRIB_COLOR0]->Enabled = 1;
attribs[VERT_ATTRIB_COLOR0]->Size = 4;
attribs[VERT_ATTRIB_COLOR0]->StrideB = 0;
diff --git a/src/mesa/drivers/dri/intel/intel_buffers.c b/src/mesa/drivers/dri/intel/intel_buffers.c
index 7465ba7c69..f1a08c5c10 100644
--- a/src/mesa/drivers/dri/intel/intel_buffers.c
+++ b/src/mesa/drivers/dri/intel/intel_buffers.c
@@ -143,16 +143,13 @@ intel_get_cliprects(struct intel_context *intel,
}
}
-/**
- * This will be called whenever the currently bound window is moved/resized.
- * XXX: actually, it seems to NOT be called when the window is only moved (BP).
+/*
+ * Correct a drawablePrivate's set of vblank flags WRT the current context.
+ * When considering multiple crtcs.
*/
-void
-intelWindowMoved(struct intel_context *intel)
+GLuint
+intelFixupVblank(struct intel_context *intel, __DRIdrawablePrivate *dPriv)
{
- GLcontext *ctx = &intel->ctx;
- __DRIdrawablePrivate *dPriv = intel->driDrawable;
- struct intel_framebuffer *intel_fb = dPriv->driverPrivate;
if (!intel->intelScreen->driScrnPriv->dri2.enabled &&
intel->intelScreen->driScrnPriv->ddx_version.minor >= 7) {
@@ -177,6 +174,35 @@ intelWindowMoved(struct intel_context *intel)
flags = dPriv->vblFlags & ~VBLANK_FLAG_SECONDARY;
}
+ /* Do the stupid test: Is one of them actually disabled?
+ */
+ if (sarea->planeA_w == 0 || sarea->planeA_h == 0) {
+ flags = dPriv->vblFlags | VBLANK_FLAG_SECONDARY;
+ } else if (sarea->planeB_w == 0 || sarea->planeB_h == 0) {
+ flags = dPriv->vblFlags & ~VBLANK_FLAG_SECONDARY;
+ }
+
+ return flags;
+ } else {
+ return dPriv->vblFlags & ~VBLANK_FLAG_SECONDARY;
+ }
+}
+
+/**
+ * This will be called whenever the currently bound window is moved/resized.
+ * XXX: actually, it seems to NOT be called when the window is only moved (BP).
+ */
+void
+intelWindowMoved(struct intel_context *intel)
+{
+ GLcontext *ctx = &intel->ctx;
+ __DRIdrawablePrivate *dPriv = intel->driDrawable;
+ struct intel_framebuffer *intel_fb = dPriv->driverPrivate;
+
+ if (!intel->intelScreen->driScrnPriv->dri2.enabled &&
+ intel->intelScreen->driScrnPriv->ddx_version.minor >= 7) {
+ GLuint flags = intelFixupVblank(intel, dPriv);
+
/* Check to see if we changed pipes */
if (flags != dPriv->vblFlags && dPriv->vblFlags &&
!(dPriv->vblFlags & VBLANK_FLAG_NO_IRQ)) {
diff --git a/src/mesa/drivers/dri/intel/intel_buffers.h b/src/mesa/drivers/dri/intel/intel_buffers.h
index 0be1cee091..529e823b4f 100644
--- a/src/mesa/drivers/dri/intel/intel_buffers.h
+++ b/src/mesa/drivers/dri/intel/intel_buffers.h
@@ -47,6 +47,9 @@ extern struct intel_region *intel_drawbuf_region(struct intel_context *intel);
extern void intelSwapBuffers(__DRIdrawablePrivate * dPriv);
+extern GLuint intelFixupVblank(struct intel_context *intel,
+ __DRIdrawablePrivate *dPriv);
+
extern void intelWindowMoved(struct intel_context *intel);
extern void intel_draw_buffer(GLcontext * ctx, struct gl_framebuffer *fb);
diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c
index f733afb291..87b0417baa 100644
--- a/src/mesa/drivers/dri/intel/intel_context.c
+++ b/src/mesa/drivers/dri/intel/intel_context.c
@@ -866,6 +866,11 @@ intelMakeCurrent(__DRIcontextPrivate * driContextPriv,
? driGetDefaultVBlankFlags(&intel->optionCache)
: VBLANK_FLAG_NO_IRQ;
+ /* Prevent error printf if one crtc is disabled, this will
+ * be properly calculated in intelWindowMoved() next.
+ */
+ driDrawPriv->vblFlags = intelFixupVblank(intel, driDrawPriv);
+
(*psp->systemTime->getUST) (&intel_fb->swap_ust);
driDrawableInitVBlank(driDrawPriv);
intel_fb->vbl_waited = driDrawPriv->vblSeq;