radeonsi: move si_screen_clear_buffer into si_compute_blit.c w/o SDMA option

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7908>
This commit is contained in:
Marek Olšák 2020-12-03 17:10:06 -05:00 committed by Marge Bot
parent 5fca7cd8b8
commit ab1377cf92
3 changed files with 13 additions and 13 deletions

View file

@ -372,6 +372,17 @@ void si_clear_buffer(struct si_context *sctx, struct pipe_resource *dst, uint64_
}
}
void si_screen_clear_buffer(struct si_screen *sscreen, struct pipe_resource *dst, uint64_t offset,
uint64_t size, unsigned value)
{
struct si_context *ctx = (struct si_context *)sscreen->aux_context;
simple_mtx_lock(&sscreen->aux_context_lock);
ctx->b.clear_buffer(&ctx->b, dst, offset, size, &value, 4);
sscreen->aux_context->flush(sscreen->aux_context, NULL, 0);
simple_mtx_unlock(&sscreen->aux_context_lock);
}
static void si_pipe_clear_buffer(struct pipe_context *ctx, struct pipe_resource *dst,
unsigned offset, unsigned size, const void *clear_value,
int clear_value_size)

View file

@ -317,14 +317,3 @@ void si_flush_dma_cs(struct si_context *ctx, unsigned flags, struct pipe_fence_h
si_clear_saved_cs(&saved);
}
}
void si_screen_clear_buffer(struct si_screen *sscreen, struct pipe_resource *dst, uint64_t offset,
uint64_t size, unsigned value)
{
struct si_context *ctx = (struct si_context *)sscreen->aux_context;
simple_mtx_lock(&sscreen->aux_context_lock);
si_sdma_clear_buffer(ctx, dst, offset, size, value);
sscreen->aux_context->flush(sscreen->aux_context, NULL, 0);
simple_mtx_unlock(&sscreen->aux_context_lock);
}

View file

@ -1356,6 +1356,8 @@ void si_launch_grid_internal(struct si_context *sctx, struct pipe_grid_info *inf
void si_clear_buffer(struct si_context *sctx, struct pipe_resource *dst, uint64_t offset,
uint64_t size, uint32_t *clear_value, uint32_t clear_value_size,
enum si_coherency coher, bool force_cpdma);
void si_screen_clear_buffer(struct si_screen *sscreen, struct pipe_resource *dst, uint64_t offset,
uint64_t size, unsigned value);
void si_copy_buffer(struct si_context *sctx, struct pipe_resource *dst, struct pipe_resource *src,
uint64_t dst_offset, uint64_t src_offset, unsigned size);
void si_compute_copy_image(struct si_context *sctx, struct pipe_resource *dst, unsigned dst_level,
@ -1427,8 +1429,6 @@ void si_sdma_copy_buffer(struct si_context *sctx, struct pipe_resource *dst,
void si_need_dma_space(struct si_context *ctx, unsigned num_dw, struct si_resource *dst,
struct si_resource *src);
void si_flush_dma_cs(struct si_context *ctx, unsigned flags, struct pipe_fence_handle **fence);
void si_screen_clear_buffer(struct si_screen *sscreen, struct pipe_resource *dst, uint64_t offset,
uint64_t size, unsigned value);
/* si_fence.c */
void si_cp_release_mem(struct si_context *ctx, struct radeon_cmdbuf *cs, unsigned event,