mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 13:38:06 +02:00
panvk: ensure wsi memory is bound at offset 0
No apps or tests have hit the spec corner case yet, but in theory they could pass invalid offset and expect the impl to ignore it for wsi alias binding. This change ensures the offset is zero, which aligns with common wsi side binding as well as obeying the dedicated allocation requirement. Fixes:187956bd51("panvk: adopt wsi_common_get_memory") Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Acked-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com> Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36603> (cherry picked from commit2f54020f29)
This commit is contained in:
parent
7c4b200707
commit
8f23dba130
2 changed files with 5 additions and 3 deletions
|
|
@ -5924,7 +5924,7 @@
|
||||||
"description": "panvk: ensure wsi memory is bound at offset 0",
|
"description": "panvk: ensure wsi memory is bound at offset 0",
|
||||||
"nominated": true,
|
"nominated": true,
|
||||||
"nomination_type": 2,
|
"nomination_type": 2,
|
||||||
"resolution": 0,
|
"resolution": 1,
|
||||||
"main_sha": null,
|
"main_sha": null,
|
||||||
"because_sha": "187956bd51ad1ade4bf6f7a2b289aea29340e718",
|
"because_sha": "187956bd51ad1ade4bf6f7a2b289aea29340e718",
|
||||||
"notes": null
|
"notes": null
|
||||||
|
|
|
||||||
|
|
@ -681,6 +681,7 @@ panvk_image_bind(struct panvk_device *dev,
|
||||||
const VkBindImageMemoryInfo *bind_info) {
|
const VkBindImageMemoryInfo *bind_info) {
|
||||||
VK_FROM_HANDLE(panvk_image, image, bind_info->image);
|
VK_FROM_HANDLE(panvk_image, image, bind_info->image);
|
||||||
VK_FROM_HANDLE(panvk_device_memory, mem, bind_info->memory);
|
VK_FROM_HANDLE(panvk_device_memory, mem, bind_info->memory);
|
||||||
|
uint64_t offset = bind_info->memoryOffset;
|
||||||
|
|
||||||
if (!mem) {
|
if (!mem) {
|
||||||
#if DETECT_OS_ANDROID
|
#if DETECT_OS_ANDROID
|
||||||
|
|
@ -694,6 +695,7 @@ panvk_image_bind(struct panvk_device *dev,
|
||||||
VkDeviceMemory mem_handle = wsi_common_get_memory(
|
VkDeviceMemory mem_handle = wsi_common_get_memory(
|
||||||
swapchain_info->swapchain, swapchain_info->imageIndex);
|
swapchain_info->swapchain, swapchain_info->imageIndex);
|
||||||
mem = panvk_device_memory_from_handle(mem_handle);
|
mem = panvk_device_memory_from_handle(mem_handle);
|
||||||
|
offset = 0;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -705,12 +707,12 @@ panvk_image_bind(struct panvk_device *dev,
|
||||||
const uint8_t plane =
|
const uint8_t plane =
|
||||||
panvk_plane_index(image->vk.format, plane_info->planeAspect);
|
panvk_plane_index(image->vk.format, plane_info->planeAspect);
|
||||||
return panvk_image_plane_bind(dev, &image->planes[plane], mem->bo,
|
return panvk_image_plane_bind(dev, &image->planes[plane], mem->bo,
|
||||||
mem->addr.dev, bind_info->memoryOffset);
|
mem->addr.dev, offset);
|
||||||
} else {
|
} else {
|
||||||
for (unsigned plane = 0; plane < image->plane_count; plane++) {
|
for (unsigned plane = 0; plane < image->plane_count; plane++) {
|
||||||
VkResult result =
|
VkResult result =
|
||||||
panvk_image_plane_bind(dev, &image->planes[plane], mem->bo,
|
panvk_image_plane_bind(dev, &image->planes[plane], mem->bo,
|
||||||
mem->addr.dev, bind_info->memoryOffset);
|
mem->addr.dev, offset);
|
||||||
if (result != VK_SUCCESS)
|
if (result != VK_SUCCESS)
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue