freedreno/a6xx: Convert to fdl6_layout_image

Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36075>
This commit is contained in:
Rob Clark 2025-07-10 16:12:28 -07:00 committed by Marge Bot
parent b6e27a9f57
commit e55c6c5f25
2 changed files with 22 additions and 17 deletions

View file

@ -256,18 +256,20 @@ fd6_layout_resource(struct fd_resource *rsc, enum fd_layout_type type)
{
struct pipe_resource *prsc = &rsc->b.b;
struct fd_screen *screen = fd_screen(prsc->screen);
bool ubwc = false;
unsigned tile_mode = TILE6_LINEAR;
if (type >= FD_LAYOUT_TILED)
rsc->layout.tile_mode = fd6_tile_mode(prsc);
tile_mode = fd6_tile_mode(prsc);
if (type == FD_LAYOUT_UBWC)
rsc->layout.ubwc = true;
ubwc = true;
if (rsc->layout.ubwc && !ok_ubwc_format(prsc->screen, prsc->format, prsc->nr_samples))
rsc->layout.ubwc = false;
if (ubwc && !ok_ubwc_format(prsc->screen, prsc->format, prsc->nr_samples))
ubwc = false;
fdl6_layout(&rsc->layout, screen->info, prsc->format, fd_resource_nr_samples(prsc),
prsc->width0, prsc->height0, prsc->depth0, prsc->last_level + 1,
prsc->array_size, prsc->target == PIPE_TEXTURE_3D, false, false, NULL);
struct fdl_image_params params = fd_image_params(prsc, ubwc, tile_mode);
fdl6_layout_image(&rsc->layout, screen->info, &params, NULL);
if (!FD_DBG(NOLRZ) && has_depth(prsc->format) && !is_z32(prsc->format))
setup_lrz<CHIP>(rsc);
@ -288,12 +290,9 @@ fill_ubwc_buffer_sizes(struct fd_resource *rsc)
if (!can_do_ubwc(prsc))
return -1;
rsc->layout.ubwc = true;
rsc->layout.tile_mode = TILE6_3;
struct fdl_image_params params = fd_image_params(prsc, true, TILE6_3);
if (!fdl6_layout(&rsc->layout, screen->info, prsc->format, fd_resource_nr_samples(prsc),
prsc->width0, prsc->height0, prsc->depth0,
prsc->last_level + 1, prsc->array_size, false, false, true, &l))
if (!fdl6_layout_image(&rsc->layout, screen->info, &params, &l))
return -1;
if (rsc->layout.size > fd_bo_size(rsc->bo))

View file

@ -126,17 +126,23 @@ fd6_layout_tex2d_from_buf(struct fdl_layout *layout,
.pitch = tex2d_from_buf->row_stride * block_size,
};
struct fdl_image_params params = {
.format = format,
.nr_samples = 1,
.width0 = tex2d_from_buf->width,
.height0 = tex2d_from_buf->height,
.depth0 = 1,
.mip_levels = 1,
.array_size = 1,
};
*layout = (struct fdl_layout) {
.ubwc = false,
.tile_all = false,
.tile_mode = TILE6_LINEAR,
};
ASSERTED bool ret = fdl6_layout(layout, info, format, 1,
tex2d_from_buf->width,
tex2d_from_buf->height,
1, 1, 1, false, false,
false, &explicit_layout);
ASSERTED bool ret = fdl6_layout_image(layout, info, &params, &explicit_layout);
assert(ret);
}