linux/include/video/sstfb.h

/* SPDX-License-Identifier: GPL-2.0 */
/*
 * linux/drivers/video/sstfb.h -- voodoo graphics frame buffer
 *
 *     Copyright (c) 2000,2001 Ghozlane Toumi <[email protected]>
 *
 *     Created 28 Aug 2001 by Ghozlane Toumi
 */


#ifndef _SSTFB_H_
#define _SSTFB_H_

/*
 *
 *  Debug Stuff
 *
 */

#ifdef SST_DEBUG
#define dprintk
#define SST_DEBUG_REG
#define SST_DEBUG_FUNC
#define SST_DEBUG_VAR
#else
#define dprintk(X...)
#define SST_DEBUG_REG
#define SST_DEBUG_FUNC
#define SST_DEBUG_VAR
#endif

#if (SST_DEBUG_REG > 0)
#define r_dprintk
#else
#define r_dprintk(X...)
#endif
#if (SST_DEBUG_REG > 1)
#define r_ddprintk
#else
#define r_ddprintk(X...)
#endif

#if (SST_DEBUG_FUNC > 0)
#define f_dprintk
#else
#define f_dprintk(X...)
#endif
#if (SST_DEBUG_FUNC > 1)
#define f_ddprintk
#else
#define f_ddprintk(X...)
#endif
#if (SST_DEBUG_FUNC > 2)
#define f_dddprintk
#else
#define f_dddprintk(X...)
#endif

#if (SST_DEBUG_VAR > 0)
#define v_dprintk
#define print_var
#else
#define v_dprintk(X...)
#define print_var(X,Y...)
#endif

#define POW2(x)

/*
 *
 *  Const
 *
 */

/* pci stuff */
#define PCI_INIT_ENABLE
#define PCI_EN_INIT_WR
#define PCI_EN_FIFO_WR
#define PCI_REMAP_DAC
#define PCI_VCLK_ENABLE
#define PCI_VCLK_DISABLE

/* register offsets from memBaseAddr */
#define STATUS
#define STATUS_FBI_BUSY
#define FBZMODE
#define EN_CLIPPING
#define EN_RGB_WRITE
#define EN_ALPHA_WRITE
#define ENGINE_INVERT_Y
#define LFBMODE
#define LFB_565
#define LFB_888
#define LFB_8888
#define WR_BUFF_FRONT
#define WR_BUFF_BACK
#define RD_BUFF_FRONT
#define RD_BUFF_BACK
#define EN_PXL_PIPELINE
#define LFB_WORD_SWIZZLE_WR
#define LFB_BYTE_SWIZZLE_WR
#define LFB_INVERT_Y
#define LFB_WORD_SWIZZLE_RD
#define LFB_BYTE_SWIZZLE_RD
#define CLIP_LEFT_RIGHT
#define CLIP_LOWY_HIGHY
#define NOPCMD
#define FASTFILLCMD
#define SWAPBUFFCMD
#define FBIINIT4
#define FAST_PCI_READS
#define SLOW_PCI_READS
#define LFB_READ_AHEAD
#define BACKPORCH
#define VIDEODIMENSIONS
#define FBIINIT0
#define DIS_VGA_PASSTHROUGH
#define FBI_RESET
#define FIFO_RESET
#define FBIINIT1
#define VIDEO_MASK
#define FAST_PCI_WRITES
#define SLOW_PCI_WRITES
#define EN_LFB_READ
#define TILES_IN_X_SHIFT
#define VIDEO_RESET
#define EN_BLANKING
#define EN_DATA_OE
#define EN_BLANK_OE
#define EN_HVSYNC_OE
#define EN_DCLK_OE
#define SEL_INPUT_VCLK_2X
#define SEL_INPUT_VCLK_SLAVE
#define SEL_SOURCE_VCLK_SLAVE
#define SEL_SOURCE_VCLK_2X_DIV2
#define SEL_SOURCE_VCLK_2X_SEL
#define EN_24BPP
#define TILES_IN_X_MSB_SHIFT
#define VCLK_2X_SEL_DEL_SHIFT
#define VCLK_DEL_SHIFT
#define FBIINIT2
#define EN_FAST_RAS_READ
#define EN_DRAM_OE
#define EN_FAST_RD_AHEAD_WR
#define VIDEO_OFFSET_SHIFT
#define SWAP_DACVSYNC
#define SWAP_DACDATA0
#define SWAP_FIFO_STALL
#define EN_RD_AHEAD_FIFO
#define EN_DRAM_REFRESH
#define DRAM_REFRESH_16
#define DAC_READ
#define FBIINIT3
#define DISABLE_TEXTURE
#define Y_SWAP_ORIGIN_SHIFT
#define HSYNC
#define VSYNC
#define DAC_DATA
#define DAC_READ_CMD
#define FBIINIT5
#define FBIINIT5_MASK
#define HDOUBLESCAN
#define VDOUBLESCAN
#define HSYNC_HIGH
#define VSYNC_HIGH
#define INTERLACE
#define FBIINIT6
#define TILES_IN_X_LSB_SHIFT
#define FBIINIT7

#define BLTSRCBASEADDR
#define BLTDSTBASEADDR
#define BLTXYSTRIDES
#define BLTSRCCHROMARANGE
#define BLTDSTCHROMARANGE
#define BLTCLIPX
#define BLTCLIPY
#define BLTSRCXY
#define BLTDSTXY
#define BLTSIZE
#define BLTROP
#define BLTROP_COPY
#define BLTROP_INVERT
#define BLTROP_XOR
#define BLTCOLOR
#define BLTCOMMAND
#define BLT_SCR2SCR_BITBLT
#define BLT_CPU2SCR_BITBLT
#define BLT_RECFILL_BITBLT
#define BLT_16BPP_FMT
#define BLTDATA
#define LAUNCH_BITBLT

/* Dac Registers */
#define DACREG_WMA
#define DACREG_LUT
#define DACREG_RMR
#define DACREG_RMA
/*Dac registers in indexed mode (TI, ATT dacs) */
#define DACREG_ADDR_I
#define DACREG_DATA_I
#define DACREG_RMR_I
#define DACREG_CR0_I
#define DACREG_CR0_EN_INDEXED
#define DACREG_CR0_8BIT
#define DACREG_CR0_PWDOWN
#define DACREG_CR0_16BPP
#define DACREG_CR0_24BPP
#define DACREG_CR1_I
#define DACREG_CC_I
#define DACREG_CC_CLKA
#define DACREG_CC_CLKA_C
#define DACREG_CC_CLKB
#define DACREG_CC_CLKB_D
#define DACREG_AC0_I
#define DACREG_AC1_I
#define DACREG_BD0_I
#define DACREG_BD1_I

/* identification constants */
#define DACREG_MIR_TI
#define DACREG_DIR_TI
#define DACREG_MIR_ATT
#define DACREG_DIR_ATT
/* ics dac specific registers */
#define DACREG_ICS_PLLWMA
#define DACREG_ICS_PLLDATA
#define DACREG_ICS_CMD
#define DACREG_ICS_CMD_16BPP
#define DACREG_ICS_CMD_24BPP
#define DACREG_ICS_CMD_PWDOWN
#define DACREG_ICS_PLLRMA
/*
 * pll parameter register:
 * indexed : write addr to PLLWMA, write data in PLLDATA.
 * for reads use PLLRMA .
 * 8 freq registers (0-7) for video clock (CLK0)
 * 2 freq registers (a-b) for graphic clock (CLK1)
 */
#define DACREG_ICS_PLL_CLK0_1_INI
#define DACREG_ICS_PLL_CLK0_7_INI
#define DACREG_ICS_PLL_CLK1_B_INI
#define DACREG_ICS_PLL_CTRL
#define DACREG_ICS_CLK0
#define DACREG_ICS_CLK0_0
#define DACREG_ICS_CLK1_A

/* sst default init registers */
#define FBIINIT0_DEFAULT

#define FBIINIT1_DEFAULT

#define FBIINIT2_DEFAULT

#define FBIINIT3_DEFAULT

#define FBIINIT4_DEFAULT
/* Careful with this one : writing back the data just read will trash the DAC
   reading some fields give logic value on pins, but setting this field will
   set the source signal driving the pin. conclusion : just use the default
   as a base before writing back .
*/
#define FBIINIT6_DEFAULT

/*
 *
 * Misc Const
 *
 */

/* ioctl to enable/disable VGA passthrough */
#define SSTFB_SET_VGAPASS
#define SSTFB_GET_VGAPASS


/* used to know witch clock to set */
enum {};

/* freq max */
#define DAC_FREF
#define VCO_MAX

/*
 *  driver structs
 */

struct pll_timing {};

struct dac_switch {};

struct sst_spec {};

struct sstfb_par {};

#endif /* _SSTFB_H_ */