diff options
-rw-r--r-- | configure.ac | 20 | ||||
-rw-r--r-- | src/Makefile.am | 1 | ||||
-rw-r--r-- | src/compat-api.h | 73 | ||||
-rw-r--r-- | src/i740.h | 12 | ||||
-rw-r--r-- | src/i740_accel.c | 422 | ||||
-rw-r--r-- | src/i740_dga.c | 78 | ||||
-rw-r--r-- | src/i740_driver.c | 73 | ||||
-rw-r--r-- | src/i740_video.c | 1 |
8 files changed, 37 insertions, 643 deletions
diff --git a/configure.ac b/configure.ac index 6dd6327..06a3978 100644 --- a/configure.ac +++ b/configure.ac @@ -58,7 +58,7 @@ XORG_DRIVER_CHECK_EXT(XV, videoproto) XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto) # Obtain compiler/linker options for the driver dependencies -PKG_CHECK_MODULES(XORG, [xorg-server >= 1.0.99.901 xproto fontsproto $REQUIRED_MODULES]) +PKG_CHECK_MODULES(XORG, [xorg-server >= 1.18 xproto fontsproto $REQUIRED_MODULES]) # Checks for libraries. SAVE_CPPFLAGS="$CPPFLAGS" @@ -74,24 +74,6 @@ if test "x$XSERVER_LIBPCIACCESS" = xyes; then fi AM_CONDITIONAL(XSERVER_LIBPCIACCESS, test "x$XSERVER_LIBPCIACCESS" = xyes) -AC_ARG_ENABLE(xaa, - AS_HELP_STRING([--enable-xaa], - [Enable legacy X Acceleration Architecture (XAA) [default=auto]]), - [XAA="$enableval"], - [XAA=auto]) -if test "x$XAA" != xno; then - save_CFLAGS=$CFLAGS - save_CPPFLAGS=$CPPFLAGS - CFLAGS=$XORG_CFLAGS - CPPFLAGS="$XORG_CFLAGS" - AC_CHECK_HEADERS([xaa.h], XAA=yes, XAA=no) - CFLAGS=$save_CFLAGS - CPPFLAGS=$save_CPPFLAGS -fi -AC_MSG_CHECKING([whether to include XAA support]) -AM_CONDITIONAL(XAA, test "x$XAA" = xyes) -AC_MSG_RESULT([$XAA]) - AC_SUBST([moduledir]) DRIVER_NAME=i740 diff --git a/src/Makefile.am b/src/Makefile.am index 0b9f47a..7c0cfa6 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -30,7 +30,6 @@ i740_drv_ladir = @moduledir@/drivers i740_drv_la_SOURCES = \ compat-api.h \ - i740_accel.c \ i740_cursor.c \ i740_dga.c \ i740_dga.h \ diff --git a/src/compat-api.h b/src/compat-api.h index 89976e4..35e22b4 100644 --- a/src/compat-api.h +++ b/src/compat-api.h @@ -28,77 +28,12 @@ #ifndef COMPAT_API_H #define COMPAT_API_H -#ifndef GLYPH_HAS_GLYPH_PICTURE_ACCESSOR -#define GetGlyphPicture(g, s) GlyphPicture((g))[(s)->myNum] -#define SetGlyphPicture(g, s, p) GlyphPicture((g))[(s)->myNum] = p -#endif - -#ifndef XF86_HAS_SCRN_CONV -#define xf86ScreenToScrn(s) xf86Screens[(s)->myNum] -#define xf86ScrnToScreen(s) screenInfo.screens[(s)->scrnIndex] -#endif - -#ifndef XF86_SCRN_INTERFACE - -#define SCRN_ARG_TYPE int -#define SCRN_INFO_PTR(arg1) ScrnInfoPtr pScrn = xf86Screens[(arg1)] - -#define SCREEN_ARG_TYPE int -#define SCREEN_PTR(arg1) ScreenPtr pScreen = screenInfo.screens[(arg1)] - -#define SCREEN_INIT_ARGS_DECL int i, ScreenPtr pScreen, int argc, char **argv - -#define BLOCKHANDLER_ARGS_DECL int arg, pointer blockData, pointer pTimeout, pointer pReadmask -#define BLOCKHANDLER_ARGS arg, blockData, pTimeout, pReadmask - -#define CLOSE_SCREEN_ARGS_DECL int scrnIndex, ScreenPtr pScreen -#define CLOSE_SCREEN_ARGS scrnIndex, pScreen - -#define ADJUST_FRAME_ARGS_DECL int arg, int x, int y, int flags -#define ADJUST_FRAME_ARGS(arg, x, y) (arg)->scrnIndex, x, y, 0 - -#define SWITCH_MODE_ARGS_DECL int arg, DisplayModePtr mode, int flags -#define SWITCH_MODE_ARGS(arg, m) (arg)->scrnIndex, m, 0 - -#define FREE_SCREEN_ARGS_DECL int arg, int flags - -#define VT_FUNC_ARGS_DECL int arg, int flags -#define VT_FUNC_ARGS pScrn->scrnIndex, 0 - -#define XF86_SCRN_ARG(x) ((x)->scrnIndex) -#else -#define SCRN_ARG_TYPE ScrnInfoPtr -#define SCRN_INFO_PTR(arg1) ScrnInfoPtr pScrn = (arg1) - -#define SCREEN_ARG_TYPE ScreenPtr -#define SCREEN_PTR(arg1) ScreenPtr pScreen = (arg1) - -#define SCREEN_INIT_ARGS_DECL ScreenPtr pScreen, int argc, char **argv - #if ABI_VIDEODRV_VERSION >= SET_ABI_VERSION(23, 0) -#define BLOCKHANDLER_ARGS_DECL ScreenPtr arg, pointer pTimeout -#define BLOCKHANDLER_ARGS arg, pTimeout +#define BLOCKHANDLER_ARGS_DECL ScreenPtr pScreen, pointer pTimeout +#define BLOCKHANDLER_ARGS pScreen, pTimeout #else -#define BLOCKHANDLER_ARGS_DECL ScreenPtr arg, pointer pTimeout, pointer pReadmask -#define BLOCKHANDLER_ARGS arg, pTimeout, pReadmask -#endif - -#define CLOSE_SCREEN_ARGS_DECL ScreenPtr pScreen -#define CLOSE_SCREEN_ARGS pScreen - -#define ADJUST_FRAME_ARGS_DECL ScrnInfoPtr arg, int x, int y -#define ADJUST_FRAME_ARGS(arg, x, y) arg, x, y - -#define SWITCH_MODE_ARGS_DECL ScrnInfoPtr arg, DisplayModePtr mode -#define SWITCH_MODE_ARGS(arg, m) arg, m - -#define FREE_SCREEN_ARGS_DECL ScrnInfoPtr arg - -#define VT_FUNC_ARGS_DECL ScrnInfoPtr arg -#define VT_FUNC_ARGS pScrn - -#define XF86_SCRN_ARG(x) (x) - +#define BLOCKHANDLER_ARGS_DECL ScreenPtr pScreen, pointer pTimeout, pointer pReadmask +#define BLOCKHANDLER_ARGS pScreen, pTimeout, pReadmask #endif #endif @@ -41,9 +41,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "i740_reg.h" #include "i740_macros.h" -#ifdef HAVE_XAA_H -#include "xaa.h" -#endif #include "xf86Cursor.h" #include "compat-api.h" @@ -112,9 +109,6 @@ typedef struct _I740Rec { int HasSGRAM; I740RegRec SavedReg; I740RegRec ModeReg; -#ifdef HAVE_XAA_H - XAAInfoRecPtr AccelInfoRec; -#endif xf86CursorInfoPtr CursorInfoRec; FBAreaPtr CursorData; CloseScreenProcPtr CloseScreen; @@ -154,13 +148,13 @@ typedef struct _I740Rec { #define I740PTR(p) ((I740Ptr)((p)->driverPrivate)) extern Bool I740CursorInit(ScreenPtr pScreen); -extern Bool I740AccelInit(ScreenPtr pScreen); + void I740SetPIOAccess(I740Ptr pI740); void I740SetMMIOAccess(I740Ptr pI740); void I740InitVideo(ScreenPtr pScreen); -Bool I740SwitchMode(SWITCH_MODE_ARGS_DECL); -void I740AdjustFrame(ADJUST_FRAME_ARGS_DECL); +Bool I740SwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode); +void I740AdjustFrame(ScrnInfoPtr pScrn, int x, int y); Bool I740_I2CInit(ScrnInfoPtr pScrn); diff --git a/src/i740_accel.c b/src/i740_accel.c deleted file mode 100644 index b574752..0000000 --- a/src/i740_accel.c +++ /dev/null @@ -1,422 +0,0 @@ - -/************************************************************************** - -Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. -All Rights Reserved. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sub license, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice (including the -next paragraph) shall be included in all copies or substantial portions -of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR -ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -**************************************************************************/ - -/* - * Authors: - * Daryll Strauss <daryll@precisioninsight.com> - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "xf86.h" -#include "xf86_OSproc.h" - -#include "compiler.h" - -#include "xf86Pci.h" - -#include "vgaHW.h" - -#include "xf86xv.h" -#include "i740.h" - -#ifdef HAVE_XAA_H -static unsigned int i740Rop[16] = { - 0x00, /* GXclear */ - 0x88, /* GXand */ - 0x44, /* GXandReverse */ - 0xCC, /* GXcopy */ - 0x22, /* GXandInvert */ - 0xAA, /* GXnoop */ - 0x66, /* GXxor */ - 0xEE, /* GXor */ - 0x11, /* GXnor */ - 0x99, /* GXequiv */ - 0x55, /* GXinvert */ - 0xDD, /* GXorReverse */ - 0x33, /* GXcopyInvert */ - 0xBB, /* GXorInverted */ - 0x77, /* GXnand */ - 0xFF /* GXset */ -}; - -static unsigned int i740PatternRop[16] = { - 0x00, /* GXclear */ - 0xA0, /* GXand */ - 0x50, /* GXandReverse */ - 0xF0, /* GXcopy */ - 0x0A, /* GXandInvert */ - 0xAA, /* GXnoop */ - 0x5A, /* GXxor */ - 0xFA, /* GXor */ - 0x05, /* GXnor */ - 0xA5, /* GXequiv */ - 0x55, /* GXinvert */ - 0xF5, /* GXorReverse */ - 0x0F, /* GXcopyInvert */ - 0xAF, /* GXorInverted */ - 0x5F, /* GXnand */ - 0xFF /* GXset */ -}; - -static void I740SyncPIO(ScrnInfoPtr pScrn); -static void I740SyncMMIO(ScrnInfoPtr pScrn); -static void I740SetupForSolidFill(ScrnInfoPtr pScrn, int color, int rop, - unsigned int planemask); -static void I740SubsequentSolidFillRect(ScrnInfoPtr pScrn, int x, int y, - int w, int h); -static void I740SetupForScreenToScreenCopy(ScrnInfoPtr pScrn, int xdir, - int ydir, int rop, - unsigned int planemask, - int transparency_color); -static void I740SubsequentScreenToScreenCopy(ScrnInfoPtr pScrn, int x1, int y1, - int x2, int y2, int w, int h); -static void I740SetupForMono8x8PatternFill(ScrnInfoPtr pScrn, - int pattx, int patty, - int fg, int bg, int rop, - unsigned int planemask); -static void I740SubsequentMono8x8PatternFillRect(ScrnInfoPtr pScrn, - int pattx, int patty, - int x, int y, int w, int h); -#if 0 -static void I740SetupForCPUToScreenColorExpandFill(ScrnInfoPtr pScrn, - int bg, int fg, int rop, - unsigned int planemask); -static void I740SubsequentCPUToScreenColorExpandFill(ScrnInfoPtr pScrn, - int x, int y, int w, int h, - int skipleft); -#endif -#endif -/* - * The following function sets up the supported acceleration. Call it - * from the FbInit() function in the SVGA driver, or before ScreenInit - * in a monolithic server. - */ -Bool -I740AccelInit(ScreenPtr pScreen) -{ -#ifdef HAVE_XAA_H - XAAInfoRecPtr infoPtr; - ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); - I740Ptr pI740 = I740PTR(pScrn); - - pI740->AccelInfoRec = infoPtr = XAACreateInfoRec(); - if (!infoPtr) - return FALSE; - - if (pScrn->bitsPerPixel == 32) { - infoPtr->Flags = 0; /* Disables all acceleration */ - return TRUE;; - } - - infoPtr->Flags = PIXMAP_CACHE | OFFSCREEN_PIXMAPS | LINEAR_FRAMEBUFFER; - - /* Sync */ - if (pI740->usePIO) - infoPtr->Sync = I740SyncPIO; - else - infoPtr->Sync = I740SyncMMIO; - - infoPtr->CachePixelGranularity = 8 / pI740->cpp; - - /* Solid filled rectangles */ - infoPtr->SolidFillFlags = NO_PLANEMASK; - infoPtr->SetupForSolidFill = I740SetupForSolidFill; - infoPtr->SubsequentSolidFillRect = I740SubsequentSolidFillRect; - - /* Screen to screen copy */ - infoPtr->ScreenToScreenCopyFlags = (NO_PLANEMASK | NO_TRANSPARENCY); - infoPtr->SetupForScreenToScreenCopy = I740SetupForScreenToScreenCopy; - infoPtr->SubsequentScreenToScreenCopy = I740SubsequentScreenToScreenCopy; - - /* 8x8 pattern fills */ - infoPtr->SetupForMono8x8PatternFill = I740SetupForMono8x8PatternFill; - infoPtr->SubsequentMono8x8PatternFillRect = - I740SubsequentMono8x8PatternFillRect; - infoPtr->Mono8x8PatternFillFlags = - NO_PLANEMASK | HARDWARE_PATTERN_SCREEN_ORIGIN | - BIT_ORDER_IN_BYTE_MSBFIRST; - - /* CPU to screen color expansion */ - /* Currently XAA is limited to only DWORD padding. The 3.3 driver - * uses NO_PAD scanlines b/c of problems with using the chip in - * DWORD mode. Once other padding modes are available in XAA this - * Code can be turned back on. - */ -#if 0 -#ifndef ALLOW_PCI_COLOR_EXP - if (pI740->Chipset != PCI_CHIP_I740_PCI) { -#endif - /* - * Currently, we are not properly able to read the bitblt engine - * busy bit on the PCI i740 card. When we are able to do so, we - * can re-enable color expansion. - */ - infoPtr->CPUToScreenColorExpandFillFlags = NO_PLANEMASK | -#ifdef USE_DWORD_COLOR_EXP - SCANLINE_PAD_DWORD | -#endif - CPU_TRANSFER_PAD_QWORD | - SYNC_AFTER_COLOR_EXPAND | BIT_ORDER_IN_BYTE_MSBFIRST; - infoPtr->ColorExpandBase = - (unsigned char *) (pI740->MMIOBase + BLTDATA); - infoPtr->ColorExpandRange = 0x10000; - infoPtr->SetupForCPUToScreenColorExpandFill = - I740SetupForCPUToScreenColorExpandFill; - infoPtr->SubsequentCPUToScreenColorExpandFill = - I740SubsequentCPUToScreenColorExpandFill; -#ifndef ALLOW_PCI_COLOR_EXP - } -#endif -#endif - return XAAInit(pScreen, infoPtr); -#else - return FALSE; -#endif -} - -#ifdef HAVE_XAA_H - -static void -I740SyncPIO(ScrnInfoPtr pScrn) -{ - WAIT_ENGINE_IDLE_PIO(); -} - -static void -I740SyncMMIO(ScrnInfoPtr pScrn) -{ - I740Ptr pI740; - - pI740 = I740PTR(pScrn); - WAIT_ENGINE_IDLE_MMIO(); -} - -static void -I740SetupForSolidFill(ScrnInfoPtr pScrn, int color, int rop, - unsigned int planemask) -{ - I740Ptr pI740; - - pI740 = I740PTR(pScrn); - - pI740->bltcmd.BR00 = ((pScrn->displayWidth * pI740->cpp) << 16) | - (pScrn->displayWidth * pI740->cpp); - pI740->bltcmd.BR01 = color; - pI740->bltcmd.BR04 = SOLID_PAT_SELECT | PAT_IS_MONO | i740PatternRop[rop]; -} - -static void -I740SubsequentSolidFillRect(ScrnInfoPtr pScrn, int x, int y, int w, int h) -{ - I740Ptr pI740; - - pI740 = I740PTR(pScrn); - WAIT_LP_FIFO(12); - OUTREG(LP_FIFO, 0x6000000A); - OUTREG(LP_FIFO, pI740->bltcmd.BR00); - OUTREG(LP_FIFO, pI740->bltcmd.BR01); - OUTREG(LP_FIFO, 0x00000000); - OUTREG(LP_FIFO, 0x00000000); - OUTREG(LP_FIFO, pI740->bltcmd.BR04); - OUTREG(LP_FIFO, 0x00000000); - OUTREG(LP_FIFO, 0x00000000); - OUTREG(LP_FIFO, (y * pScrn->displayWidth + x) * pI740->cpp); - OUTREG(LP_FIFO, 0x00000000); - OUTREG(LP_FIFO, 0x00000000); - OUTREG(LP_FIFO, (h << 16) | (w * pI740->cpp)); -} - -static void -I740SetupForScreenToScreenCopy(ScrnInfoPtr pScrn, int xdir, int ydir, int rop, - unsigned int planemask, int transparency_color) -{ - I740Ptr pI740; - - pI740 = I740PTR(pScrn); - pI740->bltcmd.BR00 = (((pScrn->displayWidth * pI740->cpp) << 16) | - (pScrn->displayWidth * pI740->cpp)); - - pI740->bltcmd.BR04 = SRC_IS_IN_COLOR | SRC_USE_SRC_ADDR | i740Rop[rop]; - if (xdir == -1) - pI740->bltcmd.BR04 |= BLT_RIGHT_TO_LEFT; - else - pI740->bltcmd.BR04 |= BLT_LEFT_TO_RIGHT; - - if (ydir == -1) - pI740->bltcmd.BR04 |= BLT_BOT_TO_TOP; - else - pI740->bltcmd.BR04 |= BLT_TOP_TO_BOT; - - pI740->bltcmd.BR01 = 0x00000000; - -} - -static void -I740SubsequentScreenToScreenCopy(ScrnInfoPtr pScrn, int x1, int y1, - int x2, int y2, int w, int h) -{ - I740Ptr pI740; - - pI740 = I740PTR(pScrn); - if (pI740->bltcmd.BR04 & BLT_BOT_TO_TOP) { - pI740->bltcmd.BR06 = (y1 + h - 1) * pScrn->displayWidth * pI740->cpp; - pI740->bltcmd.BR07 = (y2 + h - 1) * pScrn->displayWidth * pI740->cpp; - } - else { - pI740->bltcmd.BR06 = y1 * pScrn->displayWidth * pI740->cpp; - pI740->bltcmd.BR07 = y2 * pScrn->displayWidth * pI740->cpp; - } - - if (pI740->bltcmd.BR04 & BLT_RIGHT_TO_LEFT) { - pI740->bltcmd.BR06 += (x1 + w - 1) * pI740->cpp + pI740->cpp - 1; - pI740->bltcmd.BR07 += (x2 + w - 1) * pI740->cpp + pI740->cpp - 1; - } - else { - pI740->bltcmd.BR06 += x1 * pI740->cpp; - pI740->bltcmd.BR07 += x2 * pI740->cpp; - } - - WAIT_LP_FIFO(12); - OUTREG(LP_FIFO, 0x6000000A); - OUTREG(LP_FIFO, pI740->bltcmd.BR00); - OUTREG(LP_FIFO, pI740->bltcmd.BR01); - OUTREG(LP_FIFO, 0x00000000); - OUTREG(LP_FIFO, 0x00000000); - OUTREG(LP_FIFO, pI740->bltcmd.BR04); - OUTREG(LP_FIFO, 0x00000000); - OUTREG(LP_FIFO, pI740->bltcmd.BR06); - OUTREG(LP_FIFO, pI740->bltcmd.BR07); - OUTREG(LP_FIFO, 0x00000000); - OUTREG(LP_FIFO, 0x00000000); - OUTREG(LP_FIFO, (h << 16) | (w * pI740->cpp)); -} - -static void -I740SetupForMono8x8PatternFill(ScrnInfoPtr pScrn, int pattx, int patty, - int fg, int bg, int rop, unsigned int planemask) -{ - I740Ptr pI740; - - pI740 = I740PTR(pScrn); - pI740->bltcmd.BR00 = ((pScrn->displayWidth * pI740->cpp) << 16) | - (pScrn->displayWidth * pI740->cpp); - - pI740->bltcmd.BR01 = bg; - pI740->bltcmd.BR02 = fg; - - pI740->bltcmd.BR04 = PAT_IS_MONO | i740PatternRop[rop]; - if (bg == -1) - pI740->bltcmd.BR04 |= MONO_PAT_TRANSP; - - pI740->bltcmd.BR05 = (pattx + patty * pScrn->displayWidth) * pI740->cpp; -} - -static void -I740SubsequentMono8x8PatternFillRect(ScrnInfoPtr pScrn, int pattx, int patty, - int x, int y, int w, int h) -{ - I740Ptr pI740; - - pI740 = I740PTR(pScrn); - WAIT_LP_FIFO(12); - OUTREG(LP_FIFO, 0x6000000A); - OUTREG(LP_FIFO, pI740->bltcmd.BR00); - OUTREG(LP_FIFO, pI740->bltcmd.BR01); - OUTREG(LP_FIFO, pI740->bltcmd.BR02); - OUTREG(LP_FIFO, 0x00000000); - OUTREG(LP_FIFO, pI740->bltcmd.BR04 | ((y << 20) & PAT_VERT_ALIGN)); - OUTREG(LP_FIFO, pI740->bltcmd.BR05); - OUTREG(LP_FIFO, 0x00000000); - OUTREG(LP_FIFO, (y * pScrn->displayWidth + x) * pI740->cpp); - OUTREG(LP_FIFO, 0x00000000); - OUTREG(LP_FIFO, 0x00000000); - OUTREG(LP_FIFO, (h << 16) | (w * pI740->cpp)); -} - -#if 0 -static void -I740SetupForCPUToScreenColorExpandFill(ScrnInfoPtr pScrn, int bg, int fg, - int rop, unsigned int planemask) -{ - I740Ptr pI740; - - pI740 = I740PTR(pScrn); - pI740->bltcmd.BR00 = (pScrn->displayWidth * pI740->cpp) << 16; - pI740->bltcmd.BR01 = bg; - pI740->bltcmd.BR02 = fg; -#ifdef USE_DWORD_COLOR_EXP - pI740->bltcmd.BR03 = MONO_DWORD_ALIGN | MONO_USE_COLEXP; -#else - pI740->bltcmd.BR03 = MONO_BIT_ALIGN | MONO_USE_COLEXP; -#endif - pI740->bltcmd.BR04 = SRC_IS_MONO | SRC_USE_BLTDATA | i740Rop[rop]; - if (bg == -1) - pI740->bltcmd.BR04 |= MONO_SRC_TRANSP; -} - -static void -I740SubsequentCPUToScreenColorExpandFill(ScrnInfoPtr pScrn, int x, int y, - int w, int h, int skipleft) -{ - I740Ptr pI740; - - pI740 = I740PTR(pScrn); - pI740->AccelInfoRec->Sync(pScrn); - OUTREG(LP_FIFO, 0x6000000A); - OUTREG(LP_FIFO, pI740->bltcmd.BR00); - OUTREG(LP_FIFO, pI740->bltcmd.BR01); - OUTREG(LP_FIFO, pI740->bltcmd.BR02); - OUTREG(LP_FIFO, pI740->bltcmd.BR03 | (skipleft & MONO_SRC_LEFT_CLIP)); - OUTREG(LP_FIFO, pI740->bltcmd.BR04); - OUTREG(LP_FIFO, 0x00000000); - OUTREG(LP_FIFO, 0x00000000); - OUTREG(LP_FIFO, (y * pScrn->displayWidth + x) * pI740->cpp); - OUTREG(LP_FIFO, 0x00000000); - OUTREG(LP_FIFO, 0x00000000); -#ifdef USE_DWORD_COLOR_EXP - /* - * This extra wait is necessary to keep the bitblt engine from - * locking up, but I am not sure why it is needed. If we take it - * out, "x11perf -copyplane10" will lock the bitblt engine. When - * the bitblt engine is locked, it is waiting for mono data to be - * written to the BLTDATA region, which seems to imply that some of - * the data that was written was lost. This might be fixed by - * BLT_SKEW changes. Update: The engine still locks up with this - * extra wait. More investigation (and time) is needed. - */ - WAIT_BLT_IDLE(); -#endif - OUTREG(LP_FIFO, (h << 16) | (w * pI740->cpp)); -} -#endif - -#endif diff --git a/src/i740_dga.c b/src/i740_dga.c index 2ad9188..e03d329 100644 --- a/src/i740_dga.c +++ b/src/i740_dga.c @@ -32,9 +32,6 @@ #include "vgaHW.h" #include "xf86xv.h" #include "i740.h" -#ifdef HAVE_XAA_H -#include "xaalocal.h" -#endif #include "dgaproc.h" #include "i740_dga.h" @@ -44,34 +41,13 @@ static Bool I740_SetMode(ScrnInfoPtr, DGAModePtr); static int I740_GetViewport(ScrnInfoPtr); static void I740_SetViewport(ScrnInfoPtr, int, int, int); -#ifdef HAVE_XAA_H -static void I740_Sync(ScrnInfoPtr); -static void I740_FillRect(ScrnInfoPtr, int, int, int, int, unsigned long); -static void I740_BlitRect(ScrnInfoPtr, int, int, int, int, int, int); - -#if 0 -static void I740_BlitTransRect(ScrnInfoPtr, int, int, int, int, int, int, - unsigned long); -#endif -#endif static DGAFunctionRec I740DGAFuncs = { I740_OpenFramebuffer, NULL, I740_SetMode, I740_SetViewport, I740_GetViewport, -#ifdef HAVE_XAA_H - I740_Sync, - I740_FillRect, - I740_BlitRect, -#if 0 - I740_BlitTransRect -#else - NULL -#endif -#else NULL, NULL, NULL, NULL -#endif }; Bool @@ -101,10 +77,6 @@ I740DGAInit(ScreenPtr pScreen) currentMode->mode = pMode; currentMode->flags = DGA_CONCURRENT_ACCESS | DGA_PIXMAP_AVAILABLE; -#ifdef HAVE_XAA_H - if (pI740->AccelInfoRec) - currentMode->flags |= DGA_FILL_RECT | DGA_BLIT_RECT; -#endif if (pMode->Flags & V_DBLSCAN) currentMode->flags |= DGA_DOUBLESCAN; if (pMode->Flags & V_INTERLACE) @@ -157,8 +129,8 @@ I740_SetMode(ScrnInfoPtr pScrn, DGAModePtr pMode) if (!pMode) { /* restore the original mode */ if (pI740->DGAactive) { pScrn->currentMode = I740SavedDGAModes[index]; - I740SwitchMode(SWITCH_MODE_ARGS(pScrn, pScrn->currentMode)); - I740AdjustFrame(ADJUST_FRAME_ARGS(pScrn, 0, 0)); + I740SwitchMode(pScrn, pScrn->currentMode); + I740AdjustFrame(pScrn, 0, 0); pI740->DGAactive = FALSE; } } @@ -168,7 +140,7 @@ I740_SetMode(ScrnInfoPtr pScrn, DGAModePtr pMode) pI740->DGAactive = TRUE; } - I740SwitchMode(SWITCH_MODE_ARGS(pScrn, pMode->mode)); + I740SwitchMode(pScrn, pMode->mode); } return TRUE; @@ -188,7 +160,7 @@ I740_SetViewport(ScrnInfoPtr pScrn, int x, int y, int flags) I740Ptr pI740 = I740PTR(pScrn); vgaHWPtr hwp = VGAHWPTR(pScrn); - I740AdjustFrame(ADJUST_FRAME_ARGS(pScrn, x, y)); + I740AdjustFrame(pScrn, x, y); /* wait for retrace */ while ((hwp->readST01(hwp) & 0x08)); @@ -197,48 +169,6 @@ I740_SetViewport(ScrnInfoPtr pScrn, int x, int y, int flags) pI740->DGAViewportStatus = 0; } -#ifdef HAVE_XAA_H -static void -I740_FillRect(ScrnInfoPtr pScrn, int x, int y, int w, int h, - unsigned long color) -{ - I740Ptr pI740 = I740PTR(pScrn); - - if (pI740->AccelInfoRec) { - (*pI740->AccelInfoRec->SetupForSolidFill) (pScrn, color, GXcopy, ~0); - (*pI740->AccelInfoRec->SubsequentSolidFillRect) (pScrn, x, y, w, h); - SET_SYNC_FLAG(pI740->AccelInfoRec); - } -} - -static void -I740_Sync(ScrnInfoPtr pScrn) -{ - I740Ptr pI740 = I740PTR(pScrn); - - if (pI740->AccelInfoRec) { - (*pI740->AccelInfoRec->Sync) (pScrn); - } -} - -static void -I740_BlitRect(ScrnInfoPtr pScrn, - int srcx, int srcy, int w, int h, int dstx, int dsty) -{ - I740Ptr pI740 = I740PTR(pScrn); - - if (pI740->AccelInfoRec) { - int xdir = ((srcx < dstx) && (srcy == dsty)) ? -1 : 1; - int ydir = (srcy < dsty) ? -1 : 1; - - (*pI740->AccelInfoRec->SetupForScreenToScreenCopy) (pScrn, xdir, ydir, - GXcopy, ~0, -1); - (*pI740->AccelInfoRec->SubsequentScreenToScreenCopy) (pScrn, srcx, srcy, - dstx, dsty, w, h); - SET_SYNC_FLAG(pI740->AccelInfoRec); - } -} -#endif #if 0 static void I740_BlitTransRect(ScrnInfoPtr pScrn, diff --git a/src/i740_driver.c b/src/i740_driver.c index 0bc81a4..75e57b5 100644 --- a/src/i740_driver.c +++ b/src/i740_driver.c @@ -53,10 +53,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "xf86.h" #include "xf86_OSproc.h" -#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 6 -#include "xf86Resources.h" -#include "xf86RAC.h" -#endif #include "xf86cmap.h" /* If the driver uses port I/O directly, it needs: */ @@ -101,25 +97,25 @@ static Bool I740Probe(DriverPtr drv, int flags); static Bool I740PreInit(ScrnInfoPtr pScrn, int flags); /* Initialize a screen */ -static Bool I740ScreenInit(SCREEN_INIT_ARGS_DECL); +static Bool I740ScreenInit(ScreenPtr pScreen, int argc, char **argv); /* Enter from a virtual terminal */ -static Bool I740EnterVT(VT_FUNC_ARGS_DECL); +static Bool I740EnterVT(ScrnInfoPtr pScrn); /* Leave to a virtual terminal */ -static void I740LeaveVT(VT_FUNC_ARGS_DECL); +static void I740LeaveVT(ScrnInfoPtr pScrn); /* Close down each screen we initialized */ -static Bool I740CloseScreen(CLOSE_SCREEN_ARGS_DECL); +static Bool I740CloseScreen(ScreenPtr pScreen); /* Change screensaver state */ static Bool I740SaveScreen(ScreenPtr pScreen, int mode); /* Cleanup server private data */ -static void I740FreeScreen(FREE_SCREEN_ARGS_DECL); +static void I740FreeScreen(ScrnInfoPtr pScrn); /* Check if a mode is valid on the hardware */ -static ModeStatus I740ValidMode(SCRN_ARG_TYPE arg, DisplayModePtr mode, +static ModeStatus I740ValidMode(ScrnInfoPtr pScrn, DisplayModePtr mode, Bool verbose, int flags); /* Switch to various Display Power Management System levels */ @@ -247,7 +243,7 @@ I740GetRec(ScrnInfoPtr pScrn) if (pScrn->driverPrivate) return TRUE; - pScrn->driverPrivate = xnfcalloc(sizeof(I740Rec), 1); + pScrn->driverPrivate = XNFcallocarray(sizeof(I740Rec), 1); return TRUE; } @@ -698,7 +694,7 @@ I740PreInit(ScrnInfoPtr pScrn, int flags) pI740->MaxClock = 86000; } } - clockRanges = xnfcalloc(sizeof(ClockRange), 1); + clockRanges = XNFcallocarray(sizeof(ClockRange), 1); clockRanges->next = NULL; clockRanges->minClock = 12000; /* !!! What's the min clock? !!! */ clockRanges->maxClock = pI740->MaxClock; @@ -712,10 +708,7 @@ I740PreInit(ScrnInfoPtr pScrn, int flags) if (I740MapMem(pScrn)) { if (I740_I2CInit(pScrn)) { xf86MonPtr MonInfo; - - if ((MonInfo = - xf86DoEDID_DDC2(XF86_SCRN_ARG(pScrn), - pI740->rc_i2c))) { + if ((MonInfo = xf86DoEDID_DDC2(pScrn, pI740->rc_i2c))) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "DDC Monitor info: %p\n", MonInfo); xf86PrintEDID(MonInfo); @@ -770,11 +763,9 @@ I740PreInit(ScrnInfoPtr pScrn, int flags) pI740->NoAccel = xf86ReturnOptValBool(pI740->Options, OPTION_NOACCEL, FALSE); if (!pI740->NoAccel) { - if (!xf86LoadSubModule(pScrn, "xaa")) { - xf86DrvMsg(pScrn->scrnIndex, X_WARNING, - "No acceleration available\n"); - pI740->NoAccel = 1; - } + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + "No acceleration available\n"); + pI740->NoAccel = 1; } if (!xf86ReturnOptValBool(pI740->Options, OPTION_SW_CURSOR, FALSE)) { @@ -1585,7 +1576,7 @@ I740LoadPalette24(ScrnInfoPtr pScrn, int numColors, int *indices, LOCO *colors, } static Bool -I740ScreenInit(SCREEN_INIT_ARGS_DECL) +I740ScreenInit(ScreenPtr pScreen, int argc, char **argv) { ScrnInfoPtr pScrn; vgaHWPtr hwp; @@ -1612,7 +1603,7 @@ I740ScreenInit(SCREEN_INIT_ARGS_DECL) return FALSE; I740SaveScreen(pScreen, SCREEN_SAVER_ON); - I740AdjustFrame(ADJUST_FRAME_ARGS(pScrn, pScrn->frameX0, pScrn->frameY0)); + I740AdjustFrame(pScrn, pScrn->frameX0, pScrn->frameY0); miClearVisualTypes(); @@ -1658,10 +1649,8 @@ I740ScreenInit(SCREEN_INIT_ARGS_DECL) } if (!pI740->NoAccel) { - if (!I740AccelInit(pScreen)) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, - "Hardware acceleration initialization failed\n"); - } + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "Hardware acceleration not available\n"); } if (pScrn->bitsPerPixel > 8) { @@ -1731,16 +1720,14 @@ I740ScreenInit(SCREEN_INIT_ARGS_DECL) } Bool -I740SwitchMode(SWITCH_MODE_ARGS_DECL) +I740SwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode) { - SCRN_INFO_PTR(arg); return I740ModeInit(pScrn, mode); } void -I740AdjustFrame(ADJUST_FRAME_ARGS_DECL) +I740AdjustFrame(ScrnInfoPtr pScrn, int x, int y) { - SCRN_INFO_PTR(arg); int Base; vgaHWPtr hwp; @@ -1774,20 +1761,17 @@ I740AdjustFrame(ADJUST_FRAME_ARGS_DECL) } static Bool -I740EnterVT(VT_FUNC_ARGS_DECL) +I740EnterVT(ScrnInfoPtr pScrn) { - SCRN_INFO_PTR(arg); - if (!I740ModeInit(pScrn, pScrn->currentMode)) return FALSE; - I740AdjustFrame(ADJUST_FRAME_ARGS(pScrn, pScrn->frameX0, pScrn->frameY0)); + I740AdjustFrame(pScrn, pScrn->frameX0, pScrn->frameY0); return TRUE; } static void -I740LeaveVT(VT_FUNC_ARGS_DECL) +I740LeaveVT(ScrnInfoPtr pScrn) { - SCRN_INFO_PTR(arg); vgaHWPtr hwp; hwp = VGAHWPTR(pScrn); @@ -1796,7 +1780,7 @@ I740LeaveVT(VT_FUNC_ARGS_DECL) } static Bool -I740CloseScreen(CLOSE_SCREEN_ARGS_DECL) +I740CloseScreen(ScreenPtr pScreen) { ScrnInfoPtr pScrn; vgaHWPtr hwp; @@ -1813,33 +1797,26 @@ I740CloseScreen(CLOSE_SCREEN_ARGS_DECL) I740UnmapMem(pScrn); vgaHWUnmapMem(pScrn); -#ifdef HAVE_XAA_H - if (pI740->AccelInfoRec) - XAADestroyInfoRec(pI740->AccelInfoRec); - pI740->AccelInfoRec = 0; -#endif if (pI740->CursorInfoRec) xf86DestroyCursorInfoRec(pI740->CursorInfoRec); pI740->CursorInfoRec = 0; pScrn->vtSema = FALSE; pScreen->CloseScreen = pI740->CloseScreen; - return (*pScreen->CloseScreen) (CLOSE_SCREEN_ARGS); + return (*pScreen->CloseScreen) (pScreen); } static void -I740FreeScreen(FREE_SCREEN_ARGS_DECL) +I740FreeScreen(ScrnInfoPtr pScrn) { - SCRN_INFO_PTR(arg); I740FreeRec(pScrn); if (xf86LoaderCheckSymbol("vgaHWFreeHWRec")) vgaHWFreeHWRec(pScrn); } static ModeStatus -I740ValidMode(SCRN_ARG_TYPE arg, DisplayModePtr mode, Bool verbose, int flags) +I740ValidMode(ScrnInfoPtr pScrn, DisplayModePtr mode, Bool verbose, int flags) { - SCRN_INFO_PTR(arg); if (mode->Flags & V_INTERLACE) { if (verbose) { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, diff --git a/src/i740_video.c b/src/i740_video.c index 958d4e8..1f7e9b9 100644 --- a/src/i740_video.c +++ b/src/i740_video.c @@ -908,7 +908,6 @@ I740QueryImageAttributes(ScrnInfoPtr pScrn, int id, unsigned short *w, static void I740BlockHandler(BLOCKHANDLER_ARGS_DECL) { - SCREEN_PTR(arg); ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); I740Ptr pI740 = I740PTR(pScrn); I740PortPrivPtr pPriv = GET_PORT_PRIVATE(pScrn); |