xf86-video-ati: Branch 'master' - 5 commits

George Sapountzis gsap7 at kemper.freedesktop.org
Mon Feb 5 19:35:08 EET 2007


 src/Makefile.am       |    9 +--
 src/atiaccel.c        |  113 ---------------------------------------
 src/atiaccel.h        |   35 ------------
 src/aticursor.c       |   71 -------------------------
 src/aticursor.h       |    2 
 src/atimach64accel.c  |   25 +++++++-
 src/atimach64accel.h  |    2 
 src/atimach64cursor.c |   29 +++++++++-
 src/atimach64cursor.h |   30 ----------
 src/atimach64xv.c     |  142 +++++++++++++++++++++++++++++++++++++++++++++++---
 src/atimach64xv.h     |   36 ------------
 src/atiscreen.c       |    5 -
 src/atixv.c           |  141 -------------------------------------------------
 13 files changed, 188 insertions(+), 452 deletions(-)

New commits:
diff-tree eda9fb15e8bc042661a91a3d8c921006dfb3ddd9 (from 67b240ddd4a6549a23885afc723b6efa7c52db4c)
Author: George Sapountzis <gsap7 at yahoo.gr>
Date:   Tue Nov 21 04:02:41 2006 +0200

    Consolidate atixv.c w/ atimach64xv.c, part 2.
    
    Move {Initialize,Close}XVideo from atixv.c to atimach64xv.c .

diff --git a/src/Makefile.am b/src/Makefile.am
index a386c61..f31c018 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -65,7 +65,7 @@ atimisc_drv_la_SOURCES = \
 	atilock.c atimach64.c atimach64accel.c atimach64cursor.c \
 	atimach64i2c.c atimach64io.c atimach64xv.c atimode.c atipreinit.c \
 	atiprint.c atirgb514.c atiscreen.c atituner.c atiutil.c ativalid.c \
-	atixv.c atiload.c atimisc.c $(ATIMISC_DRI_SRCS) $(ATIMISC_DGA_SOURCES) \
+	atiload.c atimisc.c $(ATIMISC_DRI_SRCS) $(ATIMISC_DGA_SOURCES) \
 	$(ATIMISC_CPIO_SOURCES) $(ATIMISC_EXA_SOURCES)
 
 r128_drv_la_LTLIBRARIES = r128_drv.la
@@ -135,7 +135,6 @@ EXTRA_DIST = \
 	atimach64i2c.h \
 	atimach64io.h \
 	atimach64render.c \
-	atimach64xv.h \
 	atimode.h \
 	atimodule.h \
 	atioption.h \
diff --git a/src/atimach64xv.c b/src/atimach64xv.c
index 54f5c4c..5df903b 100644
--- a/src/atimach64xv.c
+++ b/src/atimach64xv.c
@@ -30,10 +30,11 @@
 #include "atichip.h"
 #include "atimach64accel.h"
 #include "atimach64io.h"
-#include "atimach64xv.h"
+#include "atixv.h"
 
 #include <X11/extensions/Xv.h>
 #include "fourcc.h"
+#include "xf86xv.h"
 
 #define MAKE_ATOM(string) MakeAtom(string, strlen(string), TRUE)
 #define MaxScale          (CARD32)(CARD16)(-1)
@@ -1529,13 +1530,62 @@ ATIXVPreInit
 }
 
 /*
+ * ATIXVFreeAdaptorInfo --
+ *
+ * Free XVideo adaptor information.
+ */
+static void
+ATIXVFreeAdaptorInfo
+(
+    XF86VideoAdaptorPtr *ppAdaptor,
+    int                 nAdaptor
+)
+{
+    if (!ppAdaptor)
+        return;
+
+    while (nAdaptor > 0)
+        xfree(ppAdaptor[--nAdaptor]);
+
+    xfree(ppAdaptor);
+}
+
+/*
+ * ATIInitializeXVideo --
+ *
+ * This function is called to initialise XVideo extension support on a screen.
+ */
+Bool
+ATIInitializeXVideo
+(
+    ScreenPtr   pScreen,
+    ScrnInfoPtr pScreenInfo,
+    ATIPtr      pATI
+)
+{
+    XF86VideoAdaptorPtr *ppAdaptor;
+    int                 nAdaptor;
+    Bool                result;
+
+    pScreenInfo->memPhysBase = pATI->LinearBase;
+    pScreenInfo->fbOffset = 0;
+
+    nAdaptor = xf86XVListGenericAdaptors(pScreenInfo, &ppAdaptor);
+    result = xf86XVScreenInit(pScreen, ppAdaptor, nAdaptor);
+
+    ATIXVFreeAdaptorInfo(ppAdaptor, nAdaptor);
+
+    return result;
+}
+
+/*
  * ATIMach64CloseXVideo --
  *
  * This function is called during screen termination to clean up after
  * initialisation of Mach64 XVideo support.
  */
 void
-ATIMach64CloseXVideo
+ATICloseXVideo
 (
     ScreenPtr   pScreen,
     ScrnInfoPtr pScreenInfo,
diff --git a/src/atimach64xv.h b/src/atimach64xv.h
deleted file mode 100644
index f46a120..0000000
--- a/src/atimach64xv.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright 2003 through 2004 by Marc Aurele La France (TSI @ UQV), tsi at xfree86.org
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting documentation, and
- * that the name of Marc Aurele La France not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission.  Marc Aurele La France makes no representations
- * about the suitability of this software for any purpose.  It is provided
- * "as-is" without express or implied warranty.
- *
- * MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.  IN NO
- * EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifndef ___ATIMACH64XV_H___
-#define ___ATIMACH64XV_H___ 1
-
-#include "atipriv.h"
-
-#include "xf86str.h"
-#include "xf86xv.h"
-
-extern void ATIMach64CloseXVideo(ScreenPtr, ScrnInfoPtr, ATIPtr);
-
-#endif /* ___ATIMACH64XV_H___ */
diff --git a/src/atixv.c b/src/atixv.c
deleted file mode 100644
index 476948d..0000000
--- a/src/atixv.c
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright 2001 through 2004 by Marc Aurele La France (TSI @ UQV), tsi at xfree86.org
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting documentation, and
- * that the name of Marc Aurele La France not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission.  Marc Aurele La France makes no representations
- * about the suitability of this software for any purpose.  It is provided
- * "as-is" without express or implied warranty.
- *
- * MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.  IN NO
- * EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "atimach64xv.h"
-#include "atistruct.h"
-#include "atixv.h"
-
-/*
- * ATIXVFreeAdaptorInfo --
- *
- * Free XVideo adaptor information.
- */
-static void
-ATIXVFreeAdaptorInfo
-(
-    XF86VideoAdaptorPtr *ppAdaptor,
-    int                 nAdaptor
-)
-{
-    if (!ppAdaptor)
-        return;
-
-    while (nAdaptor > 0)
-        xfree(ppAdaptor[--nAdaptor]);
-
-    xfree(ppAdaptor);
-}
-
-/*
- * ATIInitializeXVideo --
- *
- * This function is called to initialise XVideo extension support on a screen.
- */
-Bool
-ATIInitializeXVideo
-(
-    ScreenPtr   pScreen,
-    ScrnInfoPtr pScreenInfo,
-    ATIPtr      pATI
-)
-{
-    XF86VideoAdaptorPtr *ppAdaptor;
-    int                 nAdaptor;
-    Bool                result;
-
-    pScreenInfo->memPhysBase = pATI->LinearBase;
-    pScreenInfo->fbOffset = 0;
-
-    nAdaptor = xf86XVListGenericAdaptors(pScreenInfo, &ppAdaptor);
-    result = xf86XVScreenInit(pScreen, ppAdaptor, nAdaptor);
-
-    ATIXVFreeAdaptorInfo(ppAdaptor, nAdaptor);
-
-    return result;
-}
-
-/*
- * ATICloseXVideo --
- *
- * This function is called during screen termination to clean up after XVideo
- * initialisation.
- */
-void
-ATICloseXVideo
-(
-    ScreenPtr   pScreen,
-    ScrnInfoPtr pScreenInfo,
-    ATIPtr      pATI
-)
-{
-            ATIMach64CloseXVideo(pScreen, pScreenInfo, pATI);
-}
diff-tree 67b240ddd4a6549a23885afc723b6efa7c52db4c (from 4dac7896549392f7378cad9620618cec28f41a16)
Author: George Sapountzis <gsap7 at yahoo.gr>
Date:   Tue Oct 31 16:44:10 2006 +0200

    Consolidate atixv.c w/ atimach64xv.c, part 1.
    
    Merge ATIXVInitializeAdaptor() in ATIMach64XVInitialiseAdaptor().

diff --git a/src/atimach64xv.c b/src/atimach64xv.c
index 8384685..54f5c4c 100644
--- a/src/atimach64xv.c
+++ b/src/atimach64xv.c
@@ -1404,26 +1404,30 @@ static XF86OffscreenImageRec ATIMach64Su
  * This function is called to make a Mach64's hardware overlay support
  * available as an XVideo adaptor.
  */
-int
+static int
 ATIMach64XVInitialiseAdaptor
 (
-    ScreenPtr           pScreen,
     ScrnInfoPtr         pScreenInfo,
-    ATIPtr              pATI,
     XF86VideoAdaptorPtr **pppAdaptor
 )
 {
+    ScreenPtr           pScreen    = screenInfo.screens[pScreenInfo->scrnIndex];
+    ATIPtr              pATI       = ATIPTR(pScreenInfo);
+    XF86VideoAdaptorPtr *ppAdaptor = NULL;
     XF86VideoAdaptorPtr pAdaptor;
     int                 Index;
 
+    if (pppAdaptor)
+        *pppAdaptor = NULL;
+
     if (!pATI->Block1Base)
         return 0;
 
     if (!(pAdaptor = xf86XVAllocateVideoAdaptorRec(pScreenInfo)))
         return 0;
 
-    *pppAdaptor = xnfalloc(sizeof(pAdaptor));
-    **pppAdaptor = pAdaptor;
+    ppAdaptor = xnfalloc(sizeof(pAdaptor));
+    ppAdaptor[0] = pAdaptor;
 
     pAdaptor->nPorts = 1;
     pAdaptor->pPortPrivates = pATI->XVPortPrivate;
@@ -1499,10 +1503,32 @@ ATIMach64XVInitialiseAdaptor
             ATIMach64Surface_C, nATIMach64Surface_C);
     }
 
+    if (pppAdaptor)
+        *pppAdaptor = ppAdaptor;
+    else {
+        xfree(ppAdaptor[0]);
+        xfree(ppAdaptor);
+    }
+
     return 1;
 }
 
 /*
+ * ATIXVPreInit --
+ *
+ * This function is called by ATIPreInit() to set up the environment required
+ * to support the XVideo extension.
+ */
+void
+ATIXVPreInit
+(
+    ATIPtr      pATI
+)
+{
+    (void)xf86XVRegisterGenericAdaptorDriver(ATIMach64XVInitialiseAdaptor);
+}
+
+/*
  * ATIMach64CloseXVideo --
  *
  * This function is called during screen termination to clean up after
diff --git a/src/atimach64xv.h b/src/atimach64xv.h
index 0661246..f46a120 100644
--- a/src/atimach64xv.h
+++ b/src/atimach64xv.h
@@ -28,9 +28,6 @@
 #include "xf86str.h"
 #include "xf86xv.h"
 
-extern int  ATIMach64XVInitialiseAdaptor(ScreenPtr, ScrnInfoPtr, ATIPtr,
-                                         XF86VideoAdaptorPtr **);
-
 extern void ATIMach64CloseXVideo(ScreenPtr, ScrnInfoPtr, ATIPtr);
 
 #endif /* ___ATIMACH64XV_H___ */
diff --git a/src/atixv.c b/src/atixv.c
index ef86ec3..476948d 100644
--- a/src/atixv.c
+++ b/src/atixv.c
@@ -50,52 +50,6 @@ ATIXVFreeAdaptorInfo
 }
 
 /*
- * ATIXVInitializeAdaptor --
- *
- * This is called by the server's XVideo support layer to initialise an XVideo
- * adapter.
- */
-static int
-ATIXVInitializeAdaptor
-(
-    ScrnInfoPtr         pScreenInfo,
-    XF86VideoAdaptorPtr **pppAdaptor
-)
-{
-    ScreenPtr           pScreen    = screenInfo.screens[pScreenInfo->scrnIndex];
-    ATIPtr              pATI       = ATIPTR(pScreenInfo);
-    XF86VideoAdaptorPtr *ppAdaptor = NULL;
-    int                 nAdaptor;
-
-    {
-            nAdaptor = ATIMach64XVInitialiseAdaptor(pScreen, pScreenInfo, pATI,
-                &ppAdaptor);
-    }
-
-    if (pppAdaptor)
-        *pppAdaptor = ppAdaptor;
-    else
-        ATIXVFreeAdaptorInfo(ppAdaptor, nAdaptor);
-
-    return nAdaptor;
-}
-
-/*
- * ATIXVPreInit --
- *
- * This function is called by ATIPreInit() to set up the environment required
- * to support the XVideo extension.
- */
-void
-ATIXVPreInit
-(
-    ATIPtr      pATI
-)
-{
-    (void)xf86XVRegisterGenericAdaptorDriver(ATIXVInitializeAdaptor);
-}
-
-/*
  * ATIInitializeXVideo --
  *
  * This function is called to initialise XVideo extension support on a screen.
diff-tree 4dac7896549392f7378cad9620618cec28f41a16 (from 23b12b9ff55224e8c3c45eb58ea5fbf2f747d82e)
Author: George Sapountzis <gsap7 at yahoo.gr>
Date:   Sun Oct 29 03:55:39 2006 +0200

    Consolidate aticursor.c w/ atimach64cursor.c

diff --git a/src/Makefile.am b/src/Makefile.am
index adb8707..a386c61 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -61,7 +61,7 @@ atimisc_drv_la_LDFLAGS = -module -avoid-
 atimisc_drv_ladir = @moduledir@/drivers
 atimisc_drv_la_SOURCES = \
 	atiadjust.c atiaudio.c aticlock.c aticonfig.c aticonsole.c \
-	aticursor.c atidac.c atidecoder.c atidsp.c atifillin.c atii2c.c \
+	atidac.c atidecoder.c atidsp.c atifillin.c atii2c.c \
 	atilock.c atimach64.c atimach64accel.c atimach64cursor.c \
 	atimach64i2c.c atimach64io.c atimach64xv.c atimode.c atipreinit.c \
 	atiprint.c atirgb514.c atiscreen.c atituner.c atiutil.c ativalid.c \
@@ -131,7 +131,6 @@ EXTRA_DIST = \
 	atiload.h \
 	atilock.h \
 	atimach64accel.h \
-	atimach64cursor.h \
 	atimach64.h \
 	atimach64i2c.h \
 	atimach64io.h \
diff --git a/src/aticursor.c b/src/aticursor.c
deleted file mode 100644
index e2da78c..0000000
--- a/src/aticursor.c
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright 2001 through 2004 by Marc Aurele La France (TSI @ UQV), tsi at xfree86.org
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting documentation, and
- * that the name of Marc Aurele La France not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission.  Marc Aurele La France makes no representations
- * about the suitability of this software for any purpose.  It is provided
- * "as-is" without express or implied warranty.
- *
- * MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.  IN NO
- * EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "aticursor.h"
-#include "atimach64cursor.h"
-#include "atistruct.h"
-
-#include "xf86.h"
-
-/*
- * ATIInitializeCursor --
- *
- * This function initialises the screen cursor.
- */
-Bool
-ATIInitializeCursor
-(
-    ScreenPtr pScreen,
-    ATIPtr    pATI
-)
-{
-    /* Initialise software cursor */
-    if (!miDCInitialize(pScreen, xf86GetPointerScreenFuncs()))
-        return FALSE;
-
-    if (pATI->Cursor == ATI_CURSOR_SOFTWARE)
-        return TRUE;
-
-    if (!(pATI->pCursorInfo = xf86CreateCursorInfoRec()))
-        return FALSE;
-
-    if (!ATIMach64CursorInit(pATI->pCursorInfo))
-    {
-            xf86DestroyCursorInfoRec(pATI->pCursorInfo);
-            pATI->pCursorInfo = NULL;
-            return FALSE;
-    }
-
-    if (xf86InitCursor(pScreen, pATI->pCursorInfo))
-    {
-        xf86SetSilkenMouse(pScreen);
-        return TRUE;
-    }
-
-    xf86DestroyCursorInfoRec(pATI->pCursorInfo);
-    pATI->pCursorInfo = NULL;
-    return FALSE;
-}
diff --git a/src/aticursor.h b/src/aticursor.h
index e38b589..75bd44c 100644
--- a/src/aticursor.h
+++ b/src/aticursor.h
@@ -37,6 +37,6 @@ typedef enum
     ATI_CURSOR_DAC              /* Hardware cursor provided by RAMDAC */
 } ATICursorType;
 
-extern Bool ATIInitializeCursor(ScreenPtr, ATIPtr);
+extern Bool ATIMach64CursorInit(ScreenPtr);
 
 #endif /* ___ATICURSOR_H___ */
diff --git a/src/atimach64cursor.c b/src/atimach64cursor.c
index be8ea11..a3488bb 100644
--- a/src/atimach64cursor.c
+++ b/src/atimach64cursor.c
@@ -25,8 +25,8 @@
 #endif
 
 #include "ati.h"
+#include "aticursor.h"
 #include "atimach64accel.h"
-#include "atimach64cursor.h"
 #include "atimach64io.h"
 
 /*
@@ -364,9 +364,26 @@ ATIMach64UseHWCursor
 Bool
 ATIMach64CursorInit
 (
-    xf86CursorInfoPtr pCursorInfo
+    ScreenPtr pScreen
 )
 {
+    ScrnInfoPtr       pScreenInfo = xf86Screens[pScreen->myNum];
+    ATIPtr            pATI        = ATIPTR(pScreenInfo);
+    xf86CursorInfoPtr pCursorInfo;
+
+    /* Initialise software cursor */
+    if (!miDCInitialize(pScreen, xf86GetPointerScreenFuncs()))
+        return FALSE;
+
+    if (pATI->Cursor == ATI_CURSOR_SOFTWARE)
+        return TRUE;
+
+    /* Initialise hardware cursor */
+    if (!(pATI->pCursorInfo = xf86CreateCursorInfoRec()))
+        return FALSE;
+
+    pCursorInfo = pATI->pCursorInfo;
+
     /*
      * For Mach64 variants, toggling hardware cursors off and on causes display
      * artifacts.  Ask the cursor support layers to always paint the cursor
@@ -397,5 +414,13 @@ ATIMach64CursorInit
     pCursorInfo->ShowCursor = ATIMach64ShowCursor;
     pCursorInfo->UseHWCursor = ATIMach64UseHWCursor;
 
+    if (!xf86InitCursor(pScreen, pATI->pCursorInfo))
+    {
+        xf86DestroyCursorInfoRec(pATI->pCursorInfo);
+        pATI->pCursorInfo = NULL;
+        return FALSE;
+    }
+
+    xf86SetSilkenMouse(pScreen);
     return TRUE;
 }
diff --git a/src/atimach64cursor.h b/src/atimach64cursor.h
deleted file mode 100644
index 767c6a4..0000000
--- a/src/atimach64cursor.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright 2003 through 2004 by Marc Aurele La France (TSI @ UQV), tsi at xfree86.org
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting documentation, and
- * that the name of Marc Aurele La France not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission.  Marc Aurele La France makes no representations
- * about the suitability of this software for any purpose.  It is provided
- * "as-is" without express or implied warranty.
- *
- * MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.  IN NO
- * EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifndef ___ATIMACH64CURSOR_H___
-#define ___ATIMACH64CURSOR_H___ 1
-
-#include "xf86Cursor.h"
-
-extern Bool ATIMach64CursorInit(xf86CursorInfoPtr);
-
-#endif /* ___ATIMACH64CURSOR_H___ */
diff --git a/src/atiscreen.c b/src/atiscreen.c
index 338342a..58b0bda 100644
--- a/src/atiscreen.c
+++ b/src/atiscreen.c
@@ -554,7 +554,7 @@ ATIScreenInit
     xf86SetBackingStore(pScreen);
 
     /* Initialise cursor */
-    if (!ATIInitializeCursor(pScreen, pATI))
+    if (!ATIMach64CursorInit(pScreen))
         return FALSE;
 
     /* Create default colourmap */
diff-tree 23b12b9ff55224e8c3c45eb58ea5fbf2f747d82e (from bc3b222b57d7edf7bdce00a53e8abd9047c314a4)
Author: George Sapountzis <gsap7 at yahoo.gr>
Date:   Tue Oct 31 16:10:07 2006 +0200

    Consolidate atiaccel.c w/ atimach64accel.c, part 2.
    
    Merge ATIInitializeAcceleration() in ATIMach64AccelInit().

diff --git a/src/Makefile.am b/src/Makefile.am
index ee4911b..adb8707 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -60,7 +60,7 @@ atimisc_drv_la_LTLIBRARIES = atimisc_drv
 atimisc_drv_la_LDFLAGS = -module -avoid-version
 atimisc_drv_ladir = @moduledir@/drivers
 atimisc_drv_la_SOURCES = \
-	atiaccel.c atiadjust.c atiaudio.c aticlock.c aticonfig.c aticonsole.c \
+	atiadjust.c atiaudio.c aticlock.c aticonfig.c aticonsole.c \
 	aticursor.c atidac.c atidecoder.c atidsp.c atifillin.c atii2c.c \
 	atilock.c atimach64.c atimach64accel.c atimach64cursor.c \
 	atimach64i2c.c atimach64io.c atimach64xv.c atimode.c atipreinit.c \
@@ -108,7 +108,6 @@ EXTRA_DIST = \
 	radeon_render.c \
 	radeon_accelfuncs.c \
 	\
-	atiaccel.h \
 	atiadjust.h \
 	atiaudio.h \
 	atibank.h \
diff --git a/src/atiaccel.c b/src/atiaccel.c
deleted file mode 100644
index a1f09aa..0000000
--- a/src/atiaccel.c
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright 2001 through 2004 by Marc Aurele La France (TSI @ UQV), tsi at xfree86.org
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting documentation, and
- * that the name of Marc Aurele La France not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission.  Marc Aurele La France makes no representations
- * about the suitability of this software for any purpose.  It is provided
- * "as-is" without express or implied warranty.
- *
- * MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.  IN NO
- * EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- * DRI support by:
- *    Leif Delgass <ldelgass at retinalburn.net>
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "atiaccel.h"
-#include "atimach64accel.h"
-#include "atistruct.h"
-
-#ifdef USE_XAA
-/*
- * ATIInitializeAcceleration --
- *
- * This function is called to initialise both the framebuffer manager and XAA
- * on a screen.
- */
-Bool
-ATIInitializeAcceleration
-(
-    ScreenPtr   pScreen,
-    ScrnInfoPtr pScreenInfo,
-    ATIPtr      pATI
-)
-{
-    if (pATI->OptionAccel)
-    {
-        if (!(pATI->pXAAInfo = XAACreateInfoRec()))
-            return FALSE;
-
-        {
-                ATIMach64AccelInit(pATI, pATI->pXAAInfo);
-        }
-    }
-
-    if (!pATI->OptionAccel || XAAInit(pScreen, pATI->pXAAInfo))
-        return TRUE;
-
-    XAADestroyInfoRec(pATI->pXAAInfo);
-    pATI->pXAAInfo = NULL;
-    return FALSE;
-}
-#endif /* USE_XAA */
diff --git a/src/atiaccel.h b/src/atiaccel.h
deleted file mode 100644
index 4486123..0000000
--- a/src/atiaccel.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright 2001 through 2004 by Marc Aurele La France (TSI @ UQV), tsi at xfree86.org
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting documentation, and
- * that the name of Marc Aurele La France not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission.  Marc Aurele La France makes no representations
- * about the suitability of this software for any purpose.  It is provided
- * "as-is" without express or implied warranty.
- *
- * MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.  IN NO
- * EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifndef ___ATIACCEL_H___
-#define ___ATIACCEL_H___ 1
-
-#include "atipriv.h"
-
-#include "xf86str.h"
-#include "xf86fbman.h"
-
-extern Bool        ATIInitializeAcceleration(ScreenPtr, ScrnInfoPtr, ATIPtr);
-
-#endif /* ___ATIACCEL_H___ */
diff --git a/src/atimach64accel.c b/src/atimach64accel.c
index 090ae78..276fc86 100644
--- a/src/atimach64accel.c
+++ b/src/atimach64accel.c
@@ -970,13 +970,21 @@ ATIMach64SubsequentColorExpandScanline
  * This function fills in structure fields needed for acceleration on Mach64
  * variants.
  */
-int
+Bool
 ATIMach64AccelInit
 (
-    ATIPtr        pATI,
-    XAAInfoRecPtr pXAAInfo
+    ScreenPtr pScreen
 )
 {
+    ScrnInfoPtr   pScreenInfo = xf86Screens[pScreen->myNum];
+    ATIPtr        pATI        = ATIPTR(pScreenInfo);
+    XAAInfoRecPtr pXAAInfo;
+
+    if (!(pATI->pXAAInfo = XAACreateInfoRec()))
+        return FALSE;
+
+    pXAAInfo = pATI->pXAAInfo;
+
     /* This doesn't seem quite right... */
     if (pATI->XModifier == 1)
     {
@@ -1040,7 +1048,7 @@ ATIMach64AccelInit
 
     /* The engine does not support the following primitives for 24bpp */
     if (pATI->XModifier != 1)
-        return ATIMach64MaxY;
+        goto XAAInit;
 
     /* Solid lines */
     pXAAInfo->SetupForSolidLine = ATIMach64SetupForSolidLine;
@@ -1048,6 +1056,13 @@ ATIMach64AccelInit
     pXAAInfo->SubsequentSolidBresenhamLine =
         ATIMach64SubsequentSolidBresenhamLine;
 
-    return ATIMach64MaxY;
+XAAInit:
+    if (!XAAInit(pScreen, pATI->pXAAInfo)) {
+        XAADestroyInfoRec(pATI->pXAAInfo);
+        pATI->pXAAInfo = NULL;
+        return FALSE;
+    }
+
+    return TRUE;
 }
 #endif /* USE_XAA */
diff --git a/src/atimach64accel.h b/src/atimach64accel.h
index 1cdf6ca..6a7d5b2 100644
--- a/src/atimach64accel.h
+++ b/src/atimach64accel.h
@@ -35,7 +35,7 @@
 extern Bool ATIMach64ExaInit(ScreenPtr);
 #endif
 #ifdef USE_XAA
-extern int  ATIMach64AccelInit(ATIPtr, XAAInfoRecPtr);
+extern Bool ATIMach64AccelInit(ScreenPtr);
 #endif
 extern void ATIMach64Sync(ScrnInfoPtr);
 
diff --git a/src/atiscreen.c b/src/atiscreen.c
index e849941..338342a 100644
--- a/src/atiscreen.c
+++ b/src/atiscreen.c
@@ -34,7 +34,6 @@
 #include "ati.h"
 #include "atibus.h"
 #include "atichip.h"
-#include "atiaccel.h"
 #include "aticonsole.h"
 #include "aticursor.h"
 #include "atidac.h"
@@ -525,7 +524,7 @@ ATIScreenInit
 
     /* Setup acceleration */
 
-    if (!ATIInitializeAcceleration(pScreen, pScreenInfo, pATI))
+    if (pATI->OptionAccel && !ATIMach64AccelInit(pScreen))
         return FALSE;
 
     }
diff-tree bc3b222b57d7edf7bdce00a53e8abd9047c314a4 (from d876889add41c8052d4f3feaa21ddf384f5a7054)
Author: George Sapountzis <gsap7 at yahoo.gr>
Date:   Sat Oct 28 19:29:12 2006 +0300

    Consolidate atiaccel.c w/ atimach64accel.c, part 1.
    
    Move ATIResizeOffscreenLinear() from atiaccel.c to atimach64xv.c and make it
    static. It is only used by XV memory management functions.

diff --git a/src/atiaccel.c b/src/atiaccel.c
index 11c39c7..a1f09aa 100644
--- a/src/atiaccel.c
+++ b/src/atiaccel.c
@@ -63,51 +63,4 @@ ATIInitializeAcceleration
     pATI->pXAAInfo = NULL;
     return FALSE;
 }
-
-FBLinearPtr
-ATIResizeOffscreenLinear
-(
-    ScreenPtr   pScreen,
-    FBLinearPtr pLinear,
-    int         Size
-)
-{
-    if (Size <= 0)
-    {
-        xf86FreeOffscreenLinear(pLinear);
-        return NULL;
-    }
-
-    if (pLinear)
-    {
-        if ((pLinear->size >= Size) ||
-            xf86ResizeOffscreenLinear(pLinear, Size))
-        {
-            pLinear->MoveLinearCallback = NULL;
-            pLinear->RemoveLinearCallback = NULL;
-            return pLinear;
-        }
-
-        xf86FreeOffscreenLinear(pLinear);
-    }
-
-    pLinear = xf86AllocateOffscreenLinear(pScreen, Size, 16, NULL, NULL, NULL);
-
-    if (!pLinear)
-    {
-        int maxSize;
-
-        xf86QueryLargestOffscreenLinear(pScreen, &maxSize, 16,
-            PRIORITY_EXTREME);
-
-        if (maxSize < Size)
-            return NULL;
-
-        xf86PurgeUnlockedOffscreenAreas(pScreen);
-        pLinear =
-            xf86AllocateOffscreenLinear(pScreen, Size, 16, NULL, NULL, NULL);
-    }
-
-    return pLinear;
-}
 #endif /* USE_XAA */
diff --git a/src/atiaccel.h b/src/atiaccel.h
index d31335b..4486123 100644
--- a/src/atiaccel.h
+++ b/src/atiaccel.h
@@ -30,6 +30,4 @@
 
 extern Bool        ATIInitializeAcceleration(ScreenPtr, ScrnInfoPtr, ATIPtr);
 
-extern FBLinearPtr ATIResizeOffscreenLinear(ScreenPtr, FBLinearPtr, int);
-
 #endif /* ___ATIACCEL_H___ */
diff --git a/src/atimach64xv.c b/src/atimach64xv.c
index 444cb53..8384685 100644
--- a/src/atimach64xv.c
+++ b/src/atimach64xv.c
@@ -27,7 +27,6 @@
 #include <string.h>
 
 #include "ati.h"
-#include "atiaccel.h"
 #include "atichip.h"
 #include "atimach64accel.h"
 #include "atimach64io.h"
@@ -1522,6 +1521,57 @@ ATIMach64CloseXVideo
     REGION_UNINIT(pScreen, &pATI->VideoClip);
 }
 
+/* Functions for offscreen memory management */
+
+#ifdef USE_XAA
+static FBLinearPtr
+ATIResizeOffscreenLinear
+(
+    ScreenPtr   pScreen,
+    FBLinearPtr pLinear,
+    int         Size
+)
+{
+    if (Size <= 0)
+    {
+        xf86FreeOffscreenLinear(pLinear);
+        return NULL;
+    }
+
+    if (pLinear)
+    {
+        if ((pLinear->size >= Size) ||
+            xf86ResizeOffscreenLinear(pLinear, Size))
+        {
+            pLinear->MoveLinearCallback = NULL;
+            pLinear->RemoveLinearCallback = NULL;
+            return pLinear;
+        }
+
+        xf86FreeOffscreenLinear(pLinear);
+    }
+
+    pLinear = xf86AllocateOffscreenLinear(pScreen, Size, 16, NULL, NULL, NULL);
+
+    if (!pLinear)
+    {
+        int maxSize;
+
+        xf86QueryLargestOffscreenLinear(pScreen, &maxSize, 16,
+            PRIORITY_EXTREME);
+
+        if (maxSize < Size)
+            return NULL;
+
+        xf86PurgeUnlockedOffscreenAreas(pScreen);
+        pLinear =
+            xf86AllocateOffscreenLinear(pScreen, Size, 16, NULL, NULL, NULL);
+    }
+
+    return pLinear;
+}
+#endif /* USE_XAA */
+
 static pointer
 ATIMach64XVMemAlloc
 (



More information about the xorg-commit mailing list