Merge "liboverlay: Add support for MDSS Bandwidth Compression"

This commit is contained in:
Linux Build Service Account
2013-05-01 12:03:01 -07:00
committed by Gerrit - the friendly Code Review server
6 changed files with 40 additions and 1 deletions

View File

@@ -631,6 +631,12 @@ void setMdpFlags(hwc_layer_1_t *layer,
if(transform & HWC_TRANSFORM_ROT_90) {
ovutils::setMdpFlags(mdpFlags,
ovutils::OV_MDP_SOURCE_ROTATED_90);
// enable bandwidth compression only if src width < 2048
if(qdutils::MDPVersion::getInstance().supportsBWC() &&
hnd->width < qdutils::MAX_DISPLAY_DIM) {
ovutils::setMdpFlags(mdpFlags,
ovutils::OV_MDSS_MDP_BWC_EN);
}
}
}

View File

@@ -20,6 +20,8 @@
#include "overlayUtils.h"
#include "overlayRotator.h"
#define DEBUG_MDSS_ROT 0
#ifdef VENUS_COLOR_FORMAT
#include <media/msm_media_info.h>
#else
@@ -252,7 +254,11 @@ uint32_t MdssRot::calcOutputBufSize() {
ovutils::Whf destWhf(mRotInfo.dst_rect.w, mRotInfo.dst_rect.h,
mRotInfo.src.format); //mdss src and dst formats are same.
if (mRotInfo.flags & ovutils::OV_MDSS_MDP_BWC_EN) {
opBufSize = calcCompressedBufSize();
} else {
opBufSize = Rotator::calcOutputBufSize(destWhf);
}
if (mRotInfo.flags & utils::OV_MDP_SECURE_OVERLAY_SESSION)
opBufSize = utils::align(opBufSize, SIZE_1M);
@@ -265,4 +271,23 @@ void MdssRot::getDump(char *buf, size_t len) const {
ovutils::getDump(buf, len, "MdssRotData", mRotData);
}
// Calculate the compressed o/p buffer size for BWC
uint32_t MdssRot::calcCompressedBufSize() {
uint32_t bufSize = 0;
int aWidth = ovutils::align(mRotInfo.src_rect.w, 64);
int aHeight = ovutils::align(mRotInfo.src_rect.h, 4);
int rau_cnt = aWidth/64;
int stride0 = (64 * 4 * rau_cnt) + rau_cnt/8;
int stride1 = (64 * 2 * rau_cnt) + rau_cnt/8;
int stride0_off = (aHeight/4);
int stride1_off = (aHeight/2);
//New o/p size for BWC
bufSize = (stride0 * stride0_off + stride1 * stride1_off) +
(rau_cnt * 2 * (stride0_off + stride1_off));
ALOGD_IF(DEBUG_MDSS_ROT, "%s: width = %d, height = %d raucount = %d"
"opBufSize = %d ", __FUNCTION__, aWidth, aHeight, rau_cnt, bufSize);
return bufSize;
}
} // namespace overlay

View File

@@ -198,6 +198,8 @@ private:
/* Calculates the rotator's o/p buffer size post the transform calcs and
* knowing the o/p format depending on whether fastYuv is enabled or not */
uint32_t calcOutputBufSize();
// Calculate the compressed o/p buffer size for BWC
uint32_t calcCompressedBufSize();
/* MdssRot info structure */
mdp_overlay mRotInfo;

View File

@@ -262,6 +262,7 @@ enum eMdpFlags {
OV_MDP_FLIP_V = MDP_FLIP_UD,
OV_MDSS_MDP_RIGHT_MIXER = MDSS_MDP_RIGHT_MIXER,
OV_MDP_PP_EN = MDP_OVERLAY_PP_CFG_EN,
OV_MDSS_MDP_BWC_EN = MDP_BWC_EN,
};
enum eZorder {

View File

@@ -117,5 +117,9 @@ uint32_t MDPVersion::getMaxMDPDownscale() {
return mMDPDownscale;
}
bool MDPVersion::supportsBWC() {
// BWC - Bandwidth Compression
return (mFeatures & MDP_BWC_EN);
}
}; //namespace qdutils

View File

@@ -82,6 +82,7 @@ public:
uint8_t getDMAPipes() { return mDMAPipes; }
bool supportsDecimation();
uint32_t getMaxMDPDownscale();
bool supportsBWC();
private:
int mMDPVersion;
char mPanelType;