Mesa (master): intel: Prevent an "irq is not working" printf when only pipe B is enabled.

Jesse Barnes jbarnes at kemper.freedesktop.org
Fri Jan 23 12:51:23 PST 2009


Module: Mesa
Branch: master
Commit: 39b4061bb9be540dfb51891e22c505bc235ec8a2
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=39b4061bb9be540dfb51891e22c505bc235ec8a2

Author: Owain G. Ainsworth <oga at openbsd.org>
Date:   Wed Jan 21 22:41:26 2009 +0000

intel: Prevent an "irq is not working" printf when only pipe B is enabled.

intelMakeCurrent is called before intelWindowMoved (in fact, it calls
it), so calculation of the correct vblank crtc has not happened yet.
Fix this by making a function that fixes up a set of vblank flags and
call if from both functions.

---

 src/mesa/drivers/dri/intel/intel_buffers.c |   34 +++++++++++++++++++++------
 src/mesa/drivers/dri/intel/intel_buffers.h |    3 ++
 src/mesa/drivers/dri/intel/intel_context.c |    5 ++++
 3 files changed, 34 insertions(+), 8 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_buffers.c b/src/mesa/drivers/dri/intel/intel_buffers.c
index 7465ba7..08e10c9 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,27 @@ intelWindowMoved(struct intel_context *intel)
 	 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 0be1cee..529e823 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 a68e217..6cfe57c 100644
--- a/src/mesa/drivers/dri/intel/intel_context.c
+++ b/src/mesa/drivers/dri/intel/intel_context.c
@@ -865,6 +865,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;



More information about the mesa-commit mailing list