libgralloc: Enable UBWC output buffers for Writeback displays
While allocating output buffers for writeback display, check MDP support for writeback UBWC format before assigning the format. Change-Id: I97bb320ec89d60453c4c7e3dc5a2b5c2a18394dd
This commit is contained in:
committed by
Gerrit - the friendly Code Review server
parent
13f964b7b8
commit
9bc1a783bf
@@ -101,6 +101,7 @@ static bool useUncached(const int& usage) {
|
||||
MDPCapabilityInfo :: MDPCapabilityInfo() {
|
||||
qdutils::querySDEInfo(HAS_MACRO_TILE, &isMacroTileSupported);
|
||||
qdutils::querySDEInfo(HAS_UBWC, &isUBwcSupported);
|
||||
qdutils::querySDEInfo(HAS_WB_UBWC, &isWBUBWCSupported);
|
||||
}
|
||||
|
||||
//------------- AdrenoMemInfo-----------------------//
|
||||
|
||||
@@ -267,9 +267,13 @@ int gpu_context_t::alloc_impl(int w, int h, int format, int usage,
|
||||
format == HAL_PIXEL_FORMAT_YCbCr_420_888) {
|
||||
if (usage & GRALLOC_USAGE_PRIVATE_ALLOC_UBWC)
|
||||
grallocFormat = HAL_PIXEL_FORMAT_YCbCr_420_SP_VENUS_UBWC;
|
||||
else if(usage & GRALLOC_USAGE_HW_VIDEO_ENCODER)
|
||||
else if(usage & GRALLOC_USAGE_HW_VIDEO_ENCODER) {
|
||||
if(MDPCapabilityInfo::getInstance().isWBUBWCSupportedByMDP() &&
|
||||
usage & GRALLOC_USAGE_HW_COMPOSER)
|
||||
grallocFormat = HAL_PIXEL_FORMAT_YCbCr_420_SP_VENUS_UBWC;
|
||||
else
|
||||
grallocFormat = HAL_PIXEL_FORMAT_NV12_ENCODEABLE; //NV12
|
||||
else if((usage & GRALLOC_USAGE_HW_CAMERA_MASK)
|
||||
} else if((usage & GRALLOC_USAGE_HW_CAMERA_MASK)
|
||||
== GRALLOC_USAGE_HW_CAMERA_ZSL)
|
||||
grallocFormat = HAL_PIXEL_FORMAT_NV21_ZSL; //NV21 ZSL
|
||||
else if(usage & GRALLOC_USAGE_HW_CAMERA_READ)
|
||||
|
||||
@@ -203,6 +203,7 @@ class MDPCapabilityInfo : public android::Singleton <MDPCapabilityInfo>
|
||||
{
|
||||
int isMacroTileSupported = 0;
|
||||
int isUBwcSupported = 0;
|
||||
int isWBUBWCSupported = 0;
|
||||
|
||||
public:
|
||||
MDPCapabilityInfo();
|
||||
@@ -220,6 +221,13 @@ class MDPCapabilityInfo : public android::Singleton <MDPCapabilityInfo>
|
||||
* 0 : not supported
|
||||
*/
|
||||
int isUBwcSupportedByMDP() { return isUBwcSupported; }
|
||||
/*
|
||||
* Function to return whether MDP WB block outputs UBWC format
|
||||
*
|
||||
* @return 1 : supported
|
||||
* 0 : not supported
|
||||
*/
|
||||
int isWBUBWCSupportedByMDP() { return isWBUBWCSupported; }
|
||||
};
|
||||
|
||||
#endif /* GR_H_ */
|
||||
|
||||
@@ -61,11 +61,12 @@ int querySDEInfo(HWQueryType type, int *value) {
|
||||
case HAS_MACRO_TILE:
|
||||
featureName = "tile_format";
|
||||
break;
|
||||
|
||||
case HAS_UBWC:
|
||||
featureName = "ubwc";
|
||||
break;
|
||||
|
||||
case HAS_WB_UBWC:
|
||||
featureName = "wb_ubwc";
|
||||
break;
|
||||
default:
|
||||
ALOGE("Invalid query type %d", type);
|
||||
return -EINVAL;
|
||||
|
||||
@@ -49,6 +49,7 @@ namespace qdutils {
|
||||
enum HWQueryType {
|
||||
HAS_MACRO_TILE = 0,
|
||||
HAS_UBWC = 1,
|
||||
HAS_WB_UBWC = 2
|
||||
};
|
||||
|
||||
enum {
|
||||
|
||||
Reference in New Issue
Block a user