summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno/freedreno_util.h
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2013-05-26 17:13:27 -0400
committerRob Clark <[email protected]>2013-06-08 13:15:51 -0400
commit18c317b21ddc2ec4538544f9dd69dc568dcf821f (patch)
tree224e3c0464dcedabbf5784e5c3def952473fd8f8 /src/gallium/drivers/freedreno/freedreno_util.h
parent213c207b3ac40ae769afe01b8578f566b5e7840d (diff)
freedreno: prepare for a3xx
Split the parts that are specific to adreno a2xx series GPUs from the parts that will be in common with a3xx, so that a3xx support can be added more cleanly. Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/freedreno_util.h')
-rw-r--r--src/gallium/drivers/freedreno/freedreno_util.h31
1 files changed, 19 insertions, 12 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_util.h b/src/gallium/drivers/freedreno/freedreno_util.h
index f73f792857b..f18f0fee989 100644
--- a/src/gallium/drivers/freedreno/freedreno_util.h
+++ b/src/gallium/drivers/freedreno/freedreno_util.h
@@ -38,14 +38,13 @@
#include "adreno_common.xml.h"
#include "adreno_pm4.xml.h"
-#include "a2xx.xml.h"
-enum a2xx_sq_surfaceformat fd_pipe2surface(enum pipe_format format);
-enum a2xx_colorformatx fd_pipe2color(enum pipe_format format);
-enum a2xx_rb_depth_format fd_pipe2depth(enum pipe_format format);
+enum adreno_rb_depth_format fd_pipe2depth(enum pipe_format format);
enum pc_di_index_size fd_pipe2index(enum pipe_format format);
-uint32_t fd_tex_swiz(enum pipe_format format, unsigned swizzle_r,
- unsigned swizzle_g, unsigned swizzle_b, unsigned swizzle_a);
+enum adreno_rb_blend_factor fd_blend_factor(unsigned factor);
+enum adreno_rb_blend_opcode fd_blend_func(unsigned func);
+enum adreno_pa_su_sc_draw fd_polygon_mode(unsigned mode);
+enum adreno_stencil_op fd_stencil_op(unsigned op);
#define FD_DBG_MSGS 0x1
@@ -61,6 +60,8 @@ extern int fd_mesa_debug;
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
+/* for conditionally setting boolean flag(s): */
+#define COND(bool, val) ((bool) ? (val) : 0)
#define CP_REG(reg) ((0x4 << 16) | ((unsigned int)((reg) - (0x2000))))
@@ -76,12 +77,6 @@ static inline uint32_t DRAW(enum pc_di_primtype prim_type,
(1 << 14);
}
-/* convert x,y to dword */
-static inline uint32_t xy2d(uint16_t x, uint16_t y)
-{
- return ((y & 0x3fff) << 16) | (x & 0x3fff);
-}
-
#define LOG_DWORDS 0
@@ -106,6 +101,18 @@ OUT_RELOC(struct fd_ringbuffer *ring, struct fd_bo *bo,
fd_ringbuffer_emit_reloc(ring, bo, offset, or);
}
+/* shifted reloc: */
+static inline void
+OUT_RELOCS(struct fd_ringbuffer *ring, struct fd_bo *bo,
+ uint32_t offset, uint32_t or, int32_t shift)
+{
+ if (LOG_DWORDS) {
+ DBG("ring[%p]: OUT_RELOCS %04x: %p+%u << %d", ring,
+ (uint32_t)(ring->cur - ring->last_start), bo, offset, shift);
+ }
+ fd_ringbuffer_emit_reloc_shift(ring, bo, offset, or, shift);
+}
+
static inline void BEGIN_RING(struct fd_ringbuffer *ring, uint32_t ndwords)
{
if ((ring->cur + ndwords) >= ring->end) {