Compare commits
46 Commits
cm-7.0.2.1
...
ics
| Author | SHA1 | Date | |
|---|---|---|---|
| daa06dbd16 | |||
| efa036e063 | |||
| 1dcd62aeb7 | |||
| 126a62b515 | |||
|
|
8659ff93f4 | ||
|
|
b848627dcd | ||
|
|
ff9d9e3fa4 | ||
|
|
3219d207b4 | ||
|
|
eb2454df06 | ||
|
|
700c3e8f95 | ||
|
|
d69b23ad0b | ||
|
|
33c01282bb | ||
|
|
7f0d83784e | ||
|
|
3465f1b281 | ||
|
|
f928f2aeed | ||
|
|
6ce104a582 | ||
|
|
efe5668ff3 | ||
|
|
4ec7936151 | ||
|
|
89069e2747 | ||
|
|
5954c1463d | ||
|
|
a00f55ce5f | ||
|
|
81ea69905f | ||
|
|
9ae39edf64 | ||
|
|
e78df88631 | ||
|
|
f28cefac05 | ||
|
|
da7221e3c7 | ||
|
|
0ad1dd73a9 | ||
|
|
559105613a | ||
|
|
285d47e08e | ||
|
|
372e93ebd1 | ||
|
|
78bb282387 | ||
|
|
b0efe07ebe | ||
|
|
c796b6b5d3 | ||
|
|
40ff764698 | ||
|
|
09fea52be9 | ||
|
|
b299d6ad6c | ||
|
|
bfe1d61f54 | ||
|
|
0290e2e643 | ||
|
|
d19a116748 | ||
|
|
a8743c5231 | ||
|
|
9c8096a187 | ||
|
|
9aba24261c | ||
|
|
a1afa35a73 | ||
|
|
be772dfa0d | ||
|
|
c5568a5383 | ||
|
|
aaa1df3125 |
@@ -13,11 +13,14 @@
|
||||
# limitations under the License.
|
||||
|
||||
LOCAL_PATH := $(my-dir)
|
||||
subdir_makefiles := \
|
||||
|
||||
ifeq ($(TARGET_DEVICE),click)
|
||||
subdir_makefiles := \
|
||||
$(LOCAL_PATH)/libcopybit/Android.mk \
|
||||
$(LOCAL_PATH)/libgralloc/Android.mk \
|
||||
$(LOCAL_PATH)/liblights/Android.mk \
|
||||
$(LOCAL_PATH)/libcamera/Android.mk \
|
||||
$(LOCAL_PATH)/libsensors/Android.mk
|
||||
|
||||
include $(subdir_makefiles)
|
||||
include $(subdir_makefiles)
|
||||
endif
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
USE_CAMERA_STUB := true
|
||||
|
||||
# Fake building with froyo cam, as old libcam is not here yet
|
||||
BOARD_USE_FROYO_LIBCAMERA := true
|
||||
#BOARD_USE_FROYO_LIBCAMERA := true
|
||||
|
||||
# inherit from the proprietary version
|
||||
-include vendor/htc/click/BoardConfigVendor.mk
|
||||
@@ -21,37 +21,34 @@ TARGET_CPU_ABI := armeabi-v6j
|
||||
TARGET_CPU_ABI2 := armeabi
|
||||
|
||||
TARGET_BOOTLOADER_BOARD_NAME := bahamas
|
||||
TARGET_OTA_ASSERT_DEVICE := click,tattoo
|
||||
|
||||
TARGET_NO_BOOTLOADER := true
|
||||
TARGET_NO_RADIOIMAGE := true
|
||||
|
||||
BOARD_LDPI_RECOVERY := true
|
||||
BOARD_HAS_JANKY_BACKBUFFER := true
|
||||
|
||||
TARGET_PREBUILT_RECOVERY_KERNEL := device/htc/click/custom/recovery_kernel
|
||||
TARGET_PREBUILT_KERNEL := device/htc/click/custom/kernel
|
||||
TARGET_PREBUILT_KERNEL := device/htc/click/prebuilt/kernel
|
||||
|
||||
# Wifi related defines
|
||||
BOARD_WPA_SUPPLICANT_DRIVER := CUSTOM
|
||||
BOARD_WPA_SUPPLICANT_PRIVATE_LIB := libWifiApi
|
||||
BOARD_WLAN_DEVICE := wl1251
|
||||
BOARD_WLAN_TI_STA_DK_ROOT := system/wlan/ti/sta_dk_4_0_4_32
|
||||
WIFI_DRIVER_MODULE_PATH := /system/lib/modules/wlan.ko
|
||||
WIFI_DRIVER_MODULE_PATH := "/system/lib/modules/wlan.ko"
|
||||
WIFI_DRIVER_MODULE_ARG := ""
|
||||
WIFI_DRIVER_MODULE_NAME := wlan
|
||||
WIFI_FIRMWARE_LOADER := wlan_loader
|
||||
WIFI_DRIVER_MODULE_NAME := "wlan"
|
||||
WIFI_FIRMWARE_LOADER := "wlan_loader"
|
||||
|
||||
TARGET_PROVIDES_INIT_RC := false
|
||||
|
||||
BOARD_KERNEL_CMDLINE := no_console_suspend=1 console=null
|
||||
BOARD_KERNEL_BASE := 0x02E00000
|
||||
BOARD_KERNEL_PAGESIZE := 2048
|
||||
|
||||
BOARD_USES_GENERIC_AUDIO := false
|
||||
|
||||
# Use HTC USB Function Switch to enable tethering via USB
|
||||
# BOARD_USE_HTC_USB_FUNCTION_SWITCH := true
|
||||
|
||||
BOARD_USE_USB_MASS_STORAGE_SWITCH := true
|
||||
|
||||
BOARD_HAVE_BLUETOOTH := true
|
||||
|
||||
BOARD_AVOID_DRAW_TEXTURE_EXTENSION := true
|
||||
@@ -66,7 +63,7 @@ BOARD_HAS_LIMITED_EGL := true
|
||||
TARGET_HARDWARE_3D := false
|
||||
|
||||
# OpenGL drivers config file path
|
||||
BOARD_EGL_CFG := device/htc/click/custom/egl.cfg
|
||||
BOARD_EGL_CFG := device/htc/click/prebuilt/egl.cfg
|
||||
|
||||
# No authoring clock for OpenCore
|
||||
# BOARD_NO_PV_AUTHORING_CLOCK := true
|
||||
@@ -74,15 +71,21 @@ BOARD_EGL_CFG := device/htc/click/custom/egl.cfg
|
||||
BOARD_HAVE_FM_RADIO := true
|
||||
BOARD_GLOBAL_CFLAGS += -DHAVE_FM_RADIO
|
||||
|
||||
BOARD_USES_QCOM_HARDWARE := true
|
||||
BOARD_USES_QCOM_GPS := true
|
||||
BOARD_USES_QCOM_LIBS := true
|
||||
|
||||
BOARD_USES_GPSSHIM := true
|
||||
|
||||
BOARD_GPS_LIBRARIES := libgps librpc
|
||||
COMMON_GLOBAL_CFLAGS += -DQCOM_HARDWARE
|
||||
TARGET_SPECIFIC_HEADER_PATH := device/htc/click/include
|
||||
|
||||
TARGET_USE_CUSTOM_LUN_FILE_PATH := /sys/devices/platform/usb_mass_storage/lun0/file
|
||||
|
||||
BOARD_USE_NEW_LIBRIL_HTC := true
|
||||
|
||||
TARGET_LIBAGL_USE_GRALLOC_COPYBITS := true
|
||||
|
||||
BOARD_NO_RGBX_8888 := true
|
||||
TARGET_ELECTRONBEAM_FRAMES := 10
|
||||
|
||||
# WITH_DEXPREOPT := true
|
||||
JS_ENGINE := v8
|
||||
@@ -105,4 +108,4 @@ BOARD_USERDATAIMAGE_PARTITION_SIZE := 0x0a520000
|
||||
BOARD_FLASH_BLOCK_SIZE := 131072
|
||||
|
||||
# Add LUNFILE configuration to the system
|
||||
BOARD_UMS_LUNFILE := "/sys/devices/platform/msm_hsusb/gadget/lun0/file"
|
||||
# BOARD_UMS_LUNFILE := "/sys/devices/platform/usb_mass_storage/lun0/file"
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
# Kernel Modules TO BE COPIED
|
||||
PRODUCT_COPY_FILES += \
|
||||
device/htc/click/custom/modules/2.6.29.6-Kalim/modules.alias.bin:system/lib/modules/2.6.29.6-Kalim/modules.alias.bin \
|
||||
device/htc/click/custom/modules/2.6.29.6-Kalim/modules.symbols.bin:system/lib/modules/2.6.29.6-Kalim/modules.symbols.bin \
|
||||
device/htc/click/custom/modules/2.6.29.6-Kalim/modules.dep.bin:system/lib/modules/2.6.29.6-Kalim/modules.dep.bin \
|
||||
device/htc/click/custom/modules/2.6.29.6-Kalim/kernel/fs/nls/nls_utf8.ko:system/lib/modules/2.6.29.6-Kalim/kernel/fs/nls/nls_utf8.ko \
|
||||
device/htc/click/custom/modules/2.6.29.6-Kalim/kernel/fs/jbd2/jbd2.ko:system/lib/modules/2.6.29.6-Kalim/kernel/fs/jbd2/jbd2.ko \
|
||||
device/htc/click/custom/modules/2.6.29.6-Kalim/kernel/fs/aufs/aufs.ko:system/lib/modules/2.6.29.6-Kalim/kernel/fs/aufs/aufs.ko \
|
||||
device/htc/click/custom/modules/2.6.29.6-Kalim/kernel/fs/cifs/cifs.ko:system/lib/modules/2.6.29.6-Kalim/kernel/fs/cifs/cifs.ko \
|
||||
device/htc/click/custom/modules/2.6.29.6-Kalim/kernel/fs/ext4/ext4.ko:system/lib/modules/2.6.29.6-Kalim/kernel/fs/ext4/ext4.ko \
|
||||
device/htc/click/custom/modules/2.6.29.6-Kalim/kernel/drivers/hid/hid-dummy.ko:system/lib/modules/2.6.29.6-Kalim/kernel/drivers/hid/hid-dummy.ko \
|
||||
device/htc/click/custom/modules/2.6.29.6-Kalim/kernel/drivers/net/wireless/tiwlan1251/wlan.ko:system/lib/modules/2.6.29.6-Kalim/kernel/drivers/net/wireless/tiwlan1251/wlan.ko \
|
||||
device/htc/click/custom/modules/2.6.29.6-Kalim/kernel/drivers/staging/ramzswap/ramzswap.ko:system/lib/modules/2.6.29.6-Kalim/kernel/drivers/staging/ramzswap/ramzswap.ko \
|
||||
device/htc/click/custom/modules/2.6.29.6-Kalim/kernel/net/netfilter/xt_TCPMSS.ko:system/lib/modules/2.6.29.6-Kalim/kernel/net/netfilter/xt_TCPMSS.ko \
|
||||
device/htc/click/custom/modules/2.6.29.6-Kalim/modules.ccwmap:system/lib/modules/2.6.29.6-Kalim/modules.ccwmap \
|
||||
device/htc/click/custom/modules/2.6.29.6-Kalim/modules.seriomap:system/lib/modules/2.6.29.6-Kalim/modules.seriomap \
|
||||
device/htc/click/custom/modules/2.6.29.6-Kalim/modules.pcimap:system/lib/modules/2.6.29.6-Kalim/modules.pcimap \
|
||||
device/htc/click/custom/modules/2.6.29.6-Kalim/modules.ofmap:system/lib/modules/2.6.29.6-Kalim/modules.ofmap \
|
||||
device/htc/click/custom/modules/2.6.29.6-Kalim/modules.isapnpmap:system/lib/modules/2.6.29.6-Kalim/modules.isapnpmap \
|
||||
device/htc/click/custom/modules/2.6.29.6-Kalim/modules.dep:system/lib/modules/2.6.29.6-Kalim/modules.dep \
|
||||
device/htc/click/custom/modules/2.6.29.6-Kalim/modules.inputmap:system/lib/modules/2.6.29.6-Kalim/modules.inputmap \
|
||||
device/htc/click/custom/modules/2.6.29.6-Kalim/modules.softdep:system/lib/modules/2.6.29.6-Kalim/modules.softdep \
|
||||
device/htc/click/custom/modules/2.6.29.6-Kalim/modules.ieee1394map:system/lib/modules/2.6.29.6-Kalim/modules.ieee1394map \
|
||||
device/htc/click/custom/modules/2.6.29.6-Kalim/modules.alias:system/lib/modules/2.6.29.6-Kalim/modules.alias \
|
||||
device/htc/click/custom/modules/2.6.29.6-Kalim/modules.symbols:system/lib/modules/2.6.29.6-Kalim/modules.symbols \
|
||||
device/htc/click/custom/modules/2.6.29.6-Kalim/modules.usbmap:system/lib/modules/2.6.29.6-Kalim/modules.usbmap \
|
||||
device/htc/click/custom/modules/2.6.29.6-Kalim/modules.devname:system/lib/modules/2.6.29.6-Kalim/modules.devname \
|
||||
device/htc/click/custom/modules/2.6.29.6-Kalim/modules.order:system/lib/modules/2.6.29.6-Kalim/modules.order \
|
||||
device/htc/click/custom/modules/wlan.ko:system/lib/modules/wlan.ko
|
||||
68
click.mk
68
click.mk
@@ -18,11 +18,10 @@ DEVICE_PACKAGE_OVERLAYS += device/htc/click/overlay
|
||||
|
||||
# Defines for Vold to config fstab defs
|
||||
PRODUCT_COPY_FILES += \
|
||||
device/htc/click/vold.fstab:system/etc/vold.fstab
|
||||
device/htc/click/prebuilt/vold.fstab:system/etc/vold.fstab
|
||||
|
||||
# Libs to be added to this ROM
|
||||
PRODUCT_PACKAGES += \
|
||||
librs_jni \
|
||||
sensors.bahamas \
|
||||
lights.bahamas \
|
||||
copybit.bahamas \
|
||||
@@ -31,72 +30,57 @@ PRODUCT_PACKAGES += \
|
||||
libOmxCore \
|
||||
libmm-omxcore \
|
||||
libOmxVidEnc \
|
||||
libcamera \
|
||||
librpc \
|
||||
tiwlan.ini \
|
||||
dhcpcd.conf \
|
||||
rzscontrol \
|
||||
wlan_loader \
|
||||
dexpreopt
|
||||
|
||||
DISABLE_DEXPREOPT := false
|
||||
|
||||
#WiFi stuff
|
||||
PRODUCT_PACKAGES += \
|
||||
wpa_supplicant.conf \
|
||||
tiwlan.ini \
|
||||
dhcpcd.conf \
|
||||
wlan_cu \
|
||||
wlan_loader \
|
||||
libCustomWifi
|
||||
|
||||
#HotSpot
|
||||
PRODUCT_PACKAGES += \
|
||||
tiap_loader \
|
||||
tiap_cu \
|
||||
tiwlan_ap.ini \
|
||||
hostap \
|
||||
hostapd.conf
|
||||
|
||||
# Add Gallery 3D / Normal
|
||||
PRODUCT_PACKAGES += Gallery
|
||||
|
||||
# Boot kernel files
|
||||
PRODUCT_COPY_FILES += \
|
||||
device/htc/click/init.bahamas.rc:root/init.bahamas.rc \
|
||||
device/htc/click/ueventd.bahamas.rc:root/ueventd.bahamas.rc
|
||||
device/htc/click/prebuilt/init.bahamas.rc:root/init.bahamas.rc \
|
||||
device/htc/click/prebuilt/init.bahamas.usb.rc:root/init.bahamas.usb.rc \
|
||||
device/htc/click/prebuilt/ueventd.bahamas.rc:root/ueventd.bahamas.rc
|
||||
|
||||
# from device_dream_sapphire.mk
|
||||
PRODUCT_COPY_FILES += \
|
||||
frameworks/base/data/etc/android.hardware.camera.autofocus.xml:system/etc/permissions/android.hardware.camera.autofocus.xml \
|
||||
frameworks/base/data/etc/handheld_core_hardware.xml:system/etc/permissions/handheld_core_hardware.xml \
|
||||
frameworks/base/data/etc/android.hardware.telephony.gsm.xml:system/etc/permissions/android.hardware.telephony.gsm.xml \
|
||||
frameworks/base/data/etc/android.hardware.location.gps.xml:system/etc/permissions/android.hardware.location.gps.xml \
|
||||
frameworks/base/data/etc/android.hardware.wifi.xml:system/etc/permissions/android.hardware.wifi.xml
|
||||
frameworks/base/data/etc/android.hardware.wifi.xml:system/etc/permissions/android.hardware.wifi.xml \
|
||||
frameworks/base/data/etc/android.software.sip.voip.xml:system/etc/permissions/android.software.sip.voip.xml
|
||||
|
||||
# keychars and keylayout files
|
||||
PRODUCT_COPY_FILES += \
|
||||
device/htc/click/custom/keychars/bahamas-keypad.kcm.bin:system/usr/keychars/bahamas-keypad.kcm.bin \
|
||||
device/htc/click/custom/keychars/qwerty.kcm.bin:system/usr/keychars/qwerty.kcm.bin \
|
||||
device/htc/click/custom/keychars/qwerty2.kcm.bin:system/usr/keychars/qwerty2.kcm.bin \
|
||||
device/htc/click/custom/keylayout/AVRCP.kl:system/usr/keylayout/AVRCP.kl \
|
||||
device/htc/click/custom/keylayout/bahamas-keypad.kl:system/usr/keylayout/bahamas-keypad.kl \
|
||||
device/htc/click/custom/keylayout/h2w_headset.kl:system/usr/keylayout/h2w_headset.kl \
|
||||
device/htc/click/custom/keylayout/qwerty.kl:system/usr/keylayout/qwerty.kl
|
||||
|
||||
# extra etc config files
|
||||
PRODUCT_COPY_FILES += \
|
||||
device/htc/click/custom/sysctl.conf:system/etc/sysctl.conf
|
||||
device/htc/click/prebuilt/keychars/bahamas-keypad.kcm.bin:system/usr/keychars/bahamas-keypad.kcm.bin \
|
||||
device/htc/click/prebuilt/keychars/qwerty.kcm.bin:system/usr/keychars/qwerty.kcm.bin \
|
||||
device/htc/click/prebuilt/keychars/qwerty2.kcm.bin:system/usr/keychars/qwerty2.kcm.bin \
|
||||
device/htc/click/prebuilt/keylayout/bahamas-keypad.kl:system/usr/keylayout/bahamas-keypad.kl \
|
||||
device/htc/click/prebuilt/keylayout/h2w_headset.kl:system/usr/keylayout/h2w_headset.kl \
|
||||
device/htc/click/prebuilt/keylayout/qwerty.kl:system/usr/keylayout/qwerty.kl
|
||||
|
||||
# precompiled files for /system/bin
|
||||
PRODUCT_COPY_FILES += \
|
||||
device/htc/click/custom/calibrate_screen:system/bin/calibrate_screen
|
||||
device/htc/click/prebuilt/calibrate_screen:system/bin/calibrate_screen \
|
||||
device/htc/click/prebuilt/klogtail:system/xbin/klogtail
|
||||
|
||||
# media configuration xml file
|
||||
PRODUCT_COPY_FILES += \
|
||||
device/htc/click/media_profiles.xml:/system/etc/media_profiles.xml
|
||||
device/htc/click/prebuilt/media_profiles.xml:/system/etc/media_profiles.xml
|
||||
|
||||
# Kernel Modules
|
||||
PRODUCT_COPY_FILES += $(shell \
|
||||
find device/htc/click/prebuilt/modules -name '*.ko' \
|
||||
| sed -r 's/^\/?(.*\/)([^/ ]+)$$/\1\2:system\/lib\/modules\/\2/' \
|
||||
| tr '\n' ' ')
|
||||
|
||||
# Kernel Targets
|
||||
ifeq ($(TARGET_PREBUILT_KERNEL),)
|
||||
LOCAL_KERNEL := device/htc/click/custom/kernel
|
||||
LOCAL_KERNEL := device/htc/click/prebuilt/kernel
|
||||
else
|
||||
LOCAL_KERNEL := $(TARGET_PREBUILT_KERNEL)
|
||||
endif
|
||||
@@ -104,7 +88,6 @@ endif
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(LOCAL_KERNEL):kernel
|
||||
|
||||
|
||||
$(call inherit-product, device/common/gps/gps_eu_supl.mk)
|
||||
$(call inherit-product, device/htc/common/common.mk)
|
||||
$(call inherit-product, build/target/product/full_base.mk)
|
||||
@@ -117,6 +100,3 @@ PRODUCT_DEVICE := click
|
||||
# of the aspects that require proprietary drivers that aren't
|
||||
# commonly available
|
||||
$(call inherit-product-if-exists, vendor/htc/click/click-vendor.mk)
|
||||
|
||||
# Added all the kernel modules to be copyed
|
||||
$(call inherit-product-if-exists, device/htc/click/KernelModules.mk)
|
||||
|
||||
32
cm.mk
Normal file
32
cm.mk
Normal file
@@ -0,0 +1,32 @@
|
||||
## Specify phone tech before including full_phone
|
||||
$(call inherit-product, vendor/cm/config/gsm.mk)
|
||||
|
||||
# Release name
|
||||
PRODUCT_RELEASE_NAME := GN
|
||||
|
||||
# Inherit some common CM stuff.
|
||||
$(call inherit-product, vendor/cm/config/common_full_phone.mk)
|
||||
|
||||
# Inherit device configuration
|
||||
$(call inherit-product, device/htc/click/click.mk)
|
||||
|
||||
## Device identifier. This must come after all inclusions
|
||||
PRODUCT_MODEL := HTC Tattoo
|
||||
PRODUCT_MANUFACTURER := HTC
|
||||
PRODUCT_BRAND := htc
|
||||
PRODUCT_DEVICE := click
|
||||
PRODUCT_NAME := cm_click
|
||||
|
||||
#Set build fingerprint / ID / Prduct Name ect.
|
||||
PRODUCT_BUILD_PROP_OVERRIDES += PRODUCT_NAME=click BUILD_ID=IML74K BUILD_DISPLAY_ID=IML74K BUILD_FINGERPRINT="google/htc_click/click:4.0.3/IML74K/239410:user/release-keys" PRVIATE_BUILD_DESC="full_click-user 4.0.3 IML74K 239410 release-keys"
|
||||
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
Camera \
|
||||
CMSettings
|
||||
|
||||
# Release name and versioning
|
||||
PRODUCT_RELEASE_NAME := CLICK
|
||||
#PRODUCT_VERSION_DEVICE_SPECIFIC := -aali
|
||||
|
||||
-include vendor/cm/products/common_versions.mk
|
||||
@@ -1,25 +1,47 @@
|
||||
mkdir proprietary
|
||||
mkdir proprietary/firmware
|
||||
adb pull /system/app/HTCCalibrate.apk proprietary/
|
||||
adb pull /system/etc/AudioPara4.csv proprietary/
|
||||
adb pull /system/etc/AudioFilter.csv proprietary/
|
||||
adb pull /system/etc/AudioPreProcess.csv proprietary/
|
||||
adb pull /system/lib/liboemcamera.so proprietary/
|
||||
adb pull /system/lib/libmmcamera.so proprietary/
|
||||
adb pull /system/lib/libmm-qcamera-tgt.so proprietary/
|
||||
adb pull /system/lib/libmmjpeg.so proprietary/
|
||||
adb pull /system/lib/libaudioeq.so proprietary/
|
||||
adb pull /system/lib/libqcamera.so proprietary/
|
||||
adb pull /system/lib/libmm-adspsvc.so proprietary/
|
||||
adb pull /system/lib/egl/libGLES_qcom.so proprietary/
|
||||
adb pull /system/lib/libgps.so proprietary/
|
||||
adb pull /system/lib/libOmxH264Dec.so proprietary/
|
||||
adb pull /system/lib/libOmxMpeg4Dec.so proprietary/
|
||||
adb pull /system/lib/libOmxVidEnc.so proprietary/
|
||||
adb pull /system/lib/libmm-adspsvc.so proprietary/
|
||||
adb pull /system/lib/libhtc_acoustic.so proprietary/
|
||||
adb pull /system/lib/libhtc_ril.so proprietary/
|
||||
adb pull /system/bin/akm8973 proprietary/
|
||||
adb pull /system/etc/wifi/Fw1251r1c.bin proprietary/firmware/
|
||||
adb pull /system/etc/firmware/brf6300.bin proprietary/firmware/
|
||||
adb pull /system/etc/firmware/brf6350.bin proprietary/firmware/
|
||||
#!/bin/sh
|
||||
|
||||
# Copyright (C) 2010 The Android Open Source 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.
|
||||
|
||||
DEVICE=leo
|
||||
MANUFACTURER=htc
|
||||
STAGESYS=~/cm-$DEVICE/system
|
||||
|
||||
if [ "$1" = "pull" ]; then
|
||||
if [ -s "$STAGESYS" ]; then
|
||||
rm -R ~/cm-$DEVICE
|
||||
fi
|
||||
mkdir ~/cm-$DEVICE
|
||||
mkdir $STAGESYS
|
||||
mkdir $STAGESYS/bin
|
||||
mkdir $STAGESYS/lib
|
||||
mkdir $STAGESYS/etc
|
||||
adb pull /system/bin $STAGESYS/bin
|
||||
adb pull /system/lib $STAGESYS/lib
|
||||
adb pull /system/etc $STAGESYS/etc
|
||||
fi
|
||||
|
||||
OUTDIR=../../../vendor/$MANUFACTURER/$DEVICE
|
||||
BASE=$OUTDIR/proprietary
|
||||
rm -rf $BASE/*
|
||||
|
||||
for FILE in `cat proprietary-files.txt | grep -v ^# | grep -v ^$`; do
|
||||
DIR=`dirname $FILE`
|
||||
if [ ! -d $BASE/$DIR ]; then
|
||||
mkdir -p $BASE/$DIR
|
||||
fi
|
||||
cp $STAGESYS/$FILE $BASE/$FILE
|
||||
done
|
||||
|
||||
./setup-makefiles.sh
|
||||
|
||||
BIN
custom/kernel
BIN
custom/kernel
Binary file not shown.
@@ -1,6 +0,0 @@
|
||||
key 164 MEDIA_PLAY_PAUSE WAKE
|
||||
key 128 MEDIA_STOP WAKE
|
||||
key 163 MEDIA_NEXT WAKE
|
||||
key 165 MEDIA_PREVIOUS WAKE
|
||||
key 168 MEDIA_REWIND WAKE
|
||||
key 159 MEDIA_FAST_FORWARD WAKE
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,4 +0,0 @@
|
||||
# Aliases extracted from modules themselves.
|
||||
alias sdio:c07v*d* wlan
|
||||
alias ip6t_TCPMSS xt_TCPMSS
|
||||
alias ipt_TCPMSS xt_TCPMSS
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
# ccw module match_flags cu_type cu_model dev_type dev_model
|
||||
@@ -1,9 +0,0 @@
|
||||
kernel/fs/nls/nls_utf8.ko:
|
||||
kernel/fs/ext4/ext4.ko: kernel/fs/jbd2/jbd2.ko
|
||||
kernel/fs/jbd2/jbd2.ko:
|
||||
kernel/fs/cifs/cifs.ko:
|
||||
kernel/fs/aufs/aufs.ko:
|
||||
kernel/drivers/net/wireless/tiwlan1251/wlan.ko:
|
||||
kernel/drivers/hid/hid-dummy.ko:
|
||||
kernel/drivers/staging/ramzswap/ramzswap.ko:
|
||||
kernel/net/netfilter/xt_TCPMSS.ko:
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
# Device nodes to trigger on-demand module loading.
|
||||
@@ -1 +0,0 @@
|
||||
# ieee1394 module match_flags vendor_id model_id specifier_id version
|
||||
@@ -1 +0,0 @@
|
||||
# module matchBits bustype vendor product version evBits keyBits relBits absBits mscBits ledBits sndBits ffBits [swBits] driver_info
|
||||
@@ -1 +0,0 @@
|
||||
# isapnp module cardvendor carddevice driver_data vendor function ...
|
||||
@@ -1 +0,0 @@
|
||||
# of module name type compatible
|
||||
@@ -1,9 +0,0 @@
|
||||
kernel/fs/nls/nls_utf8.ko
|
||||
kernel/fs/ext4/ext4.ko
|
||||
kernel/fs/jbd2/jbd2.ko
|
||||
kernel/fs/cifs/cifs.ko
|
||||
kernel/fs/aufs/aufs.ko
|
||||
kernel/drivers/net/wireless/tiwlan1251/wlan.ko
|
||||
kernel/drivers/hid/hid-dummy.ko
|
||||
kernel/drivers/staging/ramzswap/ramzswap.ko
|
||||
kernel/net/netfilter/xt_TCPMSS.ko
|
||||
@@ -1 +0,0 @@
|
||||
# pci module vendor device subvendor subdevice class class_mask driver_data
|
||||
@@ -1 +0,0 @@
|
||||
# serio module type extra id proto
|
||||
@@ -1,2 +0,0 @@
|
||||
# Soft dependencies extracted from modules themselves.
|
||||
# Copy, with a .conf extension, to /etc/modprobe.d to use it with modprobe.
|
||||
@@ -1,41 +0,0 @@
|
||||
# Aliases for symbols, used by symbol_request().
|
||||
alias symbol:jbd2_journal_try_to_free_buffers jbd2
|
||||
alias symbol:jbd2_journal_start_commit jbd2
|
||||
alias symbol:jbd2_journal_load jbd2
|
||||
alias symbol:jbd2_journal_flush jbd2
|
||||
alias symbol:jbd2_journal_init_dev jbd2
|
||||
alias symbol:jbd2_journal_update_format jbd2
|
||||
alias symbol:jbd2_journal_blocks_per_page jbd2
|
||||
alias symbol:jbd2_journal_restart jbd2
|
||||
alias symbol:jbd2_journal_destroy jbd2
|
||||
alias symbol:jbd2_journal_get_undo_access jbd2
|
||||
alias symbol:jbd2_journal_init_jbd_inode jbd2
|
||||
alias symbol:jbd2_journal_abort jbd2
|
||||
alias symbol:jbd2_journal_unlock_updates jbd2
|
||||
alias symbol:jbd2_journal_wipe jbd2
|
||||
alias symbol:jbd2_journal_set_features jbd2
|
||||
alias symbol:jbd2_journal_lock_updates jbd2
|
||||
alias symbol:jbd2_journal_clear_features jbd2
|
||||
alias symbol:jbd2_journal_get_create_access jbd2
|
||||
alias symbol:jbd2_journal_init_inode jbd2
|
||||
alias symbol:jbd2_journal_release_buffer jbd2
|
||||
alias symbol:jbd2_journal_forget jbd2
|
||||
alias symbol:jbd2_journal_start jbd2
|
||||
alias symbol:jbd2_journal_force_commit_nested jbd2
|
||||
alias symbol:jbd2_journal_check_used_features jbd2
|
||||
alias symbol:jbd2_journal_set_triggers jbd2
|
||||
alias symbol:jbd2_journal_check_available_features jbd2
|
||||
alias symbol:jbd2_journal_stop jbd2
|
||||
alias symbol:jbd2_journal_extend jbd2
|
||||
alias symbol:jbd2_journal_ack_err jbd2
|
||||
alias symbol:jbd2_journal_begin_ordered_truncate jbd2
|
||||
alias symbol:jbd2_journal_file_inode jbd2
|
||||
alias symbol:jbd2_journal_errno jbd2
|
||||
alias symbol:jbd2_log_wait_commit jbd2
|
||||
alias symbol:jbd2_journal_clear_err jbd2
|
||||
alias symbol:jbd2_journal_release_jbd_inode jbd2
|
||||
alias symbol:jbd2_journal_revoke jbd2
|
||||
alias symbol:jbd2_journal_get_write_access jbd2
|
||||
alias symbol:jbd2_journal_invalidatepage jbd2
|
||||
alias symbol:jbd2_journal_dirty_metadata jbd2
|
||||
alias symbol:jbd2_journal_force_commit jbd2
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
# usb module match_flags idVendor idProduct bcdDevice_lo bcdDevice_hi bDeviceClass bDeviceSubClass bDeviceProtocol bInterfaceClass bInterfaceSubClass bInterfaceProtocol driver_info
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,8 +0,0 @@
|
||||
# Scheduler-Tuning
|
||||
kernel.sched_latency_ns = 600000
|
||||
kernel.sched_min_granularity_ns = 400000
|
||||
vm.dirty_ratio = 90
|
||||
vm.dirty_background_ratio = 70
|
||||
vm.vfs_cache_pressure = 5
|
||||
vm.oom_kill_allocating_task = 1
|
||||
vm.min_free_kbytes = 4096
|
||||
@@ -19,71 +19,15 @@
|
||||
DEVICE=click
|
||||
MANUFACTURER=htc
|
||||
|
||||
mkdir -p ../../../vendor/$MANUFACTURER/$DEVICE/proprietary
|
||||
mkdir -p ../../../vendor/$MANUFACTURER/$DEVICE/proprietary/firmware
|
||||
adb pull /system/app/HTCCalibrate.apk ../../../vendor/$MANUFACTURER/$DEVICE/proprietary/HTCCalibrate.apk
|
||||
adb pull /system/etc/AudioPara4.csv ../../../vendor/$MANUFACTURER/$DEVICE/proprietary/AudioPara4.csv
|
||||
adb pull /system/etc/AudioFilter.csv ../../../vendor/$MANUFACTURER/$DEVICE/proprietary/AudioFilter.csv
|
||||
adb pull /system/etc/AudioPreProcess.csv ../../../vendor/$MANUFACTURER/$DEVICE/proprietary/AudioPreProcess.csv
|
||||
adb pull /system/lib/libmm-qcamera-tgt.so ../../../vendor/$MANUFACTURER/$DEVICE/proprietary/libmm-qcamera-tgt.so
|
||||
adb pull /system/lib/libaudioeq.so ../../../vendor/$MANUFACTURER/$DEVICE/proprietary/libaudioeq.so
|
||||
adb pull /system/lib/libmm-adspsvc.so ../../../vendor/$MANUFACTURER/$DEVICE/proprietary/libmm-adspsvc.so
|
||||
adb pull /system/lib/libgps.so ../../../vendor/$MANUFACTURER/$DEVICE/proprietary/libgps.so
|
||||
adb pull /system/lib/libOmxH264Dec.so ../../../vendor/$MANUFACTURER/$DEVICE/proprietary/libOmxH264Dec.so
|
||||
adb pull /system/lib/libOmxMpeg4Dec.so ../../../vendor/$MANUFACTURER/$DEVICE/proprietary/libOmxMpeg4Dec.so
|
||||
adb pull /system/lib/libOmxVidEnc.so ../../../vendor/$MANUFACTURER/$DEVICE/proprietary/libOmxVidEnc.so
|
||||
adb pull /system/lib/libmm-adspsvc.so ../../../vendor/$MANUFACTURER/$DEVICE/proprietary/libmm-adspsvc.so
|
||||
adb pull /system/lib/libhtc_acoustic.so ../../../vendor/$MANUFACTURER/$DEVICE/proprietary/libhtc_acoustic.so
|
||||
adb pull /system/lib/libhtc_ril.so ../../../vendor/$MANUFACTURER/$DEVICE/proprietary/libhtc_ril.so
|
||||
adb pull /system/etc/wifi/Fw1251r1c.bin ../../../vendor/$MANUFACTURER/$DEVICE/proprietary/firmware/Fw1251r1c.bin
|
||||
adb pull /system/etc/firmware/brf6300.bin ../../../vendor/$MANUFACTURER/$DEVICE/proprietary/firmware/brf6300.bin
|
||||
adb pull /system/etc/firmware/brf6350.bin ../../../vendor/$MANUFACTURER/$DEVICE/proprietary/firmware/brf6350.bin
|
||||
adb pull /system/bin/akm8973 ../../../vendor/$MANUFACTURER/$DEVICE/proprietary/akm8973
|
||||
BASE=../../../vendor/$MANUFACTURER/$DEVICE/proprietary
|
||||
rm -rf $BASE/*
|
||||
|
||||
(cat << EOF) | sed s/__DEVICE__/$DEVICE/g | sed s/__MANUFACTURER__/$MANUFACTURER/g > ../../../vendor/$MANUFACTURER/$DEVICE/device-vendor-blobs.mk
|
||||
# Copyright (C) 2010 The Android Open Source 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.
|
||||
|
||||
# This file is generated by device/__MANUFACTURER__/__DEVICE__/extract-files.sh - DO NOT EDIT
|
||||
|
||||
# Prebuilt libraries that are needed to build open-source libraries
|
||||
PRODUCT_COPY_FILES += \\
|
||||
vendor/__MANUFACTURER__/__DEVICE__/proprietary/libgps.so:obj/lib/libgps.so
|
||||
|
||||
# proprietary firmware files
|
||||
PRODUCT_COPY_FILES += \\
|
||||
vendor/__MANUFACTURER__/__DEVICE__/proprietary/firmware/Fw1251r1c.bin:system/etc/wifi/Fw1251r1c.bin \\
|
||||
vendor/__MANUFACTURER__/__DEVICE__/proprietary/firmware/brf6300.bin:system/etc/firmware/brf6300.bin \\
|
||||
vendor/__MANUFACTURER__/__DEVICE__/proprietary/firmware/brf6350.bin:system/etc/firmware/brf6350.bin
|
||||
|
||||
# All the blobs necessary for click
|
||||
PRODUCT_COPY_FILES += \\
|
||||
vendor/__MANUFACTURER__/__DEVICE__/proprietary/HTCCalibrate.apk:system/app/HTCCalibrate.apk \\
|
||||
vendor/__MANUFACTURER__/__DEVICE__/proprietary/AudioPara4.csv:system/etc/AudioPara4.csv \\
|
||||
vendor/__MANUFACTURER__/__DEVICE__/proprietary/AudioFilter.csv:system/etc/AudioFilter.csv \\
|
||||
vendor/__MANUFACTURER__/__DEVICE__/proprietary/AudioPreProcess.csv:system/etc/AudioPreProcess.csv \\
|
||||
vendor/__MANUFACTURER__/__DEVICE__/proprietary/libmm-qcamera-tgt.so:system/lib/libmm-qcamera-tgt.so \\
|
||||
vendor/__MANUFACTURER__/__DEVICE__/proprietary/libaudioeq.so:system/lib/libaudioeq.so \\
|
||||
vendor/__MANUFACTURER__/__DEVICE__/proprietary/libmm-adspsvc.so:system/lib/libmm-adspsvc.so \\
|
||||
vendor/__MANUFACTURER__/__DEVICE__/proprietary/libgps.so:system/lib/libgps.so \\
|
||||
vendor/__MANUFACTURER__/__DEVICE__/proprietary/libOmxH264Dec.so:system/lib/libOmxH264Dec.so \\
|
||||
vendor/__MANUFACTURER__/__DEVICE__/proprietary/libOmxMpeg4Dec.so:system/lib/libOmxMpeg4Dec.so \\
|
||||
vendor/__MANUFACTURER__/__DEVICE__/proprietary/libOmxVidEnc.so:system/lib/libOmxVidEnc.so \\
|
||||
vendor/__MANUFACTURER__/__DEVICE__/proprietary/libmm-adspsvc.so:system/lib/libmm-adspsvc.so \\
|
||||
vendor/__MANUFACTURER__/__DEVICE__/proprietary/libhtc_acoustic.so:system/lib/libhtc_acoustic.so \\
|
||||
vendor/__MANUFACTURER__/__DEVICE__/proprietary/libhtc_ril.so:system/lib/libhtc_ril.so \\
|
||||
vendor/__MANUFACTURER__/__DEVICE__/proprietary/akm8973:system/bin/akm8973
|
||||
EOF
|
||||
for FILE in `cat proprietary-files.txt | grep -v ^# | grep -v ^$`; do
|
||||
DIR=`dirname $FILE`
|
||||
if [ ! -d $BASE/$DIR ]; then
|
||||
mkdir -p $BASE/$DIR
|
||||
fi
|
||||
adb pull /system/$FILE $BASE/$FILE
|
||||
done
|
||||
|
||||
./setup-makefiles.sh
|
||||
|
||||
175
include/hardware/fb.h
Normal file
175
include/hardware/fb.h
Normal file
@@ -0,0 +1,175 @@
|
||||
/*
|
||||
* Copyright (C) 2008 The Android Open Source 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.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef ANDROID_FB_INTERFACE_H
|
||||
#define ANDROID_FB_INTERFACE_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <cutils/native_handle.h>
|
||||
|
||||
#include <hardware/hardware.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
#define GRALLOC_HARDWARE_FB0 "fb0"
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
typedef struct framebuffer_device_t {
|
||||
struct hw_device_t common;
|
||||
|
||||
/* flags describing some attributes of the framebuffer */
|
||||
const uint32_t flags;
|
||||
|
||||
/* dimensions of the framebuffer in pixels */
|
||||
const uint32_t width;
|
||||
const uint32_t height;
|
||||
|
||||
/* frambuffer stride in pixels */
|
||||
const int stride;
|
||||
|
||||
/* framebuffer pixel format */
|
||||
const int format;
|
||||
|
||||
/* resolution of the framebuffer's display panel in pixel per inch*/
|
||||
const float xdpi;
|
||||
const float ydpi;
|
||||
|
||||
/* framebuffer's display panel refresh rate in frames per second */
|
||||
const float fps;
|
||||
|
||||
/* min swap interval supported by this framebuffer */
|
||||
const int minSwapInterval;
|
||||
|
||||
/* max swap interval supported by this framebuffer */
|
||||
const int maxSwapInterval;
|
||||
|
||||
/* number of framebuffers */
|
||||
const int numFramebuffers;
|
||||
|
||||
int reserved[7];
|
||||
|
||||
/*
|
||||
* requests a specific swap-interval (same definition than EGL)
|
||||
*
|
||||
* Returns 0 on success or -errno on error.
|
||||
*/
|
||||
int (*setSwapInterval)(struct framebuffer_device_t* window,
|
||||
int interval);
|
||||
|
||||
/*
|
||||
* This hook is OPTIONAL.
|
||||
*
|
||||
* It is non NULL If the framebuffer driver supports "update-on-demand"
|
||||
* and the given rectangle is the area of the screen that gets
|
||||
* updated during (*post)().
|
||||
*
|
||||
* This is useful on devices that are able to DMA only a portion of
|
||||
* the screen to the display panel, upon demand -- as opposed to
|
||||
* constantly refreshing the panel 60 times per second, for instance.
|
||||
*
|
||||
* Only the area defined by this rectangle is guaranteed to be valid, that
|
||||
* is, the driver is not allowed to post anything outside of this
|
||||
* rectangle.
|
||||
*
|
||||
* The rectangle evaluated during (*post)() and specifies which area
|
||||
* of the buffer passed in (*post)() shall to be posted.
|
||||
*
|
||||
* return -EINVAL if width or height <=0, or if left or top < 0
|
||||
*/
|
||||
int (*setUpdateRect)(struct framebuffer_device_t* window,
|
||||
int left, int top, int width, int height);
|
||||
|
||||
/*
|
||||
* Post <buffer> to the display (display it on the screen)
|
||||
* The buffer must have been allocated with the
|
||||
* GRALLOC_USAGE_HW_FB usage flag.
|
||||
* buffer must be the same width and height as the display and must NOT
|
||||
* be locked.
|
||||
*
|
||||
* The buffer is shown during the next VSYNC.
|
||||
*
|
||||
* If the same buffer is posted again (possibly after some other buffer),
|
||||
* post() will block until the the first post is completed.
|
||||
*
|
||||
* Internally, post() is expected to lock the buffer so that a
|
||||
* subsequent call to gralloc_module_t::(*lock)() with USAGE_RENDER or
|
||||
* USAGE_*_WRITE will block until it is safe; that is typically once this
|
||||
* buffer is shown and another buffer has been posted.
|
||||
*
|
||||
* Returns 0 on success or -errno on error.
|
||||
*/
|
||||
int (*post)(struct framebuffer_device_t* dev, buffer_handle_t buffer);
|
||||
|
||||
|
||||
/*
|
||||
* The (*compositionComplete)() method must be called after the
|
||||
* compositor has finished issuing GL commands for client buffers.
|
||||
*/
|
||||
|
||||
int (*compositionComplete)(struct framebuffer_device_t* dev);
|
||||
|
||||
int (*lockBuffer) (struct framebuffer_device_t* dev, int);
|
||||
|
||||
/*
|
||||
* This hook is OPTIONAL.
|
||||
*
|
||||
* If non NULL it will be caused by SurfaceFlinger on dumpsys
|
||||
*/
|
||||
void (*dump)(struct framebuffer_device_t* dev, char *buff, int buff_len);
|
||||
|
||||
/*
|
||||
* (*enableScreen)() is used to either blank (enable=0) or
|
||||
* unblank (enable=1) the screen this framebuffer is attached to.
|
||||
*
|
||||
* Returns 0 on success or -errno on error.
|
||||
*/
|
||||
int (*enableScreen)(struct framebuffer_device_t* dev, int enable);
|
||||
|
||||
int (*orientationChanged) (struct framebuffer_device_t* dev, int);
|
||||
int (*videoOverlayStarted) (struct framebuffer_device_t* dev, int);
|
||||
int (*enableHDMIOutput) (struct framebuffer_device_t* dev, int);
|
||||
int (*setActionSafeWidthRatio) (struct framebuffer_device_t* dev, float);
|
||||
int (*setActionSafeHeightRatio) (struct framebuffer_device_t* dev, float);
|
||||
int (*resetBufferPostStatus)(struct framebuffer_device_t* dev);
|
||||
int (*waitForBufferPost) (struct framebuffer_device_t* dev);
|
||||
|
||||
} framebuffer_device_t;
|
||||
|
||||
|
||||
/** convenience API for opening and closing a supported device */
|
||||
|
||||
static inline int framebuffer_open(const struct hw_module_t* module,
|
||||
struct framebuffer_device_t** device) {
|
||||
return module->methods->open(module,
|
||||
GRALLOC_HARDWARE_FB0, (struct hw_device_t**)device);
|
||||
}
|
||||
|
||||
static inline int framebuffer_close(struct framebuffer_device_t* device) {
|
||||
return device->common.close(&device->common);
|
||||
}
|
||||
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif // ANDROID_FB_INTERFACE_H
|
||||
369
include/hardware/hwcomposer.h
Normal file
369
include/hardware/hwcomposer.h
Normal file
@@ -0,0 +1,369 @@
|
||||
/*
|
||||
* Copyright (C) 2010 The Android Open Source 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.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_INCLUDE_HARDWARE_HWCOMPOSER_H
|
||||
#define ANDROID_INCLUDE_HARDWARE_HWCOMPOSER_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
#include <hardware/gralloc.h>
|
||||
#include <hardware/hardware.h>
|
||||
#include <cutils/native_handle.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
#define HWC_API_VERSION 1
|
||||
|
||||
/**
|
||||
* The id of this module
|
||||
*/
|
||||
#define HWC_HARDWARE_MODULE_ID "hwcomposer"
|
||||
|
||||
/**
|
||||
* Name of the sensors device to open
|
||||
*/
|
||||
#define HWC_HARDWARE_COMPOSER "composer"
|
||||
|
||||
|
||||
enum {
|
||||
/* hwc_composer_device_t::set failed in EGL */
|
||||
HWC_EGL_ERROR = -1
|
||||
};
|
||||
|
||||
/*
|
||||
* hwc_layer_t::hints values
|
||||
* Hints are set by the HAL and read by SurfaceFlinger
|
||||
*/
|
||||
enum {
|
||||
/*
|
||||
* HWC can set the HWC_HINT_TRIPLE_BUFFER hint to indicate to SurfaceFlinger
|
||||
* that it should triple buffer this layer. Typically HWC does this when
|
||||
* the layer will be unavailable for use for an extended period of time,
|
||||
* e.g. if the display will be fetching data directly from the layer and
|
||||
* the layer can not be modified until after the next set().
|
||||
*/
|
||||
HWC_HINT_TRIPLE_BUFFER = 0x00000001,
|
||||
|
||||
/*
|
||||
* HWC sets HWC_HINT_CLEAR_FB to tell SurfaceFlinger that it should clear the
|
||||
* framebuffer with transparent pixels where this layer would be.
|
||||
* SurfaceFlinger will only honor this flag when the layer has no blending
|
||||
*
|
||||
*/
|
||||
HWC_HINT_CLEAR_FB = 0x00000002
|
||||
};
|
||||
|
||||
/*
|
||||
* hwc_layer_t::flags values
|
||||
* Flags are set by SurfaceFlinger and read by the HAL
|
||||
*/
|
||||
enum {
|
||||
/*
|
||||
* HWC_SKIP_LAYER is set by SurfaceFlnger to indicate that the HAL
|
||||
* shall not consider this layer for composition as it will be handled
|
||||
* by SurfaceFlinger (just as if compositionType was set to HWC_OVERLAY).
|
||||
*/
|
||||
HWC_SKIP_LAYER = 0x00000001,
|
||||
};
|
||||
|
||||
/*
|
||||
* hwc_layer_t::compositionType values
|
||||
*/
|
||||
enum {
|
||||
/* this layer is to be drawn into the framebuffer by SurfaceFlinger */
|
||||
HWC_FRAMEBUFFER = 0,
|
||||
|
||||
/* this layer will be handled in the HWC */
|
||||
HWC_OVERLAY = 1,
|
||||
};
|
||||
|
||||
/*
|
||||
* hwc_layer_t::blending values
|
||||
*/
|
||||
enum {
|
||||
/* no blending */
|
||||
HWC_BLENDING_NONE = 0x0100,
|
||||
|
||||
/* ONE / ONE_MINUS_SRC_ALPHA */
|
||||
HWC_BLENDING_PREMULT = 0x0105,
|
||||
|
||||
/* SRC_ALPHA / ONE_MINUS_SRC_ALPHA */
|
||||
HWC_BLENDING_COVERAGE = 0x0405
|
||||
};
|
||||
|
||||
/*
|
||||
* hwc_layer_t::transform values
|
||||
*/
|
||||
enum {
|
||||
/* flip source image horizontally */
|
||||
HWC_TRANSFORM_FLIP_H = HAL_TRANSFORM_FLIP_H,
|
||||
/* flip source image vertically */
|
||||
HWC_TRANSFORM_FLIP_V = HAL_TRANSFORM_FLIP_V,
|
||||
/* rotate source image 90 degrees clock-wise */
|
||||
HWC_TRANSFORM_ROT_90 = HAL_TRANSFORM_ROT_90,
|
||||
/* rotate source image 180 degrees */
|
||||
HWC_TRANSFORM_ROT_180 = HAL_TRANSFORM_ROT_180,
|
||||
/* rotate source image 270 degrees clock-wise */
|
||||
HWC_TRANSFORM_ROT_270 = HAL_TRANSFORM_ROT_270,
|
||||
};
|
||||
|
||||
typedef struct hwc_rect {
|
||||
int left;
|
||||
int top;
|
||||
int right;
|
||||
int bottom;
|
||||
} hwc_rect_t;
|
||||
|
||||
typedef struct hwc_region {
|
||||
size_t numRects;
|
||||
hwc_rect_t const* rects;
|
||||
} hwc_region_t;
|
||||
|
||||
typedef struct hwc_layer {
|
||||
/*
|
||||
* initially set to HWC_FRAMEBUFFER, indicates the layer will
|
||||
* be drawn into the framebuffer using OpenGL ES.
|
||||
* The HWC can toggle this value to HWC_OVERLAY, to indicate
|
||||
* it will handle the layer.
|
||||
*/
|
||||
int32_t compositionType;
|
||||
|
||||
/* see hwc_layer_t::hints above */
|
||||
uint32_t hints;
|
||||
|
||||
/* see hwc_layer_t::flags above */
|
||||
uint32_t flags;
|
||||
|
||||
/* handle of buffer to compose. this handle is guaranteed to have been
|
||||
* allocated with gralloc */
|
||||
buffer_handle_t handle;
|
||||
|
||||
/* transformation to apply to the buffer during composition */
|
||||
uint32_t transform;
|
||||
|
||||
/* blending to apply during composition */
|
||||
int32_t blending;
|
||||
|
||||
/* alpha value of the layer */
|
||||
int32_t alpha;
|
||||
|
||||
/* area of the source to consider, the origin is the top-left corner of
|
||||
* the buffer */
|
||||
hwc_rect_t sourceCrop;
|
||||
|
||||
/* where to composite the sourceCrop onto the display. The sourceCrop
|
||||
* is scaled using linear filtering to the displayFrame. The origin is the
|
||||
* top-left corner of the screen.
|
||||
*/
|
||||
hwc_rect_t displayFrame;
|
||||
|
||||
/* visible region in screen space. The origin is the
|
||||
* top-left corner of the screen.
|
||||
* The visible region INCLUDES areas overlapped by a translucent layer.
|
||||
*/
|
||||
hwc_region_t visibleRegionScreen;
|
||||
} hwc_layer_t;
|
||||
|
||||
|
||||
/*
|
||||
* hwc_layer_list_t::flags values
|
||||
*/
|
||||
enum {
|
||||
/*
|
||||
* HWC_GEOMETRY_CHANGED is set by SurfaceFlinger to indicate that the list
|
||||
* passed to (*prepare)() has changed by more than just the buffer handles.
|
||||
*/
|
||||
HWC_GEOMETRY_CHANGED = 0x00000001,
|
||||
|
||||
/*
|
||||
* HWC_SKIP_COMPOSITION is set by the HWC to indicate to SurfaceFlinger to
|
||||
* skip composition for this iteration.
|
||||
*/
|
||||
HWC_SKIP_COMPOSITION = 0x00000002
|
||||
};
|
||||
|
||||
/*
|
||||
* List of layers.
|
||||
* The handle members of hwLayers elements must be unique.
|
||||
*/
|
||||
typedef struct hwc_layer_list {
|
||||
uint32_t flags;
|
||||
size_t numHwLayers;
|
||||
hwc_layer_t hwLayers[0];
|
||||
} hwc_layer_list_t;
|
||||
|
||||
/* This represents a display, typically an EGLDisplay object */
|
||||
typedef void* hwc_display_t;
|
||||
|
||||
/* This represents a surface, typically an EGLSurface object */
|
||||
typedef void* hwc_surface_t;
|
||||
|
||||
|
||||
/* see hwc_composer_device::registerProcs()
|
||||
* Any of the callbacks can be NULL, in which case the corresponding
|
||||
* functionality is not supported.
|
||||
*/
|
||||
typedef struct hwc_procs {
|
||||
/*
|
||||
* (*invalidate)() triggers a screen refresh, in particular prepare and set
|
||||
* will be called shortly after this call is made. Note that there is
|
||||
* NO GUARANTEE that the screen refresh will happen after invalidate()
|
||||
* returns (in particular, it could happen before).
|
||||
* invalidate() is GUARANTEED TO NOT CALL BACK into the h/w composer HAL and
|
||||
* it is safe to call invalidate() from any of hwc_composer_device
|
||||
* hooks, unless noted otherwise.
|
||||
*/
|
||||
void (*invalidate)(struct hwc_procs* procs);
|
||||
} hwc_procs_t;
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
typedef struct hwc_module {
|
||||
struct hw_module_t common;
|
||||
} hwc_module_t;
|
||||
|
||||
|
||||
typedef struct hwc_composer_device {
|
||||
struct hw_device_t common;
|
||||
|
||||
/*
|
||||
* (*prepare)() is called for each frame before composition and is used by
|
||||
* SurfaceFlinger to determine what composition steps the HWC can handle.
|
||||
*
|
||||
* (*prepare)() can be called more than once, the last call prevails.
|
||||
*
|
||||
* The HWC responds by setting the compositionType field to either
|
||||
* HWC_FRAMEBUFFER or HWC_OVERLAY. In the former case, the composition for
|
||||
* this layer is handled by SurfaceFlinger with OpenGL ES, in the later
|
||||
* case, the HWC will have to handle this layer's composition.
|
||||
*
|
||||
* (*prepare)() is called with HWC_GEOMETRY_CHANGED to indicate that the
|
||||
* list's geometry has changed, that is, when more than just the buffer's
|
||||
* handles have been updated. Typically this happens (but is not limited to)
|
||||
* when a window is added, removed, resized or moved.
|
||||
*
|
||||
* a NULL list parameter or a numHwLayers of zero indicates that the
|
||||
* entire composition will be handled by SurfaceFlinger with OpenGL ES.
|
||||
*
|
||||
* returns: 0 on success. An negative error code on error. If an error is
|
||||
* returned, SurfaceFlinger will assume that none of the layer will be
|
||||
* handled by the HWC.
|
||||
*/
|
||||
int (*prepare)(struct hwc_composer_device *dev, hwc_layer_list_t* list);
|
||||
|
||||
|
||||
/*
|
||||
* (*set)() is used in place of eglSwapBuffers(), and assumes the same
|
||||
* functionality, except it also commits the work list atomically with
|
||||
* the actual eglSwapBuffers().
|
||||
*
|
||||
* The list parameter is guaranteed to be the same as the one returned
|
||||
* from the last call to (*prepare)().
|
||||
*
|
||||
* When this call returns the caller assumes that:
|
||||
*
|
||||
* - the display will be updated in the near future with the content
|
||||
* of the work list, without artifacts during the transition from the
|
||||
* previous frame.
|
||||
*
|
||||
* - all objects are available for immediate access or destruction, in
|
||||
* particular, hwc_region_t::rects data and hwc_layer_t::layer's buffer.
|
||||
* Note that this means that immediately accessing (potentially from a
|
||||
* different process) a buffer used in this call will not result in
|
||||
* screen corruption, the driver must apply proper synchronization or
|
||||
* scheduling (eg: block the caller, such as gralloc_module_t::lock(),
|
||||
* OpenGL ES, Camera, Codecs, etc..., or schedule the caller's work
|
||||
* after the buffer is freed from the actual composition).
|
||||
*
|
||||
* a NULL list parameter or a numHwLayers of zero indicates that the
|
||||
* entire composition has been handled by SurfaceFlinger with OpenGL ES.
|
||||
* In this case, (*set)() behaves just like eglSwapBuffers().
|
||||
*
|
||||
* dpy, sur, and list are set to NULL to indicate that the screen is
|
||||
* turning off. This happens WITHOUT prepare() being called first.
|
||||
* This is a good time to free h/w resources and/or power
|
||||
* the relevant h/w blocks down.
|
||||
*
|
||||
* IMPORTANT NOTE: there is an implicit layer containing opaque black
|
||||
* pixels behind all the layers in the list.
|
||||
* It is the responsibility of the hwcomposer module to make
|
||||
* sure black pixels are output (or blended from).
|
||||
*
|
||||
* returns: 0 on success. An negative error code on error:
|
||||
* HWC_EGL_ERROR: eglGetError() will provide the proper error code
|
||||
* Another code for non EGL errors.
|
||||
*
|
||||
*/
|
||||
int (*set)(struct hwc_composer_device *dev,
|
||||
hwc_display_t dpy,
|
||||
hwc_surface_t sur,
|
||||
hwc_layer_list_t* list);
|
||||
/*
|
||||
* This hook is OPTIONAL.
|
||||
*
|
||||
* If non NULL it will be called by SurfaceFlinger on dumpsys
|
||||
*/
|
||||
void (*dump)(struct hwc_composer_device* dev, char *buff, int buff_len);
|
||||
|
||||
/*
|
||||
* This hook is OPTIONAL.
|
||||
*
|
||||
* (*registerProcs)() registers a set of callbacks the h/w composer HAL
|
||||
* can later use. It is FORBIDDEN to call any of the callbacks from
|
||||
* within registerProcs(). registerProcs() must save the hwc_procs_t pointer
|
||||
* which is needed when calling a registered callback.
|
||||
* Each call to registerProcs replaces the previous set of callbacks.
|
||||
* registerProcs is called with NULL to unregister all callbacks.
|
||||
*
|
||||
* Any of the callbacks can be NULL, in which case the corresponding
|
||||
* functionality is not supported.
|
||||
*/
|
||||
void (*registerProcs)(struct hwc_composer_device* dev,
|
||||
hwc_procs_t const* procs);
|
||||
|
||||
void* reserved_proc[6];
|
||||
|
||||
/*
|
||||
* This API is called by Surfaceflinger to inform the HWC about the
|
||||
* HDMI status.
|
||||
*/
|
||||
void (*enableHDMIOutput)(struct hwc_composer_device* dev, bool enable);
|
||||
|
||||
} hwc_composer_device_t;
|
||||
|
||||
|
||||
/** convenience API for opening and closing a device */
|
||||
|
||||
static inline int hwc_open(const struct hw_module_t* module,
|
||||
hwc_composer_device_t** device) {
|
||||
return module->methods->open(module,
|
||||
HWC_HARDWARE_COMPOSER, (struct hw_device_t**)device);
|
||||
}
|
||||
|
||||
static inline int hwc_close(hwc_composer_device_t* device) {
|
||||
return device->common.close(&device->common);
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* ANDROID_INCLUDE_HARDWARE_HWCOMPOSER_H */
|
||||
185
include/linux/android_pmem.h
Normal file
185
include/linux/android_pmem.h
Normal file
@@ -0,0 +1,185 @@
|
||||
/* include/linux/android_pmem.h
|
||||
*
|
||||
* Copyright (C) 2007 Google, Inc.
|
||||
*
|
||||
* This software is licensed under the terms of the GNU General Public
|
||||
* License version 2, as published by the Free Software Foundation, and
|
||||
* may be copied, distributed, and modified under those terms.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _ANDROID_PMEM_H_
|
||||
#define _ANDROID_PMEM_H_
|
||||
|
||||
#include <linux/fs.h>
|
||||
|
||||
#define PMEM_KERNEL_TEST_MAGIC 0xc0
|
||||
#define PMEM_KERNEL_TEST_NOMINAL_TEST_IOCTL \
|
||||
_IO(PMEM_KERNEL_TEST_MAGIC, 1)
|
||||
#define PMEM_KERNEL_TEST_ADVERSARIAL_TEST_IOCTL \
|
||||
_IO(PMEM_KERNEL_TEST_MAGIC, 2)
|
||||
#define PMEM_KERNEL_TEST_HUGE_ALLOCATION_TEST_IOCTL \
|
||||
_IO(PMEM_KERNEL_TEST_MAGIC, 3)
|
||||
#define PMEM_KERNEL_TEST_FREE_UNALLOCATED_TEST_IOCTL \
|
||||
_IO(PMEM_KERNEL_TEST_MAGIC, 4)
|
||||
#define PMEM_KERNEL_TEST_LARGE_REGION_NUMBER_TEST_IOCTL \
|
||||
_IO(PMEM_KERNEL_TEST_MAGIC, 5)
|
||||
|
||||
#define PMEM_IOCTL_MAGIC 'p'
|
||||
#define PMEM_GET_PHYS _IOW(PMEM_IOCTL_MAGIC, 1, unsigned int)
|
||||
#define PMEM_MAP _IOW(PMEM_IOCTL_MAGIC, 2, unsigned int)
|
||||
#define PMEM_GET_SIZE _IOW(PMEM_IOCTL_MAGIC, 3, unsigned int)
|
||||
#define PMEM_UNMAP _IOW(PMEM_IOCTL_MAGIC, 4, unsigned int)
|
||||
/* This ioctl will allocate pmem space, backing the file, it will fail
|
||||
* if the file already has an allocation, pass it the len as the argument
|
||||
* to the ioctl */
|
||||
#define PMEM_ALLOCATE _IOW(PMEM_IOCTL_MAGIC, 5, unsigned int)
|
||||
/* This will connect a one pmem file to another, pass the file that is already
|
||||
* backed in memory as the argument to the ioctl
|
||||
*/
|
||||
#define PMEM_CONNECT _IOW(PMEM_IOCTL_MAGIC, 6, unsigned int)
|
||||
/* Returns the total size of the pmem region it is sent to as a pmem_region
|
||||
* struct (with offset set to 0).
|
||||
*/
|
||||
#define PMEM_GET_TOTAL_SIZE _IOW(PMEM_IOCTL_MAGIC, 7, unsigned int)
|
||||
/* Revokes gpu registers and resets the gpu. Pass a pointer to the
|
||||
* start of the mapped gpu regs (the vaddr returned by mmap) as the argument.
|
||||
*/
|
||||
#define HW3D_REVOKE_GPU _IOW(PMEM_IOCTL_MAGIC, 8, unsigned int)
|
||||
#define HW3D_GRANT_GPU _IOW(PMEM_IOCTL_MAGIC, 9, unsigned int)
|
||||
#define HW3D_WAIT_FOR_INTERRUPT _IOW(PMEM_IOCTL_MAGIC, 10, unsigned int)
|
||||
|
||||
#define PMEM_CLEAN_INV_CACHES _IOW(PMEM_IOCTL_MAGIC, 11, unsigned int)
|
||||
#define PMEM_CLEAN_CACHES _IOW(PMEM_IOCTL_MAGIC, 12, unsigned int)
|
||||
#define PMEM_INV_CACHES _IOW(PMEM_IOCTL_MAGIC, 13, unsigned int)
|
||||
|
||||
#define PMEM_GET_FREE_SPACE _IOW(PMEM_IOCTL_MAGIC, 14, unsigned int)
|
||||
#define PMEM_ALLOCATE_ALIGNED _IOW(PMEM_IOCTL_MAGIC, 15, unsigned int)
|
||||
struct pmem_region {
|
||||
unsigned long offset;
|
||||
unsigned long len;
|
||||
};
|
||||
|
||||
struct pmem_addr {
|
||||
unsigned long vaddr;
|
||||
unsigned long offset;
|
||||
unsigned long length;
|
||||
};
|
||||
|
||||
struct pmem_freespace {
|
||||
unsigned long total;
|
||||
unsigned long largest;
|
||||
};
|
||||
|
||||
struct pmem_allocation {
|
||||
unsigned long size;
|
||||
unsigned int align;
|
||||
};
|
||||
|
||||
#ifdef __KERNEL__
|
||||
int get_pmem_file(unsigned int fd, unsigned long *start, unsigned long *vstart,
|
||||
unsigned long *end, struct file **filp);
|
||||
int get_pmem_fd(int fd, unsigned long *start, unsigned long *end);
|
||||
int get_pmem_user_addr(struct file *file, unsigned long *start,
|
||||
unsigned long *end);
|
||||
void put_pmem_file(struct file* file);
|
||||
void put_pmem_fd(int fd);
|
||||
void flush_pmem_fd(int fd, unsigned long start, unsigned long len);
|
||||
void flush_pmem_file(struct file *file, unsigned long start, unsigned long len);
|
||||
int pmem_cache_maint(struct file *file, unsigned int cmd,
|
||||
struct pmem_addr *pmem_addr);
|
||||
|
||||
enum pmem_allocator_type {
|
||||
/* Zero is a default in platform PMEM structures in the board files,
|
||||
* when the "allocator_type" structure element is not explicitly
|
||||
* defined
|
||||
*/
|
||||
PMEM_ALLOCATORTYPE_BITMAP = 0, /* forced to be zero here */
|
||||
PMEM_ALLOCATORTYPE_SYSTEM,
|
||||
|
||||
PMEM_ALLOCATORTYPE_ALLORNOTHING,
|
||||
PMEM_ALLOCATORTYPE_BUDDYBESTFIT,
|
||||
|
||||
PMEM_ALLOCATORTYPE_MAX,
|
||||
};
|
||||
|
||||
#define PMEM_MEMTYPE_MASK 0x7
|
||||
#define PMEM_INVALID_MEMTYPE 0x0
|
||||
#define PMEM_MEMTYPE_EBI1 0x1
|
||||
#define PMEM_MEMTYPE_SMI 0x2
|
||||
#define PMEM_MEMTYPE_RESERVED_INVALID2 0x3
|
||||
#define PMEM_MEMTYPE_RESERVED_INVALID3 0x4
|
||||
#define PMEM_MEMTYPE_RESERVED_INVALID4 0x5
|
||||
#define PMEM_MEMTYPE_RESERVED_INVALID5 0x6
|
||||
#define PMEM_MEMTYPE_RESERVED_INVALID6 0x7
|
||||
|
||||
#define PMEM_ALIGNMENT_MASK 0x18
|
||||
#define PMEM_ALIGNMENT_RESERVED_INVALID1 0x0
|
||||
#define PMEM_ALIGNMENT_4K 0x8 /* the default */
|
||||
#define PMEM_ALIGNMENT_1M 0x10
|
||||
#define PMEM_ALIGNMENT_RESERVED_INVALID2 0x18
|
||||
|
||||
/* flags in the following function defined as above. */
|
||||
int32_t pmem_kalloc(const size_t size, const uint32_t flags);
|
||||
int32_t pmem_kfree(const int32_t physaddr);
|
||||
|
||||
/* kernel api names for board specific data structures */
|
||||
#define PMEM_KERNEL_EBI1_DATA_NAME "pmem_kernel_ebi1"
|
||||
#define PMEM_KERNEL_SMI_DATA_NAME "pmem_kernel_smi"
|
||||
|
||||
struct android_pmem_platform_data
|
||||
{
|
||||
const char* name;
|
||||
/* size of memory region */
|
||||
unsigned long size;
|
||||
|
||||
enum pmem_allocator_type allocator_type;
|
||||
/* treated as a 'hidden' variable in the board files. Can be
|
||||
* set, but default is the system init value of 0 which becomes a
|
||||
* quantum of 4K pages.
|
||||
*/
|
||||
unsigned int quantum;
|
||||
|
||||
/* set to indicate maps of this region should be cached, if a mix of
|
||||
* cached and uncached is desired, set this and open the device with
|
||||
* O_SYNC to get an uncached region */
|
||||
unsigned cached;
|
||||
/* The MSM7k has bits to enable a write buffer in the bus controller*/
|
||||
unsigned buffered;
|
||||
/* which memory type (i.e. SMI, EBI1) this PMEM device is backed by */
|
||||
unsigned memory_type;
|
||||
/*
|
||||
* function to be called when the number of allocations goes from
|
||||
* 0 -> 1
|
||||
*/
|
||||
void (*request_region)(void *);
|
||||
/*
|
||||
* function to be called when the number of allocations goes from
|
||||
* 1 -> 0
|
||||
*/
|
||||
void (*release_region)(void *);
|
||||
/*
|
||||
* function to be called upon pmem registration
|
||||
*/
|
||||
void *(*setup_region)(void);
|
||||
/*
|
||||
* indicates that this region should be mapped/unmaped as needed
|
||||
*/
|
||||
int map_on_demand;
|
||||
};
|
||||
|
||||
int pmem_setup(struct android_pmem_platform_data *pdata,
|
||||
long (*ioctl)(struct file *, unsigned int, unsigned long),
|
||||
int (*release)(struct inode *, struct file *));
|
||||
|
||||
int pmem_remap(struct pmem_region *region, struct file *file,
|
||||
unsigned operation);
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif //_ANDROID_PPP_H_
|
||||
|
||||
50
include/linux/ashmem.h
Normal file
50
include/linux/ashmem.h
Normal file
@@ -0,0 +1,50 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_ASHMEM_H
|
||||
#define _LINUX_ASHMEM_H
|
||||
|
||||
#include <linux/limits.h>
|
||||
#include <linux/ioctl.h>
|
||||
|
||||
#define ASHMEM_NAME_LEN 256
|
||||
|
||||
#define ASHMEM_NAME_DEF "dev/ashmem"
|
||||
|
||||
#define ASHMEM_NOT_PURGED 0
|
||||
#define ASHMEM_WAS_PURGED 1
|
||||
|
||||
#define ASHMEM_IS_UNPINNED 0
|
||||
#define ASHMEM_IS_PINNED 1
|
||||
|
||||
struct ashmem_pin {
|
||||
__u32 offset;
|
||||
__u32 len;
|
||||
};
|
||||
|
||||
#define __ASHMEMIOC 0x77
|
||||
|
||||
#define ASHMEM_SET_NAME _IOW(__ASHMEMIOC, 1, char[ASHMEM_NAME_LEN])
|
||||
#define ASHMEM_GET_NAME _IOR(__ASHMEMIOC, 2, char[ASHMEM_NAME_LEN])
|
||||
#define ASHMEM_SET_SIZE _IOW(__ASHMEMIOC, 3, size_t)
|
||||
#define ASHMEM_GET_SIZE _IO(__ASHMEMIOC, 4)
|
||||
#define ASHMEM_SET_PROT_MASK _IOW(__ASHMEMIOC, 5, unsigned long)
|
||||
#define ASHMEM_GET_PROT_MASK _IO(__ASHMEMIOC, 6)
|
||||
#define ASHMEM_PIN _IOW(__ASHMEMIOC, 7, struct ashmem_pin)
|
||||
#define ASHMEM_UNPIN _IOW(__ASHMEMIOC, 8, struct ashmem_pin)
|
||||
#define ASHMEM_GET_PIN_STATUS _IO(__ASHMEMIOC, 9)
|
||||
#define ASHMEM_PURGE_ALL_CACHES _IO(__ASHMEMIOC, 10)
|
||||
|
||||
#define ASHMEM_CACHE_FLUSH_RANGE _IO(__ASHMEMIOC, 11)
|
||||
#define ASHMEM_CACHE_CLEAN_RANGE _IO(__ASHMEMIOC, 12)
|
||||
#define ASHMEM_CACHE_INV_RANGE _IO(__ASHMEMIOC, 13)
|
||||
|
||||
#endif
|
||||
45
include/linux/genlock.h
Normal file
45
include/linux/genlock.h
Normal file
@@ -0,0 +1,45 @@
|
||||
#ifndef _GENLOCK_H_
|
||||
#define _GENLOCK_H_
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
struct genlock;
|
||||
struct genlock_handle;
|
||||
|
||||
struct genlock_handle *genlock_get_handle(void);
|
||||
struct genlock_handle *genlock_get_handle_fd(int fd);
|
||||
void genlock_put_handle(struct genlock_handle *handle);
|
||||
struct genlock *genlock_create_lock(struct genlock_handle *);
|
||||
struct genlock *genlock_attach_lock(struct genlock_handle *, int fd);
|
||||
int genlock_wait(struct genlock_handle *handle, u32 timeout);
|
||||
void genlock_release_lock(struct genlock_handle *);
|
||||
int genlock_lock(struct genlock_handle *handle, int op, int flags,
|
||||
u32 timeout);
|
||||
#endif
|
||||
|
||||
#define GENLOCK_UNLOCK 0
|
||||
#define GENLOCK_WRLOCK 1
|
||||
#define GENLOCK_RDLOCK 2
|
||||
|
||||
#define GENLOCK_NOBLOCK (1 << 0)
|
||||
|
||||
struct genlock_lock {
|
||||
int fd;
|
||||
int op;
|
||||
int flags;
|
||||
int timeout;
|
||||
};
|
||||
|
||||
#define GENLOCK_IOC_MAGIC 'G'
|
||||
|
||||
#define GENLOCK_IOC_NEW _IO(GENLOCK_IOC_MAGIC, 0)
|
||||
#define GENLOCK_IOC_EXPORT _IOR(GENLOCK_IOC_MAGIC, 1, \
|
||||
struct genlock_lock)
|
||||
#define GENLOCK_IOC_ATTACH _IOW(GENLOCK_IOC_MAGIC, 2, \
|
||||
struct genlock_lock)
|
||||
#define GENLOCK_IOC_LOCK _IOW(GENLOCK_IOC_MAGIC, 3, \
|
||||
struct genlock_lock)
|
||||
#define GENLOCK_IOC_RELEASE _IO(GENLOCK_IOC_MAGIC, 4)
|
||||
#define GENLOCK_IOC_WAIT _IOW(GENLOCK_IOC_MAGIC, 5, \
|
||||
struct genlock_lock)
|
||||
#endif
|
||||
556
include/linux/ion.h
Normal file
556
include/linux/ion.h
Normal file
@@ -0,0 +1,556 @@
|
||||
/*
|
||||
* include/linux/ion.h
|
||||
*
|
||||
* Copyright (C) 2011 Google, Inc.
|
||||
*
|
||||
* This software is licensed under the terms of the GNU General Public
|
||||
* License version 2, as published by the Free Software Foundation, and
|
||||
* may be copied, distributed, and modified under those terms.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_ION_H
|
||||
#define _LINUX_ION_H
|
||||
|
||||
#include <linux/ioctl.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
|
||||
struct ion_handle;
|
||||
/**
|
||||
* enum ion_heap_types - list of all possible types of heaps
|
||||
* @ION_HEAP_TYPE_SYSTEM: memory allocated via vmalloc
|
||||
* @ION_HEAP_TYPE_SYSTEM_CONTIG: memory allocated via kmalloc
|
||||
* @ION_HEAP_TYPE_CARVEOUT: memory allocated from a prereserved
|
||||
* carveout heap, allocations are physically
|
||||
* contiguous
|
||||
* @ION_HEAP_END: helper for iterating over heaps
|
||||
*/
|
||||
enum ion_heap_type {
|
||||
ION_HEAP_TYPE_SYSTEM,
|
||||
ION_HEAP_TYPE_SYSTEM_CONTIG,
|
||||
ION_HEAP_TYPE_CARVEOUT,
|
||||
ION_HEAP_TYPE_CUSTOM, /* must be last so device specific heaps always
|
||||
are at the end of this enum */
|
||||
ION_NUM_HEAPS,
|
||||
};
|
||||
|
||||
#define ION_HEAP_SYSTEM_MASK (1 << ION_HEAP_TYPE_SYSTEM)
|
||||
#define ION_HEAP_SYSTEM_CONTIG_MASK (1 << ION_HEAP_TYPE_SYSTEM_CONTIG)
|
||||
#define ION_HEAP_CARVEOUT_MASK (1 << ION_HEAP_TYPE_CARVEOUT)
|
||||
|
||||
|
||||
/**
|
||||
* These are the only ids that should be used for Ion heap ids.
|
||||
* The ids listed are the order in which allocation will be attempted
|
||||
* if specified. Don't swap the order of heap ids unless you know what
|
||||
* you are doing!
|
||||
*/
|
||||
|
||||
enum ion_heap_ids {
|
||||
ION_HEAP_SYSTEM_ID,
|
||||
ION_HEAP_SYSTEM_CONTIG_ID,
|
||||
ION_HEAP_EBI_ID,
|
||||
ION_HEAP_SMI_ID,
|
||||
ION_HEAP_ADSP_ID,
|
||||
ION_HEAP_AUDIO_ID,
|
||||
};
|
||||
|
||||
#define ION_KMALLOC_HEAP_NAME "kmalloc"
|
||||
#define ION_VMALLOC_HEAP_NAME "vmalloc"
|
||||
#define ION_EBI1_HEAP_NAME "EBI1"
|
||||
#define ION_ADSP_HEAP_NAME "adsp"
|
||||
#define ION_SMI_HEAP_NAME "smi"
|
||||
|
||||
#define CACHED 1
|
||||
#define UNCACHED 0
|
||||
|
||||
#define ION_CACHE_SHIFT 0
|
||||
|
||||
#define ION_SET_CACHE(__cache) ((__cache) << ION_CACHE_SHIFT)
|
||||
|
||||
#define ION_IS_CACHED(__flags) ((__flags) & (1 << ION_CACHE_SHIFT))
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <linux/err.h>
|
||||
#include <mach/ion.h>
|
||||
struct ion_device;
|
||||
struct ion_heap;
|
||||
struct ion_mapper;
|
||||
struct ion_client;
|
||||
struct ion_buffer;
|
||||
|
||||
/* This should be removed some day when phys_addr_t's are fully
|
||||
plumbed in the kernel, and all instances of ion_phys_addr_t should
|
||||
be converted to phys_addr_t. For the time being many kernel interfaces
|
||||
do not accept phys_addr_t's that would have to */
|
||||
#define ion_phys_addr_t unsigned long
|
||||
|
||||
/**
|
||||
* struct ion_platform_heap - defines a heap in the given platform
|
||||
* @type: type of the heap from ion_heap_type enum
|
||||
* @id: unique identifier for heap. When allocating (lower numbers
|
||||
* will be allocated from first)
|
||||
* @name: used for debug purposes
|
||||
* @base: base address of heap in physical memory if applicable
|
||||
* @size: size of the heap in bytes if applicable
|
||||
*
|
||||
* Provided by the board file.
|
||||
*/
|
||||
struct ion_platform_heap {
|
||||
enum ion_heap_type type;
|
||||
unsigned int id;
|
||||
const char *name;
|
||||
ion_phys_addr_t base;
|
||||
size_t size;
|
||||
enum ion_memory_types memory_type;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct ion_platform_data - array of platform heaps passed from board file
|
||||
* @nr: number of structures in the array
|
||||
* @request_region: function to be called when the number of allocations goes
|
||||
* from 0 -> 1
|
||||
* @release_region: function to be called when the number of allocations goes
|
||||
* from 1 -> 0
|
||||
* @setup_region: function to be called upon ion registration
|
||||
* @heaps: array of platform_heap structions
|
||||
*
|
||||
* Provided by the board file in the form of platform data to a platform device.
|
||||
*/
|
||||
struct ion_platform_data {
|
||||
int nr;
|
||||
void (*request_region)(void *);
|
||||
void (*release_region)(void *);
|
||||
void *(*setup_region)(void);
|
||||
struct ion_platform_heap heaps[];
|
||||
};
|
||||
|
||||
#ifdef CONFIG_ION
|
||||
|
||||
/**
|
||||
* ion_client_create() - allocate a client and returns it
|
||||
* @dev: the global ion device
|
||||
* @heap_mask: mask of heaps this client can allocate from
|
||||
* @name: used for debugging
|
||||
*/
|
||||
struct ion_client *ion_client_create(struct ion_device *dev,
|
||||
unsigned int heap_mask, const char *name);
|
||||
|
||||
/**
|
||||
* msm_ion_client_create - allocate a client using the ion_device specified in
|
||||
* drivers/gpu/ion/msm/msm_ion.c
|
||||
*
|
||||
* heap_mask and name are the same as ion_client_create, return values
|
||||
* are the same as ion_client_create.
|
||||
*/
|
||||
|
||||
struct ion_client *msm_ion_client_create(unsigned int heap_mask,
|
||||
const char *name);
|
||||
|
||||
/**
|
||||
* ion_client_destroy() - free's a client and all it's handles
|
||||
* @client: the client
|
||||
*
|
||||
* Free the provided client and all it's resources including
|
||||
* any handles it is holding.
|
||||
*/
|
||||
void ion_client_destroy(struct ion_client *client);
|
||||
|
||||
/**
|
||||
* ion_alloc - allocate ion memory
|
||||
* @client: the client
|
||||
* @len: size of the allocation
|
||||
* @align: requested allocation alignment, lots of hardware blocks have
|
||||
* alignment requirements of some kind
|
||||
* @flags: mask of heaps to allocate from, if multiple bits are set
|
||||
* heaps will be tried in order from lowest to highest order bit
|
||||
*
|
||||
* Allocate memory in one of the heaps provided in heap mask and return
|
||||
* an opaque handle to it.
|
||||
*/
|
||||
struct ion_handle *ion_alloc(struct ion_client *client, size_t len,
|
||||
size_t align, unsigned int flags);
|
||||
|
||||
/**
|
||||
* ion_free - free a handle
|
||||
* @client: the client
|
||||
* @handle: the handle to free
|
||||
*
|
||||
* Free the provided handle.
|
||||
*/
|
||||
void ion_free(struct ion_client *client, struct ion_handle *handle);
|
||||
|
||||
/**
|
||||
* ion_phys - returns the physical address and len of a handle
|
||||
* @client: the client
|
||||
* @handle: the handle
|
||||
* @addr: a pointer to put the address in
|
||||
* @len: a pointer to put the length in
|
||||
*
|
||||
* This function queries the heap for a particular handle to get the
|
||||
* handle's physical address. It't output is only correct if
|
||||
* a heap returns physically contiguous memory -- in other cases
|
||||
* this api should not be implemented -- ion_map_dma should be used
|
||||
* instead. Returns -EINVAL if the handle is invalid. This has
|
||||
* no implications on the reference counting of the handle --
|
||||
* the returned value may not be valid if the caller is not
|
||||
* holding a reference.
|
||||
*/
|
||||
int ion_phys(struct ion_client *client, struct ion_handle *handle,
|
||||
ion_phys_addr_t *addr, size_t *len);
|
||||
|
||||
/**
|
||||
* ion_map_kernel - create mapping for the given handle
|
||||
* @client: the client
|
||||
* @handle: handle to map
|
||||
* @flags: flags for this mapping
|
||||
*
|
||||
* Map the given handle into the kernel and return a kernel address that
|
||||
* can be used to access this address. If no flags are specified, this
|
||||
* will return a non-secure uncached mapping.
|
||||
*/
|
||||
void *ion_map_kernel(struct ion_client *client, struct ion_handle *handle,
|
||||
unsigned long flags);
|
||||
|
||||
/**
|
||||
* ion_unmap_kernel() - destroy a kernel mapping for a handle
|
||||
* @client: the client
|
||||
* @handle: handle to unmap
|
||||
*/
|
||||
void ion_unmap_kernel(struct ion_client *client, struct ion_handle *handle);
|
||||
|
||||
/**
|
||||
* ion_map_dma - create a dma mapping for a given handle
|
||||
* @client: the client
|
||||
* @handle: handle to map
|
||||
*
|
||||
* Return an sglist describing the given handle
|
||||
*/
|
||||
struct scatterlist *ion_map_dma(struct ion_client *client,
|
||||
struct ion_handle *handle,
|
||||
unsigned long flags);
|
||||
|
||||
/**
|
||||
* ion_unmap_dma() - destroy a dma mapping for a handle
|
||||
* @client: the client
|
||||
* @handle: handle to unmap
|
||||
*/
|
||||
void ion_unmap_dma(struct ion_client *client, struct ion_handle *handle);
|
||||
|
||||
/**
|
||||
* ion_share() - given a handle, obtain a buffer to pass to other clients
|
||||
* @client: the client
|
||||
* @handle: the handle to share
|
||||
*
|
||||
* Given a handle, return a buffer, which exists in a global name
|
||||
* space, and can be passed to other clients. Should be passed into ion_import
|
||||
* to obtain a new handle for this buffer.
|
||||
*
|
||||
* NOTE: This function does do not an extra reference. The burden is on the
|
||||
* caller to make sure the buffer doesn't go away while it's being passed to
|
||||
* another client. That is, ion_free should not be called on this handle until
|
||||
* the buffer has been imported into the other client.
|
||||
*/
|
||||
struct ion_buffer *ion_share(struct ion_client *client,
|
||||
struct ion_handle *handle);
|
||||
|
||||
/**
|
||||
* ion_import() - given an buffer in another client, import it
|
||||
* @client: this blocks client
|
||||
* @buffer: the buffer to import (as obtained from ion_share)
|
||||
*
|
||||
* Given a buffer, add it to the client and return the handle to use to refer
|
||||
* to it further. This is called to share a handle from one kernel client to
|
||||
* another.
|
||||
*/
|
||||
struct ion_handle *ion_import(struct ion_client *client,
|
||||
struct ion_buffer *buffer);
|
||||
|
||||
/**
|
||||
* ion_import_fd() - given an fd obtained via ION_IOC_SHARE ioctl, import it
|
||||
* @client: this blocks client
|
||||
* @fd: the fd
|
||||
*
|
||||
* A helper function for drivers that will be recieving ion buffers shared
|
||||
* with them from userspace. These buffers are represented by a file
|
||||
* descriptor obtained as the return from the ION_IOC_SHARE ioctl.
|
||||
* This function coverts that fd into the underlying buffer, and returns
|
||||
* the handle to use to refer to it further.
|
||||
*/
|
||||
struct ion_handle *ion_import_fd(struct ion_client *client, int fd);
|
||||
|
||||
/**
|
||||
* ion_handle_get_flags - get the flags for a given handle
|
||||
*
|
||||
* @client - client who allocated the handle
|
||||
* @handle - handle to get the flags
|
||||
* @flags - pointer to store the flags
|
||||
*
|
||||
* Gets the current flags for a handle. These flags indicate various options
|
||||
* of the buffer (caching, security, etc.)
|
||||
*/
|
||||
int ion_handle_get_flags(struct ion_client *client, struct ion_handle *handle,
|
||||
unsigned long *flags);
|
||||
|
||||
#else
|
||||
static inline struct ion_client *ion_client_create(struct ion_device *dev,
|
||||
unsigned int heap_mask, const char *name)
|
||||
{
|
||||
return ERR_PTR(-ENODEV);
|
||||
}
|
||||
|
||||
static inline struct ion_client *msm_ion_client_create(unsigned int heap_mask,
|
||||
const char *name)
|
||||
{
|
||||
return ERR_PTR(-ENODEV);
|
||||
}
|
||||
|
||||
static inline void ion_client_destroy(struct ion_client *client) { }
|
||||
|
||||
static inline struct ion_handle *ion_alloc(struct ion_client *client,
|
||||
size_t len, size_t align, unsigned int flags)
|
||||
{
|
||||
return ERR_PTR(-ENODEV);
|
||||
}
|
||||
|
||||
static inline void ion_free(struct ion_client *client,
|
||||
struct ion_handle *handle) { }
|
||||
|
||||
|
||||
static inline int ion_phys(struct ion_client *client,
|
||||
struct ion_handle *handle, ion_phys_addr_t *addr, size_t *len)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
static inline void *ion_map_kernel(struct ion_client *client,
|
||||
struct ion_handle *handle, unsigned long flags)
|
||||
{
|
||||
return ERR_PTR(-ENODEV);
|
||||
}
|
||||
|
||||
static inline void ion_unmap_kernel(struct ion_client *client,
|
||||
struct ion_handle *handle) { }
|
||||
|
||||
static inline struct scatterlist *ion_map_dma(struct ion_client *client,
|
||||
struct ion_handle *handle, unsigned long flags)
|
||||
{
|
||||
return ERR_PTR(-ENODEV);
|
||||
}
|
||||
|
||||
static inline void ion_unmap_dma(struct ion_client *client,
|
||||
struct ion_handle *handle) { }
|
||||
|
||||
static inline struct ion_buffer *ion_share(struct ion_client *client,
|
||||
struct ion_handle *handle)
|
||||
{
|
||||
return ERR_PTR(-ENODEV);
|
||||
}
|
||||
|
||||
static inline struct ion_handle *ion_import(struct ion_client *client,
|
||||
struct ion_buffer *buffer)
|
||||
{
|
||||
return ERR_PTR(-ENODEV);
|
||||
}
|
||||
|
||||
static inline struct ion_handle *ion_import_fd(struct ion_client *client,
|
||||
int fd)
|
||||
{
|
||||
return ERR_PTR(-ENODEV);
|
||||
}
|
||||
|
||||
static inline int ion_handle_get_flags(struct ion_client *client,
|
||||
struct ion_handle *handle, unsigned long *flags)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
#endif /* CONFIG_ION */
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
/**
|
||||
* DOC: Ion Userspace API
|
||||
*
|
||||
* create a client by opening /dev/ion
|
||||
* most operations handled via following ioctls
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* struct ion_allocation_data - metadata passed from userspace for allocations
|
||||
* @len: size of the allocation
|
||||
* @align: required alignment of the allocation
|
||||
* @flags: flags passed to heap
|
||||
* @handle: pointer that will be populated with a cookie to use to refer
|
||||
* to this allocation
|
||||
*
|
||||
* Provided by userspace as an argument to the ioctl
|
||||
*/
|
||||
struct ion_allocation_data {
|
||||
size_t len;
|
||||
size_t align;
|
||||
unsigned int flags;
|
||||
struct ion_handle *handle;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct ion_fd_data - metadata passed to/from userspace for a handle/fd pair
|
||||
* @handle: a handle
|
||||
* @fd: a file descriptor representing that handle
|
||||
*
|
||||
* For ION_IOC_SHARE or ION_IOC_MAP userspace populates the handle field with
|
||||
* the handle returned from ion alloc, and the kernel returns the file
|
||||
* descriptor to share or map in the fd field. For ION_IOC_IMPORT, userspace
|
||||
* provides the file descriptor and the kernel returns the handle.
|
||||
*/
|
||||
struct ion_fd_data {
|
||||
struct ion_handle *handle;
|
||||
int fd;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct ion_handle_data - a handle passed to/from the kernel
|
||||
* @handle: a handle
|
||||
*/
|
||||
struct ion_handle_data {
|
||||
struct ion_handle *handle;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct ion_custom_data - metadata passed to/from userspace for a custom ioctl
|
||||
* @cmd: the custom ioctl function to call
|
||||
* @arg: additional data to pass to the custom ioctl, typically a user
|
||||
* pointer to a predefined structure
|
||||
*
|
||||
* This works just like the regular cmd and arg fields of an ioctl.
|
||||
*/
|
||||
struct ion_custom_data {
|
||||
unsigned int cmd;
|
||||
unsigned long arg;
|
||||
};
|
||||
|
||||
|
||||
/* struct ion_flush_data - data passed to ion for flushing caches
|
||||
*
|
||||
* @handle: handle with data to flush
|
||||
* @vaddr: userspace virtual address mapped with mmap
|
||||
* @offset: offset into the handle to flush
|
||||
* @length: length of handle to flush
|
||||
*
|
||||
* Performs cache operations on the handle. If p is the start address
|
||||
* of the handle, p + offset through p + offset + length will have
|
||||
* the cache operations performed
|
||||
*/
|
||||
struct ion_flush_data {
|
||||
struct ion_handle *handle;
|
||||
void *vaddr;
|
||||
unsigned int offset;
|
||||
unsigned int length;
|
||||
};
|
||||
|
||||
/* struct ion_flag_data - information about flags for this buffer
|
||||
*
|
||||
* @handle: handle to get flags from
|
||||
* @flags: flags of this handle
|
||||
*
|
||||
* Takes handle as an input and outputs the flags from the handle
|
||||
* in the flag field.
|
||||
*/
|
||||
struct ion_flag_data {
|
||||
struct ion_handle *handle;
|
||||
unsigned long flags;
|
||||
};
|
||||
|
||||
#define ION_IOC_MAGIC 'I'
|
||||
|
||||
/**
|
||||
* DOC: ION_IOC_ALLOC - allocate memory
|
||||
*
|
||||
* Takes an ion_allocation_data struct and returns it with the handle field
|
||||
* populated with the opaque handle for the allocation.
|
||||
*/
|
||||
#define ION_IOC_ALLOC _IOWR(ION_IOC_MAGIC, 0, \
|
||||
struct ion_allocation_data)
|
||||
|
||||
/**
|
||||
* DOC: ION_IOC_FREE - free memory
|
||||
*
|
||||
* Takes an ion_handle_data struct and frees the handle.
|
||||
*/
|
||||
#define ION_IOC_FREE _IOWR(ION_IOC_MAGIC, 1, struct ion_handle_data)
|
||||
|
||||
/**
|
||||
* DOC: ION_IOC_MAP - get a file descriptor to mmap
|
||||
*
|
||||
* Takes an ion_fd_data struct with the handle field populated with a valid
|
||||
* opaque handle. Returns the struct with the fd field set to a file
|
||||
* descriptor open in the current address space. This file descriptor
|
||||
* can then be used as an argument to mmap.
|
||||
*/
|
||||
#define ION_IOC_MAP _IOWR(ION_IOC_MAGIC, 2, struct ion_fd_data)
|
||||
|
||||
/**
|
||||
* DOC: ION_IOC_SHARE - creates a file descriptor to use to share an allocation
|
||||
*
|
||||
* Takes an ion_fd_data struct with the handle field populated with a valid
|
||||
* opaque handle. Returns the struct with the fd field set to a file
|
||||
* descriptor open in the current address space. This file descriptor
|
||||
* can then be passed to another process. The corresponding opaque handle can
|
||||
* be retrieved via ION_IOC_IMPORT.
|
||||
*/
|
||||
#define ION_IOC_SHARE _IOWR(ION_IOC_MAGIC, 4, struct ion_fd_data)
|
||||
|
||||
/**
|
||||
* DOC: ION_IOC_IMPORT - imports a shared file descriptor
|
||||
*
|
||||
* Takes an ion_fd_data struct with the fd field populated with a valid file
|
||||
* descriptor obtained from ION_IOC_SHARE and returns the struct with the handle
|
||||
* filed set to the corresponding opaque handle.
|
||||
*/
|
||||
#define ION_IOC_IMPORT _IOWR(ION_IOC_MAGIC, 5, int)
|
||||
|
||||
/**
|
||||
* DOC: ION_IOC_CUSTOM - call architecture specific ion ioctl
|
||||
*
|
||||
* Takes the argument of the architecture specific ioctl to call and
|
||||
* passes appropriate userdata for that ioctl
|
||||
*/
|
||||
#define ION_IOC_CUSTOM _IOWR(ION_IOC_MAGIC, 6, struct ion_custom_data)
|
||||
|
||||
|
||||
/**
|
||||
* DOC: ION_IOC_CLEAN_CACHES - clean the caches
|
||||
*
|
||||
* Clean the caches of the handle specified.
|
||||
*/
|
||||
#define ION_IOC_CLEAN_CACHES _IOWR(ION_IOC_MAGIC, 7, \
|
||||
struct ion_flush_data)
|
||||
/**
|
||||
* DOC: ION_MSM_IOC_INV_CACHES - invalidate the caches
|
||||
*
|
||||
* Invalidate the caches of the handle specified.
|
||||
*/
|
||||
#define ION_IOC_INV_CACHES _IOWR(ION_IOC_MAGIC, 8, \
|
||||
struct ion_flush_data)
|
||||
/**
|
||||
* DOC: ION_MSM_IOC_CLEAN_CACHES - clean and invalidate the caches
|
||||
*
|
||||
* Clean and invalidate the caches of the handle specified.
|
||||
*/
|
||||
#define ION_IOC_CLEAN_INV_CACHES _IOWR(ION_IOC_MAGIC, 9, \
|
||||
struct ion_flush_data)
|
||||
|
||||
/**
|
||||
* DOC: ION_IOC_GET_FLAGS - get the flags of the handle
|
||||
*
|
||||
* Gets the flags of the current handle which indicate cachability,
|
||||
* secure state etc.
|
||||
*/
|
||||
#define ION_IOC_GET_FLAGS _IOWR(ION_IOC_MAGIC, 10, \
|
||||
struct ion_flag_data)
|
||||
#endif /* _LINUX_ION_H */
|
||||
329
include/linux/msm_audio_7x30.h
Normal file
329
include/linux/msm_audio_7x30.h
Normal file
@@ -0,0 +1,329 @@
|
||||
/* include/linux/msm_audio.h
|
||||
*
|
||||
* Copyright (C) 2008 Google, Inc.
|
||||
* Copyright (c) 2009, Code Aurora Forum. All rights reserved.
|
||||
*
|
||||
* This software is licensed under the terms of the GNU General Public
|
||||
* License version 2, as published by the Free Software Foundation, and
|
||||
* may be copied, distributed, and modified under those terms.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __LINUX_MSM_AUDIO_H
|
||||
#define __LINUX_MSM_AUDIO_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/ioctl.h>
|
||||
#include <asm/sizes.h>
|
||||
|
||||
/* PCM Audio */
|
||||
|
||||
#define AUDIO_IOCTL_MAGIC 'a'
|
||||
|
||||
#define AUDIO_START _IOW(AUDIO_IOCTL_MAGIC, 0, unsigned)
|
||||
#define AUDIO_STOP _IOW(AUDIO_IOCTL_MAGIC, 1, unsigned)
|
||||
#define AUDIO_FLUSH _IOW(AUDIO_IOCTL_MAGIC, 2, unsigned)
|
||||
#define AUDIO_GET_CONFIG _IOR(AUDIO_IOCTL_MAGIC, 3, unsigned)
|
||||
#define AUDIO_SET_CONFIG _IOW(AUDIO_IOCTL_MAGIC, 4, unsigned)
|
||||
#define AUDIO_GET_STATS _IOR(AUDIO_IOCTL_MAGIC, 5, unsigned)
|
||||
#define AUDIO_ENABLE_AUDPP _IOW(AUDIO_IOCTL_MAGIC, 6, unsigned)
|
||||
#define AUDIO_SET_ADRC _IOW(AUDIO_IOCTL_MAGIC, 7, unsigned)
|
||||
#define AUDIO_SET_EQ _IOW(AUDIO_IOCTL_MAGIC, 8, unsigned)
|
||||
#define AUDIO_SET_RX_IIR _IOW(AUDIO_IOCTL_MAGIC, 9, unsigned)
|
||||
#define AUDIO_SET_VOLUME _IOW(AUDIO_IOCTL_MAGIC, 10, unsigned)
|
||||
#define AUDIO_PAUSE _IOW(AUDIO_IOCTL_MAGIC, 11, unsigned)
|
||||
#define AUDIO_PLAY_DTMF _IOW(AUDIO_IOCTL_MAGIC, 12, unsigned)
|
||||
#define AUDIO_GET_EVENT _IOR(AUDIO_IOCTL_MAGIC, 13, unsigned)
|
||||
#define AUDIO_ABORT_GET_EVENT _IOW(AUDIO_IOCTL_MAGIC, 14, unsigned)
|
||||
#define AUDIO_REGISTER_PMEM _IOW(AUDIO_IOCTL_MAGIC, 15, unsigned)
|
||||
#define AUDIO_DEREGISTER_PMEM _IOW(AUDIO_IOCTL_MAGIC, 16, unsigned)
|
||||
#define AUDIO_ASYNC_WRITE _IOW(AUDIO_IOCTL_MAGIC, 17, unsigned)
|
||||
#define AUDIO_ASYNC_READ _IOW(AUDIO_IOCTL_MAGIC, 18, unsigned)
|
||||
#define AUDIO_SET_INCALL _IOW(AUDIO_IOCTL_MAGIC, 19, struct msm_voicerec_mode)
|
||||
#define AUDIO_GET_NUM_SND_DEVICE _IOR(AUDIO_IOCTL_MAGIC, 20, unsigned)
|
||||
#define AUDIO_GET_SND_DEVICES _IOWR(AUDIO_IOCTL_MAGIC, 21, \
|
||||
struct msm_snd_device_list)
|
||||
#define AUDIO_ENABLE_SND_DEVICE _IOW(AUDIO_IOCTL_MAGIC, 22, unsigned)
|
||||
#define AUDIO_DISABLE_SND_DEVICE _IOW(AUDIO_IOCTL_MAGIC, 23, unsigned)
|
||||
#define AUDIO_ROUTE_STREAM _IOW(AUDIO_IOCTL_MAGIC, 24, \
|
||||
struct msm_audio_route_config)
|
||||
#define AUDIO_GET_PCM_CONFIG _IOR(AUDIO_IOCTL_MAGIC, 30, unsigned)
|
||||
#define AUDIO_SET_PCM_CONFIG _IOW(AUDIO_IOCTL_MAGIC, 31, unsigned)
|
||||
#define AUDIO_SWITCH_DEVICE _IOW(AUDIO_IOCTL_MAGIC, 32, unsigned)
|
||||
#define AUDIO_SET_MUTE _IOW(AUDIO_IOCTL_MAGIC, 33, unsigned)
|
||||
#define AUDIO_UPDATE_ACDB _IOW(AUDIO_IOCTL_MAGIC, 34, unsigned)
|
||||
#define AUDIO_START_VOICE _IOW(AUDIO_IOCTL_MAGIC, 35, unsigned)
|
||||
#define AUDIO_STOP_VOICE _IOW(AUDIO_IOCTL_MAGIC, 36, unsigned)
|
||||
#define AUDIO_REINIT_ACDB _IOW(AUDIO_IOCTL_MAGIC, 39, unsigned)
|
||||
#define AUDIO_OUTPORT_FLUSH _IOW(AUDIO_IOCTL_MAGIC, 40, unsigned short)
|
||||
#define AUDIO_SET_ERR_THRESHOLD_VALUE _IOW(AUDIO_IOCTL_MAGIC, 41, \
|
||||
unsigned short)
|
||||
#define AUDIO_GET_BITSTREAM_ERROR_INFO _IOR(AUDIO_IOCTL_MAGIC, 42, \
|
||||
struct msm_audio_bitstream_error_info)
|
||||
/* Qualcomm extensions */
|
||||
#define AUDIO_SET_STREAM_CONFIG _IOW(AUDIO_IOCTL_MAGIC, 80, \
|
||||
struct msm_audio_stream_config)
|
||||
#define AUDIO_GET_STREAM_CONFIG _IOR(AUDIO_IOCTL_MAGIC, 81, \
|
||||
struct msm_audio_stream_config)
|
||||
#define AUDIO_GET_SESSION_ID _IOR(AUDIO_IOCTL_MAGIC, 82, unsigned short)
|
||||
#define AUDIO_GET_STREAM_INFO _IOR(AUDIO_IOCTL_MAGIC, 83, \
|
||||
struct msm_audio_bitstream_info)
|
||||
#define AUDIO_SET_PAN _IOW(AUDIO_IOCTL_MAGIC, 84, unsigned)
|
||||
#define AUDIO_SET_QCONCERT_PLUS _IOW(AUDIO_IOCTL_MAGIC, 85, unsigned)
|
||||
#define AUDIO_SET_MBADRC _IOW(AUDIO_IOCTL_MAGIC, 86, unsigned)
|
||||
#define AUDIO_SET_VOLUME_PATH _IOW(AUDIO_IOCTL_MAGIC, 87, \
|
||||
struct msm_vol_info)
|
||||
#define AUDIO_SET_MAX_VOL_ALL _IOW(AUDIO_IOCTL_MAGIC, 88, unsigned)
|
||||
#define AUDIO_ENABLE_AUDPRE _IOW(AUDIO_IOCTL_MAGIC, 89, unsigned)
|
||||
#define AUDIO_SET_AGC _IOW(AUDIO_IOCTL_MAGIC, 90, unsigned)
|
||||
#define AUDIO_SET_NS _IOW(AUDIO_IOCTL_MAGIC, 91, unsigned)
|
||||
#define AUDIO_SET_TX_IIR _IOW(AUDIO_IOCTL_MAGIC, 92, unsigned)
|
||||
|
||||
#define AUDIO_MAX_COMMON_IOCTL_NUM 100
|
||||
|
||||
|
||||
#define HANDSET_MIC 0x01
|
||||
#define HANDSET_SPKR 0x02
|
||||
#define HEADSET_MIC 0x03
|
||||
#define HEADSET_SPKR_MONO 0x04
|
||||
#define HEADSET_SPKR_STEREO 0x05
|
||||
#define SPKR_PHONE_MIC 0x06
|
||||
#define SPKR_PHONE_MONO 0x07
|
||||
#define SPKR_PHONE_STEREO 0x08
|
||||
#define BT_SCO_MIC 0x09
|
||||
#define BT_SCO_SPKR 0x0A
|
||||
#define BT_A2DP_SPKR 0x0B
|
||||
#define TTY_HEADSET_MIC 0x0C
|
||||
#define TTY_HEADSET_SPKR 0x0D
|
||||
|
||||
/* Default devices are not supported in a */
|
||||
/* device switching context. Only supported */
|
||||
/* for stream devices. */
|
||||
/* DO NOT USE */
|
||||
#define DEFAULT_TX 0x0E
|
||||
#define DEFAULT_RX 0x0F
|
||||
|
||||
#define BT_A2DP_TX 0x10
|
||||
|
||||
#define HEADSET_MONO_PLUS_SPKR_MONO_RX 0x11
|
||||
#define HEADSET_MONO_PLUS_SPKR_STEREO_RX 0x12
|
||||
#define HEADSET_STEREO_PLUS_SPKR_MONO_RX 0x13
|
||||
#define HEADSET_STEREO_PLUS_SPKR_STEREO_RX 0x14
|
||||
|
||||
#define I2S_RX 0x20
|
||||
#define I2S_TX 0x21
|
||||
|
||||
#define ADRC_ENABLE 0x0001
|
||||
#define EQ_ENABLE 0x0002
|
||||
#define IIR_ENABLE 0x0004
|
||||
#define QCONCERT_PLUS_ENABLE 0x0008
|
||||
#define MBADRC_ENABLE 0x0010
|
||||
|
||||
#define AGC_ENABLE 0x0001
|
||||
#define NS_ENABLE 0x0002
|
||||
#define TX_IIR_ENABLE 0x0004
|
||||
|
||||
#define VOC_REC_UPLINK 0x00
|
||||
#define VOC_REC_DOWNLINK 0x01
|
||||
#define VOC_REC_BOTH 0x02
|
||||
|
||||
struct msm_audio_config {
|
||||
uint32_t buffer_size;
|
||||
uint32_t buffer_count;
|
||||
uint32_t channel_count;
|
||||
uint32_t sample_rate;
|
||||
uint32_t type;
|
||||
uint32_t meta_field;
|
||||
uint32_t bits;
|
||||
uint32_t unused[3];
|
||||
};
|
||||
|
||||
struct msm_audio_stream_config {
|
||||
uint32_t buffer_size;
|
||||
uint32_t buffer_count;
|
||||
};
|
||||
|
||||
struct msm_audio_stats {
|
||||
uint32_t byte_count;
|
||||
uint32_t sample_count;
|
||||
uint32_t unused[2];
|
||||
};
|
||||
|
||||
struct msm_audio_pmem_info {
|
||||
int fd;
|
||||
void *vaddr;
|
||||
};
|
||||
|
||||
struct msm_audio_aio_buf {
|
||||
void *buf_addr;
|
||||
uint32_t buf_len;
|
||||
uint32_t data_len;
|
||||
void *private_data;
|
||||
unsigned short mfield_sz; /*only useful for data has meta field */
|
||||
};
|
||||
|
||||
/* Audio routing */
|
||||
|
||||
#define SND_IOCTL_MAGIC 's'
|
||||
|
||||
#define SND_MUTE_UNMUTED 0
|
||||
#define SND_MUTE_MUTED 1
|
||||
|
||||
struct msm_mute_info {
|
||||
uint32_t mute;
|
||||
uint32_t path;
|
||||
};
|
||||
|
||||
struct msm_vol_info {
|
||||
uint32_t vol;
|
||||
uint32_t path;
|
||||
};
|
||||
|
||||
struct msm_voicerec_mode {
|
||||
uint32_t rec_mode;
|
||||
};
|
||||
|
||||
struct msm_snd_device_config {
|
||||
uint32_t device;
|
||||
uint32_t ear_mute;
|
||||
uint32_t mic_mute;
|
||||
};
|
||||
|
||||
#define SND_SET_DEVICE _IOW(SND_IOCTL_MAGIC, 2, struct msm_device_config *)
|
||||
|
||||
#define SND_METHOD_VOICE 0
|
||||
|
||||
struct msm_snd_volume_config {
|
||||
uint32_t device;
|
||||
uint32_t method;
|
||||
uint32_t volume;
|
||||
};
|
||||
|
||||
#define SND_SET_VOLUME _IOW(SND_IOCTL_MAGIC, 3, struct msm_snd_volume_config *)
|
||||
|
||||
/* Returns the number of SND endpoints supported. */
|
||||
|
||||
#define SND_GET_NUM_ENDPOINTS _IOR(SND_IOCTL_MAGIC, 4, unsigned *)
|
||||
|
||||
struct msm_snd_endpoint {
|
||||
int id; /* input and output */
|
||||
char name[64]; /* output only */
|
||||
};
|
||||
|
||||
/* Takes an index between 0 and one less than the number returned by
|
||||
* SND_GET_NUM_ENDPOINTS, and returns the SND index and name of a
|
||||
* SND endpoint. On input, the .id field contains the number of the
|
||||
* endpoint, and on exit it contains the SND index, while .name contains
|
||||
* the description of the endpoint.
|
||||
*/
|
||||
|
||||
#define SND_GET_ENDPOINT _IOWR(SND_IOCTL_MAGIC, 5, struct msm_snd_endpoint *)
|
||||
|
||||
|
||||
#define SND_AVC_CTL _IOW(SND_IOCTL_MAGIC, 6, unsigned *)
|
||||
#define SND_AGC_CTL _IOW(SND_IOCTL_MAGIC, 7, unsigned *)
|
||||
|
||||
struct msm_audio_pcm_config {
|
||||
uint32_t pcm_feedback; /* 0 - disable > 0 - enable */
|
||||
uint32_t buffer_count; /* Number of buffers to allocate */
|
||||
uint32_t buffer_size; /* Size of buffer for capturing of
|
||||
PCM samples */
|
||||
};
|
||||
|
||||
#define AUDIO_EVENT_SUSPEND 0
|
||||
#define AUDIO_EVENT_RESUME 1
|
||||
#define AUDIO_EVENT_WRITE_DONE 2
|
||||
#define AUDIO_EVENT_READ_DONE 3
|
||||
#define AUDIO_EVENT_STREAM_INFO 4
|
||||
#define AUDIO_EVENT_BITSTREAM_ERROR_INFO 5
|
||||
|
||||
#define AUDIO_CODEC_TYPE_MP3 0
|
||||
#define AUDIO_CODEC_TYPE_AAC 1
|
||||
|
||||
struct msm_audio_bitstream_info {
|
||||
uint32_t codec_type;
|
||||
uint32_t chan_info;
|
||||
uint32_t sample_rate;
|
||||
uint32_t bit_stream_info;
|
||||
uint32_t bit_rate;
|
||||
uint32_t unused[3];
|
||||
};
|
||||
|
||||
struct msm_audio_bitstream_error_info {
|
||||
uint32_t dec_id;
|
||||
uint32_t err_msg_indicator;
|
||||
uint32_t err_type;
|
||||
};
|
||||
|
||||
union msm_audio_event_payload {
|
||||
struct msm_audio_aio_buf aio_buf;
|
||||
struct msm_audio_bitstream_info stream_info;
|
||||
struct msm_audio_bitstream_error_info error_info;
|
||||
int reserved;
|
||||
};
|
||||
|
||||
struct msm_audio_event {
|
||||
int event_type;
|
||||
int timeout_ms;
|
||||
union msm_audio_event_payload event_payload;
|
||||
};
|
||||
|
||||
#define MSM_SNDDEV_CAP_RX 0x1
|
||||
#define MSM_SNDDEV_CAP_TX 0x2
|
||||
#define MSM_SNDDEV_CAP_VOICE 0x4
|
||||
|
||||
struct msm_snd_device_info {
|
||||
uint32_t dev_id;
|
||||
uint32_t dev_cap; /* bitmask describe capability of device */
|
||||
char dev_name[64];
|
||||
};
|
||||
|
||||
struct msm_snd_device_list {
|
||||
uint32_t num_dev; /* Indicate number of device info to be retrieved */
|
||||
struct msm_snd_device_info *list;
|
||||
};
|
||||
|
||||
struct msm_dtmf_config {
|
||||
uint16_t path;
|
||||
uint16_t dtmf_hi;
|
||||
uint16_t dtmf_low;
|
||||
uint16_t duration;
|
||||
uint16_t tx_gain;
|
||||
uint16_t rx_gain;
|
||||
uint16_t mixing;
|
||||
};
|
||||
|
||||
#define AUDIO_ROUTE_STREAM_VOICE_RX 0
|
||||
#define AUDIO_ROUTE_STREAM_VOICE_TX 1
|
||||
#define AUDIO_ROUTE_STREAM_PLAYBACK 2
|
||||
#define AUDIO_ROUTE_STREAM_REC 3
|
||||
|
||||
struct msm_audio_route_config {
|
||||
uint32_t stream_type;
|
||||
uint32_t stream_id;
|
||||
uint32_t dev_id;
|
||||
};
|
||||
|
||||
#define AUDIO_MAX_EQ_BANDS 12
|
||||
|
||||
struct msm_audio_eq_band {
|
||||
uint16_t band_idx; /* The band index, 0 .. 11 */
|
||||
uint32_t filter_type; /* Filter band type */
|
||||
uint32_t center_freq_hz; /* Filter band center frequency */
|
||||
uint32_t filter_gain; /* Filter band initial gain (dB) */
|
||||
/* Range is +12 dB to -12 dB with 1dB increments. */
|
||||
uint32_t q_factor;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct msm_audio_eq_stream_config {
|
||||
uint32_t enable; /* Number of consequtive bands specified */
|
||||
uint32_t num_bands;
|
||||
struct msm_audio_eq_band eq_bands[AUDIO_MAX_EQ_BANDS];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
#endif
|
||||
78
include/linux/msm_audio_aac.h
Normal file
78
include/linux/msm_audio_aac.h
Normal file
@@ -0,0 +1,78 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef __MSM_AUDIO_AAC_H
|
||||
#define __MSM_AUDIO_AAC_H
|
||||
|
||||
#include <linux/msm_audio.h>
|
||||
|
||||
#define AUDIO_SET_AAC_CONFIG _IOW(AUDIO_IOCTL_MAGIC, (AUDIO_MAX_COMMON_IOCTL_NUM+0), unsigned)
|
||||
#define AUDIO_GET_AAC_CONFIG _IOR(AUDIO_IOCTL_MAGIC, (AUDIO_MAX_COMMON_IOCTL_NUM+1), unsigned)
|
||||
|
||||
#define AUDIO_SET_AAC_ENC_CONFIG _IOW(AUDIO_IOCTL_MAGIC, (AUDIO_MAX_COMMON_IOCTL_NUM+3), struct msm_audio_aac_enc_config)
|
||||
|
||||
#define AUDIO_GET_AAC_ENC_CONFIG _IOR(AUDIO_IOCTL_MAGIC, (AUDIO_MAX_COMMON_IOCTL_NUM+4), struct msm_audio_aac_enc_config)
|
||||
|
||||
#define AUDIO_AAC_FORMAT_ADTS -1
|
||||
#define AUDIO_AAC_FORMAT_RAW 0x0000
|
||||
#define AUDIO_AAC_FORMAT_PSUEDO_RAW 0x0001
|
||||
#define AUDIO_AAC_FORMAT_LOAS 0x0002
|
||||
|
||||
#define AUDIO_AAC_OBJECT_LC 0x0002
|
||||
#define AUDIO_AAC_OBJECT_LTP 0x0004
|
||||
#define AUDIO_AAC_OBJECT_ERLC 0x0011
|
||||
#define AUDIO_AAC_OBJECT_BSAC 0x0016
|
||||
|
||||
#define AUDIO_AAC_SEC_DATA_RES_ON 0x0001
|
||||
#define AUDIO_AAC_SEC_DATA_RES_OFF 0x0000
|
||||
|
||||
#define AUDIO_AAC_SCA_DATA_RES_ON 0x0001
|
||||
#define AUDIO_AAC_SCA_DATA_RES_OFF 0x0000
|
||||
|
||||
#define AUDIO_AAC_SPEC_DATA_RES_ON 0x0001
|
||||
#define AUDIO_AAC_SPEC_DATA_RES_OFF 0x0000
|
||||
|
||||
#define AUDIO_AAC_SBR_ON_FLAG_ON 0x0001
|
||||
#define AUDIO_AAC_SBR_ON_FLAG_OFF 0x0000
|
||||
|
||||
#define AUDIO_AAC_SBR_PS_ON_FLAG_ON 0x0001
|
||||
#define AUDIO_AAC_SBR_PS_ON_FLAG_OFF 0x0000
|
||||
|
||||
#define AUDIO_AAC_DUAL_MONO_PL_PR 0
|
||||
|
||||
#define AUDIO_AAC_DUAL_MONO_SL_SR 1
|
||||
|
||||
#define AUDIO_AAC_DUAL_MONO_SL_PR 2
|
||||
|
||||
#define AUDIO_AAC_DUAL_MONO_PL_SR 3
|
||||
|
||||
struct msm_audio_aac_config {
|
||||
signed short format;
|
||||
unsigned short audio_object;
|
||||
unsigned short ep_config;
|
||||
unsigned short aac_section_data_resilience_flag;
|
||||
unsigned short aac_scalefactor_data_resilience_flag;
|
||||
unsigned short aac_spectral_data_resilience_flag;
|
||||
unsigned short sbr_on_flag;
|
||||
unsigned short sbr_ps_on_flag;
|
||||
unsigned short dual_mono_mode;
|
||||
unsigned short channel_configuration;
|
||||
};
|
||||
|
||||
struct msm_audio_aac_enc_config {
|
||||
uint32_t channels;
|
||||
uint32_t sample_rate;
|
||||
uint32_t bit_rate;
|
||||
uint32_t stream_format;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
455
include/linux/msm_kgsl.h
Normal file
455
include/linux/msm_kgsl.h
Normal file
@@ -0,0 +1,455 @@
|
||||
#ifndef _MSM_KGSL_H
|
||||
#define _MSM_KGSL_H
|
||||
|
||||
#define KGSL_VERSION_MAJOR 3
|
||||
#define KGSL_VERSION_MINOR 8
|
||||
|
||||
/*context flags */
|
||||
#define KGSL_CONTEXT_SAVE_GMEM 1
|
||||
#define KGSL_CONTEXT_NO_GMEM_ALLOC 2
|
||||
#define KGSL_CONTEXT_SUBMIT_IB_LIST 4
|
||||
#define KGSL_CONTEXT_CTX_SWITCH 8
|
||||
|
||||
/* Memory allocayion flags */
|
||||
#define KGSL_MEMFLAGS_GPUREADONLY 0x01000000
|
||||
|
||||
/* generic flag values */
|
||||
#define KGSL_FLAGS_NORMALMODE 0x00000000
|
||||
#define KGSL_FLAGS_SAFEMODE 0x00000001
|
||||
#define KGSL_FLAGS_INITIALIZED0 0x00000002
|
||||
#define KGSL_FLAGS_INITIALIZED 0x00000004
|
||||
#define KGSL_FLAGS_STARTED 0x00000008
|
||||
#define KGSL_FLAGS_ACTIVE 0x00000010
|
||||
#define KGSL_FLAGS_RESERVED0 0x00000020
|
||||
#define KGSL_FLAGS_RESERVED1 0x00000040
|
||||
#define KGSL_FLAGS_RESERVED2 0x00000080
|
||||
#define KGSL_FLAGS_SOFT_RESET 0x00000100
|
||||
|
||||
/* Clock flags to show which clocks should be controled by a given platform */
|
||||
#define KGSL_CLK_SRC 0x00000001
|
||||
#define KGSL_CLK_CORE 0x00000002
|
||||
#define KGSL_CLK_IFACE 0x00000004
|
||||
#define KGSL_CLK_MEM 0x00000008
|
||||
#define KGSL_CLK_MEM_IFACE 0x00000010
|
||||
#define KGSL_CLK_AXI 0x00000020
|
||||
|
||||
#define KGSL_MAX_PWRLEVELS 5
|
||||
|
||||
#define KGSL_CONVERT_TO_MBPS(val) \
|
||||
(val*1000*1000U)
|
||||
|
||||
/* device id */
|
||||
enum kgsl_deviceid {
|
||||
KGSL_DEVICE_3D0 = 0x00000000,
|
||||
KGSL_DEVICE_2D0 = 0x00000001,
|
||||
KGSL_DEVICE_2D1 = 0x00000002,
|
||||
KGSL_DEVICE_MAX = 0x00000003
|
||||
};
|
||||
|
||||
enum kgsl_user_mem_type {
|
||||
KGSL_USER_MEM_TYPE_PMEM = 0x00000000,
|
||||
KGSL_USER_MEM_TYPE_ASHMEM = 0x00000001,
|
||||
KGSL_USER_MEM_TYPE_ADDR = 0x00000002,
|
||||
KGSL_USER_MEM_TYPE_ION = 0x00000003,
|
||||
};
|
||||
|
||||
struct kgsl_devinfo {
|
||||
|
||||
unsigned int device_id;
|
||||
/* chip revision id
|
||||
* coreid:8 majorrev:8 minorrev:8 patch:8
|
||||
*/
|
||||
unsigned int chip_id;
|
||||
unsigned int mmu_enabled;
|
||||
unsigned int gmem_gpubaseaddr;
|
||||
/*
|
||||
* This field contains the adreno revision
|
||||
* number 200, 205, 220, etc...
|
||||
*/
|
||||
unsigned int gpu_id;
|
||||
unsigned int gmem_sizebytes;
|
||||
};
|
||||
|
||||
/* this structure defines the region of memory that can be mmap()ed from this
|
||||
driver. The timestamp fields are volatile because they are written by the
|
||||
GPU
|
||||
*/
|
||||
struct kgsl_devmemstore {
|
||||
volatile unsigned int soptimestamp;
|
||||
unsigned int sbz;
|
||||
volatile unsigned int eoptimestamp;
|
||||
unsigned int sbz2;
|
||||
volatile unsigned int ts_cmp_enable;
|
||||
unsigned int sbz3;
|
||||
volatile unsigned int ref_wait_ts;
|
||||
unsigned int sbz4;
|
||||
unsigned int current_context;
|
||||
unsigned int sbz5;
|
||||
};
|
||||
|
||||
#define KGSL_DEVICE_MEMSTORE_OFFSET(field) \
|
||||
offsetof(struct kgsl_devmemstore, field)
|
||||
|
||||
|
||||
/* timestamp id*/
|
||||
enum kgsl_timestamp_type {
|
||||
KGSL_TIMESTAMP_CONSUMED = 0x00000001, /* start-of-pipeline timestamp */
|
||||
KGSL_TIMESTAMP_RETIRED = 0x00000002, /* end-of-pipeline timestamp*/
|
||||
KGSL_TIMESTAMP_MAX = 0x00000002,
|
||||
};
|
||||
|
||||
/* property types - used with kgsl_device_getproperty */
|
||||
enum kgsl_property_type {
|
||||
KGSL_PROP_DEVICE_INFO = 0x00000001,
|
||||
KGSL_PROP_DEVICE_SHADOW = 0x00000002,
|
||||
KGSL_PROP_DEVICE_POWER = 0x00000003,
|
||||
KGSL_PROP_SHMEM = 0x00000004,
|
||||
KGSL_PROP_SHMEM_APERTURES = 0x00000005,
|
||||
KGSL_PROP_MMU_ENABLE = 0x00000006,
|
||||
KGSL_PROP_INTERRUPT_WAITS = 0x00000007,
|
||||
KGSL_PROP_VERSION = 0x00000008,
|
||||
};
|
||||
|
||||
struct kgsl_shadowprop {
|
||||
unsigned int gpuaddr;
|
||||
unsigned int size;
|
||||
unsigned int flags; /* contains KGSL_FLAGS_ values */
|
||||
};
|
||||
|
||||
struct kgsl_pwrlevel {
|
||||
unsigned int gpu_freq;
|
||||
unsigned int bus_freq;
|
||||
unsigned int io_fraction;
|
||||
};
|
||||
|
||||
struct kgsl_version {
|
||||
unsigned int drv_major;
|
||||
unsigned int drv_minor;
|
||||
unsigned int dev_major;
|
||||
unsigned int dev_minor;
|
||||
};
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#define KGSL_3D0_REG_MEMORY "kgsl_3d0_reg_memory"
|
||||
#define KGSL_3D0_IRQ "kgsl_3d0_irq"
|
||||
#define KGSL_2D0_REG_MEMORY "kgsl_2d0_reg_memory"
|
||||
#define KGSL_2D0_IRQ "kgsl_2d0_irq"
|
||||
#define KGSL_2D1_REG_MEMORY "kgsl_2d1_reg_memory"
|
||||
#define KGSL_2D1_IRQ "kgsl_2d1_irq"
|
||||
|
||||
struct kgsl_device_platform_data {
|
||||
struct kgsl_pwrlevel pwrlevel[KGSL_MAX_PWRLEVELS];
|
||||
int init_level;
|
||||
int num_levels;
|
||||
int (*set_grp_async)(void);
|
||||
unsigned int idle_timeout;
|
||||
unsigned int nap_allowed;
|
||||
unsigned int clk_map;
|
||||
struct msm_bus_scale_pdata *bus_scale_table;
|
||||
const char *iommu_user_ctx_name;
|
||||
const char *iommu_priv_ctx_name;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
/* structure holds list of ibs */
|
||||
struct kgsl_ibdesc {
|
||||
unsigned int gpuaddr;
|
||||
void *hostptr;
|
||||
unsigned int sizedwords;
|
||||
unsigned int ctrl;
|
||||
};
|
||||
|
||||
/* ioctls */
|
||||
#define KGSL_IOC_TYPE 0x09
|
||||
|
||||
/* get misc info about the GPU
|
||||
type should be a value from enum kgsl_property_type
|
||||
value points to a structure that varies based on type
|
||||
sizebytes is sizeof() that structure
|
||||
for KGSL_PROP_DEVICE_INFO, use struct kgsl_devinfo
|
||||
this structure contaings hardware versioning info.
|
||||
for KGSL_PROP_DEVICE_SHADOW, use struct kgsl_shadowprop
|
||||
this is used to find mmap() offset and sizes for mapping
|
||||
struct kgsl_memstore into userspace.
|
||||
*/
|
||||
struct kgsl_device_getproperty {
|
||||
unsigned int type;
|
||||
void *value;
|
||||
unsigned int sizebytes;
|
||||
};
|
||||
|
||||
#define IOCTL_KGSL_DEVICE_GETPROPERTY \
|
||||
_IOWR(KGSL_IOC_TYPE, 0x2, struct kgsl_device_getproperty)
|
||||
|
||||
|
||||
/* read a GPU register.
|
||||
offsetwords it the 32 bit word offset from the beginning of the
|
||||
GPU register space.
|
||||
*/
|
||||
struct kgsl_device_regread {
|
||||
unsigned int offsetwords;
|
||||
unsigned int value; /* output param */
|
||||
};
|
||||
|
||||
#define IOCTL_KGSL_DEVICE_REGREAD \
|
||||
_IOWR(KGSL_IOC_TYPE, 0x3, struct kgsl_device_regread)
|
||||
|
||||
|
||||
/* block until the GPU has executed past a given timestamp
|
||||
* timeout is in milliseconds.
|
||||
*/
|
||||
struct kgsl_device_waittimestamp {
|
||||
unsigned int timestamp;
|
||||
unsigned int timeout;
|
||||
};
|
||||
|
||||
#define IOCTL_KGSL_DEVICE_WAITTIMESTAMP \
|
||||
_IOW(KGSL_IOC_TYPE, 0x6, struct kgsl_device_waittimestamp)
|
||||
|
||||
|
||||
/* issue indirect commands to the GPU.
|
||||
* drawctxt_id must have been created with IOCTL_KGSL_DRAWCTXT_CREATE
|
||||
* ibaddr and sizedwords must specify a subset of a buffer created
|
||||
* with IOCTL_KGSL_SHAREDMEM_FROM_PMEM
|
||||
* flags may be a mask of KGSL_CONTEXT_ values
|
||||
* timestamp is a returned counter value which can be passed to
|
||||
* other ioctls to determine when the commands have been executed by
|
||||
* the GPU.
|
||||
*/
|
||||
struct kgsl_ringbuffer_issueibcmds {
|
||||
unsigned int drawctxt_id;
|
||||
unsigned int ibdesc_addr;
|
||||
unsigned int numibs;
|
||||
unsigned int timestamp; /*output param */
|
||||
unsigned int flags;
|
||||
};
|
||||
|
||||
#define IOCTL_KGSL_RINGBUFFER_ISSUEIBCMDS \
|
||||
_IOWR(KGSL_IOC_TYPE, 0x10, struct kgsl_ringbuffer_issueibcmds)
|
||||
|
||||
/* read the most recently executed timestamp value
|
||||
* type should be a value from enum kgsl_timestamp_type
|
||||
*/
|
||||
struct kgsl_cmdstream_readtimestamp {
|
||||
unsigned int type;
|
||||
unsigned int timestamp; /*output param */
|
||||
};
|
||||
|
||||
#define IOCTL_KGSL_CMDSTREAM_READTIMESTAMP_OLD \
|
||||
_IOR(KGSL_IOC_TYPE, 0x11, struct kgsl_cmdstream_readtimestamp)
|
||||
|
||||
#define IOCTL_KGSL_CMDSTREAM_READTIMESTAMP \
|
||||
_IOWR(KGSL_IOC_TYPE, 0x11, struct kgsl_cmdstream_readtimestamp)
|
||||
|
||||
/* free memory when the GPU reaches a given timestamp.
|
||||
* gpuaddr specify a memory region created by a
|
||||
* IOCTL_KGSL_SHAREDMEM_FROM_PMEM call
|
||||
* type should be a value from enum kgsl_timestamp_type
|
||||
*/
|
||||
struct kgsl_cmdstream_freememontimestamp {
|
||||
unsigned int gpuaddr;
|
||||
unsigned int type;
|
||||
unsigned int timestamp;
|
||||
};
|
||||
|
||||
#define IOCTL_KGSL_CMDSTREAM_FREEMEMONTIMESTAMP \
|
||||
_IOW(KGSL_IOC_TYPE, 0x12, struct kgsl_cmdstream_freememontimestamp)
|
||||
|
||||
/* Previous versions of this header had incorrectly defined
|
||||
IOCTL_KGSL_CMDSTREAM_FREEMEMONTIMESTAMP as a read-only ioctl instead
|
||||
of a write only ioctl. To ensure binary compatability, the following
|
||||
#define will be used to intercept the incorrect ioctl
|
||||
*/
|
||||
|
||||
#define IOCTL_KGSL_CMDSTREAM_FREEMEMONTIMESTAMP_OLD \
|
||||
_IOR(KGSL_IOC_TYPE, 0x12, struct kgsl_cmdstream_freememontimestamp)
|
||||
|
||||
/* create a draw context, which is used to preserve GPU state.
|
||||
* The flags field may contain a mask KGSL_CONTEXT_* values
|
||||
*/
|
||||
struct kgsl_drawctxt_create {
|
||||
unsigned int flags;
|
||||
unsigned int drawctxt_id; /*output param */
|
||||
};
|
||||
|
||||
#define IOCTL_KGSL_DRAWCTXT_CREATE \
|
||||
_IOWR(KGSL_IOC_TYPE, 0x13, struct kgsl_drawctxt_create)
|
||||
|
||||
/* destroy a draw context */
|
||||
struct kgsl_drawctxt_destroy {
|
||||
unsigned int drawctxt_id;
|
||||
};
|
||||
|
||||
#define IOCTL_KGSL_DRAWCTXT_DESTROY \
|
||||
_IOW(KGSL_IOC_TYPE, 0x14, struct kgsl_drawctxt_destroy)
|
||||
|
||||
/* add a block of pmem, fb, ashmem or user allocated address
|
||||
* into the GPU address space */
|
||||
struct kgsl_map_user_mem {
|
||||
int fd;
|
||||
unsigned int gpuaddr; /*output param */
|
||||
unsigned int len;
|
||||
unsigned int offset;
|
||||
unsigned int hostptr; /*input param */
|
||||
enum kgsl_user_mem_type memtype;
|
||||
unsigned int reserved; /* May be required to add
|
||||
params for another mem type */
|
||||
};
|
||||
|
||||
#define IOCTL_KGSL_MAP_USER_MEM \
|
||||
_IOWR(KGSL_IOC_TYPE, 0x15, struct kgsl_map_user_mem)
|
||||
|
||||
/* add a block of pmem or fb into the GPU address space */
|
||||
struct kgsl_sharedmem_from_pmem {
|
||||
int pmem_fd;
|
||||
unsigned int gpuaddr; /*output param */
|
||||
unsigned int len;
|
||||
unsigned int offset;
|
||||
};
|
||||
|
||||
#define IOCTL_KGSL_SHAREDMEM_FROM_PMEM \
|
||||
_IOWR(KGSL_IOC_TYPE, 0x20, struct kgsl_sharedmem_from_pmem)
|
||||
|
||||
/* remove memory from the GPU's address space */
|
||||
struct kgsl_sharedmem_free {
|
||||
unsigned int gpuaddr;
|
||||
};
|
||||
|
||||
#define IOCTL_KGSL_SHAREDMEM_FREE \
|
||||
_IOW(KGSL_IOC_TYPE, 0x21, struct kgsl_sharedmem_free)
|
||||
|
||||
struct kgsl_cff_user_event {
|
||||
unsigned char cff_opcode;
|
||||
unsigned int op1;
|
||||
unsigned int op2;
|
||||
unsigned int op3;
|
||||
unsigned int op4;
|
||||
unsigned int op5;
|
||||
unsigned int __pad[2];
|
||||
};
|
||||
|
||||
#define IOCTL_KGSL_CFF_USER_EVENT \
|
||||
_IOW(KGSL_IOC_TYPE, 0x31, struct kgsl_cff_user_event)
|
||||
|
||||
struct kgsl_gmem_desc {
|
||||
unsigned int x;
|
||||
unsigned int y;
|
||||
unsigned int width;
|
||||
unsigned int height;
|
||||
unsigned int pitch;
|
||||
};
|
||||
|
||||
struct kgsl_buffer_desc {
|
||||
void *hostptr;
|
||||
unsigned int gpuaddr;
|
||||
int size;
|
||||
unsigned int format;
|
||||
unsigned int pitch;
|
||||
unsigned int enabled;
|
||||
};
|
||||
|
||||
struct kgsl_bind_gmem_shadow {
|
||||
unsigned int drawctxt_id;
|
||||
struct kgsl_gmem_desc gmem_desc;
|
||||
unsigned int shadow_x;
|
||||
unsigned int shadow_y;
|
||||
struct kgsl_buffer_desc shadow_buffer;
|
||||
unsigned int buffer_id;
|
||||
};
|
||||
|
||||
#define IOCTL_KGSL_DRAWCTXT_BIND_GMEM_SHADOW \
|
||||
_IOW(KGSL_IOC_TYPE, 0x22, struct kgsl_bind_gmem_shadow)
|
||||
|
||||
/* add a block of memory into the GPU address space */
|
||||
struct kgsl_sharedmem_from_vmalloc {
|
||||
unsigned int gpuaddr; /*output param */
|
||||
unsigned int hostptr;
|
||||
unsigned int flags;
|
||||
};
|
||||
|
||||
#define IOCTL_KGSL_SHAREDMEM_FROM_VMALLOC \
|
||||
_IOWR(KGSL_IOC_TYPE, 0x23, struct kgsl_sharedmem_from_vmalloc)
|
||||
|
||||
#define IOCTL_KGSL_SHAREDMEM_FLUSH_CACHE \
|
||||
_IOW(KGSL_IOC_TYPE, 0x24, struct kgsl_sharedmem_free)
|
||||
|
||||
struct kgsl_drawctxt_set_bin_base_offset {
|
||||
unsigned int drawctxt_id;
|
||||
unsigned int offset;
|
||||
};
|
||||
|
||||
#define IOCTL_KGSL_DRAWCTXT_SET_BIN_BASE_OFFSET \
|
||||
_IOW(KGSL_IOC_TYPE, 0x25, struct kgsl_drawctxt_set_bin_base_offset)
|
||||
|
||||
enum kgsl_cmdwindow_type {
|
||||
KGSL_CMDWINDOW_MIN = 0x00000000,
|
||||
KGSL_CMDWINDOW_2D = 0x00000000,
|
||||
KGSL_CMDWINDOW_3D = 0x00000001, /* legacy */
|
||||
KGSL_CMDWINDOW_MMU = 0x00000002,
|
||||
KGSL_CMDWINDOW_ARBITER = 0x000000FF,
|
||||
KGSL_CMDWINDOW_MAX = 0x000000FF,
|
||||
};
|
||||
|
||||
/* write to the command window */
|
||||
struct kgsl_cmdwindow_write {
|
||||
enum kgsl_cmdwindow_type target;
|
||||
unsigned int addr;
|
||||
unsigned int data;
|
||||
};
|
||||
|
||||
#define IOCTL_KGSL_CMDWINDOW_WRITE \
|
||||
_IOW(KGSL_IOC_TYPE, 0x2e, struct kgsl_cmdwindow_write)
|
||||
|
||||
struct kgsl_gpumem_alloc {
|
||||
unsigned long gpuaddr;
|
||||
size_t size;
|
||||
unsigned int flags;
|
||||
};
|
||||
|
||||
#define IOCTL_KGSL_GPUMEM_ALLOC \
|
||||
_IOWR(KGSL_IOC_TYPE, 0x2f, struct kgsl_gpumem_alloc)
|
||||
|
||||
struct kgsl_cff_syncmem {
|
||||
unsigned int gpuaddr;
|
||||
unsigned int len;
|
||||
unsigned int __pad[2]; /* For future binary compatibility */
|
||||
};
|
||||
|
||||
#define IOCTL_KGSL_CFF_SYNCMEM \
|
||||
_IOW(KGSL_IOC_TYPE, 0x30, struct kgsl_cff_syncmem)
|
||||
|
||||
/*
|
||||
* A timestamp event allows the user space to register an action following an
|
||||
* expired timestamp.
|
||||
*/
|
||||
|
||||
struct kgsl_timestamp_event {
|
||||
int type; /* Type of event (see list below) */
|
||||
unsigned int timestamp; /* Timestamp to trigger event on */
|
||||
unsigned int context_id; /* Context for the timestamp */
|
||||
void *priv; /* Pointer to the event specific blob */
|
||||
size_t len; /* Size of the event specific blob */
|
||||
};
|
||||
|
||||
#define IOCTL_KGSL_TIMESTAMP_EVENT \
|
||||
_IOW(KGSL_IOC_TYPE, 0x31, struct kgsl_timestamp_event)
|
||||
|
||||
/* A genlock timestamp event releases an existing lock on timestamp expire */
|
||||
|
||||
#define KGSL_TIMESTAMP_EVENT_GENLOCK 1
|
||||
|
||||
struct kgsl_timestamp_event_genlock {
|
||||
int handle; /* Handle of the genlock lock to release */
|
||||
};
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#ifdef CONFIG_MSM_KGSL_DRM
|
||||
int kgsl_gem_obj_addr(int drm_fd, int handle, unsigned long *start,
|
||||
unsigned long *len);
|
||||
#else
|
||||
#define kgsl_gem_obj_addr(...) 0
|
||||
#endif
|
||||
#endif
|
||||
#endif /* _MSM_KGSL_H */
|
||||
341
include/linux/msm_mdp.h
Normal file
341
include/linux/msm_mdp.h
Normal file
@@ -0,0 +1,341 @@
|
||||
/* include/linux/msm_mdp.h
|
||||
*
|
||||
* Copyright (C) 2007 Google Incorporated
|
||||
*
|
||||
* This software is licensed under the terms of the GNU General Public
|
||||
* License version 2, as published by the Free Software Foundation, and
|
||||
* may be copied, distributed, and modified under those terms.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
#ifndef _MSM_MDP_H_
|
||||
#define _MSM_MDP_H_
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/fb.h>
|
||||
|
||||
#define MSMFB_IOCTL_MAGIC 'm'
|
||||
#define MSMFB_GRP_DISP _IOW(MSMFB_IOCTL_MAGIC, 1, unsigned int)
|
||||
#define MSMFB_BLIT _IOW(MSMFB_IOCTL_MAGIC, 2, unsigned int)
|
||||
#define MSMFB_SUSPEND_SW_REFRESHER _IOW(MSMFB_IOCTL_MAGIC, 128, unsigned int)
|
||||
#define MSMFB_RESUME_SW_REFRESHER _IOW(MSMFB_IOCTL_MAGIC, 129, unsigned int)
|
||||
#define MSMFB_CURSOR _IOW(MSMFB_IOCTL_MAGIC, 130, struct fb_cursor)
|
||||
#define MSMFB_SET_LUT _IOW(MSMFB_IOCTL_MAGIC, 131, struct fb_cmap)
|
||||
#define MSMFB_HISTOGRAM _IOWR(MSMFB_IOCTL_MAGIC, 132, struct mdp_histogram)
|
||||
/* new ioctls's for set/get ccs matrix */
|
||||
#define MSMFB_GET_CCS_MATRIX _IOWR(MSMFB_IOCTL_MAGIC, 133, struct mdp_ccs)
|
||||
#define MSMFB_SET_CCS_MATRIX _IOW(MSMFB_IOCTL_MAGIC, 134, struct mdp_ccs)
|
||||
#define MSMFB_OVERLAY_SET _IOWR(MSMFB_IOCTL_MAGIC, 135, \
|
||||
struct mdp_overlay)
|
||||
#define MSMFB_OVERLAY_UNSET _IOW(MSMFB_IOCTL_MAGIC, 136, unsigned int)
|
||||
#define MSMFB_OVERLAY_PLAY _IOW(MSMFB_IOCTL_MAGIC, 137, \
|
||||
struct msmfb_overlay_data)
|
||||
#define MSMFB_GET_PAGE_PROTECTION _IOR(MSMFB_IOCTL_MAGIC, 138, \
|
||||
struct mdp_page_protection)
|
||||
#define MSMFB_SET_PAGE_PROTECTION _IOW(MSMFB_IOCTL_MAGIC, 139, \
|
||||
struct mdp_page_protection)
|
||||
#define MSMFB_OVERLAY_GET _IOR(MSMFB_IOCTL_MAGIC, 140, \
|
||||
struct mdp_overlay)
|
||||
#define MSMFB_OVERLAY_PLAY_ENABLE _IOW(MSMFB_IOCTL_MAGIC, 141, unsigned int)
|
||||
#define MSMFB_OVERLAY_BLT _IOWR(MSMFB_IOCTL_MAGIC, 142, \
|
||||
struct msmfb_overlay_blt)
|
||||
#define MSMFB_OVERLAY_BLT_OFFSET _IOW(MSMFB_IOCTL_MAGIC, 143, unsigned int)
|
||||
#define MSMFB_HISTOGRAM_START _IO(MSMFB_IOCTL_MAGIC, 144)
|
||||
#define MSMFB_HISTOGRAM_STOP _IO(MSMFB_IOCTL_MAGIC, 145)
|
||||
#define MSMFB_NOTIFY_UPDATE _IOW(MSMFB_IOCTL_MAGIC, 146, unsigned int)
|
||||
|
||||
#define MSMFB_OVERLAY_3D _IOWR(MSMFB_IOCTL_MAGIC, 147, \
|
||||
struct msmfb_overlay_3d)
|
||||
|
||||
#define MSMFB_MIXER_INFO _IOWR(MSMFB_IOCTL_MAGIC, 148, \
|
||||
struct msmfb_mixer_info_req)
|
||||
#define MSMFB_OVERLAY_PLAY_WAIT _IOWR(MSMFB_IOCTL_MAGIC, 149, \
|
||||
struct msmfb_overlay_data)
|
||||
|
||||
#define MSMFB_WRITEBACK_INIT _IO(MSMFB_IOCTL_MAGIC, 150)
|
||||
#define MSMFB_WRITEBACK_REGISTER_BUFFER _IOW(MSMFB_IOCTL_MAGIC, 151, \
|
||||
struct msmfb_writeback_data)
|
||||
#define MSMFB_WRITEBACK_UNREGISTER_BUFFER _IOW(MSMFB_IOCTL_MAGIC, 152, \
|
||||
struct msmfb_writeback_data)
|
||||
#define MSMFB_WRITEBACK_QUEUE_BUFFER _IOW(MSMFB_IOCTL_MAGIC, 153, \
|
||||
struct msmfb_data)
|
||||
#define MSMFB_WRITEBACK_DEQUEUE_BUFFER _IOW(MSMFB_IOCTL_MAGIC, 154, \
|
||||
struct msmfb_data)
|
||||
#define MSMFB_WRITEBACK_TERMINATE _IO(MSMFB_IOCTL_MAGIC, 155)
|
||||
|
||||
#define FB_TYPE_3D_PANEL 0x10101010
|
||||
#define MDP_IMGTYPE2_START 0x10000
|
||||
#define MSMFB_DRIVER_VERSION 0xF9E8D701
|
||||
|
||||
enum {
|
||||
NOTIFY_UPDATE_START,
|
||||
NOTIFY_UPDATE_STOP,
|
||||
};
|
||||
|
||||
enum {
|
||||
MDP_RGB_565, /* RGB 565 planer */
|
||||
MDP_XRGB_8888, /* RGB 888 padded */
|
||||
MDP_Y_CBCR_H2V2, /* Y and CbCr, pseudo planer w/ Cb is in MSB */
|
||||
MDP_ARGB_8888, /* ARGB 888 */
|
||||
MDP_RGB_888, /* RGB 888 planer */
|
||||
MDP_Y_CRCB_H2V2, /* Y and CrCb, pseudo planer w/ Cr is in MSB */
|
||||
MDP_YCRYCB_H2V1, /* YCrYCb interleave */
|
||||
MDP_Y_CRCB_H2V1, /* Y and CrCb, pseduo planer w/ Cr is in MSB */
|
||||
MDP_Y_CBCR_H2V1, /* Y and CrCb, pseduo planer w/ Cr is in MSB */
|
||||
MDP_RGBA_8888, /* ARGB 888 */
|
||||
MDP_BGRA_8888, /* ABGR 888 */
|
||||
MDP_RGBX_8888, /* RGBX 888 */
|
||||
MDP_Y_CRCB_H2V2_TILE, /* Y and CrCb, pseudo planer tile */
|
||||
MDP_Y_CBCR_H2V2_TILE, /* Y and CbCr, pseudo planer tile */
|
||||
MDP_Y_CR_CB_H2V2, /* Y, Cr and Cb, planar */
|
||||
MDP_Y_CR_CB_GH2V2, /* Y, Cr and Cb, planar aligned to Android YV12 */
|
||||
MDP_Y_CB_CR_H2V2, /* Y, Cb and Cr, planar */
|
||||
MDP_Y_CRCB_H1V1, /* Y and CrCb, pseduo planer w/ Cr is in MSB */
|
||||
MDP_Y_CBCR_H1V1, /* Y and CbCr, pseduo planer w/ Cb is in MSB */
|
||||
MDP_IMGTYPE_LIMIT,
|
||||
MDP_BGR_565 = MDP_IMGTYPE2_START, /* BGR 565 planer */
|
||||
MDP_FB_FORMAT, /* framebuffer format */
|
||||
MDP_IMGTYPE_LIMIT2 /* Non valid image type after this enum */
|
||||
};
|
||||
|
||||
enum {
|
||||
PMEM_IMG,
|
||||
FB_IMG,
|
||||
};
|
||||
|
||||
enum {
|
||||
HSIC_HUE = 0,
|
||||
HSIC_SAT,
|
||||
HSIC_INT,
|
||||
HSIC_CON,
|
||||
NUM_HSIC_PARAM,
|
||||
};
|
||||
|
||||
/* mdp_blit_req flag values */
|
||||
#define MDP_ROT_NOP 0
|
||||
#define MDP_FLIP_LR 0x1
|
||||
#define MDP_FLIP_UD 0x2
|
||||
#define MDP_ROT_90 0x4
|
||||
#define MDP_ROT_180 (MDP_FLIP_UD|MDP_FLIP_LR)
|
||||
#define MDP_ROT_270 (MDP_ROT_90|MDP_FLIP_UD|MDP_FLIP_LR)
|
||||
#define MDP_DITHER 0x8
|
||||
#define MDP_BLUR 0x10
|
||||
#define MDP_BLEND_FG_PREMULT 0x20000
|
||||
#define MDP_DEINTERLACE 0x80000000
|
||||
#define MDP_SHARPENING 0x40000000
|
||||
#define MDP_NO_DMA_BARRIER_START 0x20000000
|
||||
#define MDP_NO_DMA_BARRIER_END 0x10000000
|
||||
#define MDP_NO_BLIT 0x08000000
|
||||
#define MDP_BLIT_WITH_DMA_BARRIERS 0x000
|
||||
#define MDP_BLIT_WITH_NO_DMA_BARRIERS \
|
||||
(MDP_NO_DMA_BARRIER_START | MDP_NO_DMA_BARRIER_END)
|
||||
#define MDP_BLIT_SRC_GEM 0x04000000
|
||||
#define MDP_BLIT_DST_GEM 0x02000000
|
||||
#define MDP_BLIT_NON_CACHED 0x01000000
|
||||
#define MDP_OV_PIPE_SHARE 0x00800000
|
||||
#define MDP_DEINTERLACE_ODD 0x00400000
|
||||
#define MDP_OV_PLAY_NOWAIT 0x00200000
|
||||
#define MDP_SOURCE_ROTATED_90 0x00100000
|
||||
#define MDP_MEMORY_ID_TYPE_FB 0x00001000
|
||||
#define MDP_DPP_HSIC 0x00080000
|
||||
|
||||
#define MDP_TRANSP_NOP 0xffffffff
|
||||
#define MDP_ALPHA_NOP 0xff
|
||||
|
||||
#define MDP_FB_PAGE_PROTECTION_NONCACHED (0)
|
||||
#define MDP_FB_PAGE_PROTECTION_WRITECOMBINE (1)
|
||||
#define MDP_FB_PAGE_PROTECTION_WRITETHROUGHCACHE (2)
|
||||
#define MDP_FB_PAGE_PROTECTION_WRITEBACKCACHE (3)
|
||||
#define MDP_FB_PAGE_PROTECTION_WRITEBACKWACACHE (4)
|
||||
/* Sentinel: Don't use! */
|
||||
#define MDP_FB_PAGE_PROTECTION_INVALID (5)
|
||||
/* Count of the number of MDP_FB_PAGE_PROTECTION_... values. */
|
||||
#define MDP_NUM_FB_PAGE_PROTECTION_VALUES (5)
|
||||
|
||||
struct mdp_rect {
|
||||
uint32_t x;
|
||||
uint32_t y;
|
||||
uint32_t w;
|
||||
uint32_t h;
|
||||
};
|
||||
|
||||
struct mdp_img {
|
||||
uint32_t width;
|
||||
uint32_t height;
|
||||
uint32_t format;
|
||||
uint32_t offset;
|
||||
int memory_id; /* the file descriptor */
|
||||
uint32_t priv;
|
||||
};
|
||||
|
||||
/*
|
||||
* {3x3} + {3} ccs matrix
|
||||
*/
|
||||
|
||||
#define MDP_CCS_RGB2YUV 0
|
||||
#define MDP_CCS_YUV2RGB 1
|
||||
|
||||
#define MDP_CCS_SIZE 9
|
||||
#define MDP_BV_SIZE 3
|
||||
|
||||
struct mdp_ccs {
|
||||
int direction; /* MDP_CCS_RGB2YUV or YUV2RGB */
|
||||
uint16_t ccs[MDP_CCS_SIZE]; /* 3x3 color coefficients */
|
||||
uint16_t bv[MDP_BV_SIZE]; /* 1x3 bias vector */
|
||||
};
|
||||
|
||||
struct mdp_csc {
|
||||
int id;
|
||||
uint32_t csc_mv[9];
|
||||
uint32_t csc_pre_bv[3];
|
||||
uint32_t csc_post_bv[3];
|
||||
uint32_t csc_pre_lv[6];
|
||||
uint32_t csc_post_lv[6];
|
||||
};
|
||||
|
||||
/* The version of the mdp_blit_req structure so that
|
||||
* user applications can selectively decide which functionality
|
||||
* to include
|
||||
*/
|
||||
|
||||
#define MDP_BLIT_REQ_VERSION 2
|
||||
|
||||
struct mdp_blit_req {
|
||||
struct mdp_img src;
|
||||
struct mdp_img dst;
|
||||
struct mdp_rect src_rect;
|
||||
struct mdp_rect dst_rect;
|
||||
uint32_t alpha;
|
||||
uint32_t transp_mask;
|
||||
uint32_t flags;
|
||||
int sharpening_strength; /* -127 <--> 127, default 64 */
|
||||
};
|
||||
|
||||
struct mdp_blit_req_list {
|
||||
uint32_t count;
|
||||
struct mdp_blit_req req[];
|
||||
};
|
||||
|
||||
#define MSMFB_DATA_VERSION 2
|
||||
|
||||
struct msmfb_data {
|
||||
uint32_t offset;
|
||||
int memory_id;
|
||||
int id;
|
||||
uint32_t flags;
|
||||
uint32_t priv;
|
||||
};
|
||||
|
||||
#define MSMFB_NEW_REQUEST -1
|
||||
|
||||
struct msmfb_overlay_data {
|
||||
uint32_t id;
|
||||
struct msmfb_data data;
|
||||
uint32_t version_key;
|
||||
struct msmfb_data plane1_data;
|
||||
struct msmfb_data plane2_data;
|
||||
};
|
||||
|
||||
struct msmfb_img {
|
||||
uint32_t width;
|
||||
uint32_t height;
|
||||
uint32_t format;
|
||||
};
|
||||
|
||||
#define MSMFB_WRITEBACK_DEQUEUE_BLOCKING 0x1
|
||||
struct msmfb_writeback_data {
|
||||
struct msmfb_data buf_info;
|
||||
struct msmfb_img img;
|
||||
};
|
||||
|
||||
struct dpp_ctrl {
|
||||
/*
|
||||
*'sharp_strength' has inputs = -128 <-> 127
|
||||
* Increasingly positive values correlate with increasingly sharper
|
||||
* picture. Increasingly negative values correlate with increasingly
|
||||
* smoothed picture.
|
||||
*/
|
||||
int8_t sharp_strength;
|
||||
int8_t hsic_params[NUM_HSIC_PARAM];
|
||||
};
|
||||
|
||||
struct mdp_overlay {
|
||||
struct msmfb_img src;
|
||||
struct mdp_rect src_rect;
|
||||
struct mdp_rect dst_rect;
|
||||
uint32_t z_order; /* stage number */
|
||||
uint32_t is_fg; /* control alpha & transp */
|
||||
uint32_t alpha;
|
||||
uint32_t transp_mask;
|
||||
uint32_t flags;
|
||||
uint32_t id;
|
||||
uint32_t user_data[8];
|
||||
struct dpp_ctrl dpp;
|
||||
};
|
||||
|
||||
struct msmfb_overlay_3d {
|
||||
uint32_t is_3d;
|
||||
uint32_t width;
|
||||
uint32_t height;
|
||||
};
|
||||
|
||||
|
||||
struct msmfb_overlay_blt {
|
||||
uint32_t enable;
|
||||
uint32_t offset;
|
||||
uint32_t width;
|
||||
uint32_t height;
|
||||
uint32_t bpp;
|
||||
};
|
||||
|
||||
struct mdp_histogram {
|
||||
uint32_t frame_cnt;
|
||||
uint32_t bin_cnt;
|
||||
uint32_t *r;
|
||||
uint32_t *g;
|
||||
uint32_t *b;
|
||||
};
|
||||
|
||||
struct mdp_page_protection {
|
||||
uint32_t page_protection;
|
||||
};
|
||||
|
||||
|
||||
struct mdp_mixer_info {
|
||||
int pndx;
|
||||
int pnum;
|
||||
int ptype;
|
||||
int mixer_num;
|
||||
int z_order;
|
||||
};
|
||||
|
||||
#define MAX_PIPE_PER_MIXER 4
|
||||
|
||||
struct msmfb_mixer_info_req {
|
||||
int mixer_num;
|
||||
int cnt;
|
||||
struct mdp_mixer_info info[MAX_PIPE_PER_MIXER];
|
||||
};
|
||||
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
/* get the framebuffer physical address information */
|
||||
int get_fb_phys_info(unsigned long *start, unsigned long *len, int fb_num);
|
||||
struct fb_info *msm_fb_get_writeback_fb(void);
|
||||
int msm_fb_writeback_init(struct fb_info *info);
|
||||
int msm_fb_writeback_register_buffer(struct fb_info *info,
|
||||
struct msmfb_writeback_data *data);
|
||||
int msm_fb_writeback_queue_buffer(struct fb_info *info,
|
||||
struct msmfb_data *data);
|
||||
int msm_fb_writeback_dequeue_buffer(struct fb_info *info,
|
||||
struct msmfb_data *data);
|
||||
int msm_fb_writeback_unregister_buffer(struct fb_info *info,
|
||||
struct msmfb_writeback_data *data);
|
||||
int msm_fb_writeback_terminate(struct fb_info *info);
|
||||
#endif
|
||||
|
||||
#endif /*_MSM_MDP_H_*/
|
||||
80
include/linux/msm_rotator.h
Normal file
80
include/linux/msm_rotator.h
Normal file
@@ -0,0 +1,80 @@
|
||||
/* Copyright (c) 2009, Code Aurora Forum. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of Code Aurora Forum, Inc. nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __MSM_ROTATOR_H__
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/msm_mdp.h>
|
||||
|
||||
#define MSM_ROTATOR_IOCTL_MAGIC 'R'
|
||||
|
||||
#define MSM_ROTATOR_IOCTL_START \
|
||||
_IOWR(MSM_ROTATOR_IOCTL_MAGIC, 1, struct msm_rotator_img_info)
|
||||
#define MSM_ROTATOR_IOCTL_ROTATE \
|
||||
_IOW(MSM_ROTATOR_IOCTL_MAGIC, 2, struct msm_rotator_data_info)
|
||||
#define MSM_ROTATOR_IOCTL_FINISH \
|
||||
_IOW(MSM_ROTATOR_IOCTL_MAGIC, 3, int)
|
||||
|
||||
enum rotator_clk_type {
|
||||
ROTATOR_AXICLK_CLK,
|
||||
ROTATOR_PCLK_CLK,
|
||||
ROTATOR_IMEMCLK_CLK
|
||||
};
|
||||
|
||||
struct msm_rotator_img_info {
|
||||
unsigned int session_id;
|
||||
struct msmfb_img src;
|
||||
struct msmfb_img dst;
|
||||
struct mdp_rect src_rect;
|
||||
unsigned int dst_x;
|
||||
unsigned int dst_y;
|
||||
unsigned char rotations;
|
||||
int enable;
|
||||
};
|
||||
|
||||
struct msm_rotator_data_info {
|
||||
int session_id;
|
||||
struct msmfb_data src;
|
||||
struct msmfb_data dst;
|
||||
};
|
||||
|
||||
struct msm_rot_clocks {
|
||||
const char *clk_name;
|
||||
enum rotator_clk_type clk_type;
|
||||
unsigned int clk_rate;
|
||||
};
|
||||
|
||||
struct msm_rotator_platform_data {
|
||||
unsigned int number_of_clocks;
|
||||
unsigned int hardware_version_number;
|
||||
struct msm_rot_clocks *rotator_clks;
|
||||
const char *regulator_name;
|
||||
};
|
||||
#endif
|
||||
|
||||
151
include/linux/spi_aic3254.h
Normal file
151
include/linux/spi_aic3254.h
Normal file
@@ -0,0 +1,151 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef __SPI_AIC3254_H__
|
||||
#define __SPI_AIC3254_H__
|
||||
|
||||
#include <linux/ioctl.h>
|
||||
|
||||
typedef struct _CODEC_SPI_CMD {
|
||||
unsigned char act;
|
||||
unsigned char reg;
|
||||
unsigned char data;
|
||||
} CODEC_SPI_CMD;
|
||||
|
||||
typedef struct _CODEC_SPI_CMD_PARAM {
|
||||
CODEC_SPI_CMD *data;
|
||||
unsigned int len;
|
||||
} CODEC_SPI_CMD_PARAM;
|
||||
|
||||
struct AIC3254_PARAM {
|
||||
unsigned int row_num;
|
||||
unsigned int col_num;
|
||||
void *cmd_data;
|
||||
};
|
||||
|
||||
struct CODEC_CFG {
|
||||
unsigned char tb_idx;
|
||||
unsigned char index;
|
||||
};
|
||||
|
||||
#define AIC3254_IOCTL_MAGIC 's'
|
||||
#define AIC3254_SET_TX_PARAM _IOW(AIC3254_IOCTL_MAGIC, 0x10, unsigned)
|
||||
#define AIC3254_SET_RX_PARAM _IOW(AIC3254_IOCTL_MAGIC, 0x11, unsigned)
|
||||
#define AIC3254_CONFIG_TX _IOW(AIC3254_IOCTL_MAGIC, 0x12, unsigned int)
|
||||
#define AIC3254_CONFIG_RX _IOW(AIC3254_IOCTL_MAGIC, 0x13, unsigned int)
|
||||
#define AIC3254_SET_DSP_PARAM _IOW(AIC3254_IOCTL_MAGIC, 0x20, unsigned)
|
||||
#define AIC3254_CONFIG_MEDIA _IOW(AIC3254_IOCTL_MAGIC, 0x21, unsigned int)
|
||||
#define AIC3254_CONFIG_VOICE _IOW(AIC3254_IOCTL_MAGIC, 0x22, unsigned int)
|
||||
#define AIC3254_CONFIG_VOLUME_L _IOW(AIC3254_IOCTL_MAGIC, 0x23, unsigned int)
|
||||
#define AIC3254_CONFIG_VOLUME_R _IOW(AIC3254_IOCTL_MAGIC, 0x24, unsigned int)
|
||||
#define AIC3254_POWERDOWN _IOW(AIC3254_IOCTL_MAGIC, 0x25, unsigned int)
|
||||
#define AIC3254_LOOPBACK _IOW(AIC3254_IOCTL_MAGIC, 0x26, unsigned int)
|
||||
#define AIC3254_DUMP_PAGES _IOW(AIC3254_IOCTL_MAGIC, 0x30, unsigned int)
|
||||
#define AIC3254_READ_REG _IOWR(AIC3254_IOCTL_MAGIC, 0x31, unsigned)
|
||||
#define AIC3254_WRITE_REG _IOW(AIC3254_IOCTL_MAGIC, 0x32, unsigned)
|
||||
#define AIC3254_RESET _IOW(AIC3254_IOCTL_MAGIC, 0x33, unsigned int)
|
||||
|
||||
#define AIC3254_MAX_PAGES 255
|
||||
#define AIC3254_MAX_REGS 128
|
||||
#define AIC3254_MAX_RETRY 10
|
||||
|
||||
#define IO_CTL_ROW_MAX 64
|
||||
#define IO_CTL_COL_MAX 1024
|
||||
#define MINIDSP_ROW_MAX 32
|
||||
#define MINIDSP_COL_MAX 16384
|
||||
|
||||
enum aic3254_uplink_mode {
|
||||
INITIAL = 0,
|
||||
CALL_UPLINK_IMIC_RECEIVER = 1,
|
||||
CALL_UPLINK_EMIC_HEADSET,
|
||||
CALL_UPLINK_IMIC_HEADSET,
|
||||
CALL_UPLINK_IMIC_SPEAKER,
|
||||
CALL_UPLINK_IMIC_RECEIVER_DUALMIC,
|
||||
CALL_UPLINK_EMIC_HEADSET_DUALMIC,
|
||||
CALL_UPLINK_IMIC_SPEAKER_DUALMIC,
|
||||
CALL_UPLINK_IMIC_RECIVER_TESTSIM,
|
||||
CALL_UPLINK_EMIC_HEADSET_TESTSIM,
|
||||
CALL_UPLINK_IMIC_SPEAKER_TESTSIM,
|
||||
VOICERECORD_IMIC = 15,
|
||||
VOICERECORD_EMIC,
|
||||
VIDEORECORD_IMIC,
|
||||
VIDEORECORD_EMIC,
|
||||
VOICERECOGNITION_IMIC,
|
||||
VOICERECOGNITION_EMIC,
|
||||
FM_IN_SPEAKER,
|
||||
FM_IN_HEADSET,
|
||||
TTY_IN_HCO,
|
||||
TTY_IN_VCO,
|
||||
TTY_IN_FULL,
|
||||
UPLINK_OFF = 29,
|
||||
UPLINK_WAKEUP,
|
||||
POWER_OFF,
|
||||
SLEEP_WITH_HP_IN,
|
||||
VOICERECORD_IMIC_PLAYBACK_SPEAKER,
|
||||
VOICERECORD_EMIC_PLAYBACK_HEADSET,
|
||||
VOICERECORD_IMIC_PLAYBACK_HEADSET,
|
||||
};
|
||||
|
||||
enum aic3254_downlink_mode {
|
||||
CALL_DOWNLINK_IMIC_RECEIVER = 1,
|
||||
CALL_DOWNLINK_EMIC_HEADSET,
|
||||
CALL_DOWNLINK_IMIC_HEADSET,
|
||||
CALL_DOWNLINK_IMIC_SPEAKER,
|
||||
CALL_DOWNLINK_IMIC_RECEIVER_DUALMIC,
|
||||
CALL_DOWNLINK_EMIC_HEADSET_DUALMIC,
|
||||
CALL_DOWNLINK_IMIC_SPEAKER_DUALMIC,
|
||||
CALL_DOWNLINK_IMIC_RECIVER_TESTSIM,
|
||||
CALL_DOWNLINK_EMIC_HEADSET_TESTSIM,
|
||||
CALL_DOWNLINK_IMIC_SPEAKER_TESTSIM,
|
||||
PLAYBACK_RECEIVER,
|
||||
PLAYBACK_HEADSET,
|
||||
PLAYBACK_SPEAKER = 13,
|
||||
RING_HEADSET_SPEAKER,
|
||||
PLAYBACK_SPEAKER_ALT,
|
||||
USB_AUDIO,
|
||||
FM_OUT_SPEAKER = 21,
|
||||
FM_OUT_HEADSET,
|
||||
TTY_OUT_HCO,
|
||||
TTY_OUT_VCO,
|
||||
TTY_OUT_FULL,
|
||||
MUSE,
|
||||
HAC,
|
||||
LPM_IMIC_RECEIVER,
|
||||
DOWNLINK_OFF = 29,
|
||||
DOWNLINK_WAKEUP,
|
||||
};
|
||||
|
||||
struct aic3254_ctl_ops {
|
||||
void (*tx_amp_enable)(int en);
|
||||
void (*rx_amp_enable)(int en);
|
||||
int (*panel_sleep_in)(void);
|
||||
void (*reset_3254)(void);
|
||||
void (*spibus_enable)(int en);
|
||||
CODEC_SPI_CMD_PARAM *downlink_off;
|
||||
CODEC_SPI_CMD_PARAM *uplink_off;
|
||||
CODEC_SPI_CMD_PARAM *downlink_on;
|
||||
CODEC_SPI_CMD_PARAM *uplink_on;
|
||||
CODEC_SPI_CMD_PARAM *lb_dsp_init;
|
||||
CODEC_SPI_CMD_PARAM *lb_downlink_receiver;
|
||||
CODEC_SPI_CMD_PARAM *lb_downlink_speaker;
|
||||
CODEC_SPI_CMD_PARAM *lb_downlink_headset;
|
||||
CODEC_SPI_CMD_PARAM *lb_uplink_imic;
|
||||
CODEC_SPI_CMD_PARAM *lb_uplink_emic;
|
||||
CODEC_SPI_CMD_PARAM *lb_receiver_imic;
|
||||
CODEC_SPI_CMD_PARAM *lb_speaker_imic;
|
||||
CODEC_SPI_CMD_PARAM *lb_headset_emic;
|
||||
CODEC_SPI_CMD_PARAM *lb_receiver_bmic;
|
||||
CODEC_SPI_CMD_PARAM *lb_speaker_bmic;
|
||||
CODEC_SPI_CMD_PARAM *lb_headset_bmic;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
52
include/linux/tpa2051d3.h
Normal file
52
include/linux/tpa2051d3.h
Normal file
@@ -0,0 +1,52 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef TPA2051D3_H
|
||||
#define TPA2051D3_H
|
||||
|
||||
#include <linux/ioctl.h>
|
||||
|
||||
#define TPA2051D3_I2C_NAME "tpa2051d3"
|
||||
#define SPKR_OUTPUT 0
|
||||
#define HEADSET_OUTPUT 1
|
||||
#define DUAL_OUTPUT 2
|
||||
#define HANDSET_OUTPUT 3
|
||||
#define MODE_CMD_LEM 9
|
||||
struct tpa2051d3_platform_data {
|
||||
uint32_t gpio_tpa2051_spk_en;
|
||||
};
|
||||
|
||||
struct tpa2051_config_data {
|
||||
unsigned int data_len;
|
||||
unsigned int mode_num;
|
||||
unsigned char *cmd_data;
|
||||
};
|
||||
|
||||
enum TPA2051_Mode {
|
||||
TPA2051_MODE_OFF,
|
||||
TPA2051_MODE_PLAYBACK_SPKR,
|
||||
TPA2051_MODE_PLAYBACK_HEADSET,
|
||||
TPA2051_MODE_RING,
|
||||
TPA2051_MODE_VOICECALL_SPKR,
|
||||
TPA2051_MODE_VOICECALL_HEADSET,
|
||||
TPA2051_MODE_FM_SPKR,
|
||||
TPA2051_MODE_FM_HEADSET,
|
||||
TPA2051_MODE_HANDSET,
|
||||
TPA2051_MAX_MODE
|
||||
};
|
||||
#define TPA2051_IOCTL_MAGIC 'a'
|
||||
#define TPA2051_SET_CONFIG _IOW(TPA2051_IOCTL_MAGIC, 0x01, unsigned)
|
||||
#define TPA2051_READ_CONFIG _IOW(TPA2051_IOCTL_MAGIC, 0x02, unsigned)
|
||||
#define TPA2051_SET_MODE _IOW(TPA2051_IOCTL_MAGIC, 0x03, unsigned)
|
||||
#define TPA2051_SET_PARAM _IOW(TPA2051_IOCTL_MAGIC, 0x04, unsigned)
|
||||
|
||||
#endif
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
** See the License for the specific language governing permissions and
|
||||
** limitations under the License.
|
||||
*/
|
||||
#define REVISION_C "CM.7.0.1."
|
||||
// NOTE: Version number of the lib
|
||||
#define REVISION_C "CM.7.1.0.15."
|
||||
// #define LOG_NDEBUG 0
|
||||
|
||||
#define LOG_TAG "QualcommCameraHardware"
|
||||
@@ -96,6 +97,7 @@ struct preview_size_type {
|
||||
static preview_size_type preview_sizes[] = {
|
||||
{ 480, 320 }, // HVGA
|
||||
{ 432, 320 }, // 1.35-to-1, for photos. (Rounded up from 1.3333 to 1)
|
||||
{ 384, 288 }, // 4:3
|
||||
{ 352, 288 }, // CIF
|
||||
{ 336, 244 },
|
||||
{ 320, 320 },
|
||||
@@ -120,12 +122,26 @@ static int attr_lookup(const struct str_map *const arr, const char *name)
|
||||
return NOT_FOUND;
|
||||
}
|
||||
|
||||
static const char* attr_lookup(const struct dstr_map *const arr, const char *name)
|
||||
{
|
||||
if (name) {
|
||||
const struct dstr_map *trav = arr;
|
||||
while (trav->desc) {
|
||||
if (!strcmp(trav->desc, name))
|
||||
return trav->val;
|
||||
trav++;
|
||||
}
|
||||
}
|
||||
return '\0';
|
||||
}
|
||||
|
||||
#define INIT_VALUES_FOR(parm) do { \
|
||||
if (!parm##_values) { \
|
||||
parm##_values = (char *)malloc(sizeof(parm)/ \
|
||||
sizeof(parm[0])*30); \
|
||||
LOGD("Kalim Param: %s",parm##_values); \
|
||||
char *ptr = parm##_values; \
|
||||
const str_map *trav; \
|
||||
const TYPESTRMAP *trav; \
|
||||
for (trav = parm; trav->desc; trav++) { \
|
||||
int len = strlen(trav->desc); \
|
||||
strcpy(ptr, trav->desc); \
|
||||
@@ -181,6 +197,21 @@ static const str_map picturesize[] = {
|
||||
};
|
||||
static char *picturesize_values;
|
||||
|
||||
static const dstr_map reducesize[] = {
|
||||
{ "2048x1536", "1600x1200" },
|
||||
{ "1600x1200", "1280x960" },
|
||||
{ "1280x960" , "480x320" },
|
||||
{ "640x480" , "320x240" },
|
||||
{ "480x320" , "640x480" },
|
||||
{ "320x240" , "352x288" },
|
||||
{ "352x288" , "176x144" },
|
||||
{ "176x144" , NULL },
|
||||
{ NULL, 0 }
|
||||
};
|
||||
|
||||
static char *reducesize_values;
|
||||
|
||||
|
||||
// round to the next power of two
|
||||
static inline unsigned clp2(unsigned x)
|
||||
{
|
||||
@@ -199,14 +230,15 @@ static Mutex singleton_lock;
|
||||
static bool singleton_releasing;
|
||||
static Condition singleton_wait;
|
||||
|
||||
static void receive_camframe_callback(struct msm_frame_t *frame);
|
||||
static void receive_camframe_callback(struct msm_frame *frame);
|
||||
|
||||
static int camerafd;
|
||||
static int fd_frame;
|
||||
static int32_t mMaxZoom = -1;
|
||||
static int32_t prevzoom = 0;
|
||||
static int ZOOM_STEP;
|
||||
static bool zoomSupported = false;
|
||||
struct msm_frame_t *frameA;
|
||||
struct msm_frame *frameA;
|
||||
bool bFramePresent;
|
||||
pthread_t w_thread;
|
||||
pthread_t jpegThread;
|
||||
@@ -260,7 +292,7 @@ static bool native_get_maxzoom(int camfd, void *pZm)
|
||||
{
|
||||
LOGV("native_get_maxzoom E");
|
||||
|
||||
struct msm_ctrl_cmd_t ctrlCmd;
|
||||
struct msm_ctrl_cmd ctrlCmd;
|
||||
int32_t *pZoom = (int32_t *)pZm;
|
||||
|
||||
ctrlCmd.type = CAMERA_GET_PARM_MAXZOOM;
|
||||
@@ -309,10 +341,14 @@ void QualcommCameraHardware::initDefaultParameters()
|
||||
|
||||
// This will happen only once in the lifetime of the mediaserver process.
|
||||
// We do not free the _values arrays when we destroy the camera object.
|
||||
#define TYPESTRMAP str_map
|
||||
INIT_VALUES_FOR(antibanding);
|
||||
INIT_VALUES_FOR(effect);
|
||||
INIT_VALUES_FOR(whitebalance);
|
||||
INIT_VALUES_FOR(picturesize);
|
||||
#undef TYPESTRMAP
|
||||
#define TYPESTRMAP dstr_map
|
||||
INIT_VALUES_FOR(reducesize);
|
||||
|
||||
p.set(CameraParameters::KEY_SUPPORTED_ANTIBANDING, antibanding_values);
|
||||
p.set(CameraParameters::KEY_SUPPORTED_EFFECTS, effect_values);
|
||||
@@ -326,8 +362,8 @@ void QualcommCameraHardware::initDefaultParameters()
|
||||
// Zoom parameters
|
||||
p.set(CameraParameters::KEY_ZOOM_SUPPORTED, "true");
|
||||
p.set(CameraParameters::KEY_ZOOM, "0");
|
||||
p.set(CameraParameters::KEY_MAX_ZOOM, 5);
|
||||
p.set(CameraParameters::KEY_ZOOM_RATIOS, "100,150,175,200,250,300");
|
||||
p.set(CameraParameters::KEY_MAX_ZOOM,6);
|
||||
p.set(CameraParameters::KEY_ZOOM_RATIOS, "100,150,175,200,250,275,300");
|
||||
|
||||
if (setParameters(p) != NO_ERROR) {
|
||||
LOGE("Failed to set default parameters?!");
|
||||
@@ -454,13 +490,13 @@ status_t QualcommCameraHardware::dump(int fd,
|
||||
bool QualcommCameraHardware::reg_unreg_buf(int camfd,
|
||||
int width,
|
||||
int height,
|
||||
msm_frame_t *frame,
|
||||
msm_pmem_t pmem_type,
|
||||
msm_frame *frame,
|
||||
msm_pmem pmem_type,
|
||||
unsigned char unregister,
|
||||
unsigned char active)
|
||||
{
|
||||
uint32_t y_size;
|
||||
struct msm_pmem_info_t pmemBuf;
|
||||
struct msm_pmem_info pmemBuf;
|
||||
uint32_t ioctl_cmd;
|
||||
int ioctlRetVal;
|
||||
|
||||
@@ -489,7 +525,7 @@ bool QualcommCameraHardware::reg_unreg_buf(int camfd,
|
||||
void QualcommCameraHardware::native_register_preview_bufs(
|
||||
int camfd,
|
||||
void *pDim,
|
||||
struct msm_frame_t *frame,
|
||||
struct msm_frame *frame,
|
||||
unsigned char active)
|
||||
{
|
||||
cam_ctrl_dimension_t *dimension = (cam_ctrl_dimension_t *)pDim;
|
||||
@@ -506,7 +542,7 @@ void QualcommCameraHardware::native_register_preview_bufs(
|
||||
void QualcommCameraHardware::native_unregister_preview_bufs(
|
||||
int camfd,
|
||||
void *pDim,
|
||||
struct msm_frame_t *frame)
|
||||
struct msm_frame *frame)
|
||||
{
|
||||
cam_ctrl_dimension_t *dimension = (cam_ctrl_dimension_t *)pDim;
|
||||
|
||||
@@ -533,7 +569,7 @@ static bool native_cancel_afmode(int camfd, int af_fd)
|
||||
|
||||
static bool native_start_preview(int camfd)
|
||||
{
|
||||
struct msm_ctrl_cmd_t ctrlCmd;
|
||||
struct msm_ctrl_cmd ctrlCmd;
|
||||
|
||||
ctrlCmd.timeout_ms = 5000;
|
||||
ctrlCmd.type = CAMERA_START_PREVIEW;
|
||||
@@ -553,7 +589,7 @@ static bool native_start_preview(int camfd)
|
||||
static bool native_get_picture(int camfd, common_crop_t *crop)
|
||||
{
|
||||
LOGV("native_get_picture E");
|
||||
struct msm_ctrl_cmd_t ctrlCmd;
|
||||
struct msm_ctrl_cmd ctrlCmd;
|
||||
|
||||
ctrlCmd.timeout_ms = 5000;
|
||||
ctrlCmd.length = sizeof(common_crop_t);
|
||||
@@ -586,7 +622,7 @@ static bool native_get_picture(int camfd, common_crop_t *crop)
|
||||
|
||||
static bool native_stop_preview(int camfd)
|
||||
{
|
||||
struct msm_ctrl_cmd_t ctrlCmd;
|
||||
struct msm_ctrl_cmd ctrlCmd;
|
||||
ctrlCmd.timeout_ms = 5000;
|
||||
ctrlCmd.type = CAMERA_STOP_PREVIEW;
|
||||
ctrlCmd.length = 0;
|
||||
@@ -603,7 +639,7 @@ static bool native_stop_preview(int camfd)
|
||||
|
||||
static bool native_start_snapshot(int camfd)
|
||||
{
|
||||
struct msm_ctrl_cmd_t ctrlCmd;
|
||||
struct msm_ctrl_cmd ctrlCmd;
|
||||
|
||||
ctrlCmd.timeout_ms = 5000;
|
||||
ctrlCmd.type = CAMERA_START_SNAPSHOT;
|
||||
@@ -621,7 +657,7 @@ static bool native_start_snapshot(int camfd)
|
||||
|
||||
static bool native_stop_snapshot(int camfd)
|
||||
{
|
||||
struct msm_ctrl_cmd_t ctrlCmd;
|
||||
struct msm_ctrl_cmd ctrlCmd;
|
||||
|
||||
ctrlCmd.timeout_ms = 5000;
|
||||
ctrlCmd.type = CAMERA_STOP_SNAPSHOT;
|
||||
@@ -700,7 +736,7 @@ bool QualcommCameraHardware::native_set_parm(
|
||||
cam_ctrl_type type, uint16_t length, void *value)
|
||||
{
|
||||
int rc = true;
|
||||
struct msm_ctrl_cmd_t ctrlCmd;
|
||||
struct msm_ctrl_cmd ctrlCmd;
|
||||
|
||||
ctrlCmd.timeout_ms = 5000;
|
||||
ctrlCmd.type = (uint16_t)type;
|
||||
@@ -729,7 +765,7 @@ static void *cam_frame_click(void *data)
|
||||
{
|
||||
LOGV("Entering cam_frame_click");
|
||||
|
||||
frameA = (msm_frame_t *)data;
|
||||
frameA = (msm_frame *)data;
|
||||
|
||||
struct sigaction act;
|
||||
|
||||
@@ -756,10 +792,7 @@ static void *cam_frame_click(void *data)
|
||||
timeout.tv_usec = 0;
|
||||
|
||||
ret = select(fd_frame+1, &readfds, NULL, NULL, &timeout);
|
||||
if (ret == -1) {
|
||||
LOGE("calling select failed!");
|
||||
break;
|
||||
} else if (FD_ISSET(fd_frame, &readfds)) {
|
||||
if (FD_ISSET(fd_frame, &readfds)) {
|
||||
pthread_mutex_lock(&mutex_camframe);
|
||||
// ready to get frame
|
||||
ret = ioctl(fd_frame, MSM_CAM_IOCTL_GETFRAME, frameA);
|
||||
@@ -772,6 +805,9 @@ static void *cam_frame_click(void *data)
|
||||
} else
|
||||
LOGE("MSM_CAM_IOCTL_GETFRAME error %s", strerror(errno));
|
||||
pthread_mutex_unlock(&mutex_camframe);
|
||||
} else if (ret == -1) {
|
||||
LOGE("calling select() failed!");
|
||||
break;
|
||||
} else {
|
||||
LOGV("frame is not ready! select returns %d", ret);
|
||||
usleep(100000);
|
||||
@@ -973,7 +1009,6 @@ void QualcommCameraHardware::runJpegEncodeThread(void *data)
|
||||
camera_position_type *npt = &pt;
|
||||
if(!encode_location) {
|
||||
npt = NULL;
|
||||
|
||||
}
|
||||
|
||||
int jpeg_quality = mParameters.getInt("jpeg-quality");
|
||||
@@ -1016,6 +1051,8 @@ bool QualcommCameraHardware::initPreview()
|
||||
}
|
||||
mSnapshotThreadWaitLock.unlock();
|
||||
|
||||
setZoom();
|
||||
|
||||
mPreviewFrameSize = mPreviewWidth * mPreviewHeight * 3/2;
|
||||
mPreviewHeap = new PreviewPmemPool(mCameraControlFd,
|
||||
mPreviewWidth * mPreviewHeight * 2,
|
||||
@@ -1233,7 +1270,7 @@ void QualcommCameraHardware::release()
|
||||
}
|
||||
|
||||
int rc;
|
||||
struct msm_ctrl_cmd_t ctrlCmd;
|
||||
struct msm_ctrl_cmd ctrlCmd;
|
||||
|
||||
if (mCameraRunning) {
|
||||
if (mMsgEnabled & CAMERA_MSG_VIDEO_FRAME) {
|
||||
@@ -1283,8 +1320,12 @@ void QualcommCameraHardware::release()
|
||||
libmmcamera_target = NULL;
|
||||
}
|
||||
|
||||
// FIXME: solve end of lib sometimes can fail
|
||||
Mutex::Autolock lock(&singleton_lock);
|
||||
singleton_releasing = true;
|
||||
singleton.clear();
|
||||
singleton_releasing = false;
|
||||
singleton_wait.signal();
|
||||
|
||||
LOGV("release X");
|
||||
}
|
||||
@@ -1608,6 +1649,12 @@ status_t QualcommCameraHardware::setParameters(
|
||||
else mDimension.ui_thumbnail_height = val;
|
||||
}
|
||||
|
||||
//User changed pic size, recheck zoom
|
||||
if (params.get("picture-size") != NULL && mParameters.get("picture-size") != NULL && strcmp(params.get("picture-size"), mParameters.get("picture-size")) != 0){
|
||||
prevzoom = 99;
|
||||
LOGV("setParameters: user/system modified pic size! rechecking zoom");
|
||||
}
|
||||
|
||||
// setParameters
|
||||
mParameters = params;
|
||||
|
||||
@@ -1689,7 +1736,7 @@ sp<QualcommCameraHardware> QualcommCameraHardware::getInstance()
|
||||
}
|
||||
|
||||
// passes the Addresses to CameraService to getPreviewHeap
|
||||
void QualcommCameraHardware::receivePreviewFrame(struct msm_frame_t *frame)
|
||||
void QualcommCameraHardware::receivePreviewFrame(struct msm_frame *frame)
|
||||
{
|
||||
if ( LOG_PREVIEW )
|
||||
LOGV("receivePreviewFrame E");
|
||||
@@ -1700,9 +1747,7 @@ void QualcommCameraHardware::receivePreviewFrame(struct msm_frame_t *frame)
|
||||
}
|
||||
|
||||
// Find the offset within the heap of the current buffer.
|
||||
ssize_t offset =
|
||||
(ssize_t)frame->buffer - (ssize_t)mPreviewHeap->mHeap->base();
|
||||
offset /= mPreviewFrameSize;
|
||||
ssize_t offset = 0;
|
||||
|
||||
mInPreviewCallback = true;
|
||||
if (mMsgEnabled & CAMERA_MSG_PREVIEW_FRAME)
|
||||
@@ -1883,6 +1928,18 @@ int QualcommCameraHardware::getParm(
|
||||
return attr_lookup(parm_map, str);
|
||||
}
|
||||
|
||||
const char* QualcommCameraHardware::getParm(
|
||||
const char *parm_str, const struct dstr_map *const parm_map)
|
||||
{
|
||||
// Check if the parameter exists.
|
||||
const char *str = mParameters.get(parm_str);
|
||||
if (str == NULL) return '\0';
|
||||
|
||||
// Look up the parameter value.
|
||||
return attr_lookup(parm_map, str);
|
||||
}
|
||||
|
||||
|
||||
void QualcommCameraHardware::setEffect()
|
||||
{
|
||||
int32_t value = getParm(CameraParameters::KEY_EFFECT, effect);
|
||||
@@ -1918,22 +1975,50 @@ void QualcommCameraHardware::setAntibanding()
|
||||
|
||||
void QualcommCameraHardware::setZoom()
|
||||
{
|
||||
int32_t level = mParameters.getInt(CameraParameters::KEY_ZOOM);
|
||||
|
||||
int32_t level;
|
||||
int32_t multiplier;
|
||||
int32_t zoomsel;
|
||||
bool iscamcorder = false;
|
||||
|
||||
// NOTE: ZOOM Routine
|
||||
LOGV(" *************************** ZOOM ROUTINE STARTED ****************************************************************************");
|
||||
if(native_get_maxzoom(mCameraControlFd,
|
||||
(void *)&mMaxZoom) == true){
|
||||
LOGD("Maximum zoom value is %d", mMaxZoom);
|
||||
LOGV("Maximum zoom value is %d", mMaxZoom);
|
||||
//maxZoom/5 in the ideal world, but it's stuck on 90
|
||||
multiplier = getParm("picture-size", picturesize);
|
||||
|
||||
LOGV("Multiplier: %d",multiplier);
|
||||
|
||||
//Camcorder mode uses preview size
|
||||
LOGD("preview-frame-rate: %s",mParameters.get("preview-frame-rate"));
|
||||
if (strcmp(mParameters.get("preview-frame-rate"),"30") != 0){
|
||||
multiplier = getParm("preview-size", picturesize);
|
||||
iscamcorder = true;
|
||||
LOGV("Multiplier: %d",multiplier);
|
||||
}
|
||||
LOGV("Multiplier: %d, PrevZoom: %d",multiplier,prevzoom);
|
||||
|
||||
zoomSupported = true;
|
||||
if(mMaxZoom > 0){
|
||||
//if max zoom is available find the zoom ratios
|
||||
int16_t * zoomRatios = new int16_t[mMaxZoom+1];
|
||||
if(zoomRatios == NULL){
|
||||
LOGE("Failed to get zoomratios...");
|
||||
delete zoomRatios;
|
||||
} else {
|
||||
LOGV("zoom ratios set");
|
||||
//To get more 'natural' zoom we reduce picture resolution
|
||||
//if the sensor can't cope with it
|
||||
zoomsel = mParameters.getInt(CameraParameters::KEY_ZOOM);
|
||||
|
||||
if(!iscamcorder && prevzoom > zoomsel){
|
||||
mParameters.set("picture-size", "2048x1536");
|
||||
LOGV("User panning, increasing picture quality to max");
|
||||
}
|
||||
prevzoom = zoomsel;
|
||||
while(!iscamcorder && zoomsel * 5 > 5 * multiplier && getParm("picture-size", reducesize) != NULL) {
|
||||
mParameters.set("picture-size", getParm("picture-size", reducesize));
|
||||
multiplier = getParm("picture-size", picturesize);
|
||||
LOGV("Reducing picture quality; new multiplier: %d", multiplier);
|
||||
}
|
||||
level = zoomsel * (iscamcorder ? (multiplier*5) / 6 : 5);
|
||||
//Update the parameters so initRaw doesn't use the wrong size later
|
||||
mParameters.getPictureSize(&mRawWidth, &mRawHeight);
|
||||
LOGV("Level: %d, Multiplier: %d ZoomSel: %d",level,multiplier,zoomsel);
|
||||
}
|
||||
} else {
|
||||
zoomSupported = false;
|
||||
@@ -1942,24 +2027,29 @@ void QualcommCameraHardware::setZoom()
|
||||
mMaxZoom = 0;
|
||||
}
|
||||
|
||||
if (level > mMaxZoom) {
|
||||
if (level >= mMaxZoom) {
|
||||
level = mMaxZoom;
|
||||
LOGV("Level=Maxzoom: %d",level);
|
||||
}
|
||||
|
||||
LOGV("Set Zoom level: %d current: %d maximum: %d", level, mCurZoom, mMaxZoom);
|
||||
|
||||
if (level == mCurZoom) {
|
||||
LOGV("Level=Curzoom: %d",level);
|
||||
LOGV(" *************************** ZOOM ROUTINE ENDED ******************************************************************************");
|
||||
return;
|
||||
}
|
||||
|
||||
if (level != -1) {
|
||||
level*=ZOOM_STEP;
|
||||
LOGV("Final Zoom Level: %d", level);
|
||||
if (level >= 0 && level <= mMaxZoom) {
|
||||
native_set_parm(CAMERA_SET_PARM_ZOOM, sizeof(level), (void *)&level);
|
||||
usleep(35000);
|
||||
mCurZoom = level;
|
||||
}
|
||||
}
|
||||
LOGV(" *************************** ZOOM ROUTINE ENDED ******************************************************************************");
|
||||
|
||||
}
|
||||
|
||||
QualcommCameraHardware::MemPool::MemPool(int buffer_size, int num_buffers,
|
||||
@@ -2023,13 +2113,13 @@ static bool register_buf(int camfd,
|
||||
int pmempreviewfd,
|
||||
uint32_t offset,
|
||||
uint8_t *buf,
|
||||
msm_pmem_t pmem_type,
|
||||
msm_pmem pmem_type,
|
||||
bool active,
|
||||
bool register_buffer = true);
|
||||
|
||||
QualcommCameraHardware::PmemPool::PmemPool(const char *pmem_pool,
|
||||
int camera_control_fd,
|
||||
msm_pmem_t pmem_type,
|
||||
msm_pmem pmem_type,
|
||||
int buffer_size,
|
||||
int num_buffers,
|
||||
int frame_size,
|
||||
@@ -2155,11 +2245,11 @@ static bool register_buf(int camfd,
|
||||
int pmempreviewfd,
|
||||
uint32_t offset,
|
||||
uint8_t *buf,
|
||||
msm_pmem_t pmem_type,
|
||||
msm_pmem pmem_type,
|
||||
bool active,
|
||||
bool register_buffer)
|
||||
{
|
||||
struct msm_pmem_info_t pmemBuf;
|
||||
struct msm_pmem_info pmemBuf;
|
||||
|
||||
pmemBuf.type = pmem_type;
|
||||
pmemBuf.fd = pmempreviewfd;
|
||||
@@ -2272,7 +2362,7 @@ status_t QualcommCameraHardware::MemPool::dump(int fd, const Vector<String16>& a
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
static void receive_camframe_callback(struct msm_frame_t *frame)
|
||||
static void receive_camframe_callback(struct msm_frame *frame)
|
||||
{
|
||||
if ( LOG_PREVIEW )
|
||||
LOGV("receive_camframe_callback E");
|
||||
|
||||
@@ -33,7 +33,7 @@ extern "C" {
|
||||
|
||||
#define CAM_CTRL_SUCCESS 1
|
||||
|
||||
#define REVISION_H "2"
|
||||
#define REVISION_H "4"
|
||||
|
||||
#define CAMERA_SET_PARM_DIMENSION 1
|
||||
#define CAMERA_SET_PARM_ZOOM 2
|
||||
@@ -144,6 +144,11 @@ struct str_map {
|
||||
int val;
|
||||
};
|
||||
|
||||
struct dstr_map {
|
||||
const char *const desc;
|
||||
const char *const val;
|
||||
};
|
||||
|
||||
// ********************************************************************************************************
|
||||
typedef unsigned int exif_tag_id_t;
|
||||
|
||||
@@ -232,19 +237,19 @@ public:
|
||||
bool reg_unreg_buf(int camfd,
|
||||
int width,
|
||||
int height,
|
||||
msm_frame_t *frame,
|
||||
msm_pmem_t pmem_type,
|
||||
msm_frame *frame,
|
||||
msm_pmem pmem_type,
|
||||
unsigned char unregister,
|
||||
unsigned char active);
|
||||
void native_register_preview_bufs(int camfd,
|
||||
void *pDim,
|
||||
struct msm_frame_t *frame,
|
||||
struct msm_frame *frame,
|
||||
unsigned char active);
|
||||
void native_unregister_preview_bufs(int camfd,
|
||||
void *pDim,
|
||||
struct msm_frame_t *frame);
|
||||
struct msm_frame *frame);
|
||||
|
||||
void receivePreviewFrame(struct msm_frame_t *frame);
|
||||
void receivePreviewFrame(struct msm_frame *frame);
|
||||
void receiveJpegPicture(void);
|
||||
void receiveJpegPictureFragment(uint8_t *buf, uint32_t size);
|
||||
void notifyShutter();
|
||||
@@ -261,6 +266,7 @@ private:
|
||||
bool native_set_parm(cam_ctrl_type type, uint16_t length, void *value);
|
||||
bool native_set_dimension(cam_ctrl_dimension_t *value);
|
||||
int getParm(const char *parm_str, const str_map *parm_map);
|
||||
const char* getParm(const char *parm_str, const dstr_map *parm_map);
|
||||
void setGpsParameters();
|
||||
const char *KEY_GPS_LATITUDE;
|
||||
|
||||
@@ -325,13 +331,13 @@ private:
|
||||
struct PmemPool : public MemPool {
|
||||
PmemPool(const char *pmem_pool,
|
||||
int control_camera_fd,
|
||||
msm_pmem_t pmem_type,
|
||||
msm_pmem pmem_type,
|
||||
int buffer_size, int num_buffers,
|
||||
int frame_size, int frame_offset,
|
||||
const char *name);
|
||||
virtual ~PmemPool();
|
||||
int mFd;
|
||||
msm_pmem_t mPmemType;
|
||||
msm_pmem mPmemType;
|
||||
int mCameraControlFd;
|
||||
uint32_t mAlignedSize;
|
||||
struct pmem_region mSize;
|
||||
@@ -429,7 +435,7 @@ private:
|
||||
|
||||
common_crop_t mCrop;
|
||||
|
||||
struct msm_frame_t frames[kPreviewBufferCount];
|
||||
struct msm_frame frames[kPreviewBufferCount];
|
||||
bool mInPreviewCallback;
|
||||
bool mCameraRecording;
|
||||
int32_t mCurZoom;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#include "jhead.h"
|
||||
#define LOG_TAG "ExifWriterCamera"
|
||||
//#define LOG_NDEBUG 0
|
||||
// #define LOG_NDEBUG 0
|
||||
|
||||
#include <utils/Log.h>
|
||||
|
||||
@@ -17,6 +17,10 @@
|
||||
#define TAG_ORIENTATION 0x0112
|
||||
#define TAG_MAKE 0x010F
|
||||
#define TAG_MODEL 0x0110
|
||||
#define TAG_IMAGE_WIDTH 0x0100
|
||||
#define TAG_IMAGE_LENGTH 0x0101
|
||||
#define TAG_EXIF_VERSION 0x9000
|
||||
#define EXIF_TOTAL_DATA 2
|
||||
|
||||
|
||||
float *float2degminsec( float deg )
|
||||
@@ -127,7 +131,7 @@ static void dump_to_file(const char *fname,
|
||||
}
|
||||
|
||||
void writeExif( void *origData, void *destData , int origSize , uint32_t *resultSize, int orientation,camera_position_type *pt ) {
|
||||
const char *filename = "/data/temp.jpg";
|
||||
const char *filename = "/cache/tmp/temp.jpg";
|
||||
|
||||
dump_to_file( filename, (uint8_t *)origData, origSize );
|
||||
LOGV("WRITE EXIF Filename %s", filename);
|
||||
@@ -149,7 +153,7 @@ void writeExif( void *origData, void *destData , int origSize , uint32_t *result
|
||||
}
|
||||
|
||||
|
||||
ExifElement_t *t = (ExifElement_t *)malloc( sizeof(ExifElement_t)*(3+gpsTag) );
|
||||
ExifElement_t *t = (ExifElement_t *)malloc( sizeof(ExifElement_t)*(EXIF_TOTAL_DATA+gpsTag) );
|
||||
|
||||
ExifElement_t *it = t;
|
||||
// Store file date/time.
|
||||
@@ -159,31 +163,21 @@ void writeExif( void *origData, void *destData , int origSize , uint32_t *result
|
||||
unsigned short v;
|
||||
LOGV("EXIF Orientation %d º", orientation);
|
||||
if( orientation == 90 ) {
|
||||
(*it).Value = "6";
|
||||
(*it).Value = "6\0";
|
||||
} else if( orientation == 180 ) {
|
||||
(*it).Value = "3";
|
||||
(*it).Value = "3\0";
|
||||
} else {
|
||||
(*it).Value = "1";
|
||||
(*it).Value = "1\0";
|
||||
}
|
||||
(*it).GpsTag = FALSE;
|
||||
|
||||
it++;
|
||||
|
||||
(*it).Tag = TAG_MAKE;
|
||||
(*it).Format = FMT_STRING;
|
||||
(*it).Value = "HTC";
|
||||
(*it).DataLength = 8;
|
||||
(*it).GpsTag = FALSE;
|
||||
|
||||
it++;
|
||||
|
||||
(*it).Tag = TAG_MODEL;
|
||||
(*it).Format = FMT_STRING;
|
||||
(*it).Value = "Tattoo with CyanogenMOD";
|
||||
(*it).DataLength = 18;
|
||||
(*it).Value = "Tattoo with CyanogenMOD\0";
|
||||
(*it).DataLength = 24;
|
||||
(*it).GpsTag = FALSE;
|
||||
|
||||
|
||||
if( pt != NULL ) {
|
||||
LOGV("pt->latitude == %f", pt->latitude );
|
||||
LOGV("pt->longitude == %f", pt->longitude );
|
||||
@@ -193,70 +187,61 @@ void writeExif( void *origData, void *destData , int origSize , uint32_t *result
|
||||
(*it).Tag = 0x01;
|
||||
(*it).Format = FMT_STRING;
|
||||
if( pt->latitude > 0 ) {
|
||||
(*it).Value = "N";
|
||||
(*it).Value = "N\0";
|
||||
} else {
|
||||
(*it).Value = "S";
|
||||
(*it).Value = "S\0";
|
||||
}
|
||||
(*it).DataLength = 2;
|
||||
(*it).GpsTag = TRUE;
|
||||
|
||||
it++;
|
||||
char *mylat = coord2degminsec( pt->latitude );
|
||||
LOGV("writeExif: La latitud queda en: %s", mylat);
|
||||
(*it).Value = coord2degminsec( pt->latitude );
|
||||
LOGV("writeExif: La latitud queda en: %s", (*it).Value);
|
||||
|
||||
(*it).Tag = 0x02;
|
||||
(*it).Format = FMT_URATIONAL;
|
||||
(*it).Value = mylat;
|
||||
(*it).DataLength = 3;
|
||||
(*it).GpsTag = TRUE;
|
||||
free( mylat );
|
||||
|
||||
it++;
|
||||
(*it).Tag = 0x03;
|
||||
(*it).Format = FMT_STRING;
|
||||
if( (*pt).longitude > 0 ) {
|
||||
(*it).Value = "E";
|
||||
(*it).Value = "E\0";
|
||||
} else {
|
||||
(*it).Value = "W";
|
||||
(*it).Value = "W\0";
|
||||
}
|
||||
(*it).DataLength = 2;
|
||||
(*it).GpsTag = TRUE;
|
||||
|
||||
it++;
|
||||
char *mylong = coord2degminsec( (*pt).longitude );
|
||||
LOGV("writeExif: La longitud queda en: %s", mylong);
|
||||
(*it).Value = coord2degminsec( pt->longitude );
|
||||
LOGV("writeExif: La longitud queda en: %s", (*it).Value);
|
||||
|
||||
(*it).Tag = 0x04;
|
||||
(*it).Format = FMT_URATIONAL;
|
||||
(*it).Value = mylong;
|
||||
(*it).DataLength = 3;
|
||||
(*it).GpsTag = TRUE;
|
||||
|
||||
free( mylong );
|
||||
|
||||
it++;
|
||||
(*it).Tag = 0x05;
|
||||
(*it).Format = FMT_USHORT;
|
||||
if( (*pt).altitude > 0 ) {
|
||||
(*it).Value = "0";
|
||||
(*it).Value = "0\0";
|
||||
} else {
|
||||
(*it).Value = "1";
|
||||
(*it).Value = "1\0";
|
||||
}
|
||||
(*it).DataLength = 1;
|
||||
(*it).GpsTag = TRUE;
|
||||
|
||||
it++;
|
||||
char *myalt = float2rationnal( fabs( (*pt).altitude ) );
|
||||
LOGV("writeExif: La altitud queda en: %s", myalt);
|
||||
(*it).Value = float2rationnal( fabs( pt->altitude ) );
|
||||
LOGV("writeExif: La altitud queda en: %s", (*it).Value);
|
||||
|
||||
(*it).Tag = 0x06;
|
||||
(*it).Format = FMT_SRATIONAL;
|
||||
(*it).Value = myalt;
|
||||
(*it).DataLength = 1;
|
||||
(*it).GpsTag = TRUE;
|
||||
|
||||
free( myalt );
|
||||
|
||||
}
|
||||
|
||||
{
|
||||
@@ -275,7 +260,7 @@ void writeExif( void *origData, void *destData , int origSize , uint32_t *result
|
||||
int res = ReadJpegFile(filename, (ReadMode_t)ReadMode );
|
||||
LOGV("READ EXIF Filename %s", filename);
|
||||
|
||||
create_EXIF( t, 3, gpsTag);
|
||||
create_EXIF( t, EXIF_TOTAL_DATA, gpsTag);
|
||||
|
||||
WriteJpegFile(filename);
|
||||
chmod( filename, S_IRWXU );
|
||||
@@ -290,5 +275,7 @@ void writeExif( void *origData, void *destData , int origSize , uint32_t *result
|
||||
|
||||
int read = fread( destData, 1, (*resultSize), src );
|
||||
|
||||
free( t );
|
||||
|
||||
unlink( filename );
|
||||
}
|
||||
|
||||
@@ -24,70 +24,70 @@
|
||||
#define MSM_CAM_IOCTL_MAGIC 'm'
|
||||
|
||||
#define MSM_CAM_IOCTL_GET_SENSOR_INFO \
|
||||
_IOR(MSM_CAM_IOCTL_MAGIC, 1, struct msm_camsensor_info_t *)
|
||||
_IOR(MSM_CAM_IOCTL_MAGIC, 1, struct msm_camsensor_info *)
|
||||
|
||||
#define MSM_CAM_IOCTL_REGISTER_PMEM \
|
||||
_IOW(MSM_CAM_IOCTL_MAGIC, 2, struct msm_pmem_info_t *)
|
||||
_IOW(MSM_CAM_IOCTL_MAGIC, 2, struct msm_pmem_info *)
|
||||
|
||||
#define MSM_CAM_IOCTL_UNREGISTER_PMEM \
|
||||
_IOW(MSM_CAM_IOCTL_MAGIC, 3, unsigned)
|
||||
|
||||
#define MSM_CAM_IOCTL_CTRL_COMMAND \
|
||||
_IOW(MSM_CAM_IOCTL_MAGIC, 4, struct msm_ctrl_cmd_t *)
|
||||
_IOW(MSM_CAM_IOCTL_MAGIC, 4, struct msm_ctrl_cmd *)
|
||||
|
||||
#define MSM_CAM_IOCTL_CONFIG_VFE \
|
||||
_IOW(MSM_CAM_IOCTL_MAGIC, 5, struct msm_camera_vfe_cfg_cmd_t *)
|
||||
_IOW(MSM_CAM_IOCTL_MAGIC, 5, struct msm_camera_vfe_cfg_cmd *)
|
||||
|
||||
#define MSM_CAM_IOCTL_GET_STATS \
|
||||
_IOR(MSM_CAM_IOCTL_MAGIC, 6, struct msm_camera_stats_event_ctrl_t *)
|
||||
_IOR(MSM_CAM_IOCTL_MAGIC, 6, struct msm_camera_stats_event_ctrl *)
|
||||
|
||||
#define MSM_CAM_IOCTL_GETFRAME \
|
||||
_IOR(MSM_CAM_IOCTL_MAGIC, 7, struct msm_camera_get_frame_t *)
|
||||
_IOR(MSM_CAM_IOCTL_MAGIC, 7, struct msm_camera_get_frame *)
|
||||
|
||||
#define MSM_CAM_IOCTL_ENABLE_VFE \
|
||||
_IOW(MSM_CAM_IOCTL_MAGIC, 8, struct camera_enable_cmd_t *)
|
||||
_IOW(MSM_CAM_IOCTL_MAGIC, 8, struct camera_enable_cmd *)
|
||||
|
||||
#define MSM_CAM_IOCTL_CTRL_CMD_DONE \
|
||||
_IOW(MSM_CAM_IOCTL_MAGIC, 9, struct camera_cmd_t *)
|
||||
_IOW(MSM_CAM_IOCTL_MAGIC, 9, struct camera_cmd *)
|
||||
|
||||
#define MSM_CAM_IOCTL_CONFIG_CMD \
|
||||
_IOW(MSM_CAM_IOCTL_MAGIC, 10, struct camera_cmd_t *)
|
||||
_IOW(MSM_CAM_IOCTL_MAGIC, 10, struct camera_cmd *)
|
||||
|
||||
#define MSM_CAM_IOCTL_DISABLE_VFE \
|
||||
_IOW(MSM_CAM_IOCTL_MAGIC, 11, struct camera_enable_cmd_t *)
|
||||
_IOW(MSM_CAM_IOCTL_MAGIC, 11, struct camera_enable_cmd *)
|
||||
|
||||
#define MSM_CAM_IOCTL_PAD_REG_RESET2 \
|
||||
_IOW(MSM_CAM_IOCTL_MAGIC, 12, struct camera_enable_cmd_t *)
|
||||
_IOW(MSM_CAM_IOCTL_MAGIC, 12, struct camera_enable_cmd *)
|
||||
|
||||
#define MSM_CAM_IOCTL_VFE_APPS_RESET \
|
||||
_IOW(MSM_CAM_IOCTL_MAGIC, 13, struct camera_enable_cmd_t *)
|
||||
_IOW(MSM_CAM_IOCTL_MAGIC, 13, struct camera_enable_cmd *)
|
||||
|
||||
#define MSM_CAM_IOCTL_RELEASE_FRAMEE_BUFFER \
|
||||
_IOW(MSM_CAM_IOCTL_MAGIC, 14, struct camera_enable_cmd_t *)
|
||||
_IOW(MSM_CAM_IOCTL_MAGIC, 14, struct camera_enable_cmd *)
|
||||
|
||||
#define MSM_CAM_IOCTL_RELEASE_STATS_BUFFER \
|
||||
_IOW(MSM_CAM_IOCTL_MAGIC, 15, struct msm_stats_buf_t *)
|
||||
_IOW(MSM_CAM_IOCTL_MAGIC, 15, struct msm_stats_buf *)
|
||||
|
||||
#define MSM_CAM_IOCTL_AXI_CONFIG \
|
||||
_IOW(MSM_CAM_IOCTL_MAGIC, 16, struct msm_camera_vfe_cfg_cmd_t *)
|
||||
_IOW(MSM_CAM_IOCTL_MAGIC, 16, struct msm_camera_vfe_cfg_cmd *)
|
||||
|
||||
#define MSM_CAM_IOCTL_GET_PICTURE \
|
||||
_IOW(MSM_CAM_IOCTL_MAGIC, 17, struct msm_camera_ctrl_cmd_t *)
|
||||
_IOW(MSM_CAM_IOCTL_MAGIC, 17, struct msm_camera_ctrl_cmd *)
|
||||
|
||||
#define MSM_CAM_IOCTL_SET_CROP \
|
||||
_IOW(MSM_CAM_IOCTL_MAGIC, 18, struct crop_info_t *)
|
||||
_IOW(MSM_CAM_IOCTL_MAGIC, 18, struct crop_info *)
|
||||
|
||||
#define MSM_CAM_IOCTL_PICT_PP \
|
||||
_IOW(MSM_CAM_IOCTL_MAGIC, 19, uint8_t *)
|
||||
|
||||
#define MSM_CAM_IOCTL_PICT_PP_DONE \
|
||||
_IOW(MSM_CAM_IOCTL_MAGIC, 20, struct msm_snapshot_pp_status_t *)
|
||||
_IOW(MSM_CAM_IOCTL_MAGIC, 20, struct msm_snapshot_pp_status *)
|
||||
|
||||
#define MSM_CAM_IOCTL_SENSOR_IO_CFG \
|
||||
_IOW(MSM_CAM_IOCTL_MAGIC, 21, struct sensor_cfg_data_t *)
|
||||
_IOW(MSM_CAM_IOCTL_MAGIC, 21, struct sensor_cfg_data *)
|
||||
|
||||
#define MSM_CAM_IOCTL_FLASH_LED_CFG \
|
||||
_IOW(MSM_CAM_IOCTL_MAGIC, 22, enum msm_camera_led_state_t *)
|
||||
_IOW(MSM_CAM_IOCTL_MAGIC, 22, enum msm_camera_led_state *)
|
||||
|
||||
#define MAX_SENSOR_NUM 3
|
||||
#define MAX_SENSOR_NAME 32
|
||||
@@ -95,7 +95,7 @@
|
||||
/*****************************************************
|
||||
* enum
|
||||
*****************************************************/
|
||||
enum msm_camera_update_t {
|
||||
enum msm_camera_update {
|
||||
MSM_CAM_CTRL_CMD_DONE,
|
||||
MSM_CAM_SENSOR_VFE_CMD,
|
||||
};
|
||||
@@ -112,7 +112,7 @@ enum msm_camera_update_t {
|
||||
* 1. control command: control command(from control thread),
|
||||
* control status (from config thread);
|
||||
*/
|
||||
struct msm_ctrl_cmd_t {
|
||||
struct msm_ctrl_cmd {
|
||||
int timeout_ms;
|
||||
uint16_t type;
|
||||
uint16_t length;
|
||||
@@ -120,14 +120,14 @@ struct msm_ctrl_cmd_t {
|
||||
uint16_t status;
|
||||
};
|
||||
|
||||
struct msm_vfe_evt_msg_t {
|
||||
struct msm_vfe_evt_msg {
|
||||
unsigned short type; /* 1 == event (RPC), 0 == message (adsp) */
|
||||
unsigned short msg_id;
|
||||
unsigned int len; /* size in, number of bytes out */
|
||||
unsigned char *data;
|
||||
};
|
||||
|
||||
enum msm_camera_resp_t {
|
||||
enum msm_camera_resp {
|
||||
MSM_CAM_RESP_CTRL,
|
||||
MSM_CAM_RESP_STAT_EVT_MSG,
|
||||
MSM_CAM_RESP_V4L2,
|
||||
@@ -140,15 +140,15 @@ struct msm_stats_event_ctrl {
|
||||
/* 0 - ctrl_cmd from control thread,
|
||||
* 1 - stats/event kernel,
|
||||
* 2 - V4L control or read request */
|
||||
enum msm_camera_resp_t resptype;
|
||||
enum msm_camera_resp resptype;
|
||||
int timeout_ms;
|
||||
struct msm_ctrl_cmd_t ctrl_cmd;
|
||||
struct msm_ctrl_cmd ctrl_cmd;
|
||||
/* struct vfe_event_t stats_event; */
|
||||
struct msm_vfe_evt_msg_t stats_event;
|
||||
struct msm_vfe_evt_msg stats_event;
|
||||
};
|
||||
|
||||
/* 2. config command: config command(from config thread); */
|
||||
struct msm_camera_cfg_cmd_t {
|
||||
struct msm_camera_cfg_cmd {
|
||||
/* what to config:
|
||||
* 1 - sensor config, 2 - vfe config */
|
||||
uint16_t cfg_type;
|
||||
@@ -160,7 +160,7 @@ struct msm_camera_cfg_cmd_t {
|
||||
void *value;
|
||||
};
|
||||
|
||||
enum cfg_cmd_type_t {
|
||||
enum cfg_cmd_type {
|
||||
CMD_GENERAL,
|
||||
CMD_AXI_CFG_OUT1,
|
||||
CMD_AXI_CFG_SNAP_O1_AND_O2,
|
||||
@@ -183,18 +183,18 @@ enum cfg_cmd_type_t {
|
||||
};
|
||||
|
||||
/* vfe config command: config command(from config thread)*/
|
||||
struct msm_vfe_cfg_cmd_t {
|
||||
enum cfg_cmd_type_t cmd_type;
|
||||
struct msm_vfe_cfg_cmd {
|
||||
enum cfg_cmd_type cmd_type;
|
||||
uint16_t length;
|
||||
void *value;
|
||||
};
|
||||
|
||||
struct camera_enable_cmd_t {
|
||||
struct camera_enable_cmd {
|
||||
char *name;
|
||||
uint16_t length;
|
||||
};
|
||||
|
||||
enum msm_pmem_t {
|
||||
enum msm_pmem {
|
||||
MSM_PMEM_OUTPUT1,
|
||||
MSM_PMEM_OUTPUT2,
|
||||
MSM_PMEM_OUTPUT1_OUTPUT2,
|
||||
@@ -207,7 +207,7 @@ enum msm_pmem_t {
|
||||
MSM_PMEM_MAX
|
||||
};
|
||||
|
||||
enum msm_camera_out_frame_t {
|
||||
enum msm_camera_out_frame {
|
||||
FRAME_PREVIEW_OUTPUT1,
|
||||
FRAME_PREVIEW_OUTPUT2,
|
||||
FRAME_SNAPSHOT,
|
||||
@@ -216,8 +216,8 @@ enum msm_camera_out_frame_t {
|
||||
FRAME_MAX
|
||||
};
|
||||
|
||||
struct msm_pmem_info_t {
|
||||
enum msm_pmem_t type;
|
||||
struct msm_pmem_info {
|
||||
enum msm_pmem type;
|
||||
int fd;
|
||||
void *vaddr;
|
||||
uint32_t y_off;
|
||||
@@ -225,7 +225,7 @@ struct msm_pmem_info_t {
|
||||
uint8_t active;
|
||||
};
|
||||
|
||||
struct outputCfg_t {
|
||||
struct outputCfg {
|
||||
uint32_t height;
|
||||
uint32_t width;
|
||||
|
||||
@@ -233,7 +233,7 @@ struct outputCfg_t {
|
||||
uint32_t window_height_lastline;
|
||||
};
|
||||
|
||||
enum vfeoutput_mode_t {
|
||||
enum vfeoutput_mode {
|
||||
OUTPUT_1,
|
||||
OUTPUT_2,
|
||||
OUTPUT_1_AND_2,
|
||||
@@ -249,7 +249,7 @@ enum msm_frame_path {
|
||||
MSM_FRAME_ENC,
|
||||
};
|
||||
|
||||
struct msm_frame_t {
|
||||
struct msm_frame {
|
||||
enum msm_frame_path path;
|
||||
unsigned long buffer;
|
||||
uint32_t y_off;
|
||||
@@ -266,13 +266,13 @@ enum stat_type {
|
||||
STAT_MAX,
|
||||
};
|
||||
|
||||
struct msm_stats_buf_t {
|
||||
struct msm_stats_buf {
|
||||
enum stat_type type;
|
||||
unsigned long buffer;
|
||||
int fd;
|
||||
};
|
||||
|
||||
enum msm_v4l2_ctrl_t {
|
||||
enum msm_v4l2_ctrl {
|
||||
MSM_V4L2_VID_CAP_TYPE,
|
||||
MSM_V4L2_STREAM_ON,
|
||||
MSM_V4L2_STREAM_OFF,
|
||||
@@ -285,23 +285,23 @@ enum msm_v4l2_ctrl_t {
|
||||
MSM_V4L2_MAX
|
||||
};
|
||||
|
||||
struct crop_info_t {
|
||||
struct crop_info {
|
||||
void *info;
|
||||
int len;
|
||||
};
|
||||
|
||||
struct msm_postproc_t {
|
||||
struct msm_postproc {
|
||||
int ftnum;
|
||||
struct msm_frame_t fthumnail;
|
||||
struct msm_frame fthumnail;
|
||||
int fmnum;
|
||||
struct msm_frame_t fmain;
|
||||
struct msm_frame fmain;
|
||||
};
|
||||
|
||||
struct msm_snapshot_pp_status_t {
|
||||
struct msm_snapshot_pp_status {
|
||||
void *status;
|
||||
};
|
||||
|
||||
enum sensor_cfg_t {
|
||||
enum sensor_cfg {
|
||||
CFG_SET_MODE,
|
||||
CFG_SET_EFFECT,
|
||||
CFG_START,
|
||||
@@ -335,24 +335,24 @@ enum sensor_cfg_t {
|
||||
CFG_MAX
|
||||
};
|
||||
|
||||
enum sensor_move_focus_t {
|
||||
enum sensor_move_focus {
|
||||
MOVE_NEAR,
|
||||
MOVE_FAR
|
||||
};
|
||||
|
||||
enum sensor_mode_t {
|
||||
enum sensor_mode {
|
||||
SENSOR_PREVIEW_MODE,
|
||||
SENSOR_SNAPSHOT_MODE,
|
||||
SENSOR_RAW_SNAPSHOT_MODE
|
||||
};
|
||||
|
||||
enum sensor_resolution_t {
|
||||
enum sensor_resolution {
|
||||
SENSOR_QTR_SIZE,
|
||||
SENSOR_FULL_SIZE,
|
||||
SENSOR_INVALID_SIZE,
|
||||
};
|
||||
|
||||
enum camera_effect_t {
|
||||
enum camera_effect {
|
||||
CAMERA_EFFECT_MIN_MINUS_1,
|
||||
CAMERA_EFFECT_OFF = 1, /* This list must match aeecamera.h */
|
||||
CAMERA_EFFECT_MONO,
|
||||
@@ -381,7 +381,7 @@ struct exp_gain_cfg {
|
||||
|
||||
struct focus_cfg {
|
||||
int32_t steps;
|
||||
enum sensor_move_focus_t dir;
|
||||
enum sensor_move_focus dir;
|
||||
};
|
||||
|
||||
struct fps_cfg {
|
||||
@@ -390,16 +390,16 @@ struct fps_cfg {
|
||||
uint32_t pict_fps_div;
|
||||
};
|
||||
|
||||
enum msm_camera_led_state_t {
|
||||
enum msm_camera_led_state {
|
||||
MSM_LED_OFF,
|
||||
MSM_LED_LOW,
|
||||
MSM_LED_HIGH
|
||||
};
|
||||
|
||||
struct sensor_cfg_data_t {
|
||||
enum sensor_cfg_t cfgtype;
|
||||
enum sensor_mode_t mode;
|
||||
enum sensor_resolution_t rs;
|
||||
struct sensor_cfg_data {
|
||||
enum sensor_cfg cfgtype;
|
||||
enum sensor_mode mode;
|
||||
enum sensor_resolution rs;
|
||||
|
||||
union {
|
||||
int8_t effect;
|
||||
@@ -417,7 +417,7 @@ struct sensor_cfg_data_t {
|
||||
} cfg;
|
||||
};
|
||||
|
||||
enum sensor_get_info_t {
|
||||
enum sensor_get_info {
|
||||
GET_NAME,
|
||||
GET_PREVIEW_LINE_PER_FRAME,
|
||||
GET_PREVIEW_PIXELS_PER_LINE,
|
||||
@@ -427,7 +427,7 @@ enum sensor_get_info_t {
|
||||
GET_SNAPSHOT_MAX_EP_LINE_CNT,
|
||||
};
|
||||
|
||||
struct msm_camsensor_info_t {
|
||||
struct msm_camsensor_info {
|
||||
char name[MAX_SENSOR_NAME];
|
||||
int8_t flash_enabled;
|
||||
};
|
||||
|
||||
@@ -23,7 +23,7 @@ LOCAL_PRELINK_MODULE := false
|
||||
LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
|
||||
LOCAL_SHARED_LIBRARIES := liblog
|
||||
LOCAL_SRC_FILES := copybit.cpp
|
||||
LOCAL_MODULE := copybit.bahamas
|
||||
LOCAL_MODULE := copybit.$(TARGET_BOOTLOADER_BOARD_NAME)
|
||||
LOCAL_C_INCLUDES += hardware/msm7k/libgralloc
|
||||
LOCAL_CFLAGS += -DCOPYBIT_MSM7K=1
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
/******************************************************************************/
|
||||
|
||||
#if defined(COPYBIT_MSM7K)
|
||||
#define MAX_SCALE_FACTOR (3)
|
||||
#define MAX_SCALE_FACTOR (4)
|
||||
#define MAX_DIMENSION (4096)
|
||||
#elif defined(COPYBIT_QSD8K)
|
||||
#define MAX_SCALE_FACTOR (8)
|
||||
@@ -131,27 +131,18 @@ static int get_format(int format) {
|
||||
}
|
||||
|
||||
/** convert from copybit image to mdp image structure */
|
||||
static void set_image(struct mdp_img *img, const struct copybit_image_t *rhs)
|
||||
static void set_image(struct mdp_img *img, const struct copybit_image_t *rhs)
|
||||
{
|
||||
private_handle_t* hnd = (private_handle_t*)rhs->handle;
|
||||
if(hnd == NULL){
|
||||
LOGE("copybit: Invalid handle");
|
||||
return;
|
||||
}
|
||||
img->width = rhs->w;
|
||||
img->height = rhs->h;
|
||||
img->format = get_format(rhs->format);
|
||||
img->offset = hnd->offset;
|
||||
#if defined(COPYBIT_MSM7K)
|
||||
if (hnd->flags & private_handle_t::PRIV_FLAGS_USES_GPU) {
|
||||
img->offset += hnd->map_offset;
|
||||
img->memory_id = hnd->gpu_fd;
|
||||
if (img->format == MDP_RGBA_8888) {
|
||||
// msm7201A GPU only supports BGRA_8888 destinations
|
||||
img->format = MDP_BGRA_8888;
|
||||
}
|
||||
} else {
|
||||
img->memory_id = hnd->fd;
|
||||
}
|
||||
#else
|
||||
img->memory_id = hnd->fd;
|
||||
#endif
|
||||
}
|
||||
/** setup rectangles */
|
||||
static void set_rects(struct copybit_context_t *dev,
|
||||
@@ -194,14 +185,17 @@ static void set_rects(struct copybit_context_t *dev,
|
||||
}
|
||||
|
||||
/** setup mdp request */
|
||||
static void set_infos(struct copybit_context_t *dev, struct mdp_blit_req *req) {
|
||||
static void set_infos(struct copybit_context_t *dev, struct mdp_blit_req *req, int flags) {
|
||||
req->alpha = dev->mAlpha;
|
||||
req->transp_mask = MDP_TRANSP_NOP;
|
||||
req->flags = dev->mFlags | MDP_BLEND_FG_PREMULT;
|
||||
req->flags = dev->mFlags | flags;
|
||||
#if defined(COPYBIT_QSD8K)
|
||||
req->flags |= MDP_BLEND_FG_PREMULT;
|
||||
#endif
|
||||
}
|
||||
|
||||
/** copy the bits */
|
||||
static int msm_copybit(struct copybit_context_t *dev, void const *list)
|
||||
static int msm_copybit(struct copybit_context_t *dev, void const *list)
|
||||
{
|
||||
int err = ioctl(dev->mFD, MSMFB_BLIT,
|
||||
(struct mdp_blit_req_list const*)list);
|
||||
@@ -245,7 +239,7 @@ static int msm_copybit(struct copybit_context_t *dev, void const *list)
|
||||
static int set_parameter_copybit(
|
||||
struct copybit_device_t *dev,
|
||||
int name,
|
||||
int value)
|
||||
int value)
|
||||
{
|
||||
struct copybit_context_t* ctx = (struct copybit_context_t*)dev;
|
||||
int status = 0;
|
||||
@@ -308,7 +302,7 @@ static int set_parameter_copybit(
|
||||
}
|
||||
|
||||
/** Get a static info value */
|
||||
static int get(struct copybit_device_t *dev, int name)
|
||||
static int get(struct copybit_device_t *dev, int name)
|
||||
{
|
||||
struct copybit_context_t* ctx = (struct copybit_context_t*)dev;
|
||||
int value;
|
||||
@@ -342,7 +336,7 @@ static int stretch_copybit(
|
||||
struct copybit_image_t const *src,
|
||||
struct copybit_rect_t const *dst_rect,
|
||||
struct copybit_rect_t const *src_rect,
|
||||
struct copybit_region_t const *region)
|
||||
struct copybit_region_t const *region)
|
||||
{
|
||||
struct copybit_context_t* ctx = (struct copybit_context_t*)dev;
|
||||
int status = 0;
|
||||
@@ -383,7 +377,9 @@ static int stretch_copybit(
|
||||
while ((status == 0) && region->next(region, &clip)) {
|
||||
intersect(&clip, &bounds, &clip);
|
||||
mdp_blit_req* req = &list.req[list.count];
|
||||
set_infos(ctx, req);
|
||||
int flags = 0;
|
||||
|
||||
set_infos(ctx, req, flags);
|
||||
set_image(&req->dst, dst);
|
||||
set_image(&req->src, src);
|
||||
set_rects(ctx, req, dst_rect, src_rect, &clip);
|
||||
@@ -413,7 +409,7 @@ static int blit_copybit(
|
||||
struct copybit_device_t *dev,
|
||||
struct copybit_image_t const *dst,
|
||||
struct copybit_image_t const *src,
|
||||
struct copybit_region_t const *region)
|
||||
struct copybit_region_t const *region)
|
||||
{
|
||||
struct copybit_rect_t dr = { 0, 0, dst->w, dst->h };
|
||||
struct copybit_rect_t sr = { 0, 0, src->w, src->h };
|
||||
@@ -423,7 +419,7 @@ static int blit_copybit(
|
||||
/*****************************************************************************/
|
||||
|
||||
/** Close the copybit device */
|
||||
static int close_copybit(struct hw_device_t *dev)
|
||||
static int close_copybit(struct hw_device_t *dev)
|
||||
{
|
||||
struct copybit_context_t* ctx = (struct copybit_context_t*)dev;
|
||||
if (ctx) {
|
||||
|
||||
@@ -29,6 +29,6 @@ LOCAL_SRC_FILES := \
|
||||
framebuffer.cpp \
|
||||
mapper.cpp
|
||||
|
||||
LOCAL_MODULE := gralloc.bahamas
|
||||
LOCAL_MODULE := gralloc.$(TARGET_BOOTLOADER_BOARD_NAME)
|
||||
LOCAL_CFLAGS:= -DLOG_TAG=\"gralloc\"
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#include <cutils/atomic.h>
|
||||
|
||||
#include <linux/fb.h>
|
||||
#include "linux/msm_mdp.h"
|
||||
#include <linux/msm_mdp.h>
|
||||
|
||||
#include "gralloc_priv.h"
|
||||
#include "gr.h"
|
||||
@@ -290,7 +290,7 @@ int mapFrameBufferLocked(struct private_module_t* module)
|
||||
|
||||
int err;
|
||||
size_t fbSize = roundUpToPageSize(finfo.line_length * info.yres_virtual);
|
||||
module->framebuffer = new private_handle_t(dup(fd), fbSize,
|
||||
module->framebuffer = new private_handle_t(fd, fbSize,
|
||||
private_handle_t::PRIV_FLAGS_USES_PMEM);
|
||||
|
||||
module->numBuffers = info.yres_virtual / info.yres;
|
||||
@@ -372,6 +372,9 @@ int fb_device_open(hw_module_t const* module, const char* name,
|
||||
|
||||
*device = &dev->device.common;
|
||||
}
|
||||
|
||||
// Close the gralloc module
|
||||
gralloc_close(gralloc_device);
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ ifneq ($(TARGET_SIMULATOR),true)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := lights.bahamas
|
||||
LOCAL_MODULE := lights.$(TARGET_BOOTLOADER_BOARD_NAME)
|
||||
|
||||
LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2008 The Android Open Source Project
|
||||
* Copyright (C) 2010 Diogo Ferreira <diogo@underdev.org>
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,8 +14,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
// #define LOG_NDEBUG 0
|
||||
#define LOG_TAG "lights"
|
||||
|
||||
#include <cutils/log.h>
|
||||
@@ -32,257 +30,286 @@
|
||||
|
||||
#include <hardware/lights.h>
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
static pthread_once_t g_init = PTHREAD_ONCE_INIT;
|
||||
static pthread_mutex_t g_lock = PTHREAD_MUTEX_INITIALIZER;
|
||||
static struct light_state_t g_notification = {0,0,0,0,0};
|
||||
static struct light_state_t g_battery = {0,0,0,0,0};
|
||||
static struct light_state_t g_notification;
|
||||
static struct light_state_t g_battery;
|
||||
static int g_backlight = 255;
|
||||
|
||||
char const*const GREEN_LED_FILE
|
||||
= "/sys/class/leds/green/brightness";
|
||||
char const*const AMBER_LED_FILE = "/sys/class/leds/amber/brightness";
|
||||
char const*const GREEN_LED_FILE = "/sys/class/leds/green/brightness";
|
||||
|
||||
char const*const AMBER_LED_FILE
|
||||
= "/sys/class/leds/amber/brightness";
|
||||
char const*const BUTTON_FILE = "/sys/class/leds/button-backlight/brightness";
|
||||
|
||||
char const*const LCD_FILE
|
||||
= "/sys/class/leds/lcd-backlight/brightness";
|
||||
char const*const AMBER_BLINK_FILE = "/sys/class/leds/amber/blink";
|
||||
char const*const GREEN_BLINK_FILE = "/sys/class/leds/green/blink";
|
||||
|
||||
char const*const AMBER_BLINK_FILE
|
||||
= "/sys/class/leds/amber/blink";
|
||||
|
||||
char const*const GREEN_BLINK_FILE
|
||||
= "/sys/class/leds/green/blink";
|
||||
|
||||
char const*const BUTTON_FILE
|
||||
= "/sys/class/leds/button-backlight/brightness";
|
||||
char const*const LCD_BACKLIGHT_FILE = "/sys/class/leds/lcd-backlight/brightness";
|
||||
|
||||
enum {
|
||||
LED_BLANK,
|
||||
LED_AMBER,
|
||||
LED_GREEN,
|
||||
LED_BOTH,
|
||||
};
|
||||
|
||||
/**
|
||||
* device methods
|
||||
* Aux method, write int to file
|
||||
*/
|
||||
static int write_int (const char* path, int value) {
|
||||
int fd;
|
||||
static int already_warned = 0;
|
||||
|
||||
static int
|
||||
write_int(char const* path, int value)
|
||||
{
|
||||
int fd;
|
||||
static int already_warned = 0;
|
||||
fd = open(path, O_RDWR);
|
||||
if (fd < 0) {
|
||||
if (already_warned == 0) {
|
||||
LOGE("write_int failed to open %s\n", path);
|
||||
already_warned = 1;
|
||||
}
|
||||
return -errno;
|
||||
}
|
||||
|
||||
fd = open(path, O_RDWR);
|
||||
if (fd >= 0) {
|
||||
char buffer[20];
|
||||
int bytes = sprintf(buffer, "%d\n", value);
|
||||
int amt = write(fd, buffer, bytes);
|
||||
close(fd);
|
||||
return amt == -1 ? -errno : 0;
|
||||
} else {
|
||||
if (already_warned == 0) {
|
||||
LOGE("write_int failed to open %s\n", path);
|
||||
already_warned = 1;
|
||||
}
|
||||
return -errno;
|
||||
}
|
||||
char buffer[20];
|
||||
int bytes = snprintf(buffer, sizeof(buffer), "%d\n",value);
|
||||
int written = write (fd, buffer, bytes);
|
||||
close (fd);
|
||||
|
||||
return written == -1 ? -errno : 0;
|
||||
}
|
||||
|
||||
static int
|
||||
is_lit(struct light_state_t const* state)
|
||||
{
|
||||
return state->color & 0x00ffffff;
|
||||
void init_globals (void) {
|
||||
pthread_mutex_init (&g_lock, NULL);
|
||||
}
|
||||
|
||||
static int
|
||||
rgb_to_brightness(struct light_state_t const* state)
|
||||
static int is_lit (struct light_state_t const* state) {
|
||||
return state->color & 0x00ffffff;
|
||||
}
|
||||
|
||||
static unsigned int rgb_to_led(struct light_state_t *state) {
|
||||
unsigned int colorRGB = state->color & 0xFFFFFF;
|
||||
unsigned int colorLED = LED_BLANK;
|
||||
|
||||
if (colorRGB & 0xFF)
|
||||
colorLED |= LED_GREEN;
|
||||
else {
|
||||
if ((colorRGB >> 8) & 0xFF)
|
||||
colorLED |= LED_GREEN;
|
||||
if ((colorRGB >> 16) & 0xFF)
|
||||
colorLED |= LED_AMBER;
|
||||
}
|
||||
|
||||
return colorLED;
|
||||
}
|
||||
|
||||
static void set_speaker_light_locked (struct light_device_t *dev,
|
||||
struct light_state_t *state) {
|
||||
unsigned int colorRGB = state->color & 0xFFFFFF;
|
||||
unsigned int colorLED = rgb_to_led(state);
|
||||
|
||||
switch (state->flashMode) {
|
||||
case LIGHT_FLASH_HARDWARE:
|
||||
case LIGHT_FLASH_TIMED:
|
||||
switch (colorLED) {
|
||||
case LED_BOTH:
|
||||
write_int (AMBER_BLINK_FILE, 1);
|
||||
write_int (GREEN_BLINK_FILE, 1);
|
||||
break;
|
||||
case LED_AMBER:
|
||||
if (state == &g_battery)
|
||||
write_int (AMBER_BLINK_FILE, 4);
|
||||
else
|
||||
write_int (AMBER_BLINK_FILE, 1);
|
||||
write_int (GREEN_LED_FILE, 0);
|
||||
break;
|
||||
case LED_GREEN:
|
||||
write_int (GREEN_BLINK_FILE, 1);
|
||||
write_int (AMBER_LED_FILE, 0);
|
||||
break;
|
||||
case LED_BLANK:
|
||||
write_int (AMBER_BLINK_FILE, 0);
|
||||
write_int (GREEN_BLINK_FILE, 0);
|
||||
break;
|
||||
default:
|
||||
LOGE("set_led_state: unknown color, colorRGB=0x%08X colorLED=%d\n",
|
||||
colorRGB, colorLED);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case LIGHT_FLASH_NONE:
|
||||
switch (colorLED) {
|
||||
case LED_BOTH:
|
||||
write_int (AMBER_LED_FILE, 1);
|
||||
write_int (GREEN_LED_FILE, 1);
|
||||
break;
|
||||
case LED_AMBER:
|
||||
write_int (AMBER_LED_FILE, 1);
|
||||
write_int (GREEN_LED_FILE, 0);
|
||||
break;
|
||||
case LED_GREEN:
|
||||
write_int (AMBER_LED_FILE, 0);
|
||||
write_int (GREEN_LED_FILE, 1);
|
||||
break;
|
||||
case LED_BLANK:
|
||||
write_int (AMBER_LED_FILE, 0);
|
||||
write_int (GREEN_LED_FILE, 0);
|
||||
break;
|
||||
default:
|
||||
LOGE("set_led_state: unknown color, colorRGB=0x%08X colorLED=%d\n",
|
||||
colorRGB, colorLED);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
LOGE("set_led_state: unknown mode, colorRGB=0x%08X flashMode=%d\n",
|
||||
colorRGB, state->flashMode);
|
||||
}
|
||||
}
|
||||
|
||||
static void set_speaker_light_locked_dual(struct light_device_t *dev,
|
||||
struct light_state_t *bstate, struct light_state_t *nstate) {
|
||||
unsigned int bcolorRGB = bstate->color & 0xFFFFFF;
|
||||
unsigned int bcolorLED = rgb_to_led(bstate);
|
||||
|
||||
switch (bcolorLED) {
|
||||
case LED_BOTH:
|
||||
case LED_AMBER:
|
||||
write_int (AMBER_BLINK_FILE, 4);
|
||||
write_int (GREEN_LED_FILE, 1);
|
||||
break;
|
||||
case LED_GREEN:
|
||||
write_int (AMBER_BLINK_FILE, 1);
|
||||
write_int (GREEN_LED_FILE, 1);
|
||||
break;
|
||||
case LED_BLANK:
|
||||
default:
|
||||
LOGE("set_led_state_dual: unexpected color, bcolorRGB=0x%08X bcolorLED=%d\n",
|
||||
bcolorRGB, bcolorLED);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void handle_speaker_battery_locked (struct light_device_t *dev) {
|
||||
if (is_lit (&g_battery) && is_lit (&g_notification)) {
|
||||
set_speaker_light_locked_dual(dev, &g_battery, &g_notification);
|
||||
} else if (is_lit (&g_battery)) {
|
||||
set_speaker_light_locked (dev, &g_battery);
|
||||
} else {
|
||||
set_speaker_light_locked (dev, &g_notification);
|
||||
}
|
||||
}
|
||||
|
||||
static int set_light_buttons (struct light_device_t* dev,
|
||||
struct light_state_t const* state) {
|
||||
int err = 0;
|
||||
int on = is_lit (state);
|
||||
pthread_mutex_lock (&g_lock);
|
||||
err = write_int (BUTTON_FILE, on?255:0);
|
||||
pthread_mutex_unlock (&g_lock);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int rgb_to_brightness(struct light_state_t const* state)
|
||||
{
|
||||
int color = state->color & 0x00ffffff;
|
||||
return ((77*((color>>16)&0x00ff))
|
||||
+ (150*((color>>8)&0x00ff)) + (29*(color&0x00ff))) >> 8;
|
||||
}
|
||||
|
||||
static int
|
||||
set_light_backlight(struct light_device_t* dev,
|
||||
struct light_state_t const* state)
|
||||
{
|
||||
int err = 0;
|
||||
int brightness = rgb_to_brightness(state);
|
||||
pthread_mutex_lock(&g_lock);
|
||||
err = write_int(LCD_FILE, brightness);
|
||||
pthread_mutex_unlock(&g_lock);
|
||||
return err;
|
||||
static int set_light_backlight(struct light_device_t* dev,
|
||||
struct light_state_t const* state) {
|
||||
int err = 0;
|
||||
int brightness = rgb_to_brightness(state);
|
||||
LOGV("%s brightness=%d color=0x%08x",
|
||||
__func__,brightness, state->color);
|
||||
pthread_mutex_lock(&g_lock);
|
||||
g_backlight = brightness;
|
||||
err = write_int(LCD_BACKLIGHT_FILE, brightness);
|
||||
pthread_mutex_unlock(&g_lock);
|
||||
return err;
|
||||
}
|
||||
|
||||
static int
|
||||
set_light_buttons(struct light_device_t* dev,
|
||||
struct light_state_t const* state)
|
||||
{
|
||||
int err = 0;
|
||||
int on = is_lit(state);
|
||||
pthread_mutex_lock(&g_lock);
|
||||
err = write_int(BUTTON_FILE, on?255:0);
|
||||
pthread_mutex_unlock(&g_lock);
|
||||
return err;
|
||||
static int set_light_battery (struct light_device_t* dev,
|
||||
struct light_state_t const* state) {
|
||||
pthread_mutex_lock (&g_lock);
|
||||
g_battery = *state;
|
||||
handle_speaker_battery_locked(dev);
|
||||
pthread_mutex_unlock (&g_lock);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
set_speaker_light_locked(struct light_device_t* dev,
|
||||
struct light_state_t const* state)
|
||||
{
|
||||
int len;
|
||||
int alpha, red, green, blue;
|
||||
int blink, freq, pwm;
|
||||
int onMS, offMS;
|
||||
unsigned int colorRGB;
|
||||
static int set_light_attention (struct light_device_t* dev,
|
||||
struct light_state_t const* state) {
|
||||
/* tattoo has no attention */
|
||||
|
||||
switch (state->flashMode) {
|
||||
case LIGHT_FLASH_TIMED:
|
||||
blink = 1;
|
||||
onMS = state->flashOnMS;
|
||||
offMS = state->flashOffMS;
|
||||
break;
|
||||
case LIGHT_FLASH_HARDWARE:
|
||||
blink = 1;
|
||||
onMS = state->flashOnMS;
|
||||
offMS = state->flashOffMS;
|
||||
break;
|
||||
case LIGHT_FLASH_NONE:
|
||||
blink = 0;
|
||||
onMS = 0;
|
||||
offMS = 0;
|
||||
break;
|
||||
default:
|
||||
blink = 1;
|
||||
onMS = 0;
|
||||
offMS = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
colorRGB = state->color;
|
||||
|
||||
LOGD("set_speaker_light_locked colorRGB=%08X, onMS=%d, offMS=%d\n",
|
||||
colorRGB, onMS, offMS);
|
||||
|
||||
red = (colorRGB >> 16) & 0xFF;
|
||||
green = (colorRGB >> 8) & 0xFF;
|
||||
blue = colorRGB & 0xFF;
|
||||
|
||||
if (red) {
|
||||
write_int(GREEN_LED_FILE, 0);
|
||||
write_int(AMBER_LED_FILE, 1);
|
||||
if (blink) {
|
||||
//blink must come after brightness change
|
||||
write_int(AMBER_BLINK_FILE, 1);
|
||||
}
|
||||
} else if (green || blue) {
|
||||
write_int(AMBER_LED_FILE, 0);
|
||||
write_int(GREEN_LED_FILE, 1);
|
||||
if (blink) {
|
||||
write_int(GREEN_BLINK_FILE, 1);
|
||||
}
|
||||
} else {
|
||||
write_int(GREEN_LED_FILE, 0);
|
||||
write_int(AMBER_LED_FILE, 0);
|
||||
}
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
handle_speaker_light_locked(struct light_device_t* dev)
|
||||
{
|
||||
if (is_lit(&g_battery)) {
|
||||
set_speaker_light_locked(dev, &g_battery);
|
||||
} else {
|
||||
set_speaker_light_locked(dev, &g_notification);
|
||||
}
|
||||
static int set_light_notifications (struct light_device_t* dev,
|
||||
struct light_state_t const* state) {
|
||||
pthread_mutex_lock (&g_lock);
|
||||
g_notification = *state;
|
||||
handle_speaker_battery_locked (dev);
|
||||
pthread_mutex_unlock (&g_lock);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
set_light_battery(struct light_device_t* dev,
|
||||
struct light_state_t const* state)
|
||||
{
|
||||
pthread_mutex_lock(&g_lock);
|
||||
g_battery = *state;
|
||||
handle_speaker_light_locked(dev);
|
||||
pthread_mutex_unlock(&g_lock);
|
||||
return 0;
|
||||
static int close_lights (struct light_device_t *dev) {
|
||||
if (dev)
|
||||
free (dev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
set_light_notifications(struct light_device_t* dev,
|
||||
struct light_state_t const* state)
|
||||
{
|
||||
pthread_mutex_lock(&g_lock);
|
||||
g_notification = *state;
|
||||
handle_speaker_light_locked(dev);
|
||||
pthread_mutex_unlock(&g_lock);
|
||||
return 0;
|
||||
static int open_lights (const struct hw_module_t* module, char const* name,
|
||||
struct hw_device_t** device) {
|
||||
int (*set_light)(struct light_device_t* dev,
|
||||
struct light_state_t const* state);
|
||||
|
||||
if (0 == strcmp(LIGHT_ID_BACKLIGHT, name)) {
|
||||
set_light = set_light_backlight;
|
||||
}
|
||||
else if (0 == strcmp(LIGHT_ID_BUTTONS, name)) {
|
||||
set_light = set_light_buttons;
|
||||
}
|
||||
else if (0 == strcmp(LIGHT_ID_BATTERY, name)) {
|
||||
set_light = set_light_battery;
|
||||
}
|
||||
else if (0 == strcmp(LIGHT_ID_ATTENTION, name)) {
|
||||
set_light = set_light_attention;
|
||||
}
|
||||
else if (0 == strcmp(LIGHT_ID_NOTIFICATIONS, name)) {
|
||||
set_light = set_light_notifications;
|
||||
}
|
||||
else {
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
pthread_once (&g_init, init_globals);
|
||||
struct light_device_t *dev = malloc (sizeof (struct light_device_t));
|
||||
memset (dev,0,sizeof(*dev));
|
||||
|
||||
dev->common.tag = HARDWARE_DEVICE_TAG;
|
||||
dev->common.version = 0;
|
||||
dev->common.module = (struct hw_module_t*)module;
|
||||
dev->common.close = (int (*)(struct hw_device_t*))close_lights;
|
||||
dev->set_light = set_light;
|
||||
|
||||
*device = (struct hw_device_t*) dev;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/** Close the lights device */
|
||||
static int
|
||||
close_lights(struct light_device_t *dev)
|
||||
{
|
||||
if (dev) {
|
||||
free(dev);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
/**
|
||||
* module methods
|
||||
*/
|
||||
|
||||
/** Open a new instance of a lights device using name */
|
||||
static int open_lights(const struct hw_module_t* module, char const* name,
|
||||
struct hw_device_t** device)
|
||||
{
|
||||
int (*set_light)(struct light_device_t* dev,
|
||||
struct light_state_t const* state);
|
||||
|
||||
if (0 == strcmp(LIGHT_ID_BACKLIGHT, name)) {
|
||||
set_light = set_light_backlight;
|
||||
}
|
||||
else if (0 == strcmp(LIGHT_ID_BUTTONS, name)) {
|
||||
set_light = set_light_buttons;
|
||||
}
|
||||
else if (0 == strcmp(LIGHT_ID_BATTERY, name)) {
|
||||
set_light = set_light_battery;
|
||||
}
|
||||
else if (0 == strcmp(LIGHT_ID_NOTIFICATIONS, name)) {
|
||||
set_light = set_light_notifications;
|
||||
}
|
||||
else {
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
struct light_device_t *dev = calloc(1, sizeof(struct light_device_t));
|
||||
|
||||
dev->common.tag = HARDWARE_DEVICE_TAG;
|
||||
dev->common.version = 0;
|
||||
dev->common.module = (struct hw_module_t*)module;
|
||||
dev->common.close = (int (*)(struct hw_device_t*))close_lights;
|
||||
dev->set_light = set_light;
|
||||
|
||||
*device = (struct hw_device_t*)dev;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static struct hw_module_methods_t lights_module_methods = {
|
||||
.open = open_lights,
|
||||
.open = open_lights,
|
||||
};
|
||||
|
||||
/*
|
||||
* The lights Module
|
||||
*/
|
||||
const struct hw_module_t HAL_MODULE_INFO_SYM = {
|
||||
.tag = HARDWARE_MODULE_TAG,
|
||||
.version_major = 1,
|
||||
.version_minor = 0,
|
||||
.id = LIGHTS_HARDWARE_MODULE_ID,
|
||||
.name = "Tattoo lights module",
|
||||
.author = "CyanogenMod",
|
||||
.methods = &lights_module_methods,
|
||||
.tag = HARDWARE_MODULE_TAG,
|
||||
.version_major = 2,
|
||||
.version_minor = 0,
|
||||
.id = LIGHTS_HARDWARE_MODULE_ID,
|
||||
.name = "Tattoo lights module",
|
||||
.author = "Diogo Ferreira <diogo@underdev.org>",
|
||||
.methods = &lights_module_methods,
|
||||
};
|
||||
|
||||
@@ -21,7 +21,7 @@ ifneq ($(TARGET_SIMULATOR),true)
|
||||
# hw/<SENSORS_HARDWARE_MODULE_ID>.<ro.product.board>.so
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := sensors.bahamas
|
||||
LOCAL_MODULE := sensors.$(TARGET_BOOTLOADER_BOARD_NAME)
|
||||
|
||||
LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
|
||||
|
||||
|
||||
@@ -24,28 +24,28 @@
|
||||
alpha compositing functionality in hardware. If set, the window
|
||||
manager will disable alpha trasformation in animations where not
|
||||
strictly needed. -->
|
||||
<bool name="config_sf_limitedAlpha">false</bool>
|
||||
<bool name="config_sf_limitedAlpha">true</bool>
|
||||
|
||||
<!-- Flag indicating whether the surface flinger is inefficient
|
||||
at performing a blur. Used by parts of the UI to turn off
|
||||
the blur effect where it isn't worth the performance hit. -->
|
||||
<bool name="config_sf_slowBlur">false</bool>
|
||||
<bool name="config_sf_slowBlur">true</bool>
|
||||
|
||||
<!-- XXXXX NOTE THE FOLLOWING RESOURCES USE THE WRONG NAMING CONVENTION.
|
||||
Please don't copy them, copy anything else. -->
|
||||
|
||||
<!-- This string array should be overridden by the device to present a list of network
|
||||
attributes. This is used by the connectivity manager to decide which networks can coexist
|
||||
based on the hardware -->
|
||||
<!-- An Array of "[Connection name],[ConnectivityManager connection type],
|
||||
[associated radio-type],[priority] -->
|
||||
<!-- An Array of "[Connection name],[ConnectivityManager.TYPE_xxxx],
|
||||
[associated radio-type],[priority],[restoral-timer(ms)],[dependencyMet] -->
|
||||
<!-- the 5th element "resore-time" indicates the number of milliseconds to delay
|
||||
before automatically restore the default connection. Set -1 if the connection
|
||||
does not require auto-restore. -->
|
||||
<!-- the 6th element indicates boot-time dependency-met value. -->
|
||||
<string-array translatable="false" name="networkAttributes">
|
||||
<item>"wifi,1,1,1"</item>
|
||||
<item>"mobile,0,0,0"</item>
|
||||
<item>"mobile_mms,2,0,2"</item>
|
||||
<item>"mobile_supl,3,0,2"</item>
|
||||
<item>"mobile_dun,4,0,4"</item>
|
||||
<item>"mobile_hipri,5,0,3"</item>
|
||||
<item>"wifi,1,1,1,-1,true"</item>
|
||||
<item>"mobile,0,0,0,-1,true"</item>
|
||||
<item>"mobile_mms,2,0,2,60000,true"</item>
|
||||
<item>"mobile_supl,3,0,2,60000,true"</item>
|
||||
<item>"mobile_dun,4,0,4,60000,true"</item>
|
||||
<item>"mobile_hipri,5,0,3,60000,true"</item>
|
||||
<item>"mobile_bluetooth,7,7,1,-1,true"</item>
|
||||
<item>"wifi_p2p,13,1,0,-1,true"</item>
|
||||
</string-array>
|
||||
|
||||
<!-- List of regexpressions describing the interface (if any) that represent tetherable
|
||||
@@ -61,17 +61,15 @@
|
||||
<string-array translatable="false" name="config_tether_wifi_regexs">
|
||||
</string-array>
|
||||
|
||||
<!-- Regex array of allowable upstream ifaces for tethering - for example if you want
|
||||
tethering on a new interface called "foo2" add <item>"foo\\d"</item> to the array -->
|
||||
<string-array translatable="false" name="config_tether_upstream_regexs">
|
||||
<item>"rmnet\\d"</item>
|
||||
<item>"tiwlan\\d"</item>
|
||||
</string-array>
|
||||
<!-- If this is true, the screen will come on when you unplug usb/power/whatever. -->
|
||||
<bool name="config_unplugTurnsOnScreen">true</bool>
|
||||
|
||||
<!-- If this is true, the screen will fade off. -->
|
||||
<bool name="config_animateScreenLights">true</bool>
|
||||
<!-- Whether a software navigation bar should be shown. NOTE: in the future this may be
|
||||
autodetected from the Configuration. -->
|
||||
<bool name="config_showNavigationBar">false</bool>
|
||||
|
||||
<!-- XXXXXX END OF RESOURCES USING WRONG NAMING CONVENTION -->
|
||||
<!-- Minimum screen brightness allowed by the power manager. -->
|
||||
<integer name="config_screenBrightnessDim">10</integer>
|
||||
|
||||
<!-- Indicate whether the SD card is accessible without removing the battery. -->
|
||||
<bool name="config_batterySdCardAccessibility">true</bool>
|
||||
@@ -85,14 +83,7 @@
|
||||
<!-- Component name of the service providing geocoder API support. -->
|
||||
<string name="config_geocodeProvider">com.google.android.location.GeocodeProvider</string>
|
||||
|
||||
<!-- Handle notifications differently if device only uses an amber/green
|
||||
LED. This also needs a liblights module that enables them accordingly. -->
|
||||
<bool name="config_amber_green_light">false</bool>
|
||||
|
||||
<!-- Configure Top Rotary Possition-->
|
||||
<integer name="config_rotaryMarginBottomDIP">37</integer>
|
||||
|
||||
<!-- Configure lense unlock time label offset -->
|
||||
<integer name="config_lenseTimeLabelOffsetDIP">30</integer>
|
||||
|
||||
<!-- Use legacy USB device manager. -->
|
||||
<!-- Will uncomment this once the code is in CM
|
||||
<bool name="config_usesLegacyUsbDeviceManager">false</bool> -->
|
||||
</resources>
|
||||
|
||||
41
overlay/frameworks/base/core/res/res/xml/storage_list.xml
Normal file
41
overlay/frameworks/base/core/res/res/xml/storage_list.xml
Normal file
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
**
|
||||
** Copyright 2011, The Android Open Source 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.
|
||||
*/
|
||||
-->
|
||||
|
||||
<!-- The <device> element should contain one or more <storage> elements.
|
||||
Exactly one of these should have the attribute primary="true".
|
||||
This storage will be the primary external storage and should have mountPoint="/mnt/sdcard".
|
||||
Each storage should have both a mountPoint and storageDescription attribute.
|
||||
The following attributes are optional:
|
||||
|
||||
primary: (boolean) this storage is the primary external storage
|
||||
removable: (boolean) this is removable storage (for example, a real SD card)
|
||||
emulated: (boolean) the storage is emulated via the FUSE sdcard daemon
|
||||
mtpReserve: (integer) number of megabytes of storage MTP should reserve for free storage
|
||||
(used for emulated storage that is shared with system's data partition)
|
||||
|
||||
A storage should not have both emulated and removable set to true
|
||||
-->
|
||||
|
||||
<StorageList xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<storage android:mountPoint="/mnt/sdcard"
|
||||
android:storageDescription="@string/storage_sd_card"
|
||||
android:primary="true"
|
||||
android:removable="true"
|
||||
android:allowMassStorage="true" />
|
||||
</StorageList>
|
||||
@@ -1,79 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2009 The Android Open Source 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.
|
||||
-->
|
||||
|
||||
<resources>
|
||||
<string name="rom_mod_string">KalimAz</string>
|
||||
<bool name="force_hidden_settings">true</bool>
|
||||
<bool name="config_desktopRotation">true</bool>
|
||||
<integer name="config_desktopSpeed">600</integer>
|
||||
<integer name="config_desktopBounce">30</integer>
|
||||
<integer name="config_pageHorizontalMargin">10</integer>
|
||||
<integer name="config_drawerColumnsPortrait">4</integer>
|
||||
<integer name="config_drawerRowsPortrait">3</integer>
|
||||
<integer name="config_drawerColumnsLandscape">4</integer>
|
||||
<integer name="config_drawerRowsLandscape">3</integer>
|
||||
<string name="config_homeBinding">1</string>
|
||||
<string name="config_swipedown_actions">0</string>
|
||||
<string name="config_swipeup_actions">0</string>
|
||||
<bool name="config_drawerAnimated">true</bool>
|
||||
<!-- config_desktopScreens min value is 1, so it will add 1 to whatever value you set here -->
|
||||
<integer name="config_desktopScreens">4</integer>
|
||||
<integer name="config_defaultScreen">2</integer>
|
||||
<bool name="config_hideStatusbar">false</bool>
|
||||
<bool name="config_previewsNew">true</bool>
|
||||
<bool name="config_uiDots">true</bool>
|
||||
<bool name="config_uiDockbar">true</bool>
|
||||
<bool name="config_uiCloseDockbar">false</bool>
|
||||
<bool name="config_uiCloseFolder">false</bool>
|
||||
<bool name="config_uiABBg">false</bool>
|
||||
<!-- config_zoomSpeed min is 300, so it will add 300 to whatever value you set here -->
|
||||
<integer name="config_zoomSpeed">100</integer>
|
||||
<!-- config_uiScaleAB is a float value between 0.1 and 1.0. Set here the default .X-->
|
||||
<integer name="config_uiScaleAB">7</integer>
|
||||
<bool name="config_uiHideLabels">false</bool>
|
||||
<bool name="config_wallpaperHack">true</bool>
|
||||
<integer name="config_highlights_color">0xa0000000</integer>
|
||||
<integer name="config_highlights_color_focus">0xa0000000</integer>
|
||||
<bool name="config_new_selectors">true</bool>
|
||||
<integer name="config_drawer_color">0x80000000</integer>
|
||||
<!-- config_desktopColumns/Rows min value is 3, so it will add 3 to whatever value you set here -->
|
||||
<integer name="config_desktopColumns">1</integer>
|
||||
<integer name="config_desktopRows">1</integer>
|
||||
<bool name="config_autosizeIcons">false</bool>
|
||||
<bool name="config_drawerLabels">true</bool>
|
||||
<bool name="config_fadeDrawerLabels">true</bool>
|
||||
<bool name="config_desktop_indicator">true</bool>
|
||||
<bool name="config_desktop_indicator_autohide">true</bool>
|
||||
<!-- 1=top dots, 2=top slider, 3=bottom slider -->
|
||||
<string name="config_desktop_indicator_type">1</string>
|
||||
<bool name="config_system_persistent">true</bool>
|
||||
<!-- 1=sensor, 2=portrait, 3=landscape -->
|
||||
<string name="config_orientation_default">1</string>
|
||||
<!-- 1=low quality,2=auto, 3=disabled -->
|
||||
<string name="config_screenCache">2</string>
|
||||
<bool name="config_nagScreen">false</bool>
|
||||
<bool name="config_drawer_navigate_catalogs">true</bool>
|
||||
<bool name="config_notif_receiver">true</bool>
|
||||
<!-- config_notif_size min is 10, so it will add 10 to whatever value you set here -->
|
||||
<integer name="config_notif_size">4</integer>
|
||||
<string name="config_main_dock_style">1</string>
|
||||
<string name="config_drawer_style">0</string>
|
||||
<bool name="config_ab_tint">false</bool>
|
||||
<integer name="config_ab_tint_color">0xffffffff</integer>
|
||||
<bool name="config_wallpaper_scroll">true</bool>
|
||||
<string name="config_deletezone_style">1</string>
|
||||
<bool name="config_close_apps_dockbar">true</bool>
|
||||
</resources>
|
||||
32
overlay/packages/apps/CMParts/res/values/arrays.xml
Normal file
32
overlay/packages/apps/CMParts/res/values/arrays.xml
Normal file
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
* Copyright (C) 2007 The Android Open Source 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.
|
||||
-->
|
||||
|
||||
<resources>
|
||||
<string-array name="entries_dual_led_colors" translatable="false">
|
||||
<item>@string/trackball_color_entry_use_app</item>
|
||||
<item>@string/trackball_color_entry_green</item>
|
||||
<item>@string/trackball_color_entry_red</item>
|
||||
<item>@string/trackball_color_entry_amber</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="values_dual_led_colors" translatable="false">
|
||||
<item>default</item>
|
||||
<item>green</item>
|
||||
<item>red</item>
|
||||
<item>yellow</item>
|
||||
</string-array>
|
||||
</resources>
|
||||
20
overlay/packages/apps/CMParts/res/values/config.xml
Normal file
20
overlay/packages/apps/CMParts/res/values/config.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- Whether or not to display the trackball settings -->
|
||||
<bool name="has_trackball">true</bool>
|
||||
|
||||
<!-- Whether or not to display the camera button settings -->
|
||||
<bool name="has_camera_button">false</bool>
|
||||
|
||||
<!-- Notification LED can show any color -->
|
||||
<bool name="has_rgb_notification_led">false</bool>
|
||||
|
||||
<!-- Notification LED can show green and amber only -->
|
||||
<bool name="has_dual_notification_led">true</bool>
|
||||
|
||||
<!-- LED Flashlight -->
|
||||
<bool name="has_led_flash">false</bool>
|
||||
|
||||
<!-- Whether or not to display search button settings -->
|
||||
<bool name="has_search_button">true</bool>
|
||||
</resources>
|
||||
@@ -1,34 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
** Copyright 2009, The Android Open Source 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.
|
||||
*/
|
||||
-->
|
||||
|
||||
<!-- These resources are around just to allow their values to be customized
|
||||
for different hardware and product builds. -->
|
||||
<resources>
|
||||
<!-- set this to true if the device doesn't have a GPU, or an EGL
|
||||
library is for some reason unavailable -->
|
||||
<bool name="softwareGLOnly">true</bool>
|
||||
|
||||
<!-- FFC parameter filtering -->
|
||||
<bool name="ffc_canFocus">false</bool>
|
||||
<bool name="ffc_canZoom">false</bool>
|
||||
<string name="ffc_supportedEffects"></string>
|
||||
|
||||
<!-- Resolution filtering -->
|
||||
<string name="filtered_pictureSizes"></string>
|
||||
</resources>
|
||||
11
overlay/packages/apps/FM/res/values/config.xml
Normal file
11
overlay/packages/apps/FM/res/values/config.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- Whether or not Bluetooth must be enabled for FM radio -->
|
||||
<bool name="require_bt">true</bool>
|
||||
|
||||
<!-- Whether or not output to speaker is supported -->
|
||||
<bool name="speaker_supported">true</bool>
|
||||
|
||||
<!-- Whether or not seek is supported -->
|
||||
<bool name="seek_supported">true</bool>
|
||||
</resources>
|
||||
@@ -23,15 +23,40 @@
|
||||
|
||||
<mms_config version="4">
|
||||
<!-- Maximum message size in bytes for a MMS message -->
|
||||
<int name="maxMessageSize">0307200</int>
|
||||
<int name="maxMessageSize">1048576</int>
|
||||
|
||||
<!-- Maximum height for an attached image -->
|
||||
<int name="maxImageHeight">0768</int>
|
||||
<int name="maxImageHeight">1944</int>
|
||||
|
||||
<!-- Maximum width for an attached image -->
|
||||
<int name="maxImageWidth">1024</int>
|
||||
<int name="maxImageWidth">2592</int>
|
||||
|
||||
<!-- User-Agent parameter used in MMS http request -->
|
||||
<string name="userAgent">Bravo</string>
|
||||
|
||||
<!-- UAProf URL -->
|
||||
<string name="uaProfUrl">http://www.htcmms.com.tw/Android/Common/tattoo/ua-profile.xml</string>
|
||||
<string name="uaProfUrl">http://www.htcmms.com.tw/Android/Common/Bravo/ua-profile.xml</string>
|
||||
|
||||
<!-- Maximum number of recipients allowed per message. Use a value of -1
|
||||
to indicate no limit. -->
|
||||
<int name="recipientLimit">-1</int>
|
||||
|
||||
<!-- Maximum number of SMS message segments in a long text message before converting
|
||||
the SMS message to an MMS message. -->
|
||||
<int name="smsToMmsTextThreshold">4</int>
|
||||
|
||||
<!-- If true, The text message over 160 characters will be sent in multi part.
|
||||
If false, The text message over 160 characters will be sent
|
||||
via multi media message. -->
|
||||
<bool name="enableMultipartSMS">false</bool>
|
||||
|
||||
<!-- If true, The mms support slide duration.
|
||||
If false, The mms does not support slide duration and we have to
|
||||
set duration value. -->
|
||||
<bool name="enableSlideDuration">true</bool>
|
||||
|
||||
<!-- Maximum length for message text. Use a value of -1
|
||||
to indicate default value -->
|
||||
<int name="maxMessageTextSize">-1</int>
|
||||
|
||||
</mms_config>
|
||||
|
||||
@@ -1,125 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2009 The Android Open Source 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.
|
||||
-->
|
||||
|
||||
<!-- Phone app resources that may need to be customized
|
||||
for different hardware or product builds. -->
|
||||
<resources>
|
||||
<!-- Flag indicating whether the Phone app should ignore
|
||||
EVENT_SIM_NETWORK_LOCKED events from the Sim. If true, this will
|
||||
prevent the IccNetworkDepersonalizationPanel from being shown,
|
||||
and effectively disable the "Sim network lock" feature. -->
|
||||
<bool name="ignore_sim_network_locked_events">false</bool>
|
||||
|
||||
<!-- Flag indicating whether the Phone app should provide
|
||||
a "Dismiss" button on the SIM network unlock screen.
|
||||
The default value is true.
|
||||
If set to false, there will be *no way* to dismiss the SIM
|
||||
network unlock screen if you don't enter the correct unlock code.
|
||||
(One important consequence: there will be no way to make an
|
||||
Emergency Call if your SIM is network-locked and you don't know
|
||||
the PIN.) -->
|
||||
<bool name="sim_network_unlock_allow_dismiss">true</bool>
|
||||
|
||||
<!-- If true, enable the onscreen touch UI for incoming calls.
|
||||
This feature is necessary for devices with no hard SEND/END keys,
|
||||
and optional on all other devices. -->
|
||||
<bool name="allow_incoming_call_touch_ui">true</bool>
|
||||
|
||||
<!-- If true, enable the onscreen touch UI for regular "ongoing call"
|
||||
states of the in-call UI.
|
||||
In general, the touch UI is used for regular calls only on
|
||||
devices with a proximity sensor. (On other devices, we can't
|
||||
have touchable UI onscreen during a call because of the risk of
|
||||
false cheek touches.)
|
||||
TODO: maybe this can be determined algorithmically based on
|
||||
specific properties of the device, perhaps by detecting the
|
||||
presence of a proximity sensor and/or hard SEND/END keys. (If
|
||||
so, we wouldn't need this flag at all.) -->
|
||||
<bool name="allow_in_call_touch_ui">false</bool>
|
||||
|
||||
<!-- OTA configuration values, used when provisioning CDMA devices.
|
||||
Following defaults values of zero means OTA UI is completely disabled.
|
||||
These OTA UI can be enabled by setting config value to one in the product
|
||||
specific overlay file -->
|
||||
|
||||
<!-- Determine whether we want to display the OTA activation screen, which
|
||||
gives the user option to activate or cancel -->
|
||||
<integer name="OtaShowActivationScreen">1</integer>
|
||||
<!-- Determine whether we should show the "listen for instructions" screen after
|
||||
successfully placing the OTA call -->
|
||||
<integer name="OtaShowListeningScreen">0</integer>
|
||||
<!-- The number of times we should show the activation screen/allow the provisioning
|
||||
to fail before just showing an unsuccessful dialog -->
|
||||
<integer name="OtaShowActivateFailTimes">0</integer>
|
||||
<!-- Determine whether or not we should play the success/failure tone -->
|
||||
<integer name="OtaPlaySuccessFailureTone">0</integer>
|
||||
|
||||
<!-- Flag indicating if the phone is a world phone -->
|
||||
<bool name="world_phone">false</bool>
|
||||
|
||||
<!-- If true, enable vibration (haptic feedback) for key presses
|
||||
in the EmergencyDialer activity. The pattern is set on a
|
||||
per-platform basis using config_virtualKeyVibePattern. To be
|
||||
consistent with the regular Dialer, this value should agree
|
||||
with the corresponding values from config.xml under
|
||||
apps/Contacts. -->
|
||||
<bool name="config_enable_dialer_key_vibration">true</bool>
|
||||
|
||||
<!-- Flag indicating if the voicemail notification option is enabled -->
|
||||
<bool name="voicemail_notification_enabled">true</bool>
|
||||
|
||||
<!-- Flag indicating if the tty is enabled -->
|
||||
<bool name="tty_enabled">false</bool>
|
||||
|
||||
<!-- Flag indicating if hac is enabled -->
|
||||
<bool name="hac_enabled">false</bool>
|
||||
|
||||
<!-- Flag indicating if dtmf tone type is enabled -->
|
||||
<bool name="dtmf_type_enabled">false</bool>
|
||||
|
||||
<!-- Flag indicating if auto retry is enabled -->
|
||||
<bool name="auto_retry_enabled">false</bool>
|
||||
|
||||
<!-- Determine whether we want to play local DTMF tones in a call, or
|
||||
just let the radio/BP handle playing of the tones. -->
|
||||
<bool name="allow_local_dtmf_tones">true</bool>
|
||||
|
||||
<!-- While an incoming call is ringing, this flag specifies whether
|
||||
the BACK key should reject the current call (just like the
|
||||
ENDCALL button does.)
|
||||
This was originally the default behavior for all platforms, but
|
||||
it's a bad idea on devices where the BACK key is a capacitive
|
||||
button (since it's too easy to press the key accidentally as you
|
||||
pull the phone out of your pocket.) So devices that *don't* want
|
||||
this behavior should set this flag to false via the resource
|
||||
overlay. -->
|
||||
<bool name="allow_back_key_to_reject_incoming_call">true</bool>
|
||||
|
||||
<!-- If true, show an onscreen "Dial" button in the dialer.
|
||||
In practice this is used on all platforms even the ones with hard SEND/END
|
||||
keys, but for maximum flexibility it's controlled by a flag here
|
||||
(which can be overridden on a per-product basis.) -->
|
||||
<bool name="config_show_onscreen_dial_button">true</bool>
|
||||
|
||||
<!-- Determine whether calls to mute the microphone in PhoneUtils
|
||||
are routed through the android.media.AudioManager class (true) or through
|
||||
the com.android.internal.telephony.Phone interface (false). -->
|
||||
<bool name="send_mic_mute_to_AudioManager">false</bool>
|
||||
|
||||
<!-- Determines if device implements a noise suppression device for in call audio-->
|
||||
<bool name="has_in_call_noise_suppression">false</bool>
|
||||
|
||||
</resources>
|
||||
@@ -1,35 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
**
|
||||
** Copyright 2008, The Android Open Source 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.
|
||||
*/
|
||||
-->
|
||||
|
||||
<resources>
|
||||
<!-- key_height + key_bottom_gap = popup_key_height -->
|
||||
<dimen name="key_height">0.240in</dimen>
|
||||
<dimen name="key_bottom_gap">0.004in</dimen>
|
||||
<dimen name="popup_key_height">0.270in</dimen>
|
||||
<dimen name="keyboard_bottom_padding">0in</dimen>
|
||||
<dimen name="candidate_strip_height">38dip</dimen>
|
||||
<dimen name="candidate_strip_fading_edge_length">63dip</dimen>
|
||||
<dimen name="spacebar_vertical_correction">2dip</dimen>
|
||||
<!-- Amount of allowance for selecting keys in a mini popup keyboard by sliding finger. -->
|
||||
<!-- popup_key_height x 1.7 -->
|
||||
<dimen name="mini_keyboard_slide_allowance">0.459in</dimen>
|
||||
<!-- popup_key_height x 1.0 -->
|
||||
<dimen name="mini_keyboard_vertical_correction">-0.270in</dimen>
|
||||
</resources>
|
||||
@@ -1,50 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
**
|
||||
** Copyright 2008, The Android Open Source 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.
|
||||
*/
|
||||
-->
|
||||
|
||||
<resources>
|
||||
<!-- key_height + key_bottom_gap = popup_key_height -->
|
||||
<dimen name="key_height">0.260in</dimen>
|
||||
<dimen name="key_bottom_gap">0in</dimen>
|
||||
<dimen name="popup_key_height">0.300in</dimen>
|
||||
<dimen name="keyboard_bottom_padding">0in</dimen>
|
||||
<dimen name="bubble_pointer_offset">22dip</dimen>
|
||||
<dimen name="candidate_strip_height">42dip</dimen>
|
||||
<dimen name="candidate_strip_fading_edge_length">63dip</dimen>
|
||||
<dimen name="spacebar_vertical_correction">4dip</dimen>
|
||||
<!-- If the screen height in landscape is larger than the below value, then the keyboard
|
||||
will not go into extract (fullscreen) mode. -->
|
||||
<dimen name="max_height_for_fullscreen">2.5in</dimen>
|
||||
<dimen name="key_text_size">0.12in</dimen>
|
||||
<dimen name="key_label_text_size">0.083in</dimen>
|
||||
<dimen name="key_preview_text_size_large">38sp</dimen>
|
||||
<dimen name="key_preview_offset">0.000in</dimen>
|
||||
<!-- key_preview_text_size_large x 2 -->
|
||||
<dimen name="key_preview_height">80sp</dimen>
|
||||
<!-- Amount of allowance for selecting keys in a mini popup keyboard by sliding finger. -->
|
||||
<!-- popup_key_height x 1.7 -->
|
||||
<dimen name="mini_keyboard_slide_allowance">0.553in</dimen>
|
||||
<!-- popup_key_height x 1.0 -->
|
||||
<dimen name="mini_keyboard_vertical_correction">-0.325in</dimen>
|
||||
<dimen name="key_hysteresis_distance">0.05in</dimen>
|
||||
<!-- We use "inch", not "dip" because this value tries dealing with physical distance related
|
||||
to user's finger. -->
|
||||
<dimen name="keyboard_vertical_correction">-0.05in</dimen>
|
||||
<dimen name="candidate_min_touchable_width">0.3in</dimen>
|
||||
</resources>
|
||||
@@ -20,14 +20,18 @@ on boot
|
||||
mkdir /data/misc/dhcp 0770 dhcp dhcp
|
||||
chown dhcp dhcp /data/misc/dhcp
|
||||
|
||||
chown radio system /sys/module/gpio_event/parameters/phone_call_status
|
||||
chmod 0664 /sys/module/gpio_event/parameters/phone_call_status
|
||||
|
||||
# write screen calibration
|
||||
write /sys/class/input/input1/calibration_points 794,867,213,863,502,493,798,120,198,139
|
||||
write /sys/class/input/input1/calibration_points 837,864,166,859,507,503,844,142,167,142
|
||||
|
||||
# bluetooth power up/down interface
|
||||
chown bluetooth bluetooth /sys/class/rfkill/rfkill0/type
|
||||
chown bluetooth bluetooth /sys/class/rfkill/rfkill0/state
|
||||
chmod 0660 /sys/class/rfkill/rfkill0/state
|
||||
chown system system /dev/ttyHSUSB0
|
||||
|
||||
chown radio radio /sys/class/htc_ecompass/ecompass/PhoneOnOffFlag
|
||||
|
||||
# Permissions for Liblights.
|
||||
chown system system /sys/class/leds/green/brightness
|
||||
@@ -37,23 +41,22 @@ on boot
|
||||
chown system system /sys/class/leds/button-backlight/brightness
|
||||
chown system system /sys/class/leds/lcd-backlight/brightness
|
||||
|
||||
# Revise su permisions to ensure all users can use it
|
||||
chmod 06755 /system/xbin/su
|
||||
# CPU_Scaling Governor make permissions
|
||||
chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
|
||||
|
||||
# Set idle_sleep_mode permissions to radio
|
||||
chown radio radio /sys/module/pm/parameters/idle_sleep_mode
|
||||
|
||||
# mount tmp cache system to speed up photo taking
|
||||
mkdir /cache/tmp 0666 system system
|
||||
mount tmpfs tmpfs /cache/tmp
|
||||
|
||||
# revise fb0 permission for copybit
|
||||
chmod 0666 /dev/graphics/fb0
|
||||
|
||||
# cpufreq configurations
|
||||
write /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate 40000
|
||||
write /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold 85
|
||||
|
||||
# Set idle_sleep_mode permissions to radio
|
||||
chown radio radio /sys/module/pm/parameters/idle_sleep_mode
|
||||
|
||||
# for disabling IPv6 over mobile network.
|
||||
write /proc/sys/net/ipv6/conf/rmnet0/disable_ipv6 1
|
||||
write /proc/sys/net/ipv6/conf/rmnet1/disable_ipv6 1
|
||||
write /proc/sys/net/ipv6/conf/rmnet2/disable_ipv6 1
|
||||
write /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate 50000
|
||||
write /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold 90
|
||||
|
||||
# performance tweaks for flash
|
||||
write /sys/block/mtdblock3/bdi/read_ahead_kb 4
|
||||
@@ -64,21 +67,29 @@ on boot
|
||||
write /sys/block/mmcblk0/bdi/read_ahead_kb 1024
|
||||
|
||||
# enable low memory killer to check file pages
|
||||
write /sys/module/lowmemorykiller/parameters/minfree 3584,4096,8192,10240,11264,12288
|
||||
write /sys/module/lowmemorykiller/parameters/minfile 0,0,0,5120,5632,6144
|
||||
write /sys/module/lowmemorykiller/parameters/check_filepages 1
|
||||
|
||||
write /sys/devices/system/cpu/cpufreq/ondemand/up_threshold 90
|
||||
write /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate 50000
|
||||
write /proc/sys/kernel/sched_latency_ns 5000000
|
||||
write /proc/sys/kernel/sched_wakeup_granularity_ns 100000
|
||||
write /proc/sys/kernel/sched_min_granularity_ns 100000
|
||||
|
||||
# CPU_Scaling Governor make permissions
|
||||
chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
|
||||
# Assign TCP buffer thresholds to be ceiling value of technology maximums
|
||||
# Increased technology maximums should be reflected here.
|
||||
write /proc/sys/net/core/rmem_max 262144
|
||||
write /proc/sys/net/core/wmem_max 262144
|
||||
|
||||
setrlimit 8 268435456 268435456
|
||||
|
||||
# compass/accelerometer daemon
|
||||
service akm8973 /system/bin/akm8973
|
||||
service akmd /system/bin/akmd
|
||||
class main
|
||||
user compass
|
||||
group compass misc input
|
||||
|
||||
service calibrate_screen /system/bin/calibrate_screen
|
||||
class main
|
||||
user root
|
||||
group root
|
||||
oneshot
|
||||
@@ -86,6 +97,7 @@ service calibrate_screen /system/bin/calibrate_screen
|
||||
service wlan_loader /system/bin/wlan_loader \
|
||||
-f /system/etc/wifi/Fw1251r1c.bin -e /proc/calibration \
|
||||
-i /system/etc/wifi/tiwlan.ini
|
||||
class main
|
||||
disabled
|
||||
oneshot
|
||||
|
||||
@@ -93,24 +105,33 @@ service wpa_supplicant /system/bin/wpa_supplicant \
|
||||
-Dtiwlan0 -itiwlan0 -c/data/misc/wifi/wpa_supplicant.conf -q
|
||||
# we will start as root and wpa_supplicant will switch to user wifi
|
||||
# after setting up the capabilities required for WEXT
|
||||
class main
|
||||
# user wifi
|
||||
# group wifi inet keystore
|
||||
socket wpa_tiwlan0 dgram 660 wifi wifi
|
||||
disabled
|
||||
oneshot
|
||||
|
||||
service dhcpcd /system/bin/dhcpcd -ABKL
|
||||
service dhcpcd_tiwlan0 /system/bin/dhcpcd -ABKL
|
||||
class main
|
||||
disabled
|
||||
oneshot
|
||||
|
||||
service iprenew_tiwlan0 /system/bin/dhcpcd -n
|
||||
class main
|
||||
disabled
|
||||
oneshot
|
||||
|
||||
service hciattach /system/bin/hciattach \
|
||||
-n -s 115200 /dev/ttyHS0 texasalt 4000000 flow
|
||||
class main
|
||||
user bluetooth
|
||||
group bluetooth net_bt_admin
|
||||
disabled
|
||||
|
||||
# bugreport is triggered by the KEY_BACK and KEY_MENU keycodes
|
||||
service bugreport /system/bin/dumpstate -d -v -o /sdcard/bugreports/bugreport
|
||||
class main
|
||||
disabled
|
||||
oneshot
|
||||
keycodes 158 139
|
||||
32
prebuilt/init.bahamas.usb.rc
Normal file
32
prebuilt/init.bahamas.usb.rc
Normal file
@@ -0,0 +1,32 @@
|
||||
on property:sys.usb.config=adb
|
||||
write /sys/class/usb_composite/adb/enable 1
|
||||
start adbd
|
||||
setprop sys.usb.state $sys.usb.config
|
||||
|
||||
on property:sys.usb.config=mass_storage
|
||||
write /sys/class/usb_composite/usb_mass_storage/enable 1
|
||||
start adbd
|
||||
setprop sys.usb.state $sys.usb.config
|
||||
|
||||
on property:sys.usb.config=mass_storage,adb
|
||||
write /sys/class/usb_composite/usb_mass_storage/enable 1
|
||||
write /sys/class/usb_composite/adb/enable 1
|
||||
start adbd
|
||||
setprop sys.usb.state $sys.usb.config
|
||||
|
||||
on property:sys.usb.config=rndis
|
||||
write /sys/class/usb_composite/rndis/enable 1
|
||||
setprop sys.usb.state $sys.usb.config
|
||||
|
||||
on property:sys.usb.config=rndis,adb
|
||||
write /sys/class/usb_composite/rndis/enable 1
|
||||
write /sys/class/usb_composite/adb/enable 1
|
||||
start adbd
|
||||
setprop sys.usb.state $sys.usb.config
|
||||
|
||||
on property:sys.usb.config=mass_storage,rndis,adb
|
||||
write /sys/class/usb_composite/usb_mass_storage/enable 1
|
||||
write /sys/class/usb_composite/rndis/enable 1
|
||||
write /sys/class/usb_composite/adb/enable 1
|
||||
start adbd
|
||||
setprop sys.usb.state $sys.usb.config
|
||||
BIN
prebuilt/kernel
Executable file
BIN
prebuilt/kernel
Executable file
Binary file not shown.
BIN
prebuilt/klogtail
Normal file
BIN
prebuilt/klogtail
Normal file
Binary file not shown.
@@ -79,25 +79,25 @@
|
||||
<!-- Each camcorder profile defines a set of predefined configuration parameters -->
|
||||
<CamcorderProfiles cameraId="0">
|
||||
|
||||
<EncoderProfile quality="high" fileFormat="mp4" duration="60">
|
||||
<EncoderProfile quality="high" fileFormat="3gp" duration="60">
|
||||
<Video codec="h263"
|
||||
bitRate="360000"
|
||||
width="352"
|
||||
bitRate="720000"
|
||||
width="384"
|
||||
height="288"
|
||||
frameRate="24" />
|
||||
|
||||
<Audio codec="aac"
|
||||
bitRate="64000"
|
||||
sampleRate="16000"
|
||||
channels="1" />
|
||||
channels="2" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="low" fileFormat="3gp" duration="30">
|
||||
<Video codec="h263"
|
||||
bitRate="192000"
|
||||
width="176"
|
||||
height="144"
|
||||
frameRate="30" />
|
||||
width="240"
|
||||
height="160"
|
||||
frameRate="20" />
|
||||
|
||||
<Audio codec="amrnb"
|
||||
bitRate="12200"
|
||||
@@ -115,7 +115,6 @@
|
||||
</CamcorderProfiles>
|
||||
|
||||
<EncoderOutputFileFormat name="3gp" />
|
||||
<EncoderOutputFileFormat name="mp4" />
|
||||
|
||||
<!--
|
||||
If a codec is not enabled, it is invisible to the applications
|
||||
@@ -124,26 +123,26 @@
|
||||
-->
|
||||
<VideoEncoderCap name="h264" enabled="true"
|
||||
minBitRate="64000" maxBitRate="420000"
|
||||
minFrameWidth="176" maxFrameWidth="352"
|
||||
minFrameWidth="176" maxFrameWidth="384"
|
||||
minFrameHeight="144" maxFrameHeight="288"
|
||||
minFrameRate="1" maxFrameRate="30" />
|
||||
|
||||
<VideoEncoderCap name="h263" enabled="true"
|
||||
minBitRate="64000" maxBitRate="420000"
|
||||
minFrameWidth="176" maxFrameWidth="352"
|
||||
minBitRate="64000" maxBitRate="720000"
|
||||
minFrameWidth="176" maxFrameWidth="384"
|
||||
minFrameHeight="144" maxFrameHeight="288"
|
||||
minFrameRate="1" maxFrameRate="30" />
|
||||
|
||||
<VideoEncoderCap name="m4v" enabled="true"
|
||||
minBitRate="64000" maxBitRate="420000"
|
||||
minFrameWidth="176" maxFrameWidth="352"
|
||||
minFrameWidth="176" maxFrameWidth="384"
|
||||
minFrameHeight="144" maxFrameHeight="288"
|
||||
minFrameRate="1" maxFrameRate="30" />
|
||||
|
||||
<AudioEncoderCap name="aac" enabled="true"
|
||||
minBitRate="8192" maxBitRate="96000"
|
||||
minSampleRate="8000" maxSampleRate="16000"
|
||||
minChannels="1" maxChannels="1" />
|
||||
minChannels="1" maxChannels="2" />
|
||||
|
||||
<AudioEncoderCap name="amrwb" enabled="true"
|
||||
minBitRate="6600" maxBitRate="23050"
|
||||
Binary file not shown.
6
prebuilt/ueventd.bahamas.rc
Normal file
6
prebuilt/ueventd.bahamas.rc
Normal file
@@ -0,0 +1,6 @@
|
||||
mtd@misc 0460 radio diag
|
||||
/dev/system_bus_freq 0660 system system
|
||||
/dev/cpu_dma_latency 0660 system system
|
||||
/dev/radio_feedback 0660 radio radio
|
||||
/dev/smd9 0600 system system
|
||||
/dev/ttyHS0 0660 bluetooth bluetooth
|
||||
18
proprietary-files.txt
Executable file
18
proprietary-files.txt
Executable file
@@ -0,0 +1,18 @@
|
||||
app/HTCCalibrate.apk
|
||||
etc/AudioPara4.csv
|
||||
etc/AudioFilter.csv
|
||||
etc/AudioPreProcess.csv
|
||||
lib/libmm-qcamera-tgt.so
|
||||
lib/libaudioeq.so
|
||||
lib/libmm-adspsvc.so
|
||||
lib/libgps.so
|
||||
lib/libOmxH264Dec.so
|
||||
lib/libOmxMpeg4Dec.so
|
||||
lib/libOmxVidEnc.so
|
||||
lib/libmm-adspsvc.so
|
||||
lib/libhtc_acoustic.so
|
||||
lib/libhtc_ril.so
|
||||
etc/wifi/Fw1251r1c.bin
|
||||
etc/firmware/brf6300.bin
|
||||
etc/firmware/brf6350.bin
|
||||
bin/akmd
|
||||
@@ -7,4 +7,4 @@
|
||||
/recovery mtd recovery
|
||||
/sdcard vfat /dev/block/mmcblk0p1 /dev/block/mmcblk0
|
||||
/system yaffs2 system
|
||||
/sd-ext auto LABEL=sd-ext
|
||||
/sd-ext ext3 /dev/block/mmcblk0p2
|
||||
@@ -17,9 +17,11 @@
|
||||
DEVICE=click
|
||||
MANUFACTURER=htc
|
||||
|
||||
mkdir -p ../../../vendor/$MANUFACTURER/$DEVICE
|
||||
OUTDIR=vendor/$MANUFACTURER/$DEVICE
|
||||
mkdir -p ../../../$OUTDIR
|
||||
MAKEFILE=../../../$OUTDIR/$DEVICE-vendor-blobs.mk
|
||||
|
||||
(cat << EOF) | sed s/__DEVICE__/$DEVICE/g | sed s/__MANUFACTURER__/$MANUFACTURER/g > ../../../vendor/$MANUFACTURER/$DEVICE/$DEVICE-vendor.mk
|
||||
(cat << EOF) > $MAKEFILE
|
||||
# Copyright (C) 2010 The Android Open Source Project
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -34,17 +36,52 @@ mkdir -p ../../../vendor/$MANUFACTURER/$DEVICE
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# This file is generated by device/__MANUFACTURER__/__DEVICE__/setup-makefiles.sh
|
||||
# This file is generated by device/$MANUFACTURER/$DEVICE/setup-makefiles.sh - DO NOT EDIT
|
||||
|
||||
# Prebuilt libraries that are needed to build open-source libraries
|
||||
PRODUCT_COPY_FILES += \\
|
||||
$OUTDIR/proprietary/lib/libgps.so:obj/lib/libgps.so
|
||||
|
||||
# Prebuilt libraries that are needed to build open-source libraries
|
||||
PRODUCT_COPY_FILES += \\
|
||||
EOF
|
||||
|
||||
LINEEND=" \\"
|
||||
COUNT=`cat proprietary-files.txt | grep -v ^# | grep -v ^$ | wc -l | awk {'print $1'}`
|
||||
for FILE in `cat proprietary-files.txt | grep -v ^# | grep -v ^$`; do
|
||||
COUNT=`expr $COUNT - 1`
|
||||
if [ $COUNT = "0" ]; then
|
||||
LINEEND=""
|
||||
fi
|
||||
echo " $OUTDIR/proprietary/$FILE:system/$FILE$LINEEND" >> $MAKEFILE
|
||||
done
|
||||
|
||||
(cat << EOF) > ../../../$OUTDIR/$DEVICE-vendor.mk
|
||||
# Copyright (C) 2010 The Android Open Source 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.
|
||||
|
||||
# This file is generated by device/$MANUFACTURER/$DEVICE/setup-makefiles.sh
|
||||
|
||||
# Live wallpaper packages
|
||||
PRODUCT_PACKAGES := \\
|
||||
LiveWallpapersPicker \\
|
||||
librs_jni
|
||||
|
||||
\$(call inherit-product, vendor/__MANUFACTURER__/__DEVICE__/device-vendor-blobs.mk)
|
||||
\$(call inherit-product, $OUTDIR/$DEVICE-vendor-blobs.mk)
|
||||
EOF
|
||||
|
||||
(cat << EOF) | sed s/__DEVICE__/$DEVICE/g | sed s/__MANUFACTURER__/$MANUFACTURER/g > ../../../vendor/$MANUFACTURER/$DEVICE/BoardConfigVendor.mk
|
||||
(cat << EOF) > ../../../$OUTDIR/BoardConfigVendor.mk
|
||||
# Copyright (C) 2010 The Android Open Source Project
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -59,13 +96,13 @@ EOF
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# This file is generated by device/__MANUFACTURER__/__DEVICE__/setup-makefiles.sh
|
||||
# This file is generated by device/$MANUFACTURER/$DEVICE/setup-makefiles.sh
|
||||
|
||||
USE_CAMERA_STUB := false
|
||||
EOF
|
||||
|
||||
mkdir -p ../../../vendor/$MANUFACTURER/$DEVICE/overlay/packages/apps/Launcher2/res/layout
|
||||
(cat << EOF) | sed s/__DEVICE__/$DEVICE/g | sed s/__MANUFACTURER__/$MANUFACTURER/g > ../../../vendor/$MANUFACTURER/$DEVICE/overlay/packages/apps/Launcher2/res/layout/all_apps.xml
|
||||
mkdir -p ../../../$OUTDIR/overlay/packages/apps/Launcher2/res/layout
|
||||
(cat << EOF) > ../../../$OUTDIR/overlay/packages/apps/Launcher2/res/layout/all_apps.xml
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2010 The Android Open Source Project
|
||||
|
||||
@@ -82,7 +119,7 @@ mkdir -p ../../../vendor/$MANUFACTURER/$DEVICE/overlay/packages/apps/Launcher2/r
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<!-- This file is generated by device/__MANUFACTURER__/__DEVICE__/setup-makefiles.sh -->
|
||||
<!-- This file is generated by device/$MANUFACTURER/$DEVICE/setup-makefiles.sh -->
|
||||
|
||||
<!-- switch to all_apps_3d on devices that support RenderScript -->
|
||||
<merge xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
11
system.prop
11
system.prop
@@ -60,8 +60,8 @@ ro.config.alarm_alert=Alarm_Classic.ogg
|
||||
dalvik.vm.execution-mode=int:jit
|
||||
|
||||
# Persist default parameters
|
||||
persist.sys.use_dithering=0
|
||||
persist.sys.purgeable_assets=1
|
||||
persist.sys.use_dithering=1
|
||||
persist.sys.purgeable_assets=0
|
||||
|
||||
# VM heap size
|
||||
dalvik.vm.heapsize=24m
|
||||
@@ -69,11 +69,14 @@ dalvik.vm.heapsize=24m
|
||||
# Enable compcache
|
||||
ro.compcache.default=18
|
||||
|
||||
# Lock dirty_ratio to 20 when USB is mounted for improved transfer speed
|
||||
ro.vold.umsdirtyratio=20
|
||||
|
||||
# Makes HOME ADW / OTHERS to be always in memoory
|
||||
pref_lock_home=1
|
||||
|
||||
# Default Tether Dissabled
|
||||
ro.tether.denied=true
|
||||
# Default Tether Enabled
|
||||
ro.tether.denied=false
|
||||
|
||||
# Enable Google-specific location features,
|
||||
# like NetworkLocationProvider and LocationCollector.
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
mtd@misc 0460 radio diag
|
||||
@@ -1,5 +1,6 @@
|
||||
#
|
||||
# Copyright (C) 2009 The Android Open Source Project
|
||||
#!/bin/sh
|
||||
|
||||
# Copyright (C) 2010 The Android Open Source Project
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -12,12 +13,20 @@
|
||||
# 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.
|
||||
#
|
||||
|
||||
# This file is executed by build/envsetup.sh, and can use anything
|
||||
# defined in envsetup.sh.
|
||||
#
|
||||
# In particular, you can add lunch options with the add_lunch_combo
|
||||
# function: add_lunch_combo generic-eng
|
||||
DEVICE=click
|
||||
MANUFACTURER=htc
|
||||
|
||||
add_lunch_combo cyanogen_click-eng
|
||||
OUTDIR=../../../vendor/$MANUFACTURER/$DEVICE
|
||||
BASE=$OUTDIR/proprietary
|
||||
rm -rf $BASE/*
|
||||
|
||||
for FILE in `cat proprietary-files.txt | grep -v ^# | grep -v ^$`; do
|
||||
DIR=`dirname $FILE`
|
||||
if [ ! -d $BASE/$DIR ]; then
|
||||
mkdir -p $BASE/$DIR
|
||||
fi
|
||||
unzip -j -o ../../../${DEVICE}_update.zip system/$FILE -d $BASE/$DIR
|
||||
done
|
||||
|
||||
./setup-makefiles.sh
|
||||
Reference in New Issue
Block a user