summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--wsi/swapchain_base.cpp13
-rw-r--r--wsi/tizen/swapchain.cpp11
2 files changed, 17 insertions, 7 deletions
diff --git a/wsi/swapchain_base.cpp b/wsi/swapchain_base.cpp
index e728bbe..8b591a9 100644
--- a/wsi/swapchain_base.cpp
+++ b/wsi/swapchain_base.cpp
@@ -105,11 +105,13 @@ void swapchain_base::call_present(uint32_t image_index)
* pending buffers from the ancestor have been presented. */
if (m_first_present)
{
- if (m_ancestor != VK_NULL_HANDLE)
+ /* commented by xuelian.bai. if there is old swapchain, wait for pending buffers
+ * will lead to block */
+ /*if (m_ancestor != VK_NULL_HANDLE)
{
auto *ancestor = reinterpret_cast<swapchain_base *>(m_ancestor);
ancestor->wait_for_pending_buffers();
- }
+ }*/
sem_post(&m_start_present_semaphore);
@@ -302,6 +304,7 @@ VkResult swapchain_base::init(VkDevice device, const VkSwapchainCreateInfoKHR *s
ancestor->deprecate(reinterpret_cast<VkSwapchainKHR>(this));
}
+
set_error_state(VK_SUCCESS);
return VK_SUCCESS;
@@ -325,7 +328,9 @@ void swapchain_base::teardown()
else if (!error_has_occured())
{
/* If descendant hasn't started presenting, there are pending buffers in the swapchain. */
- wait_for_pending_buffers();
+ /* Commented by xuelian.bai. When reset happen, wait for pending buffer will lead to
+ * pending in getting buffers. */
+ //wait_for_pending_buffers();
}
if (m_queue != VK_NULL_HANDLE)
@@ -550,7 +555,7 @@ void swapchain_base::deprecate(VkSwapchainKHR descendant)
{
for (auto& img : m_swapchain_images)
{
- if (img.status == swapchain_image::FREE)
+ if (img.status == swapchain_image::FREE || img.status == swapchain_image::PENDING)
{
destroy_image(img);
}
diff --git a/wsi/tizen/swapchain.cpp b/wsi/tizen/swapchain.cpp
index 5c227a0..63ca55e 100644
--- a/wsi/tizen/swapchain.cpp
+++ b/wsi/tizen/swapchain.cpp
@@ -138,8 +138,11 @@ wsi_tizen_get_tbm_format(VkFormat format, VkCompositeAlphaFlagBitsKHR comp)
/* 8 8 8 8 */
case VK_FORMAT_B8G8R8A8_UNORM:
RETURN_FORMAT(comp, XRGB8888, ARGB8888, 0, ARGB8888);
+ /* Use RGBA in every alpha bit case.*/
case VK_FORMAT_R8G8B8A8_UNORM:
- RETURN_FORMAT(comp, RGBA8888, RGBA8888, 0, RGBA8888);
+ case VK_FORMAT_UNDEFINED:/*VK_FORMAT_UNDEFINED specifies that the format is not specified.*/
+ case VK_FORMAT_R8G8B8A8_SRGB:
+ RETURN_FORMAT(comp, RGBA8888, RGBA8888, RGBA8888, RGBA8888);
case VK_FORMAT_A8B8G8R8_UNORM_PACK32:
RETURN_FORMAT(comp, XBGR8888, ABGR8888, 0, ABGR8888);
/* 2 10 10 10 */
@@ -151,6 +154,7 @@ wsi_tizen_get_tbm_format(VkFormat format, VkCompositeAlphaFlagBitsKHR comp)
break;
}
+ WSI_LOG_ERROR("Unsupported format[%d]\n", format);
return 0;
}
@@ -178,10 +182,11 @@ VkResult swapchain::init_platform(VkDevice device, const VkSwapchainCreateInfoKH
m_tpl_surface = tpl_surface_create(m_tpl_display, m_wl_surface, TPL_SURFACE_TYPE_WINDOW, format);
} else {
format = wsi_tizen_get_tbm_format(swapchain_create_info->imageFormat, swapchain_create_info->compositeAlpha);
- tpl_object_unreference(reinterpret_cast<tpl_object_t *>(m_tpl_display));
+ //tpl_object_reference(reinterpret_cast<tpl_object_t *>(m_tpl_display));
+ tpl_object_reference(reinterpret_cast<tpl_object_t *>(m_tpl_surface));
}
- if (m_tpl_surface == NULL) {
+ if (m_tpl_surface == NULL || format == 0) {
WSI_LOG_ERROR("create tpl surface failed\n");
return VK_ERROR_INITIALIZATION_FAILED;
}