static void
vc4_rcl_tile_calls(struct vc4_context *vc4,
+ struct vc4_surface *csurf,
uint32_t xtiles, uint32_t ytiles)
{
+ struct vc4_resource *ctex = vc4_resource(csurf->base.texture);
+
for (int x = 0; x < xtiles; x++) {
for (int y = 0; y < ytiles; y++) {
cl_u8(&vc4->rcl, VC4_PACKET_TILE_COORDINATES);
cl_u8(&vc4->rcl, x);
cl_u8(&vc4->rcl, y);
+ cl_start_reloc(&vc4->rcl, 1);
+ cl_u8(&vc4->rcl, VC4_PACKET_LOAD_TILE_BUFFER_GENERAL);
+ cl_u8(&vc4->rcl,
+ VC4_LOADSTORE_TILE_BUFFER_COLOR |
+ VC4_LOADSTORE_TILE_BUFFER_FORMAT_RASTER);
+ cl_u8(&vc4->rcl,
+ VC4_LOADSTORE_TILE_BUFFER_RGBA8888);
+ cl_reloc(vc4, &vc4->rcl, ctex->bo, csurf->offset);
+
cl_start_reloc(&vc4->rcl, 1);
cl_u8(&vc4->rcl, VC4_PACKET_BRANCH_TO_SUB_LIST);
cl_reloc(vc4, &vc4->rcl, vc4->tile_alloc,
// Do a store of the first tile to force the tile buffer to be cleared
/* XXX: I think these two packets may be unnecessary. */
- cl_u8(&vc4->rcl, VC4_PACKET_TILE_COORDINATES);
- cl_u8(&vc4->rcl, 0);
- cl_u8(&vc4->rcl, 0);
-
- cl_u8(&vc4->rcl, VC4_PACKET_STORE_TILE_BUFFER_GENERAL);
- cl_u16(&vc4->rcl, 0); // Store nothing (just clear)
- cl_u32(&vc4->rcl, 0); // no address is needed
+ if (0) {
+ cl_u8(&vc4->rcl, VC4_PACKET_TILE_COORDINATES);
+ cl_u8(&vc4->rcl, 0);
+ cl_u8(&vc4->rcl, 0);
+
+ cl_u8(&vc4->rcl, VC4_PACKET_STORE_TILE_BUFFER_GENERAL);
+ cl_u16(&vc4->rcl, 0); // Store nothing (just clear)
+ cl_u32(&vc4->rcl, 0); // no address is needed
+ }
- vc4_rcl_tile_calls(vc4, tilew, tileh);
+ vc4_rcl_tile_calls(vc4, csurf, tilew, tileh);
vc4_flush(pctx);
}
} __attribute__ ((__packed__));
/** @{
- * byte 2 of VC4_PACKET_STORE_TILE_BUFFER_GENERAL (low bits of the
- * address)
+ *
+ * byte 2 of VC4_PACKET_STORE_TILE_BUFFER_GENERAL and
+ * VC4_PACKET_LOAD_TILE_BUFFER_GENERAL (low bits of the address)
*/
-#define VC4_STORE_TILE_BUFFER_DISABLE_FULL_VG_MASK_DUMP (1 << 2)
-#define VC4_STORE_TILE_BUFFER_DISABLE_FULL_ZS_DUMP (1 << 1)
-#define VC4_STORE_TILE_BUFFER_DISABLE_FULL_COLOR_DUMP (1 << 0)
+#define VC4_LOADSTORE_TILE_BUFFER_DISABLE_FULL_VG_MASK (1 << 2)
+#define VC4_LOADSTORE_TILE_BUFFER_DISABLE_FULL_ZS (1 << 1)
+#define VC4_LOADSTORE_TILE_BUFFER_DISABLE_FULL_COLOR (1 << 0)
/** @} */
-/** @{ byte 1 of VC4_PACKET_STORE_TILE_BUFFER_GENERAL */
+/** @{
+ *
+ * byte 1 of VC4_PACKET_STORE_TILE_BUFFER_GENERAL and
+ * VC4_PACKET_LOAD_TILE_BUFFER_GENERAL
+ */
#define VC4_STORE_TILE_BUFFER_DISABLE_VG_MASK_CLEAR (1 << 7)
#define VC4_STORE_TILE_BUFFER_DISABLE_ZS_CLEAR (1 << 6)
#define VC4_STORE_TILE_BUFFER_DISABLE_COLOR_CLEAR (1 << 5)
#define VC4_STORE_TILE_BUFFER_DISABLE_SWAP (1 << 4)
-#define VC4_STORE_TILE_BUFFER_RGBA8888 (0 << 0)
-#define VC4_STORE_TILE_BUFFER_BGR565_DITHER (1 << 0)
-#define VC4_STORE_TILE_BUFFER_BGR565 (2 << 0)
+#define VC4_LOADSTORE_TILE_BUFFER_RGBA8888 (0 << 0)
+#define VC4_LOADSTORE_TILE_BUFFER_BGR565_DITHER (1 << 0)
+#define VC4_LOADSTORE_TILE_BUFFER_BGR565 (2 << 0)
/** @} */
-/** @{ byte 0 of VC4_PACKET_STORE_TILE_BUFFER_GENERAL */
+/** @{
+ *
+ * byte 0 of VC4_PACKET_STORE_TILE_BUFFER_GENERAL and
+ * VC4_PACKET_LOAD_TILE_BUFFER_GENERAL
+ */
#define VC4_STORE_TILE_BUFFER_MODE_SAMPLE0 (0 << 6)
#define VC4_STORE_TILE_BUFFER_MODE_DECIMATE_X4 (1 << 6)
#define VC4_STORE_TILE_BUFFER_MODE_DECIMATE_X16 (2 << 6)
-#define VC4_STORE_TILE_BUFFER_FORMAT_RASTER (0 << 4)
-#define VC4_STORE_TILE_BUFFER_FORMAT_T (1 << 4)
-#define VC4_STORE_TILE_BUFFER_FORMAT_LT (2 << 4)
+#define VC4_LOADSTORE_TILE_BUFFER_FORMAT_RASTER (0 << 4)
+#define VC4_LOADSTORE_TILE_BUFFER_FORMAT_T (1 << 4)
+#define VC4_LOADSTORE_TILE_BUFFER_FORMAT_LT (2 << 4)
-#define VC4_STORE_TILE_BUFFER_NONE (0 << 0)
-#define VC4_STORE_TILE_BUFFER_COLOR (1 << 0)
-#define VC4_STORE_TILE_BUFFER_ZS (2 << 0)
-#define VC4_STORE_TILE_BUFFER_Z (3 << 0)
-#define VC4_STORE_TILE_BUFFER_VG_MASK (4 << 0)
-#define VC4_STORE_TILE_BUFFER_FULL (5 << 0)
+#define VC4_LOADSTORE_TILE_BUFFER_NONE (0 << 0)
+#define VC4_LOADSTORE_TILE_BUFFER_COLOR (1 << 0)
+#define VC4_LOADSTORE_TILE_BUFFER_ZS (2 << 0)
+#define VC4_LOADSTORE_TILE_BUFFER_Z (3 << 0)
+#define VC4_LOADSTORE_TILE_BUFFER_VG_MASK (4 << 0)
+#define VC4_LOADSTORE_TILE_BUFFER_FULL (5 << 0)
/** @} */
#define VC4_INDEX_BUFFER_U8 (0 << 4)