xf86-video-intel: Branch 'modesetting' - 2 commits - configure.ac src/i830_debug.c src/i830_display.c src/i830_dri.c src/i830_driver.c src/i830_edid_modes.c src/i830_exa.c src/i830.h src/i830_randr.c src/i830_tv.c src/i830_xf86Crtc.c src/i830_xf86Crtc.h src/i830_xf86cvt.c src/i965_video.c

Keith Packard keithp at kemper.freedesktop.org
Tue Jan 2 10:17:06 EET 2007


 configure.ac          |    6 +
 src/i830.h            |    8 --
 src/i830_debug.c      |    1 
 src/i830_display.c    |    8 --
 src/i830_dri.c        |    5 +
 src/i830_driver.c     |   20 ++---
 src/i830_edid_modes.c |    2 
 src/i830_exa.c        |    1 
 src/i830_randr.c      |  200 +++++++++++++++++++++++---------------------------
 src/i830_tv.c         |    1 
 src/i830_xf86Crtc.c   |    7 +
 src/i830_xf86Crtc.h   |    8 ++
 src/i830_xf86cvt.c    |    1 
 src/i965_video.c      |    1 
 14 files changed, 134 insertions(+), 135 deletions(-)

New commits:
diff-tree 5080307230d534b84090bfefc13ac437d53f915d (from 237847007afb5a429a50b6aa0b1acc239326571b)
Author: Keith Packard <keithp at mandolin.keithp.com>
Date:   Tue Jan 2 00:16:41 2007 -0800

    Fix driver to build on RandR 1.2 systems again.
    
    Changes to move initial config code to RandR 1.1/1.2 common path broke
    code required only for RandR 1.2.

diff --git a/src/i830_randr.c b/src/i830_randr.c
index 55ff31e..d5ccce3 100644
--- a/src/i830_randr.c
+++ b/src/i830_randr.c
@@ -864,7 +864,11 @@ xf86RandR12CreateObjects12 (ScreenPtr pS
 static Bool
 xf86RandR12CreateScreenResources12 (ScreenPtr pScreen)
 {
-    
+    int			c;
+    ScrnInfoPtr		pScrn = xf86Screens[pScreen->myNum];
+    XF86RandRInfoPtr	randrp = XF86RANDRINFO(pScreen);
+    xf86CrtcConfigPtr   config = XF86_CRTC_CONFIG_PTR(pScrn);
+
     for (c = 0; c < config->num_crtc; c++)
 	xf86RandR12CrtcNotify (config->crtc[c]->randr_crtc);
     
diff-tree 237847007afb5a429a50b6aa0b1acc239326571b (from 25d5a892319b02dc6eb81390dea29cd88a1e7da4)
Author: Keith Packard <keithp at mandolin.keithp.com>
Date:   Tue Jan 2 00:09:35 2007 -0800

    Make driver build and run on Xorg 7.1. Delay DSP*BASE setting until last.
    
    Autodetect libdrm version, disable new memory manager on older libraries.
    Move new M_T_ defines from i830.h to i830_xf86Crtc.h. Add many system
    headers to define functions. Use i830PipeSetBase at end of mode setting
    code to set DSP*BASE and flush changes. Don't duplicate PipeSetBase call
    from screen init function. Make initial RandR configuration code usable on
    older versions of extension so the server doesn't start in a panning mode.
    Use xfree instead of free in i830_tv.c.

diff --git a/configure.ac b/configure.ac
index be80a87..b295c5a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -120,9 +120,13 @@ fi
 
 AM_CONDITIONAL(DRI, test x$DRI = xyes)
 if test "$DRI" = yes; then
-        PKG_CHECK_MODULES(DRI, [libdrm >= 2.2 xf86driproto])
+        PKG_CHECK_MODULES(DRI, [libdrm xf86driproto])
         AC_DEFINE(XF86DRI,1,[Enable DRI driver support])
         AC_DEFINE(XF86DRI_DEVEL,1,[Enable developmental DRI driver support])
+	PKG_CHECK_MODULES(DRI_MM, [libdrm >= 2.2],[DRI_MM=yes], [DRI_MM=no])
+	if test "x$DRM_MM" = xyes; then
+		AC_DEFINE(XF86DRI_MM,1,[Extended DRI memory management])
+	fi
 fi
 
 AM_CONDITIONAL(VIDEO_DEBUG, test x$VIDEO_DEBUG = xyes)
diff --git a/src/i830.h b/src/i830.h
index 06f6838..c2670cd 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -628,14 +628,6 @@ void i830_tv_init(ScrnInfoPtr pScrn);
 #define _845_DRAM_RW_CONTROL 0x90
 #define DRAM_WRITE    0x33330000
 
-/* Compat definitions for older X Servers. */
-#ifndef M_T_PREFERRED
-#define M_T_PREFERRED	0x08
-#endif
-#ifndef M_T_DRIVER
-#define M_T_DRIVER	0x40
-#endif
-
 /* 
  * Xserver MM compatibility. Remove code guarded by this when the
  * XServer contains the libdrm mm code
diff --git a/src/i830_debug.c b/src/i830_debug.c
index 25245fb..897ab92 100644
--- a/src/i830_debug.c
+++ b/src/i830_debug.c
@@ -32,6 +32,7 @@
 #include "xf86.h"
 #include "i830.h"
 #include "i830_debug.h"
+#include <strings.h>
 
 #define DEBUGSTRING(func) static char *func(I830Ptr pI830, int reg, CARD32 val)
 
diff --git a/src/i830_display.c b/src/i830_display.c
index c5880d6..9ec46a4 100644
--- a/src/i830_display.c
+++ b/src/i830_display.c
@@ -350,8 +350,8 @@ i830PipeSetBase(xf86CrtcPtr crtc, int x,
     }
 
     if (IS_I965G(pI830)) {
-	OUTREG(dspbase, ((y * pScrn->displayWidth + x) * pI830->cpp));
-	OUTREG(dspsurf, Start);
+        OUTREG(dspbase, ((y * pScrn->displayWidth + x) * pI830->cpp));
+        OUTREG(dspsurf, Start);
     } else {
 	OUTREG(dspbase, Start + ((y * pScrn->displayWidth + x) * pI830->cpp));
     }
@@ -603,7 +603,6 @@ i830_crtc_mode_set(xf86CrtcPtr crtc, Dis
     int dpll_reg = (pipe == 0) ? DPLL_A : DPLL_B;
     int dpll_md_reg = (intel_crtc->pipe == 0) ? DPLL_A_MD : DPLL_B_MD;
     int dspcntr_reg = (pipe == 0) ? DSPACNTR : DSPBCNTR;
-    int dspbase_reg = (pipe == 0) ? DSPABASE : DSPBBASE;
     int pipeconf_reg = (pipe == 0) ? PIPEACONF : PIPEBCONF;
     int htot_reg = (pipe == 0) ? HTOTAL_A : HTOTAL_B;
     int hblank_reg = (pipe == 0) ? HBLANK_A : HBLANK_B;
@@ -828,13 +827,12 @@ i830_crtc_mode_set(xf86CrtcPtr crtc, Dis
     OUTREG(dspsize_reg, ((mode->VDisplay - 1) << 16) | (mode->HDisplay - 1));
     OUTREG(dsppos_reg, 0);
     OUTREG(pipesrc_reg, ((mode->HDisplay - 1) << 16) | (mode->VDisplay - 1));
-    i830PipeSetBase(crtc, crtc->x, crtc->y);
     OUTREG(pipeconf_reg, pipeconf);
     i830WaitForVblank(pScrn);
     
     OUTREG(dspcntr_reg, dspcntr);
     /* Flush the plane changes */
-    OUTREG(dspbase_reg, INREG(dspbase_reg));
+    i830PipeSetBase(crtc, crtc->x, crtc->y);
     
     i830WaitForVblank(pScrn);
 }
diff --git a/src/i830_dri.c b/src/i830_dri.c
index c5d7a94..5fdacc7 100644
--- a/src/i830_dri.c
+++ b/src/i830_dri.c
@@ -655,11 +655,14 @@ I830DRIScreenInit(ScreenPtr pScreen)
 	 }
 	 pI830->drmMinor = version->version_minor;
 	 if (!(pI830->mmModeFlags & I830_KERNEL_TEX)) {
+#ifdef XF86DRI_MM	    
 	    if ((version->version_major > 1) ||
 		((version->version_minor >= 7) && 
 		 (version->version_major == 1))) {
 	       pI830->mmModeFlags |= I830_KERNEL_MM;
-	    } else {
+	    } else 
+#endif
+	    {
 	       pI830->mmModeFlags |= I830_KERNEL_TEX;
 	    }		
 	 } else {
diff --git a/src/i830_driver.c b/src/i830_driver.c
index 7f535ac..5264767 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -2469,11 +2469,7 @@ IntelEmitInvarientState(ScrnInfoPtr pScr
    }
 }
 
-#ifdef XF86DRI
-#ifndef DRM_BO_MEM_TT
-#error "Wrong drm.h file included. You need to compile and install a recent libdrm."
-#endif
-
+#ifdef XF86DRI_MM
 #ifndef XSERVER_LIBDRM_MM
 
 static int
@@ -2548,7 +2544,7 @@ static int I830DrmMMUnlock(int fd, unsig
 }
 
 #endif
-#endif
+#endif /* XF86DRI_MM */
 
 static Bool
 I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
@@ -3001,7 +2997,7 @@ I830ScreenInit(int scrnIndex, ScreenPtr 
          break;
    }
 
-#ifdef XF86DRI
+#ifdef XF86DRI_MM
    if (pI830->directRenderingEnabled && (pI830->mmModeFlags & I830_KERNEL_MM)) {
       unsigned long aperEnd = ROUND_DOWN_TO(pI830->FbMapSize, GTT_PAGE_SIZE) 
 	 / GTT_PAGE_SIZE;
@@ -3040,7 +3036,7 @@ I830ScreenInit(int scrnIndex, ScreenPtr 
 	 }
       }
    }
-#endif
+#endif /* XF86DRI_MM */
 
    return TRUE;
 }
@@ -3101,6 +3097,7 @@ I830LeaveVT(int scrnIndex, int flags)
 #ifdef XF86DRI
    if (pI830->directRenderingOpen) {
       DRILock(screenInfo.screens[pScrn->scrnIndex], 0);
+#ifdef XF86DRI_MM
       if (pI830->mmModeFlags & I830_KERNEL_MM) {
 #ifndef XSERVER_LIBDRM_MM
 	 I830DrmMMLock(pI830->drmSubFD, DRM_BO_MEM_TT);
@@ -3108,6 +3105,7 @@ I830LeaveVT(int scrnIndex, int flags)
 	 drmMMLock(pI830->drmSubFD, DRM_BO_MEM_TT);
 #endif
       }
+#endif /* XF86DRI_MM */
       I830DRISetVBlankInterrupt (pScrn, FALSE);
       
       drmCtlUninstHandler(pI830->drmSubFD);
@@ -3185,8 +3183,6 @@ I830EnterVT(int scrnIndex, int flags)
       
       if (!i830PipeSetMode (crtc, &crtc->desiredMode, TRUE))
 	 return FALSE;
-      
-      i830PipeSetBase(crtc, crtc->x, crtc->y);
    }
 
    i830DumpRegs (pScrn);
@@ -3221,6 +3217,7 @@ I830EnterVT(int scrnIndex, int flags)
 	 for(i = 0; i < I830_NR_TEX_REGIONS+1 ; i++)
 	    sarea->texList[i].age = sarea->texAge;
 
+#ifdef XF86DRI_MM
 	 if (pI830->mmModeFlags & I830_KERNEL_MM) {
 #ifndef XSERVER_LIBDRM_MM
 	    I830DrmMMUnlock(pI830->drmSubFD, DRM_BO_MEM_TT);
@@ -3228,6 +3225,7 @@ I830EnterVT(int scrnIndex, int flags)
 	    drmMMUnlock(pI830->drmSubFD, DRM_BO_MEM_TT);
 #endif
 	 }
+#endif /* XF86DRI_MM */
 
 	 DPRINTF(PFX, "calling dri unlock\n");
 	 DRIUnlock(screenInfo.screens[pScrn->scrnIndex]);
@@ -3371,6 +3369,7 @@ I830CloseScreen(int scrnIndex, ScreenPtr
    pI830->closing = TRUE;
 #ifdef XF86DRI
    if (pI830->directRenderingOpen) {
+#ifdef XF86DRI_MM
       if (pI830->mmModeFlags & I830_KERNEL_MM) {
 #ifndef XSERVER_LIBDRM_MM
 	 I830DrmMMTakedown(pI830->drmSubFD, DRM_BO_MEM_TT);
@@ -3378,6 +3377,7 @@ I830CloseScreen(int scrnIndex, ScreenPtr
 	 drmMMTakedown(pI830->drmSubFD, DRM_BO_MEM_TT);	 
 #endif
       }
+#endif /* XF86DRI_MM */
       pI830->directRenderingOpen = FALSE;
       I830DRICloseScreen(pScreen);
    }
diff --git a/src/i830_edid_modes.c b/src/i830_edid_modes.c
index c121610..31ce100 100644
--- a/src/i830_edid_modes.c
+++ b/src/i830_edid_modes.c
@@ -37,6 +37,8 @@
 #include "xf86DDC.h"
 #include "i830.h"
 #include "i830_display.h"
+#include <string.h>
+#include <math.h>
 
 #if XORG_VERSION_CURRENT <= XORG_VERSION_NUMERIC(7,2,99,2,0)
 
diff --git a/src/i830_exa.c b/src/i830_exa.c
index 7de5617..9356c79 100644
--- a/src/i830_exa.c
+++ b/src/i830_exa.c
@@ -36,6 +36,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN
 #include "i830.h"
 #include "i810_reg.h"
 #include "i830_reg.h"
+#include <string.h>
 
 #ifdef I830DEBUG
 #define DEBUG_I830FALLBACK 1
diff --git a/src/i830_randr.c b/src/i830_randr.c
index aa50254..55ff31e 100644
--- a/src/i830_randr.c
+++ b/src/i830_randr.c
@@ -325,6 +325,44 @@ xf86RandR12SetConfig (ScreenPtr		pScreen
     return TRUE;
 }
 
+static Bool
+xf86RandR12ScreenSetSize (ScreenPtr	pScreen,
+			CARD16		width,
+			CARD16		height,
+			CARD32		mmWidth,
+			CARD32		mmHeight)
+{
+    XF86RandRInfoPtr	randrp = XF86RANDRINFO(pScreen);
+    ScrnInfoPtr		pScrn = XF86SCRNINFO(pScreen);
+    WindowPtr		pRoot = WindowTable[pScreen->myNum];
+    Bool 		ret = TRUE;
+
+    if (randrp->virtualX == -1 || randrp->virtualY == -1)
+    {
+	randrp->virtualX = pScrn->virtualX;
+	randrp->virtualY = pScrn->virtualY;
+    }
+    if (pRoot)
+	(*pScrn->EnableDisableFBAccess) (pScreen->myNum, FALSE);
+    pScrn->virtualX = width;
+    pScrn->virtualY = height;
+
+    pScreen->width = pScrn->virtualX;
+    pScreen->height = pScrn->virtualY;
+    pScreen->mmWidth = mmWidth;
+    pScreen->mmHeight = mmHeight;
+
+    xf86SetViewport (pScreen, pScreen->width-1, pScreen->height-1);
+    xf86SetViewport (pScreen, 0, 0);
+    if (pRoot)
+	(*pScrn->EnableDisableFBAccess) (pScreen->myNum, TRUE);
+#if RANDR_12_INTERFACE
+    if (WindowTable[pScreen->myNum])
+	RRScreenSizeNotify (pScreen);
+#endif
+    return ret;
+}
+
 Rotation
 xf86RandR12GetRotation(ScreenPtr pScreen)
 {
@@ -336,38 +374,68 @@ xf86RandR12GetRotation(ScreenPtr pScreen
 Bool
 xf86RandR12CreateScreenResources (ScreenPtr pScreen)
 {
-#if 0
     ScrnInfoPtr		pScrn = xf86Screens[pScreen->myNum];
-    I830Ptr		pI830 = I830PTR(pScrn);
-#endif
+    xf86CrtcConfigPtr   config = XF86_CRTC_CONFIG_PTR(pScrn);
+    XF86RandRInfoPtr	randrp = XF86RANDRINFO(pScreen);
+    int			c;
+    int			width, height;
+    int			mmWidth, mmHeight;
 #ifdef PANORAMIX
     /* XXX disable RandR when using Xinerama */
     if (!noPanoramiXExtension)
 	return TRUE;
 #endif
+
+    /*
+     * Compute size of screen
+     */
+    width = 0; height = 0;
+    for (c = 0; c < config->num_crtc; c++)
+    {
+	xf86CrtcPtr crtc = config->crtc[c];
+	int	    crtc_width = crtc->x + crtc->curMode.HDisplay;
+	int	    crtc_height = crtc->y + crtc->curMode.VDisplay;
+	
+	if (crtc->enabled && crtc_width > width)
+	    width = crtc_width;
+	if (crtc->enabled && crtc_height > height)
+	    height = crtc_height;
+    }
+    
+    if (width && height)
+    {
+	/*
+	 * Compute physical size of screen
+	 */
+	if (monitorResolution) 
+	{
+	    mmWidth = width * 25.4 / monitorResolution;
+	    mmHeight = height * 25.4 / monitorResolution;
+	}
+	else
+	{
+	    mmWidth = pScreen->mmWidth;
+	    mmHeight = pScreen->mmHeight;
+	}
+	xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+		   "Setting screen physical size to %d x %d\n",
+		   mmWidth, mmHeight);
+	xf86RandR12ScreenSetSize (pScreen,
+				  width,
+				  height,
+				  mmWidth,
+				  mmHeight);
+    }
+
+    if (randrp->virtualX == -1 || randrp->virtualY == -1)
+    {
+	randrp->virtualX = pScrn->virtualX;
+	randrp->virtualY = pScrn->virtualY;
+    }
 #if RANDR_12_INTERFACE
     if (xf86RandR12CreateScreenResources12 (pScreen))
 	return TRUE;
 #endif
-#if 0
-    /* XXX deal with initial rotation */
-    if (pI830->rotation != RR_Rotate_0) {
-	RRScreenSize p;
-	Rotation requestedRotation = pI830->rotation;
-
-	pI830->rotation = RR_Rotate_0;
-
-	/* Just setup enough for an initial rotate */
-	p.width = pScreen->width;
-	p.height = pScreen->height;
-	p.mmWidth = pScreen->mmWidth;
-	p.mmHeight = pScreen->mmHeight;
-
-	pI830->starting = TRUE; /* abuse this for dual head & rotation */
-	xf86RandR12SetConfig (pScreen, requestedRotation, 0, &p);
-	pI830->starting = FALSE;
-    }
-#endif
     return TRUE;
 }
 
@@ -450,42 +518,6 @@ xf86RandR12GetOriginalVirtualSize(ScrnIn
 
 #if RANDR_12_INTERFACE
 static Bool
-xf86RandR12ScreenSetSize (ScreenPtr	pScreen,
-			CARD16		width,
-			CARD16		height,
-			CARD32		mmWidth,
-			CARD32		mmHeight)
-{
-    XF86RandRInfoPtr	randrp = XF86RANDRINFO(pScreen);
-    ScrnInfoPtr		pScrn = XF86SCRNINFO(pScreen);
-    WindowPtr		pRoot = WindowTable[pScreen->myNum];
-    Bool 		ret = TRUE;
-
-    if (randrp->virtualX == -1 || randrp->virtualY == -1)
-    {
-	randrp->virtualX = pScrn->virtualX;
-	randrp->virtualY = pScrn->virtualY;
-    }
-    if (pRoot)
-	(*pScrn->EnableDisableFBAccess) (pScreen->myNum, FALSE);
-    pScrn->virtualX = width;
-    pScrn->virtualY = height;
-
-    pScreen->width = pScrn->virtualX;
-    pScreen->height = pScrn->virtualY;
-    pScreen->mmWidth = mmWidth;
-    pScreen->mmHeight = mmHeight;
-
-    xf86SetViewport (pScreen, pScreen->width, pScreen->height);
-    xf86SetViewport (pScreen, 0, 0);
-    if (pRoot)
-	(*pScrn->EnableDisableFBAccess) (pScreen->myNum, TRUE);
-    if (WindowTable[pScreen->myNum])
-	RRScreenSizeNotify (pScreen);
-    return ret;
-}
-
-static Bool
 xf86RandR12CrtcNotify (RRCrtcPtr	randr_crtc)
 {
     ScreenPtr		pScreen = randr_crtc->pScreen;
@@ -832,62 +864,10 @@ xf86RandR12CreateObjects12 (ScreenPtr pS
 static Bool
 xf86RandR12CreateScreenResources12 (ScreenPtr pScreen)
 {
-    ScrnInfoPtr		pScrn = xf86Screens[pScreen->myNum];
-    xf86CrtcConfigPtr   config = XF86_CRTC_CONFIG_PTR(pScrn);
-    XF86RandRInfoPtr	randrp = XF86RANDRINFO(pScreen);
-    int			c;
-    int			width, height;
-    int			mmWidth, mmHeight;
-
-    /*
-     * Compute size of screen
-     */
-    width = 0; height = 0;
-    for (c = 0; c < config->num_crtc; c++)
-    {
-	xf86CrtcPtr crtc = config->crtc[c];
-	int	    crtc_width = crtc->x + crtc->curMode.HDisplay;
-	int	    crtc_height = crtc->y + crtc->curMode.VDisplay;
-	
-	if (crtc->enabled && crtc_width > width)
-	    width = crtc_width;
-	if (crtc->enabled && crtc_height > height)
-	    height = crtc_height;
-    }
     
-    if (width && height)
-    {
-	/*
-	 * Compute physical size of screen
-	 */
-	if (monitorResolution) 
-	{
-	    mmWidth = width * 25.4 / monitorResolution;
-	    mmHeight = height * 25.4 / monitorResolution;
-	}
-	else
-	{
-	    mmWidth = pScreen->mmWidth;
-	    mmHeight = pScreen->mmHeight;
-	}
-	xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-		   "Setting screen physical size to %d x %d\n",
-		   mmWidth, mmHeight);
-	xf86RandR12ScreenSetSize (pScreen,
-				  width,
-				  height,
-				  mmWidth,
-				  mmHeight);
-    }
-
     for (c = 0; c < config->num_crtc; c++)
 	xf86RandR12CrtcNotify (config->crtc[c]->randr_crtc);
     
-    if (randrp->virtualX == -1 || randrp->virtualY == -1)
-    {
-	randrp->virtualX = pScrn->virtualX;
-	randrp->virtualY = pScrn->virtualY;
-    }
     
     RRScreenSetSizeRange (pScreen, 320, 240,
 			  randrp->virtualX, randrp->virtualY);
diff --git a/src/i830_tv.c b/src/i830_tv.c
index f17a353..5cf36a5 100644
--- a/src/i830_tv.c
+++ b/src/i830_tv.c
@@ -36,6 +36,7 @@
 #include "xf86.h"
 #include "i830.h"
 #include "i830_display.h"
+#include <string.h>
 
 enum tv_type {
     TV_TYPE_NONE,
diff --git a/src/i830_xf86Crtc.c b/src/i830_xf86Crtc.c
index 33f96ab..a0f44df 100644
--- a/src/i830_xf86Crtc.c
+++ b/src/i830_xf86Crtc.c
@@ -143,7 +143,7 @@ xf86OutputSetMonitor (xf86OutputPtr outp
 	monitor = output->name;
     else
 	xf86MarkOptionUsedByName (output->scrn->options, option_name);
-    free (option_name);
+    xfree (option_name);
     output->conf_monitor = xf86findMonitor (monitor, xf86configptr->conf_monitor_lst);
 }
 
@@ -1026,7 +1026,10 @@ i830_xf86OutputSetEDID (xf86OutputPtr ou
 {
     ScrnInfoPtr		pScrn = output->scrn;
     xf86CrtcConfigPtr	config = XF86_CRTC_CONFIG_PTR(pScrn);
-    int			i, size;
+    int			i;
+#ifdef RANDR_12_INTERFACE
+    int			size;
+#endif
     
     if (output->MonInfo != NULL)
 	xfree(output->MonInfo);
diff --git a/src/i830_xf86Crtc.h b/src/i830_xf86Crtc.h
index 3e70563..b30003e 100644
--- a/src/i830_xf86Crtc.h
+++ b/src/i830_xf86Crtc.h
@@ -27,6 +27,14 @@
 #include "i830_xf86Modes.h"
 #include "xf86Parser.h"
 
+/* Compat definitions for older X Servers. */
+#ifndef M_T_PREFERRED
+#define M_T_PREFERRED	0x08
+#endif
+#ifndef M_T_DRIVER
+#define M_T_DRIVER	0x40
+#endif
+
 typedef struct _xf86Crtc xf86CrtcRec, *xf86CrtcPtr;
 typedef struct _xf86Output xf86OutputRec, *xf86OutputPtr;
 
diff --git a/src/i830_xf86cvt.c b/src/i830_xf86cvt.c
index dba57c8..1a2b786 100644
--- a/src/i830_xf86cvt.c
+++ b/src/i830_xf86cvt.c
@@ -39,6 +39,7 @@
 
 #include "i830.h"
 #include "i830_display.h"
+#include <string.h>
 
 #if XORG_VERSION_CURRENT <= XORG_VERSION_NUMERIC(7,2,99,2,0)
 /*
diff --git a/src/i965_video.c b/src/i965_video.c
index 0d1bec6..9e96527 100644
--- a/src/i965_video.c
+++ b/src/i965_video.c
@@ -39,6 +39,7 @@
 #include "i830_video.h"
 #include "brw_defines.h"
 #include "brw_structs.h"
+#include <string.h>
 
 /* Make assert() work. */
 #undef NDEBUG



More information about the xorg-commit mailing list