From 27f4a6409db891962939b82e211efcce059aeae4 Mon Sep 17 00:00:00 2001 From: Vishal Mahaveer Date: Wed, 6 Jun 2018 15:34:17 -0500 Subject: hwc: move uevent dependant code under new flag HDMI hotplug detection logic is dependent on uevent APIs, move this code under new flag to remove dependency on libhardware_legacy. When building for VNDK, set the HWC_SUPPORT_HDMI_HOTPLUG flag to false. Change-Id: Iacb932124dbb81f3af42760a5fe886efc0443448 Signed-off-by: Vishal Mahaveer --- hwcomposer/Android.mk | 8 +++++++- hwcomposer/hwc.c | 6 ++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/hwcomposer/Android.mk b/hwcomposer/Android.mk index 2221c43..f4b279e 100644 --- a/hwcomposer/Android.mk +++ b/hwcomposer/Android.mk @@ -8,7 +8,7 @@ LOCAL_PRELINK_MODULE := false LOCAL_ARM_MODE := arm LOCAL_MODULE_RELATIVE_PATH := hw LOCAL_VENDOR_MODULE := true -LOCAL_SHARED_LIBRARIES := liblog libcutils libutils libhardware libdrm libsync libhardware_legacy libdrm_omap +LOCAL_SHARED_LIBRARIES := liblog libcutils libutils libhardware libdrm libsync libdrm_omap LOCAL_CFLAGS += -DSUPPORT_ANDROID_MEMTRACK_HAL @@ -36,6 +36,12 @@ ifeq ($(HWC_USE_DRM_PAGEFLIP_MODE),true) LOCAL_CFLAGS += -DHWC_USE_DRM_PAGEFLIP_MODE endif +HWC_SUPPORT_HDMI_HOTPLUG := true +ifeq ($(HWC_SUPPORT_HDMI_HOTPLUG),true) + LOCAL_CFLAGS += -DHWC_SUPPORT_HDMI_HOTPLUG + LOCAL_SHARED_LIBRARIES += libhardware_legacy +endif + LOCAL_MODULE_TAGS := optional LOCAL_MODULE := hwcomposer.$(TARGET_BOARD_PLATFORM) diff --git a/hwcomposer/hwc.c b/hwcomposer/hwc.c index f03d43b..cab0d1a 100644 --- a/hwcomposer/hwc.c +++ b/hwcomposer/hwc.c @@ -31,7 +31,9 @@ #define HWC_REMOVE_DEPRECATED_VERSIONS 1 #include #include +#ifdef HWC_SUPPORT_HDMI_HOTPLUG #include +#endif #include #include #include @@ -483,6 +485,7 @@ static int hwc_device_close(hw_device_t* device) } +#ifdef HWC_SUPPORT_HDMI_HOTPLUG static void handle_hotplug(omap_hwc_device_t *hwc_dev) { /* WA: till Hotplug is integrated */ @@ -661,6 +664,7 @@ static void *hwc_hdmi_thread(void *data) return NULL; } +#endif /* * DRM event polling thread @@ -860,12 +864,14 @@ static int hwc_device_open(const hw_module_t* module, const char* name, hw_devic goto done; } +#ifdef HWC_SUPPORT_HDMI_HOTPLUG if (pthread_create(&hwc_dev->hdmi_thread, NULL, hwc_hdmi_thread, hwc_dev)) { ALOGE("failed to create HDMI listening thread (%d): %m", errno); err = -errno; goto done; } +#endif char value[PROPERTY_VALUE_MAX]; property_get("persist.hwc.upscaled_nv12_limit", value, "2."); -- cgit v1.2.3