xf86-video-intel: Branch 'modesetting' - 10 commits - ChangeLog .gitignore man/.gitignore src/common.h src/i810_driver.c src/i830_dri.c src/i830_driver.c

Eric Anholt anholt at kemper.freedesktop.org
Mon May 22 23:07:44 EEST 2006


 .gitignore        |    2 
 ChangeLog         |    5 +
 man/.gitignore    |    2 
 src/common.h      |    4 -
 src/i810_driver.c |    2 
 src/i830_dri.c    |    3 +
 src/i830_driver.c |  155 ++++++++++++++++++++++++++++++++----------------------
 7 files changed, 106 insertions(+), 67 deletions(-)

New commits:
diff-tree c1c46f882f9a11c383c8d1d1ce393be8fda55ed0 (from parents)
Merge: 1e2da2450d7213c0aa4d4bd1fba5723dcda13ddf f2967a2f5f47b636b2445fa69dbc3ec79e065c90
Author: Eric Anholt <anholt at FreeBSD.org>
Date:   Mon May 22 10:42:24 2006 -0700

    Merge branch 'master' into modesetting
    
    Conflicts:
    
    	man/.gitignore

diff --cc src/common.h
index 6e68767,a6e4ca3..21977af
@@@ -83,9 -84,7 +84,8 @@@
  #ifdef XF86DRI
  extern const char *I810driSymbols[];
  extern const char *I810drmSymbols[];
- extern const char *I810shadowSymbols[];
  #endif
 +extern const char *I810i2cSymbols[];
  
  extern void I830DPRINTF_stub(const char *filename, int line,
  			     const char *function, const char *fmt, ...);
diff-tree 1e2da2450d7213c0aa4d4bd1fba5723dcda13ddf (from 1bc2a8f7a20b2ea9251e93157c0f2342fdbb951c)
Author: Lukáš Hejtmanek <xhejtman at mail.muni.cz>
Date:   Mon May 22 09:48:09 2006 -0700

    Replace VBE call to do DPMS with native code, and fix screensaver in clone mode.

diff --git a/src/i830_driver.c b/src/i830_driver.c
index 3eb3205..425ddd5 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -4258,27 +4258,30 @@ I830BIOSSaveScreen(ScreenPtr pScreen, in
    I830Ptr pI830 = I830PTR(pScrn);
    Bool on = xf86IsUnblank(mode);
    CARD32 temp, ctrl, base;
+   int i;
 
    DPRINTF(PFX, "I830BIOSSaveScreen: %d, on is %s\n", mode, BOOLTOSTRING(on));
 
    if (pScrn->vtSema) {
-      if (pI830->pipe == 0) {
-	 ctrl = DSPACNTR;
-	 base = DSPABASE;
-      } else {
-	 ctrl = DSPBCNTR;
-	 base = DSPBADDR;
-      }
-      if (pI830->planeEnabled[pI830->pipe]) {
-	 temp = INREG(ctrl);
-	 if (on)
-	    temp |= DISPLAY_PLANE_ENABLE;
-	 else
-	    temp &= ~DISPLAY_PLANE_ENABLE;
-	 OUTREG(ctrl, temp);
-	 /* Flush changes */
-	 temp = INREG(base);
-	 OUTREG(base, temp);
+      for (i = 0; i < pI830->availablePipes; i++) {
+        if (i == 0) {
+	    ctrl = DSPACNTR;
+	    base = DSPABASE;
+        } else {
+	    ctrl = DSPBCNTR;
+	    base = DSPBADDR;
+        }
+        if (pI830->planeEnabled[i]) {
+	   temp = INREG(ctrl);
+	   if (on)
+	      temp |= DISPLAY_PLANE_ENABLE;
+	   else
+	      temp &= ~DISPLAY_PLANE_ENABLE;
+	   OUTREG(ctrl, temp);
+	   /* Flush changes */
+	   temp = INREG(base);
+	   OUTREG(base, temp);
+        }
       }
 
       if (pI830->CursorInfoRec && !pI830->SWCursor && pI830->cursorOn) {
@@ -4292,63 +4295,91 @@ I830BIOSSaveScreen(ScreenPtr pScreen, in
    return TRUE;
 }
 
+static void
+I830DPMSCRT(ScrnInfoPtr pScrn, int mode)
+{
+   I830Ptr pI830 = I830PTR(pScrn);
+   CARD32 temp;
+   
+   temp = INREG(ADPA);
+   temp &= ~(ADPA_HSYNC_CNTL_DISABLE|ADPA_VSYNC_CNTL_DISABLE);
+   switch(mode) {
+   case DPMSModeOn:
+      break;
+   case DPMSModeStandby:
+      temp |= ADPA_HSYNC_CNTL_DISABLE;
+      break;
+   case DPMSModeSuspend:
+      temp |= ADPA_VSYNC_CNTL_DISABLE;
+      break;
+   case DPMSModeOff:
+      temp |= ADPA_HSYNC_CNTL_DISABLE|ADPA_VSYNC_CNTL_DISABLE;
+      break;
+   }
+   OUTREG(ADPA, temp);
+}
+
+static void
+I830DPMSLVDS(ScrnInfoPtr pScrn, int mode)
+{
+   if (mode == DPMSModeOn)
+      i830SetLVDSPanelPower(pScrn, TRUE);
+   else
+      i830SetLVDSPanelPower(pScrn, FALSE);
+}
+
 /* Use the VBE version when available. */
 static void
 I830DisplayPowerManagementSet(ScrnInfoPtr pScrn, int PowerManagementMode,
 			      int flags)
 {
    I830Ptr pI830 = I830PTR(pScrn);
-   vbeInfoPtr pVbe = pI830->pVbe;
+   int i;
+   CARD32 temp, ctrl, base;
 
-   if (pI830->Clone) {
-      SetBIOSPipe(pScrn, !pI830->pipe);
-      if (xf86LoaderCheckSymbol("VBEDPMSSet")) {
-         VBEDPMSSet(pVbe, PowerManagementMode);
+   for (i = 0; i < pI830->availablePipes; i++) {
+      if (i == 0) {
+         ctrl = DSPACNTR;
+         base = DSPABASE;
       } else {
-         pVbe->pInt10->num = 0x10;
-         pVbe->pInt10->ax = 0x4f10;
-         pVbe->pInt10->bx = 0x01;
-
-         switch (PowerManagementMode) {
-         case DPMSModeOn:
-	    break;
-         case DPMSModeStandby:
-	    pVbe->pInt10->bx |= 0x0100;
-	    break;
-         case DPMSModeSuspend:
-	    pVbe->pInt10->bx |= 0x0200;
-	    break;
-         case DPMSModeOff:
-	    pVbe->pInt10->bx |= 0x0400;
-	    break;
-         }
-         xf86ExecX86int10_wrapper(pVbe->pInt10, pScrn);
+         ctrl = DSPBCNTR;
+         base = DSPBADDR;
+      }
+      if (pI830->planeEnabled[i]) {
+	   temp = INREG(ctrl);
+	   if (PowerManagementMode == DPMSModeOn)
+	      temp |= DISPLAY_PLANE_ENABLE;
+	   else
+	      temp &= ~DISPLAY_PLANE_ENABLE;
+	   OUTREG(ctrl, temp);
+	   /* Flush changes */
+	   temp = INREG(base);
+	   OUTREG(base, temp);
       }
    }
 
-   SetPipeAccess(pScrn);
+   if (pI830->operatingDevices & (PIPE_CRT_ACTIVE | (PIPE_CRT_ACTIVE<<8))) {
+      I830DPMSCRT(pScrn, PowerManagementMode);
+   }
 
-   if (xf86LoaderCheckSymbol("VBEDPMSSet")) {
-      VBEDPMSSet(pVbe, PowerManagementMode);
-   } else {
-      pVbe->pInt10->num = 0x10;
-      pVbe->pInt10->ax = 0x4f10;
-      pVbe->pInt10->bx = 0x01;
-
-      switch (PowerManagementMode) {
-      case DPMSModeOn:
-	 break;
-      case DPMSModeStandby:
-	 pVbe->pInt10->bx |= 0x0100;
-	 break;
-      case DPMSModeSuspend:
-	 pVbe->pInt10->bx |= 0x0200;
-	 break;
-      case DPMSModeOff:
-	 pVbe->pInt10->bx |= 0x0400;
-	 break;
-      }
-      xf86ExecX86int10_wrapper(pVbe->pInt10, pScrn);
+   if (pI830->operatingDevices & (PIPE_LCD_ACTIVE | (PIPE_LCD_ACTIVE<<8))) {
+      I830DPMSLVDS(pScrn, PowerManagementMode);
+   }
+
+   if (pI830->operatingDevices & (PIPE_DFP_ACTIVE | (PIPE_DFP_ACTIVE<<8))) {
+      /* TBD */
+   }
+
+   if (pI830->operatingDevices & (PIPE_DFP2_ACTIVE | (PIPE_DFP2_ACTIVE<<8))) {
+      /* TBD */
+   }
+
+   if (pI830->CursorInfoRec && !pI830->SWCursor && pI830->cursorOn) {
+      if (PowerManagementMode == DPMSModeOn)
+         pI830->CursorInfoRec->ShowCursor(pScrn);
+      else
+         pI830->CursorInfoRec->HideCursor(pScrn);
+      pI830->cursorOn = TRUE;
    }
 }
 
diff-tree f2967a2f5f47b636b2445fa69dbc3ec79e065c90 (from 99b0e53244aa49f4e7461a1c96aba69453b3516f)
Author: Keith Packard <keithp at neko.keithp.com>
Date:   Tue May 9 13:51:25 2006 -0700

    Video overlay gamma bounds checking must be done bytewise.
    Also, pend bound computations to register writes to allow
    updates to individual values that are 'out of spec' so
    the client can update multiple values.
    (cherry picked from 190f9ad0606e96e684e0b028d576d822dc9aa3cf commit)

diff --git a/src/i830_video.c b/src/i830_video.c
index 0ae6860..a608a7e 100644
--- a/src/i830_video.c
+++ b/src/i830_video.c
@@ -592,18 +592,53 @@ I830SetOneLineModeRatio(ScrnInfoPtr pScr
       pPriv->oneLineMode = FALSE;
 }
 
+static CARD32 I830BoundGammaElt (CARD32 elt, CARD32 eltPrev)
+{
+   elt &= 0xff;
+   eltPrev &= 0xff;
+   if (elt < eltPrev)
+      elt = eltPrev;
+   else if ((elt - eltPrev) > 0x7e)
+      elt = eltPrev + 0x7e;
+   return elt;
+}
+
+static CARD32 I830BoundGamma (CARD32 gamma, CARD32 gammaPrev)
+{
+   return (I830BoundGammaElt (gamma >> 24, gammaPrev >> 24) << 24 |
+	   I830BoundGammaElt (gamma >> 16, gammaPrev >> 16) << 16 |
+	   I830BoundGammaElt (gamma >>  8, gammaPrev >>  8) <<  8 |
+	   I830BoundGammaElt (gamma      , gammaPrev      ));
+}
+
 static void
 I830UpdateGamma(ScrnInfoPtr pScrn)
 {
    I830Ptr pI830 = I830PTR(pScrn);
    I830PortPrivPtr pPriv = pI830->adaptor->pPortPrivates[0].ptr;
-
-   OUTREG(OGAMC5, pPriv->gamma5);
-   OUTREG(OGAMC4, pPriv->gamma4);
-   OUTREG(OGAMC3, pPriv->gamma3);
-   OUTREG(OGAMC2, pPriv->gamma2);
-   OUTREG(OGAMC1, pPriv->gamma1);
-   OUTREG(OGAMC0, pPriv->gamma0);
+   CARD32   gamma0 = pPriv->gamma0;
+   CARD32   gamma1 = pPriv->gamma1;
+   CARD32   gamma2 = pPriv->gamma2;
+   CARD32   gamma3 = pPriv->gamma3;
+   CARD32   gamma4 = pPriv->gamma4;
+   CARD32   gamma5 = pPriv->gamma5;
+
+   ErrorF ("Original gamma: 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx\n",
+	   gamma0, gamma1, gamma2, gamma3, gamma4, gamma5);
+   gamma1 = I830BoundGamma (gamma1, gamma0);
+   gamma2 = I830BoundGamma (gamma2, gamma1);
+   gamma3 = I830BoundGamma (gamma3, gamma2);
+   gamma4 = I830BoundGamma (gamma4, gamma3);
+   gamma5 = I830BoundGamma (gamma5, gamma4);
+   ErrorF ("Bounded  gamma: 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx\n",
+	   gamma0, gamma1, gamma2, gamma3, gamma4, gamma5);
+
+   OUTREG(OGAMC5, gamma5);
+   OUTREG(OGAMC4, gamma4);
+   OUTREG(OGAMC3, gamma3);
+   OUTREG(OGAMC2, gamma2);
+   OUTREG(OGAMC1, gamma1);
+   OUTREG(OGAMC0, gamma0);
 }
 
 static XF86VideoAdaptorPtr
@@ -849,28 +884,16 @@ I830SetPortAttribute(ScrnInfoPtr pScrn,
 #endif
    } else if (attribute == xvGamma0 && (IS_I9XX(pI830))) {
       pPriv->gamma0 = value; 
-      if (pPriv->gamma1 - pPriv->gamma0 > 0x7d)
-         pPriv->gamma1 = pPriv->gamma0 + 0x7d;
    } else if (attribute == xvGamma1 && (IS_I9XX(pI830))) {
       pPriv->gamma1 = value;
-      if (pPriv->gamma1 - pPriv->gamma0 > 0x7d)
-        pPriv->gamma0 = pPriv->gamma1 - 0x7d;
    } else if (attribute == xvGamma2 && (IS_I9XX(pI830))) {
       pPriv->gamma2 = value;
-      if (pPriv->gamma3 - pPriv->gamma2 > 0x7d)
-         pPriv->gamma3 = pPriv->gamma2 + 0x7d;
    } else if (attribute == xvGamma3 && (IS_I9XX(pI830))) {
       pPriv->gamma3 = value;
-      if (pPriv->gamma3 - pPriv->gamma2 > 0x7d)
-         pPriv->gamma2 = pPriv->gamma3 - 0x7d;
    } else if (attribute == xvGamma4 && (IS_I9XX(pI830))) {
       pPriv->gamma4 = value;
-      if (pPriv->gamma5 - pPriv->gamma4 > 0x7d)
-         pPriv->gamma5 = pPriv->gamma4 + 0x7d;
    } else if (attribute == xvGamma5 && (IS_I9XX(pI830))) {
       pPriv->gamma5 = value;
-      if (pPriv->gamma5 - pPriv->gamma4 > 0x7d)
-         pPriv->gamma4 = pPriv->gamma5 - 0x7d;
    } else if (attribute == xvColorKey) {
       pPriv->colorKey = value;
       switch (pScrn->depth) {
diff-tree 99b0e53244aa49f4e7461a1c96aba69453b3516f (from 86f0119f47d8be975016ffdea850f0227e32eebc)
Author: Matthieu Herrb <matthieu at reactor.herrb.com>
Date:   Mon May 1 10:47:09 2006 +0200

    Fix non-dri build.

diff --git a/ChangeLog b/ChangeLog
index afb2e74..d77176b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-05-01  Matthieu Herrb <matthieu.herrb at laas.fr>
+
+	* src/common.h:
+	Fix build on non-dri systems.
+
 2006-04-07  Adam Jackson  <ajax at freedesktop.org>
 
 	* configure.ac:
diff-tree 86f0119f47d8be975016ffdea850f0227e32eebc (from 1dbb19059f5dd5cd2ad386c4f73498095987b943)
Author: Matthieu Herrb <matthieu at reactor.herrb.com>
Date:   Mon May 1 10:41:10 2006 +0200

    Fix non-dri build.

diff --git a/src/common.h b/src/common.h
index 9d3bd03..a6e4ca3 100644
--- a/src/common.h
+++ b/src/common.h
@@ -80,10 +80,10 @@ extern const char *I810ddcSymbols[];
 extern const char *I810fbSymbols[];
 extern const char *I810xaaSymbols[];
 extern const char *I810shadowFBSymbols[];
+extern const char *I810shadowSymbols[];
 #ifdef XF86DRI
 extern const char *I810driSymbols[];
 extern const char *I810drmSymbols[];
-extern const char *I810shadowSymbols[];
 #endif
 
 extern void I830DPRINTF_stub(const char *filename, int line,
diff-tree 1dbb19059f5dd5cd2ad386c4f73498095987b943 (from a85be820033af8bf30d1fec4a899349af35a6ef6)
Author: Alan Hourihane <alanh at fairlite.demon.co.uk>
Date:   Thu Apr 20 10:43:19 2006 +0100

    fix bug 6365

diff --git a/src/i830_dri.c b/src/i830_dri.c
index e5890c2..13d2cfd 100644
--- a/src/i830_dri.c
+++ b/src/i830_dri.c
@@ -771,6 +771,9 @@ I830DRIDoMappings(ScreenPtr pScreen)
    sarea->depth_handle = 0;
    sarea->tex_handle = 0;
 
+   /* Assign pScreen */
+   pScrn->pScreen = pScreen;
+
    /* Need to initialize pScreen now to let RandR know. */
    pScrn->pScreen->width = pScrn->virtualX;
    pScrn->pScreen->height = pScrn->virtualY;
diff-tree a85be820033af8bf30d1fec4a899349af35a6ef6 (from 3c9bc19db63a317db9e2d67a5bc15b1de1a1060a)
Author: Ian Romanick <idr at localhost.localdomain>
Date:   Mon Apr 17 12:52:30 2006 -0700

    Add missing new-line character in log message.

diff --git a/src/common.h b/src/common.h
index bb89dd2..9d3bd03 100644
--- a/src/common.h
+++ b/src/common.h
@@ -131,7 +131,7 @@ extern void I830DPRINTF_stub(const char 
    RecPtr->LpRing->space -= ringused;					\
    if (outring & 0x07)							\
       ErrorF("ADVANCE_LP_RING: "					\
-	     "outring (0x%x) isn't on a QWord boundary", outring);	\
+	     "outring (0x%x) isn't on a QWord boundary\n", outring);	\
    OUTREG(LP_RING + RING_TAIL, outring);				\
 } while (0)
 
diff-tree 3c9bc19db63a317db9e2d67a5bc15b1de1a1060a (from a797a6626a8117cd16456a206ed96300e4a0ceeb)
Author: Alan Hourihane <alanh at jetpack.demon.co.uk>
Date:   Wed Apr 12 21:54:50 2006 +0100

    fix typo

diff --git a/src/i830_video.c b/src/i830_video.c
index afdc99a..0ae6860 100644
--- a/src/i830_video.c
+++ b/src/i830_video.c
@@ -1390,9 +1390,7 @@ I830DisplayVideo(ScrnInfoPtr pScrn, int 
 
    /* When in dual head with different bpp setups we need to refresh the
     * color key, so let's reset the video parameters and refresh here */
-#if 0
    if (pI830->entityPrivate)
-#endif
       I830ResetVideo(pScrn);
 
    /* Ensure overlay is turned on with OVERLAY_ENABLE at 0 */
diff-tree a797a6626a8117cd16456a206ed96300e4a0ceeb (from 66d216da3bfe7c143d681b610130e6daf6dfa52f)
Author: Wang Zhenyu <zhenyu.z.wang at intel.com>
Date:   Tue Apr 11 16:44:42 2006 -0700

    Fix a broken test that resulted in page flipping always being enabled, not just
    when the user enabled it.

diff --git a/src/i810_driver.c b/src/i810_driver.c
index 0661538..7d854df 100644
--- a/src/i810_driver.c
+++ b/src/i810_driver.c
@@ -1093,7 +1093,7 @@ I810PreInit(ScrnInfoPtr pScrn, int flags
 #ifdef XF86DRI
    if (!pI810->directRenderingDisabled) {
      pI810->allowPageFlip = enable;
-     if (pI810->allowPageFlip == enable)
+     if (pI810->allowPageFlip == TRUE)
      {
        if (!xf86LoadSubModule(pScrn, "shadowfb")) {
 	 pI810->allowPageFlip = 0;
diff-tree 66d216da3bfe7c143d681b610130e6daf6dfa52f (from 692a4a4bafd4cab197b761cda22368581b78f996)
Author: Eric Anholt <anholt at leguin.anholt.net>
Date:   Tue Apr 11 16:37:10 2006 -0700

    Replace .cvsignore with .gitignore.

diff --git a/.cvsignore b/.cvsignore
deleted file mode 100644
index c7bcbee..0000000
--- a/.cvsignore
+++ /dev/null
@@ -1,20 +0,0 @@
-Makefile
-Makefile.in
-*.la
-*.lo
-aclocal.m4
-autom4te.cache
-compile
-config.guess
-config.h
-config.h.in
-config.log
-config.status
-config.sub
-configure
-depcomp
-install-sh
-libtool
-ltmain.sh
-missing
-stamp-h1
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..6f660b9
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,22 @@
+.deps
+.libs
+Makefile
+Makefile.in
+*.la
+*.lo
+aclocal.m4
+autom4te.cache
+compile
+config.guess
+config.h
+config.h.in
+config.log
+config.status
+config.sub
+configure
+depcomp
+install-sh
+libtool
+ltmain.sh
+missing
+stamp-h1
diff --git a/man/.gitignore b/man/.gitignore
new file mode 100644
index 0000000..a438e80
--- /dev/null
+++ b/man/.gitignore
@@ -0,0 +1,2 @@
+i810.4
+i810.4x
diff --git a/src/.cvsignore b/src/.cvsignore
deleted file mode 100644
index 9730646..0000000
--- a/src/.cvsignore
+++ /dev/null
@@ -1,6 +0,0 @@
-.deps
-.libs
-Makefile
-Makefile.in
-*.la
-*.lo



More information about the xorg-commit mailing list