summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunkyeong Kim <jk0430.kim@samsung.com>2016-08-18 11:49:00 +0900
committerJunkyeong Kim <jk0430.kim@samsung.com>2016-08-18 11:49:03 +0900
commit3546629a60d36873da35cf6e9570d80a88e6c27e (patch)
tree020e44ed1f8f7f6579a6a3c9f369a77547f0ca3e
parentf4616cbd93b874c129dd35fa36cec393cd8d5bd6 (diff)
downloadlibtdm-drm-3546629a60d36873da35cf6e9570d80a88e6c27e.tar.gz
libtdm-drm-3546629a60d36873da35cf6e9570d80a88e6c27e.tar.bz2
libtdm-drm-3546629a60d36873da35cf6e9570d80a88e6c27e.zip
Change-Id: I1748a21062a4fb4f79c83cff9c121cd12c99b14e Signed-off-by: Junkyeong Kim <jk0430.kim@samsung.com>
-rw-r--r--src/tdm_drm_display.c51
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)
{