summaryrefslogtreecommitdiff
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2018-01-03 12:42:13 -0800
committerEric Anholt <eric@anholt.net>2018-01-12 21:51:47 -0800
commit2c48ce74f7b8ac9a2a47f6f8db7fe9b1639e3755 (patch)
tree2a5d05c5859f1980483260b267376330e83c99b0 /src/gallium/drivers
parentfb4face86ad9f58ea0410c3633fda211836b7df5 (diff)
broadcom/vc5: Convert vc5_cl.h to use the V3DX() macros.
To conditionally compile cl_emit() macros per V3D version, we need it to expand to whatever V3D we're building for. This required emitting #define V3D_VERSION 33 in all our currently 3.3-only code.
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/vc5/vc5_cl.c5
-rw-r--r--src/gallium/drivers/vc5/vc5_cl.h8
-rw-r--r--src/gallium/drivers/vc5/vc5_draw.c4
-rw-r--r--src/gallium/drivers/vc5/vc5_emit.c4
-rw-r--r--src/gallium/drivers/vc5/vc5_job.c5
-rw-r--r--src/gallium/drivers/vc5/vc5_rcl.c4
-rw-r--r--src/gallium/drivers/vc5/vc5_state.c4
7 files changed, 24 insertions, 10 deletions
diff --git a/src/gallium/drivers/vc5/vc5_cl.c b/src/gallium/drivers/vc5/vc5_cl.c
index 37d96c4360..a10c1649e0 100644
--- a/src/gallium/drivers/vc5/vc5_cl.c
+++ b/src/gallium/drivers/vc5/vc5_cl.c
@@ -24,7 +24,10 @@
#include "util/u_math.h"
#include "util/ralloc.h"
#include "vc5_context.h"
-#include "broadcom/cle/v3d_packet_v33_pack.h"
+/* The branching packets are the same across V3D versions. */
+#define V3D_VERSION 33
+#include "broadcom/common/v3d_macros.h"
+#include "broadcom/cle/v3dx_pack.h"
void
vc5_init_cl(struct vc5_job *job, struct vc5_cl *cl)
diff --git a/src/gallium/drivers/vc5/vc5_cl.h b/src/gallium/drivers/vc5/vc5_cl.h
index f62376e296..7025b5a672 100644
--- a/src/gallium/drivers/vc5/vc5_cl.h
+++ b/src/gallium/drivers/vc5/vc5_cl.h
@@ -185,10 +185,10 @@ cl_address(struct vc5_bo *bo, uint32_t offset)
uint32_t vc5_cl_ensure_space(struct vc5_cl *cl, uint32_t size, uint32_t align);
void vc5_cl_ensure_space_with_branch(struct vc5_cl *cl, uint32_t size);
-#define cl_packet_header(packet) V3D33_ ## packet ## _header
-#define cl_packet_length(packet) V3D33_ ## packet ## _length
-#define cl_packet_pack(packet) V3D33_ ## packet ## _pack
-#define cl_packet_struct(packet) V3D33_ ## packet
+#define cl_packet_header(packet) V3DX(packet ## _header)
+#define cl_packet_length(packet) V3DX(packet ## _length)
+#define cl_packet_pack(packet) V3DX(packet ## _pack)
+#define cl_packet_struct(packet) V3DX(packet)
static inline void *
cl_get_emit_space(struct vc5_cl_out **cl, size_t size)
diff --git a/src/gallium/drivers/vc5/vc5_draw.c b/src/gallium/drivers/vc5/vc5_draw.c
index d157531a17..18e8127311 100644
--- a/src/gallium/drivers/vc5/vc5_draw.c
+++ b/src/gallium/drivers/vc5/vc5_draw.c
@@ -32,8 +32,10 @@
#include "vc5_context.h"
#include "vc5_resource.h"
#include "vc5_cl.h"
-#include "broadcom/cle/v3d_packet_v33_pack.h"
#include "broadcom/compiler/v3d_compiler.h"
+#define V3D_VERSION 33
+#include "broadcom/common/v3d_macros.h"
+#include "broadcom/cle/v3dx_pack.h"
/**
* Does the initial bining command list setup for drawing to a given FBO.
diff --git a/src/gallium/drivers/vc5/vc5_emit.c b/src/gallium/drivers/vc5/vc5_emit.c
index 321f59d14c..bc484d696b 100644
--- a/src/gallium/drivers/vc5/vc5_emit.c
+++ b/src/gallium/drivers/vc5/vc5_emit.c
@@ -24,7 +24,9 @@
#include "util/u_format.h"
#include "util/u_half.h"
#include "vc5_context.h"
-#include "broadcom/cle/v3d_packet_v33_pack.h"
+#define V3D_VERSION 33
+#include "broadcom/common/v3d_macros.h"
+#include "broadcom/cle/v3dx_pack.h"
#include "broadcom/compiler/v3d_compiler.h"
static uint8_t
diff --git a/src/gallium/drivers/vc5/vc5_job.c b/src/gallium/drivers/vc5/vc5_job.c
index 0141802b43..07d39f3b22 100644
--- a/src/gallium/drivers/vc5/vc5_job.c
+++ b/src/gallium/drivers/vc5/vc5_job.c
@@ -28,11 +28,14 @@
#include <xf86drm.h>
#include "vc5_context.h"
+/* The OQ/semaphore packets are the same across V3D versions. */
+#define V3D_VERSION 33
+#include "broadcom/cle/v3dx_pack.h"
+#include "broadcom/common/v3d_macros.h"
#include "util/hash_table.h"
#include "util/ralloc.h"
#include "util/set.h"
#include "broadcom/clif/clif_dump.h"
-#include "broadcom/cle/v3d_packet_v33_pack.h"
static void
remove_from_ht(struct hash_table *ht, void *key)
diff --git a/src/gallium/drivers/vc5/vc5_rcl.c b/src/gallium/drivers/vc5/vc5_rcl.c
index f113d27961..659b839270 100644
--- a/src/gallium/drivers/vc5/vc5_rcl.c
+++ b/src/gallium/drivers/vc5/vc5_rcl.c
@@ -24,7 +24,9 @@
#include "util/u_format.h"
#include "vc5_context.h"
#include "vc5_tiling.h"
-#include "broadcom/cle/v3d_packet_v33_pack.h"
+#define V3D_VERSION 33
+#include "broadcom/common/v3d_macros.h"
+#include "broadcom/cle/v3dx_pack.h"
static void
load_raw(struct vc5_cl *cl, struct pipe_surface *psurf, int buffer)
diff --git a/src/gallium/drivers/vc5/vc5_state.c b/src/gallium/drivers/vc5/vc5_state.c
index 0d6699ae57..19e82c6c7d 100644
--- a/src/gallium/drivers/vc5/vc5_state.c
+++ b/src/gallium/drivers/vc5/vc5_state.c
@@ -31,7 +31,9 @@
#include "util/u_helpers.h"
#include "vc5_context.h"
-#include "broadcom/cle/v3d_packet_v33_pack.h"
+#define V3D_VERSION 33
+#include "broadcom/common/v3d_macros.h"
+#include "broadcom/cle/v3dx_pack.h"
static void *
vc5_generic_cso_state_create(const void *src, uint32_t size)