diff options
author | Marek Olšák <[email protected]> | 2016-11-06 14:51:57 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2017-03-30 14:44:33 +0200 |
commit | b25d7c2cbfaf0e3aadb3724bbf1a6cce218e6b2b (patch) | |
tree | 764d32cf6073f6d964c27180f4bc00ebdbed80e3 /src/gallium/drivers/radeon/r600_texture.c | |
parent | 9b365d497a4fc304e9e0fb613170b1933bb66834 (diff) |
gallium/radeon: move pre-GFX9 radeon_bo_metadata.* to u.legacy.*
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeon/r600_texture.c')
-rw-r--r-- | src/gallium/drivers/radeon/r600_texture.c | 64 |
1 files changed, 36 insertions, 28 deletions
diff --git a/src/gallium/drivers/radeon/r600_texture.c b/src/gallium/drivers/radeon/r600_texture.c index ece1e806e3e..353e942aaa2 100644 --- a/src/gallium/drivers/radeon/r600_texture.c +++ b/src/gallium/drivers/radeon/r600_texture.c @@ -281,24 +281,29 @@ static int r600_init_surface(struct r600_common_screen *rscreen, return 0; } -static void r600_texture_init_metadata(struct r600_texture *rtex, +static void r600_texture_init_metadata(struct r600_common_screen *rscreen, + struct r600_texture *rtex, struct radeon_bo_metadata *metadata) { struct radeon_surf *surface = &rtex->surface; memset(metadata, 0, sizeof(*metadata)); - metadata->microtile = surface->u.legacy.level[0].mode >= RADEON_SURF_MODE_1D ? - RADEON_LAYOUT_TILED : RADEON_LAYOUT_LINEAR; - metadata->macrotile = surface->u.legacy.level[0].mode >= RADEON_SURF_MODE_2D ? - RADEON_LAYOUT_TILED : RADEON_LAYOUT_LINEAR; - metadata->pipe_config = surface->u.legacy.pipe_config; - metadata->bankw = surface->u.legacy.bankw; - metadata->bankh = surface->u.legacy.bankh; - metadata->tile_split = surface->u.legacy.tile_split; - metadata->mtilea = surface->u.legacy.mtilea; - metadata->num_banks = surface->u.legacy.num_banks; - metadata->stride = surface->u.legacy.level[0].nblk_x * surface->bpe; - metadata->scanout = (surface->flags & RADEON_SURF_SCANOUT) != 0; + + if (rscreen->chip_class >= GFX9) { + } else { + metadata->u.legacy.microtile = surface->u.legacy.level[0].mode >= RADEON_SURF_MODE_1D ? + RADEON_LAYOUT_TILED : RADEON_LAYOUT_LINEAR; + metadata->u.legacy.macrotile = surface->u.legacy.level[0].mode >= RADEON_SURF_MODE_2D ? + RADEON_LAYOUT_TILED : RADEON_LAYOUT_LINEAR; + metadata->u.legacy.pipe_config = surface->u.legacy.pipe_config; + metadata->u.legacy.bankw = surface->u.legacy.bankw; + metadata->u.legacy.bankh = surface->u.legacy.bankh; + metadata->u.legacy.tile_split = surface->u.legacy.tile_split; + metadata->u.legacy.mtilea = surface->u.legacy.mtilea; + metadata->u.legacy.num_banks = surface->u.legacy.num_banks; + metadata->u.legacy.stride = surface->u.legacy.level[0].nblk_x * surface->bpe; + metadata->u.legacy.scanout = (surface->flags & RADEON_SURF_SCANOUT) != 0; + } } static void r600_eliminate_fast_color_clear(struct r600_common_context *rctx, @@ -526,7 +531,7 @@ static boolean r600_texture_get_handle(struct pipe_screen* screen, /* Set metadata. */ if (!res->is_shared || update_metadata) { - r600_texture_init_metadata(rtex, &metadata); + r600_texture_init_metadata(rscreen, rtex, &metadata); if (rscreen->query_opaque_metadata) rscreen->query_opaque_metadata(rscreen, rtex, &metadata); @@ -1265,22 +1270,25 @@ static struct pipe_resource *r600_texture_from_handle(struct pipe_screen *screen rscreen->ws->buffer_get_metadata(buf, &metadata); - surface.u.legacy.pipe_config = metadata.pipe_config; - surface.u.legacy.bankw = metadata.bankw; - surface.u.legacy.bankh = metadata.bankh; - surface.u.legacy.tile_split = metadata.tile_split; - surface.u.legacy.mtilea = metadata.mtilea; - surface.u.legacy.num_banks = metadata.num_banks; - - if (metadata.macrotile == RADEON_LAYOUT_TILED) - array_mode = RADEON_SURF_MODE_2D; - else if (metadata.microtile == RADEON_LAYOUT_TILED) - array_mode = RADEON_SURF_MODE_1D; - else - array_mode = RADEON_SURF_MODE_LINEAR_ALIGNED; + if (rscreen->chip_class >= GFX9) { + } else { + surface.u.legacy.pipe_config = metadata.u.legacy.pipe_config; + surface.u.legacy.bankw = metadata.u.legacy.bankw; + surface.u.legacy.bankh = metadata.u.legacy.bankh; + surface.u.legacy.tile_split = metadata.u.legacy.tile_split; + surface.u.legacy.mtilea = metadata.u.legacy.mtilea; + surface.u.legacy.num_banks = metadata.u.legacy.num_banks; + + if (metadata.u.legacy.macrotile == RADEON_LAYOUT_TILED) + array_mode = RADEON_SURF_MODE_2D; + else if (metadata.u.legacy.microtile == RADEON_LAYOUT_TILED) + array_mode = RADEON_SURF_MODE_1D; + else + array_mode = RADEON_SURF_MODE_LINEAR_ALIGNED; + } r = r600_init_surface(rscreen, &surface, templ, array_mode, stride, - offset, true, metadata.scanout, false, false); + offset, true, metadata.u.legacy.scanout, false, false); if (r) { return NULL; } |