diff --git a/hw/xfree86/ramdac/Makefile.am b/hw/xfree86/ramdac/Makefile.am index 83e6befd5..ffae2c31f 100644 --- a/hw/xfree86/ramdac/Makefile.am +++ b/hw/xfree86/ramdac/Makefile.am @@ -1,11 +1,10 @@ noinst_LTLIBRARIES = libramdac.la -libramdac_la_SOURCES = xf86RamDac.c xf86RamDacCmap.c \ - xf86CursorRD.c xf86HWCurs.c +libramdac_la_SOURCES = xf86CursorRD.c xf86HWCurs.c -sdk_HEADERS = xf86Cursor.h xf86RamDac.h +sdk_HEADERS = xf86Cursor.h -EXTRA_DIST = xf86CursorPriv.h xf86RamDacPriv.h CURSOR.NOTES +EXTRA_DIST = xf86CursorPriv.h CURSOR.NOTES AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) AM_CPPFLAGS = $(XORG_INCS) diff --git a/hw/xfree86/ramdac/meson.build b/hw/xfree86/ramdac/meson.build index c20e2d6d8..0a2bb4b79 100644 --- a/hw/xfree86/ramdac/meson.build +++ b/hw/xfree86/ramdac/meson.build @@ -1,6 +1,4 @@ srcs_xorg_ramdac = [ - 'xf86RamDac.c', - 'xf86RamDacCmap.c', 'xf86CursorRD.c', 'xf86HWCurs.c', ] @@ -15,7 +13,6 @@ xorg_ramdac = static_library('xorg_ramdac', install_data( [ 'xf86Cursor.h', - 'xf86RamDac.h', ], install_dir: xorgsdkdir, ) diff --git a/hw/xfree86/ramdac/xf86RamDac.c b/hw/xfree86/ramdac/xf86RamDac.c deleted file mode 100644 index a67164917..000000000 --- a/hw/xfree86/ramdac/xf86RamDac.c +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Copyright 1998 by Alan Hourihane, Wigan, England. - * - * 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 Alan Hourihane not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Alan Hourihane makes no representations - * about the suitability of this software for any purpose. It is provided - * "as is" without express or implied warranty. - * - * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL ALAN HOURIHANE 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. - * - * Authors: Alan Hourihane, - * - * Generic RAMDAC access routines. - */ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include "xf86.h" -#include "xf86_OSproc.h" - -#include "xf86RamDacPriv.h" - -int RamDacHWPrivateIndex = -1; -int RamDacScreenPrivateIndex = -1; - -RamDacRecPtr -RamDacCreateInfoRec(void) -{ - RamDacRecPtr infoRec; - - infoRec = calloc(1, sizeof(RamDacRec)); - - return infoRec; -} - -RamDacHelperRecPtr -RamDacHelperCreateInfoRec(void) -{ - RamDacHelperRecPtr infoRec; - - infoRec = calloc(1, sizeof(RamDacHelperRec)); - - return infoRec; -} - -void -RamDacDestroyInfoRec(RamDacRecPtr infoRec) -{ - free(infoRec); -} - -void -RamDacHelperDestroyInfoRec(RamDacHelperRecPtr infoRec) -{ - free(infoRec); -} - -Bool -RamDacInit(ScrnInfoPtr pScrn, RamDacRecPtr ramdacPriv) -{ - RamDacScreenRecPtr ramdacScrPtr; - - /* - * make sure the RamDacRec is allocated - */ - if (!RamDacGetRec(pScrn)) - return FALSE; - ramdacScrPtr = - ((RamDacScreenRecPtr) (pScrn)->privates[RamDacGetScreenIndex()].ptr); - ramdacScrPtr->RamDacRec = ramdacPriv; - - return TRUE; -} - -void -RamDacGetRecPrivate(void) -{ - if (RamDacHWPrivateIndex < 0) - RamDacHWPrivateIndex = xf86AllocateScrnInfoPrivateIndex(); - if (RamDacScreenPrivateIndex < 0) - RamDacScreenPrivateIndex = xf86AllocateScrnInfoPrivateIndex(); - return; -} - -Bool -RamDacGetRec(ScrnInfoPtr scrp) -{ - RamDacGetRecPrivate(); - /* - * New privates are always set to NULL, so we can check if the allocation - * has already been done. - */ - if (scrp->privates[RamDacHWPrivateIndex].ptr != NULL) - return TRUE; - if (scrp->privates[RamDacScreenPrivateIndex].ptr != NULL) - return TRUE; - - scrp->privates[RamDacHWPrivateIndex].ptr = - xnfcalloc(sizeof(RamDacHWRec), 1); - scrp->privates[RamDacScreenPrivateIndex].ptr = - xnfcalloc(sizeof(RamDacScreenRec), 1); - - return TRUE; -} - -void -RamDacFreeRec(ScrnInfoPtr pScrn) -{ - RamDacHWRecPtr ramdacHWPtr; - RamDacScreenRecPtr ramdacScrPtr; - - if (RamDacHWPrivateIndex < 0) - return; - - if (RamDacScreenPrivateIndex < 0) - return; - - ramdacHWPtr = RAMDACHWPTR(pScrn); - ramdacScrPtr = ((RamDacScreenRecPtr) - (pScrn)->privates[RamDacGetScreenIndex()].ptr); - - free(ramdacHWPtr); - ramdacHWPtr = NULL; - - free(ramdacScrPtr); - ramdacScrPtr = NULL; -} - -int -RamDacGetHWIndex(void) -{ - return RamDacHWPrivateIndex; -} - -int -RamDacGetScreenIndex(void) -{ - return RamDacScreenPrivateIndex; -} diff --git a/hw/xfree86/ramdac/xf86RamDac.h b/hw/xfree86/ramdac/xf86RamDac.h deleted file mode 100644 index af16b7faa..000000000 --- a/hw/xfree86/ramdac/xf86RamDac.h +++ /dev/null @@ -1,88 +0,0 @@ - -#ifndef _XF86RAMDAC_H -#define _XF86RAMDAC_H 1 - -#include "colormapst.h" -#include "xf86Cursor.h" - -/* Define unique vendor codes for RAMDAC's */ -#define VENDOR_IBM 0x0000 -#define VENDOR_BT 0x0001 -#define VENDOR_TI 0x0002 - -typedef struct _RamDacRegRec { -/* This is probably the nastiest assumption, we allocate 1024 slots for - * ramdac registers, should be enough. I've checked IBM and TVP series - * and they seem o.k - * Then we allocate 768 entries for the DAC too. IBM640 needs 1024 -FIXME - */ - unsigned short DacRegs[0x400]; /* register set */ - unsigned char DAC[0x300]; /* colour map */ - Bool Overlay; -} RamDacRegRec, *RamDacRegRecPtr; - -typedef struct _RamDacHWRegRec { - RamDacRegRec SavedReg; - RamDacRegRec ModeReg; -} RamDacHWRec, *RamDacHWRecPtr; - -typedef struct _RamDacRec { - CARD32 RamDacType; - - void (*LoadPalette) (ScrnInfoPtr pScrn, - int numColors, - int *indices, LOCO * colors, VisualPtr pVisual); - - unsigned char (*ReadDAC) (ScrnInfoPtr pScrn, CARD32); - - void (*WriteDAC) (ScrnInfoPtr pScrn, CARD32, unsigned char, unsigned char); - - void (*WriteAddress) (ScrnInfoPtr pScrn, CARD32); - - void (*WriteData) (ScrnInfoPtr pScrn, unsigned char); - - void (*ReadAddress) (ScrnInfoPtr pScrn, CARD32); - - unsigned char (*ReadData) (ScrnInfoPtr pScrn); -} RamDacRec, *RamDacRecPtr; - -typedef struct _RamDacHelperRec { - CARD32 RamDacType; - - void (*Restore) (ScrnInfoPtr pScrn, - RamDacRecPtr ramdacPtr, RamDacRegRecPtr ramdacReg); - - void (*Save) (ScrnInfoPtr pScrn, - RamDacRecPtr ramdacPtr, RamDacRegRecPtr ramdacReg); - - void (*SetBpp) (ScrnInfoPtr pScrn, RamDacRegRecPtr ramdacReg); - - void (*HWCursorInit) (xf86CursorInfoPtr infoPtr); -} RamDacHelperRec, *RamDacHelperRecPtr; - -#define RAMDACHWPTR(p) ((RamDacHWRecPtr)((p)->privates[RamDacGetHWIndex()].ptr)) - -typedef struct _RamdacScreenRec { - RamDacRecPtr RamDacRec; -} RamDacScreenRec, *RamDacScreenRecPtr; - -#define RAMDACSCRPTR(p) ((RamDacScreenRecPtr)((p)->privates[RamDacGetScreenIndex()].ptr))->RamDacRec - -extern _X_EXPORT int RamDacHWPrivateIndex; -extern _X_EXPORT int RamDacScreenPrivateIndex; - -typedef struct { - int token; -} RamDacSupportedInfoRec, *RamDacSupportedInfoRecPtr; - -extern _X_EXPORT RamDacRecPtr RamDacCreateInfoRec(void); -extern _X_EXPORT RamDacHelperRecPtr RamDacHelperCreateInfoRec(void); -extern _X_EXPORT void RamDacDestroyInfoRec(RamDacRecPtr RamDacRec); -extern _X_EXPORT void RamDacHelperDestroyInfoRec(RamDacHelperRecPtr RamDacRec); -extern _X_EXPORT Bool RamDacInit(ScrnInfoPtr pScrn, RamDacRecPtr RamDacRec); -extern _X_EXPORT Bool RamDacHandleColormaps(ScreenPtr pScreen, int maxColors, - int sigRGBbits, unsigned int flags); -extern _X_EXPORT void RamDacFreeRec(ScrnInfoPtr pScrn); -extern _X_EXPORT int RamDacGetHWIndex(void); - -#endif /* _XF86RAMDAC_H */ diff --git a/hw/xfree86/ramdac/xf86RamDacCmap.c b/hw/xfree86/ramdac/xf86RamDacCmap.c deleted file mode 100644 index 2a0f75569..000000000 --- a/hw/xfree86/ramdac/xf86RamDacCmap.c +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright 1998 by Alan Hourihane, Wigan, England. - * - * 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 Alan Hourihane not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Alan Hourihane makes no representations - * about the suitability of this software for any purpose. It is provided - * "as is" without express or implied warranty. - * - * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL ALAN HOURIHANE 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. - * - * Authors: Alan Hourihane, - * - * Generic RAMDAC access to colormaps. - */ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include -#include -#include "windowstr.h" -#include "mipointer.h" -#include "micmap.h" - -#include "xf86.h" -#include "colormapst.h" -#include "xf86RamDacPriv.h" - -void -RamDacLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, LOCO * colors, - VisualPtr pVisual) -{ - RamDacRecPtr hwp = RAMDACSCRPTR(pScrn); - int i, index; - - for (i = 0; i < numColors; i++) { - index = indices[i]; - (*hwp->WriteAddress) (pScrn, index); - (*hwp->WriteData) (pScrn, colors[index].red); - (*hwp->WriteData) (pScrn, colors[index].green); - (*hwp->WriteData) (pScrn, colors[index].blue); - } -} - -Bool -RamDacHandleColormaps(ScreenPtr pScreen, int maxColors, int sigRGBbits, - unsigned int flags) -{ - ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); - RamDacRecPtr hwp = RAMDACSCRPTR(pScrn); - - if (hwp->LoadPalette == NULL) - return xf86HandleColormaps(pScreen, maxColors, sigRGBbits, - RamDacLoadPalette, NULL, flags); - else - return xf86HandleColormaps(pScreen, maxColors, sigRGBbits, - hwp->LoadPalette, NULL, flags); -} diff --git a/hw/xfree86/ramdac/xf86RamDacPriv.h b/hw/xfree86/ramdac/xf86RamDacPriv.h deleted file mode 100644 index ae1c665de..000000000 --- a/hw/xfree86/ramdac/xf86RamDacPriv.h +++ /dev/null @@ -1,13 +0,0 @@ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include "xf86RamDac.h" -#include "xf86cmap.h" - -void RamDacGetRecPrivate(void); -Bool RamDacGetRec(ScrnInfoPtr pScrn); -int RamDacGetScreenIndex(void); -void RamDacLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, - LOCO * colors, VisualPtr pVisual); diff --git a/hw/xfree86/sdksyms.sh b/hw/xfree86/sdksyms.sh index c06b3b081..a4addc267 100755 --- a/hw/xfree86/sdksyms.sh +++ b/hw/xfree86/sdksyms.sh @@ -148,7 +148,6 @@ cat > sdksyms.c << EOF /* hw/xfree86/ramdac/Makefile.am */ #include "xf86Cursor.h" -#include "xf86RamDac.h" /* hw/xfree86/shadowfb/Makefile.am -- module */