From c4eced3b0a774643b09ea4844f47f867772b03df Mon Sep 17 00:00:00 2001 From: Junkyeong Kim Date: Wed, 7 Feb 2018 20:51:14 +0900 Subject: [PATCH] change vblank sw hw changing condition Change-Id: I24baf90fcbb3adbf7fd081c7881920bf63ff96b2 Signed-off-by: Junkyeong Kim --- src/tdm_vblank.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/tdm_vblank.c b/src/tdm_vblank.c index 21dd98b..73f7214 100644 --- a/src/tdm_vblank.c +++ b/src/tdm_vblank.c @@ -367,13 +367,13 @@ _tdm_vblank_update_output_info(tdm_private_vblank *private_vblank) { tdm_output *output = private_vblank->output; tdm_output_conn_status connection = TDM_OUTPUT_CONN_STATUS_DISCONNECTED; - unsigned int vrefresh = 0; + unsigned int vrefresh = TDM_VBLANK_DEFAULT_VREFRESH; tdm_error ret; ret = tdm_output_get_conn_status(output, &connection); TDM_WARNING_IF_FAIL(ret == TDM_ERROR_NONE); - if (connection != TDM_OUTPUT_CONN_STATUS_DISCONNECTED) { + if (connection == TDM_OUTPUT_CONN_STATUS_MODE_SETTED) { const tdm_output_mode *mode = NULL; tdm_output_get_mode(output, &mode); if (mode) @@ -382,11 +382,6 @@ _tdm_vblank_update_output_info(tdm_private_vblank *private_vblank) VWR("mode not setted!!!"); } - if (vrefresh == 0) { - VWR("vrefresh can't be zero !!!"); - vrefresh = TDM_VBLANK_DEFAULT_VREFRESH; - } - private_vblank->connection = connection; private_vblank->vrefresh = vrefresh; private_vblank->HW_vblank_gap = 1.0 / private_vblank->vrefresh; @@ -1467,6 +1462,7 @@ tdm_vblank_wait(tdm_vblank *vblank, unsigned int req_sec, unsigned int req_usec, return TDM_ERROR_OUT_OF_MEMORY; /* LCOV_EXCL_STOP */ } + _tdm_vblank_update_output_info(private_vblank); /* set request time to current time if 0. This function seems to be called in server side. */ if (req_sec == 0 && req_usec == 0) { @@ -1508,7 +1504,7 @@ tdm_vblank_wait(tdm_vblank *vblank, unsigned int req_sec, unsigned int req_usec, if (private_vblank->vrefresh % fps) wait_info->type = VBLANK_TYPE_SW; else if (TDM_OUTPUT_DPMS_VSYNC_IS_OFF(dpms) || - private_vblank->connection == TDM_OUTPUT_CONN_STATUS_DISCONNECTED) + private_vblank->connection != TDM_OUTPUT_CONN_STATUS_MODE_SETTED) wait_info->type = VBLANK_TYPE_SW_FAKE; else if (private_vblank->offset == 0) wait_info->type = VBLANK_TYPE_HW; -- 2.7.4