linux/drivers/video/fbdev/via/accel.h

/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
 * Copyright 1998-2008 VIA Technologies, Inc. All Rights Reserved.
 * Copyright 2001-2008 S3 Graphics, Inc. All Rights Reserved.

 */

#ifndef __ACCEL_H__
#define __ACCEL_H__

#define FB_ACCEL_VIA_UNICHROME

/* MMIO Base Address Definition */
#define MMIO_VGABASE
#define MMIO_CR_READ
#define MMIO_CR_WRITE
#define MMIO_SR_READ
#define MMIO_SR_WRITE

/* HW Cursor Status Define */
#define HW_Cursor_ON
#define HW_Cursor_OFF

#define CURSOR_SIZE
#define VQ_SIZE

#define VIA_MMIO_BLTBASE
#define VIA_MMIO_BLTSIZE

/* Defines for 2D registers */
#define VIA_REG_GECMD
#define VIA_REG_GEMODE
#define VIA_REG_SRCPOS
#define VIA_REG_DSTPOS
/* width and height */
#define VIA_REG_DIMENSION
#define VIA_REG_PATADDR
#define VIA_REG_FGCOLOR
#define VIA_REG_BGCOLOR
/* top and left of clipping */
#define VIA_REG_CLIPTL
/* bottom and right of clipping */
#define VIA_REG_CLIPBR
#define VIA_REG_OFFSET
/* color key control */
#define VIA_REG_KEYCONTROL
#define VIA_REG_SRCBASE
#define VIA_REG_DSTBASE
/* pitch of src and dst */
#define VIA_REG_PITCH
#define VIA_REG_MONOPAT0
#define VIA_REG_MONOPAT1
/* from 0x100 to 0x1ff */
#define VIA_REG_COLORPAT

/* defines for VIA 2D registers for vt3353/3409 (M1 engine)*/
#define VIA_REG_GECMD_M1
#define VIA_REG_GEMODE_M1
#define VIA_REG_GESTATUS_M1
#define VIA_REG_PITCH_M1
#define VIA_REG_DIMENSION_M1
#define VIA_REG_DSTPOS_M1
#define VIA_REG_LINE_XY_M1
#define VIA_REG_DSTBASE_M1
#define VIA_REG_SRCPOS_M1
#define VIA_REG_LINE_K1K2_M1
#define VIA_REG_SRCBASE_M1
#define VIA_REG_PATADDR_M1
#define VIA_REG_MONOPAT0_M1
#define VIA_REG_MONOPAT1_M1
#define VIA_REG_OFFSET_M1
#define VIA_REG_LINE_ERROR_M1
#define VIA_REG_CLIPTL_M1
#define VIA_REG_CLIPBR_M1
#define VIA_REG_KEYCONTROL_M1
#define VIA_REG_FGCOLOR_M1
#define VIA_REG_DSTCOLORKEY_M1
#define VIA_REG_BGCOLOR_M1
#define VIA_REG_SRCCOLORKEY_M1
#define VIA_REG_MONOPATFGC_M1
#define VIA_REG_MONOPATBGC_M1
#define VIA_REG_COLORPAT_M1

/* VIA_REG_PITCH(0x38): Pitch Setting */
#define VIA_PITCH_ENABLE

/* defines for VIA HW cursor registers */
#define VIA_REG_CURSOR_MODE
#define VIA_REG_CURSOR_POS
#define VIA_REG_CURSOR_ORG
#define VIA_REG_CURSOR_BG
#define VIA_REG_CURSOR_FG

/* VIA_REG_GEMODE(0x04): GE mode */
#define VIA_GEM_8bpp
#define VIA_GEM_16bpp
#define VIA_GEM_32bpp

/* VIA_REG_GECMD(0x00): 2D Engine Command  */
#define VIA_GEC_NOOP
#define VIA_GEC_BLT
#define VIA_GEC_LINE

/* Rotate Command */
#define VIA_GEC_ROT

#define VIA_GEC_SRC_XY
#define VIA_GEC_SRC_LINEAR
#define VIA_GEC_DST_XY
#define VIA_GEC_DST_LINRAT

#define VIA_GEC_SRC_FB
#define VIA_GEC_SRC_SYS
#define VIA_GEC_DST_FB
#define VIA_GEC_DST_SYS

/* source is mono */
#define VIA_GEC_SRC_MONO
/* pattern is mono */
#define VIA_GEC_PAT_MONO
/* mono src is opaque */
#define VIA_GEC_MSRC_OPAQUE
/* mono src is transparent */
#define VIA_GEC_MSRC_TRANS
/* pattern is in frame buffer */
#define VIA_GEC_PAT_FB
/* pattern is from reg setting */
#define VIA_GEC_PAT_REG

#define VIA_GEC_CLIP_DISABLE
#define VIA_GEC_CLIP_ENABLE

#define VIA_GEC_FIXCOLOR_PAT

#define VIA_GEC_INCX
#define VIA_GEC_DECY
#define VIA_GEC_INCY
#define VIA_GEC_DECX
/* mono pattern is opaque */
#define VIA_GEC_MPAT_OPAQUE
/* mono pattern is transparent */
#define VIA_GEC_MPAT_TRANS

#define VIA_GEC_MONO_UNPACK
#define VIA_GEC_MONO_PACK
#define VIA_GEC_MONO_DWORD
#define VIA_GEC_MONO_WORD
#define VIA_GEC_MONO_BYTE

#define VIA_GEC_LASTPIXEL_ON
#define VIA_GEC_LASTPIXEL_OFF
#define VIA_GEC_X_MAJOR
#define VIA_GEC_Y_MAJOR
#define VIA_GEC_QUICK_START

/* defines for VIA 3D registers */
#define VIA_REG_STATUS
#define VIA_REG_CR_TRANSET
#define VIA_REG_CR_TRANSPACE
#define VIA_REG_TRANSET
#define VIA_REG_TRANSPACE

/* VIA_REG_STATUS(0x400): Engine Status */

/* Command Regulator is busy */
#define VIA_CMD_RGTR_BUSY
/* 2D Engine is busy */
#define VIA_2D_ENG_BUSY
/* 3D Engine is busy */
#define VIA_3D_ENG_BUSY
/* Virtual Queue is busy */
#define VIA_VR_QUEUE_BUSY

/* VIA_REG_STATUS(0x400): Engine Status for H5 */
#define VIA_CMD_RGTR_BUSY_H5
#define VIA_2D_ENG_BUSY_H5
#define VIA_3D_ENG_BUSY_H5
#define VIA_VR_QUEUE_BUSY_H5

/* VIA_REG_STATUS(0x400): Engine Status for VT3353/3409 */
#define VIA_CMD_RGTR_BUSY_M1
#define VIA_2D_ENG_BUSY_M1
#define VIA_3D_ENG_BUSY_M1
#define VIA_VR_QUEUE_BUSY_M1

#define MAXLOOP

#define VIA_BITBLT_COLOR
#define VIA_BITBLT_MONO
#define VIA_BITBLT_FILL

int viafb_setup_engine(struct fb_info *info);
void viafb_reset_engine(struct viafb_par *viapar);
void viafb_show_hw_cursor(struct fb_info *info, int Status);
void viafb_wait_engine_idle(struct fb_info *info);

#endif /* __ACCEL_H__ */