layer: add the macro to check the HWC cap is enabled 28/206228/2
authorSooChan Lim <sc1.lim@samsung.com>
Wed, 15 May 2019 08:40:48 +0000 (17:40 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Wed, 11 Mar 2020 01:08:32 +0000 (01:08 +0000)
Change-Id: I8812530c7aed667baed03dc0a1e08ee169d9a418

src/tdm_layer.c

index 488f498..3737da1 100644 (file)
        private_output = private_layer->private_output; \
        private_display = private_output->private_display
 
+#define OUTPUT_HWC_CAP_CHECK() \
+       if (private_output->caps.capabilities & TDM_OUTPUT_CAPABILITY_HWC) { \
+               TDM_ERR("output(%p) support HWC. Use HWC functions", private_output); \
+               _pthread_mutex_unlock(&private_display->lock); \
+               return TDM_ERROR_OPERATION_FAILED; \
+       }
+
+#define OUTPUT_HWC_CAP_CHECK_ERROR() \
+       if (private_output->caps.capabilities & TDM_OUTPUT_CAPABILITY_HWC) { \
+               TDM_ERR("output(%p) support HWC. Use HWC functions", private_output); \
+               if (error) *error = TDM_ERROR_OPERATION_FAILED; \
+               _pthread_mutex_unlock(&private_display->lock); \
+               return NULL; \
+       }
+
+#define OUTPUT_HWC_CAP_CHECK_VOID_RETURN() \
+       if (private_output->caps.capabilities & TDM_OUTPUT_CAPABILITY_HWC)  { \
+               TDM_ERR("output(%p) support HWC. Use HWC functions", private_output); \
+               _pthread_mutex_unlock(&private_display->lock); \
+               return; \
+       }
+
 static void _tdm_layer_cb_wait_vblank(tdm_vblank *vblank, tdm_error error, unsigned int sequence,
                                                                          unsigned int tv_sec, unsigned int tv_usec, void *user_data);
 static void _tbm_layer_queue_acquirable_cb(tbm_surface_queue_h surface_queue, void *data);