composer: Read buffer attributes from private handle
Mapper Gralloc 4 API calls add huge overhead in querying the basic
buffer attributes and reading the Metadata for each layer, getting
updated in the frame. Use private handle to read buffer attributes
and Metadata to avoid overhead and fix the performance regression.
Change-Id: I7fc79fc47dc693d97cfb646e75bf3dcacbecef24
diff --git a/composer/hwc_layers.h b/composer/hwc_layers.h
index 26556cf..b1df68b 100644
--- a/composer/hwc_layers.h
+++ b/composer/hwc_layers.h
@@ -23,6 +23,7 @@
/* This class translates HWC2 Layer functions to the SDM LayerStack
*/
+#include "gr_utils.h"
#include <QtiGralloc.h>
#include <core/layer_stack.h>
#include <core/layer_buffer.h>
@@ -47,7 +48,7 @@
namespace sdm {
-DisplayError SetCSC(const native_handle_t *pvt_handle, ColorMetaData *color_metadata);
+DisplayError SetCSC(const private_handle_t *pvt_handle, ColorMetaData *color_metadata);
bool GetColorPrimary(const int32_t &dataspace, ColorPrimaries *color_primary);
bool GetTransfer(const int32_t &dataspace, GammaTransfer *gamma_transfer);
bool GetRange(const int32_t &dataspace, ColorRange *color_range);
@@ -154,9 +155,9 @@
void SetRect(const hwc_frect_t &source, LayerRect *target);
uint32_t GetUint32Color(const hwc_color_t &source);
void GetUBWCStatsFromMetaData(UBWCStats *cr_stats, UbwcCrStatsVector *cr_vec);
- DisplayError SetMetaData(const native_handle_t *pvt_handle, Layer *layer);
+ DisplayError SetMetaData(const private_handle_t *pvt_handle, Layer *layer);
uint32_t RoundToStandardFPS(float fps);
- void ValidateAndSetCSC(const native_handle_t *handle);
+ void ValidateAndSetCSC(const private_handle_t *handle);
void SetDirtyRegions(hwc_region_t surface_damage);
};