pvr: implement GetRenderingAreaGranularity

As the implementation of GetRenderAreaGranularity does not reference the
render pass object, just move it to a new function and use it for both
functions.

Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
Reviewed-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41569>
This commit is contained in:
Icenowy Zheng 2026-05-14 01:35:08 +08:00 committed by Marge Bot
parent 201c2b781c
commit 9a7b785b60
3 changed files with 26 additions and 10 deletions

View file

@ -9929,3 +9929,12 @@ VkResult PVR_PER_ARCH(EndCommandBuffer)(VkCommandBuffer commandBuffer)
return vk_command_buffer_end(&cmd_buffer->vk);
}
void PVR_PER_ARCH(GetRenderingAreaGranularity)(
VkDevice _device,
const VkRenderingAreaInfoKHR *pRenderingAreaInfo,
VkExtent2D *pGranularity)
{
VK_FROM_HANDLE(pvr_device, device, _device);
pvr_get_render_area_granularity(device->pdevice, pGranularity);
}

View file

@ -1107,14 +1107,5 @@ void PVR_PER_ARCH(GetRenderAreaGranularity)(VkDevice _device,
VkExtent2D *pGranularity)
{
VK_FROM_HANDLE(pvr_device, device, _device);
const struct pvr_device_info *dev_info = &device->pdevice->dev_info;
/* Granularity does not depend on any settings in the render pass, so return
* the tile granularity.
*
* The default value is based on the minimum value found in all existing
* cores.
*/
pGranularity->width = PVR_GET_FEATURE_VALUE(dev_info, tile_size_x, 16);
pGranularity->height = PVR_GET_FEATURE_VALUE(dev_info, tile_size_y, 16);
pvr_get_render_area_granularity(device->pdevice, pGranularity);
}

View file

@ -74,6 +74,22 @@ VK_DEFINE_HANDLE_CASTS(pvr_physical_device,
VkPhysicalDevice,
VK_OBJECT_TYPE_PHYSICAL_DEVICE)
static void
pvr_get_render_area_granularity(struct pvr_physical_device *pdevice,
VkExtent2D *granularity)
{
const struct pvr_device_info *dev_info = &pdevice->dev_info;
/* Granularity does not depend on any settings in the render pass, so return
* the tile granularity.
*
* The default value is based on the minimum value found in all existing
* cores.
*/
granularity->width = PVR_GET_FEATURE_VALUE(dev_info, tile_size_x, 16);
granularity->height = PVR_GET_FEATURE_VALUE(dev_info, tile_size_y, 16);
}
VkResult pvr_physical_device_init(struct pvr_physical_device *pdevice,
struct pvr_instance *instance,
drmDevicePtr drm_render_device,