From e64633e8c3a5498998a45ab721bf80edca101cf5 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sun, 22 Sep 2013 13:06:27 +0200 Subject: r600g,radeonsi: share r600_texture.c The function r600_choose_tiling is new and needs a review. The only change in functionality is that it enables 2D tiling for compressed textures on SI. It was probably accidentally turned off. v2: don't make scanout buffers linear --- src/gallium/drivers/radeonsi/r600_buffer.c | 46 +----------------------------- 1 file changed, 1 insertion(+), 45 deletions(-) (limited to 'src/gallium/drivers/radeonsi/r600_buffer.c') diff --git a/src/gallium/drivers/radeonsi/r600_buffer.c b/src/gallium/drivers/radeonsi/r600_buffer.c index 12e5c4d366b..4c95130c352 100644 --- a/src/gallium/drivers/radeonsi/r600_buffer.c +++ b/src/gallium/drivers/radeonsi/r600_buffer.c @@ -96,50 +96,6 @@ static const struct u_resource_vtbl r600_buffer_vtbl = NULL /* transfer_inline_write */ }; -bool si_init_resource(struct r600_screen *rscreen, - struct r600_resource *res, - unsigned size, unsigned alignment, - boolean use_reusable_pool, unsigned usage) -{ - uint32_t initial_domain, domains; - - /* Staging resources particpate in transfers and blits only - * and are used for uploads and downloads from regular - * resources. We generate them internally for some transfers. - */ - if (usage == PIPE_USAGE_STAGING) { - domains = RADEON_DOMAIN_GTT; - initial_domain = RADEON_DOMAIN_GTT; - } else { - domains = RADEON_DOMAIN_GTT | RADEON_DOMAIN_VRAM; - - switch(usage) { - case PIPE_USAGE_DYNAMIC: - case PIPE_USAGE_STREAM: - case PIPE_USAGE_STAGING: - initial_domain = RADEON_DOMAIN_GTT; - break; - case PIPE_USAGE_DEFAULT: - case PIPE_USAGE_STATIC: - case PIPE_USAGE_IMMUTABLE: - default: - initial_domain = RADEON_DOMAIN_VRAM; - break; - } - } - - res->buf = rscreen->b.ws->buffer_create(rscreen->b.ws, size, alignment, - use_reusable_pool, - initial_domain); - if (!res->buf) { - return false; - } - - res->cs_buf = rscreen->b.ws->buffer_get_cs_handle(res->buf); - res->domains = domains; - return true; -} - struct pipe_resource *si_buffer_create(struct pipe_screen *screen, const struct pipe_resource *templ) { @@ -156,7 +112,7 @@ struct pipe_resource *si_buffer_create(struct pipe_screen *screen, rbuffer->b.vtbl = &r600_buffer_vtbl; util_range_init(&rbuffer->valid_buffer_range); - if (!si_init_resource(rscreen, rbuffer, templ->width0, alignment, TRUE, templ->usage)) { + if (!r600_init_resource(&rscreen->b, rbuffer, templ->width0, alignment, TRUE, templ->usage)) { FREE(rbuffer); return NULL; } -- cgit v1.2.3