[xorg-x11-drv-r128] Update to git snapshot Add hack to allow building with --disable-dri

Peter Hutterer whot at fedoraproject.org
Wed Jan 4 04:58:10 UTC 2012


commit ead3f760702a33ebdec7ae17e61f7da2e6e68699
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Wed Jan 4 14:54:06 2012 +1000

    Update to git snapshot
    Add hack to allow building with --disable-dri

 .gitignore                                         |    1 +
 ...86DRI-from-the-driver-specific-DRI-define.patch |  400 ++++++++++++++++++++
 commitid                                           |    1 +
 make-git-snapshot.sh                               |   18 +
 sources                                            |    2 +-
 xorg-x11-drv-r128.spec                             |   24 +-
 6 files changed, 441 insertions(+), 5 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index b39f865..7d5ff11 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
 xf86-video-r128-6.8.1.tar.bz2
+/xf86-video-r128-20120104.tar.bz2
diff --git a/0001-Untangle-XF86DRI-from-the-driver-specific-DRI-define.patch b/0001-Untangle-XF86DRI-from-the-driver-specific-DRI-define.patch
new file mode 100644
index 0000000..fa0784e
--- /dev/null
+++ b/0001-Untangle-XF86DRI-from-the-driver-specific-DRI-define.patch
@@ -0,0 +1,400 @@
+From 22057e94b9f7cc8f707893400628c2d9875b2955 Mon Sep 17 00:00:00 2001
+From: Peter Hutterer <peter.hutterer at who-t.net>
+Date: Wed, 4 Jan 2012 14:24:36 +1000
+Subject: [PATCH] Untangle XF86DRI from the driver-specific DRI define
+
+XF86DRI is defined by xorg-server.h, so --disable-dri in the driver
+itself does exactly nothing other than not fill in the CFLAGS and thus stop
+the driver from compiling.
+
+Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
+---
+ configure.ac      |    4 ++--
+ src/r128.h        |   14 +++++++++-----
+ src/r128_accel.c  |   18 +++++++++---------
+ src/r128_dga.c    |   10 +++++-----
+ src/r128_driver.c |   32 ++++++++++++++++----------------
+ src/r128_video.c  |    8 ++++----
+ 6 files changed, 45 insertions(+), 41 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index d5a0821..4ba44db 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -106,8 +106,8 @@ AC_MSG_RESULT([$DRI])
+ AM_CONDITIONAL(DRI, test x$DRI = xyes)
+ if test "$DRI" = yes; then
+ 	PKG_CHECK_MODULES(DRI, [libdrm >= 2.2 xf86driproto])
+-        AC_DEFINE(XF86DRI,1,[Enable DRI driver support])
+-        AC_DEFINE(XF86DRI_DEVEL,1,[Enable developmental DRI driver support])
++        AC_DEFINE(R128DRI,1,[Enable DRI driver support])
++        AC_DEFINE(R128DRI_DEVEL,1,[Enable developmental DRI driver support])
+ fi
+ 
+ SAVE_CPPFLAGS="$CPPFLAGS"
+diff --git a/src/r128.h b/src/r128.h
+index 1205245..fcef00c 100644
+--- a/src/r128.h
++++ b/src/r128.h
+@@ -56,7 +56,11 @@
+ #include "r128_probe.h"
+ 
+ 				/* DRI support */
+-#ifdef XF86DRI
++#ifndef XF86DRI
++#undef R128DRI
++#endif
++
++#if R128DRI
+ #define _XF86DRI_SERVER_
+ #include "r128_dripriv.h"
+ #include "dri.h"
+@@ -303,14 +307,14 @@ typedef struct {
+     int               scanline_y;
+     int               scanline_w;
+     int               scanline_h;
+-#ifdef XF86DRI
++#ifdef R128DRI
+     int               scanline_hpass;
+     int               scanline_x1clip;
+     int               scanline_x2clip;
+     int               scanline_rop;
+     int               scanline_fg;
+     int               scanline_bg;
+-#endif /* XF86DRI */
++#endif /* R128DRI */
+     int               scanline_words;
+     int               scanline_direct;
+     int               scanline_bpp; /* Only used for ImageWrite */
+@@ -322,7 +326,7 @@ typedef struct {
+     DGAFunctionRec    DGAFuncs;
+ 
+     R128FBLayout      CurrentLayout;
+-#ifdef XF86DRI
++#ifdef R128DRI
+     Bool              directRenderingEnabled;
+     DRIInfoPtr        pDRIInfo;
+     int               drmFD;
+@@ -474,7 +478,7 @@ extern int         R128MinBits(int val);
+ 
+ extern void        R128InitVideo(ScreenPtr pScreen);
+ 
+-#ifdef XF86DRI
++#ifdef R128DRI
+ extern Bool        R128DRIScreenInit(ScreenPtr pScreen);
+ extern void        R128DRICloseScreen(ScreenPtr pScreen);
+ extern Bool        R128DRIFinishScreenInit(ScreenPtr pScreen);
+diff --git a/src/r128_accel.c b/src/r128_accel.c
+index e383cfa..056b0b3 100644
+--- a/src/r128_accel.c
++++ b/src/r128_accel.c
+@@ -88,7 +88,7 @@
+ #include "r128.h"
+ #include "r128_reg.h"
+ #include "r128_probe.h"
+-#ifdef XF86DRI
++#ifdef R128DRI
+ #include "r128_sarea.h"
+ #define _XF86DRI_SERVER_
+ #include "r128_dri.h"
+@@ -187,7 +187,7 @@ void R128WaitForFifoFunction(ScrnInfoPtr pScrn, int entries)
+ 	xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ 		   "FIFO timed out, resetting engine...\n");
+ 	R128EngineReset(pScrn);
+-#ifdef XF86DRI
++#ifdef R128DRI
+ 	R128CCE_RESET(pScrn, info);
+ 	if (info->directRenderingEnabled) {
+ 	    R128CCE_START(pScrn, info);
+@@ -220,11 +220,11 @@ void R128WaitForIdle(ScrnInfoPtr pScrn)
+ 		   INREG(R128_GUI_PROBE)));
+ 	xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ 		   "Idle timed out, resetting engine...\n");
+-#ifdef XF86DRI
++#ifdef R128DRI
+         R128CCE_STOP(pScrn, info);
+ #endif
+ 	R128EngineReset(pScrn);
+-#ifdef XF86DRI
++#ifdef R128DRI
+ 	R128CCE_RESET(pScrn, info);
+ 	if (info->directRenderingEnabled) {
+ 	    R128CCE_START(pScrn, info);
+@@ -233,7 +233,7 @@ void R128WaitForIdle(ScrnInfoPtr pScrn)
+     }
+ }
+ 
+-#ifdef XF86DRI
++#ifdef R128DRI
+ /* Wait until the CCE is completely idle: the FIFO has drained and the
+  * CCE is idle.
+  */
+@@ -1069,7 +1069,7 @@ void R128EngineInit(ScrnInfoPtr pScrn)
+     /* FIXME: this is a kludge for texture uploads in the 3D driver. Look at
+      * how the radeon driver handles HOST_DATA_SWAP if you want to implement
+      * CCE ImageWrite acceleration or anything needing this bit */
+-#ifdef XF86DRI
++#ifdef R128DRI
+     if (info->directRenderingEnabled)
+ 	OUTREGP(R128_DP_DATATYPE, 0, ~R128_HOST_BIG_ENDIAN_EN);
+     else
+@@ -1080,7 +1080,7 @@ void R128EngineInit(ScrnInfoPtr pScrn)
+     OUTREGP(R128_DP_DATATYPE, 0, ~R128_HOST_BIG_ENDIAN_EN);
+ #endif
+ 
+-#ifdef XF86DRI
++#ifdef R128DRI
+     info->sc_left         = 0x00000000;
+     info->sc_right        = R128_DEFAULT_SC_RIGHT_MAX;
+     info->sc_top          = 0x00000000;
+@@ -1096,7 +1096,7 @@ void R128EngineInit(ScrnInfoPtr pScrn)
+     R128WaitForIdle(pScrn);
+ }
+ 
+-#ifdef XF86DRI
++#ifdef R128DRI
+ 
+ /* Setup for XAA SolidFill. */
+ static void R128CCESetupForSolidFill(ScrnInfoPtr pScrn,
+@@ -1871,7 +1871,7 @@ Bool R128AccelInit(ScreenPtr pScreen)
+ 
+     if (!(a = info->accel = XAACreateInfoRec())) return FALSE;
+ 
+-#ifdef XF86DRI
++#ifdef R128DRI
+     if (info->directRenderingEnabled)
+ 	R128CCEAccelInit(pScrn, a);
+     else
+diff --git a/src/r128_dga.c b/src/r128_dga.c
+index 1e493ee..1c8a8dd 100644
+--- a/src/r128_dga.c
++++ b/src/r128_dga.c
+@@ -20,7 +20,7 @@
+ 				/* DGA support */
+ #include "dgaproc.h"
+ 
+-#ifdef XF86DRI
++#ifdef R128DRI
+ #include "r128_common.h"
+ #endif
+ 
+@@ -244,14 +244,14 @@ R128_SetMode(
+ 	pScrn->currentMode = info->CurrentLayout.mode;
+ 
+ 	pScrn->SwitchMode(indx, pScrn->currentMode, 0);
+-#ifdef XF86DRI
++#ifdef R128DRI
+ 	if (info->directRenderingEnabled) {
+ 	    R128CCE_STOP(pScrn, info);
+ 	}
+ #endif
+ 	if (info->accelOn)
+ 	    R128EngineInit(pScrn);
+-#ifdef XF86DRI
++#ifdef R128DRI
+ 	if (info->directRenderingEnabled) {
+ 	    R128CCE_START(pScrn, info);
+ 	}
+@@ -276,14 +276,14 @@ R128_SetMode(
+ 
+ 	pScrn->SwitchMode(indx, pMode->mode, 0);
+ 
+-#ifdef XF86DRI
++#ifdef R128DRI
+ 	if (info->directRenderingEnabled) {
+ 	    R128CCE_STOP(pScrn, info);
+ 	}
+ #endif
+ 	if (info->accelOn)
+ 		R128EngineInit(pScrn);
+-#ifdef XF86DRI
++#ifdef R128DRI
+ 	if (info->directRenderingEnabled) {
+ 	    R128CCE_START(pScrn, info);
+ 	}
+diff --git a/src/r128_driver.c b/src/r128_driver.c
+index 4887727..dc83076 100644
+--- a/src/r128_driver.c
++++ b/src/r128_driver.c
+@@ -71,7 +71,7 @@
+ #include "r128_reg.h"
+ #include "r128_version.h"
+ 
+-#ifdef XF86DRI
++#ifdef R128DRI
+ #define _XF86DRI_SERVER_
+ #include "r128_dri.h"
+ #include "r128_common.h"
+@@ -133,7 +133,7 @@ typedef enum {
+   OPTION_SW_CURSOR,
+   OPTION_DAC_6BIT,
+   OPTION_DAC_8BIT,
+-#ifdef XF86DRI
++#ifdef R128DRI
+   OPTION_XV_DMA,
+   OPTION_IS_PCI,
+   OPTION_CCE_PIO,
+@@ -164,7 +164,7 @@ static const OptionInfoRec R128Options[] = {
+   { OPTION_SW_CURSOR,    "SWcursor",         OPTV_BOOLEAN, {0}, FALSE },
+   { OPTION_DAC_6BIT,     "Dac6Bit",          OPTV_BOOLEAN, {0}, FALSE },
+   { OPTION_DAC_8BIT,     "Dac8Bit",          OPTV_BOOLEAN, {0}, TRUE  },
+-#ifdef XF86DRI
++#ifdef R128DRI
+   { OPTION_XV_DMA,       "DMAForXv",         OPTV_BOOLEAN, {0}, FALSE },
+   { OPTION_IS_PCI,       "ForcePCIMode",     OPTV_BOOLEAN, {0}, FALSE },
+   { OPTION_CCE_PIO,      "CCEPIOMode",       OPTV_BOOLEAN, {0}, FALSE },
+@@ -1175,7 +1175,7 @@ static Bool R128PreInitConfig(ScrnInfoPtr pScrn)
+ 	}
+     }
+ 
+-#ifdef XF86DRI
++#ifdef R128DRI
+ 				/* DMA for Xv */
+     info->DMAForXv = xf86ReturnOptValBool(info->Options, OPTION_XV_DMA, FALSE);
+     if (info->DMAForXv) {
+@@ -1766,7 +1766,7 @@ static Bool R128PreInitInt10(ScrnInfoPtr pScrn, xf86Int10InfoPtr *ppInt10)
+     return TRUE;
+ }
+ 
+-#ifdef XF86DRI
++#ifdef R128DRI
+ static Bool R128PreInitDRI(ScrnInfoPtr pScrn)
+ {
+     R128InfoPtr   info = R128PTR(pScrn);
+@@ -2065,7 +2065,7 @@ Bool R128PreInit(ScrnInfoPtr pScrn, int flags)
+ 
+     if (!R128PreInitCursor(pScrn))             goto fail;
+ 
+-#ifdef XF86DRI
++#ifdef R128DRI
+     if (!R128PreInitDRI(pScrn))                goto fail;
+ #endif
+ 
+@@ -2171,7 +2171,7 @@ R128BlockHandler(int i, pointer blockData, pointer pTimeout, pointer pReadmask)
+     ScrnInfoPtr pScrn   = xf86Screens[i];
+     R128InfoPtr info    = R128PTR(pScrn);
+ 
+-#ifdef XF86DRI
++#ifdef R128DRI
+     if (info->directRenderingEnabled)
+         FLUSH_RING();
+ #endif
+@@ -2197,7 +2197,7 @@ Bool R128ScreenInit(int scrnIndex, ScreenPtr pScreen,
+ 
+     R128TRACE(("R128ScreenInit %x %d\n", pScrn->memPhysBase, pScrn->fbOffset));
+ 
+-#ifdef XF86DRI
++#ifdef R128DRI
+ 				/* Turn off the CCE for now. */
+     info->CCEInUse     = FALSE;
+     info->indirectBuffer = NULL;
+@@ -2206,7 +2206,7 @@ Bool R128ScreenInit(int scrnIndex, ScreenPtr pScreen,
+     if (!R128MapMem(pScrn)) return FALSE;
+     pScrn->fbOffset    = 0;
+     if(info->IsSecondary) pScrn->fbOffset = pScrn->videoRam * 1024;
+-#ifdef XF86DRI
++#ifdef R128DRI
+     info->fbX          = 0;
+     info->fbY          = 0;
+     info->frontOffset  = 0;
+@@ -2235,7 +2235,7 @@ Bool R128ScreenInit(int scrnIndex, ScreenPtr pScreen,
+ 
+     noAccel = xf86ReturnOptValBool(info->Options, OPTION_NOACCEL, FALSE);
+ 
+-#ifdef XF86DRI
++#ifdef R128DRI
+ 				/* Setup DRI after visuals have been
+ 				   established, but before fbScreenInit is
+ 				   called.  fbScreenInit will eventually
+@@ -2320,7 +2320,7 @@ Bool R128ScreenInit(int scrnIndex, ScreenPtr pScreen,
+     fbPictureInit (pScreen, 0, 0);
+ 
+ 				/* Memory manager setup */
+-#ifdef XF86DRI
++#ifdef R128DRI
+     if (info->directRenderingEnabled) {
+ 	FBAreaPtr fbarea;
+ 	int width_bytes = (pScrn->displayWidth *
+@@ -2622,7 +2622,7 @@ Bool R128ScreenInit(int scrnIndex, ScreenPtr pScreen,
+     if (serverGeneration == 1)
+ 	xf86ShowUnusedOptions(pScrn->scrnIndex, pScrn->options);
+ 
+-#ifdef XF86DRI
++#ifdef R128DRI
+ 				/* DRI finalization */
+     if (info->directRenderingEnabled) {
+ 				/* Now that mi, fb, drm and others have
+@@ -3351,7 +3351,7 @@ static void R128InitCommonRegisters(R128SavePtr save, R128InfoPtr info)
+     save->subpic_cntl        = 0;
+     save->viph_control       = 0;
+     save->i2c_cntl_1         = 0;
+-#ifdef XF86DRI
++#ifdef R128DRI
+     save->gen_int_cntl       = info->gen_int_cntl;
+ #else
+     save->gen_int_cntl       = 0;
+@@ -4234,7 +4234,7 @@ Bool R128EnterVT(int scrnIndex, int flags)
+     if (info->accelOn)
+ 	R128EngineInit(pScrn);
+ 
+-#ifdef XF86DRI
++#ifdef R128DRI
+     if (info->directRenderingEnabled) {
+ 	if (info->irq) {
+ 	    /* Need to make sure interrupts are enabled */
+@@ -4261,7 +4261,7 @@ void R128LeaveVT(int scrnIndex, int flags)
+     R128SavePtr save  = &info->ModeReg;
+ 
+     R128TRACE(("R128LeaveVT\n"));
+-#ifdef XF86DRI
++#ifdef R128DRI
+     if (info->directRenderingEnabled) {
+ 	DRILock(pScrn->pScreen, 0);
+ 	R128CCE_STOP(pScrn, info);
+@@ -4286,7 +4286,7 @@ static Bool R128CloseScreen(int scrnIndex, ScreenPtr pScreen)
+ 
+     R128TRACE(("R128CloseScreen\n"));
+ 
+-#ifdef XF86DRI
++#ifdef R128DRI
+ 				/* Disable direct rendering */
+     if (info->directRenderingEnabled) {
+ 	R128DRICloseScreen(pScreen);
+diff --git a/src/r128_video.c b/src/r128_video.c
+index ec22ee1..11bb9bd 100644
+--- a/src/r128_video.c
++++ b/src/r128_video.c
+@@ -8,7 +8,7 @@
+ #include "r128.h"
+ #include "r128_reg.h"
+ 
+-#ifdef XF86DRI
++#ifdef R128DRI
+ #include "r128_common.h"
+ #include "r128_sarea.h"
+ #endif
+@@ -392,7 +392,7 @@ R128DMA(
+   int w
+ ){
+ 
+-#ifdef XF86DRI
++#ifdef R128DRI
+ 
+ #define BUFSIZE (R128_BUFFER_SIZE - R128_HOSTDATA_BLIT_OFFSET)
+ #define MAXPASSES (MAXHEIGHT/(BUFSIZE/(MAXWIDTH*2))+1)
+@@ -481,10 +481,10 @@ R128DMA(
+ 
+ #else
+ 
+-    /* This is to avoid cluttering the rest of the code with '#ifdef XF86DRI' */
++    /* This is to avoid cluttering the rest of the code with '#ifdef R128DRI' */
+     return FALSE;
+ 
+-#endif	/* XF86DRI */
++#endif	/* R128DRI */
+ 
+ }
+ 
+-- 
+1.7.7.4
+
diff --git a/commitid b/commitid
new file mode 100644
index 0000000..ed9405e
--- /dev/null
+++ b/commitid
@@ -0,0 +1 @@
+b4892e34011d6da577002a29913a803d5dbe1c06
diff --git a/make-git-snapshot.sh b/make-git-snapshot.sh
new file mode 100755
index 0000000..1ca1b12
--- /dev/null
+++ b/make-git-snapshot.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+MODULE=xf86-video-r128
+DIRNAME=$MODULE-$( date +%Y%m%d )
+
+rm -rf $DIRNAME
+git clone git://git.freedesktop.org/git/xorg/driver/$MODULE $DIRNAME
+cd $DIRNAME
+if [ -z "$1" ]; then
+    git log | head -1
+else
+    git checkout $1
+fi
+git log | head -1 | awk '{ print $2 }' > ../commitid
+git repack -a -d
+cd ..
+tar jcf $DIRNAME.tar.bz2 $DIRNAME
+rm -rf $DIRNAME
diff --git a/sources b/sources
index 5a284b8..451bd31 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-2b90854a62a4d45d652062f582dc8d13  xf86-video-r128-6.8.1.tar.bz2
+e7bee3dba3941f034ae8deef955d8595  xf86-video-r128-20120104.tar.bz2
diff --git a/xorg-x11-drv-r128.spec b/xorg-x11-drv-r128.spec
index 69ad46d..53d8aae 100644
--- a/xorg-x11-drv-r128.spec
+++ b/xorg-x11-drv-r128.spec
@@ -2,20 +2,31 @@
 %define moduledir %(pkg-config xorg-server --variable=moduledir )
 %define driverdir	%{moduledir}/drivers
 
+%global gitdate 20120104
+%global gitversion b4892e340
+
 Summary:   Xorg X11 r128 video driver
 Name:      xorg-x11-drv-r128
 Version:   6.8.1
-Release:   16%{?dist}
+Release:   17%{?gitdate:.%{gitdate}git%{gitversion}}%{dist}
 URL:       http://www.x.org
 License:   MIT
 Group:     User Interface/X Hardware Support
 
+%if 0%{?gitdate}
+Source0:    %{tarball}-%{gitdate}.tar.bz2
+Source1:    make-git-snapshot.sh
+Source2:    commitid
+%else
 Source0:   http://www.x.org/pub/individual/driver/%{tarball}-%{version}.tar.bz2
+%endif
 
 Patch0:	    r128-6.8.1-panel-hack.patch
+Patch2:     0001-Untangle-XF86DRI-from-the-driver-specific-DRI-define.patch
 
 ExcludeArch: s390 s390x
 
+BuildRequires: autoconf automake libtool
 BuildRequires: xorg-x11-server-sdk >= 1.10.99.902
 BuildRequires: mesa-libGL-devel >= 6.4-4
 BuildRequires: libdrm-devel >= 2.0-1
@@ -29,11 +40,12 @@ Requires: Xorg %(xserver-sdk-abi-requires videodrv)
 X.Org X11 r128 video driver.
 
 %prep
-%setup -q -n %{tarball}-%{version}
+%setup -q -n %{tarball}-%{?gitdate:%{gitdate}}%{!?gitdate:%{version}}
 %patch0 -p1 -b .panel
+%patch2 -p1 -b .dri-hack
 
 %build
-# aclocal ; automake -a ; autoconf
+autoreconf -v --install || exit 1
 %configure --disable-static --disable-dri
 make %{?_smp_mflags}
 
@@ -49,11 +61,15 @@ rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(-,root,root,-)
-%doc README.r128
+%doc README
 %{driverdir}/r128_drv.so
 %{_mandir}/man4/r128.4*
 
 %changelog
+* Wed Jan 04 2012 Peter Hutterer <peter.hutterer at redhat.com> 6.8.1-17.20120104.gitb4892e340
+- Update to git snapshot
+- Add hack to allow building with --disable-dri
+
 * Wed Jan 04 2012 Peter Hutterer <peter.hutterer at redhat.com> - 6.8.1-16
 - Rebuild for server 1.12
 


More information about the scm-commits mailing list