typedef enum {
TDM_DISPLAY_CAPABILITY_PP = (1 << 0), /**< if hardware supports pp operation */
TDM_DISPLAY_CAPABILITY_CAPTURE = (1 << 1), /**< if hardware supports capture operation */
- TDM_DISPLAY_CAPABILITY_HWC = (1 << 2), /**< if hardware supports hwc operation @since 2.0.0*/
} tdm_display_capability;
/**
*/
typedef enum {
TDM_OUTPUT_CAPABILITY_ASYNC_DPMS = (1 << 0), /**< if a outupt supports asynchronous DPMS operation */
+ TDM_OUTPUT_CAPABILITY_HWC = (1 << 1), /**< if a outupt supports hwc operation @since 2.0.0*/
} tdm_output_capability;
/**
tdm_display_enable_commit_per_vblank(private_display, enable);
}
- str = getenv("TDM_HWC");
- if (str) {
- char *end;
- int enable = strtol(str, &end, 10);
- private_display->hwc_enable = enable;
- }
-
if (pthread_mutex_init(&private_display->lock, NULL)) {
ret = TDM_ERROR_OPERATION_FAILED;
TDM_ERR("mutex init failed: %m");
if (ret != TDM_ERROR_NONE)
goto failed_load;
- if (!(private_display->capabilities & TDM_DISPLAY_CAPABILITY_HWC))
- private_display->hwc_enable = 0;
-
stamp2 = tdm_helper_get_time();
TDM_DBG("loading backend time: %.3f ms", (stamp2 - stamp1) * 1000.0);
stamp1 = stamp2;
private_display->init_count = 1;
private_display->commit_type = TDM_COMMIT_TYPE_NONE;
- if (private_display->hwc_enable) {
- tdm_private_output *o = NULL;
- LIST_FOR_EACH_ENTRY(o, &private_display->output_list, link)
+ tdm_private_output *o = NULL;
+ LIST_FOR_EACH_ENTRY(o, &private_display->output_list, link) {
+ if (o->caps.capabilities & TDM_OUTPUT_CAPABILITY_HWC)
tdm_output_need_validate_event_init(o);
}
if (_check_abi_version(module, 2, 0) < 0)
return TDM_ERROR_BAD_MODULE;
- private_display->capabilities |= TDM_DISPLAY_CAPABILITY_HWC;
private_display->func_hwc_window = *func_hwc_window;
return TDM_ERROR_NONE;
_pthread_mutex_lock(&private_display->lock);
- if (private_display->hwc_enable) {
+ if (private_output->caps.capabilities & TDM_OUTPUT_CAPABILITY_HWC) {
*count = 0;
_pthread_mutex_unlock(&private_display->lock);
return TDM_ERROR_NONE;
if (error)
*error = TDM_ERROR_NONE;
- if (private_display->hwc_enable) {
+ if (private_output->caps.capabilities & TDM_OUTPUT_CAPABILITY_HWC) {
_pthread_mutex_unlock(&private_display->lock);
if (error)
*error = TDM_ERROR_INVALID_PARAMETER;
_pthread_mutex_lock(&private_display->lock);
- if (private_display->hwc_enable)
+ if (private_output->caps.capabilities & TDM_OUTPUT_CAPABILITY_HWC)
hwc_window = (tdm_hwc_window *)tdm_hwc_window_create_internal(private_output, error);
else
if (error)
TDM_RETURN_VAL_IF_FAIL(TDM_MUTEX_IS_LOCKED(), TDM_ERROR_OPERATION_FAILED);
+ if (!(private_output->caps.capabilities & TDM_OUTPUT_CAPABILITY_HWC))
+ return TDM_ERROR_NONE;
+
/* build in eventfd fds into event_loop listened & handled by the tdm-thread */
fd = eventfd(0, 0);
TDM_WARNING_IF_FAIL(fd >= 0);
int commit_per_vblank;
tdm_commit_type commit_type;
- int hwc_enable;
-
int print_fps;
};