android_device_samsung_msm8.../BoardConfigCommon.mk
Gabriele M 17591b33ae Custom PowerHAL implementation
PowerHAL highlights:
* The CPU governor is always interactive. Governor changes are not
  expected and permissions are set once on boot.
* Powersave profile: the CPU frequency is limited 787MHz and the CPU
  is never boosted on user interaction. This will save power without
  making the phone unbearably slow.
* Performance profile: the CPU is constantly boosted.
* Balanced profile: the CPU is boosted on user interaction.
  When the screen is turned off, the governor is tuned to lower the
  power consumption to save power in case of long lasting screen off
  activities such as music playback.
* Currently there are no restrictions on the number of active cores.

With this PowerHAL cpu-boost is not needed, so keep it disabled.

In addition to that, drop all the properties based profiles and set
config_perf_profile_prop to "powerhal" to make the framework send
hints to PowerHAL when the power profile is changed.

msm8226-common: PowerHAL: Initialize mutex

Since the mutex is declared as static, this went unnoticed, but mutexes
should always be initialized, so do it.

msm8226-common: PowerHAL: Don't override user selected profiles

Save and restore the last selected profile so that the user preference
is not lost when transitioning out the low power mode. Also, don't
actually change the profile if in low power mode, but don't discard
the user preference.

msm8226-common: Refactor PowerHAL

Make the HAL generic by keeping the device dependent configuration
separate. This allows to easily add or edit the profiles.

The HAL should behave exactly as before, except for the fact that now
there might be some useless writes when the screen is turned off.

Change-Id: I6bb01a14f0058c59986989568e7766f4203150cc
2015-12-27 13:13:57 +01:00

121 lines
3.5 KiB
Makefile

# Copyright (C) 2014 The CyanogenMod Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Inherit from qcom-common
-include device/samsung/qcom-common/BoardConfigCommon.mk
VENDOR_PATH := device/samsung/msm8226-common
TARGET_SPECIFIC_HEADER_PATH := $(VENDOR_PATH)/include
# Architecture
TARGET_CPU_MEMCPY_BASE_OPT_DISABLE := true
TARGET_CPU_VARIANT := krait
# Audio
AUDIO_FEATURE_ENABLED_LOW_LATENCY_CAPTURE := true
BOARD_USES_ALSA_AUDIO := true
# Bluetooth
BOARD_HAVE_BLUETOOTH := true
BOARD_HAVE_BLUETOOTH_QCOM := true
BLUETOOTH_HCI_USE_MCT := true
# Bootloader
TARGET_BOOTLOADER_BOARD_NAME := MSM8226
# Camera
TARGET_PROVIDES_CAMERA_HAL := true
USE_DEVICE_SPECIFIC_CAMERA := true
COMMON_GLOBAL_CFLAGS += -DCAMERA_VENDOR_L_COMPAT
# Charger
BOARD_BATTERY_DEVICE_NAME := "battery"
BOARD_CHARGING_CMDLINE_NAME := "androidboot.mode"
BOARD_CHARGING_CMDLINE_VALUE := "charger"
BOARD_CHARGER_ENABLE_SUSPEND := true
BOARD_CHARGER_SHOW_PERCENTAGE := true
# CM Hardware
BOARD_USES_CYANOGEN_HARDWARE := true
BOARD_HARDWARE_CLASS += \
hardware/cyanogen/cmhw \
$(VENDOR_PATH)/cmhw
# Custom RIL class
BOARD_RIL_CLASS := ../../../$(VENDOR_PATH)/ril
# Display
NUM_FRAMEBUFFER_SURFACE_BUFFERS := 3
OVERRIDE_RS_DRIVER := libRSDriver_adreno.so
# Shader cache config options
# Maximum size of the GLES Shaders that can be cached for reuse.
# Increase the size if shaders of size greater than 12KB are used.
MAX_EGL_CACHE_KEY_SIZE := 12*1024
# Maximum GLES shader cache size for each app to store the compiled shader
# binaries. Decrease the size if RAM or Flash Storage size is a limitation
# of the device.
MAX_EGL_CACHE_SIZE := 2048*1024
# FM
AUDIO_FEATURE_ENABLED_FM := true
TARGET_QCOM_NO_FM_FIRMWARE := true
# Fonts
EXTENDED_FONT_FOOTPRINT := true
# GPS
TARGET_GPS_HAL_PATH := $(VENDOR_PATH)/gps
# Init
TARGET_INIT_VENDOR_LIB := libinit_msm
# Kernel
TARGET_KERNEL_CROSS_COMPILE_PREFIX := arm-linux-androideabi-
# Memory
MALLOC_IMPL := dlmalloc
# Partitions and Vold
BOARD_VOLD_EMMC_SHARES_DEV_MAJOR := true
TARGET_USERIMAGES_USE_EXT4 := true
TARGET_USE_CUSTOM_LUN_FILE_PATH := /sys/devices/platform/msm_hsusb/gadget/lun%d/file
# Platform
TARGET_BOARD_PLATFORM := msm8226
TARGET_BOARD_PLATFORM_GPU := qcom-adreno305
# Properties (reset them here, include more in device if needed)
TARGET_SYSTEM_PROP := $(VENDOR_PATH)/system.prop
# SELinux
-include device/qcom/sepolicy/sepolicy.mk
BOARD_SEPOLICY_DIRS += $(VENDOR_PATH)/sepolicy
# Wifi
BOARD_HAS_QCOM_WLAN := true
BOARD_HAS_QCOM_WLAN_SDK := true
BOARD_WLAN_DEVICE := qcwcn
BOARD_HOSTAPD_DRIVER := NL80211
BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_$(BOARD_WLAN_DEVICE)
BOARD_WPA_SUPPLICANT_DRIVER := NL80211
BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_$(BOARD_WLAN_DEVICE)
TARGET_PROVIDES_WCNSS_QMI := true
TARGET_USES_QCOM_WCNSS_QMI := true
TARGET_USES_WCNSS_CTRL := true
WPA_SUPPLICANT_VERSION := VER_0_8_X
WIFI_DRIVER_FW_PATH_STA := "sta"
WIFI_DRIVER_FW_PATH_AP := "ap"