diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2009-02-10 15:44:04 -0800 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-02-10 15:44:04 -0800 |
commit | b376203efb29c5f86ad8c8d40e90b74756669a1c (patch) | |
tree | 6b058ae8d46ca88bf59313a45090d84a28da486c | |
parent | f87393cb242a0de85631c3df4d8f147cdbb43e59 (diff) | |
download | libhardware-b376203efb29c5f86ad8c8d40e90b74756669a1c.tar.gz |
auto import from //branches/cupcake/...@130745
-rw-r--r-- | include/hardware/copybit.h | 14 | ||||
-rw-r--r-- | include/hardware/hardware.h | 19 | ||||
-rw-r--r-- | include/hardware/overlay.h | 14 | ||||
-rw-r--r-- | include/hardware/sensors.h | 30 | ||||
-rw-r--r-- | modules/README.android | 2 |
5 files changed, 59 insertions, 20 deletions
diff --git a/include/hardware/copybit.h b/include/hardware/copybit.h index 3c873e06..15b5ebee 100644 --- a/include/hardware/copybit.h +++ b/include/hardware/copybit.h @@ -39,13 +39,13 @@ __BEGIN_DECLS * graphics/PixelFormat.java, ui/PixelFormat.h, pixelflinger/format.h */ enum { - COPYBIT_FORMAT_RGBA_8888 = 1, - COPYBIT_FORMAT_RGB_565 = 4, - COPYBIT_FORMAT_BGRA_8888 = 5, - COPYBIT_FORMAT_RGBA_5551 = 6, - COPYBIT_FORMAT_RGBA_4444 = 7, - COPYBIT_FORMAT_YCbCr_422_SP = 0x10, - COPYBIT_FORMAT_YCbCr_420_SP = 0x11 + COPYBIT_FORMAT_RGBA_8888 = HAL_PIXEL_FORMAT_RGBA_8888, + COPYBIT_FORMAT_RGB_565 = HAL_PIXEL_FORMAT_RGB_565, + COPYBIT_FORMAT_BGRA_8888 = HAL_PIXEL_FORMAT_BGRA_8888, + COPYBIT_FORMAT_RGBA_5551 = HAL_PIXEL_FORMAT_RGBA_5551, + COPYBIT_FORMAT_RGBA_4444 = HAL_PIXEL_FORMAT_RGBA_4444, + COPYBIT_FORMAT_YCbCr_422_SP = HAL_PIXEL_FORMAT_YCbCr_422_SP, + COPYBIT_FORMAT_YCbCr_420_SP = HAL_PIXEL_FORMAT_YCbCr_420_SP, }; /* name for copybit_set_parameter */ diff --git a/include/hardware/hardware.h b/include/hardware/hardware.h index 65ce8d0c..e4806750 100644 --- a/include/hardware/hardware.h +++ b/include/hardware/hardware.h @@ -106,6 +106,25 @@ struct hw_device_t { */ int hw_get_module(const char *id, const struct hw_module_t **module); + +/** + * pixel format definitions + */ + +enum { + HAL_PIXEL_FORMAT_RGBA_8888 = 1, + HAL_PIXEL_FORMAT_RGB_565 = 4, + HAL_PIXEL_FORMAT_BGRA_8888 = 5, + HAL_PIXEL_FORMAT_RGBA_5551 = 6, + HAL_PIXEL_FORMAT_RGBA_4444 = 7, + HAL_PIXEL_FORMAT_YCbCr_422_SP = 0x10, + HAL_PIXEL_FORMAT_YCbCr_420_SP = 0x11, + HAL_PIXEL_FORMAT_YCbCr_422_P = 0x12, + HAL_PIXEL_FORMAT_YCbCr_420_P = 0x13, + HAL_PIXEL_FORMAT_YCbCr_422_I = 0x14, + HAL_PIXEL_FORMAT_YCbCr_420_I = 0x15 +}; + __END_DECLS #endif /* ANDROID_INCLUDE_HARDWARE_HARDWARE_H */ diff --git a/include/hardware/overlay.h b/include/hardware/overlay.h index a5cd2633..c5d43cbb 100644 --- a/include/hardware/overlay.h +++ b/include/hardware/overlay.h @@ -42,13 +42,11 @@ __BEGIN_DECLS /* possible overlay formats */ enum { - OVERLAY_FORMAT_RGBA_8888 = 1, - OVERLAY_FORMAT_RGB_565 = 4, - OVERLAY_FORMAT_BGRA_8888 = 5, - OVERLAY_FORMAT_YCbCr_422_SP = 0x10, - OVERLAY_FORMAT_YCbCr_420_SP = 0x11, - OVERLAY_FORMAT_YCbCr_422_I = 0x14, - OVERLAY_FORMAT_YCbCr_420_I = 0x15 + OVERLAY_FORMAT_RGBA_8888 = HAL_PIXEL_FORMAT_RGBA_8888, + OVERLAY_FORMAT_RGB_565 = HAL_PIXEL_FORMAT_RGB_565, + OVERLAY_FORMAT_BGRA_8888 = HAL_PIXEL_FORMAT_BGRA_8888, + OVERLAY_FORMAT_YCbCr_422_I = HAL_PIXEL_FORMAT_YCbCr_422_I, + OVERLAY_FORMAT_YCbCr_420_I = HAL_PIXEL_FORMAT_YCbCr_420_I }; /* values for copybit_set_parameter(OVERLAY_TRANSFORM) */ @@ -193,6 +191,8 @@ struct overlay_data_device_t { /* returns the address of a given buffer if supported, NULL otherwise. */ void* (*getBufferAddress)(struct overlay_data_device_t *dev, overlay_buffer_t buffer); + + int (*getBufferCount)(struct overlay_data_device_t *dev); }; diff --git a/include/hardware/sensors.h b/include/hardware/sensors.h index a7ab7ad5..094b3eee 100644 --- a/include/hardware/sensors.h +++ b/include/hardware/sensors.h @@ -37,7 +37,10 @@ __BEGIN_DECLS #define SENSORS_HARDWARE_DATA "data" /** - * Handles must be higher than SENSORS_HANDLE_BASE + * Handles must be higher than SENSORS_HANDLE_BASE and must be unique. + * A Handle identifies a given sensors. The handle is used to activate + * and/or deactivate sensors. + * In this version of the API there can only be 256 handles. */ #define SENSORS_HANDLE_BASE 0 #define SENSORS_HANDLE_BITS 8 @@ -232,22 +235,37 @@ struct sensors_module_t { struct hw_module_t common; /** - * @return bit map of available sensors defined by - * the constants SENSORS_XXXX. + * Enumerate all available sensors. The list is returned in "list". + * @return number of sensors in the list */ int (*get_sensors_list)(struct sensors_module_t* module, - struct sensor_t const**); + struct sensor_t const** list); }; struct sensor_t { + /* name of this sensors */ const char* name; + /* vendor of the hardware part */ const char* vendor; + /* version of the hardware part + driver. The value of this field is + * left to the implementation and doesn't have to be monotonicaly + * increasing. + */ int version; + /* handle that identifies this sensors. This handle is used to activate + * and deactivate this sensor. The value of the handle must be 8 bits + * in this version of the API. + */ int handle; + /* this sensor's type. */ int type; + /* maximaum range of this sensor's value in SI units */ float maxRange; + /* smallest difference between two values reported by this sensor */ float resolution; + /* rough estimate of this sensor's power consumption in mA */ float power; + /* reserved fields, must be zero */ void* reserved[9]; }; @@ -269,9 +287,9 @@ struct sensors_control_device_t { */ int (*open_data_source)(struct sensors_control_device_t *dev); - /** Activate/deactivate one or more of the sensors. + /** Activate/deactivate one sensor. * - * @param sensors is the handle of the sensors to change. + * @param handle is the handle of the sensor to change. * @param enabled set to 1 to enable, or 0 to disable the sensor. * * @return 0 on success, negative errno code otherwise diff --git a/modules/README.android b/modules/README.android index a79a1d55..57abb726 100644 --- a/modules/README.android +++ b/modules/README.android @@ -7,6 +7,8 @@ libhardware.so eventually should contain *just* the HAL hub Modules are .so in /system/libs/hw/ and have a well defined naming convention: + /system/libs/hw/<*_HARDWARE_MODULE_ID>.<ro.product.board>.so + /system/libs/hw/<*_HARDWARE_MODULE_ID>.<ro.board.platform>.so /system/libs/hw/<*_HARDWARE_MODULE_ID>.<ro.arch>.so /system/libs/hw/<*_HARDWARE_MODULE_ID>.default.so |