turnip: 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 14:06:25 -07:00 committed by Marge Bot
parent 15bccc29bd
commit d485c7b446
2 changed files with 32 additions and 26 deletions

View file

@ -2920,25 +2920,24 @@ tu_copy_image_to_image(struct tu_cmd_buffer *cmd,
struct fdl_layout staging_layout = { 0 };
VkOffset3D staging_offset = { 0 };
staging_layout.tile_mode = TILE6_LINEAR;
staging_layout.ubwc = false;
uint32_t layer_count =
vk_image_subresource_layer_count(&src_image->vk,
&info->srcSubresource);
fdl6_layout(&staging_layout,
&cmd->device->physical_device->dev_info,
src_format,
src_image->layout[0].nr_samples,
extent.width,
extent.height,
extent.depth,
1,
layer_count,
extent.depth > 1,
false,
false,
NULL);
struct fdl_image_params params = {
.format = src_format,
.nr_samples = src_image->layout[0].nr_samples,
.width0 = extent.width,
.height0 = extent.height,
.depth0 = extent.depth,
.mip_levels = 1,
.array_size = layer_count,
.tile_mode = TILE6_LINEAR,
.is_3d = extent.depth > 1,
};
fdl6_layout_image(&staging_layout, &cmd->device->physical_device->dev_info,
&params, NULL);
struct tu_bo *staging_bo;
VkResult result = tu_get_scratch_bo(cmd->device,

View file

@ -546,16 +546,23 @@ tu_image_update_layout(struct tu_device *device, struct tu_image *image,
layout->tile_mode = tile_mode;
layout->ubwc = image->ubwc_enabled;
if (!fdl6_layout(layout, &device->physical_device->dev_info, format,
image->vk.samples,
width0, height0,
image->vk.extent.depth,
image->vk.mip_levels,
image->vk.array_layers,
image->vk.image_type == VK_IMAGE_TYPE_3D,
image->is_mutable,
force_ubwc,
plane_layouts ? &plane_layout : NULL)) {
struct fdl_image_params params = {
.format = format,
.nr_samples = image->vk.samples,
.width0 = width0,
.height0 = height0,
.depth0 = image->vk.extent.depth,
.mip_levels = image->vk.mip_levels,
.array_size = image->vk.array_layers,
.tile_mode = tile_mode,
.ubwc = image->ubwc_enabled,
.force_ubwc = force_ubwc,
image->vk.image_type == VK_IMAGE_TYPE_3D,
image->is_mutable,
};
if (!fdl6_layout_image(layout, &device->physical_device->dev_info,
&params, plane_layouts ? &plane_layout : NULL)) {
assert(plane_layouts); /* can only fail with explicit layout */
return vk_error(device, VK_ERROR_INVALID_DRM_FORMAT_MODIFIER_PLANE_LAYOUT_EXT);
}