gralloc : Add singleton class for mdp capability
Many case reading the same mdp capability multiple times from sys file causing delay in operation. Hence reading only once. Change-Id: I1b94ca63074aba2f078fe6add5a8de628ca87740
This commit is contained in:
@@ -76,6 +76,7 @@ using namespace qdutils;
|
|||||||
using namespace android;
|
using namespace android;
|
||||||
|
|
||||||
ANDROID_SINGLETON_STATIC_INSTANCE(AdrenoMemInfo);
|
ANDROID_SINGLETON_STATIC_INSTANCE(AdrenoMemInfo);
|
||||||
|
ANDROID_SINGLETON_STATIC_INSTANCE(MDPCapabilityInfo);
|
||||||
|
|
||||||
static void getYuvUBwcWidthHeight(int, int, int, int&, int&);
|
static void getYuvUBwcWidthHeight(int, int, int, int&, int&);
|
||||||
static unsigned int getUBwcSize(int, int, int, const int, const int);
|
static unsigned int getUBwcSize(int, int, int, const int, const int);
|
||||||
@@ -97,7 +98,17 @@ static bool useUncached(const int& usage) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------- AdrenoMemInfo-----------------------//
|
//------------- MDPCapabilityInfo-----------------------//
|
||||||
|
MDPCapabilityInfo :: MDPCapabilityInfo() {
|
||||||
|
isMacroTileSupported = false;
|
||||||
|
qdutils::querySDEInfo(HAS_MACRO_TILE, &isMacroTileSupported);
|
||||||
|
}
|
||||||
|
|
||||||
|
int MDPCapabilityInfo :: isMacroTilingSupportedByMDP(){
|
||||||
|
return isMacroTileSupported;
|
||||||
|
}
|
||||||
|
|
||||||
|
//------------- AdrenoMemInfo-----------------------//
|
||||||
AdrenoMemInfo::AdrenoMemInfo()
|
AdrenoMemInfo::AdrenoMemInfo()
|
||||||
{
|
{
|
||||||
LINK_adreno_compute_aligned_width_and_height = NULL;
|
LINK_adreno_compute_aligned_width_and_height = NULL;
|
||||||
@@ -516,13 +527,9 @@ IMemAlloc* IonController::getAllocator(int flags)
|
|||||||
bool isMacroTileEnabled(int format, int usage)
|
bool isMacroTileEnabled(int format, int usage)
|
||||||
{
|
{
|
||||||
bool tileEnabled = false;
|
bool tileEnabled = false;
|
||||||
int isMacroTileSupportedByMDP = 0;
|
|
||||||
|
|
||||||
qdutils::querySDEInfo(HAS_MACRO_TILE, &isMacroTileSupportedByMDP);
|
|
||||||
|
|
||||||
// Check whether GPU & MDSS supports MacroTiling feature
|
// Check whether GPU & MDSS supports MacroTiling feature
|
||||||
if(AdrenoMemInfo::getInstance().isMacroTilingSupportedByGPU() &&
|
if(AdrenoMemInfo::getInstance().isMacroTilingSupportedByGPU() &&
|
||||||
isMacroTileSupportedByMDP)
|
MDPCapabilityInfo::getInstance().isMacroTilingSupportedByMDP())
|
||||||
{
|
{
|
||||||
// check the format
|
// check the format
|
||||||
switch(format)
|
switch(format)
|
||||||
|
|||||||
@@ -197,4 +197,21 @@ class AdrenoMemInfo : public android::Singleton <AdrenoMemInfo>
|
|||||||
|
|
||||||
unsigned int (*LINK_adreno_get_gpu_pixel_alignment) ();
|
unsigned int (*LINK_adreno_get_gpu_pixel_alignment) ();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class MDPCapabilityInfo : public android::Singleton <MDPCapabilityInfo>
|
||||||
|
{
|
||||||
|
int isMacroTileSupported;
|
||||||
|
public:
|
||||||
|
MDPCapabilityInfo();
|
||||||
|
/*
|
||||||
|
* Function to return whether MDP support MacroTile feature
|
||||||
|
*
|
||||||
|
* @return 1 : supported
|
||||||
|
* 0 : not supported
|
||||||
|
*/
|
||||||
|
int isMacroTilingSupportedByMDP();
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
#endif /* GR_H_ */
|
#endif /* GR_H_ */
|
||||||
|
|||||||
Reference in New Issue
Block a user