diff options
author | Junkyeong Kim <jk0430.kim@samsung.com> | 2016-08-18 11:49:00 +0900 |
---|---|---|
committer | Junkyeong Kim <jk0430.kim@samsung.com> | 2016-08-18 11:49:03 +0900 |
commit | 3546629a60d36873da35cf6e9570d80a88e6c27e (patch) | |
tree | 020e44ed1f8f7f6579a6a3c9f369a77547f0ca3e | |
parent | f4616cbd93b874c129dd35fa36cec393cd8d5bd6 (diff) | |
download | libtdm-drm-3546629a60d36873da35cf6e9570d80a88e6c27e.tar.gz libtdm-drm-3546629a60d36873da35cf6e9570d80a88e6c27e.tar.bz2 libtdm-drm-3546629a60d36873da35cf6e9570d80a88e6c27e.zip |
set correct status when mode changedsubmit/tizen_3.0_wearable/20161015.000004submit/tizen_3.0_tv/20161015.000003submit/tizen_3.0_mobile/20161015.000004submit/tizen_3.0_ivi/20161010.000004submit/tizen_3.0_common/20161104.104000submit/tizen/20160823.022539accepted/tizen/wearable/20160824.055108accepted/tizen/tv/20160824.055040accepted/tizen/mobile/20160824.055005accepted/tizen/ivi/20160824.055135accepted/tizen/common/20160824.154216accepted/tizen/3.0/wearable/20161015.083552accepted/tizen/3.0/tv/20161016.004918accepted/tizen/3.0/mobile/20161015.033648accepted/tizen/3.0/ivi/20161011.050533accepted/tizen/3.0/common/20161114.105055
Change-Id: I1748a21062a4fb4f79c83cff9c121cd12c99b14e
Signed-off-by: Junkyeong Kim <jk0430.kim@samsung.com>
-rw-r--r-- | src/tdm_drm_display.c | 51 |
1 files changed, 25 insertions, 26 deletions
diff --git a/src/tdm_drm_display.c b/src/tdm_drm_display.c index 7fdee22..9ff29ee 100644 --- a/src/tdm_drm_display.c +++ b/src/tdm_drm_display.c @@ -185,6 +185,24 @@ _tdm_drm_display_wait_vblank(int fd, int pipe, uint *target_msc, void *data) } static tdm_error +_tdm_drm_output_update_status(tdm_drm_output_data *output_data, + tdm_output_conn_status status) +{ + RETURN_VAL_IF_FAIL(output_data, TDM_ERROR_INVALID_PARAMETER); + + if (output_data->status == status) + return TDM_ERROR_NONE; + + output_data->status = status; + + if (output_data->status_func) + output_data->status_func(output_data, status, + output_data->status_user_data); + + return TDM_ERROR_NONE; +} + +static tdm_error _tdm_drm_display_commit_primary_layer(tdm_drm_layer_data *layer_data, void *user_data, int *do_waitvblank) { @@ -215,10 +233,9 @@ _tdm_drm_display_commit_primary_layer(tdm_drm_layer_data *layer_data, TDM_ERR("set crtc failed: %m"); return TDM_ERROR_OPERATION_FAILED; } - output_data->status = TDM_OUTPUT_CONN_STATUS_MODE_SETTED; - if (output_data->status_func) - output_data->status_func(output_data, output_data->status, - output_data->status_user_data); + + _tdm_drm_output_update_status(output_data, TDM_OUTPUT_CONN_STATUS_MODE_SETTED); + *do_waitvblank = 1; return TDM_ERROR_NONE; } else if (layer_data->display_buffer_changed) { @@ -230,10 +247,10 @@ _tdm_drm_display_commit_primary_layer(tdm_drm_layer_data *layer_data, TDM_ERR("unset crtc failed: %m"); return TDM_ERROR_OPERATION_FAILED; } - output_data->status = TDM_OUTPUT_CONN_STATUS_CONNECTED; - if (output_data->status_func) - output_data->status_func(output_data, output_data->status, - output_data->status_user_data); + + if (output_data->status == TDM_OUTPUT_CONN_STATUS_MODE_SETTED) + _tdm_drm_output_update_status(output_data, TDM_OUTPUT_CONN_STATUS_CONNECTED); + *do_waitvblank = 1; } else { tdm_drm_event_data *event_data = calloc(1, sizeof(tdm_drm_event_data)); @@ -709,24 +726,6 @@ tdm_drm_display_destroy_output_list(tdm_drm_data *drm_data) } } -static tdm_error -_tdm_drm_output_update_status(tdm_drm_output_data *output_data, - tdm_output_conn_status status) -{ - RETURN_VAL_IF_FAIL(output_data, TDM_ERROR_INVALID_PARAMETER); - - if (output_data->status == status) - return TDM_ERROR_NONE; - - output_data->status = status; - - if (output_data->status_func) - output_data->status_func(output_data, status, - output_data->status_user_data); - - return TDM_ERROR_NONE; -} - void tdm_drm_display_update_output_status(tdm_drm_data *drm_data) { |