Support M
authorDmitry Grinberg <dmitrygr@gmail.com>
Sat, 10 Oct 2015 21:19:50 +0000 (21:19 +0000)
committerScott Warner <Tortel1210@gmail.com>
Mon, 12 Oct 2015 13:41:45 +0000 (09:41 -0400)
Change-Id: I517d094e45344501298f57ab9f68e62e49b23a4e

exynos_omx/openmax/exynos_omx/osal/Exynos_OSAL_Android.cpp
gralloc/gralloc.cpp
libcamera2/ExynosCamera2.cpp
libcamera2/ExynosCameraHWInterface2.cpp
libcamera2/ExynosJpegEncoderForCamera.cpp
libcsc/csc.c
libkeymaster/keymaster_mobicore.cpp
mobicore/Android.mk
mobicore/common/LogWrapper/log.h
mobicore/daemon/Daemon/Server/NetlinkServer.cpp

index b91365b1813639ebe97f5e5b978c821aac46584f..b128aafe39d68dae01f6c4be9712d16cedd5e432 100644 (file)
@@ -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];
 
index b5f269bf242be4d31fa40cd1bb914956cb801aac..d48acab047cf10544824ff652cab10fd4e489b58 100644 (file)
 #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:
index 35bb9f518d6f772a492c07662ef31e72d71a0725..e06f670604f6f193b25348ccd70c2f6f155420a0 100644 (file)
@@ -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,
index fa6c8d39c62ce4531e62600327c76ceac17890e4..0bc8aa460b084dec4877694f4146b9b7a8ca53af 100644 (file)
@@ -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,
     };
 }
 
index 9eb924fe192457bc904727e529c8754211a3666c..14d73afa52185b62d3cab8467f41c3dd3c30df70 100644 (file)
@@ -17,6 +17,7 @@
 
 #define LOG_TAG "ExynosJpegForCamera"
 #include <utils/Log.h>
+#include <string.h>
 
 #include "ExynosJpegEncoderForCamera.h"
 
index 0831f612b1ecc5e446f4d376dcbdca8c4ae8560a..8608dee66c5a62e5473890a5729853701cf2815e 100644 (file)
@@ -29,6 +29,7 @@
  */
 #define LOG_TAG "libcsc"
 #include <cutils/log.h>
+#include <errno.h>
 
 #include <stdio.h>
 #include <stdlib.h>
index 7d11a18416563a7c3044b741cc83ccc0be5bbe06..784b41e8df6e400b0352d5f0ead9a8096205bd66 100644 (file)
@@ -20,7 +20,7 @@
 #include <stdint.h>
 
 #include <hardware/hardware.h>
-#include <hardware/keymaster.h>
+#include <hardware/keymaster0.h>
 
 #include <openssl/evp.h>
 #include <openssl/bio.h>
@@ -66,7 +66,7 @@ struct RSA_Delete {
 };
 typedef UniquePtr<RSA, RSA_Delete> Unique_RSA;
 
-typedef UniquePtr<keymaster_device_t> Unique_keymaster_device_t;
+typedef UniquePtr<keymaster0_device_t> 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;
 
index c89cb228edb9291d16d2eba604a565286df077e8..d9ec6748cbe072877934066af2d3042fc773bead 100644 (file)
@@ -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
index 36c174625dd81799f7c809dd2bb11252a3add9c6..c3716e8fb0b6f6bc6d196437b9c48d7c280f308c 100644 (file)
@@ -36,6 +36,7 @@
 
 #include <unistd.h>
 #include <stdio.h>
+#include <string.h>
 #include <android/log.h>
 
 /** LOG_I(fmt, args...)
     #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)
 
             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)
index cdf80f5e86815b6e630e26544bc7dee0bee7911e..a91af10086b2a22082d4f1a8ab67a5e5280c5fff 100644 (file)
@@ -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;