pvr: Add pvr_image_view_get_image()

This replaces the pattern of vk_to_pvr_image(iview->vk.image).

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23313>
This commit is contained in:
Matt Coster 2023-02-27 09:08:02 +00:00 committed by Marge Bot
parent 675aa18d4d
commit c31998b7d3
4 changed files with 12 additions and 6 deletions

View file

@ -925,7 +925,7 @@ static void pvr_setup_pbe_state(
uint32_t pbe_cs_words[static const ROGUE_NUM_PBESTATE_STATE_WORDS],
uint64_t pbe_reg_words[static const ROGUE_NUM_PBESTATE_REG_WORDS])
{
const struct pvr_image *image = vk_to_pvr_image(iview->vk.image);
const struct pvr_image *image = pvr_image_view_get_image(iview);
uint32_t level_pitch = image->mip_levels[iview->vk.base_mip_level].pitch;
struct pvr_pbe_surf_params surface_params;
@ -1305,7 +1305,7 @@ static VkResult pvr_sub_cmd_gfx_job_init(const struct pvr_device_info *dev_info,
if (hw_render->ds_attach_idx != VK_ATTACHMENT_UNUSED) {
struct pvr_image_view *iview =
render_pass_info->attachments[hw_render->ds_attach_idx];
const struct pvr_image *image = vk_to_pvr_image(iview->vk.image);
const struct pvr_image *image = pvr_image_view_get_image(iview);
job->has_depth_attachment = vk_format_has_depth(image->vk.format);
job->has_stencil_attachment = vk_format_has_stencil(image->vk.format);
@ -1419,7 +1419,7 @@ static VkResult pvr_sub_cmd_gfx_job_init(const struct pvr_device_info *dev_info,
if (hw_render->ds_attach_idx != VK_ATTACHMENT_UNUSED) {
struct pvr_image_view *iview =
render_pass_info->attachments[hw_render->ds_attach_idx];
const struct pvr_image *image = vk_to_pvr_image(iview->vk.image);
const struct pvr_image *image = pvr_image_view_get_image(iview);
/* If the HW render pass has a valid depth/stencil surface, determine the
* sample count from the attachment's image.

View file

@ -1493,7 +1493,7 @@ pvr_write_image_descriptor_secondaries(const struct pvr_device_info *dev_info,
iview->vk.view_type == VK_IMAGE_VIEW_TYPE_CUBE_ARRAY;
if (!PVR_HAS_FEATURE(dev_info, tpu_array_textures)) {
const struct pvr_image *image = vk_to_pvr_image(iview->vk.image);
const struct pvr_image *image = pvr_image_view_get_image(iview);
uint64_t addr =
image->dev_addr.addr + iview->vk.base_array_layer * image->layer_size;

View file

@ -280,7 +280,7 @@ VkResult pvr_CreateImageView(VkDevice _device,
if (!iview)
return vk_error(device, VK_ERROR_OUT_OF_HOST_MEMORY);
image = vk_to_pvr_image(iview->vk.image);
image = pvr_image_view_get_image(iview);
info.type = iview->vk.view_type;
info.base_level = iview->vk.base_mip_level;
@ -342,7 +342,7 @@ VkResult pvr_CreateImageView(VkDevice _device,
info.base_level = 0;
info.tex_state_type = PVR_TEXTURE_STATE_ATTACHMENT;
if (iview->vk.image->image_type == VK_IMAGE_TYPE_3D &&
if (image->vk.image_type == VK_IMAGE_TYPE_3D &&
iview->vk.view_type == VK_IMAGE_VIEW_TYPE_2D) {
info.type = VK_IMAGE_VIEW_TYPE_3D;
} else {

View file

@ -1285,6 +1285,12 @@ vk_to_pvr_image(const struct vk_image *image)
return container_of(image, const struct pvr_image, vk);
}
static inline const struct pvr_image *
pvr_image_view_get_image(const struct pvr_image_view *const iview)
{
return vk_to_pvr_image(iview->vk.image);
}
static enum pvr_pipeline_stage_bits
pvr_stage_mask(VkPipelineStageFlags2 stage_mask)
{