radeonsi: move enum si_cache_policy and si_get_flush_flags into si_cp_dma.c

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31168>
This commit is contained in:
Marek Olšák
2024-08-19 21:51:06 -04:00
parent b0ee7b0b8f
commit 9ed0530413
3 changed files with 13 additions and 14 deletions
@@ -12,12 +12,6 @@
#include "util/u_pack_color.h"
#include "ac_nir_meta.h"
unsigned si_get_flush_flags(struct si_context *sctx, enum si_cache_policy cache_policy)
{
return SI_CONTEXT_INV_SCACHE | SI_CONTEXT_INV_VCACHE |
(cache_policy == L2_BYPASS ? SI_CONTEXT_INV_L2 : 0);
}
static bool si_is_buffer_idle(struct si_context *sctx, struct si_resource *buf,
unsigned usage)
{
+13
View File
@@ -21,11 +21,24 @@
#define CP_DMA_PFP_SYNC_ME (1 << 4)
#define CP_DMA_SRC_IS_GDS (1 << 5)
enum si_cache_policy
{
L2_BYPASS,
L2_STREAM, /* same as SLC=1 */
L2_LRU, /* same as SLC=0 */
};
static enum si_cache_policy get_cache_policy(struct si_context *sctx)
{
return sctx->gfx_level >= GFX7 ? L2_LRU : L2_BYPASS;
}
static unsigned si_get_flush_flags(struct si_context *sctx, enum si_cache_policy cache_policy)
{
return SI_CONTEXT_INV_SCACHE | SI_CONTEXT_INV_VCACHE |
(cache_policy == L2_BYPASS ? SI_CONTEXT_INV_L2 : 0);
}
/* The max number of bytes that can be copied per packet. */
static inline unsigned cp_dma_max_byte_count(struct si_context *sctx)
{
-8
View File
@@ -263,13 +263,6 @@ enum
#define DBG_ALL_SHADERS (((1 << (DBG_CS + 1)) - 1))
#define DBG(name) (1ull << DBG_##name)
enum si_cache_policy
{
L2_BYPASS,
L2_STREAM, /* same as SLC=1 */
L2_LRU, /* same as SLC=0 */
};
#define SI_BIND_CONSTANT_BUFFER_SHIFT 0
#define SI_BIND_SHADER_BUFFER_SHIFT 6
#define SI_BIND_IMAGE_BUFFER_SHIFT 12
@@ -1481,7 +1474,6 @@ void si_destroy_compute(struct si_compute *program);
#define SI_OP_FAIL_IF_SLOW (1 << 9)
#define SI_OP_IS_NESTED (1 << 10)
unsigned si_get_flush_flags(struct si_context *sctx, enum si_cache_policy cache_policy);
bool si_should_blit_clamp_to_edge(const struct pipe_blit_info *info, unsigned coord_mask);
void si_launch_grid_internal_ssbos(struct si_context *sctx, struct pipe_grid_info *info,
void *shader, unsigned flags, unsigned num_buffers,