From d9f5c6041bc1605f3163d3e59becc4d441349407 Mon Sep 17 00:00:00 2001 From: Xuelian Bai Date: Mon, 11 Apr 2022 15:02:57 +0800 Subject: [PATCH] Fix issue when reset Set ref_cnt as 1 before CREATE_QUEUE, or when queue is reused and ref_cnt is increased, the ref_cnt will be set back to 1. Set format as default when reset Change-Id: I0bd90a361d26329cb86393b1eaddf1013af09244 Signed-off-by: Xuelian Bai --- src/tpl_wl_vk_thread.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/tpl_wl_vk_thread.c b/src/tpl_wl_vk_thread.c index 40f7e81..f9d6952 100644 --- a/src/tpl_wl_vk_thread.c +++ b/src/tpl_wl_vk_thread.c @@ -1489,7 +1489,7 @@ _thread_swapchain_create_tbm_queue(tpl_wl_vk_surface_t *wl_vk_surface) tbm_surface_queue_reset(swapchain->tbm_queue, swapchain->properties.width, swapchain->properties.height, - swapchain->properties.format); + TBM_FORMAT_ARGB8888); TPL_INFO("[RESIZE]", "wl_vk_surface(%p) swapchain(%p) tbm_queue(%p) (%dx%d)->(%dx%d)", wl_vk_surface, swapchain, swapchain->tbm_queue, @@ -1612,9 +1612,12 @@ __tpl_wl_vk_surface_create_swapchain(tpl_surface_t *surface, swapchain->properties.height = height; swapchain->properties.present_mode = present_mode; swapchain->wl_vk_surface = wl_vk_surface; + swapchain->properties.format = format; wl_vk_surface->swapchain = swapchain; + __tpl_util_atomic_set(&swapchain->ref_cnt, 1); + tpl_gmutex_lock(&wl_vk_surface->surf_mutex); /* send swapchain create tbm_queue message */ wl_vk_surface->sent_message = CREATE_QUEUE; @@ -1627,9 +1630,9 @@ __tpl_wl_vk_surface_create_swapchain(tpl_surface_t *surface, swapchain->tbm_queue != NULL, "[CRITICAL FAIL] Failed to create tbm_surface_queue"); + wl_vk_surface->reset = TPL_FALSE; - __tpl_util_atomic_set(&swapchain->ref_cnt, 1); return TPL_ERROR_NONE; } -- 2.7.4