mirror of
https://github.com/X11Libre/xserver.git
synced 2026-10-17 00:32:57 +00:00
Lots of Tiny-X changes:
Add overlay support in the Tiny-X Savage4 driver (required changing lots of
Tiny-X code). Savage4 now support 8/16, 8/32 overlays.
Add IGS Cyberpro 5050 driver. This chip has bus support for embeded
systems.
This commit is contained in:
parent
4b54f22b6a
commit
3731c184d6
34 changed files with 4000 additions and 720 deletions
14
hw/kdrive/igs/Imakefile
Normal file
14
hw/kdrive/igs/Imakefile
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
XCOMM $XFree86$
|
||||
#include <Server.tmpl>
|
||||
|
||||
SRCS = igs.c igsdraw.c igsstub.c
|
||||
|
||||
OBJS = igs.o igsdraw.o igsstub.o
|
||||
|
||||
INCLUDES = -I.. -I. -I$(XBUILDINCDIR) -I$(FONTINCSRC) \
|
||||
-I../../../fb -I../../../mi -I../../../include -I../../../os \
|
||||
-I$(EXTINCSRC) -I$(XINCLUDESRC)
|
||||
|
||||
NormalLibraryObjectRule()
|
||||
NormalLibraryTarget(igs,$(OBJS))
|
||||
DependTarget()
|
||||
201
hw/kdrive/igs/igs.c
Normal file
201
hw/kdrive/igs/igs.c
Normal file
|
|
@ -0,0 +1,201 @@
|
|||
/*
|
||||
* $XFree86$
|
||||
*
|
||||
* Copyright © 1999 SuSE, Inc.
|
||||
*
|
||||
* 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 SuSE not be used in advertising or
|
||||
* publicity pertaining to distribution of the software without specific,
|
||||
* written prior permission. SuSE makes no representations about the
|
||||
* suitability of this software for any purpose. It is provided "as is"
|
||||
* without express or implied warranty.
|
||||
*
|
||||
* SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
|
||||
* 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.
|
||||
*
|
||||
* Author: Keith Packard, SuSE, Inc.
|
||||
*/
|
||||
|
||||
#include "igs.h"
|
||||
|
||||
Bool
|
||||
igsCardInit (KdCardInfo *card)
|
||||
{
|
||||
int k;
|
||||
char *pixels;
|
||||
IgsCardInfo *igsc;
|
||||
|
||||
igsc = (IgsCardInfo *) xalloc (sizeof (IgsCardInfo));
|
||||
if (!igsc)
|
||||
return FALSE;
|
||||
|
||||
memset (igsc, '\0', sizeof (IgsCardInfo));
|
||||
|
||||
igsc->frameBuffer = (CARD8 *) KdMapDevice (card->attr.address[0],
|
||||
4096 * 1024);
|
||||
|
||||
igsc->cop = (Cop5xxx *) KdMapDevice (card->attr.address[0] +
|
||||
IGS_COP_OFFSET,
|
||||
sizeof (Cop5xxx));
|
||||
|
||||
igsc->copData = (VOL32 *) KdMapDevice (card->attr.address[0] +
|
||||
IGS_COP_DATA,
|
||||
IGS_COP_DATA_LEN);
|
||||
|
||||
card->driver = igsc;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
Bool
|
||||
igsScreenInit (KdScreenInfo *screen)
|
||||
{
|
||||
IgsCardInfo *igsc = screen->card->driver;
|
||||
int fb = 0;
|
||||
|
||||
if (screen->fb[fb].depth >= 24)
|
||||
{
|
||||
screen->fb[fb].depth = 24;
|
||||
if (screen->fb[fb].bitsPerPixel != 24)
|
||||
screen->fb[fb].bitsPerPixel = 32;
|
||||
}
|
||||
else if (screen->fb[fb].depth >= 16)
|
||||
{
|
||||
screen->fb[fb].depth = 16;
|
||||
screen->fb[fb].bitsPerPixel = 16;
|
||||
}
|
||||
else if (screen->fb[fb].depth >= 15)
|
||||
{
|
||||
screen->fb[fb].depth = 15;
|
||||
screen->fb[fb].bitsPerPixel = 16;
|
||||
}
|
||||
else
|
||||
{
|
||||
screen->fb[fb].depth = 8;
|
||||
screen->fb[fb].bitsPerPixel = 8;
|
||||
}
|
||||
switch (screen->fb[fb].depth) {
|
||||
case 8:
|
||||
screen->fb[fb].visuals = ((1 << StaticGray) |
|
||||
(1 << GrayScale) |
|
||||
(1 << StaticColor) |
|
||||
(1 << PseudoColor) |
|
||||
(1 << TrueColor) |
|
||||
(1 << DirectColor));
|
||||
screen->fb[fb].blueMask = 0x00;
|
||||
screen->fb[fb].greenMask = 0x00;
|
||||
screen->fb[fb].redMask = 0x00;
|
||||
break;
|
||||
case 15:
|
||||
screen->fb[fb].visuals = (1 << TrueColor);
|
||||
screen->fb[fb].blueMask = 0x001f;
|
||||
screen->fb[fb].greenMask = 0x03e0;
|
||||
screen->fb[fb].redMask = 0x7c00;
|
||||
break;
|
||||
case 16:
|
||||
screen->fb[fb].visuals = (1 << TrueColor);
|
||||
screen->fb[fb].blueMask = 0x001f;
|
||||
screen->fb[fb].greenMask = 0x07e0;
|
||||
screen->fb[fb].redMask = 0xf800;
|
||||
break;
|
||||
case 24:
|
||||
screen->fb[fb].visuals = (1 << TrueColor);
|
||||
screen->fb[fb].blueMask = 0x0000ff;
|
||||
screen->fb[fb].greenMask = 0x00ff00;
|
||||
screen->fb[fb].redMask = 0xff0000;
|
||||
break;
|
||||
}
|
||||
screen->fb[fb].pixelStride = screen->width;
|
||||
screen->fb[fb].byteStride = screen->width * (screen->fb[fb].bitsPerPixel >> 3);
|
||||
screen->fb[fb].frameBuffer = igsc->frameBuffer;
|
||||
if (!igsc->cop)
|
||||
screen->dumb = TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
Bool
|
||||
igsInitScreen(ScreenPtr pScreen)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
igsPreserve (KdCardInfo *card)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
igsEnable (ScreenPtr pScreen)
|
||||
{
|
||||
}
|
||||
|
||||
Bool
|
||||
igsDPMS (ScreenPtr pScreen, int mode)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
igsDisable (ScreenPtr pScreen)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
igsRestore (KdCardInfo *card)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
igsScreenFini (KdScreenInfo *screen)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
igsCardFini (KdCardInfo *card)
|
||||
{
|
||||
IgsCardInfo *igsc = card->driver;
|
||||
|
||||
if (igsc->copData)
|
||||
KdUnmapDevice ((void *) igsc->copData, IGS_COP_DATA_LEN);
|
||||
if (igsc->cop)
|
||||
KdUnmapDevice (igsc->cop, sizeof (Cop5xxx));
|
||||
if (igsc->frameBuffer)
|
||||
KdUnmapDevice (igsc->frameBuffer, 4096 * 1024);
|
||||
xfree (igsc);
|
||||
card->driver = 0;
|
||||
}
|
||||
|
||||
KdCardFuncs igsFuncs = {
|
||||
igsCardInit, /* cardinit */
|
||||
igsScreenInit, /* scrinit */
|
||||
igsInitScreen,
|
||||
igsPreserve, /* preserve */
|
||||
igsEnable, /* enable */
|
||||
igsDPMS, /* dpms */
|
||||
igsDisable, /* disable */
|
||||
igsRestore, /* restore */
|
||||
igsScreenFini, /* scrfini */
|
||||
igsCardFini, /* cardfini */
|
||||
|
||||
0, /* initCursor */
|
||||
0, /* enableCursor */
|
||||
0, /* disableCursor */
|
||||
0, /* finiCursor */
|
||||
0, /* recolorCursor */
|
||||
|
||||
igsDrawInit, /* initAccel */
|
||||
igsDrawEnable, /* enableAccel */
|
||||
igsDrawSync, /* drawSync */
|
||||
igsDrawDisable, /* disableAccel */
|
||||
igsDrawFini, /* finiAccel */
|
||||
|
||||
0, /* getColors */
|
||||
0, /* putColors */
|
||||
};
|
||||
244
hw/kdrive/igs/igs.h
Normal file
244
hw/kdrive/igs/igs.h
Normal file
|
|
@ -0,0 +1,244 @@
|
|||
/*
|
||||
* $XFree86$
|
||||
*
|
||||
* Copyright © 1999 SuSE, Inc.
|
||||
*
|
||||
* 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 SuSE not be used in advertising or
|
||||
* publicity pertaining to distribution of the software without specific,
|
||||
* written prior permission. SuSE makes no representations about the
|
||||
* suitability of this software for any purpose. It is provided "as is"
|
||||
* without express or implied warranty.
|
||||
*
|
||||
* SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
|
||||
* 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.
|
||||
*
|
||||
* Author: Keith Packard, SuSE, Inc.
|
||||
*/
|
||||
|
||||
#ifndef _IGS_H_
|
||||
#define _IGS_H_
|
||||
|
||||
#include "kdrive.h"
|
||||
|
||||
extern KdCardFuncs igsFuncs;
|
||||
|
||||
/*
|
||||
* FB 0x00000000
|
||||
* VGA 0x00800000
|
||||
* Blt window 0x008a0000
|
||||
* Coprocessor 0x008bf000
|
||||
*/
|
||||
|
||||
#define IGS_COP_DATA 0x008a0000
|
||||
#define IGS_COP_DATA_LEN 0x00010000
|
||||
#define IGS_COP_OFFSET 0x008bf000
|
||||
|
||||
typedef volatile CARD8 VOL8;
|
||||
typedef volatile CARD16 VOL16;
|
||||
typedef volatile CARD32 VOL32;
|
||||
|
||||
typedef struct _Cop5xxx {
|
||||
VOL8 pad000[0x11]; /* 0x000 */
|
||||
|
||||
VOL8 control; /* 0x011 */
|
||||
#define IGS_CONTROL_HBLTW_RDYZ 0x01
|
||||
#define IGS_CONTROL_MALLWBEPTZ 0x02
|
||||
#define IGS_CONTROL_CMDFF 0x04
|
||||
#define IGS_CONTROL_SOP 0x08
|
||||
#define IGS_CONTROL_OPS 0x10
|
||||
#define IGS_CONTROL_TER 0x20
|
||||
#define IGS_CONTROL_HBACKZ 0x40
|
||||
#define IGS_CONTROL_BUSY 0x80
|
||||
|
||||
VOL8 pad012[0x06]; /* 0x012 */
|
||||
|
||||
VOL32 src1_stride; /* 0x018 */
|
||||
|
||||
VOL32 format; /* 0x01c */
|
||||
|
||||
#define IGS_FORMAT_8BPP 0
|
||||
#define IGS_FORMAT_16BPP 1
|
||||
#define IGS_FORMAT_24BPP 2
|
||||
#define IGS_FORMAT_32BPP 3
|
||||
|
||||
VOL32 bres_error; /* 0x020 */
|
||||
VOL32 bres_k1; /* 0x024 */
|
||||
VOL32 bres_k2; /* 0x028 */
|
||||
VOL8 pad02c[0x1c]; /* 0x02c */
|
||||
|
||||
VOL32 mix; /* 0x048 */
|
||||
#define IGS_MIX_FG 0x00ff
|
||||
#define IGS_MIX_BG 0xff00
|
||||
#define IGS_MAKE_MIX(fg,bg) ((fg) | ((bg) << 8))
|
||||
|
||||
#define IGS_MIX_ZERO 0x0
|
||||
#define IGS_MIX_SRC_AND_DST 0x1
|
||||
#define IGS_MIX_SRC_AND_NOT_DST 0x2
|
||||
#define IGS_MIX_SRC 0x3
|
||||
#define IGS_MIX_NOT_SRC_AND_DST 0x4
|
||||
#define IGS_MIX_DST 0x5
|
||||
#define IGS_MIX_SRC_XOR_DST 0x6
|
||||
#define IGS_MIX_SRC_OR_DST 0x7
|
||||
#define IGS_MIX_NOT_SRC_AND_NOT_DST 0x8
|
||||
#define IGS_MIX_SRC_XOR_NOT_DST 0x9
|
||||
#define IGS_MIX_NOT_DST 0xa
|
||||
#define IGS_MIX_SRC_OR_NOT_DST 0xb
|
||||
#define IGS_MIX_NOT_SRC 0xc
|
||||
#define IGS_MIX_NOT_SRC_OR_DST 0xd
|
||||
#define IGS_MIX_NOT_SRC_OR_NOT_DST 0xe
|
||||
#define IGS_MIX_ONE 0xf
|
||||
|
||||
VOL32 colorComp; /* 0x04c */
|
||||
VOL32 planemask; /* 0x050 */
|
||||
|
||||
VOL8 pad054[0x4]; /* 0x054 */
|
||||
|
||||
VOL32 fg; /* 0x058 */
|
||||
VOL32 bg; /* 0x05c */
|
||||
VOL32 dim; /* 0x060 */
|
||||
#define IGS_MAKE_DIM(w,h) ((w) | ((h) << 16))
|
||||
VOL8 pad5[0x0c]; /* 0x064 */
|
||||
|
||||
VOL32 src1_base_address; /* 0x070 */
|
||||
VOL8 pad074[0x04]; /* 0x074 */
|
||||
|
||||
VOL16 dst_x_rotate; /* 0x078 */
|
||||
VOL16 pat_y_rotate; /* 0x07a */
|
||||
VOL32 operation; /* 0x07c */
|
||||
|
||||
/* OCT[2:0] */
|
||||
#define IGS_DRAW_X_MAJOR 0x00000000
|
||||
#define IGS_DRAW_Y_MAJOR 0x00000001
|
||||
#define IGS_DRAW_T_B 0x00000000
|
||||
#define IGS_DRAW_B_T 0x00000002
|
||||
#define IGS_DRAW_L_R 0x00000000
|
||||
#define IGS_DRAW_R_L 0x00000004
|
||||
|
||||
/* Draw_Mode[1:0] */
|
||||
#define IGS_DRAW_ALL 0x00000000
|
||||
#define IGS_DRAW_NOT_FIRST 0x00000010
|
||||
#define IGS_DRAW_NOT_LAST 0x00000020
|
||||
#define IGS_DRAW_NOT_FIRST_LAST 0x00000030
|
||||
|
||||
/* TRPS[1:0] */
|
||||
#define IGS_TRANS_SRC1 0x00000000
|
||||
#define IGS_TRANS_SRC2 0x00000100
|
||||
#define IGS_TRANS_DST 0x00000200
|
||||
/* TRPS2 Transparent Invert */
|
||||
#define IGS_TRANS_INVERT 0x00000400
|
||||
/* TRPS3, Transparent Enable */
|
||||
#define IGS_TRANS_ENABLE 0x00000800
|
||||
|
||||
/* PPS[3:0], Pattern Pixel Select */
|
||||
#define IGS_PIXEL_TEXT_OPAQUE 0x00001000
|
||||
#define IGS_PIXEL_STIP_OPAQUE 0x00002000
|
||||
#define IGS_PIXEL_LINE_OPAQUE 0x00003000
|
||||
#define IGS_PIXEL_TEXT_TRANS 0x00005000
|
||||
#define IGS_PIXEL_STIP_TRANS 0x00006000
|
||||
#define IGS_PIXEL_LINE_TRANS 0x00007000
|
||||
#define IGS_PIXEL_FG 0x00008000
|
||||
#define IGS_PIXEL_TILE 0x00009000
|
||||
|
||||
/* HostBltEnable[1:0] */
|
||||
#define IGS_HBLT_DISABLE 0x00000000
|
||||
#define IGS_HBLT_READ 0x00010000
|
||||
#define IGS_HBLT_WRITE_1 0x00020000
|
||||
#define IGS_HBLT_WRITE_2 0x00030000
|
||||
|
||||
/* Src2MapSelect[2:0], Src2 map select mode */
|
||||
#define IGS_SRC2_NORMAL 0x00000000
|
||||
#define IGS_SRC2_MONO_OPAQUE 0x00100000
|
||||
#define IGS_SRC2_FG 0x00200000
|
||||
#define IGS_SRC2_MONO_TRANS 0x00500000
|
||||
|
||||
/* StepFunction[3:0], Step function select */
|
||||
#define IGS_STEP_DRAW_AND_STEP 0x04000000
|
||||
#define IGS_STEP_LINE_DRAW 0x05000000
|
||||
#define IGS_STEP_PXBLT 0x08000000
|
||||
#define IGS_STEP_INVERT_PXBLT 0x09000000
|
||||
#define IGS_STEP_TERNARY_PXBLT 0x0b000000
|
||||
|
||||
/* FGS */
|
||||
#define IGS_FGS_FG 0x00000000
|
||||
#define IGS_FGS_SRC 0x20000000
|
||||
|
||||
/* BGS */
|
||||
#define IGS_BGS_BG 0x00000000
|
||||
#define IGS_BGS_SRC 0x80000000
|
||||
VOL8 pad080[0x91]; /* 0x080 */
|
||||
|
||||
VOL8 debug_control_1; /* 0x111 */
|
||||
VOL8 debug_control_2; /* 0x112 */
|
||||
VOL8 pad113[0x05]; /* 0x113 */
|
||||
|
||||
VOL32 src2_stride; /* 0x118 */
|
||||
VOL8 pad11c[0x14]; /* 0x11c */
|
||||
|
||||
VOL32 extension; /* 0x130 */
|
||||
|
||||
#define IGS_BURST_ENABLE 0x01
|
||||
#define IGS_STYLE_LINE 0x02
|
||||
#define IGS_ADDITIONAL_WAIT 0x04
|
||||
#define IGS_BLOCK_COP_REG 0x08
|
||||
#define IGS_TURBO_MONO 0x10
|
||||
#define IGS_SELECT_SAMPLE 0x40
|
||||
#define IGS_MDSBL_RD_B_WR 0x80
|
||||
#define IGS_WRMRSTZ 0x100
|
||||
#define IGS_TEST_MTST 0x200
|
||||
|
||||
VOL8 style_line_roll_over; /* 0x134 */
|
||||
VOL8 style_line_inc; /* 0x135 */
|
||||
VOL8 style_line_pattern; /* 0x136 */
|
||||
VOL8 style_line_accumulator; /* 0x137 */
|
||||
VOL8 style_line_pattern_index; /* 0x138 */
|
||||
VOL8 pad139[0x3]; /* 0x139 */
|
||||
|
||||
VOL16 mono_burst_total; /* 0x13c */
|
||||
VOL8 pad13e[0x12]; /* 0x13e */
|
||||
|
||||
VOL8 pat_x_rotate; /* 0x150 */
|
||||
VOL8 pad151[0x1f]; /* 0x151 */
|
||||
|
||||
VOL32 src1_start; /* 0x170 */
|
||||
VOL32 src2_start; /* 0x174 */
|
||||
VOL32 dst_start; /* 0x178 */
|
||||
VOL8 pad17c[0x9c]; /* 0x17c */
|
||||
|
||||
VOL16 dst_stride; /* 0x218 */
|
||||
} Cop5xxx;
|
||||
|
||||
typedef struct _igsCardInfo {
|
||||
Cop5xxx *cop;
|
||||
VOL32 *copData;
|
||||
Bool need_sync;
|
||||
CARD8 *frameBuffer;
|
||||
} IgsCardInfo;
|
||||
|
||||
#define getIgsCardInfo(kd) ((IgsCardInfo *) ((kd)->card->driver))
|
||||
#define igsCardInfo(kd) IgsCardInfo *igsc = getIgsCardInfo(kd)
|
||||
|
||||
Bool
|
||||
igsDrawInit (ScreenPtr pScreen);
|
||||
|
||||
void
|
||||
igsDrawEnable (ScreenPtr pScreen);
|
||||
|
||||
void
|
||||
igsDrawDisable (ScreenPtr pScreen);
|
||||
|
||||
void
|
||||
igsDrawSync (ScreenPtr pScreen);
|
||||
|
||||
void
|
||||
igsDrawFini (ScreenPtr pScreen);
|
||||
|
||||
|
||||
#endif /* _IGS_H_ */
|
||||
1114
hw/kdrive/igs/igsdraw.c
Normal file
1114
hw/kdrive/igs/igsdraw.c
Normal file
File diff suppressed because it is too large
Load diff
188
hw/kdrive/igs/igsdraw.h
Normal file
188
hw/kdrive/igs/igsdraw.h
Normal file
|
|
@ -0,0 +1,188 @@
|
|||
/*
|
||||
* $XFree86$
|
||||
*
|
||||
* Copyright © 2000 Keith Packard
|
||||
*
|
||||
* 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 Keith Packard not be used in
|
||||
* advertising or publicity pertaining to distribution of the software without
|
||||
* specific, written prior permission. Keith Packard makes no
|
||||
* representations about the suitability of this software for any purpose. It
|
||||
* is provided "as is" without express or implied warranty.
|
||||
*
|
||||
* KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
* EVENT SHALL KEITH PACKARD 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 _IGSDRAW_H_
|
||||
#define _IGSDRAW_H_
|
||||
|
||||
extern CARD8 igsPatRop[];
|
||||
|
||||
#define SetupIgs(s) KdScreenPriv(s); \
|
||||
igsCardInfo(pScreenPriv); \
|
||||
Cop5xxx *cop = igsc->cop; \
|
||||
int cop_stride = pScreenPriv->screen->fb[0].pixelStride
|
||||
|
||||
#define _igsWaitLoop(cop,mask,value) { \
|
||||
int __loop = 1000000; \
|
||||
while (((cop)->control & (mask)) != (value)) { \
|
||||
if (--__loop <= 0) { \
|
||||
FatalError("Warning: igsWaitLoop 0x%x 0x%x failed\n", mask, value); \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
#define _igsWaitDone(cop) _igsWaitLoop(cop, \
|
||||
(IGS_CONTROL_BUSY| \
|
||||
IGS_CONTROL_MALLWBEPTZ), \
|
||||
0)
|
||||
|
||||
#define _igsWaitFull(cop) _igsWaitLoop(cop, \
|
||||
IGS_CONTROL_CMDFF, \
|
||||
0)
|
||||
|
||||
#define _igsWaitIdleEmpty(cop) _igsWaitDone(cop)
|
||||
#define _igsWaitHostBltAck(cop) _igsWaitLoop(cop, \
|
||||
(IGS_CONTROL_HBACKZ| \
|
||||
IGS_CONTROL_CMDFF), \
|
||||
0)
|
||||
|
||||
#define _igsReset(cop) ((cop)->control = 0)
|
||||
|
||||
#define IgsInvertBits32(v) { \
|
||||
v = ((v & 0x55555555) << 1) | ((v >> 1) & 0x55555555); \
|
||||
v = ((v & 0x33333333) << 2) | ((v >> 2) & 0x33333333); \
|
||||
v = ((v & 0x0f0f0f0f) << 4) | ((v >> 4) & 0x0f0f0f0f); \
|
||||
}
|
||||
|
||||
#define IgsInvertBits16(v) { \
|
||||
v = ((v & 0x5555) << 1) | ((v >> 1) & 0x5555); \
|
||||
v = ((v & 0x3333) << 2) | ((v >> 2) & 0x3333); \
|
||||
v = ((v & 0x0f0f) << 4) | ((v >> 4) & 0x0f0f); \
|
||||
}
|
||||
|
||||
#define IgsInvertBits8(v) { \
|
||||
v = ((v & 0x55) << 1) | ((v >> 1) & 0x55); \
|
||||
v = ((v & 0x33) << 2) | ((v >> 2) & 0x33); \
|
||||
v = ((v & 0x0f) << 4) | ((v >> 4) & 0x0f); \
|
||||
}
|
||||
|
||||
#define IgsAdjustBits32(b) IgsInvertBits32(b)
|
||||
|
||||
#define _igsSetSolidRect(cop,alu,pm,pix,cmd) {\
|
||||
_igsWaitFull(cop); \
|
||||
(cop)->mix = IGS_MAKE_MIX(alu,alu); \
|
||||
(cop)->fg = (pix); \
|
||||
(cop)->planemask = (pm); \
|
||||
(cmd) = (IGS_DRAW_T_B | \
|
||||
IGS_DRAW_L_R | \
|
||||
IGS_DRAW_ALL | \
|
||||
IGS_PIXEL_FG | \
|
||||
IGS_HBLT_DISABLE | \
|
||||
IGS_SRC2_NORMAL | \
|
||||
IGS_STEP_PXBLT | \
|
||||
IGS_FGS_FG | \
|
||||
IGS_BGS_BG); \
|
||||
}
|
||||
|
||||
#define _igsRect(cop,x,y,w,h,cmd) { \
|
||||
_igsWaitFull(cop); \
|
||||
(cop)->dst_start = (x) + (y) * (cop_stride); \
|
||||
(cop)->dim = IGS_MAKE_DIM(w-1,h-1); \
|
||||
(cop)->operation = (cmd); \
|
||||
}
|
||||
|
||||
#define _igsSetBlt(cop,alu,pm,backwards,upsidedown,cmd) { \
|
||||
_igsWaitFull(cop); \
|
||||
(cop)->mix = IGS_MAKE_MIX(alu,GXnoop); \
|
||||
(cop)->planemask = (pm); \
|
||||
(cop)->src1_stride = cop_stride - 1; \
|
||||
(cmd) = (IGS_DRAW_ALL | \
|
||||
IGS_PIXEL_FG | \
|
||||
IGS_HBLT_DISABLE | \
|
||||
IGS_SRC2_NORMAL | \
|
||||
IGS_STEP_PXBLT | \
|
||||
IGS_FGS_SRC | \
|
||||
IGS_BGS_BG); \
|
||||
if (backwards) (cmd) |= IGS_DRAW_R_L; \
|
||||
if (upsidedown) (cmd) |= IGS_DRAW_B_T; \
|
||||
}
|
||||
|
||||
#if 0
|
||||
#define _igsPreparePlaneBlt(cop) { \
|
||||
_igsReset(cop); \
|
||||
(cop)->dst_stride = cop_stride - 1; \
|
||||
(cop)->src1_stride = cop_stride - 1; \
|
||||
(cop)->src2_stride = cop_stride - 1; \
|
||||
(cop)->format = IGS_FORMAT_16BPP; \
|
||||
(cop)->src1_start = 0; \
|
||||
(cop)->src2_start = 0; \
|
||||
}
|
||||
#else
|
||||
#define _igsPreparePlaneBlt(cop)
|
||||
#endif
|
||||
|
||||
#define _igsSetTransparentPlaneBlt(cop,alu,pm,fg_pix,cmd) { \
|
||||
_igsWaitIdleEmpty(cop); \
|
||||
_igsPreparePlaneBlt(cop); \
|
||||
(cop)->mix = IGS_MAKE_MIX(igsPatRop[alu],igsPatRop[GXnoop]); \
|
||||
(cop)->fg = (fg_pix); \
|
||||
(cop)->planemask = (pm); \
|
||||
(cmd) = (IGS_DRAW_T_B | \
|
||||
IGS_DRAW_L_R | \
|
||||
IGS_DRAW_ALL | \
|
||||
IGS_PIXEL_FG | \
|
||||
IGS_HBLT_WRITE_2 | \
|
||||
IGS_SRC2_MONO_TRANS | \
|
||||
IGS_STEP_TERNARY_PXBLT | \
|
||||
IGS_FGS_FG | \
|
||||
IGS_BGS_BG); \
|
||||
}
|
||||
|
||||
#define _igsSetOpaquePlaneBlt(cop,alu,pm,fg_pix,bg_pix,cmd) { \
|
||||
_igsWaitIdleEmpty(cop); \
|
||||
_igsPreparePlaneBlt(cop); \
|
||||
(cop)->mix = IGS_MAKE_MIX(igsPatRop[alu],igsPatRop[alu]); \
|
||||
(cop)->planemask = (pm); \
|
||||
(cop)->fg = (fg_pix); \
|
||||
(cop)->bg = (bg_pix); \
|
||||
(cmd) = (IGS_DRAW_T_B | \
|
||||
IGS_DRAW_L_R | \
|
||||
IGS_DRAW_ALL | \
|
||||
IGS_PIXEL_FG | \
|
||||
IGS_HBLT_WRITE_2 | \
|
||||
IGS_SRC2_MONO_OPAQUE | \
|
||||
IGS_STEP_TERNARY_PXBLT | \
|
||||
IGS_FGS_FG | \
|
||||
IGS_BGS_BG); \
|
||||
}
|
||||
|
||||
#define _igsPlaneBlt(cop,x,y,w,h,cmd) { \
|
||||
/* _igsWaitFull(cop); */ \
|
||||
(cop)->dst_start = (x) + (y) * (cop_stride); \
|
||||
(cop)->dim = IGS_MAKE_DIM((w)-1,(h)-1); \
|
||||
(cop)->operation = (cmd); \
|
||||
/* _igsWaitHostBltAck(cop); */ \
|
||||
}
|
||||
|
||||
#define _igsBlt(cop,sx,sy,dx,dy,w,h,cmd) { \
|
||||
_igsWaitFull(cop); \
|
||||
(cop)->dst_start = (dx) + (dy) * cop_stride; \
|
||||
(cop)->src1_start = (sx) + (sy) * cop_stride; \
|
||||
(cop)->src1_stride = cop_stride - 1; \
|
||||
(cop)->dim = IGS_MAKE_DIM(w-1,h-1); \
|
||||
(cop)->operation = (cmd); \
|
||||
}
|
||||
|
||||
#define sourceInvarient(alu) (((alu) & 3) == (((alu) >> 2) & 3))
|
||||
|
||||
#endif
|
||||
57
hw/kdrive/igs/igsstub.c
Normal file
57
hw/kdrive/igs/igsstub.c
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
/*
|
||||
* $XFree86$
|
||||
*
|
||||
* Copyright © 2000 Keith Packard
|
||||
*
|
||||
* 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 Keith Packard not be used in
|
||||
* advertising or publicity pertaining to distribution of the software without
|
||||
* specific, written prior permission. Keith Packard makes no
|
||||
* representations about the suitability of this software for any purpose. It
|
||||
* is provided "as is" without express or implied warranty.
|
||||
*
|
||||
* KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
* EVENT SHALL KEITH PACKARD 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.
|
||||
*/
|
||||
|
||||
#include "igs.h"
|
||||
|
||||
void
|
||||
InitCard (char *name)
|
||||
{
|
||||
KdCardAttr attr;
|
||||
CARD32 count;
|
||||
|
||||
count = 0;
|
||||
while (LinuxFindPci (0x10ea, 0x5000, count, &attr))
|
||||
{
|
||||
KdCardInfoAdd (&igsFuncs, &attr, 0);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
InitOutput (ScreenInfo *pScreenInfo, int argc, char **argv)
|
||||
{
|
||||
KdInitOutput (pScreenInfo, argc, argv);
|
||||
}
|
||||
|
||||
void
|
||||
InitInput (int argc, char **argv)
|
||||
{
|
||||
KdInitInput (&Ps2MouseFuncs, &LinuxKeyboardFuncs);
|
||||
}
|
||||
|
||||
int
|
||||
ddxProcessArgument (int argc, char **argv, int i)
|
||||
{
|
||||
return KdProcessArgument (argc, argv, i);
|
||||
}
|
||||
Loading…
Reference in a new issue