From bb99f0edf0273f061bbd9ca7765a727b2ccaab64 Mon Sep 17 00:00:00 2001 From: Dmitry Grinberg Date: Sat, 10 Oct 2015 21:19:50 +0000 Subject: [PATCH] Support M Change-Id: I517d094e45344501298f57ab9f68e62e49b23a4e --- .../exynos_omx/osal/Exynos_OSAL_Android.cpp | 2 +- gralloc/gralloc.cpp | 13 ++++++++- libcamera2/ExynosCamera2.cpp | 2 +- libcamera2/ExynosCameraHWInterface2.cpp | 28 ++++++++----------- libcamera2/ExynosJpegEncoderForCamera.cpp | 1 + libcsc/csc.c | 1 + libkeymaster/keymaster_mobicore.cpp | 16 +++++------ mobicore/Android.mk | 4 +-- mobicore/common/LogWrapper/log.h | 9 +++--- .../daemon/Daemon/Server/NetlinkServer.cpp | 4 +-- 10 files changed, 44 insertions(+), 36 deletions(-) diff --git a/exynos_omx/openmax/exynos_omx/osal/Exynos_OSAL_Android.cpp b/exynos_omx/openmax/exynos_omx/osal/Exynos_OSAL_Android.cpp index b91365b..b128aaf 100644 --- a/exynos_omx/openmax/exynos_omx/osal/Exynos_OSAL_Android.cpp +++ b/exynos_omx/openmax/exynos_omx/osal/Exynos_OSAL_Android.cpp @@ -81,7 +81,7 @@ OMX_ERRORTYPE Exynos_OSAL_LockANBHandle( GraphicBufferMapper &mapper = GraphicBufferMapper::get(); buffer_handle_t bufferHandle = (buffer_handle_t) handle; private_handle_t *priv_hnd = (private_handle_t *) bufferHandle; - Rect bounds(width, height); + Rect bounds((uint32_t)width, (uint32_t)height); ExynosVideoPlane *vplanes = (ExynosVideoPlane *) planes; void *vaddr[MAX_BUFFER_PLANE]; diff --git a/gralloc/gralloc.cpp b/gralloc/gralloc.cpp index b5f269b..d48acab 100644 --- a/gralloc/gralloc.cpp +++ b/gralloc/gralloc.cpp @@ -48,6 +48,17 @@ #define MB_1 (1024*1024) + +//these are no longer defined, but we DO support them, so let's keep that knowledge alive for potential binary-blob users +#define HAL_PIXEL_FORMAT_sRGB_A_8888 12 +#define HAL_PIXEL_FORMAT_sRGB_X_8888 13 + + + + + + + /*****************************************************************************/ struct gralloc_context_t { @@ -160,7 +171,7 @@ static int gralloc_alloc_rgb(int ionfd, int w, int h, int format, int usage, bpp = 3; break; case HAL_PIXEL_FORMAT_RGB_565: - case HAL_PIXEL_FORMAT_RAW_SENSOR: + case HAL_PIXEL_FORMAT_RAW16: bpp = 2; break; case HAL_PIXEL_FORMAT_BLOB: diff --git a/libcamera2/ExynosCamera2.cpp b/libcamera2/ExynosCamera2.cpp index 35bb9f5..e06f670 100644 --- a/libcamera2/ExynosCamera2.cpp +++ b/libcamera2/ExynosCamera2.cpp @@ -105,7 +105,7 @@ const nsecs_t Sensor::kFrameDurationRange[2] = const uint8_t Sensor::kColorFilterArrangement = ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGGB; const uint32_t kAvailableFormats[5] = { - HAL_PIXEL_FORMAT_RAW_SENSOR, + HAL_PIXEL_FORMAT_RAW16, HAL_PIXEL_FORMAT_BLOB, HAL_PIXEL_FORMAT_RGBA_8888, HAL_PIXEL_FORMAT_YV12, diff --git a/libcamera2/ExynosCameraHWInterface2.cpp b/libcamera2/ExynosCameraHWInterface2.cpp index fa6c8d3..0bc8aa4 100644 --- a/libcamera2/ExynosCameraHWInterface2.cpp +++ b/libcamera2/ExynosCameraHWInterface2.cpp @@ -6494,28 +6494,22 @@ done: static hw_module_methods_t camera_module_methods = { - open : HAL2_camera_device_open + .open = HAL2_camera_device_open }; extern "C" { struct camera_module HAL_MODULE_INFO_SYM = { - common : { - tag : HARDWARE_MODULE_TAG, - module_api_version : CAMERA_MODULE_API_VERSION_2_0, - hal_api_version : HARDWARE_HAL_API_VERSION, - id : CAMERA_HARDWARE_MODULE_ID, - name : "Exynos Camera HAL2", - author : "Samsung Corporation", - methods : &camera_module_methods, - dso : NULL, - reserved : {0}, + .common = { + .tag = HARDWARE_MODULE_TAG, + .module_api_version = CAMERA_MODULE_API_VERSION_2_0, + .hal_api_version = HARDWARE_HAL_API_VERSION, + .id = CAMERA_HARDWARE_MODULE_ID, + .name = "Exynos Camera HAL2", + .author = "Samsung Corporation", + .methods = &camera_module_methods, }, - get_number_of_cameras : HAL2_getNumberOfCameras, - get_camera_info : HAL2_getCameraInfo, - set_callbacks : NULL, - get_vendor_tag_ops : NULL, - open_legacy : NULL, - reserved : {0} + .get_number_of_cameras = HAL2_getNumberOfCameras, + .get_camera_info = HAL2_getCameraInfo, }; } diff --git a/libcamera2/ExynosJpegEncoderForCamera.cpp b/libcamera2/ExynosJpegEncoderForCamera.cpp index 9eb924f..14d73af 100644 --- a/libcamera2/ExynosJpegEncoderForCamera.cpp +++ b/libcamera2/ExynosJpegEncoderForCamera.cpp @@ -17,6 +17,7 @@ #define LOG_TAG "ExynosJpegForCamera" #include +#include #include "ExynosJpegEncoderForCamera.h" diff --git a/libcsc/csc.c b/libcsc/csc.c index 0831f61..8608dee 100644 --- a/libcsc/csc.c +++ b/libcsc/csc.c @@ -29,6 +29,7 @@ */ #define LOG_TAG "libcsc" #include +#include #include #include diff --git a/libkeymaster/keymaster_mobicore.cpp b/libkeymaster/keymaster_mobicore.cpp index 7d11a18..784b41e 100644 --- a/libkeymaster/keymaster_mobicore.cpp +++ b/libkeymaster/keymaster_mobicore.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include @@ -66,7 +66,7 @@ struct RSA_Delete { }; typedef UniquePtr Unique_RSA; -typedef UniquePtr Unique_keymaster_device_t; +typedef UniquePtr Unique_keymaster0_device_t; /** * Many OpenSSL APIs take ownership of an argument on success but don't free the argument @@ -92,7 +92,7 @@ static void logOpenSSLError(const char* location) { ERR_remove_state(0); } -static int exynos_km_generate_keypair(const keymaster_device_t* dev, +static int exynos_km_generate_keypair(const keymaster0_device_t* dev, const keymaster_keypair_t key_type, const void* key_params, uint8_t** keyBlob, size_t* keyBlobLength) { teeResult_t ret = TEE_ERR_NONE; @@ -133,7 +133,7 @@ static int exynos_km_generate_keypair(const keymaster_device_t* dev, return 0; } -static int exynos_km_import_keypair(const keymaster_device_t* dev, +static int exynos_km_import_keypair(const keymaster0_device_t* dev, const uint8_t* key, const size_t key_length, uint8_t** key_blob, size_t* key_blob_length) { uint8_t kbuf[RSA_KEY_BUFFER_SIZE]; @@ -229,7 +229,7 @@ static int exynos_km_import_keypair(const keymaster_device_t* dev, return 0; } -static int exynos_km_get_keypair_public(const struct keymaster_device* dev, +static int exynos_km_get_keypair_public(const struct keymaster0_device* dev, const uint8_t* key_blob, const size_t key_blob_length, uint8_t** x509_data, size_t* x509_data_length) { uint32_t bin_mod_len; @@ -328,7 +328,7 @@ static int exynos_km_get_keypair_public(const struct keymaster_device* dev, return 0; } -static int exynos_km_sign_data(const keymaster_device_t* dev, +static int exynos_km_sign_data(const keymaster0_device_t* dev, const void* params, const uint8_t* keyBlob, const size_t keyBlobLength, const uint8_t* data, const size_t dataLength, @@ -376,7 +376,7 @@ static int exynos_km_sign_data(const keymaster_device_t* dev, return 0; } -static int exynos_km_verify_data(const keymaster_device_t* dev, +static int exynos_km_verify_data(const keymaster0_device_t* dev, const void* params, const uint8_t* keyBlob, const size_t keyBlobLength, const uint8_t* signedData, const size_t signedDataLength, @@ -431,7 +431,7 @@ static int exynos_km_open(const hw_module_t* module, const char* name, if (strcmp(name, KEYSTORE_KEYMASTER) != 0) return -EINVAL; - Unique_keymaster_device_t dev(new keymaster_device_t); + Unique_keymaster0_device_t dev(new keymaster0_device_t); if (dev.get() == NULL) return -ENOMEM; diff --git a/mobicore/Android.mk b/mobicore/Android.mk index c89cb22..d9ec674 100644 --- a/mobicore/Android.mk +++ b/mobicore/Android.mk @@ -12,12 +12,12 @@ COMP_PATH_MobiCoreDriverMod := $(MOBICORE_PROJECT_PATH)/include # Application wide Cflags GLOBAL_INCLUDES := bionic \ - external/stlport/stlport \ + external/libcxx \ $(COMP_PATH_MobiCore)/inc \ $(COMP_PATH_MobiCoreDriverMod)/Public \ $(COMP_PATH_MobiCore)/inc/TlCm -GLOBAL_LIBRARIES := libstlport +GLOBAL_LIBRARIES := libc++ # Include the Daemon include $(MOBICORE_PROJECT_PATH)/daemon/Android.mk diff --git a/mobicore/common/LogWrapper/log.h b/mobicore/common/LogWrapper/log.h index 36c1746..c3716e8 100644 --- a/mobicore/common/LogWrapper/log.h +++ b/mobicore/common/LogWrapper/log.h @@ -36,6 +36,7 @@ #include #include +#include #include /** LOG_I(fmt, args...) @@ -98,10 +99,10 @@ #define LOG_I(fmt, args...) DUMMY_FUNCTION() #define LOG_W(fmt, args...) DUMMY_FUNCTION() #else - #define LOG_I(...) _LOG_x("I",__VA_ARGS__) - #define LOG_W(...) _LOG_x("W",__VA_ARGS__) + #define LOG_I(...) _LOG_x("I", __VA_ARGS__) + #define LOG_W(...) _LOG_x("W", __VA_ARGS__) #endif - #define _LOG_E(...) _LOG_x("E",__VA_ARGS__) + #define _LOG_E(...) _LOG_x("E", __VA_ARGS__) #endif //defined(LOG_ANDROID) @@ -118,7 +119,7 @@ do \ { \ _LOG_E(" *****************************"); \ - _LOG_E(" *** ERROR: "__VA_ARGS__); \ + _LOG_E(" *** ERROR: " __VA_ARGS__); \ _LOG_E(" *** Detected in %s:%i/%s()", __FILE__, __LINE__, __FUNCTION__); \ _LOG_E(" *****************************"); \ } while(1!=1) diff --git a/mobicore/daemon/Daemon/Server/NetlinkServer.cpp b/mobicore/daemon/Daemon/Server/NetlinkServer.cpp index cdf80f5..a91af10 100644 --- a/mobicore/daemon/Daemon/Server/NetlinkServer.cpp +++ b/mobicore/daemon/Daemon/Server/NetlinkServer.cpp @@ -72,13 +72,13 @@ void NetlinkServer::run( struct nlmsghdr *nlh = NULL; struct iovec iov; struct msghdr msg; - uint32_t len; + int32_t len; memset(&src_addr, 0, sizeof(src_addr)); src_addr.nl_family = AF_NETLINK; src_addr.nl_pid = MC_DAEMON_PID; /* daemon pid */ src_addr.nl_groups = 0; /* not in mcast groups */ - if (bind(serverSock, (struct sockaddr *)&src_addr, sizeof(src_addr)) < 0) { + if (::bind(serverSock, (struct sockaddr *)&src_addr, sizeof(src_addr)) < 0) { LOG_ERRNO("Binding to server socket failed, because bind"); close(serverSock); break; -- 2.20.1