radeonsi: remove si_resource_create_custom

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
This commit is contained in:
Marek Olšák 2016-10-24 23:29:50 +02:00
parent 29144d0f34
commit ad45dce4a2
5 changed files with 11 additions and 20 deletions

View file

@ -276,9 +276,9 @@ static bool si_setup_compute_scratch_buffer(struct si_context *sctx,
if (scratch_bo_size < scratch_needed) {
r600_resource_reference(&sctx->compute_scratch_buffer, NULL);
sctx->compute_scratch_buffer =
si_resource_create_custom(&sctx->screen->b.b,
PIPE_USAGE_DEFAULT, scratch_needed);
sctx->compute_scratch_buffer = (struct r600_resource*)
pipe_buffer_create(&sctx->screen->b.b, 0,
PIPE_USAGE_DEFAULT, scratch_needed);
if (!sctx->compute_scratch_buffer)
return false;

View file

@ -236,10 +236,9 @@ static void si_cp_dma_realign_engine(struct si_context *sctx, unsigned size)
if (!sctx->scratch_buffer ||
sctx->scratch_buffer->b.b.width0 < scratch_size) {
r600_resource_reference(&sctx->scratch_buffer, NULL);
sctx->scratch_buffer =
si_resource_create_custom(&sctx->screen->b.b,
PIPE_USAGE_DEFAULT,
scratch_size);
sctx->scratch_buffer = (struct r600_resource*)
pipe_buffer_create(&sctx->screen->b.b, 0,
PIPE_USAGE_DEFAULT, scratch_size);
if (!sctx->scratch_buffer)
return;
sctx->emit_scratch_reloc = true;

View file

@ -401,14 +401,6 @@ struct pipe_video_buffer *si_video_buffer_create(struct pipe_context *pipe,
* common helpers
*/
static inline struct r600_resource *
si_resource_create_custom(struct pipe_screen *screen,
unsigned usage, unsigned size)
{
assert(size);
return r600_resource(pipe_buffer_create(screen, 0, usage, size));
}
static inline void
si_invalidate_draw_sh_constants(struct si_context *sctx)
{

View file

@ -5977,9 +5977,9 @@ int si_shader_binary_upload(struct si_screen *sscreen, struct si_shader *shader)
assert(!epilog || !epilog->rodata_size);
r600_resource_reference(&shader->bo, NULL);
shader->bo = si_resource_create_custom(&sscreen->b.b,
PIPE_USAGE_IMMUTABLE,
bo_size);
shader->bo = (struct r600_resource*)
pipe_buffer_create(&sscreen->b.b, 0,
PIPE_USAGE_IMMUTABLE, bo_size);
if (!shader->bo)
return -ENOMEM;

View file

@ -1905,8 +1905,8 @@ static bool si_update_spi_tmpring_size(struct si_context *sctx)
/* Create a bigger scratch buffer */
r600_resource_reference(&sctx->scratch_buffer, NULL);
sctx->scratch_buffer =
si_resource_create_custom(&sctx->screen->b.b,
sctx->scratch_buffer = (struct r600_resource*)
pipe_buffer_create(&sctx->screen->b.b, 0,
PIPE_USAGE_DEFAULT, scratch_needed_size);
if (!sctx->scratch_buffer)
return false;