diff options
author | Manikanta Kanamarlapudi <kmanikan@codeaurora.org> | 2016-02-03 17:49:55 +0530 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-02-10 22:13:14 -0800 |
commit | cb44d976a0b2f741c9bdee2bdb13dc4d82fa96b7 (patch) | |
tree | feac2db9effe60010841e87ee1d6c43fcfb89586 | |
parent | 937c5da92881050e4cd0b7a52d29a6c036caa317 (diff) | |
download | hardware_qcom_display-cb44d976a0b2f741c9bdee2bdb13dc4d82fa96b7.tar.gz hardware_qcom_display-cb44d976a0b2f741c9bdee2bdb13dc4d82fa96b7.tar.bz2 hardware_qcom_display-cb44d976a0b2f741c9bdee2bdb13dc4d82fa96b7.zip |
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
-rw-r--r-- | libgralloc/alloc_controller.cpp | 9 | ||||
-rw-r--r-- | libgralloc/alloc_controller.h | 7 |
2 files changed, 16 insertions, 0 deletions
diff --git a/libgralloc/alloc_controller.cpp b/libgralloc/alloc_controller.cpp index 7411c38e5..430d7fda7 100644 --- a/libgralloc/alloc_controller.cpp +++ b/libgralloc/alloc_controller.cpp @@ -413,6 +413,10 @@ IAllocController* IAllocController::getInstance(void) IonController::IonController() { allocateIonMem(); + + char property[PROPERTY_VALUE_MAX]; + property_get("video.disable.ubwc", property, "0"); + mDisableUBWCForEncode = atoi(property); } void IonController::allocateIonMem() @@ -906,6 +910,11 @@ bool isUBwcEnabled(int format, int usage) if (isUBwcFormat(format)) 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 // support the format. OR if a non-OpenGL client like Rotator, sets UBWC // usage flag and MDP supports the format. diff --git a/libgralloc/alloc_controller.h b/libgralloc/alloc_controller.h index 919e5724f..8216b0c88 100644 --- a/libgralloc/alloc_controller.h +++ b/libgralloc/alloc_controller.h @@ -56,6 +56,8 @@ class IAllocController { virtual IMemAlloc* getAllocator(int flags) = 0; + virtual bool isDisableUBWCForEncoder(); + virtual ~IAllocController() {}; static IAllocController* getInstance(void); @@ -72,10 +74,15 @@ class IonController : public IAllocController { virtual IMemAlloc* getAllocator(int flags); + virtual bool isDisableUBWCForEncoder() { + return mDisableUBWCForEncode; + } + IonController(); private: IonAlloc* mIonAlloc; + bool mDisableUBWCForEncode; void allocateIonMem(); }; |