162306a36Sopenharmony_ci/*
262306a36Sopenharmony_ci *  linux/drivers/video/pm3fb.h -- 3DLabs Permedia3 frame buffer device
362306a36Sopenharmony_ci *
462306a36Sopenharmony_ci *  Copyright (C) 2001 Romain Dolbeau <dolbeau@irisa.fr>
562306a36Sopenharmony_ci *  Copyright (C) 2001 Sven Luther, <luther@dpt-info.u-strasbg.fr>
662306a36Sopenharmony_ci *
762306a36Sopenharmony_ci *  This file is subject to the terms and conditions of the GNU General Public
862306a36Sopenharmony_ci *  License. See the file COPYING in the main directory of this archive for
962306a36Sopenharmony_ci *  more details.
1062306a36Sopenharmony_ci */
1162306a36Sopenharmony_ci
1262306a36Sopenharmony_ci#ifndef PM3FB_H
1362306a36Sopenharmony_ci#define PM3FB_H
1462306a36Sopenharmony_ci
1562306a36Sopenharmony_ci/**********************************************
1662306a36Sopenharmony_ci*  GLINT Permedia3 Control Status registers   *
1762306a36Sopenharmony_ci***********************************************/
1862306a36Sopenharmony_ci/* Control Status Registers */
1962306a36Sopenharmony_ci#define PM3ResetStatus						0x0000
2062306a36Sopenharmony_ci#define PM3IntEnable						0x0008
2162306a36Sopenharmony_ci#define PM3IntFlags						0x0010
2262306a36Sopenharmony_ci#define PM3InFIFOSpace						0x0018
2362306a36Sopenharmony_ci#define PM3OutFIFOWords						0x0020
2462306a36Sopenharmony_ci#define PM3DMAAddress						0x0028
2562306a36Sopenharmony_ci#define PM3DMACount						0x0030
2662306a36Sopenharmony_ci#define PM3ErrorFlags						0x0038
2762306a36Sopenharmony_ci#define PM3VClkCtl						0x0040
2862306a36Sopenharmony_ci#define PM3TestRegister						0x0048
2962306a36Sopenharmony_ci#define PM3Aperture0						0x0050
3062306a36Sopenharmony_ci#define PM3Aperture1						0x0058
3162306a36Sopenharmony_ci#define PM3DMAControl						0x0060
3262306a36Sopenharmony_ci#define PM3FIFODis						0x0068
3362306a36Sopenharmony_ci#define PM3ChipConfig						0x0070
3462306a36Sopenharmony_ci#define PM3AGPControl						0x0078
3562306a36Sopenharmony_ci
3662306a36Sopenharmony_ci#define PM3GPOutDMAAddress					0x0080
3762306a36Sopenharmony_ci#define PM3PCIFeedbackCount					0x0088
3862306a36Sopenharmony_ci#define PM3PCIAbortStatus					0x0090
3962306a36Sopenharmony_ci#define PM3PCIAbortAddress					0x0098
4062306a36Sopenharmony_ci
4162306a36Sopenharmony_ci#define PM3PCIPLLStatus						0x00f0
4262306a36Sopenharmony_ci
4362306a36Sopenharmony_ci#define PM3HostTextureAddress					0x0100
4462306a36Sopenharmony_ci#define PM3TextureDownloadControl				0x0108
4562306a36Sopenharmony_ci#define PM3TextureOperation					0x0110
4662306a36Sopenharmony_ci#define PM3LogicalTexturePage					0x0118
4762306a36Sopenharmony_ci#define PM3TexDMAAddress					0x0120
4862306a36Sopenharmony_ci#define PM3TexFIFOSpace						0x0128
4962306a36Sopenharmony_ci
5062306a36Sopenharmony_ci/**********************************************
5162306a36Sopenharmony_ci*  GLINT Permedia3 Region 0 Bypass Controls   *
5262306a36Sopenharmony_ci***********************************************/
5362306a36Sopenharmony_ci#define PM3ByAperture1Mode					0x0300
5462306a36Sopenharmony_ci	#define PM3ByApertureMode_BYTESWAP_ABCD			(0 << 0)
5562306a36Sopenharmony_ci	#define PM3ByApertureMode_BYTESWAP_BADC			(1 << 0)
5662306a36Sopenharmony_ci	#define PM3ByApertureMode_BYTESWAP_CDAB			(2 << 0)
5762306a36Sopenharmony_ci	#define PM3ByApertureMode_BYTESWAP_DCBA			(3 << 0)
5862306a36Sopenharmony_ci	#define PM3ByApertureMode_PATCH_ENABLE			(1 << 2)
5962306a36Sopenharmony_ci	#define PM3ByApertureMode_FORMAT_RAW			(0 << 3)
6062306a36Sopenharmony_ci	#define PM3ByApertureMode_FORMAT_YUYV			(1 << 3)
6162306a36Sopenharmony_ci	#define PM3ByApertureMode_FORMAT_UYVY			(2 << 3)
6262306a36Sopenharmony_ci	#define PM3ByApertureMode_PIXELSIZE_8BIT		(0 << 5)
6362306a36Sopenharmony_ci	#define PM3ByApertureMode_PIXELSIZE_16BIT		(1 << 5)
6462306a36Sopenharmony_ci	#define PM3ByApertureMode_PIXELSIZE_32BIT		(2 << 5)
6562306a36Sopenharmony_ci		#define PM3ByApertureMode_PIXELSIZE_MASK	(3 << 5)
6662306a36Sopenharmony_ci	#define PM3ByApertureMode_EFFECTIVE_STRIDE_1024		(0 << 7)
6762306a36Sopenharmony_ci	#define PM3ByApertureMode_EFFECTIVE_STRIDE_2048		(1 << 7)
6862306a36Sopenharmony_ci	#define PM3ByApertureMode_EFFECTIVE_STRIDE_4096		(2 << 7)
6962306a36Sopenharmony_ci	#define PM3ByApertureMode_EFFECTIVE_STRIDE_8192		(3 << 7)
7062306a36Sopenharmony_ci	#define PM3ByApertureMode_PATCH_OFFSET_X(off)	(((off) & 0x7f) << 9)
7162306a36Sopenharmony_ci	#define PM3ByApertureMode_PATCH_OFFSET_Y(off)	(((off) & 0x7f) << 16)
7262306a36Sopenharmony_ci	#define PM3ByApertureMode_FRAMEBUFFER			(0 << 21)
7362306a36Sopenharmony_ci	#define PM3ByApertureMode_LOCALBUFFER			(1 << 21)
7462306a36Sopenharmony_ci	#define PM3ByApertureMode_DOUBLE_WRITE_OFF		(0 << 22)
7562306a36Sopenharmony_ci	#define PM3ByApertureMode_DOUBLE_WRITE_1MB		(1 << 22)
7662306a36Sopenharmony_ci	#define PM3ByApertureMode_DOUBLE_WRITE_2MB		(2 << 22)
7762306a36Sopenharmony_ci	#define PM3ByApertureMode_DOUBLE_WRITE_4MB		(3 << 22)
7862306a36Sopenharmony_ci	#define PM3ByApertureMode_DOUBLE_WRITE_8MB		(4 << 22)
7962306a36Sopenharmony_ci	#define PM3ByApertureMode_DOUBLE_WRITE_16MB		(5 << 22)
8062306a36Sopenharmony_ci	#define PM3ByApertureMode_DOUBLE_WRITE_32MB		(6 << 22)
8162306a36Sopenharmony_ci
8262306a36Sopenharmony_ci#define PM3ByAperture2Mode					0x0328
8362306a36Sopenharmony_ci
8462306a36Sopenharmony_ci/**********************************************
8562306a36Sopenharmony_ci*  GLINT Permedia3 Memory Control (0x1000)    *
8662306a36Sopenharmony_ci***********************************************/
8762306a36Sopenharmony_ci#define PM3MemCounter						0x1000
8862306a36Sopenharmony_ci#define PM3MemBypassWriteMask					0x1008
8962306a36Sopenharmony_ci#define PM3MemScratch						0x1010
9062306a36Sopenharmony_ci#define PM3LocalMemCaps						0x1018
9162306a36Sopenharmony_ci	#define PM3LocalMemCaps_NoWriteMask			(1 << 28)
9262306a36Sopenharmony_ci#define PM3LocalMemTimings					0x1020
9362306a36Sopenharmony_ci#define PM3LocalMemControl					0x1028
9462306a36Sopenharmony_ci#define PM3LocalMemRefresh					0x1030
9562306a36Sopenharmony_ci#define PM3LocalMemPowerDown					0x1038
9662306a36Sopenharmony_ci#define PM3RemoteMemControl					0x1100
9762306a36Sopenharmony_ci
9862306a36Sopenharmony_ci/**********************************************
9962306a36Sopenharmony_ci*  GLINT Permedia3 Video Control (0x3000)     *
10062306a36Sopenharmony_ci***********************************************/
10162306a36Sopenharmony_ci
10262306a36Sopenharmony_ci#define PM3ScreenBase						0x3000
10362306a36Sopenharmony_ci#define PM3ScreenStride						0x3008
10462306a36Sopenharmony_ci#define PM3HTotal						0x3010
10562306a36Sopenharmony_ci#define PM3HgEnd						0x3018
10662306a36Sopenharmony_ci#define PM3HbEnd						0x3020
10762306a36Sopenharmony_ci#define PM3HsStart						0x3028
10862306a36Sopenharmony_ci#define PM3HsEnd						0x3030
10962306a36Sopenharmony_ci#define PM3VTotal						0x3038
11062306a36Sopenharmony_ci#define PM3VbEnd						0x3040
11162306a36Sopenharmony_ci#define PM3VsStart						0x3048
11262306a36Sopenharmony_ci#define PM3VsEnd						0x3050
11362306a36Sopenharmony_ci#define PM3VideoControl						0x3058
11462306a36Sopenharmony_ci	#define PM3VideoControl_ENABLE				(1 << 0)
11562306a36Sopenharmony_ci	#define PM3VideoControl_BLANK_ACTIVE_HIGH		(0 << 1)
11662306a36Sopenharmony_ci	#define PM3VideoControl_BLANK_ACTIVE_LOW		(1 << 1)
11762306a36Sopenharmony_ci	#define PM3VideoControl_LINE_DOUBLE_OFF			(0 << 2)
11862306a36Sopenharmony_ci	#define PM3VideoControl_LINE_DOUBLE_ON			(1 << 2)
11962306a36Sopenharmony_ci	#define PM3VideoControl_HSYNC_FORCE_HIGH		(0 << 3)
12062306a36Sopenharmony_ci	#define PM3VideoControl_HSYNC_ACTIVE_HIGH		(1 << 3)
12162306a36Sopenharmony_ci	#define PM3VideoControl_HSYNC_FORCE_LOW			(2 << 3)
12262306a36Sopenharmony_ci	#define PM3VideoControl_HSYNC_ACTIVE_LOW		(3 << 3)
12362306a36Sopenharmony_ci	#define PM3VideoControl_HSYNC_MASK			(3 << 3)
12462306a36Sopenharmony_ci	#define PM3VideoControl_VSYNC_FORCE_HIGH		(0 << 5)
12562306a36Sopenharmony_ci	#define PM3VideoControl_VSYNC_ACTIVE_HIGH		(1 << 5)
12662306a36Sopenharmony_ci	#define PM3VideoControl_VSYNC_FORCE_LOW			(2 << 5)
12762306a36Sopenharmony_ci	#define PM3VideoControl_VSYNC_ACTIVE_LOW		(3 << 5)
12862306a36Sopenharmony_ci	#define PM3VideoControl_VSYNC_MASK			(3 << 5)
12962306a36Sopenharmony_ci	#define PM3VideoControl_BYTE_DOUBLE_OFF			(0 << 7)
13062306a36Sopenharmony_ci	#define PM3VideoControl_BYTE_DOUBLE_ON			(1 << 7)
13162306a36Sopenharmony_ci	#define PM3VideoControl_BUFFER_SWAP_SYNCON_FRAMEBLANK	(0 << 9)
13262306a36Sopenharmony_ci	#define PM3VideoControl_BUFFER_SWAP_FREE_RUNNING	(1 << 9)
13362306a36Sopenharmony_ci	#define PM3VideoControl_BUFFER_SWAP_LIMITETO_FRAMERATE	(2 << 9)
13462306a36Sopenharmony_ci	#define PM3VideoControl_STEREO_ENABLE			(1 << 11)
13562306a36Sopenharmony_ci	#define PM3VideoControl_RIGHT_EYE_ACTIVE_HIGH		(0 << 12)
13662306a36Sopenharmony_ci	#define PM3VideoControl_RIGHT_EYE_ACTIVE_LOW		(1 << 12)
13762306a36Sopenharmony_ci	#define PM3VideoControl_VIDEO_EXT_LOW			(0 << 14)
13862306a36Sopenharmony_ci	#define PM3VideoControl_VIDEO_EXT_HIGH			(1 << 14)
13962306a36Sopenharmony_ci	#define PM3VideoControl_SYNC_MODE_INDEPENDENT		(0 << 16)
14062306a36Sopenharmony_ci	#define PM3VideoControl_SYNC_MODE_SYNCTO_VSA		(1 << 16)
14162306a36Sopenharmony_ci	#define PM3VideoControl_SYNC_MODE_SYNCTO_VSB		(2 << 16)
14262306a36Sopenharmony_ci	#define PM3VideoControl_PATCH_ENABLE			(1 << 18)
14362306a36Sopenharmony_ci	#define PM3VideoControl_PIXELSIZE_8BIT			(0 << 19)
14462306a36Sopenharmony_ci	#define PM3VideoControl_PIXELSIZE_16BIT			(1 << 19)
14562306a36Sopenharmony_ci	#define PM3VideoControl_PIXELSIZE_32BIT			(2 << 19)
14662306a36Sopenharmony_ci	#define PM3VideoControl_DISPLAY_ENABLE			(1 << 21)
14762306a36Sopenharmony_ci	#define PM3VideoControl_PATCH_OFFSET_X(off)	(((off) & 0x3f) << 22)
14862306a36Sopenharmony_ci	#define PM3VideoControl_PATCH_OFFSET_Y(off)	(((off) & 0x3f) << 28)
14962306a36Sopenharmony_ci#define PM3InterruptLine					0x3060
15062306a36Sopenharmony_ci#define PM3DisplayData						0x3068
15162306a36Sopenharmony_ci#define PM3VerticalLineCount					0x3070
15262306a36Sopenharmony_ci#define PM3FifoControl						0x3078
15362306a36Sopenharmony_ci#define PM3ScreenBaseRight					0x3080
15462306a36Sopenharmony_ci#define PM3MiscControl						0x3088
15562306a36Sopenharmony_ci
15662306a36Sopenharmony_ci#define PM3VideoOverlayUpdate					0x3100
15762306a36Sopenharmony_ci	#define PM3VideoOverlayUpdate_ENABLE			(1 << 0)
15862306a36Sopenharmony_ci#define PM3VideoOverlayMode					0x3108
15962306a36Sopenharmony_ci	#define PM3VideoOverlayMode_ENABLE			(1 << 0)
16062306a36Sopenharmony_ci	#define PM3VideoOverlayMode_BUFFERSYNC_MANUAL		(0 << 1)
16162306a36Sopenharmony_ci	#define PM3VideoOverlayMode_BUFFERSYNC_VIDEOSTREAMA	(1 << 1)
16262306a36Sopenharmony_ci	#define PM3VideoOverlayMode_BUFFERSYNC_VIDEOSTREAMB	(2 << 1)
16362306a36Sopenharmony_ci	#define PM3VideoOverlayMode_FIELDPOLARITY_NORMAL	(0 << 4)
16462306a36Sopenharmony_ci	#define PM3VideoOverlayMode_FIELDPOLARITY_INVERT	(1 << 4)
16562306a36Sopenharmony_ci	#define PM3VideoOverlayMode_PIXELSIZE_8BIT		(0 << 5)
16662306a36Sopenharmony_ci	#define PM3VideoOverlayMode_PIXELSIZE_16BIT		(1 << 5)
16762306a36Sopenharmony_ci	#define PM3VideoOverlayMode_PIXELSIZE_32BIT		(2 << 5)
16862306a36Sopenharmony_ci	#define PM3VideoOverlayMode_COLORFORMAT_RGB8888		\
16962306a36Sopenharmony_ci					((0 << 7)|(1 << 12)|(2 << 5))
17062306a36Sopenharmony_ci	#define PM3VideoOverlayMode_COLORFORMAT_RGB4444		\
17162306a36Sopenharmony_ci					((1 << 7)|(1 << 12)|(1 << 5))
17262306a36Sopenharmony_ci	#define PM3VideoOverlayMode_COLORFORMAT_RGB5551		\
17362306a36Sopenharmony_ci					((2 << 7)|(1 << 12)|(1 << 5))
17462306a36Sopenharmony_ci	#define PM3VideoOverlayMode_COLORFORMAT_RGB565		\
17562306a36Sopenharmony_ci					((3 << 7)|(1 << 12)|(1 << 5))
17662306a36Sopenharmony_ci	#define PM3VideoOverlayMode_COLORFORMAT_RGB332		\
17762306a36Sopenharmony_ci					((4 << 7)|(1 << 12)|(0 << 5))
17862306a36Sopenharmony_ci	#define PM3VideoOverlayMode_COLORFORMAT_BGR8888		\
17962306a36Sopenharmony_ci					((0 << 7)|(2 << 5))
18062306a36Sopenharmony_ci	#define PM3VideoOverlayMode_COLORFORMAT_BGR4444		\
18162306a36Sopenharmony_ci					((1 << 7)|(1 << 5))
18262306a36Sopenharmony_ci	#define PM3VideoOverlayMode_COLORFORMAT_BGR5551		\
18362306a36Sopenharmony_ci					((2 << 7)|(1 << 5))
18462306a36Sopenharmony_ci	#define PM3VideoOverlayMode_COLORFORMAT_BGR565		\
18562306a36Sopenharmony_ci					((3 << 7)|(1 << 5))
18662306a36Sopenharmony_ci	#define PM3VideoOverlayMode_COLORFORMAT_BGR332		\
18762306a36Sopenharmony_ci					((4 << 7)|(0 << 5))
18862306a36Sopenharmony_ci	#define PM3VideoOverlayMode_COLORFORMAT_CI8		\
18962306a36Sopenharmony_ci					((5 << 7)|(1 << 12)|(0 << 5))
19062306a36Sopenharmony_ci	#define PM3VideoOverlayMode_COLORFORMAT_VUY444		\
19162306a36Sopenharmony_ci					((2 << 10)|(1 << 12)|(2 << 5))
19262306a36Sopenharmony_ci	#define PM3VideoOverlayMode_COLORFORMAT_YUV444		\
19362306a36Sopenharmony_ci					((2 << 10)|(2 << 5))
19462306a36Sopenharmony_ci	#define PM3VideoOverlayMode_COLORFORMAT_VUY422		\
19562306a36Sopenharmony_ci					((1 << 10)|(1 << 12)|(1 << 5))
19662306a36Sopenharmony_ci	#define PM3VideoOverlayMode_COLORFORMAT_YUV422		\
19762306a36Sopenharmony_ci					((1 << 10)|(1 << 5))
19862306a36Sopenharmony_ci	#define PM3VideoOverlayMode_COLORORDER_BGR		(0 << 12)
19962306a36Sopenharmony_ci	#define PM3VideoOverlayMode_COLORORDER_RGB		(1 << 12)
20062306a36Sopenharmony_ci	#define PM3VideoOverlayMode_LINEARCOLOREXT_OFF		(0 << 13)
20162306a36Sopenharmony_ci	#define PM3VideoOverlayMode_LINEARCOLOREXT_ON		(1 << 13)
20262306a36Sopenharmony_ci	#define PM3VideoOverlayMode_FILTER_MASK			(3 << 14)
20362306a36Sopenharmony_ci	#define PM3VideoOverlayMode_FILTER_OFF			(0 << 14)
20462306a36Sopenharmony_ci	#define PM3VideoOverlayMode_FILTER_FULL			(1 << 14)
20562306a36Sopenharmony_ci	#define PM3VideoOverlayMode_FILTER_PARTIAL		(2 << 14)
20662306a36Sopenharmony_ci	#define PM3VideoOverlayMode_DEINTERLACE_OFF		(0 << 16)
20762306a36Sopenharmony_ci	#define PM3VideoOverlayMode_DEINTERLACE_BOB		(1 << 16)
20862306a36Sopenharmony_ci	#define PM3VideoOverlayMode_PATCHMODE_OFF		(0 << 18)
20962306a36Sopenharmony_ci	#define PM3VideoOverlayMode_PATCHMODE_ON		(1 << 18)
21062306a36Sopenharmony_ci	#define PM3VideoOverlayMode_FLIP_VIDEO			(0 << 20)
21162306a36Sopenharmony_ci	#define PM3VideoOverlayMode_FLIP_VIDEOSTREAMA		(1 << 20)
21262306a36Sopenharmony_ci	#define PM3VideoOverlayMode_FLIP_VIDEOSTREAMB		(2 << 20)
21362306a36Sopenharmony_ci	#define PM3VideoOverlayMode_MIRROR_MASK			(3 << 23)
21462306a36Sopenharmony_ci	#define PM3VideoOverlayMode_MIRRORX_OFF			(0 << 23)
21562306a36Sopenharmony_ci	#define PM3VideoOverlayMode_MIRRORX_ON			(1 << 23)
21662306a36Sopenharmony_ci	#define PM3VideoOverlayMode_MIRRORY_OFF			(0 << 24)
21762306a36Sopenharmony_ci	#define PM3VideoOverlayMode_MIRRORY_ON			(1 << 24)
21862306a36Sopenharmony_ci#define PM3VideoOverlayFifoControl				0x3110
21962306a36Sopenharmony_ci#define PM3VideoOverlayIndex					0x3118
22062306a36Sopenharmony_ci#define PM3VideoOverlayBase0					0x3120
22162306a36Sopenharmony_ci#define PM3VideoOverlayBase1					0x3128
22262306a36Sopenharmony_ci#define PM3VideoOverlayBase2					0x3130
22362306a36Sopenharmony_ci#define PM3VideoOverlayStride					0x3138
22462306a36Sopenharmony_ci	#define PM3VideoOverlayStride_STRIDE(s)		(((s) & 0xfff) << 0)
22562306a36Sopenharmony_ci#define PM3VideoOverlayWidth					0x3140
22662306a36Sopenharmony_ci	#define PM3VideoOverlayWidth_WIDTH(w)		(((w) & 0xfff) << 0)
22762306a36Sopenharmony_ci#define PM3VideoOverlayHeight					0x3148
22862306a36Sopenharmony_ci	#define PM3VideoOverlayHeight_HEIGHT(h)		(((h) & 0xfff) << 0)
22962306a36Sopenharmony_ci#define PM3VideoOverlayOrigin					0x3150
23062306a36Sopenharmony_ci	#define PM3VideoOverlayOrigin_XORIGIN(x)	(((x) & 0xfff) << 0)
23162306a36Sopenharmony_ci	#define PM3VideoOverlayOrigin_YORIGIN(y)	(((y) & 0xfff) << 16)
23262306a36Sopenharmony_ci#define PM3VideoOverlayShrinkXDelta				0x3158
23362306a36Sopenharmony_ci	#define PM3VideoOverlayShrinkXDelta_NONE		(1 << 16)
23462306a36Sopenharmony_ci	#define PM3VideoOverlayShrinkXDelta_DELTA(s,d)	\
23562306a36Sopenharmony_ci		((((s) << 16)/(d)) & 0x0ffffff0)
23662306a36Sopenharmony_ci#define PM3VideoOverlayZoomXDelta				0x3160
23762306a36Sopenharmony_ci	#define PM3VideoOverlayZoomXDelta_NONE			(1 << 16)
23862306a36Sopenharmony_ci	#define PM3VideoOverlayZoomXDelta_DELTA(s,d)	\
23962306a36Sopenharmony_ci		((((s) << 16)/(d)) & 0x0001fff0)
24062306a36Sopenharmony_ci#define PM3VideoOverlayYDelta					0x3168
24162306a36Sopenharmony_ci	#define PM3VideoOverlayYDelta_NONE			(1 << 16)
24262306a36Sopenharmony_ci	#define PM3VideoOverlayYDelta_DELTA(s,d)	\
24362306a36Sopenharmony_ci		((((s) << 16)/(d)) & 0x0ffffff0)
24462306a36Sopenharmony_ci#define PM3VideoOverlayFieldOffset				0x3170
24562306a36Sopenharmony_ci#define PM3VideoOverlayStatus					0x3178
24662306a36Sopenharmony_ci
24762306a36Sopenharmony_ci/**********************************************
24862306a36Sopenharmony_ci*  GLINT Permedia3 RAMDAC Registers (0x4000)  *
24962306a36Sopenharmony_ci***********************************************/
25062306a36Sopenharmony_ci/* Direct Registers */
25162306a36Sopenharmony_ci#define PM3RD_PaletteWriteAddress				0x4000
25262306a36Sopenharmony_ci#define PM3RD_PaletteData					0x4008
25362306a36Sopenharmony_ci#define PM3RD_PixelMask						0x4010
25462306a36Sopenharmony_ci#define PM3RD_PaletteReadAddress				0x4018
25562306a36Sopenharmony_ci
25662306a36Sopenharmony_ci#define PM3RD_IndexLow						0x4020
25762306a36Sopenharmony_ci#define PM3RD_IndexHigh						0x4028
25862306a36Sopenharmony_ci#define PM3RD_IndexedData					0x4030
25962306a36Sopenharmony_ci#define PM3RD_IndexControl					0x4038
26062306a36Sopenharmony_ci	#define PM3RD_IndexControl_AUTOINCREMENT_ENABLE		(1 << 0)
26162306a36Sopenharmony_ci
26262306a36Sopenharmony_ci/* Indirect Registers */
26362306a36Sopenharmony_ci#define PM3RD_MiscControl					0x000
26462306a36Sopenharmony_ci	#define PM3RD_MiscControl_HIGHCOLOR_RES_ENABLE		(1 << 0)
26562306a36Sopenharmony_ci	#define PM3RD_MiscControl_PIXELDOUBLE_ENABLE		(1 << 1)
26662306a36Sopenharmony_ci	#define PM3RD_MiscControl_LASTREAD_ADDR_ENABLE		(1 << 2)
26762306a36Sopenharmony_ci	#define PM3RD_MiscControl_DIRECTCOLOR_ENABLE		(1 << 3)
26862306a36Sopenharmony_ci	#define PM3RD_MiscControl_OVERLAY_ENABLE		(1 << 4)
26962306a36Sopenharmony_ci	#define PM3RD_MiscControl_PIXELDOUBLE_BUFFER_ENABLE	(1 << 5)
27062306a36Sopenharmony_ci	#define PM3RD_MiscControl_VSB_OUTPUT_ENABLE		(1 << 6)
27162306a36Sopenharmony_ci	#define PM3RD_MiscControl_STEREODOUBLE_BUFFER_ENABLE	(1 << 7)
27262306a36Sopenharmony_ci#define PM3RD_SyncControl					0x001
27362306a36Sopenharmony_ci	#define PM3RD_SyncControl_HSYNC_ACTIVE_LOW		(0 << 0)
27462306a36Sopenharmony_ci	#define PM3RD_SyncControl_HSYNC_ACTIVE_HIGH		(1 << 0)
27562306a36Sopenharmony_ci	#define PM3RD_SyncControl_HSYNC_FORCE_ACTIVE		(3 << 0)
27662306a36Sopenharmony_ci	#define PM3RD_SyncControl_HSYNC_FORCE_INACTIVE		(4 << 0)
27762306a36Sopenharmony_ci	#define PM3RD_SyncControl_HSYNC_TRI_STATE		(2 << 0)
27862306a36Sopenharmony_ci	#define PM3RD_SyncControl_VSYNC_ACTIVE_LOW		(0 << 3)
27962306a36Sopenharmony_ci	#define PM3RD_SyncControl_VSYNC_ACTIVE_HIGH		(1 << 3)
28062306a36Sopenharmony_ci	#define PM3RD_SyncControl_VSYNC_TRI_STATE		(2 << 3)
28162306a36Sopenharmony_ci	#define PM3RD_SyncControl_VSYNC_FORCE_ACTIVE		(3 << 3)
28262306a36Sopenharmony_ci	#define PM3RD_SyncControl_VSYNC_FORCE_INACTIVE		(4 << 3)
28362306a36Sopenharmony_ci	#define PM3RD_SyncControl_HSYNC_OVERRIDE_SETBY_HSYNC	(0 << 6)
28462306a36Sopenharmony_ci	#define PM3RD_SyncControl_HSYNC_OVERRIDE_FORCE_HIGH	(1 << 6)
28562306a36Sopenharmony_ci	#define PM3RD_SyncControl_VSYNC_OVERRIDE_SETBY_VSYNC	(0 << 7)
28662306a36Sopenharmony_ci	#define PM3RD_SyncControl_VSYNC_OVERRIDE_FORCE_HIGH	(1 << 7)
28762306a36Sopenharmony_ci#define PM3RD_DACControl					0x002
28862306a36Sopenharmony_ci	#define PM3RD_DACControl_DAC_POWER_ON			(0 << 0)
28962306a36Sopenharmony_ci	#define PM3RD_DACControl_DAC_POWER_OFF			(1 << 0)
29062306a36Sopenharmony_ci	#define PM3RD_DACControl_SYNC_ON_GREEN_ENABLE		(1 << 3)
29162306a36Sopenharmony_ci	#define PM3RD_DACControl_BLANK_RED_DAC_ENABLE		(1 << 4)
29262306a36Sopenharmony_ci	#define PM3RD_DACControl_BLANK_GREEN_DAC_ENABLE		(1 << 5)
29362306a36Sopenharmony_ci	#define PM3RD_DACControl_BLANK_BLUE_DAC_ENABLE		(1 << 6)
29462306a36Sopenharmony_ci	#define PM3RD_DACControl_BLANK_PEDESTAL_ENABLE		(1 << 7)
29562306a36Sopenharmony_ci#define PM3RD_PixelSize						0x003
29662306a36Sopenharmony_ci	#define PM3RD_PixelSize_24_BIT_PIXELS			(4 << 0)
29762306a36Sopenharmony_ci	#define PM3RD_PixelSize_32_BIT_PIXELS			(2 << 0)
29862306a36Sopenharmony_ci	#define PM3RD_PixelSize_16_BIT_PIXELS			(1 << 0)
29962306a36Sopenharmony_ci	#define PM3RD_PixelSize_8_BIT_PIXELS			(0 << 0)
30062306a36Sopenharmony_ci#define PM3RD_ColorFormat					0x004
30162306a36Sopenharmony_ci	#define PM3RD_ColorFormat_LINEAR_COLOR_EXT_ENABLE	(1 << 6)
30262306a36Sopenharmony_ci	#define PM3RD_ColorFormat_COLOR_ORDER_BLUE_LOW		(1 << 5)
30362306a36Sopenharmony_ci	#define PM3RD_ColorFormat_COLOR_ORDER_RED_LOW		(0 << 5)
30462306a36Sopenharmony_ci	#define PM3RD_ColorFormat_COLOR_FORMAT_MASK		(0x1f << 0)
30562306a36Sopenharmony_ci	#define PM3RD_ColorFormat_8888_COLOR			(0 << 0)
30662306a36Sopenharmony_ci	#define PM3RD_ColorFormat_5551_FRONT_COLOR		(1 << 0)
30762306a36Sopenharmony_ci	#define PM3RD_ColorFormat_4444_COLOR			(2 << 0)
30862306a36Sopenharmony_ci	#define PM3RD_ColorFormat_332_FRONT_COLOR		(5 << 0)
30962306a36Sopenharmony_ci	#define PM3RD_ColorFormat_332_BACK_COLOR		(6 << 0)
31062306a36Sopenharmony_ci	#define PM3RD_ColorFormat_2321_FRONT_COLOR		(9 << 0)
31162306a36Sopenharmony_ci	#define PM3RD_ColorFormat_2321_BACK_COLOR		(10 << 0)
31262306a36Sopenharmony_ci	#define PM3RD_ColorFormat_232_FRONTOFF_COLOR		(11 << 0)
31362306a36Sopenharmony_ci	#define PM3RD_ColorFormat_232_BACKOFF_COLOR		(12 << 0)
31462306a36Sopenharmony_ci	#define PM3RD_ColorFormat_5551_BACK_COLOR		(13 << 0)
31562306a36Sopenharmony_ci	#define PM3RD_ColorFormat_CI8_COLOR			(14 << 0)
31662306a36Sopenharmony_ci	#define PM3RD_ColorFormat_565_FRONT_COLOR		(16 << 0)
31762306a36Sopenharmony_ci	#define PM3RD_ColorFormat_565_BACK_COLOR		(17 << 0)
31862306a36Sopenharmony_ci#define PM3RD_CursorMode					0x005
31962306a36Sopenharmony_ci	#define PM3RD_CursorMode_CURSOR_ENABLE			(1 << 0)
32062306a36Sopenharmony_ci	#define PM3RD_CursorMode_FORMAT_64x64_2BPE_P0123	(0 << 2)
32162306a36Sopenharmony_ci	#define PM3RD_CursorMode_FORMAT_32x32_2BPE_P0		(1 << 2)
32262306a36Sopenharmony_ci	#define PM3RD_CursorMode_FORMAT_32x32_2BPE_P1		(2 << 2)
32362306a36Sopenharmony_ci	#define PM3RD_CursorMode_FORMAT_32x32_2BPE_P2		(3 << 2)
32462306a36Sopenharmony_ci	#define PM3RD_CursorMode_FORMAT_32x32_2BPE_P3		(4 << 2)
32562306a36Sopenharmony_ci	#define PM3RD_CursorMode_FORMAT_32x32_4BPE_P01		(5 << 2)
32662306a36Sopenharmony_ci	#define PM3RD_CursorMode_FORMAT_32x32_4BPE_P23		(6 << 2)
32762306a36Sopenharmony_ci	#define PM3RD_CursorMode_TYPE_MS			(0 << 4)
32862306a36Sopenharmony_ci	#define PM3RD_CursorMode_TYPE_X				(1 << 4)
32962306a36Sopenharmony_ci	#define PM3RD_CursorMode_REVERSE_PIXEL_ORDER_ENABLE	(1 << 6)
33062306a36Sopenharmony_ci	#define PM3RD_CursorMode_REVERSE_PIXEL_ORDER_3_COLOR	(2 << 6)
33162306a36Sopenharmony_ci	#define PM3RD_CursorMode_REVERSE_PIXEL_ORDER_15_COLOR	(3 << 6)
33262306a36Sopenharmony_ci#define PM3RD_CursorControl					0x006
33362306a36Sopenharmony_ci	#define PM3RD_CursorControl_DOUBLE_X_ENABLED		(1 << 0)
33462306a36Sopenharmony_ci	#define PM3RD_CursorControl_DOUBLE_Y_ENABLED		(1 << 1)
33562306a36Sopenharmony_ci	#define PM3RD_CursorControl_READBACK_POS_ENABLED	(1 << 2)
33662306a36Sopenharmony_ci
33762306a36Sopenharmony_ci#define PM3RD_CursorXLow					0x007
33862306a36Sopenharmony_ci#define PM3RD_CursorXHigh					0x008
33962306a36Sopenharmony_ci#define PM3RD_CursorYLow					0x009
34062306a36Sopenharmony_ci#define PM3RD_CursorYHigh					0x00a
34162306a36Sopenharmony_ci#define PM3RD_CursorHotSpotX					0x00b
34262306a36Sopenharmony_ci#define PM3RD_CursorHotSpotY					0x00c
34362306a36Sopenharmony_ci#define PM3RD_OverlayKey					0x00d
34462306a36Sopenharmony_ci#define PM3RD_Pan						0x00e
34562306a36Sopenharmony_ci	#define PM3RD_Pan_ENABLE				(1 << 0)
34662306a36Sopenharmony_ci	#define PM3RD_Pan_GATE_ENABLE				(1 << 1)
34762306a36Sopenharmony_ci#define PM3RD_Sense						0x00f
34862306a36Sopenharmony_ci
34962306a36Sopenharmony_ci#define PM3RD_CheckControl					0x018
35062306a36Sopenharmony_ci	#define PM3RD_CheckControl_PIXEL_ENABLED		(1 << 0)
35162306a36Sopenharmony_ci	#define PM3RD_CheckControl_LUT_ENABLED			(1 << 1)
35262306a36Sopenharmony_ci#define PM3RD_CheckPixelRed					0x019
35362306a36Sopenharmony_ci#define PM3RD_CheckPixelGreen					0x01a
35462306a36Sopenharmony_ci#define PM3RD_CheckPixelBlue					0x01b
35562306a36Sopenharmony_ci#define PM3RD_CheckLUTRed					0x01c
35662306a36Sopenharmony_ci#define PM3RD_CheckLUTGreen					0x01d
35762306a36Sopenharmony_ci#define PM3RD_CheckLUTBlue					0x01e
35862306a36Sopenharmony_ci#define PM3RD_Scratch						0x01f
35962306a36Sopenharmony_ci
36062306a36Sopenharmony_ci#define PM3RD_VideoOverlayControl				0x020
36162306a36Sopenharmony_ci	#define PM3RD_VideoOverlayControl_ENABLE		(1 << 0)
36262306a36Sopenharmony_ci	#define PM3RD_VideoOverlayControl_MODE_MASK		(3 << 1)
36362306a36Sopenharmony_ci	#define PM3RD_VideoOverlayControl_MODE_MAINKEY		(0 << 1)
36462306a36Sopenharmony_ci	#define PM3RD_VideoOverlayControl_MODE_OVERLAYKEY	(1 << 1)
36562306a36Sopenharmony_ci	#define PM3RD_VideoOverlayControl_MODE_ALWAYS		(2 << 1)
36662306a36Sopenharmony_ci	#define PM3RD_VideoOverlayControl_MODE_BLEND		(3 << 1)
36762306a36Sopenharmony_ci	#define PM3RD_VideoOverlayControl_DIRECTCOLOR_ENABLED	(1 << 3)
36862306a36Sopenharmony_ci	#define PM3RD_VideoOverlayControl_BLENDSRC_MAIN		(0 << 4)
36962306a36Sopenharmony_ci	#define PM3RD_VideoOverlayControl_BLENDSRC_REGISTER	(1 << 4)
37062306a36Sopenharmony_ci	#define PM3RD_VideoOverlayControl_KEY_COLOR		(0 << 5)
37162306a36Sopenharmony_ci	#define PM3RD_VideoOverlayControl_KEY_ALPHA		(1 << 5)
37262306a36Sopenharmony_ci#define PM3RD_VideoOverlayXStartLow				0x021
37362306a36Sopenharmony_ci#define PM3RD_VideoOverlayXStartHigh				0x022
37462306a36Sopenharmony_ci#define PM3RD_VideoOverlayYStartLow				0x023
37562306a36Sopenharmony_ci#define PM3RD_VideoOverlayYStartHigh				0x024
37662306a36Sopenharmony_ci#define PM3RD_VideoOverlayXEndLow				0x025
37762306a36Sopenharmony_ci#define PM3RD_VideoOverlayXEndHigh				0x026
37862306a36Sopenharmony_ci#define PM3RD_VideoOverlayYEndLow				0x027
37962306a36Sopenharmony_ci#define PM3RD_VideoOverlayYEndHigh				0x028
38062306a36Sopenharmony_ci#define PM3RD_VideoOverlayKeyR					0x029
38162306a36Sopenharmony_ci#define PM3RD_VideoOverlayKeyG					0x02a
38262306a36Sopenharmony_ci#define PM3RD_VideoOverlayKeyB					0x02b
38362306a36Sopenharmony_ci#define PM3RD_VideoOverlayBlend					0x02c
38462306a36Sopenharmony_ci	#define PM3RD_VideoOverlayBlend_FACTOR_0_PERCENT	(0 << 6)
38562306a36Sopenharmony_ci	#define PM3RD_VideoOverlayBlend_FACTOR_25_PERCENT	(1 << 6)
38662306a36Sopenharmony_ci	#define PM3RD_VideoOverlayBlend_FACTOR_75_PERCENT	(2 << 6)
38762306a36Sopenharmony_ci	#define PM3RD_VideoOverlayBlend_FACTOR_100_PERCENT	(3 << 6)
38862306a36Sopenharmony_ci
38962306a36Sopenharmony_ci#define PM3RD_DClkSetup1					0x1f0
39062306a36Sopenharmony_ci#define PM3RD_DClkSetup2					0x1f1
39162306a36Sopenharmony_ci#define PM3RD_KClkSetup1					0x1f2
39262306a36Sopenharmony_ci#define PM3RD_KClkSetup2					0x1f3
39362306a36Sopenharmony_ci
39462306a36Sopenharmony_ci#define PM3RD_DClkControl					0x200
39562306a36Sopenharmony_ci	#define PM3RD_DClkControl_SOURCE_PLL			(0 << 4)
39662306a36Sopenharmony_ci	#define PM3RD_DClkControl_SOURCE_VSA			(1 << 4)
39762306a36Sopenharmony_ci	#define PM3RD_DClkControl_SOURCE_VSB			(2 << 4)
39862306a36Sopenharmony_ci	#define PM3RD_DClkControl_SOURCE_EXT			(3 << 4)
39962306a36Sopenharmony_ci	#define PM3RD_DClkControl_STATE_RUN			(2 << 2)
40062306a36Sopenharmony_ci	#define PM3RD_DClkControl_STATE_HIGH			(1 << 2)
40162306a36Sopenharmony_ci	#define PM3RD_DClkControl_STATE_LOW			(0 << 2)
40262306a36Sopenharmony_ci	#define PM3RD_DClkControl_LOCKED			(1 << 1)
40362306a36Sopenharmony_ci	#define PM3RD_DClkControl_NOT_LOCKED			(0 << 1)
40462306a36Sopenharmony_ci	#define PM3RD_DClkControl_ENABLE			(1 << 0)
40562306a36Sopenharmony_ci#define PM3RD_DClk0PreScale					0x201
40662306a36Sopenharmony_ci#define PM3RD_DClk0FeedbackScale				0x202
40762306a36Sopenharmony_ci#define PM3RD_DClk0PostScale					0x203
40862306a36Sopenharmony_ci	#define PM3_REF_CLOCK					14318
40962306a36Sopenharmony_ci#define PM3RD_DClk1PreScale					0x204
41062306a36Sopenharmony_ci#define PM3RD_DClk1FeedbackScale				0x205
41162306a36Sopenharmony_ci#define PM3RD_DClk1PostScale					0x206
41262306a36Sopenharmony_ci#define PM3RD_DClk2PreScale					0x207
41362306a36Sopenharmony_ci#define PM3RD_DClk2FeedbackScale				0x208
41462306a36Sopenharmony_ci#define PM3RD_DClk2PostScale					0x209
41562306a36Sopenharmony_ci#define PM3RD_DClk3PreScale					0x20a
41662306a36Sopenharmony_ci#define PM3RD_DClk3FeedbackScale				0x20b
41762306a36Sopenharmony_ci#define PM3RD_DClk3PostScale					0x20c
41862306a36Sopenharmony_ci#define PM3RD_KClkControl					0x20d
41962306a36Sopenharmony_ci	#define PM3RD_KClkControl_ENABLE			(1 << 0)
42062306a36Sopenharmony_ci	#define PM3RD_KClkControl_NOT_LOCKED			(0 << 1)
42162306a36Sopenharmony_ci	#define PM3RD_KClkControl_LOCKED			(1 << 1)
42262306a36Sopenharmony_ci	#define PM3RD_KClkControl_STATE_LOW			(0 << 2)
42362306a36Sopenharmony_ci	#define PM3RD_KClkControl_STATE_HIGH			(1 << 2)
42462306a36Sopenharmony_ci	#define PM3RD_KClkControl_STATE_RUN			(2 << 2)
42562306a36Sopenharmony_ci	#define PM3RD_KClkControl_STATE_LOW_POWER		(3 << 2)
42662306a36Sopenharmony_ci	#define PM3RD_KClkControl_SOURCE_PCLK			(0 << 4)
42762306a36Sopenharmony_ci	#define PM3RD_KClkControl_SOURCE_HALF_PCLK		(1 << 4)
42862306a36Sopenharmony_ci	#define PM3RD_KClkControl_SOURCE_PLL			(2 << 4)
42962306a36Sopenharmony_ci#define PM3RD_KClkPreScale					0x20e
43062306a36Sopenharmony_ci#define PM3RD_KClkFeedbackScale					0x20f
43162306a36Sopenharmony_ci#define PM3RD_KClkPostScale					0x210
43262306a36Sopenharmony_ci#define PM3RD_MClkControl					0x211
43362306a36Sopenharmony_ci	#define PM3RD_MClkControl_ENABLE			(1 << 0)
43462306a36Sopenharmony_ci	#define PM3RD_MClkControl_NOT_LOCKED			(0 << 1)
43562306a36Sopenharmony_ci	#define PM3RD_MClkControl_LOCKED			(1 << 1)
43662306a36Sopenharmony_ci	#define PM3RD_MClkControl_STATE_LOW			(0 << 2)
43762306a36Sopenharmony_ci	#define PM3RD_MClkControl_STATE_HIGH			(1 << 2)
43862306a36Sopenharmony_ci	#define PM3RD_MClkControl_STATE_RUN			(2 << 2)
43962306a36Sopenharmony_ci	#define PM3RD_MClkControl_STATE_LOW_POWER		(3 << 2)
44062306a36Sopenharmony_ci	#define PM3RD_MClkControl_SOURCE_PCLK			(0 << 4)
44162306a36Sopenharmony_ci	#define PM3RD_MClkControl_SOURCE_HALF_PCLK		(1 << 4)
44262306a36Sopenharmony_ci	#define PM3RD_MClkControl_SOURCE_HALF_EXT		(3 << 4)
44362306a36Sopenharmony_ci	#define PM3RD_MClkControl_SOURCE_EXT			(4 << 4)
44462306a36Sopenharmony_ci	#define PM3RD_MClkControl_SOURCE_HALF_KCLK		(5 << 4)
44562306a36Sopenharmony_ci	#define PM3RD_MClkControl_SOURCE_KCLK			(6 << 4)
44662306a36Sopenharmony_ci#define PM3RD_MClkPreScale					0x212
44762306a36Sopenharmony_ci#define PM3RD_MClkFeedbackScale					0x213
44862306a36Sopenharmony_ci#define PM3RD_MClkPostScale					0x214
44962306a36Sopenharmony_ci#define PM3RD_SClkControl					0x215
45062306a36Sopenharmony_ci	#define PM3RD_SClkControl_ENABLE			(1 << 0)
45162306a36Sopenharmony_ci	#define PM3RD_SClkControl_NOT_LOCKED			(0 << 1)
45262306a36Sopenharmony_ci	#define PM3RD_SClkControl_LOCKED			(1 << 1)
45362306a36Sopenharmony_ci	#define PM3RD_SClkControl_STATE_LOW			(0 << 2)
45462306a36Sopenharmony_ci	#define PM3RD_SClkControl_STATE_HIGH			(1 << 2)
45562306a36Sopenharmony_ci	#define PM3RD_SClkControl_STATE_RUN			(2 << 2)
45662306a36Sopenharmony_ci	#define PM3RD_SClkControl_STATE_LOW_POWER		(3 << 2)
45762306a36Sopenharmony_ci	#define PM3RD_SClkControl_SOURCE_PCLK			(0 << 4)
45862306a36Sopenharmony_ci	#define PM3RD_SClkControl_SOURCE_HALF_PCLK		(1 << 4)
45962306a36Sopenharmony_ci	#define PM3RD_SClkControl_SOURCE_HALF_EXT		(3 << 4)
46062306a36Sopenharmony_ci	#define PM3RD_SClkControl_SOURCE_EXT			(4 << 4)
46162306a36Sopenharmony_ci	#define PM3RD_SClkControl_SOURCE_HALF_KCLK		(5 << 4)
46262306a36Sopenharmony_ci	#define PM3RD_SClkControl_SOURCE_KCLK			(6 << 4)
46362306a36Sopenharmony_ci#define PM3RD_SClkPreScale					0x216
46462306a36Sopenharmony_ci#define PM3RD_SClkFeedbackScale					0x217
46562306a36Sopenharmony_ci#define PM3RD_SClkPostScale					0x218
46662306a36Sopenharmony_ci
46762306a36Sopenharmony_ci#define PM3RD_CursorPalette(p)				(0x303 + (p))
46862306a36Sopenharmony_ci#define PM3RD_CursorPattern(p)				(0x400 + (p))
46962306a36Sopenharmony_ci/******************************************************
47062306a36Sopenharmony_ci*  GLINT Permedia3 Video Streaming Registers (0x5000) *
47162306a36Sopenharmony_ci*******************************************************/
47262306a36Sopenharmony_ci
47362306a36Sopenharmony_ci#define PM3VSConfiguration					0x5800
47462306a36Sopenharmony_ci
47562306a36Sopenharmony_ci/**********************************************
47662306a36Sopenharmony_ci*  GLINT Permedia3 Core Registers (0x8000+)   *
47762306a36Sopenharmony_ci***********************************************/
47862306a36Sopenharmony_ci#define PM3AALineWidth						0x94c0
47962306a36Sopenharmony_ci#define PM3AAPointsize						0x94a0
48062306a36Sopenharmony_ci#define PM3AlphaBlendAlphaMode					0xafa8
48162306a36Sopenharmony_ci#define PM3AlphaBlendAlphaModeAnd				0xad30
48262306a36Sopenharmony_ci#define PM3AlphaBlendAlphaModeOr				0xad38
48362306a36Sopenharmony_ci#define PM3AlphaBlendColorMode					0xafa0
48462306a36Sopenharmony_ci#define PM3AlphaBlendColorModeAnd				0xacb0
48562306a36Sopenharmony_ci#define PM3AlphaBlendColorModeOr				0xacb8
48662306a36Sopenharmony_ci#define PM3AlphaDestColor					0xaf88
48762306a36Sopenharmony_ci#define PM3AlphaSourceColor					0xaf80
48862306a36Sopenharmony_ci#define PM3AlphaTestMode					0x8800
48962306a36Sopenharmony_ci#define PM3AlphaTestModeAnd					0xabf0
49062306a36Sopenharmony_ci#define PM3AlphaTestModeOr					0xabf8
49162306a36Sopenharmony_ci#define PM3AntialiasMode					0x8808
49262306a36Sopenharmony_ci#define PM3AntialiasModeAnd					0xac00
49362306a36Sopenharmony_ci#define PM3AntialiasModeOr					0xac08
49462306a36Sopenharmony_ci/* ... */
49562306a36Sopenharmony_ci#define PM3BackgroundColor					0xb0c8
49662306a36Sopenharmony_ci/* ... */
49762306a36Sopenharmony_ci#define PM3ColorDDAMode						0x87e0
49862306a36Sopenharmony_ci#define PM3ColorDDAModeAnd					0xabe0
49962306a36Sopenharmony_ci#define PM3ColorDDAModeOr					0xabe8
50062306a36Sopenharmony_ci#define PM3CommandInterrupt					0xa990
50162306a36Sopenharmony_ci#define PM3ConstantColorDDA					0xafb0
50262306a36Sopenharmony_ci	#define PM3ConstantColorDDA_R(r)		((r) & 0xff)
50362306a36Sopenharmony_ci	#define PM3ConstantColorDDA_G(g)		(((g) & 0xff) << 8)
50462306a36Sopenharmony_ci	#define PM3ConstantColorDDA_B(b)		(((b) & 0xff) << 16)
50562306a36Sopenharmony_ci	#define PM3ConstantColorDDA_A(a)		(((a) & 0xff) << 24)
50662306a36Sopenharmony_ci#define PM3ContextData						0x8dd0
50762306a36Sopenharmony_ci#define PM3ContextDump						0x8dc0
50862306a36Sopenharmony_ci#define PM3ContextRestore					0x8dc8
50962306a36Sopenharmony_ci#define PM3Continue						0x8058
51062306a36Sopenharmony_ci#define PM3ContinueNewDom					0x8048
51162306a36Sopenharmony_ci#define PM3ContinueNewLine					0x8040
51262306a36Sopenharmony_ci#define PM3ContinueNewSub					0x8050
51362306a36Sopenharmony_ci#define PM3Count						0x8030
51462306a36Sopenharmony_ci/* ... */
51562306a36Sopenharmony_ci#define PM3DeltaControl						0x9350
51662306a36Sopenharmony_ci#define PM3DeltaControlAnd					0xab20
51762306a36Sopenharmony_ci#define PM3DeltaControlOr					0xab28
51862306a36Sopenharmony_ci#define PM3DeltaMode						0x9300
51962306a36Sopenharmony_ci#define PM3DeltaModeAnd						0xaad0
52062306a36Sopenharmony_ci#define PM3DeltaModeOr						0xaad8
52162306a36Sopenharmony_ci/* ... */
52262306a36Sopenharmony_ci#define PM3DitherMode						0x8818
52362306a36Sopenharmony_ci#define PM3DitherModeAnd					0xacd0
52462306a36Sopenharmony_ci#define PM3DitherModeOr						0xacd8
52562306a36Sopenharmony_ci/* ... */
52662306a36Sopenharmony_ci#define PM3dXDom						0x8008
52762306a36Sopenharmony_ci#define PM3dXSub						0x8018
52862306a36Sopenharmony_ci#define PM3dY							0x8028
52962306a36Sopenharmony_ci/* ... */
53062306a36Sopenharmony_ci#define PM3FBBlockColor						0x8ac8
53162306a36Sopenharmony_ci#define PM3FBBlockColor0					0xb060
53262306a36Sopenharmony_ci#define PM3FBBlockColor1					0xb068
53362306a36Sopenharmony_ci#define PM3FBBlockColor2					0xb070
53462306a36Sopenharmony_ci#define PM3FBBlockColor3					0xb078
53562306a36Sopenharmony_ci#define PM3FBBlockColorBack					0xb0a0
53662306a36Sopenharmony_ci#define PM3FBBlockColorBack0					0xb080
53762306a36Sopenharmony_ci#define PM3FBBlockColorBack1					0xb088
53862306a36Sopenharmony_ci#define PM3FBBlockColorBack2					0xb090
53962306a36Sopenharmony_ci#define PM3FBBlockColorBack3					0xb098
54062306a36Sopenharmony_ci#define PM3FBColor						0x8a98
54162306a36Sopenharmony_ci#define PM3FBDestReadBufferAddr0				0xae80
54262306a36Sopenharmony_ci#define PM3FBDestReadBufferAddr1				0xae88
54362306a36Sopenharmony_ci#define PM3FBDestReadBufferAddr2				0xae90
54462306a36Sopenharmony_ci#define PM3FBDestReadBufferAddr3				0xae98
54562306a36Sopenharmony_ci#define PM3FBDestReadBufferOffset0				0xaea0
54662306a36Sopenharmony_ci#define PM3FBDestReadBufferOffset1				0xaea8
54762306a36Sopenharmony_ci#define PM3FBDestReadBufferOffset2				0xaeb0
54862306a36Sopenharmony_ci#define PM3FBDestReadBufferOffset3				0xaeb8
54962306a36Sopenharmony_ci	#define PM3FBDestReadBufferOffset_XOffset(x)	((x) & 0xffff)
55062306a36Sopenharmony_ci	#define PM3FBDestReadBufferOffset_YOffset(y)	(((y) & 0xffff) << 16)
55162306a36Sopenharmony_ci#define PM3FBDestReadBufferWidth0				0xaec0
55262306a36Sopenharmony_ci#define PM3FBDestReadBufferWidth1				0xaec8
55362306a36Sopenharmony_ci#define PM3FBDestReadBufferWidth2				0xaed0
55462306a36Sopenharmony_ci#define PM3FBDestReadBufferWidth3				0xaed8
55562306a36Sopenharmony_ci	#define PM3FBDestReadBufferWidth_Width(w)	((w) & 0x0fff)
55662306a36Sopenharmony_ci
55762306a36Sopenharmony_ci#define PM3FBDestReadEnables					0xaee8
55862306a36Sopenharmony_ci#define PM3FBDestReadEnablesAnd					0xad20
55962306a36Sopenharmony_ci#define PM3FBDestReadEnablesOr					0xad28
56062306a36Sopenharmony_ci	#define PM3FBDestReadEnables_E(e)		((e) & 0xff)
56162306a36Sopenharmony_ci	#define PM3FBDestReadEnables_E0				(1 << 0)
56262306a36Sopenharmony_ci	#define PM3FBDestReadEnables_E1				(1 << 1)
56362306a36Sopenharmony_ci	#define PM3FBDestReadEnables_E2				(1 << 2)
56462306a36Sopenharmony_ci	#define PM3FBDestReadEnables_E3				(1 << 3)
56562306a36Sopenharmony_ci	#define PM3FBDestReadEnables_E4				(1 << 4)
56662306a36Sopenharmony_ci	#define PM3FBDestReadEnables_E5				(1 << 5)
56762306a36Sopenharmony_ci	#define PM3FBDestReadEnables_E6				(1 << 6)
56862306a36Sopenharmony_ci	#define PM3FBDestReadEnables_E7				(1 << 7)
56962306a36Sopenharmony_ci	#define PM3FBDestReadEnables_R(r)		(((r) & 0xff) << 8)
57062306a36Sopenharmony_ci	#define PM3FBDestReadEnables_R0				(1 << 8)
57162306a36Sopenharmony_ci	#define PM3FBDestReadEnables_R1				(1 << 9)
57262306a36Sopenharmony_ci	#define PM3FBDestReadEnables_R2				(1 << 10)
57362306a36Sopenharmony_ci	#define PM3FBDestReadEnables_R3				(1 << 11)
57462306a36Sopenharmony_ci	#define PM3FBDestReadEnables_R4				(1 << 12)
57562306a36Sopenharmony_ci	#define PM3FBDestReadEnables_R5				(1 << 13)
57662306a36Sopenharmony_ci	#define PM3FBDestReadEnables_R6				(1 << 14)
57762306a36Sopenharmony_ci	#define PM3FBDestReadEnables_R7				(1 << 15)
57862306a36Sopenharmony_ci	#define PM3FBDestReadEnables_ReferenceAlpha(a)	(((a) & 0xff) << 24)
57962306a36Sopenharmony_ci
58062306a36Sopenharmony_ci#define PM3FBDestReadMode					0xaee0
58162306a36Sopenharmony_ci#define PM3FBDestReadModeAnd					0xac90
58262306a36Sopenharmony_ci#define PM3FBDestReadModeOr					0xac98
58362306a36Sopenharmony_ci	#define PM3FBDestReadMode_ReadDisable			(0 << 0)
58462306a36Sopenharmony_ci	#define PM3FBDestReadMode_ReadEnable			(1 << 0)
58562306a36Sopenharmony_ci	#define PM3FBDestReadMode_StripePitch(sp)	(((sp) & 0x7) << 2)
58662306a36Sopenharmony_ci	#define PM3FBDestReadMode_StripeHeight(sh)	(((sh) & 0x7) << 7)
58762306a36Sopenharmony_ci	#define PM3FBDestReadMode_Enable0			(1 << 8)
58862306a36Sopenharmony_ci	#define PM3FBDestReadMode_Enable1			(1 << 9)
58962306a36Sopenharmony_ci	#define PM3FBDestReadMode_Enable2			(1 << 10)
59062306a36Sopenharmony_ci	#define PM3FBDestReadMode_Enable3			(1 << 11)
59162306a36Sopenharmony_ci	#define PM3FBDestReadMode_Layout0(l)		(((l) & 0x3) << 12)
59262306a36Sopenharmony_ci	#define PM3FBDestReadMode_Layout1(l)		(((l) & 0x3) << 14)
59362306a36Sopenharmony_ci	#define PM3FBDestReadMode_Layout2(l)		(((l) & 0x3) << 16)
59462306a36Sopenharmony_ci	#define PM3FBDestReadMode_Layout3(l)		(((l) & 0x3) << 18)
59562306a36Sopenharmony_ci	#define PM3FBDestReadMode_Origin0			(1 << 20)
59662306a36Sopenharmony_ci	#define PM3FBDestReadMode_Origin1			(1 << 21)
59762306a36Sopenharmony_ci	#define PM3FBDestReadMode_Origin2			(1 << 22)
59862306a36Sopenharmony_ci	#define PM3FBDestReadMode_Origin3			(1 << 23)
59962306a36Sopenharmony_ci	#define PM3FBDestReadMode_Blocking			(1 << 24)
60062306a36Sopenharmony_ci	#define PM3FBDestReadMode_UseReadEnabled		(1 << 26)
60162306a36Sopenharmony_ci	#define PM3FBDestReadMode_AlphaFiltering		(1 << 27)
60262306a36Sopenharmony_ci
60362306a36Sopenharmony_ci#define PM3FBHardwareWriteMask					0x8ac0
60462306a36Sopenharmony_ci#define PM3FBSoftwareWriteMask					0x8820
60562306a36Sopenharmony_ci#define PM3FBData						0x8aa0
60662306a36Sopenharmony_ci#define PM3FBSourceData						0x8aa8
60762306a36Sopenharmony_ci#define PM3FBSourceReadBufferAddr				0xaf08
60862306a36Sopenharmony_ci#define PM3FBSourceReadBufferOffset				0xaf10
60962306a36Sopenharmony_ci	#define PM3FBSourceReadBufferOffset_XOffset(x)	((x) & 0xffff)
61062306a36Sopenharmony_ci	#define PM3FBSourceReadBufferOffset_YOffset(y)	(((y) & 0xffff) << 16)
61162306a36Sopenharmony_ci#define PM3FBSourceReadBufferWidth				0xaf18
61262306a36Sopenharmony_ci	#define PM3FBSourceReadBufferWidth_Width(w)	((w) & 0x0fff)
61362306a36Sopenharmony_ci#define PM3FBSourceReadMode					0xaf00
61462306a36Sopenharmony_ci#define PM3FBSourceReadModeAnd					0xaca0
61562306a36Sopenharmony_ci#define PM3FBSourceReadModeOr					0xaca8
61662306a36Sopenharmony_ci	#define PM3FBSourceReadMode_ReadDisable			(0 << 0)
61762306a36Sopenharmony_ci	#define PM3FBSourceReadMode_ReadEnable			(1 << 0)
61862306a36Sopenharmony_ci	#define PM3FBSourceReadMode_StripePitch(sp)	(((sp) & 0x7) << 2)
61962306a36Sopenharmony_ci	#define PM3FBSourceReadMode_StripeHeight(sh)	(((sh) & 0x7) << 7)
62062306a36Sopenharmony_ci	#define PM3FBSourceReadMode_Layout(l)		(((l) & 0x3) << 8)
62162306a36Sopenharmony_ci	#define PM3FBSourceReadMode_Origin			(1 << 10)
62262306a36Sopenharmony_ci	#define PM3FBSourceReadMode_Blocking			(1 << 11)
62362306a36Sopenharmony_ci	#define PM3FBSourceReadMode_UserTexelCoord		(1 << 13)
62462306a36Sopenharmony_ci	#define PM3FBSourceReadMode_WrapXEnable			(1 << 14)
62562306a36Sopenharmony_ci	#define PM3FBSourceReadMode_WrapYEnable			(1 << 15)
62662306a36Sopenharmony_ci	#define PM3FBSourceReadMode_WrapX(w)		(((w) & 0xf) << 16)
62762306a36Sopenharmony_ci	#define PM3FBSourceReadMode_WrapY(w)		(((w) & 0xf) << 20)
62862306a36Sopenharmony_ci	#define PM3FBSourceReadMode_ExternalSourceData		(1 << 24)
62962306a36Sopenharmony_ci#define PM3FBWriteBufferAddr0					0xb000
63062306a36Sopenharmony_ci#define PM3FBWriteBufferAddr1					0xb008
63162306a36Sopenharmony_ci#define PM3FBWriteBufferAddr2					0xb010
63262306a36Sopenharmony_ci#define PM3FBWriteBufferAddr3					0xb018
63362306a36Sopenharmony_ci
63462306a36Sopenharmony_ci#define PM3FBWriteBufferOffset0					0xb020
63562306a36Sopenharmony_ci#define PM3FBWriteBufferOffset1					0xb028
63662306a36Sopenharmony_ci#define PM3FBWriteBufferOffset2					0xb030
63762306a36Sopenharmony_ci#define PM3FBWriteBufferOffset3					0xb038
63862306a36Sopenharmony_ci	#define PM3FBWriteBufferOffset_XOffset(x)	((x) & 0xffff)
63962306a36Sopenharmony_ci	#define PM3FBWriteBufferOffset_YOffset(y)	(((y) & 0xffff) << 16)
64062306a36Sopenharmony_ci
64162306a36Sopenharmony_ci#define PM3FBWriteBufferWidth0					0xb040
64262306a36Sopenharmony_ci#define PM3FBWriteBufferWidth1					0xb048
64362306a36Sopenharmony_ci#define PM3FBWriteBufferWidth2					0xb050
64462306a36Sopenharmony_ci#define PM3FBWriteBufferWidth3					0xb058
64562306a36Sopenharmony_ci	#define PM3FBWriteBufferWidth_Width(w)		((w) & 0x0fff)
64662306a36Sopenharmony_ci
64762306a36Sopenharmony_ci#define PM3FBWriteMode						0x8ab8
64862306a36Sopenharmony_ci#define PM3FBWriteModeAnd					0xacf0
64962306a36Sopenharmony_ci#define PM3FBWriteModeOr					0xacf8
65062306a36Sopenharmony_ci	#define PM3FBWriteMode_WriteDisable			(0 << 0)
65162306a36Sopenharmony_ci	#define PM3FBWriteMode_WriteEnable			(1 << 0)
65262306a36Sopenharmony_ci	#define PM3FBWriteMode_Replicate			(1 << 4)
65362306a36Sopenharmony_ci	#define PM3FBWriteMode_OpaqueSpan			(1 << 5)
65462306a36Sopenharmony_ci	#define PM3FBWriteMode_StripePitch(p)		(((p) & 0x7) << 6)
65562306a36Sopenharmony_ci	#define PM3FBWriteMode_StripeHeight(h)		(((h) & 0x7) << 9)
65662306a36Sopenharmony_ci	#define PM3FBWriteMode_Enable0				(1 << 12)
65762306a36Sopenharmony_ci	#define PM3FBWriteMode_Enable1				(1 << 13)
65862306a36Sopenharmony_ci	#define PM3FBWriteMode_Enable2				(1 << 14)
65962306a36Sopenharmony_ci	#define PM3FBWriteMode_Enable3				(1 << 15)
66062306a36Sopenharmony_ci	#define PM3FBWriteMode_Layout0(l)		(((l) & 0x3) << 16)
66162306a36Sopenharmony_ci	#define PM3FBWriteMode_Layout1(l)		(((l) & 0x3) << 18)
66262306a36Sopenharmony_ci	#define PM3FBWriteMode_Layout2(l)		(((l) & 0x3) << 20)
66362306a36Sopenharmony_ci	#define PM3FBWriteMode_Layout3(l)		(((l) & 0x3) << 22)
66462306a36Sopenharmony_ci	#define PM3FBWriteMode_Origin0				(1 << 24)
66562306a36Sopenharmony_ci	#define PM3FBWriteMode_Origin1				(1 << 25)
66662306a36Sopenharmony_ci	#define PM3FBWriteMode_Origin2				(1 << 26)
66762306a36Sopenharmony_ci	#define PM3FBWriteMode_Origin3				(1 << 27)
66862306a36Sopenharmony_ci#define PM3ForegroundColor					0xb0c0
66962306a36Sopenharmony_ci/* ... */
67062306a36Sopenharmony_ci#define PM3GIDMode						0xb538
67162306a36Sopenharmony_ci#define PM3GIDModeAnd						0xb5b0
67262306a36Sopenharmony_ci#define PM3GIDModeOr						0xb5b8
67362306a36Sopenharmony_ci/* ... */
67462306a36Sopenharmony_ci#define PM3LBDestReadBufferAddr					0xb510
67562306a36Sopenharmony_ci#define PM3LBDestReadBufferOffset				0xb518
67662306a36Sopenharmony_ci#define PM3LBDestReadEnables					0xb508
67762306a36Sopenharmony_ci#define PM3LBDestReadEnablesAnd					0xb590
67862306a36Sopenharmony_ci#define PM3LBDestReadEnablesOr					0xb598
67962306a36Sopenharmony_ci#define PM3LBDestReadMode					0xb500
68062306a36Sopenharmony_ci#define PM3LBDestReadModeAnd					0xb580
68162306a36Sopenharmony_ci#define PM3LBDestReadModeOr					0xb588
68262306a36Sopenharmony_ci	#define PM3LBDestReadMode_Disable			(0 << 0)
68362306a36Sopenharmony_ci	#define PM3LBDestReadMode_Enable			(1 << 0)
68462306a36Sopenharmony_ci	#define PM3LBDestReadMode_StripePitch(p)	(((p) & 0x7) << 2)
68562306a36Sopenharmony_ci	#define PM3LBDestReadMode_StripeHeight(h)	(((h) & 0x7) << 5)
68662306a36Sopenharmony_ci	#define PM3LBDestReadMode_Layout			(1 << 8)
68762306a36Sopenharmony_ci	#define PM3LBDestReadMode_Origin			(1 << 9)
68862306a36Sopenharmony_ci	#define PM3LBDestReadMode_UserReadEnables		(1 << 10)
68962306a36Sopenharmony_ci	#define PM3LBDestReadMode_Packed16			(1 << 11)
69062306a36Sopenharmony_ci	#define PM3LBDestReadMode_Width(w)		(((w) & 0xfff) << 12)
69162306a36Sopenharmony_ci#define PM3LBReadFormat						0x8888
69262306a36Sopenharmony_ci	#define PM3LBReadFormat_DepthWidth(w)		(((w) & 0x3) << 0)
69362306a36Sopenharmony_ci	#define PM3LBReadFormat_StencilWidth(w)		(((w) & 0xf) << 2)
69462306a36Sopenharmony_ci	#define PM3LBReadFormat_StencilPosition(p)	(((p) & 0x1f) << 6)
69562306a36Sopenharmony_ci	#define PM3LBReadFormat_FCPWidth(w)		(((w) & 0xf) << 11)
69662306a36Sopenharmony_ci	#define PM3LBReadFormat_FCPPosition(p)		(((p) & 0x1f) << 15)
69762306a36Sopenharmony_ci	#define PM3LBReadFormat_GIDWidth(w)		(((w) & 0x7) << 20)
69862306a36Sopenharmony_ci	#define PM3LBReadFormat_GIDPosition(p)		(((p) & 0x1f) << 23)
69962306a36Sopenharmony_ci#define PM3LBSourceReadBufferAddr				0xb528
70062306a36Sopenharmony_ci#define PM3LBSourceReadBufferOffset				0xb530
70162306a36Sopenharmony_ci#define PM3LBSourceReadMode					0xb520
70262306a36Sopenharmony_ci#define PM3LBSourceReadModeAnd					0xb5a0
70362306a36Sopenharmony_ci#define PM3LBSourceReadModeOr					0xb5a8
70462306a36Sopenharmony_ci	#define PM3LBSourceReadMode_Enable			(1 << 0)
70562306a36Sopenharmony_ci	#define PM3LBSourceReadMode_StripePitch(p)	(((p) & 0x7) << 2)
70662306a36Sopenharmony_ci	#define PM3LBSourceReadMode_StripeHeight(h)	(((h) & 0x7) << 5)
70762306a36Sopenharmony_ci	#define PM3LBSourceReadMode_Layout			(1 << 8)
70862306a36Sopenharmony_ci	#define PM3LBSourceReadMode_Origin			(1 << 9)
70962306a36Sopenharmony_ci	#define PM3LBSourceReadMode_Packed16			(1 << 10)
71062306a36Sopenharmony_ci	#define PM3LBSourceReadMode_Width(w)		(((w) & 0xfff) << 11)
71162306a36Sopenharmony_ci#define PM3LBStencil						0x88a8
71262306a36Sopenharmony_ci#define PM3LBWriteBufferAddr					0xb540
71362306a36Sopenharmony_ci#define PM3LBWriteBufferOffset					0xb548
71462306a36Sopenharmony_ci#define PM3LBWriteFormat					0x88c8
71562306a36Sopenharmony_ci	#define PM3LBWriteFormat_DepthWidth(w)		(((w) & 0x3) << 0)
71662306a36Sopenharmony_ci	#define PM3LBWriteFormat_StencilWidth(w)	(((w) & 0xf) << 2)
71762306a36Sopenharmony_ci	#define PM3LBWriteFormat_StencilPosition(p)	(((p) & 0x1f) << 6)
71862306a36Sopenharmony_ci	#define PM3LBWriteFormat_GIDWidth(w)		(((w) & 0x7) << 20)
71962306a36Sopenharmony_ci	#define PM3LBWriteFormat_GIDPosition(p)		(((p) & 0x1f) << 23)
72062306a36Sopenharmony_ci#define PM3LBWriteMode						0x88c0
72162306a36Sopenharmony_ci#define PM3LBWriteModeAnd					0xac80
72262306a36Sopenharmony_ci#define PM3LBWriteModeOr					0xac88
72362306a36Sopenharmony_ci	#define PM3LBWriteMode_WriteDisable			(0 << 0)
72462306a36Sopenharmony_ci	#define PM3LBWriteMode_WriteEnable			(1 << 0)
72562306a36Sopenharmony_ci	#define PM3LBWriteMode_StripePitch(p)		(((p) & 0x7) << 3)
72662306a36Sopenharmony_ci	#define PM3LBWriteMode_StripeHeight(h)		(((h) & 0x7) << 6)
72762306a36Sopenharmony_ci	#define PM3LBWriteMode_Layout				(1 << 9)
72862306a36Sopenharmony_ci	#define PM3LBWriteMode_Origin				(1 << 10)
72962306a36Sopenharmony_ci	#define PM3LBWriteMode_Packed16				(1 << 11)
73062306a36Sopenharmony_ci	#define PM3LBWriteMode_Width(w)			(((w) & 0xfff) << 12)
73162306a36Sopenharmony_ci/* ... */
73262306a36Sopenharmony_ci#define PM3LineStippleMode					0x81a8
73362306a36Sopenharmony_ci#define PM3LineStippleModeAnd					0xabc0
73462306a36Sopenharmony_ci#define PM3LineStippleModeOr					0xabc8
73562306a36Sopenharmony_ci#define PM3LoadLineStippleCounters				0x81b0
73662306a36Sopenharmony_ci/* ... */
73762306a36Sopenharmony_ci#define PM3LogicalOpMode					0x8828
73862306a36Sopenharmony_ci#define PM3LogicalOpModeAnd					0xace0
73962306a36Sopenharmony_ci#define PM3LogicalOpModeOr					0xace8
74062306a36Sopenharmony_ci	#define PM3LogicalOpMode_Disable			(0 << 0)
74162306a36Sopenharmony_ci	#define PM3LogicalOpMode_Enable				(1 << 0)
74262306a36Sopenharmony_ci	#define PM3LogicalOpMode_LogicOp(op)		(((op) & 0xf) << 1)
74362306a36Sopenharmony_ci	#define PM3LogicalOpMode_UseConstantWriteData_Disable	(0 << 5)
74462306a36Sopenharmony_ci	#define PM3LogicalOpMode_UseConstantWriteData_Enable	(1 << 5)
74562306a36Sopenharmony_ci	#define PM3LogicalOpMode_Background_Disable		(0 << 6)
74662306a36Sopenharmony_ci	#define PM3LogicalOpMode_Background_Enable		(1 << 6)
74762306a36Sopenharmony_ci	#define PM3LogicalOpMode_Background_LogicOp(op)	(((op) & 0xf) << 7)
74862306a36Sopenharmony_ci	#define PM3LogicalOpMode_UseConstantSource_Disable	(0 << 11)
74962306a36Sopenharmony_ci	#define PM3LogicalOpMode_UseConstantSource_Enable	(1 << 11)
75062306a36Sopenharmony_ci/* ... */
75162306a36Sopenharmony_ci#define PM3LUT							0x8e80
75262306a36Sopenharmony_ci#define PM3LUTAddress						0x84d0
75362306a36Sopenharmony_ci#define PM3LUTData						0x84c8
75462306a36Sopenharmony_ci#define PM3LUTIndex						0x84c0
75562306a36Sopenharmony_ci#define PM3LUTMode						0xb378
75662306a36Sopenharmony_ci#define PM3LUTModeAnd						0xad70
75762306a36Sopenharmony_ci#define PM3LUTModeOr						0xad78
75862306a36Sopenharmony_ci#define PM3LUTTransfer						0x84d8
75962306a36Sopenharmony_ci/* ... */
76062306a36Sopenharmony_ci#define PM3PixelSize						0x80c0
76162306a36Sopenharmony_ci	#define PM3PixelSize_GLOBAL_32BIT			(0 << 0)
76262306a36Sopenharmony_ci	#define PM3PixelSize_GLOBAL_16BIT			(1 << 0)
76362306a36Sopenharmony_ci	#define PM3PixelSize_GLOBAL_8BIT			(2 << 0)
76462306a36Sopenharmony_ci	#define PM3PixelSize_RASTERIZER_32BIT			(0 << 2)
76562306a36Sopenharmony_ci	#define PM3PixelSize_RASTERIZER_16BIT			(1 << 2)
76662306a36Sopenharmony_ci	#define PM3PixelSize_RASTERIZER_8BIT			(2 << 2)
76762306a36Sopenharmony_ci	#define PM3PixelSize_SCISSOR_AND_STIPPLE_32BIT		(0 << 4)
76862306a36Sopenharmony_ci	#define PM3PixelSize_SCISSOR_AND_STIPPLE_16BIT		(1 << 4)
76962306a36Sopenharmony_ci	#define PM3PixelSize_SCISSOR_AND_STIPPLE_8BIT		(2 << 4)
77062306a36Sopenharmony_ci	#define PM3PixelSize_TEXTURE_32BIT			(0 << 6)
77162306a36Sopenharmony_ci	#define PM3PixelSize_TEXTURE_16BIT			(1 << 6)
77262306a36Sopenharmony_ci	#define PM3PixelSize_TEXTURE_8BIT			(2 << 6)
77362306a36Sopenharmony_ci	#define PM3PixelSize_LUT_32BIT				(0 << 8)
77462306a36Sopenharmony_ci	#define PM3PixelSize_LUT_16BIT				(1 << 8)
77562306a36Sopenharmony_ci	#define PM3PixelSize_LUT_8BIT				(2 << 8)
77662306a36Sopenharmony_ci	#define PM3PixelSize_FRAMEBUFFER_32BIT			(0 << 10)
77762306a36Sopenharmony_ci	#define PM3PixelSize_FRAMEBUFFER_16BIT			(1 << 10)
77862306a36Sopenharmony_ci	#define PM3PixelSize_FRAMEBUFFER_8BIT			(2 << 10)
77962306a36Sopenharmony_ci	#define PM3PixelSize_LOGICAL_OP_32BIT			(0 << 12)
78062306a36Sopenharmony_ci	#define PM3PixelSize_LOGICAL_OP_16BIT			(1 << 12)
78162306a36Sopenharmony_ci	#define PM3PixelSize_LOGICAL_OP_8BIT			(2 << 12)
78262306a36Sopenharmony_ci	#define PM3PixelSize_LOCALBUFFER_32BIT			(0 << 14)
78362306a36Sopenharmony_ci	#define PM3PixelSize_LOCALBUFFER_16BIT			(1 << 14)
78462306a36Sopenharmony_ci	#define PM3PixelSize_LOCALBUFFER_8BIT			(2 << 14)
78562306a36Sopenharmony_ci	#define PM3PixelSize_SETUP_32BIT			(0 << 16)
78662306a36Sopenharmony_ci	#define PM3PixelSize_SETUP_16BIT			(1 << 16)
78762306a36Sopenharmony_ci	#define PM3PixelSize_SETUP_8BIT				(2 << 16)
78862306a36Sopenharmony_ci	#define PM3PixelSize_GLOBAL				(0 << 31)
78962306a36Sopenharmony_ci	#define PM3PixelSize_INDIVIDUAL				(1 << 31)
79062306a36Sopenharmony_ci/* ... */
79162306a36Sopenharmony_ci#define PM3Render						0x8038
79262306a36Sopenharmony_ci	#define PM3Render_AreaStipple_Disable			(0 << 0)
79362306a36Sopenharmony_ci	#define PM3Render_AreaStipple_Enable			(1 << 0)
79462306a36Sopenharmony_ci	#define PM3Render_LineStipple_Disable			(0 << 1)
79562306a36Sopenharmony_ci	#define PM3Render_LineStipple_Enable			(1 << 1)
79662306a36Sopenharmony_ci	#define PM3Render_ResetLine_Disable			(0 << 2)
79762306a36Sopenharmony_ci	#define PM3Render_ResetLine_Enable			(1 << 2)
79862306a36Sopenharmony_ci	#define PM3Render_FastFill_Disable			(0 << 3)
79962306a36Sopenharmony_ci	#define PM3Render_FastFill_Enable			(1 << 3)
80062306a36Sopenharmony_ci	#define PM3Render_Primitive_Line			(0 << 6)
80162306a36Sopenharmony_ci	#define PM3Render_Primitive_Trapezoid			(1 << 6)
80262306a36Sopenharmony_ci	#define PM3Render_Primitive_Point			(2 << 6)
80362306a36Sopenharmony_ci	#define PM3Render_Antialias_Disable			(0 << 8)
80462306a36Sopenharmony_ci	#define PM3Render_Antialias_Enable			(1 << 8)
80562306a36Sopenharmony_ci	#define PM3Render_Antialias_SubPixelRes_4x4		(0 << 9)
80662306a36Sopenharmony_ci	#define PM3Render_Antialias_SubPixelRes_8x8		(1 << 9)
80762306a36Sopenharmony_ci	#define PM3Render_UsePointTable_Disable			(0 << 10)
80862306a36Sopenharmony_ci	#define PM3Render_UsePointTable_Enable			(1 << 10)
80962306a36Sopenharmony_ci	#define PM3Render_SyncOnbitMask_Disable			(0 << 11)
81062306a36Sopenharmony_ci	#define PM3Render_SyncOnBitMask_Enable			(1 << 11)
81162306a36Sopenharmony_ci	#define PM3Render_SyncOnHostData_Disable		(0 << 12)
81262306a36Sopenharmony_ci	#define PM3Render_SyncOnHostData_Enable			(1 << 12)
81362306a36Sopenharmony_ci	#define PM3Render_Texture_Disable			(0 << 13)
81462306a36Sopenharmony_ci	#define PM3Render_Texture_Enable			(1 << 13)
81562306a36Sopenharmony_ci	#define PM3Render_Fog_Disable				(0 << 14)
81662306a36Sopenharmony_ci	#define PM3Render_Fog_Enable				(1 << 14)
81762306a36Sopenharmony_ci	#define PM3Render_Coverage_Disable			(0 << 15)
81862306a36Sopenharmony_ci	#define PM3Render_Coverage_Enable			(1 << 15)
81962306a36Sopenharmony_ci	#define PM3Render_SubPixelCorrection_Disable		(0 << 16)
82062306a36Sopenharmony_ci	#define PM3Render_SubPixelCorrection_Enable		(1 << 16)
82162306a36Sopenharmony_ci	#define PM3Render_SpanOperation_Disable			(0 << 18)
82262306a36Sopenharmony_ci	#define PM3Render_SpanOperation_Enable			(1 << 18)
82362306a36Sopenharmony_ci	#define PM3Render_FBSourceRead_Disable			(0 << 27)
82462306a36Sopenharmony_ci	#define PM3Render_FBSourceRead_Enable			(1 << 27)
82562306a36Sopenharmony_ci#define PM3RasterizerMode					0x80a0
82662306a36Sopenharmony_ci#define PM3RasterizerModeAnd					0xaba0
82762306a36Sopenharmony_ci#define PM3RasterizerModeOr					0xaba8
82862306a36Sopenharmony_ci#define PM3RectangleHeight					0x94e0
82962306a36Sopenharmony_ci#define PM3RepeatLine						0x9328
83062306a36Sopenharmony_ci#define PM3ResetPickResult					0x8c20
83162306a36Sopenharmony_ci#define PM3RLEMask						0x8c48
83262306a36Sopenharmony_ci#define PM3RouterMode						0x8840
83362306a36Sopenharmony_ci#define PM3RStart						0x8780
83462306a36Sopenharmony_ci#define PM3S1Start						0x8400
83562306a36Sopenharmony_ci#define PM3aveLineStippleCounters				0x81c0
83662306a36Sopenharmony_ci#define PM3ScissorMaxXY						0x8190
83762306a36Sopenharmony_ci#define PM3ScissorMinXY						0x8188
83862306a36Sopenharmony_ci#define PM3ScissorMode						0x8180
83962306a36Sopenharmony_ci#define PM3ScissorModeAnd					0xabb0
84062306a36Sopenharmony_ci#define PM3ScissorModeOr					0xabb8
84162306a36Sopenharmony_ci#define PM3ScreenSize						0x8198
84262306a36Sopenharmony_ci#define PM3Security						0x8908
84362306a36Sopenharmony_ci#define PM3SetLogicalTexturePage				0xb360
84462306a36Sopenharmony_ci#define PM3SizeOfFramebuffer					0xb0a8
84562306a36Sopenharmony_ci#define PM3SStart						0x8388
84662306a36Sopenharmony_ci#define PM3StartXDom						0x8000
84762306a36Sopenharmony_ci#define PM3StartXSub						0x8010
84862306a36Sopenharmony_ci#define PM3StartY						0x8020
84962306a36Sopenharmony_ci/* ... */
85062306a36Sopenharmony_ci#define PM3SpanColorMask					0x8168
85162306a36Sopenharmony_ci/* ... */
85262306a36Sopenharmony_ci#define PM3TextureApplicationMode				0x8680
85362306a36Sopenharmony_ci#define PM3TextureApplicationModeAnd				0xac50
85462306a36Sopenharmony_ci#define PM3TextureApplicationModeOr				0xac58
85562306a36Sopenharmony_ci#define PM3TextureBaseAddr					0x8500
85662306a36Sopenharmony_ci#define PM3TextureCacheControl					0x8490
85762306a36Sopenharmony_ci#define PM3TextureChromaLower0					0x84f0
85862306a36Sopenharmony_ci#define PM3TextureChromaLower1					0x8608
85962306a36Sopenharmony_ci#define PM3TextureChromaUpper0					0x84e8
86062306a36Sopenharmony_ci#define PM3TextureChromaUpper1					0x8600
86162306a36Sopenharmony_ci#define PM3TextureCompositeAlphaMode0				0xb310
86262306a36Sopenharmony_ci#define PM3TextureCompositeAlphaMode0And			0xb390
86362306a36Sopenharmony_ci#define PM3TextureCompositeAlphaMode0Or				0xb398
86462306a36Sopenharmony_ci#define PM3TextureCompositeAlphaMode1				0xb320
86562306a36Sopenharmony_ci#define PM3TextureCompositeAlphaMode1And			0xb3b0
86662306a36Sopenharmony_ci#define PM3TextureCompositeAlphaMode1Or				0xb3b8
86762306a36Sopenharmony_ci#define PM3TextureCompositeColorMode0				0xb308
86862306a36Sopenharmony_ci#define PM3TextureCompositeColorMode0And			0xb380
86962306a36Sopenharmony_ci#define PM3TextureCompositeColorMode0Or				0xb388
87062306a36Sopenharmony_ci#define PM3TextureCompositeColorMode1				0xb318
87162306a36Sopenharmony_ci#define PM3TextureCompositeColorMode1And			0xb3a0
87262306a36Sopenharmony_ci#define PM3TextureCompositeColorMode1Or				0xb3a8
87362306a36Sopenharmony_ci#define PM3TextureCompositeFactor0				0xb328
87462306a36Sopenharmony_ci#define PM3TextureCompositeFactor1				0xb330
87562306a36Sopenharmony_ci#define PM3TextureCompositeMode					0xb300
87662306a36Sopenharmony_ci#define PM3TextureCoordMode					0x8380
87762306a36Sopenharmony_ci#define PM3TextureCoordModeAnd					0xac20
87862306a36Sopenharmony_ci#define PM3TextureCoordModeOr					0xac28
87962306a36Sopenharmony_ci#define PM3TextureData						0x88e8
88062306a36Sopenharmony_ci/*
88162306a36Sopenharmony_ci#define PM3TextureDownloadControl				0x0108
88262306a36Sopenharmony_ci*/
88362306a36Sopenharmony_ci#define PM3TextureDownloadOffset				0x88f0
88462306a36Sopenharmony_ci#define PM3TextureEnvColor					0x8688
88562306a36Sopenharmony_ci#define PM3TextureFilterMode					0x84e0
88662306a36Sopenharmony_ci#define PM3TextureFilterModeAnd					0xad50
88762306a36Sopenharmony_ci#define PM3TextureFilterModeOr					0xad58
88862306a36Sopenharmony_ci#define PM3TextureIndexMode0					0xb338
88962306a36Sopenharmony_ci#define PM3TextureIndexMode0And					0xb3c0
89062306a36Sopenharmony_ci#define PM3TextureIndexMode0Or					0xb3c8
89162306a36Sopenharmony_ci#define PM3TextureIndexMode1					0xb340
89262306a36Sopenharmony_ci#define PM3TextureIndexMode1And					0xb3d0
89362306a36Sopenharmony_ci#define PM3TextureIndexMode1Or					0xb3d8
89462306a36Sopenharmony_ci/* ... */
89562306a36Sopenharmony_ci#define PM3TextureMapSize					0xb428
89662306a36Sopenharmony_ci#define PM3TextureMapWidth0					0x8580
89762306a36Sopenharmony_ci#define PM3TextureMapWidth1					0x8588
89862306a36Sopenharmony_ci	#define PM3TextureMapWidth_Width(w)		(((w) & 0xfff) << 0)
89962306a36Sopenharmony_ci	#define PM3TextureMapWidth_BorderLayout			(1 << 12)
90062306a36Sopenharmony_ci	#define PM3TextureMapWidth_Layout_Linear		(0 << 13)
90162306a36Sopenharmony_ci	#define PM3TextureMapWidth_Layout_Patch64		(1 << 13)
90262306a36Sopenharmony_ci	#define PM3TextureMapWidth_Layout_Patch32_2		(2 << 13)
90362306a36Sopenharmony_ci	#define PM3TextureMapWidth_Layout_Patch2		(3 << 13)
90462306a36Sopenharmony_ci	#define PM3TextureMapWidth_HostTexture			(1 << 15)
90562306a36Sopenharmony_ci#define PM3TextureReadMode0					0xb400
90662306a36Sopenharmony_ci#define PM3TextureReadMode0And					0xac30
90762306a36Sopenharmony_ci#define PM3TextureReadMode0Or					0xac38
90862306a36Sopenharmony_ci#define PM3TextureReadMode1					0xb408
90962306a36Sopenharmony_ci#define PM3TextureReadMode1And					0xad40
91062306a36Sopenharmony_ci#define PM3TextureReadMode1Or					0xad48
91162306a36Sopenharmony_ci/* ... */
91262306a36Sopenharmony_ci#define PM3WaitForCompletion					0x80b8
91362306a36Sopenharmony_ci#define PM3Window						0x8980
91462306a36Sopenharmony_ci	#define PM3Window_ForceLBUpdate				(1 << 3)
91562306a36Sopenharmony_ci	#define PM3Window_LBUpdateSource			(1 << 4)
91662306a36Sopenharmony_ci	#define PM3Window_FrameCount(c)			(((c) & 0xff) << 9)
91762306a36Sopenharmony_ci	#define PM3Window_StencilFCP				(1 << 17)
91862306a36Sopenharmony_ci	#define PM3Window_DepthFCP				(1 << 18)
91962306a36Sopenharmony_ci	#define PM3Window_OverrideWriteFiltering		(1 << 19)
92062306a36Sopenharmony_ci#define PM3WindowAnd						0xab80
92162306a36Sopenharmony_ci#define PM3WindowOr						0xab88
92262306a36Sopenharmony_ci#define PM3WindowOrigin						0x81c8
92362306a36Sopenharmony_ci#define PM3XBias						0x9480
92462306a36Sopenharmony_ci#define PM3YBias						0x9488
92562306a36Sopenharmony_ci#define PM3YLimits						0x80a8
92662306a36Sopenharmony_ci#define PM3UVMode						0x8f00
92762306a36Sopenharmony_ci#define PM3ZFogBias						0x86b8
92862306a36Sopenharmony_ci#define PM3ZStart						0xadd8
92962306a36Sopenharmony_ci#define PM3ZStartL						0x89b8
93062306a36Sopenharmony_ci#define PM3ZStartU						0x89b0
93162306a36Sopenharmony_ci
93262306a36Sopenharmony_ci
93362306a36Sopenharmony_ci/**********************************************
93462306a36Sopenharmony_ci*  GLINT Permedia3 2D setup Unit	      *
93562306a36Sopenharmony_ci***********************************************/
93662306a36Sopenharmony_ci#define PM3Config2D						0xb618
93762306a36Sopenharmony_ci	#define PM3Config2D_OpaqueSpan				(1 << 0)
93862306a36Sopenharmony_ci	#define PM3Config2D_MultiRXBlit				(1 << 1)
93962306a36Sopenharmony_ci	#define PM3Config2D_UserScissorEnable			(1 << 2)
94062306a36Sopenharmony_ci	#define PM3Config2D_FBDestReadEnable			(1 << 3)
94162306a36Sopenharmony_ci	#define PM3Config2D_AlphaBlendEnable			(1 << 4)
94262306a36Sopenharmony_ci	#define PM3Config2D_DitherEnable			(1 << 5)
94362306a36Sopenharmony_ci	#define PM3Config2D_ForegroundROPEnable			(1 << 6)
94462306a36Sopenharmony_ci	#define PM3Config2D_ForegroundROP(rop)		(((rop) & 0xf) << 7)
94562306a36Sopenharmony_ci	#define PM3Config2D_BackgroundROPEnable			(1 << 11)
94662306a36Sopenharmony_ci	#define PM3Config2D_BackgroundROP(rop)		(((rop) & 0xf) << 12)
94762306a36Sopenharmony_ci	#define PM3Config2D_UseConstantSource			(1 << 16)
94862306a36Sopenharmony_ci	#define PM3Config2D_FBWriteEnable			(1 << 17)
94962306a36Sopenharmony_ci	#define PM3Config2D_Blocking				(1 << 18)
95062306a36Sopenharmony_ci	#define PM3Config2D_ExternalSourceData			(1 << 19)
95162306a36Sopenharmony_ci	#define PM3Config2D_LUTModeEnable			(1 << 20)
95262306a36Sopenharmony_ci#define PM3DownloadGlyphwidth					0xb658
95362306a36Sopenharmony_ci	#define PM3DownloadGlyphwidth_GlyphWidth(gw)	((gw) & 0xffff)
95462306a36Sopenharmony_ci#define PM3DownloadTarget					0xb650
95562306a36Sopenharmony_ci	#define PM3DownloadTarget_TagName(tag)		((tag) & 0x1fff)
95662306a36Sopenharmony_ci#define PM3GlyphData						0xb660
95762306a36Sopenharmony_ci#define PM3GlyphPosition					0xb608
95862306a36Sopenharmony_ci	#define PM3GlyphPosition_XOffset(x)		((x) & 0xffff)
95962306a36Sopenharmony_ci	#define PM3GlyphPosition_YOffset(y)		(((y) & 0xffff) << 16)
96062306a36Sopenharmony_ci#define PM3Packed4Pixels					0xb668
96162306a36Sopenharmony_ci#define PM3Packed8Pixels					0xb630
96262306a36Sopenharmony_ci#define PM3Packed16Pixels					0xb638
96362306a36Sopenharmony_ci#define PM3RectanglePosition					0xb600
96462306a36Sopenharmony_ci	#define PM3RectanglePosition_XOffset(x)		((x) & 0xffff)
96562306a36Sopenharmony_ci	#define PM3RectanglePosition_YOffset(y)		(((y) & 0xffff) << 16)
96662306a36Sopenharmony_ci#define PM3Render2D						0xb640
96762306a36Sopenharmony_ci	#define PM3Render2D_Width(w)			((w) & 0x0fff)
96862306a36Sopenharmony_ci	#define PM3Render2D_Operation_Normal			(0 << 12)
96962306a36Sopenharmony_ci	#define PM3Render2D_Operation_SyncOnHostData		(1 << 12)
97062306a36Sopenharmony_ci	#define PM3Render2D_Operation_SyncOnBitMask		(2 << 12)
97162306a36Sopenharmony_ci	#define PM3Render2D_Operation_PatchOrderRendering	(3 << 12)
97262306a36Sopenharmony_ci	#define PM3Render2D_FBSourceReadEnable			(1 << 14)
97362306a36Sopenharmony_ci	#define PM3Render2D_SpanOperation			(1 << 15)
97462306a36Sopenharmony_ci	#define PM3Render2D_Height(h)			(((h) & 0x0fff) << 16)
97562306a36Sopenharmony_ci	#define PM3Render2D_XPositive				(1 << 28)
97662306a36Sopenharmony_ci	#define PM3Render2D_YPositive				(1 << 29)
97762306a36Sopenharmony_ci	#define PM3Render2D_AreaStippleEnable			(1 << 30)
97862306a36Sopenharmony_ci	#define PM3Render2D_TextureEnable			(1 << 31)
97962306a36Sopenharmony_ci#define PM3Render2DGlyph					0xb648
98062306a36Sopenharmony_ci	#define PM3Render2DGlyph_Width(w)		((w) & 0x7f)
98162306a36Sopenharmony_ci	#define PM3Render2DGlyph_Height(h)		(((h) & 0x7f) << 7)
98262306a36Sopenharmony_ci	#define PM3Render2DGlyph_XOffset(x)		(((x) & 0x1ff) << 14)
98362306a36Sopenharmony_ci	#define PM3Render2DGlyph_YOffset(y)		(((y) & 0x1ff) << 23)
98462306a36Sopenharmony_ci#define PM3RenderPatchOffset					0xb610
98562306a36Sopenharmony_ci	#define PM3RenderPatchOffset_XOffset(x)		((x) & 0xffff)
98662306a36Sopenharmony_ci	#define PM3RenderPatchOffset_YOffset(y)		(((y) & 0xffff) << 16)
98762306a36Sopenharmony_ci#define PM3RLCount						0xb678
98862306a36Sopenharmony_ci	#define PM3RLCount_Count(c)			((c) & 0x0fff)
98962306a36Sopenharmony_ci#define PM3RLData						0xb670
99062306a36Sopenharmony_ci
99162306a36Sopenharmony_ci/**********************************************
99262306a36Sopenharmony_ci*  GLINT Permedia3 Alias Register	     *
99362306a36Sopenharmony_ci***********************************************/
99462306a36Sopenharmony_ci#define PM3FillBackgroundColor					0x8330
99562306a36Sopenharmony_ci#define PM3FillConfig2D0					0x8338
99662306a36Sopenharmony_ci#define PM3FillConfig2D1					0x8360
99762306a36Sopenharmony_ci	#define PM3FillConfig2D_OpaqueSpan			(1 << 0)
99862306a36Sopenharmony_ci	#define PM3FillConfig2D_MultiRXBlit			(1 << 1)
99962306a36Sopenharmony_ci	#define PM3FillConfig2D_UserScissorEnable		(1 << 2)
100062306a36Sopenharmony_ci	#define PM3FillConfig2D_FBDestReadEnable		(1 << 3)
100162306a36Sopenharmony_ci	#define PM3FillConfig2D_AlphaBlendEnable		(1 << 4)
100262306a36Sopenharmony_ci	#define PM3FillConfig2D_DitherEnable			(1 << 5)
100362306a36Sopenharmony_ci	#define PM3FillConfig2D_ForegroundROPEnable		(1 << 6)
100462306a36Sopenharmony_ci	#define PM3FillConfig2D_ForegroundROP(rop)	(((rop) & 0xf) << 7)
100562306a36Sopenharmony_ci	#define PM3FillConfig2D_BackgroundROPEnable		(1 << 11)
100662306a36Sopenharmony_ci	#define PM3FillConfig2D_BackgroundROP(rop)	(((rop) & 0xf) << 12)
100762306a36Sopenharmony_ci	#define PM3FillConfig2D_UseConstantSource		(1 << 16)
100862306a36Sopenharmony_ci	#define PM3FillConfig2D_FBWriteEnable			(1 << 17)
100962306a36Sopenharmony_ci	#define PM3FillConfig2D_Blocking			(1 << 18)
101062306a36Sopenharmony_ci	#define PM3FillConfig2D_ExternalSourceData		(1 << 19)
101162306a36Sopenharmony_ci	#define PM3FillConfig2D_LUTModeEnable			(1 << 20)
101262306a36Sopenharmony_ci#define PM3FillFBDestReadBufferAddr				0x8310
101362306a36Sopenharmony_ci#define PM3FillFBSourceReadBufferAddr				0x8308
101462306a36Sopenharmony_ci#define PM3FillFBSourceReadBufferOffset				0x8340
101562306a36Sopenharmony_ci	#define PM3FillFBSourceReadBufferOffset_XOffset(x) ((x) & 0xffff)
101662306a36Sopenharmony_ci	#define PM3FillFBSourceReadBufferOffset_YOffset(y)	\
101762306a36Sopenharmony_ci						(((y) & 0xffff) << 16)
101862306a36Sopenharmony_ci#define PM3FillFBWriteBufferAddr				0x8300
101962306a36Sopenharmony_ci#define PM3FillForegroundColor0					0x8328
102062306a36Sopenharmony_ci#define PM3FillForegroundColor1					0x8358
102162306a36Sopenharmony_ci#define PM3FillGlyphPosition					0x8368
102262306a36Sopenharmony_ci	#define PM3FillGlyphPosition_XOffset(x)		((x) & 0xffff)
102362306a36Sopenharmony_ci	#define PM3FillGlyphPosition_YOffset(y)		(((y) & 0xffff) << 16)
102462306a36Sopenharmony_ci#define PM3FillRectanglePosition				0x8348
102562306a36Sopenharmony_ci	#define PM3FillRectanglePosition_XOffset(x)	((x) & 0xffff)
102662306a36Sopenharmony_ci	#define PM3FillRectanglePosition_YOffset(y)	(((y) & 0xffff) << 16)
102762306a36Sopenharmony_ci
102862306a36Sopenharmony_ci/* a few more useful registers & regs value... */
102962306a36Sopenharmony_ci#define PM3Sync							0x8c40
103062306a36Sopenharmony_ci	#define PM3Sync_Tag					0x188
103162306a36Sopenharmony_ci#define PM3FilterMode						0x8c00
103262306a36Sopenharmony_ci	#define PM3FilterModeSync				0x400
103362306a36Sopenharmony_ci#define PM3OutputFifo						0x2000
103462306a36Sopenharmony_ci#define PM3StatisticMode					0x8c08
103562306a36Sopenharmony_ci#define PM3AreaStippleMode					0x81a0
103662306a36Sopenharmony_ci#define AreaStipplePattern_indexed(i)		(0x8200 + ((i) * 0x8))
103762306a36Sopenharmony_ci
103862306a36Sopenharmony_ci#define PM3DepthMode						0x89a0
103962306a36Sopenharmony_ci#define PM3StencilMode						0x8988
104062306a36Sopenharmony_ci#define PM3StencilData						0x8990
104162306a36Sopenharmony_ci#define PM3TextureReadMode					0x8670
104262306a36Sopenharmony_ci#define PM3FogMode						0x8690
104362306a36Sopenharmony_ci#define PM3ChromaTestMode					0x8f18
104462306a36Sopenharmony_ci#define PM3YUVMode						0x8f00
104562306a36Sopenharmony_ci#define PM3BitMaskPattern					0x8068
104662306a36Sopenharmony_ci
104762306a36Sopenharmony_ci/* ***************************** */
104862306a36Sopenharmony_ci/* ***** pm3fb IOCTL const ***** */
104962306a36Sopenharmony_ci/* ***************************** */
105062306a36Sopenharmony_ci#define PM3FBIO_RESETCHIP		0x504D33FF /* 'PM3\377' */
105162306a36Sopenharmony_ci
105262306a36Sopenharmony_ci/* ***************************************** */
105362306a36Sopenharmony_ci/* ***** pm3fb useful define and macro ***** */
105462306a36Sopenharmony_ci/* ***************************************** */
105562306a36Sopenharmony_ci
105662306a36Sopenharmony_ci/* fifo size in chip */
105762306a36Sopenharmony_ci#define PM3_FIFO_SIZE						120
105862306a36Sopenharmony_ci#define PM3_REGS_SIZE						0x10000
105962306a36Sopenharmony_ci#define PM3_MAX_PIXCLOCK					300000
106062306a36Sopenharmony_ci
106162306a36Sopenharmony_ci#endif /* PM3FB_H */
1062