summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Clark <robdclark@gmail.com>2013-03-06 20:50:59 -0500
committerRob Clark <robdclark@gmail.com>2013-03-06 20:53:19 -0500
commit4ca701ecf72e79203db95668531e4e99bb6d4325 (patch)
tree760b7af0b40dff8cbefeca121b27428a0dbf3844
parent026c9916217538cb734fe27ef54df366c46a22cb (diff)
update registers header
-rw-r--r--src/freedreno_z1xx.h97
-rw-r--r--src/msm-exa.c2
2 files changed, 82 insertions, 17 deletions
diff --git a/src/freedreno_z1xx.h b/src/freedreno_z1xx.h
index 0626e1c..943cdbc 100644
--- a/src/freedreno_z1xx.h
+++ b/src/freedreno_z1xx.h
@@ -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,
@@ -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,
@@ -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
@@ -197,7 +238,24 @@ 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)
/*
@@ -205,4 +263,11 @@ static inline uint32_t GRADW_TEXCFG_FORMAT(enum g2d_format fmt)
*/
#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_ */
diff --git a/src/msm-exa.c b/src/msm-exa.c
index e4eb5b8..1f6d263 100644
--- a/src/msm-exa.c
+++ b/src/msm-exa.c
@@ -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 */