#include "freedreno_context.h"
-#include "ir3_shader.h"
+#include "ir3/ir3_shader.h"
#include "a6xx.xml.h"
struct fd6_context {
struct fd_context base;
- struct fd_bo *vs_pvt_mem, *fs_pvt_mem;
-
/* Two buffers related to hw binning / visibility stream (VSC).
* Compared to previous generations
* (1) we cannot specify individual buffers per VSC, instead
*/
struct fd_bo *vsc_data, *vsc_data2;
-// TODO annoyingly large sizes to prevent hangs with larger amounts
-// of geometry, like aquarium with max # of fish. Need to figure
-// out how to calculate the required size.
-#define A6XX_VSC_DATA_PITCH 0x4400
-#define A6XX_VSC_DATA2_PITCH 0x10400
+ unsigned vsc_data_pitch, vsc_data2_pitch;
- /* TODO not sure what this is for.. probably similar to
- * CACHE_FLUSH_TS on kernel side, where value gets written
- * to this address synchronized w/ 3d (ie. a way to
- * synchronize when the CP is running far ahead)
+ /* The 'control' mem BO is used for various housekeeping
+ * functions. See 'struct fd6_control'
*/
- struct fd_bo *blit_mem;
+ struct fd_bo *control_mem;
uint32_t seqno;
struct u_upload_mgr *border_color_uploader;
*/
uint16_t fsaturate_s, fsaturate_t, fsaturate_r;
- /* bitmask of samplers which need astc srgb workaround: */
- uint16_t vastc_srgb, fastc_srgb;
-
/* some state changes require a different shader variant. Keep
* track of this so we know when we need to re-emit shader state
* due to variant change. See fixup_shader_state()
uint16_t tex_seqno;
struct hash_table *tex_cache;
+
+ /* collection of magic register values which differ between
+ * various different a6xx
+ */
+ struct {
+ uint32_t RB_UNKNOWN_8E04_blit; /* value for CP_BLIT's */
+ uint32_t RB_CCU_CNTL_bypass; /* for sysmem rendering */
+ uint32_t RB_CCU_CNTL_gmem; /* for GMEM rendering */
+ uint32_t PC_UNKNOWN_9805;
+ uint32_t SP_UNKNOWN_A0F8;
+
+ } magic;
};
static inline struct fd6_context *
struct pipe_context *
fd6_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags);
+
+/* This struct defines the layout of the fd6_context::control buffer: */
+struct fd6_control {
+ uint32_t seqno; /* seqno for async CP_EVENT_WRITE, etc */
+ uint32_t _pad0;
+ volatile uint32_t vsc_overflow;
+ uint32_t _pad1;
+ /* flag set from cmdstream when VSC overflow detected: */
+ uint32_t vsc_scratch;
+ uint32_t _pad2;
+ uint32_t _pad3;
+ uint32_t _pad4;
+
+ /* scratch space for VPC_SO[i].FLUSH_BASE_LO/HI, start on 32 byte boundary. */
+ struct {
+ uint32_t offset;
+ uint32_t pad[7];
+ } flush_base[4];
+};
+
+#define control_ptr(fd6_ctx, member) \
+ (fd6_ctx)->control_mem, offsetof(struct fd6_control, member), 0, 0
+
+
static inline void
emit_marker6(struct fd_ringbuffer *ring, int scratch_idx)
{