diff options
Diffstat (limited to 'libhwcomposer/hwc_utils.h')
-rw-r--r-- | libhwcomposer/hwc_utils.h | 53 |
1 files changed, 37 insertions, 16 deletions
diff --git a/libhwcomposer/hwc_utils.h b/libhwcomposer/hwc_utils.h index ced542e98..866073c90 100644 --- a/libhwcomposer/hwc_utils.h +++ b/libhwcomposer/hwc_utils.h @@ -29,6 +29,7 @@ #define UNLIKELY( exp ) (__builtin_expect( (exp) != 0, false )) #define FINAL_TRANSFORM_MASK 0x000F #define MAX_NUM_DISPLAYS 4 //Yes, this is ambitious +#define MAX_NUM_LAYERS 32 //Fwrd decls struct hwc_context_t; @@ -57,6 +58,7 @@ struct DisplayAttributes { uint32_t vsync_period; //nanos uint32_t xres; uint32_t yres; + uint32_t stride; float xdpi; float ydpi; int fd; @@ -73,15 +75,43 @@ struct ListStats { //Video specific int yuvCount; int yuvIndex; + bool needsAlphaScale; }; + +struct LayerProp { + uint32_t mFlags; //qcom specific layer flags + LayerProp():mFlags(0) {}; +}; + +// LayerProp::flag values enum { - HWC_MDPCOMP = 0x00000002, - HWC_LAYER_RESERVED_0 = 0x00000004, - HWC_LAYER_RESERVED_1 = 0x00000008 + HWC_MDPCOMP = 0x00000001, +}; + +class LayerCache { + public: + LayerCache() { + canUseLayerCache = false; + numHwLayers = 0; + for(uint32_t i = 0; i < MAX_NUM_LAYERS; i++) { + hnd[i] = NULL; + } + } + //LayerCache optimization + void updateLayerCache(hwc_display_contents_1_t* list); + void resetLayerCache(int num); + void markCachedLayersAsOverlay(hwc_display_contents_1_t* list); + private: + uint32_t numHwLayers; + bool canUseLayerCache; + buffer_handle_t hnd[MAX_NUM_LAYERS]; + }; + + // ----------------------------------------------------------------------------- // Utility functions - implemented in hwc_utils.cpp void dumpLayer(hwc_layer_1_t const* l); @@ -92,7 +122,7 @@ void closeContext(hwc_context_t *ctx); //Crops source buffer against destination and FB boundaries void calculate_crop_rects(hwc_rect_t& crop, hwc_rect_t& dst, const int fbWidth, const int fbHeight, int orient); - +bool isSecuring(hwc_context_t* ctx); bool isExternalActive(hwc_context_t* ctx); //Sync point impl. @@ -175,33 +205,24 @@ struct vsync_state { struct hwc_context_t { hwc_composer_device_1_t device; const hwc_procs_t* proc; - - int overlayInUse[HWC_NUM_DISPLAY_TYPES]; - //Framebuffer device framebuffer_device_t *mFbDev; - //Overlay object - NULL for non overlay devices - overlay::Overlay *mOverlay[HWC_NUM_DISPLAY_TYPES]; - + overlay::Overlay *mOverlay; //QService object qService::QService *mQService; - // External display related information qhwc::ExternalDisplay *mExtDisplay; - qhwc::MDPInfo mMDP; - qhwc::DisplayAttributes dpyAttr[HWC_NUM_DISPLAY_TYPES]; - qhwc::ListStats listStats[HWC_NUM_DISPLAY_TYPES]; + qhwc::LayerCache *mLayerCache[HWC_NUM_DISPLAY_TYPES]; + qhwc::LayerProp *layerProp[HWC_NUM_DISPLAY_TYPES]; //Securing in progress indicator bool mSecuring; - //Display in secure mode indicator bool mSecureMode; - //Lock to prevent set from being called while blanking mutable Locker mBlankLock; //Lock to protect set when detaching external disp |