diff options
author | dalecurtis@chromium.org <dalecurtis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-04 18:30:43 +0000 |
---|---|---|
committer | dalecurtis@chromium.org <dalecurtis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-04 18:30:43 +0000 |
commit | 8638b8865464d4b0d2518a2186a1a1756a5b8544 (patch) | |
tree | eb81f9b69cfa3ab1a6b6590683c27ea0e1a1322e /third_party/hwcplus | |
parent | 552eeef1ce86431629b002ceebd116dae9b0e2ae (diff) | |
download | chromium_src-8638b8865464d4b0d2518a2186a1a1756a5b8544.zip chromium_src-8638b8865464d4b0d2518a2186a1a1756a5b8544.tar.gz chromium_src-8638b8865464d4b0d2518a2186a1a1756a5b8544.tar.bz2 |
Revert of Make it possible to build libhardware. (https://codereview.chromium.org/252583002/)
Reason for revert:
Broke check_licenses, since hwcplus_util.c doesn't have a license. Please add one.
http://build.chromium.org/p/chromium/builders/Linux/builds/49510/steps/check_licenses/logs/stdio
Original issue's description:
> Make it possible to build libhardware.
>
> Fix up some include files, supply some stubs, and make the hardware
> module search path configurable at compile time and run time.
>
> BUG=358029
>
> Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=268096
TBR=rjkroege@chromium.org,fjhenigman@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=358029
Review URL: https://codereview.chromium.org/262153002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@268112 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/hwcplus')
-rw-r--r-- | third_party/hwcplus/include/cutils/properties.h | 9 | ||||
-rw-r--r-- | third_party/hwcplus/include/hardware/hardware.h | 6 | ||||
-rw-r--r-- | third_party/hwcplus/include/log/log.h | 4 | ||||
-rw-r--r-- | third_party/hwcplus/include/system/graphics.h | 3 | ||||
-rw-r--r-- | third_party/hwcplus/src/hardware.c | 30 | ||||
-rw-r--r-- | third_party/hwcplus/src/hwcplus_util.c | 71 |
6 files changed, 5 insertions, 118 deletions
diff --git a/third_party/hwcplus/include/cutils/properties.h b/third_party/hwcplus/include/cutils/properties.h index 66a9c5b..2c70165 100644 --- a/third_party/hwcplus/include/cutils/properties.h +++ b/third_party/hwcplus/include/cutils/properties.h @@ -19,16 +19,7 @@ #include <sys/cdefs.h> #include <stddef.h> -#ifdef ANDROID #include <sys/system_properties.h> -#else -#ifndef PROP_NAME_MAX -#define PROP_NAME_MAX 32 -#endif -#ifndef PROP_VALUE_MAX -#define PROP_VALUE_MAX 92 -#endif -#endif #ifdef __cplusplus extern "C" { diff --git a/third_party/hwcplus/include/hardware/hardware.h b/third_party/hwcplus/include/hardware/hardware.h index 9466537..416ae39 100644 --- a/third_party/hwcplus/include/hardware/hardware.h +++ b/third_party/hwcplus/include/hardware/hardware.h @@ -225,12 +225,6 @@ int hw_get_module(const char *id, const struct hw_module_t **module); int hw_get_module_by_class(const char *class_id, const char *inst, const struct hw_module_t **module); -/** - * Provide a function to handle log messages. - */ -typedef int (*hwcplus_log_fn_t)(int prio, const char* tag, const char* msg); -void hwcplus_set_log_fn(hwcplus_log_fn_t fn); - __END_DECLS #endif /* ANDROID_INCLUDE_HARDWARE_HARDWARE_H */ diff --git a/third_party/hwcplus/include/log/log.h b/third_party/hwcplus/include/log/log.h index 4677ed4..7faddea 100644 --- a/third_party/hwcplus/include/log/log.h +++ b/third_party/hwcplus/include/log/log.h @@ -37,12 +37,8 @@ #endif #include <stdarg.h> -#ifdef ANDROID #include <log/uio.h> #include <log/logd.h> -#else -#include <android/log.h> -#endif #ifdef __cplusplus extern "C" { diff --git a/third_party/hwcplus/include/system/graphics.h b/third_party/hwcplus/include/system/graphics.h index 4ba6a9e..be86ae4 100644 --- a/third_party/hwcplus/include/system/graphics.h +++ b/third_party/hwcplus/include/system/graphics.h @@ -18,9 +18,6 @@ #define SYSTEM_CORE_INCLUDE_ANDROID_GRAPHICS_H #include <stdint.h> -#ifndef ANDROID -#include <stddef.h> -#endif #ifdef __cplusplus extern "C" { diff --git a/third_party/hwcplus/src/hardware.c b/third_party/hwcplus/src/hardware.c index 4ff293d..6713ea0 100644 --- a/third_party/hwcplus/src/hardware.c +++ b/third_party/hwcplus/src/hardware.c @@ -23,29 +23,17 @@ #include <pthread.h> #include <errno.h> #include <limits.h> -#include <stdlib.h> #define LOG_TAG "HAL" -#ifdef ANDROID #include <utils/Log.h> -#else -#include <stdio.h> -#include <unistd.h> -#include <log/log.h> -#endif +/** Base path of the hal modules */ #if defined(__LP64__) -#define _64 "64" +#define HAL_LIBRARY_PATH1 "/system/lib64/hw" +#define HAL_LIBRARY_PATH2 "/vendor/lib64/hw" #else -#define _64 "" -#endif - -/** Base path of the hal modules */ -#ifndef HAL_LIBRARY_PATH1 -#define HAL_LIBRARY_PATH1 "/system/lib" _64 "/hw" -#endif -#ifndef HAL_LIBRARY_PATH2 -#define HAL_LIBRARY_PATH2 "/vendor/lib" _64 "/hw" +#define HAL_LIBRARY_PATH1 "/system/lib/hw" +#define HAL_LIBRARY_PATH2 "/vendor/lib/hw" #endif /** @@ -141,14 +129,6 @@ static int load(const char *id, static int hw_module_exists(char *path, size_t path_len, const char *name, const char *subname) { - char *hal_library_path = getenv("HAL_LIBRARY_PATH"); - if (hal_library_path) { - snprintf(path, path_len, "%s/%s.%s.so", - hal_library_path, name, subname); - if (access(path, R_OK) == 0) - return 0; - } - snprintf(path, path_len, "%s/%s.%s.so", HAL_LIBRARY_PATH2, name, subname); if (access(path, R_OK) == 0) diff --git a/third_party/hwcplus/src/hwcplus_util.c b/third_party/hwcplus/src/hwcplus_util.c deleted file mode 100644 index 2ae6eca..0000000 --- a/third_party/hwcplus/src/hwcplus_util.c +++ /dev/null @@ -1,71 +0,0 @@ -#include <stdarg.h> -#include <stdio.h> -#include <string.h> - -#include <hardware/hardware.h> -#include <cutils/properties.h> - -#define LOG_BUF_SIZE 1024 - -static int default_log_fn(int prio, const char* tag, const char* msg); - -static hwcplus_log_fn_t hwcplus_log_fn = default_log_fn; - -void hwcplus_set_log_fn(hwcplus_log_fn_t fn) { - hwcplus_log_fn = fn; -} - -#ifndef HAVE_STRLCPY -size_t strlcpy(char* dst, const char* src, size_t siz) { - char* d = dst; - const char* s = src; - size_t n = siz; - - /* Copy as many bytes as will fit */ - if (n != 0) { - while (--n != 0) { - if ((*d++ = *s++) == '\0') - break; - } - } - - /* Not enough room in dst, add NUL and traverse rest of src */ - if (n == 0) { - if (siz != 0) - *d = '\0'; /* NUL-terminate dst */ - while (*s++) { - } - } - - return(s - src - 1); /* count does not include NUL */ -} -#endif - -static int default_log_fn(int prio, const char* tag, const char* msg) { - fprintf(stderr, "<%d> %s %s\n", prio, tag, msg); -} - -int __android_log_write(int prio, const char* tag, const char* msg) { - hwcplus_log_fn(prio, tag, msg); -} - -int __android_log_print(int prio, const char* tag, const char* fmt, ...) { - va_list ap; - char buf[LOG_BUF_SIZE]; - - va_start(ap, fmt); - vsnprintf(buf, LOG_BUF_SIZE, fmt, ap); - va_end(ap); - - return __android_log_write(prio, tag, buf); -} - -int property_get(const char* key, char* value, const char* default_value) { - printf("property_get %s\n", key); - const char* r = default_value; - if (!r) - r = ""; - strncpy(value, r, PROPERTY_VALUE_MAX); - return strlen(r); -} - |