From b406f32a81e9a5ddd01dc4f867fc911968ef4398 Mon Sep 17 00:00:00 2001 From: "deasung.kim" Date: Wed, 16 Nov 2016 18:15:46 +0900 Subject: [PATCH] swapchain_tdm: added restore tdm dpms when swapchain destroy get dpms value in swapchain create use this value in swapchain destroy Change-Id: Ia78adc4c1cad9bd501dee3f815f8f1a0d788aba1 --- src/wsi/swapchain_tdm.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/wsi/swapchain_tdm.c b/src/wsi/swapchain_tdm.c index 8e25578..7c77176 100644 --- a/src/wsi/swapchain_tdm.c +++ b/src/wsi/swapchain_tdm.c @@ -35,6 +35,7 @@ struct vk_swapchain_tdm { tdm_output *tdm_output; tdm_layer *tdm_layer; const tdm_output_mode *tdm_mode; + tdm_output_dpms tdm_dpms; tbm_surface_queue_h tbm_queue; @@ -262,6 +263,8 @@ swapchain_tdm_deinit(VkDevice device, vk_swapchain_tdm_t *swapchain_tdm = chain->backend_data; if (swapchain_tdm) { + tdm_output_set_dpms(swapchain_tdm->tdm_output, swapchain_tdm->tdm_dpms); + pthread_cond_destroy(&swapchain_tdm->free_queue_cond); pthread_mutex_destroy(&swapchain_tdm->free_queue_mutex); pthread_mutex_destroy(&swapchain_tdm->front_mutex); @@ -312,7 +315,8 @@ swapchain_tdm_get_buffers(VkDevice device, *buffers = swapchain_tdm->buffers; - tdm_err = tdm_output_set_dpms(swapchain_tdm->tdm_output, TDM_OUTPUT_DPMS_ON);; + tdm_err = tdm_output_get_dpms(swapchain_tdm->tdm_output, &swapchain_tdm->tdm_dpms); + tdm_err = tdm_output_set_dpms(swapchain_tdm->tdm_output, TDM_OUTPUT_DPMS_ON); VK_CHECK(tdm_err == TDM_ERROR_NONE, return VK_ERROR_SURFACE_LOST_KHR, "tdm_output_set_dpms failed.\n"); @@ -397,6 +401,7 @@ swapchain_tdm_init(VkDevice device, swapchain_tdm->present_mode = info->presentMode; swapchain_tdm->tdm_mode = disp_mode->tdm_mode; + swapchain_tdm->tdm_dpms = TDM_OUTPUT_DPMS_OFF; chain->get_buffers = swapchain_tdm_get_buffers; chain->deinit = swapchain_tdm_deinit; -- 2.7.4