Commit 09034aab authored by Dave Airlie's avatar Dave Airlie

radv/wsi: report presentation error per image request

This ports
0fcb92c1
anv: wsi: report presentation error per image request

This fixes:
dEQP-VK.wsi.xlib.incremental_present.scale_none.*
Reviewed-by: Daniel Stone's avatarDaniel Stone <daniels@collabora.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent ce0f6925
...@@ -460,16 +460,20 @@ VkResult radv_QueuePresentKHR( ...@@ -460,16 +460,20 @@ VkResult radv_QueuePresentKHR(
RADV_FROM_HANDLE(wsi_swapchain, swapchain, pPresentInfo->pSwapchains[i]); RADV_FROM_HANDLE(wsi_swapchain, swapchain, pPresentInfo->pSwapchains[i]);
struct radeon_winsys_cs *cs; struct radeon_winsys_cs *cs;
const VkPresentRegionKHR *region = NULL; const VkPresentRegionKHR *region = NULL;
VkResult item_result;
assert(radv_device_from_handle(swapchain->device) == queue->device); assert(radv_device_from_handle(swapchain->device) == queue->device);
if (swapchain->fences[0] == VK_NULL_HANDLE) { if (swapchain->fences[0] == VK_NULL_HANDLE) {
result = radv_CreateFence(radv_device_to_handle(queue->device), item_result = radv_CreateFence(radv_device_to_handle(queue->device),
&(VkFenceCreateInfo) { &(VkFenceCreateInfo) {
.sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, .sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO,
.flags = 0, .flags = 0,
}, &swapchain->alloc, &swapchain->fences[0]); }, &swapchain->alloc, &swapchain->fences[0]);
if (result != VK_SUCCESS) if (pPresentInfo->pResults != NULL)
return result; pPresentInfo->pResults[i] = item_result;
result = result == VK_SUCCESS ? item_result : result;
if (item_result != VK_SUCCESS)
continue;
} else { } else {
radv_ResetFences(radv_device_to_handle(queue->device), radv_ResetFences(radv_device_to_handle(queue->device),
1, &swapchain->fences[0]); 1, &swapchain->fences[0]);
...@@ -493,12 +497,15 @@ VkResult radv_QueuePresentKHR( ...@@ -493,12 +497,15 @@ VkResult radv_QueuePresentKHR(
if (regions && regions->pRegions) if (regions && regions->pRegions)
region = &regions->pRegions[i]; region = &regions->pRegions[i];
result = swapchain->queue_present(swapchain, item_result = swapchain->queue_present(swapchain,
pPresentInfo->pImageIndices[i], pPresentInfo->pImageIndices[i],
region); region);
/* TODO: What if one of them returns OUT_OF_DATE? */ /* TODO: What if one of them returns OUT_OF_DATE? */
if (result != VK_SUCCESS) if (pPresentInfo->pResults != NULL)
return result; pPresentInfo->pResults[i] = item_result;
result = result == VK_SUCCESS ? item_result : result;
if (item_result != VK_SUCCESS)
continue;
VkFence last = swapchain->fences[2]; VkFence last = swapchain->fences[2];
swapchain->fences[2] = swapchain->fences[1]; swapchain->fences[2] = swapchain->fences[1];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment