hwc: Update to new API
* Updates HWC to use the Jellybean MR1 API
* Remove qcom_ui which was using parts of the old API
Change-Id: I663363547b193d2318aae88f2256a9baed1e3d4b
diff --git a/libhwcomposer/hwc_utils.h b/libhwcomposer/hwc_utils.h
index 71c1f73..84309ac 100644
--- a/libhwcomposer/hwc_utils.h
+++ b/libhwcomposer/hwc_utils.h
@@ -18,6 +18,7 @@
#ifndef HWC_UTILS_H
#define HWC_UTILS_H
+#define HWC_REMOVE_DEPRECATED_VERSIONS 1
#include <hardware/hwcomposer.h>
#include <gralloc_priv.h>
@@ -25,6 +26,7 @@
#define LIKELY( exp ) (__builtin_expect( (exp) != 0, true ))
#define UNLIKELY( exp ) (__builtin_expect( (exp) != 0, false ))
#define FINAL_TRANSFORM_MASK 0x000F
+#define MAX_NUM_DISPLAYS 4 //Yes, this is ambitious
//Fwrd decls
struct hwc_context_t;
@@ -67,8 +69,8 @@
// -----------------------------------------------------------------------------
// Utility functions - implemented in hwc_utils.cpp
-void dumpLayer(hwc_layer_t const* l);
-void getLayerStats(hwc_context_t *ctx, const hwc_layer_list_t *list);
+void dumpLayer(hwc_layer_1_t const* l);
+void getLayerStats(hwc_context_t *ctx, const hwc_display_contents_1_t *list);
void initContext(hwc_context_t *ctx);
void closeContext(hwc_context_t *ctx);
//Crops source buffer against destination and FB boundaries
@@ -76,7 +78,7 @@
const int fbWidth, const int fbHeight);
// Inline utility functions
-static inline bool isSkipLayer(const hwc_layer_t* l) {
+static inline bool isSkipLayer(const hwc_layer_1_t* l) {
return (UNLIKELY(l && (l->flags & HWC_SKIP_LAYER)));
}
@@ -108,7 +110,7 @@
// Initialize uevent thread
void init_uevent_thread(hwc_context_t* ctx);
-inline void getLayerResolution(const hwc_layer_t* layer,
+inline void getLayerResolution(const hwc_layer_1_t* layer,
int& width, int& height)
{
hwc_rect_t displayFrame = layer->displayFrame;
@@ -121,9 +123,10 @@
// HWC context
// This structure contains overall state
struct hwc_context_t {
- hwc_composer_device_t device;
+ hwc_composer_device_1_t device;
int numHwLayers;
int overlayInUse;
+ hwc_display_t dpys[MAX_NUM_DISPLAYS];
//Framebuffer device
framebuffer_device_t *mFbDev;