radv: Expose radv_get_dcc_max_uncompressed_block_size function.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25831>
This commit is contained in:
Timur Kristóf 2023-10-26 12:00:31 +02:00 committed by Marge Bot
parent 848f2f2b99
commit ed21f1c962
2 changed files with 8 additions and 6 deletions

View file

@ -1433,13 +1433,13 @@ radv_surface_max_layer_count(struct radv_image_view *iview)
: (iview->vk.base_array_layer + iview->vk.layer_count);
}
static unsigned
get_dcc_max_uncompressed_block_size(const struct radv_device *device, const struct radv_image_view *iview)
unsigned
radv_get_dcc_max_uncompressed_block_size(const struct radv_device *device, const struct radv_image *image)
{
if (device->physical_device->rad_info.gfx_level < GFX10 && iview->image->vk.samples > 1) {
if (iview->image->planes[0].surface.bpe == 1)
if (device->physical_device->rad_info.gfx_level < GFX10 && image->vk.samples > 1) {
if (image->planes[0].surface.bpe == 1)
return V_028C78_MAX_BLOCK_SIZE_64B;
else if (iview->image->planes[0].surface.bpe == 2)
else if (image->planes[0].surface.bpe == 2)
return V_028C78_MAX_BLOCK_SIZE_128B;
}
@ -1464,7 +1464,7 @@ get_dcc_min_compressed_block_size(const struct radv_device *device)
static uint32_t
radv_init_dcc_control_reg(struct radv_device *device, struct radv_image_view *iview)
{
unsigned max_uncompressed_block_size = get_dcc_max_uncompressed_block_size(device, iview);
unsigned max_uncompressed_block_size = radv_get_dcc_max_uncompressed_block_size(device, iview->image);
unsigned min_compressed_block_size = get_dcc_min_compressed_block_size(device);
unsigned max_compressed_block_size;
unsigned independent_128b_blocks;

View file

@ -2932,6 +2932,8 @@ bool radv_are_formats_dcc_compatible(const struct radv_physical_device *pdev, co
bool vi_alpha_is_on_msb(const struct radv_device *device, const VkFormat format);
unsigned radv_get_dcc_max_uncompressed_block_size(const struct radv_device *device, const struct radv_image *image);
VkResult radv_image_from_gralloc(VkDevice device_h, const VkImageCreateInfo *base_info,
const VkNativeBufferANDROID *gralloc_info, const VkAllocationCallbacks *alloc,
VkImage *out_image_h);