[hwc] make a temp fix related to ecore_drm 16/156216/2
authorSergey Sizonov <s.sizonov@samsung.com>
Tue, 17 Oct 2017 12:07:55 +0000 (15:07 +0300)
committerSergey Sizonov <s.sizonov@samsung.com>
Tue, 17 Oct 2017 12:11:46 +0000 (12:11 +0000)
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>
src/tdm_layer.c
src/tdm_output.c

index c6128a8..e15deec 100644 (file)
@@ -85,6 +85,23 @@ static void _tdm_layer_cb_output_commit(tdm_output *output, unsigned int sequenc
 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);
index 1d84a1c..dc8c87a 100644 (file)
@@ -299,7 +299,13 @@ tdm_output_get_layer_count(tdm_output *output, int *count)
        _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;
        }
@@ -334,7 +340,11 @@ tdm_output_get_layer(tdm_output *output, int index, tdm_error *error)
                _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) {