When TDM works within HWC mode it turns off the tdm_layer
functionality, but ecore_drm uses it, so to avoid changes
to ecore_drm (efl) we have to make some hack here... to let
ecore_drm pass its initialization step.
Change-Id: I221b97e45abec8622629c5253b53fcf63a9e55d4
Signed-off-by: Sergey Sizonov <s.sizonov@samsung.com>
EXTERN tdm_error
tdm_layer_get_capabilities(tdm_layer *layer, tdm_layer_capability *capabilities)
{
+ int hwc_enable;
+ char *str;
+
+ hwc_enable = 0;
+ str = getenv("TDM_HWC");
+
+ if (str)
+ hwc_enable = strtol(str, NULL, 10);
+
+ /* an ecore_drm related fix: sorry... when ecore_drm refuses to use
+ * tdm_layer we'll remove this code */
+ if (hwc_enable) {
+ if (capabilities)
+ *capabilities = TDM_LAYER_CAPABILITY_PRIMARY;
+ return TDM_ERROR_NONE;
+ }
+
LAYER_FUNC_ENTRY();
TDM_RETURN_VAL_IF_FAIL(capabilities != NULL, TDM_ERROR_INVALID_PARAMETER);
_pthread_mutex_lock(&private_display->lock);
if (private_display->hwc_enable) {
- *count = 0;
+
+ /* an ecore_drm related fix: sorry... when ecore_drm refuses to use
+ * tdm_layer we'll remove this code */
+ if (count)
+ *count = 1;
+ //*count = 0;
+
_pthread_mutex_unlock(&private_display->lock);
return TDM_ERROR_NONE;
}
_pthread_mutex_unlock(&private_display->lock);
if (error)
*error = TDM_ERROR_INVALID_PARAMETER;
- return NULL;
+
+ /* an ecore_drm related fix: sorry... when ecore_drm refuses to use tdm_layer
+ * we'll remove this code */
+ return (tdm_layer *)0xffffffffffffffff;
+ //return NULL;
}
LIST_FOR_EACH_ENTRY(private_layer, &private_output->layer_list, link) {