radeonsi: use R600_RESOURCE_FLAG_UNMAPPABLE where it's desirable
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
This commit is contained in:
parent
a41587433c
commit
45240ce598
|
@ -763,7 +763,9 @@ static void r600_texture_alloc_cmask_separate(struct r600_common_screen *rscreen
|
||||||
}
|
}
|
||||||
|
|
||||||
rtex->cmask_buffer = (struct r600_resource *)
|
rtex->cmask_buffer = (struct r600_resource *)
|
||||||
r600_aligned_buffer_create(&rscreen->b, 0, PIPE_USAGE_DEFAULT,
|
r600_aligned_buffer_create(&rscreen->b,
|
||||||
|
R600_RESOURCE_FLAG_UNMAPPABLE,
|
||||||
|
PIPE_USAGE_DEFAULT,
|
||||||
rtex->cmask.size,
|
rtex->cmask.size,
|
||||||
rtex->cmask.alignment);
|
rtex->cmask.alignment);
|
||||||
if (rtex->cmask_buffer == NULL) {
|
if (rtex->cmask_buffer == NULL) {
|
||||||
|
@ -874,7 +876,9 @@ static void r600_texture_allocate_htile(struct r600_common_screen *rscreen,
|
||||||
return;
|
return;
|
||||||
|
|
||||||
rtex->htile_buffer = (struct r600_resource*)
|
rtex->htile_buffer = (struct r600_resource*)
|
||||||
r600_aligned_buffer_create(&rscreen->b, 0, PIPE_USAGE_DEFAULT,
|
r600_aligned_buffer_create(&rscreen->b,
|
||||||
|
R600_RESOURCE_FLAG_UNMAPPABLE,
|
||||||
|
PIPE_USAGE_DEFAULT,
|
||||||
rtex->surface.htile_size,
|
rtex->surface.htile_size,
|
||||||
rtex->surface.htile_alignment);
|
rtex->surface.htile_alignment);
|
||||||
if (rtex->htile_buffer == NULL) {
|
if (rtex->htile_buffer == NULL) {
|
||||||
|
@ -2106,7 +2110,8 @@ static void vi_separate_dcc_try_enable(struct r600_common_context *rctx,
|
||||||
tex->last_dcc_separate_buffer = NULL;
|
tex->last_dcc_separate_buffer = NULL;
|
||||||
} else {
|
} else {
|
||||||
tex->dcc_separate_buffer = (struct r600_resource*)
|
tex->dcc_separate_buffer = (struct r600_resource*)
|
||||||
r600_aligned_buffer_create(rctx->b.screen, 0,
|
r600_aligned_buffer_create(rctx->b.screen,
|
||||||
|
R600_RESOURCE_FLAG_UNMAPPABLE,
|
||||||
PIPE_USAGE_DEFAULT,
|
PIPE_USAGE_DEFAULT,
|
||||||
tex->surface.dcc_size,
|
tex->surface.dcc_size,
|
||||||
tex->surface.dcc_alignment);
|
tex->surface.dcc_alignment);
|
||||||
|
|
|
@ -289,8 +289,10 @@ static bool si_setup_compute_scratch_buffer(struct si_context *sctx,
|
||||||
r600_resource_reference(&sctx->compute_scratch_buffer, NULL);
|
r600_resource_reference(&sctx->compute_scratch_buffer, NULL);
|
||||||
|
|
||||||
sctx->compute_scratch_buffer = (struct r600_resource*)
|
sctx->compute_scratch_buffer = (struct r600_resource*)
|
||||||
pipe_buffer_create(&sctx->screen->b.b, 0,
|
r600_aligned_buffer_create(&sctx->screen->b.b,
|
||||||
PIPE_USAGE_DEFAULT, scratch_needed);
|
R600_RESOURCE_FLAG_UNMAPPABLE,
|
||||||
|
PIPE_USAGE_DEFAULT,
|
||||||
|
scratch_needed, 256);
|
||||||
|
|
||||||
if (!sctx->compute_scratch_buffer)
|
if (!sctx->compute_scratch_buffer)
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -276,8 +276,10 @@ static void si_cp_dma_realign_engine(struct si_context *sctx, unsigned size,
|
||||||
sctx->scratch_buffer->b.b.width0 < scratch_size) {
|
sctx->scratch_buffer->b.b.width0 < scratch_size) {
|
||||||
r600_resource_reference(&sctx->scratch_buffer, NULL);
|
r600_resource_reference(&sctx->scratch_buffer, NULL);
|
||||||
sctx->scratch_buffer = (struct r600_resource*)
|
sctx->scratch_buffer = (struct r600_resource*)
|
||||||
pipe_buffer_create(&sctx->screen->b.b, 0,
|
r600_aligned_buffer_create(&sctx->screen->b.b,
|
||||||
PIPE_USAGE_DEFAULT, scratch_size);
|
R600_RESOURCE_FLAG_UNMAPPABLE,
|
||||||
|
PIPE_USAGE_DEFAULT,
|
||||||
|
scratch_size, 256);
|
||||||
if (!sctx->scratch_buffer)
|
if (!sctx->scratch_buffer)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -204,8 +204,9 @@ static struct pipe_context *si_create_context(struct pipe_screen *screen,
|
||||||
}
|
}
|
||||||
|
|
||||||
sctx->ce_suballocator =
|
sctx->ce_suballocator =
|
||||||
u_suballocator_create(&sctx->b.b, 1024 * 1024,
|
u_suballocator_create(&sctx->b.b, 1024 * 1024, 0,
|
||||||
0, PIPE_USAGE_DEFAULT, 0, false);
|
PIPE_USAGE_DEFAULT,
|
||||||
|
R600_RESOURCE_FLAG_UNMAPPABLE, false);
|
||||||
if (!sctx->ce_suballocator)
|
if (!sctx->ce_suballocator)
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
@ -257,8 +258,11 @@ static struct pipe_context *si_create_context(struct pipe_screen *screen,
|
||||||
/* CIK cannot unbind a constant buffer (S_BUFFER_LOAD doesn't skip loads
|
/* CIK cannot unbind a constant buffer (S_BUFFER_LOAD doesn't skip loads
|
||||||
* if NUM_RECORDS == 0). We need to use a dummy buffer instead. */
|
* if NUM_RECORDS == 0). We need to use a dummy buffer instead. */
|
||||||
if (sctx->b.chip_class == CIK) {
|
if (sctx->b.chip_class == CIK) {
|
||||||
sctx->null_const_buf.buffer = pipe_buffer_create(screen, PIPE_BIND_CONSTANT_BUFFER,
|
sctx->null_const_buf.buffer =
|
||||||
PIPE_USAGE_DEFAULT, 16);
|
r600_aligned_buffer_create(screen,
|
||||||
|
R600_RESOURCE_FLAG_UNMAPPABLE,
|
||||||
|
PIPE_USAGE_DEFAULT, 16,
|
||||||
|
sctx->screen->b.info.tcc_cache_line_size);
|
||||||
if (!sctx->null_const_buf.buffer)
|
if (!sctx->null_const_buf.buffer)
|
||||||
goto fail;
|
goto fail;
|
||||||
sctx->null_const_buf.buffer_size = sctx->null_const_buf.buffer->width0;
|
sctx->null_const_buf.buffer_size = sctx->null_const_buf.buffer->width0;
|
||||||
|
|
|
@ -2079,18 +2079,22 @@ static bool si_update_gs_ring_buffers(struct si_context *sctx)
|
||||||
|
|
||||||
if (update_esgs) {
|
if (update_esgs) {
|
||||||
pipe_resource_reference(&sctx->esgs_ring, NULL);
|
pipe_resource_reference(&sctx->esgs_ring, NULL);
|
||||||
sctx->esgs_ring = pipe_buffer_create(sctx->b.b.screen, 0,
|
sctx->esgs_ring =
|
||||||
PIPE_USAGE_DEFAULT,
|
r600_aligned_buffer_create(sctx->b.b.screen,
|
||||||
esgs_ring_size);
|
R600_RESOURCE_FLAG_UNMAPPABLE,
|
||||||
|
PIPE_USAGE_DEFAULT,
|
||||||
|
esgs_ring_size, alignment);
|
||||||
if (!sctx->esgs_ring)
|
if (!sctx->esgs_ring)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (update_gsvs) {
|
if (update_gsvs) {
|
||||||
pipe_resource_reference(&sctx->gsvs_ring, NULL);
|
pipe_resource_reference(&sctx->gsvs_ring, NULL);
|
||||||
sctx->gsvs_ring = pipe_buffer_create(sctx->b.b.screen, 0,
|
sctx->gsvs_ring =
|
||||||
PIPE_USAGE_DEFAULT,
|
r600_aligned_buffer_create(sctx->b.b.screen,
|
||||||
gsvs_ring_size);
|
R600_RESOURCE_FLAG_UNMAPPABLE,
|
||||||
|
PIPE_USAGE_DEFAULT,
|
||||||
|
gsvs_ring_size, alignment);
|
||||||
if (!sctx->gsvs_ring)
|
if (!sctx->gsvs_ring)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -2227,8 +2231,10 @@ static bool si_update_spi_tmpring_size(struct si_context *sctx)
|
||||||
r600_resource_reference(&sctx->scratch_buffer, NULL);
|
r600_resource_reference(&sctx->scratch_buffer, NULL);
|
||||||
|
|
||||||
sctx->scratch_buffer = (struct r600_resource*)
|
sctx->scratch_buffer = (struct r600_resource*)
|
||||||
pipe_buffer_create(&sctx->screen->b.b, 0,
|
r600_aligned_buffer_create(&sctx->screen->b.b,
|
||||||
PIPE_USAGE_DEFAULT, scratch_needed_size);
|
R600_RESOURCE_FLAG_UNMAPPABLE,
|
||||||
|
PIPE_USAGE_DEFAULT,
|
||||||
|
scratch_needed_size, 256);
|
||||||
if (!sctx->scratch_buffer)
|
if (!sctx->scratch_buffer)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -2332,18 +2338,23 @@ static void si_init_tess_factor_ring(struct si_context *sctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(!sctx->tf_ring);
|
assert(!sctx->tf_ring);
|
||||||
sctx->tf_ring = pipe_buffer_create(sctx->b.b.screen, 0,
|
sctx->tf_ring = r600_aligned_buffer_create(sctx->b.b.screen,
|
||||||
PIPE_USAGE_DEFAULT,
|
R600_RESOURCE_FLAG_UNMAPPABLE,
|
||||||
32768 * sctx->screen->b.info.max_se);
|
PIPE_USAGE_DEFAULT,
|
||||||
|
32768 * sctx->screen->b.info.max_se,
|
||||||
|
256);
|
||||||
if (!sctx->tf_ring)
|
if (!sctx->tf_ring)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
assert(((sctx->tf_ring->width0 / 4) & C_030938_SIZE) == 0);
|
assert(((sctx->tf_ring->width0 / 4) & C_030938_SIZE) == 0);
|
||||||
|
|
||||||
sctx->tess_offchip_ring = pipe_buffer_create(sctx->b.b.screen, 0,
|
sctx->tess_offchip_ring =
|
||||||
PIPE_USAGE_DEFAULT,
|
r600_aligned_buffer_create(sctx->b.b.screen,
|
||||||
max_offchip_buffers *
|
R600_RESOURCE_FLAG_UNMAPPABLE,
|
||||||
sctx->screen->tess_offchip_block_dw_size * 4);
|
PIPE_USAGE_DEFAULT,
|
||||||
|
max_offchip_buffers *
|
||||||
|
sctx->screen->tess_offchip_block_dw_size * 4,
|
||||||
|
256);
|
||||||
if (!sctx->tess_offchip_ring)
|
if (!sctx->tess_offchip_ring)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue