#include "r600_public.h"
#include "r600_resource.h"
-#define R600_NUM_ATOMS 40
-
-#define R600_TRACE_CS 0
+#define R600_NUM_ATOMS 41
/* the number of CS dwords for flushing and drawing */
#define R600_MAX_FLUSH_CS_DWORDS 16
pipe_mutex mutex;
};
-enum r600_msaa_texture_mode {
- /* If the hw can fetch the first sample only (no decompression available).
- * This means MSAA texturing is not fully implemented. */
- MSAA_TEXTURE_SAMPLE_ZERO,
-
- /* If the hw can fetch decompressed MSAA textures.
- * Supported families: R600, R700, Evergreen.
- * Cayman cannot use this, because it cannot do the decompression. */
- MSAA_TEXTURE_DECOMPRESSED,
-
- /* If the hw can fetch compressed MSAA textures, which means shaders can
- * read resolved FMASK. This yields the best performance.
- * Supported families: Evergreen, Cayman. */
- MSAA_TEXTURE_COMPRESSED
-};
-
typedef boolean (*r600g_dma_blit_t)(struct pipe_context *ctx,
struct pipe_resource *dst,
unsigned dst_level,
/* logging */
#define DBG_TEX_DEPTH (1 << 0)
#define DBG_COMPUTE (1 << 1)
-#define DBG_VM (1 << 2)
+#define DBG_VM (1 << 2)
+#define DBG_TRACE_CS (1 << 3)
/* shaders */
#define DBG_FS (1 << 8)
#define DBG_VS (1 << 9)
#define DBG_NO_CP_DMA (1 << 18)
#define DBG_NO_ASYNC_DMA (1 << 19)
#define DBG_NO_DISCARD_RANGE (1 << 20)
+/* shader backend */
+#define DBG_SB (1 << 21)
+#define DBG_SB_CS (1 << 22)
+#define DBG_SB_DRY_RUN (1 << 23)
+#define DBG_SB_STAT (1 << 24)
+#define DBG_SB_DUMP (1 << 25)
+#define DBG_SB_NO_FALLBACK (1 << 26)
+#define DBG_SB_DISASM (1 << 27)
struct r600_tiling_info {
unsigned num_channels;
bool has_streamout;
bool has_msaa;
bool has_cp_dma;
- enum r600_msaa_texture_mode msaa_texture_support;
+ bool has_compressed_msaa_texturing;
struct r600_tiling_info tiling_info;
struct r600_pipe_fences fences;
* XXX: Not sure if this is the best place for global_pool. Also,
* it's not thread safe, so it won't work with multiple contexts. */
struct compute_memory_pool *global_pool;
-#if R600_TRACE_CS
struct r600_resource *trace_bo;
uint32_t *trace_ptr;
unsigned cs_count;
-#endif
r600g_dma_blit_t dma_blit;
+
+ /* Auxiliary context. Mainly used to initialize resources.
+ * It must be locked prior to using and flushed before unlocking. */
+ struct pipe_context *aux_context;
+ pipe_mutex aux_context_lock;
};
struct r600_pipe_sampler_view {
void *custom_dsa_flush;
void *custom_blend_resolve;
void *custom_blend_decompress;
- void *custom_blend_fmask_decompress;
/* With rasterizer discard, there doesn't have to be a pixel shader.
* In that case, we bind this one: */
void *dummy_pixel_shader;
unsigned current_render_cond_mode;
boolean predicate_drawing;
+ void *sb_context;
struct r600_isa *isa;
};
cs->cdw += cb->num_dw;
}
-#if R600_TRACE_CS
void r600_trace_emit(struct r600_context *rctx);
-#endif
static INLINE void r600_emit_atom(struct r600_context *rctx, struct r600_atom *atom)
{
atom->emit(rctx, atom);
atom->dirty = false;
-#if R600_TRACE_CS
if (rctx->screen->trace_bo) {
r600_trace_emit(rctx);
}
-#endif
}
static INLINE void r600_set_cso_state(struct r600_cso_state *state, void *cso)
void *evergreen_create_db_flush_dsa(struct r600_context *rctx);
void *evergreen_create_resolve_blend(struct r600_context *rctx);
void *evergreen_create_decompress_blend(struct r600_context *rctx);
-void *evergreen_create_fmask_decompress_blend(struct r600_context *rctx);
boolean evergreen_is_format_supported(struct pipe_screen *screen,
enum pipe_format format,
enum pipe_texture_target target,
/* r600_blit.c */
void r600_copy_buffer(struct pipe_context *ctx, struct pipe_resource *dst, unsigned dstx,
struct pipe_resource *src, const struct pipe_box *src_box);
+void r600_screen_clear_buffer(struct r600_screen *rscreen, struct pipe_resource *dst,
+ unsigned offset, unsigned size, unsigned char value);
void r600_init_blit_functions(struct r600_context *rctx);
void r600_blit_decompress_depth(struct pipe_context *ctx,
struct r600_texture *texture,
struct pipe_resource *dst, uint64_t dst_offset,
struct pipe_resource *src, uint64_t src_offset,
unsigned size);
+void evergreen_cp_dma_clear_buffer(struct r600_context *rctx,
+ struct pipe_resource *dst, uint64_t offset,
+ unsigned size, uint32_t clear_value);
void r600_dma_copy(struct r600_context *rctx,
struct pipe_resource *dst,
struct pipe_resource *src,
struct pipe_video_buffer *r600_video_buffer_create(struct pipe_context *pipe,
const struct pipe_video_buffer *tmpl);
+int r600_uvd_get_video_param(struct pipe_screen *screen,
+ enum pipe_video_profile profile,
+ enum pipe_video_cap param);
/*
* Helpers for building command buffers
r600_write_value(cs, value);
}
+static INLINE void r600_write_context_reg_flag(struct radeon_winsys_cs *cs, unsigned reg, unsigned value, unsigned flag)
+{
+ if (flag & RADEON_CP_PACKET3_COMPUTE_MODE) {
+ r600_write_compute_context_reg(cs, reg, value);
+ } else {
+ r600_write_context_reg(cs, reg, value);
+ }
+
+}
static INLINE void r600_write_ctl_const(struct radeon_winsys_cs *cs, unsigned reg, unsigned value)
{
r600_write_ctl_const_seq(cs, reg, 1);