summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Fufutos <fufutos610@hotmail.com>2006-04-20 01:26:10 +0300
committerLuc Verhaegen <libv@skynet.be>2006-04-20 02:50:29 +0200
commit0c4962d7ffeb4bb2c0569d3ffdece061d354954d (patch)
tree712a87e35a0a05937eaad0934b90d02cb9531d46
parentd03e528f9836d2614141ce1e4262494d1e1f2277 (diff)
[PATCH] Consolidate aticursor.c and atimach64cursor.c
-rw-r--r--src/Makefile.am3
-rw-r--r--src/aticonfig.c2
-rw-r--r--src/aticursor.c70
-rw-r--r--src/aticursor.h43
-rw-r--r--src/atiload.c2
-rw-r--r--src/atimach64cursor.c33
-rw-r--r--src/atimach64cursor.h12
-rw-r--r--src/atipreinit.c2
-rw-r--r--src/atiscreen.c4
9 files changed, 44 insertions, 127 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index c834eda..2c5f122 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -49,7 +49,7 @@ mach64_drv_la_LDFLAGS = -module -avoid-version
mach64_drv_ladir = @moduledir@/drivers
mach64_drv_la_SOURCES = \
atioption.c atividmem.c atiadjust.c \
- atiaudio.c aticlock.c aticonfig.c aticonsole.c aticursor.c atidac.c \
+ atiaudio.c aticlock.c aticonfig.c aticonsole.c atidac.c \
atidecoder.c atidsp.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 \
@@ -66,7 +66,6 @@ EXTRA_DIST = \
aticonfig.h \
aticonsole.h \
aticrtc.h \
- aticursor.h \
atidac.h \
atidecoder.h \
atidga.h \
diff --git a/src/aticonfig.c b/src/aticonfig.c
index 1c8750c..1f92bdd 100644
--- a/src/aticonfig.c
+++ b/src/aticonfig.c
@@ -33,9 +33,9 @@
#include "atichip.h"
#include "aticonfig.h"
-#include "aticursor.h"
#include "atioption.h"
#include "atistruct.h"
+#include "atimach64cursor.h"
#include "mach64_common.h"
diff --git a/src/aticursor.c b/src/aticursor.c
deleted file mode 100644
index 237972d..0000000
--- a/src/aticursor.c
+++ /dev/null
@@ -1,70 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/aticursor.c,v 1.4 2003/04/23 21:51:27 tsi Exp $ */
-/*
- * Copyright 2001 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@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
deleted file mode 100644
index 5f7902c..0000000
--- a/src/aticursor.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/aticursor.h,v 1.3 2003/01/01 19:16:31 tsi Exp $ */
-/*
- * Copyright 2001 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@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 ___ATICURSOR_H___
-#define ___ATICURSOR_H___ 1
-
-#include "atipriv.h"
-
-#include "screenint.h"
-
-/*
- * Cursor related definitions.
- */
-typedef enum
-{
- ATI_CURSOR_SOFTWARE, /* Software cursor */
- ATI_CURSOR_HARDWARE, /* Hardware cursor provided by CRTC */
- ATI_CURSOR_DAC /* Hardware cursor provided by RAMDAC */
-} ATICursorType;
-
-extern Bool ATIInitializeCursor(ScreenPtr, ATIPtr);
-
-#endif /* ___ATICURSOR_H___ */
diff --git a/src/atiload.c b/src/atiload.c
index 82adb95..5dcba50 100644
--- a/src/atiload.c
+++ b/src/atiload.c
@@ -33,9 +33,9 @@
#include <string.h>
#include "ati.h"
-#include "aticursor.h"
#include "atiload.h"
#include "atistruct.h"
+#include "atimach64cursor.h"
/*
* ATILoadModule --
diff --git a/src/atimach64cursor.c b/src/atimach64cursor.c
index 65a9dbf..bcdee1f 100644
--- a/src/atimach64cursor.c
+++ b/src/atimach64cursor.c
@@ -374,15 +374,27 @@ ATIMach64UseHWCursor
/*
* ATIMach64CursorInit --
*
- * Initialise xf86CursorInfoRec fields with information specific to Mach64
- * variants.
+ * This function initialises the screen cursor.
*/
Bool
-ATIMach64CursorInit
-(
- xf86CursorInfoPtr pCursorInfo
-)
+ATIMach64CursorInit(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 */
+ pCursorInfo = xf86CreateCursorInfoRec();
+ if (!pCursorInfo)
+ return FALSE;
+
/*
* For Mach64 variants, toggling hardware cursors off and on causes display
* artifacts. Ask the cursor support layers to always paint the cursor
@@ -413,5 +425,14 @@ ATIMach64CursorInit
pCursorInfo->ShowCursor = ATIMach64ShowCursor;
pCursorInfo->UseHWCursor = ATIMach64UseHWCursor;
+ pATI->pCursorInfo = pCursorInfo;
+
+ 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
index dcea5ca..dfac7b8 100644
--- a/src/atimach64cursor.h
+++ b/src/atimach64cursor.h
@@ -26,6 +26,16 @@
#include "xf86Cursor.h"
-extern Bool ATIMach64CursorInit(xf86CursorInfoPtr);
+/*
+ * Cursor related definitions.
+ */
+typedef enum
+{
+ ATI_CURSOR_SOFTWARE, /* Software cursor */
+ ATI_CURSOR_HARDWARE, /* Hardware cursor provided by CRTC */
+ ATI_CURSOR_DAC /* Hardware cursor provided by RAMDAC */
+} ATICursorType;
+
+extern Bool ATIMach64CursorInit(ScreenPtr pScreen);
#endif /* ___ATIMACH64CURSOR_H___ */
diff --git a/src/atipreinit.c b/src/atipreinit.c
index 6ac936d..60290c4 100644
--- a/src/atipreinit.c
+++ b/src/atipreinit.c
@@ -37,7 +37,6 @@
#include "atiaudio.h"
#include "atichip.h"
#include "aticonfig.h"
-#include "aticursor.h"
#include "atidac.h"
#include "atidsp.h"
#include "atii2c.h"
@@ -45,6 +44,7 @@
#include "atilock.h"
#include "atimach64.h"
#include "atimach64accel.h"
+#include "atimach64cursor.h"
#include "atimach64io.h"
#include "atimode.h"
#include "atipreinit.h"
diff --git a/src/atiscreen.c b/src/atiscreen.c
index 2f79f00..b907f46 100644
--- a/src/atiscreen.c
+++ b/src/atiscreen.c
@@ -35,7 +35,6 @@
#include "atichip.h"
#include "aticonsole.h"
-#include "aticursor.h"
#include "atidac.h"
#include "atidga.h"
#include "atidri.h"
@@ -45,6 +44,7 @@
#include "atistruct.h"
#include "atixv.h"
#include "atimach64accel.h"
+#include "atimach64cursor.h"
#ifdef XF86DRI_DEVEL
#include "mach64_dri.h"
@@ -576,7 +576,7 @@ ATIScreenInit
xf86SetBackingStore(pScreen);
/* Initialise cursor */
- if (!ATIInitializeCursor(pScreen, pATI))
+ if (!ATIMach64CursorInit(pScreen))
return FALSE;
/* Create default colourmap */