xf86-video-intel: 4 commits - src/i830_common.h src/i830_dri.c src/i830_dri.h src/i830_driver.c

Michel Daenzer daenzer at kemper.freedesktop.org
Thu Sep 28 16:49:00 EEST 2006


 src/i830_common.h |    9 +++++
 src/i830_dri.c    |   61 ++++++++++++++++++++++-----------------
 src/i830_dri.h    |    4 +-
 src/i830_driver.c |   83 ++++++++++++++++++++++++++++++++++++++++++------------
 4 files changed, 111 insertions(+), 46 deletions(-)

New commits:
diff-tree 2013b839de3733fd12becb2cc3c1daadde329eb4 (from fe691953f08b4d299295f91450412404ba42810b)
Author: Michel Dänzer <michel at tungstengraphics.com>
Date:   Thu Sep 28 13:49:44 2006 +0200

    Always call I830UpdateXineramaScreenInfo() unconditionally, and document why.

diff --git a/src/i830_driver.c b/src/i830_driver.c
index fc768af..2506f53 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -2064,9 +2064,6 @@ I830XineramaExtensionInit(ScrnInfoPtr pS
        pI830->I830XineramaVY = 0;
 
     }
-
-    I830UpdateXineramaScreenInfo(pScrn);
-
 }
 
 static void
@@ -7491,6 +7488,9 @@ I830BIOSScreenInit(int scrnIndex, Screen
       xf86DrvMsg(pScrn->scrnIndex, X_INFO, "libshadow is version %d.%d.%d, required 1.1.0 or greater for rotation.\n",pI830->shadowReq.majorversion,pI830->shadowReq.minorversion,pI830->shadowReq.patchlevel);
    }
 
+   /* Call this unconditionally, as it also sets some fields in the SAREA */
+   I830UpdateXineramaScreenInfo(pScrn);
+
    if (serverGeneration == 1)
       xf86ShowUnusedOptions(pScrn->scrnIndex, pScrn->options);
 
@@ -8235,6 +8235,7 @@ I830BIOSSwitchMode(int scrnIndex, Displa
 
    /* Since RandR (indirectly) uses SwitchMode(), we need to
     * update our Xinerama info here, too, in case of resizing
+    * Call this unconditionally, as it also sets some fields in the SAREA
     */
    I830UpdateXineramaScreenInfo(pScrn);
 
diff-tree fe691953f08b4d299295f91450412404ba42810b (from 06c5f7bd076e9ba4b925e061a40b837714bc8267)
Author: Michel Dänzer <michel at tungstengraphics.com>
Date:   Thu Aug 31 18:35:10 2006 +0200

    Store viewport limits of both pipes in SAREA.
    
    This allows DRI clients to determine which pipe they should synchronize buffer
    swaps of each window to.

diff --git a/src/i830_common.h b/src/i830_common.h
index c3ef4cd..79455b6 100644
--- a/src/i830_common.h
+++ b/src/i830_common.h
@@ -121,6 +121,15 @@ 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
diff --git a/src/i830_dri.h b/src/i830_dri.h
index 41f8a90..3a4cfaf 100644
--- a/src/i830_dri.h
+++ b/src/i830_dri.h
@@ -9,8 +9,8 @@
 #define I830_MAX_DRAWABLES 256
 
 #define I830_MAJOR_VERSION 1
-#define I830_MINOR_VERSION 6
-#define I830_PATCHLEVEL 4
+#define I830_MINOR_VERSION 7
+#define I830_PATCHLEVEL 0
 
 #define I830_REG_SIZE 0x80000
 
diff --git a/src/i830_driver.c b/src/i830_driver.c
index ffa93f8..fc768af 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -1342,15 +1342,49 @@ I830UpdateXineramaScreenInfo(ScrnInfoPtr
     Bool infochanged = FALSE;
     Bool usenonrect = pI830->NonRect;
     const char *rectxine = "\t... setting up rectangular Xinerama layout\n";
+#ifdef XF86DRI
+    drmI830Sarea *sarea;
+
+    if (pI830->directRenderingEnabled) {
+       sarea = (drmI830Sarea *) DRIGetSAREAPrivate(pScrn1->pScreen);
+    }
+#endif
 
     pI830->MBXNR1XMAX = pI830->MBXNR1YMAX = pI830->MBXNR2XMAX = pI830->MBXNR2YMAX = 65536;
     pI830->HaveNonRect = pI830->HaveOffsRegions = FALSE;
 
-    if(!pI830->MergedFB) return;
+    if(!pI830->MergedFB) {
+#ifdef XF86DRI
+       if (pI830->directRenderingEnabled) {
+          sarea->pipeA_x = sarea->pipeA_y = sarea->pipeB_x = sarea->pipeB_y = 0;
 
-    if(I830noPanoramiXExtension) return;
+          if (pI830->planeEnabled[0]) {
+             sarea->pipeA_w = pScrn1->virtualX;
+             sarea->pipeA_h = pScrn1->virtualY;
+          } else {
+             sarea->pipeA_w = 0;
+             sarea->pipeA_h = 0;
+          }
+
+          if (pI830->planeEnabled[1]) {
+             sarea->pipeB_w = pScrn1->virtualX;
+             sarea->pipeB_h = pScrn1->virtualY;
+          } else {
+             sarea->pipeB_w = 0;
+             sarea->pipeB_h = 0;
+          }
+       }
+#endif
 
-    if(!I830XineramadataPtr) return;
+       return;
+    }
+
+    if (I830noPanoramiXExtension || !I830XineramadataPtr) {
+#ifdef XF86DRI
+       if (!pI830->directRenderingEnabled)
+#endif
+	  return;
+    }
 
     if(pI830->SecondIsScrn0) {
        scrnnum1 = 1;
@@ -1631,14 +1665,30 @@ I830UpdateXineramaScreenInfo(ScrnInfoPtr
 
     }
 
-    I830XineramadataPtr[scrnnum1].x = x1;
-    I830XineramadataPtr[scrnnum1].y = y1;
-    I830XineramadataPtr[scrnnum1].width = w1;
-    I830XineramadataPtr[scrnnum1].height = h1;
-    I830XineramadataPtr[scrnnum2].x = x2;
-    I830XineramadataPtr[scrnnum2].y = y2;
-    I830XineramadataPtr[scrnnum2].width = w2;
-    I830XineramadataPtr[scrnnum2].height = h2;
+#ifdef XF86DRI
+    if (pI830->directRenderingEnabled) {
+       sarea->pipeA_x = x1;
+       sarea->pipeA_y = y1;
+       sarea->pipeA_w = w1;
+       sarea->pipeA_h = h1;
+       sarea->pipeB_x = x2;
+       sarea->pipeB_y = y2;
+       sarea->pipeB_w = w2;
+       sarea->pipeB_h = h2;
+    }
+#endif
+
+    if (I830XineramadataPtr && !I830noPanoramiXExtension) {
+       I830XineramadataPtr[scrnnum1].x = x1;
+       I830XineramadataPtr[scrnnum1].y = y1;
+       I830XineramadataPtr[scrnnum1].width = w1;
+       I830XineramadataPtr[scrnnum1].height = h1;
+       I830XineramadataPtr[scrnnum2].x = x2;
+       I830XineramadataPtr[scrnnum2].y = y2;
+       I830XineramadataPtr[scrnnum2].width = w2;
+       I830XineramadataPtr[scrnnum2].height = h2;
+    } else
+       return;
 
     if(infochanged) {
        xf86DrvMsg(pScrn1->scrnIndex, X_INFO,
@@ -8186,9 +8236,7 @@ I830BIOSSwitchMode(int scrnIndex, Displa
    /* Since RandR (indirectly) uses SwitchMode(), we need to
     * update our Xinerama info here, too, in case of resizing
     */
-   if(pI830->MergedFB) {
-      I830UpdateXineramaScreenInfo(pScrn);
-   }
+   I830UpdateXineramaScreenInfo(pScrn);
 
    return ret;
 }
diff-tree 06c5f7bd076e9ba4b925e061a40b837714bc8267 (from 89cbc6e215a5f313ccc17370424c35630cf75892)
Author: Michel Dänzer <michel at tungstengraphics.com>
Date:   Wed Aug 30 19:45:33 2006 +0200

    If the DRM can handle it, enable vertical blank interrupts for both pipes.

diff --git a/src/i830_dri.c b/src/i830_dri.c
index 92f8d4a..21af651 100644
--- a/src/i830_dri.c
+++ b/src/i830_dri.c
@@ -1489,9 +1489,12 @@ I830DRISetVBlankInterrupt (ScrnInfoPtr p
 
     if (pI830->directRenderingEnabled && pI830->drmMinor >= 5) {
 	if (on) {
-	    if (pI830->planeEnabled[1])
-		pipe.pipe = DRM_I830_VBLANK_PIPE_B;
-	    else
+	    if (pI830->planeEnabled[1]) {
+		if (pI830->drmMinor >= 6)
+		    pipe.pipe = DRM_I830_VBLANK_PIPE_A | DRM_I830_VBLANK_PIPE_B;
+		else
+		    pipe.pipe = DRM_I830_VBLANK_PIPE_B;
+	    } else
 		pipe.pipe = DRM_I830_VBLANK_PIPE_A;
 	} else {
 	    pipe.pipe = 0;
diff-tree 89cbc6e215a5f313ccc17370424c35630cf75892 (from 6614b4bda2e079fd1e56e0825894481b80e2df58)
Author: Michel Dänzer <michel at tungstengraphics.com>
Date:   Thu Aug 24 10:30:27 2006 +0200

    Only enable the IRQ after DRIFinishScreenInit.
    
    This makes sure we've been assigned a context ID, so the interrupt context
    won't mess things up if it grabs the HW lock.

diff --git a/src/i830_dri.c b/src/i830_dri.c
index c9b52c4..92f8d4a 100644
--- a/src/i830_dri.c
+++ b/src/i830_dri.c
@@ -835,29 +835,6 @@ I830DRIDoMappings(ScreenPtr pScreen)
       I830SetParam(pScrn, I830_SETPARAM_USE_MI_BATCHBUFFER_START, 1 );
    }
 
-   /* Okay now initialize the dma engine */
-   {
-      pI830DRI->irq = drmGetInterruptFromBusID(pI830->drmSubFD,
-					       ((pciConfigPtr) pI830->
-						PciInfo->thisCard)->busnum,
-					       ((pciConfigPtr) pI830->
-						PciInfo->thisCard)->devnum,
-					       ((pciConfigPtr) pI830->
-						PciInfo->thisCard)->funcnum);
-
-      if (drmCtlInstHandler(pI830->drmSubFD, pI830DRI->irq)) {
-	 xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
-		    "[drm] failure adding irq handler\n");
-	 pI830DRI->irq = 0;
-	 DRICloseScreen(pScreen);
-	 return FALSE;
-      }
-      else
-	 xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-		    "[drm] dma control initialized, using IRQ %d\n",
-		    pI830DRI->irq);
-   }
-
    pI830DRI = (I830DRIPtr) pI830->pDRIInfo->devPrivate;
    pI830DRI->deviceID = pI830->PciInfo->chipType;
    pI830DRI->width = pScrn->virtualX;
@@ -982,7 +959,34 @@ I830DRIFinishScreenInit(ScreenPtr pScree
       pI830->allowPageFlip = 0;
 
 
-   return DRIFinishScreenInit(pScreen);
+   if (!DRIFinishScreenInit(pScreen))
+      return FALSE;
+
+   /* Okay now initialize the dma engine */
+   {
+      I830DRIPtr pI830DRI = (I830DRIPtr) pI830->pDRIInfo->devPrivate;
+
+      pI830DRI->irq = drmGetInterruptFromBusID(pI830->drmSubFD,
+					       ((pciConfigPtr) pI830->
+						PciInfo->thisCard)->busnum,
+					       ((pciConfigPtr) pI830->
+						PciInfo->thisCard)->devnum,
+					       ((pciConfigPtr) pI830->
+						PciInfo->thisCard)->funcnum);
+
+      if (drmCtlInstHandler(pI830->drmSubFD, pI830DRI->irq)) {
+	 xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+		    "[drm] failure adding irq handler\n");
+	 pI830DRI->irq = 0;
+	 DRICloseScreen(pScreen);
+	 return FALSE;
+      }
+      else
+	 xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+		    "[drm] dma control initialized, using IRQ %d\n",
+		    pI830DRI->irq);
+	 return TRUE;
+   }
 }
 
 void



More information about the xorg-commit mailing list