return TDM_ERROR_NONE;
}
+/* LCOV_EXCL_START */
INTERN void
tdm_output_thread_cb_destroy(tdm_private_display *private_display, void *object, tdm_thread_cb_base *cb_base, void *user_data)
{
_pthread_mutex_unlock(&private_display->lock);
}
+/* LCOV_EXCL_STOP */
EXTERN tdm_module *
tdm_output_get_backend_module(tdm_output *output, tdm_error *error)
return TDM_ERROR_NONE;
}
+/* LCOV_EXCL_START */
INTERN void
tdm_output_cb_status(tdm_output *output_backend, tdm_output_conn_status status, void *user_data)
{
TDM_WARNING_IF_FAIL(ret == TDM_ERROR_NONE);
}
+INTERN void
+tdm_output_cb_status_hal_tdm(hal_tdm_output *output_backend, hal_tdm_output_conn_status status, void *user_data)
+{
+ tdm_private_output *private_output = user_data;
+ tdm_error ret;
+
+ TDM_RETURN_IF_FAIL(private_output);
+
+ TDM_INFO("output(%d) %s", private_output->pipe, tdm_status_str((tdm_output_conn_status)status));
+
+ if ((private_output->caps.status == TDM_OUTPUT_CONN_STATUS_DISCONNECTED && status != HAL_TDM_OUTPUT_CONN_STATUS_DISCONNECTED) ||
+ (private_output->caps.status != TDM_OUTPUT_CONN_STATUS_DISCONNECTED && status == HAL_TDM_OUTPUT_CONN_STATUS_DISCONNECTED)) {
+ ret = tdm_display_update_output(private_output->private_module, output_backend);
+ TDM_RETURN_IF_FAIL(ret == TDM_ERROR_NONE);
+ } else {
+ private_output->caps.status = (tdm_output_conn_status)status;
+ }
+
+ ret = _tdm_output_call_thread_cb_status(private_output, (tdm_output_conn_status)status);
+ TDM_WARNING_IF_FAIL(ret == TDM_ERROR_NONE);
+}
+
+INTERN void
+tdm_output_cb_dpms_hal_tdm(hal_tdm_output *output_backend, hal_tdm_output_dpms dpms, void *user_data)
+{
+ tdm_private_output *private_output = user_data;
+ tdm_error ret;
+
+ TDM_INFO("output(%d) %s", private_output->pipe, tdm_dpms_str((tdm_output_dpms)dpms));
+
+ private_output->current_dpms_value = (tdm_output_dpms)dpms;
+ private_output->waiting_dpms_change = 0;
+ TDM_INFO("output(%d) DPMS async '%s' done", private_output->pipe, tdm_dpms_str((tdm_output_dpms)dpms));
+
+ ret = _tdm_output_call_thread_cb_dpms(private_output, (tdm_output_dpms)dpms);
+ TDM_WARNING_IF_FAIL(ret == TDM_ERROR_NONE);
+}
+/* LCOV_EXCL_STOP */
+
EXTERN tdm_error
tdm_output_add_change_handler(tdm_output *output,
tdm_output_change_handler func,
return ret;
}
+/* LCOV_EXCL_START */
EXTERN tdm_error
tdm_output_add_mode_change_request_handler(tdm_output *output,
tdm_output_mode_change_request_handler func,
return TDM_ERROR_INVALID_PARAMETER;
}
+/* LCOV_EXCL_STOP */
EXTERN void
tdm_output_remove_change_handler(tdm_output *output,
_pthread_mutex_lock(&private_display->lock);
private_module = private_output->private_module;
- func_output = &private_module->func_output;
- if (!func_output->output_set_property) {
- /* LCOV_EXCL_START */
- _pthread_mutex_unlock(&private_display->lock);
- TDM_WRN("not implemented!!");
- return TDM_ERROR_NOT_IMPLEMENTED;
- /* LCOV_EXCL_STOP */
- }
+ if (private_module->use_hal_tdm) {
+ hal_tdm_value hvalue;
+ memcpy(&hvalue.ptr, &value.ptr, sizeof(hal_tdm_value));
+ ret = (tdm_error)hal_tdm_output_set_property(private_output->output_backend, id, hvalue);
+ } else {
+ func_output = &private_module->func_output;
- ret = func_output->output_set_property(private_output->output_backend, id,
- value);
+ if (!func_output->output_set_property) {
+ /* LCOV_EXCL_START */
+ _pthread_mutex_unlock(&private_display->lock);
+ TDM_WRN("not implemented!!");
+ return TDM_ERROR_NOT_IMPLEMENTED;
+ /* LCOV_EXCL_STOP */
+ }
+
+ ret = func_output->output_set_property(private_output->output_backend, id, value);
+ }
_pthread_mutex_unlock(&private_display->lock);
_pthread_mutex_lock(&private_display->lock);
private_module = private_output->private_module;
- func_output = &private_module->func_output;
- if (!func_output->output_get_property) {
- /* LCOV_EXCL_START */
- _pthread_mutex_unlock(&private_display->lock);
- TDM_WRN("not implemented!!");
- return TDM_ERROR_NOT_IMPLEMENTED;
- /* LCOV_EXCL_STOP */
- }
+ if (private_module->use_hal_tdm) {
+ hal_tdm_value hvalue;
+ ret = (tdm_error)hal_tdm_output_get_property(private_output->output_backend, id, &hvalue);
+ if (ret == TDM_ERROR_NONE)
+ memcpy(&value->ptr, &hvalue.ptr, sizeof(tdm_value));
+ } else {
+ func_output = &private_module->func_output;
- ret = func_output->output_get_property(private_output->output_backend, id,
- value);
+ if (!func_output->output_get_property) {
+ /* LCOV_EXCL_START */
+ _pthread_mutex_unlock(&private_display->lock);
+ TDM_WRN("not implemented!!");
+ return TDM_ERROR_NOT_IMPLEMENTED;
+ /* LCOV_EXCL_STOP */
+ }
+ ret = func_output->output_get_property(private_output->output_backend, id, value);
+ }
_pthread_mutex_unlock(&private_display->lock);
return ret;
}
static void
+_tdm_output_cb_vblank_hal_tdm(hal_tdm_output *output_backend, unsigned int sequence,
+ unsigned int tv_sec, unsigned int tv_usec, void *user_data)
+{
+ tdm_private_output_vblank_handler *vblank_handler = user_data;
+ tdm_thread_cb_output_vblank output_vblank;
+ tdm_error ret;
+
+ memset(&output_vblank, 0, sizeof output_vblank);
+ output_vblank.base.type = TDM_THREAD_CB_OUTPUT_VBLANK;
+ output_vblank.base.length = sizeof output_vblank;
+ output_vblank.base.object_stamp = vblank_handler->private_output->stamp;
+ output_vblank.base.data = vblank_handler;
+ output_vblank.base.sync = 0;
+ output_vblank.sequence = sequence;
+ output_vblank.tv_sec = tv_sec;
+ output_vblank.tv_usec = tv_usec;
+
+ vblank_handler->sent_to_frontend = 1;
+
+ if (tdm_debug_module & TDM_DEBUG_COMMIT)
+ TDM_INFO("output(%d) wait_vblank: handler(%p)", vblank_handler->private_output->pipe, vblank_handler);
+
+ ret = tdm_thread_cb_call(vblank_handler->private_output, &output_vblank.base, 1);
+ TDM_WARNING_IF_FAIL(ret == TDM_ERROR_NONE);
+}
+
+/* LCOV_EXCL_START */
+static void
_tdm_output_thread_cb_commit(tdm_private_display *private_display, void *object, tdm_thread_cb_base *cb_base, void *user_data)
{
tdm_thread_cb_output_commit *output_commit = (tdm_thread_cb_output_commit *)cb_base;
}
static void
+_tdm_output_cb_commit_hal_tdm(hal_tdm_output *output_backend, unsigned int sequence,
+ unsigned int tv_sec, unsigned int tv_usec, void *user_data)
+{
+ tdm_private_output_commit_handler *output_commit_handler = user_data;
+ tdm_private_output *private_output;
+ tdm_thread_cb_output_commit output_commit;
+ tdm_error ret;
+
+ if (output_commit_handler)
+ private_output = output_commit_handler->private_output;
+ else
+ private_output = tdm_display_find_private_output(tdm_display_get(), (tdm_output *)output_backend);
+
+ memset(&output_commit, 0, sizeof output_commit);
+ output_commit.base.type = TDM_THREAD_CB_OUTPUT_COMMIT;
+ output_commit.base.length = sizeof output_commit;
+ output_commit.base.object_stamp = private_output->stamp;
+ output_commit.base.data = output_commit_handler;
+ output_commit.base.sync = 0;
+ output_commit.sequence = sequence;
+ output_commit.tv_sec = tv_sec;
+ output_commit.tv_usec = tv_usec;
+
+ ret = tdm_thread_cb_call(private_output, &output_commit.base, 1);
+ TDM_WARNING_IF_FAIL(ret == TDM_ERROR_NONE);
+}
+/* LCOV_EXCL_STOP */
+
+/* LCOV_EXCL_START */
+static void
_tdm_voutput_thread_cb_commit(tdm_private_display *private_display, void *object, tdm_thread_cb_base *cb_base, void *user_data)
{
tdm_thread_cb_voutput_commit *voutput_commit = (tdm_thread_cb_voutput_commit *)cb_base;
ret = tdm_thread_cb_call(private_voutput, &voutput_commit.base, 1);
TDM_WARNING_IF_FAIL(ret == TDM_ERROR_NONE);
}
+/* LCOV_EXCL_STOP */
/* add_front: To distinguish between the user vblank handlers and the layer
* commit vblank handlers. The layer commit handlers will be called
if (interval <= 0)
interval = 1;
- if (!func_output->output_wait_vblank) {
- /* LCOV_EXCL_START */
- TDM_WRN("not implemented!!");
- return TDM_ERROR_NOT_IMPLEMENTED;
- /* LCOV_EXCL_STOP */
- }
+ if (private_module->use_hal_tdm) {
+ if (!private_output->regist_vblank_cb) {
+ private_output->regist_vblank_cb = 1;
+ ret = (tdm_error)hal_tdm_output_set_vblank_handler(private_output->output_backend, _tdm_output_cb_vblank_hal_tdm);
+ }
+ } else {
+ if (!func_output->output_wait_vblank) {
+ /* LCOV_EXCL_START */
+ TDM_WRN("not implemented!!");
+ return TDM_ERROR_NOT_IMPLEMENTED;
+ /* LCOV_EXCL_STOP */
+ }
- if (!private_output->regist_vblank_cb) {
- private_output->regist_vblank_cb = 1;
- ret = func_output->output_set_vblank_handler(private_output->output_backend,
- _tdm_output_cb_vblank);
+ if (!private_output->regist_vblank_cb) {
+ private_output->regist_vblank_cb = 1;
+ ret = func_output->output_set_vblank_handler(private_output->output_backend,
+ _tdm_output_cb_vblank);
+ }
}
-
vblank_handler = calloc(1, sizeof(tdm_private_output_vblank_handler));
if (!vblank_handler) {
/* LCOV_EXCL_START */
TDM_ERR("tdm_thread_cb_add failed");
goto wait_failed;
}
-
- ret = func_output->output_wait_vblank(private_output->output_backend, interval,
- sync, vblank_handler);
+ if (private_module->use_hal_tdm)
+ ret = (tdm_error)hal_tdm_output_wait_vblank(private_output->output_backend, interval,
+ sync, vblank_handler);
+ else
+ ret = func_output->output_wait_vblank(private_output->output_backend, interval,
+ sync, vblank_handler);
TDM_GOTO_IF_FAIL(ret == TDM_ERROR_NONE, wait_failed);
_tdm_output_vblank_timeout_update(private_output, 1000);
return TDM_ERROR_DPMS_OFF;
}
+ if (private_output->waiting_dpms_change) {
+ TDM_WRN("output(%d) dpms is changing: %s", private_output->pipe,
+ tdm_dpms_str(private_output->current_dpms_value));
+ _pthread_mutex_unlock(&private_display->lock);
+ return TDM_ERROR_DPMS_OFF;
+ }
+
ret = _tdm_output_wait_vblank(private_output, interval, sync, func, user_data, 0);
_pthread_mutex_unlock(&private_display->lock);
return TDM_ERROR_DPMS_OFF;
}
+ if (private_output->waiting_dpms_change) {
+ TDM_WRN("output(%d) dpms is changing: %s", private_output->pipe,
+ tdm_dpms_str(private_output->current_dpms_value));
+ _pthread_mutex_unlock(&private_display->lock);
+ return TDM_ERROR_DPMS_OFF;
+ }
+
ret = _tdm_output_wait_vblank(private_output, interval, sync, func, user_data, 1);
_pthread_mutex_unlock(&private_display->lock);
}
}
+/* LCOV_EXCL_START */
INTERN void
tdm_output_remove_commit_handler_internal(tdm_output *output, tdm_output_commit_handler func, void *user_data)
{
}
}
}
+/* LCOV_EXCL_STOP */
EXTERN tdm_error
tdm_output_remove_vblank_handler(tdm_output *output, tdm_output_vblank_handler func, void *user_data)
return ret;
}
+/* LCOV_EXCL_START */
EXTERN tdm_error
tdm_output_remove_commit_handler(tdm_output *output, tdm_output_commit_handler func, void *user_data)
{
return ret;
}
+/* LCOV_EXCL_STOP */
+/* LCOV_EXCL_START */
INTERN void
tdm_output_request_mode_set(tdm_output *output, unsigned int index)
{
voutput_commit_handler = calloc(1, sizeof(tdm_private_voutput_commit_handler));
if (!voutput_commit_handler) {
- /* LCOV_EXCL_START */
TDM_ERR("failed: alloc memory");
_pthread_mutex_unlock(&private_display->lock);
return TDM_ERROR_OUT_OF_MEMORY;
- /* LCOV_EXCL_STOP */
}
ret = tdm_thread_cb_add(private_output->private_voutput, TDM_THREAD_CB_VOUTPUT_COMMIT, voutput_commit_handler, _tdm_voutput_thread_cb_commit, NULL);
return TDM_ERROR_NONE;
}
+/* LCOV_EXCL_STOP */
+/* LCOV_EXCL_START */
INTERN tdm_error
tdm_output_commit_internal(tdm_output *output, int sync, tdm_output_commit_handler func, void *user_data)
{
private_display = private_module->private_display;
func_output = &private_module->func_output;
- if (!func_output->output_commit) {
- /* LCOV_EXCL_START */
- TDM_WRN("not implemented!!");
- return TDM_ERROR_NOT_IMPLEMENTED;
- /* LCOV_EXCL_STOP */
+ if (!private_module->use_hal_tdm) {
+ if (!func_output->output_commit) {
+ TDM_WRN("not implemented!!");
+ return TDM_ERROR_NOT_IMPLEMENTED;
+ }
}
ret = tdm_output_get_dpms_internal(output, &dpms_value);
if (!TDM_OUTPUT_DPMS_VSYNC_IS_OFF(dpms_value)) {
if (!private_output->regist_commit_cb) {
private_output->regist_commit_cb = 1;
- ret = func_output->output_set_commit_handler(private_output->output_backend, _tdm_output_cb_commit);
+ if (private_module->use_hal_tdm)
+ ret = (tdm_error)hal_tdm_output_set_commit_handler(private_output->output_backend, _tdm_output_cb_commit_hal_tdm);
+ else
+ ret = func_output->output_set_commit_handler(private_output->output_backend, _tdm_output_cb_commit);
TDM_GOTO_IF_FAIL(ret == TDM_ERROR_NONE, commit_failed);
}
output_commit_handler = calloc(1, sizeof(tdm_private_output_commit_handler));
if (!output_commit_handler) {
- /* LCOV_EXCL_START */
TDM_ERR("failed: alloc memory");
return TDM_ERROR_OUT_OF_MEMORY;
- /* LCOV_EXCL_STOP */
}
if (private_module == private_display->virtual_module) {
voutput_commit_handler->user_data = private_layer->commiting_buffer;
}
}
-
- ret = func_output->output_commit(private_output->output_backend, sync,
- output_commit_handler);
+ if (private_module->use_hal_tdm)
+ ret = (tdm_error)hal_tdm_output_commit(private_output->output_backend, sync, output_commit_handler);
+ else
+ ret = func_output->output_commit(private_output->output_backend, sync, output_commit_handler);
TDM_GOTO_IF_FAIL(ret == TDM_ERROR_NONE, commit_failed);
if (tdm_debug_module & TDM_DEBUG_COMMIT)
return ret;
commit_failed:
- /* LCOV_EXCL_START */
if (output_commit_handler) {
tdm_thread_cb_remove(private_output, TDM_THREAD_CB_OUTPUT_COMMIT, output_commit_handler, _tdm_output_thread_cb_commit, NULL);
LIST_DEL(&output_commit_handler->link);
}
return ret;
- /* LCOV_EXCL_STOP */
}
EXTERN tdm_error
return ret;
}
+/* LCOV_EXCL_STOP */
EXTERN tdm_error
tdm_output_set_mode(tdm_output *output, const tdm_output_mode *mode)
private_module = private_output->private_module;
func_output = &private_module->func_output;
- if (!func_output->output_set_mode) {
- /* LCOV_EXCL_START */
- _pthread_mutex_unlock(&private_display->lock);
- TDM_WRN("not implemented!!");
- return TDM_ERROR_NOT_IMPLEMENTED;
- /* LCOV_EXCL_STOP */
- }
+ if (private_module->use_hal_tdm) {
+ ret = (tdm_error)hal_tdm_output_set_mode(private_output->output_backend, (const hal_tdm_output_mode *)mode);
+ } else {
+ if (!func_output->output_set_mode) {
+ /* LCOV_EXCL_START */
+ _pthread_mutex_unlock(&private_display->lock);
+ TDM_WRN("not implemented!!");
+ return TDM_ERROR_NOT_IMPLEMENTED;
+ /* LCOV_EXCL_STOP */
+ }
- ret = func_output->output_set_mode(private_output->output_backend, mode);
+ ret = func_output->output_set_mode(private_output->output_backend, mode);
+ }
if (ret == TDM_ERROR_NONE) {
private_output->current_mode = mode;
private_output->need_set_target_info = 1;
TDM_INFO("output(%d) DPMS '%s'", private_output->pipe, tdm_dpms_str(dpms_value));
- if (func_output->output_set_dpms)
- ret = func_output->output_set_dpms(private_output->output_backend, dpms_value);
- else {
- /* LCOV_EXCL_START */
- ret = TDM_ERROR_NONE;
- TDM_WRN("DPMS not implemented!!");
- goto done;
- /* LCOV_EXCL_STOP */
+ if (private_module->use_hal_tdm) {
+ ret = (tdm_error)hal_tdm_output_set_dpms(private_output->output_backend, (hal_tdm_output_dpms)dpms_value);
+ } else {
+ if (func_output->output_set_dpms)
+ ret = func_output->output_set_dpms(private_output->output_backend, dpms_value);
+ else {
+ /* LCOV_EXCL_START */
+ ret = TDM_ERROR_NONE;
+ TDM_WRN("DPMS not implemented!!");
+ /* LCOV_EXCL_STOP */
+ }
}
-done:
if (ret == TDM_ERROR_NONE) {
if (private_output->current_dpms_value != dpms_value) {
private_output->current_dpms_value = dpms_value;
private_module = private_output->private_module;
func_output = &private_module->func_output;
- if (!func_output->output_set_dpms_handler) {
- TDM_WRN("not implemented DPMS: output_set_dpms_handler");
- _pthread_mutex_unlock(&private_display->lock);
- return TDM_ERROR_NOT_IMPLEMENTED;
- }
+ if (!private_module->use_hal_tdm) {
+ if (!func_output->output_set_dpms_handler) {
+ TDM_WRN("not implemented DPMS: output_set_dpms_handler");
+ _pthread_mutex_unlock(&private_display->lock);
+ return TDM_ERROR_NOT_IMPLEMENTED;
+ }
- if (!func_output->output_set_dpms_async) {
- TDM_WRN("not implemented DPMS: output_set_dpms_async");
- _pthread_mutex_unlock(&private_display->lock);
- return TDM_ERROR_NOT_IMPLEMENTED;
+ if (!func_output->output_set_dpms_async) {
+ TDM_WRN("not implemented DPMS: output_set_dpms_async");
+ _pthread_mutex_unlock(&private_display->lock);
+ return TDM_ERROR_NOT_IMPLEMENTED;
+ }
}
if (!private_output->regist_dpms_cb) {
private_output->regist_dpms_cb = 1;
- ret = func_output->output_set_dpms_handler(private_output->output_backend,
- tdm_output_cb_dpms, private_output);
+ if (private_module->use_hal_tdm)
+ ret = (tdm_error)hal_tdm_output_set_dpms_handler(private_output->output_backend,
+ tdm_output_cb_dpms_hal_tdm, private_output);
+ else
+ ret = func_output->output_set_dpms_handler(private_output->output_backend,
+ tdm_output_cb_dpms, private_output);
if (ret != TDM_ERROR_NONE) {
_pthread_mutex_unlock(&private_display->lock);
TDM_ERR("Can't set the DPMS handler!!");
TDM_INFO("output(%d) DPMS async '%s'", private_output->pipe, tdm_dpms_str(dpms_value));
- ret = func_output->output_set_dpms_async(private_output->output_backend, dpms_value, &sync);
+ if (private_module->use_hal_tdm)
+ ret = (tdm_error)hal_tdm_output_set_dpms_async(private_output->output_backend, (hal_tdm_output_dpms)dpms_value, &sync);
+ else
+ ret = func_output->output_set_dpms_async(private_output->output_backend, dpms_value, &sync);
if (ret == TDM_ERROR_NONE) {
if (sync) {
private_module = private_output->private_module;
func_output = &private_module->func_output;
- if (!func_output->output_get_dpms) {
- /* LCOV_EXCL_START */
- *dpms_value = private_output->current_dpms_value;
- TDM_WRN("DPMS get not implemented!!");
- return TDM_ERROR_NONE;
- /* LCOV_EXCL_STOP */
- }
+ if (private_module->use_hal_tdm) {
+ ret = (tdm_error)hal_tdm_output_get_dpms(private_output->output_backend, (hal_tdm_output_dpms *)dpms_value);
+ } else {
+ if (!func_output->output_get_dpms) {
+ /* LCOV_EXCL_START */
+ *dpms_value = private_output->current_dpms_value;
+ TDM_WRN("DPMS get not implemented!!");
+ return TDM_ERROR_NONE;
+ /* LCOV_EXCL_STOP */
+ }
- ret = func_output->output_get_dpms(private_output->output_backend, dpms_value);
+ ret = func_output->output_get_dpms(private_output->output_backend, dpms_value);
+ }
if (ret != TDM_ERROR_NONE) {
/* LCOV_EXCL_START */
TDM_ERR("output get DPMS failed");
return TDM_ERROR_BAD_REQUEST;
}
- if (!func_output->output_set_mirror) {
- TDM_WRN("not implemented!!");
- _pthread_mutex_unlock(&private_display->lock);
- return TDM_ERROR_NOT_IMPLEMENTED;
+ if (private_module->use_hal_tdm) {
+ ret = (tdm_error)hal_tdm_output_set_mirror((hal_tdm_output *)private_output->output_backend,
+ (hal_tdm_output *)private_src_output->output_backend, (hal_tdm_transform)transform);
}
+ else {
+ if (!func_output->output_set_mirror) {
+ TDM_WRN("not implemented!!");
+ _pthread_mutex_unlock(&private_display->lock);
+ return TDM_ERROR_NOT_IMPLEMENTED;
+ }
- ret = func_output->output_set_mirror(private_output->output_backend,
- private_src_output->output_backend,
- transform);
+ ret = func_output->output_set_mirror(private_output->output_backend,
+ private_src_output->output_backend,
+ transform);
+ }
if (ret != TDM_ERROR_NONE) {
TDM_ERR("output(%p) fails to set MIRROR.", private_output);
_pthread_mutex_unlock(&private_display->lock);
return TDM_ERROR_BAD_REQUEST;
}
- if (!func_output->output_unset_mirror) {
- TDM_WRN("not implemented!!");
- _pthread_mutex_unlock(&private_display->lock);
- return TDM_ERROR_NOT_IMPLEMENTED;
- }
+ if (private_module->use_hal_tdm) {
+ ret = (tdm_error)hal_tdm_output_unset_mirror((hal_tdm_output *)private_output->output_backend);
+ } else {
+ if (!func_output->output_unset_mirror) {
+ TDM_WRN("not implemented!!");
+ _pthread_mutex_unlock(&private_display->lock);
+ return TDM_ERROR_NOT_IMPLEMENTED;
+ }
- ret = func_output->output_unset_mirror(private_output->output_backend);
+ ret = func_output->output_unset_mirror(private_output->output_backend);
+ }
if (ret != TDM_ERROR_NONE) {
TDM_ERR("output(%p) fails to unset MIRROR.", private_output);
_pthread_mutex_unlock(&private_display->lock);
return TDM_ERROR_NONE;
}
+/* LCOV_EXCL_START */
INTERN tdm_error
tdm_voutput_destroy(tdm_voutput *voutput)
{
_pthread_mutex_lock(&private_display->lock);
- func_voutput = &private_module->func_voutput;
- if (func_voutput->voutput_set_available_mode)
- ret = func_voutput->voutput_set_available_mode(private_voutput->voutput_backend, modes, count);
- else
- ret = TDM_ERROR_NOT_IMPLEMENTED;
-
+ if (private_module->use_hal_tdm) {
+ ret = (tdm_error)hal_tdm_voutput_set_available_mode((hal_tdm_voutput *)private_voutput->voutput_backend,
+ (const hal_tdm_output_mode *)modes, count);
+ } else {
+ func_voutput = &private_module->func_voutput;
+ if (func_voutput->voutput_set_available_mode)
+ ret = func_voutput->voutput_set_available_mode(private_voutput->voutput_backend, modes, count);
+ else
+ ret = TDM_ERROR_NOT_IMPLEMENTED;
+ }
_pthread_mutex_unlock(&private_display->lock);
return ret;
_pthread_mutex_lock(&private_display->lock);
- func_voutput = &private_module->func_voutput;
- if (func_voutput->voutput_set_physical_size)
- ret = func_voutput->voutput_set_physical_size(private_voutput->voutput_backend, mmwidth, mmheight);
- else
- ret = TDM_ERROR_NOT_IMPLEMENTED;
-
+ if (private_module->use_hal_tdm) {
+ ret = (tdm_error)hal_tdm_voutput_set_physical_size((hal_tdm_voutput *)private_voutput->voutput_backend, mmwidth, mmheight);
+ } else {
+ func_voutput = &private_module->func_voutput;
+ if (func_voutput->voutput_set_physical_size)
+ ret = func_voutput->voutput_set_physical_size(private_voutput->voutput_backend, mmwidth, mmheight);
+ else
+ ret = TDM_ERROR_NOT_IMPLEMENTED;
+ }
_pthread_mutex_unlock(&private_display->lock);
return ret;
_pthread_mutex_lock(&private_display->lock);
- func_voutput = &private_module->func_voutput;
- if (func_voutput->voutput_connect)
- ret = func_voutput->voutput_connect(private_voutput->voutput_backend);
- else
- ret = TDM_ERROR_NOT_IMPLEMENTED;
-
+ if (private_module->use_hal_tdm) {
+ ret = (tdm_error)hal_tdm_voutput_connect((hal_tdm_voutput *)private_voutput->voutput_backend);
+ } else {
+ func_voutput = &private_module->func_voutput;
+ if (func_voutput->voutput_connect)
+ ret = func_voutput->voutput_connect(private_voutput->voutput_backend);
+ else
+ ret = TDM_ERROR_NOT_IMPLEMENTED;
+ }
_pthread_mutex_unlock(&private_display->lock);
return ret;
_pthread_mutex_lock(&private_display->lock);
- func_voutput = &private_module->func_voutput;
- if (func_voutput->voutput_disconnect)
- ret = func_voutput->voutput_disconnect(private_voutput->voutput_backend);
- else
- ret = TDM_ERROR_NOT_IMPLEMENTED;
-
+ if (private_module->use_hal_tdm) {
+ ret = (tdm_error)hal_tdm_voutput_disconnect((hal_tdm_voutput *)private_voutput->voutput_backend);
+ } else {
+ func_voutput = &private_module->func_voutput;
+ if (func_voutput->voutput_disconnect)
+ ret = func_voutput->voutput_disconnect(private_voutput->voutput_backend);
+ else
+ ret = TDM_ERROR_NOT_IMPLEMENTED;
+ }
_pthread_mutex_unlock(&private_display->lock);
return ret;
}
-/* LCOV_EXCL_START */
INTERN tdm_error
tdm_voutput_set_commit_func(tdm_voutput *voutput, tdm_voutput_commit_handler func)
{
private_module = private_voutput->private_module;
TDM_RETURN_VAL_IF_FAIL(private_module == private_display->virtual_module, TDM_ERROR_BAD_MODULE);
- func_voutput = &private_module->func_voutput;
- if (func_voutput->voutput_set_commit_func)
- ret = func_voutput->voutput_set_commit_func(private_voutput->voutput_backend, func);
- else
- ret = TDM_ERROR_NOT_IMPLEMENTED;
-
+ if (private_module->use_hal_tdm) {
+ ret = (tdm_error)hal_tdm_voutput_set_commit_func((hal_tdm_voutput *)private_voutput->voutput_backend,
+ (hal_tdm_voutput_commit_handler)func);
+ } else {
+ func_voutput = &private_module->func_voutput;
+ if (func_voutput->voutput_set_commit_func)
+ ret = func_voutput->voutput_set_commit_func(private_voutput->voutput_backend, func);
+ else
+ ret = TDM_ERROR_NOT_IMPLEMENTED;
+ }
return ret;
}
_pthread_mutex_lock(&private_display->lock);
- func_voutput = &private_module->func_voutput;
- if (func_voutput->voutput_commit_done)
- ret = func_voutput->voutput_commit_done(private_voutput->voutput_backend);
- else
- ret = TDM_ERROR_NOT_IMPLEMENTED;
-
+ if (private_module->use_hal_tdm) {
+ ret = (tdm_error)hal_tdm_voutput_commit_done((hal_tdm_voutput *)private_voutput->voutput_backend);
+ } else {
+ func_voutput = &private_module->func_voutput;
+ if (func_voutput->voutput_commit_done)
+ ret = func_voutput->voutput_commit_done(private_voutput->voutput_backend);
+ else
+ ret = TDM_ERROR_NOT_IMPLEMENTED;
+ }
_pthread_mutex_unlock(&private_display->lock);
return ret;