Skip to content

Commit

Permalink
update registers header
Browse files Browse the repository at this point in the history
  • Loading branch information
robclark committed Mar 7, 2013
1 parent 026c991 commit 4ca701e
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 17 deletions.
97 changes: 81 additions & 16 deletions src/freedreno_z1xx.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ enum z1xx_reg {
G2D_ROP = 0x0d,
G2D_CONFIG = 0x0e,
G2D_INPUT = 0x0f,
G2D_MASK = 0x10,
G2D_BLENDERCFG = 0x11,
G2D_CONST0 = 0xb0,
G2D_CONST1 = 0xb1,
Expand All @@ -56,6 +57,18 @@ enum z1xx_reg {
G2D_SXY2 = 0xf3,
G2D_IDLE = 0xfe,
G2D_COLOR = 0xff,
G2D_BLEND_A0 = 0x14,
G2D_BLEND_A1 = 0x15,
G2D_BLEND_A2 = 0x16,
G2D_BLEND_A3 = 0x17,
G2D_BLEND_C0 = 0x18,
G2D_BLEND_C1 = 0x19,
G2D_BLEND_C2 = 0x1a,
G2D_BLEND_C3 = 0x1b,
G2D_BLEND_C4 = 0x1c,
G2D_BLEND_C5 = 0x1d,
G2D_BLEND_C6 = 0x1e,
G2D_BLEND_C7 = 0x1f,

VGV1_DIRTYBASE = 0x29,
VGV1_CBASE1 = 0x2a,
Expand All @@ -66,28 +79,56 @@ enum z1xx_reg {
VGV3_WRITERAW = 0x7c,
VGV3_LAST = 0x7f,

GRADW_CONST0 = 0xc0,
GRADW_CONST1 = 0xc1,
GRADW_CONST2 = 0xc2,
GRADW_CONST3 = 0xc3,
GRADW_CONST4 = 0xc4,
GRADW_CONST5 = 0xc5,
GRADW_CONST6 = 0xc6,
GRADW_CONST7 = 0xc7,
GRADW_CONST8 = 0xc8,
GRADW_CONST9 = 0xc9,
GRADW_CONSTA = 0xca,
GRADW_CONSTB = 0xcb,
GRADW_TEXCFG = 0xd1,
GRADW_TEXSIZE = 0xd2,
GRADW_TEXBASE = 0xd3,
GRADW_TEXCFG2 = 0xd5,
GRADW_INST0 = 0xe0,
GRADW_INST1 = 0xe1,
GRADW_INST2 = 0xe2,
GRADW_INST3 = 0xe3,
GRADW_INST4 = 0xe4,
GRADW_INST5 = 0xe5,
GRADW_INST6 = 0xe6,
GRADW_INST7 = 0xe7,

};

enum g2d_format {
GRADW_1 = 0,
GRADW_1BW = 1,
GRADW_4 = 2,
GRADW_8 = 3,
GRADW_4444 = 4,
GRADW_1555 = 5,
GRADW_0565 = 6,
GRADW_8888 = 7,
GRADW_YUY2 = 8,
GRADW_UYVY = 9,
GRADW_YVYU = 10,
GRADW_4444_RGBA = 11,
GRADW_5551_RGBA = 12,
GRADW_8888_RGBA = 13,
GRADW_A8 = 14,
G2D_1 = 0,
G2D_1BW = 1,
G2D_4 = 2,
G2D_8 = 3,
G2D_4444 = 4,
G2D_1555 = 5,
G2D_0565 = 6,
G2D_8888 = 7,
G2D_YUY2 = 8,
G2D_UYVY = 9,
G2D_YVYU = 10,
G2D_4444_RGBA = 11,
G2D_5551_RGBA = 12,
G2D_8888_RGBA = 13,
G2D_A8 = 14,
};

enum g2d_wrap {
G2D_CLAMP = 0,
G2D_REPEAT = 1,
G2D_MIRROR = 2,
G2D_BORDER = 3,
};

/* used to write one register.. at most 24 bits or maybe less, register
Expand Down Expand Up @@ -197,12 +238,36 @@ static inline uint32_t GRADW_TEXCFG_FORMAT(enum g2d_format fmt)
{
return (fmt & 0xf) << 12;
}
#define GRADW_TEXCFG_SWAPBITS (1 << 30)
#define GRADW_TEXCFG_TILED (1 << 16)
static inline uint32_t GRADW_TEXCFG_WRAPU(enum g2d_wrap wrap)
{
return (wrap & 0x3) << 17;
}
static inline uint32_t GRADW_TEXCFG_WRAPV(enum g2d_wrap wrap)
{
return (wrap & 0x3) << 19;
}
#define GRADW_TEXCFG_BILIN (1 << 21)
#define GRADW_TEXCFG_SRGB (1 << 22)
#define GRADW_TEXCFG_PREMULTIPLY (1 << 23)
#define GRADW_TEXCFG_SWAPWORDS (1 << 24)
#define GRADW_TEXCFG_SWAPBYTES (1 << 25)
#define GRADW_TEXCFG_SWAPALL (1 << 26)
#define GRADW_TEXCFG_SWAPRB (1 << 27)
#define GRADW_TEXCFG_TEX2D (1 << 28)
#define GRADW_TEXCFG_SWAPBITS (1 << 29)


/*
* Bits for GRADW_TEXCFG2:
*/
#define GRADW_TEXCFG2_ALPHA_TEX (1 << 7)


/*
* Bits for GRADW_TEXSIZE:
*/
#define GRADW_TEXSIZE_WIDTH(val) ((val) & 0x7ff)
#define GRADW_TEXSIZE_HEIGHT(val) (((val) & 0x7ff) << 13)

#endif /* FREEDRENO_Z1XX_H_ */
2 changes: 1 addition & 1 deletion src/msm-exa.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ static const uint32_t composite_op_dwords[4][PictOpAdd+1][4] = {
static inline enum g2d_format
pixfmt(PixmapPtr pix)
{
return (pix->drawable.depth == 8) ? GRADW_A8 : GRADW_8888;
return (pix->drawable.depth == 8) ? G2D_A8 : G2D_8888;
}

/* 15 dwords */
Expand Down

0 comments on commit 4ca701e

Please sign in to comment.