libgralloc: disable UBWC for video encoder usecase
check for target specific system property "video.disable.ubwc" to disable UBWC for the targets where encoder doesn't support UBWC color-format. Change-Id: Ifd050c3b44768870fc74a16e941e8286e3ea0c13
This commit is contained in:
committed by
Gerrit - the friendly Code Review server
parent
937c5da928
commit
cb44d976a0
@@ -413,6 +413,10 @@ IAllocController* IAllocController::getInstance(void)
|
|||||||
IonController::IonController()
|
IonController::IonController()
|
||||||
{
|
{
|
||||||
allocateIonMem();
|
allocateIonMem();
|
||||||
|
|
||||||
|
char property[PROPERTY_VALUE_MAX];
|
||||||
|
property_get("video.disable.ubwc", property, "0");
|
||||||
|
mDisableUBWCForEncode = atoi(property);
|
||||||
}
|
}
|
||||||
|
|
||||||
void IonController::allocateIonMem()
|
void IonController::allocateIonMem()
|
||||||
@@ -906,6 +910,11 @@ bool isUBwcEnabled(int format, int usage)
|
|||||||
if (isUBwcFormat(format))
|
if (isUBwcFormat(format))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
if ((usage & GRALLOC_USAGE_HW_VIDEO_ENCODER) &&
|
||||||
|
gralloc::IAllocController::getInstance()->isDisableUBWCForEncoder()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Allow UBWC, if an OpenGL client sets UBWC usage flag and GPU plus MDP
|
// Allow UBWC, if an OpenGL client sets UBWC usage flag and GPU plus MDP
|
||||||
// support the format. OR if a non-OpenGL client like Rotator, sets UBWC
|
// support the format. OR if a non-OpenGL client like Rotator, sets UBWC
|
||||||
// usage flag and MDP supports the format.
|
// usage flag and MDP supports the format.
|
||||||
|
|||||||
@@ -56,6 +56,8 @@ class IAllocController {
|
|||||||
|
|
||||||
virtual IMemAlloc* getAllocator(int flags) = 0;
|
virtual IMemAlloc* getAllocator(int flags) = 0;
|
||||||
|
|
||||||
|
virtual bool isDisableUBWCForEncoder();
|
||||||
|
|
||||||
virtual ~IAllocController() {};
|
virtual ~IAllocController() {};
|
||||||
|
|
||||||
static IAllocController* getInstance(void);
|
static IAllocController* getInstance(void);
|
||||||
@@ -72,10 +74,15 @@ class IonController : public IAllocController {
|
|||||||
|
|
||||||
virtual IMemAlloc* getAllocator(int flags);
|
virtual IMemAlloc* getAllocator(int flags);
|
||||||
|
|
||||||
|
virtual bool isDisableUBWCForEncoder() {
|
||||||
|
return mDisableUBWCForEncode;
|
||||||
|
}
|
||||||
|
|
||||||
IonController();
|
IonController();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
IonAlloc* mIonAlloc;
|
IonAlloc* mIonAlloc;
|
||||||
|
bool mDisableUBWCForEncode;
|
||||||
void allocateIonMem();
|
void allocateIonMem();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user