hwc: Add target specific checks in hwcomposer

* Mdss driver supports DMA-Multiplexing on wb interface
for certain targets. Add overlay get function to query
this info during pipe allocation for wb.

* UI Scaling on external is not supported on certain
targets due to the lack of availability of pipes with
scalars. Add overlay get function to query this info
to disable action-safe calcs, DRC and others which
require downscaling.

Change-Id: I1726caa4634f72d781561e797078648524ea2eef
This commit is contained in:
Raj Kamal
2014-04-14 16:14:06 +05:30
parent d1bf7b790b
commit 068f4575f6
7 changed files with 25 additions and 10 deletions

View File

@@ -34,7 +34,6 @@
#include "external.h"
#include "overlayUtils.h"
#include "overlay.h"
#include "mdp_version.h"
#include "qd_utils.h"
using namespace android;
@@ -586,7 +585,7 @@ void ExternalDisplay::setAttributes() {
mHwcContext->dpyAttr[HWC_DISPLAY_EXTERNAL].xres = width;
mHwcContext->dpyAttr[HWC_DISPLAY_EXTERNAL].yres = height;
mHwcContext->dpyAttr[HWC_DISPLAY_EXTERNAL].mDownScaleMode = false;
if(!qdutils::MDPVersion::getInstance().is8x26()
if(mHwcContext->mOverlay->isUIScalingOnExternalSupported()
&& mHwcContext->mMDPDownscaleEnabled) {
int priW = mHwcContext->dpyAttr[HWC_DISPLAY_PRIMARY].xres;
int priH = mHwcContext->dpyAttr[HWC_DISPLAY_PRIMARY].yres;

View File

@@ -146,7 +146,7 @@ static void setDMAState(hwc_context_t *ctx, int numDisplays,
if (UNLIKELY(isYuvBuffer(hnd)) && canUseRotator(ctx,i) &&
(layer->transform & HWC_TRANSFORM_ROT_90)) {
if(not qdutils::MDPVersion::getInstance().is8x26()) {
if(not ctx->mOverlay->isDMAMultiplexingSupported()) {
if(ctx->mOverlay->isPipeTypeAttached(
overlay::utils::OV_MDP_PIPE_DMA))
ctx->isPaddingRound = true;

View File

@@ -192,7 +192,7 @@ bool FBUpdateNonSplit::configure(hwc_context_t *ctx, hwc_display_contents_1 *lis
(mDpy && !extOrient
&& !ctx->dpyAttr[mDpy].mDownScaleMode))
&& (extOnlyLayerIndex == -1)) {
if(!qdutils::MDPVersion::getInstance().is8x26() &&
if(ctx->mOverlay->isUIScalingOnExternalSupported() &&
!ctx->dpyAttr[mDpy].customFBSize) {
getNonWormholeRegion(list, sourceCrop);
displayFrame = sourceCrop;

View File

@@ -403,7 +403,8 @@ bool MDPComp::isFrameDoable(hwc_context_t *ctx) {
if(!isEnabled()) {
ALOGD_IF(isDebug(),"%s: MDP Comp. not enabled.", __FUNCTION__);
ret = false;
} else if(qdutils::MDPVersion::getInstance().is8x26() &&
} else if((qdutils::MDPVersion::getInstance().is8x26() ||
qdutils::MDPVersion::getInstance().is8x16()) &&
ctx->mVideoTransFlag &&
isSecondaryConnected(ctx)) {
//1 Padding round to shift pipes across mixers

View File

@@ -569,7 +569,7 @@ void calcExtDisplayPosition(hwc_context_t *ctx,
ovutils::eTransform& orient) {
// Swap width and height when there is a 90deg transform
int extOrient = getExtOrientation(ctx);
if(dpy && !qdutils::MDPVersion::getInstance().is8x26()) {
if(dpy && ctx->mOverlay->isUIScalingOnExternalSupported()) {
if(!isYuvBuffer(hnd)) {
if(extOrient & HWC_TRANSFORM_ROT_90) {
int dstWidth = ctx->dpyAttr[dpy].xres;
@@ -1943,10 +1943,10 @@ int configureSourceSplit(hwc_context_t *ctx, hwc_layer_1_t *layer,
}
bool canUseRotator(hwc_context_t *ctx, int dpy) {
if(qdutils::MDPVersion::getInstance().is8x26() &&
if(ctx->mOverlay->isDMAMultiplexingSupported() &&
isSecondaryConnected(ctx) &&
!ctx->dpyAttr[HWC_DISPLAY_VIRTUAL].isPause) {
/* 8x26 mdss driver supports multiplexing of DMA pipe
/* mdss driver on certain targets support multiplexing of DMA pipe
* in LINE and BLOCK modes for writeback panels.
*/
if(dpy == HWC_DISPLAY_PRIMARY)

View File

@@ -130,6 +130,10 @@ public:
/* Returns pipe dump. Expects a NULL terminated buffer of big enough size
* to populate.
*/
/* Returns if DMA pipe multiplexing is supported by the mdss driver */
static bool isDMAMultiplexingSupported();
/* Returns if UI scaling on external is supported on the targets */
static bool isUIScalingOnExternalSupported();
void getDump(char *buf, size_t len);
/* Reset usage and allocation bits on all pipes for given display */
void clear(int dpy);
@@ -306,6 +310,18 @@ inline void Overlay::setDMAMultiplexingSupported() {
sDMAMultiplexingSupported = true;
}
inline bool Overlay::isDMAMultiplexingSupported() {
return sDMAMultiplexingSupported;
}
inline bool Overlay::isUIScalingOnExternalSupported() {
if(qdutils::MDPVersion::getInstance().is8x26() or
qdutils::MDPVersion::getInstance().is8x16()) {
return false;
}
return true;
}
inline int Overlay::getDMAMode() {
return sDMAMode;
}

View File

@@ -47,7 +47,6 @@
#include "virtual.h"
#include "overlayUtils.h"
#include "overlay.h"
#include "mdp_version.h"
#include "qd_utils.h"
using namespace android;
@@ -184,7 +183,7 @@ void VirtualDisplay::setAttributes() {
initResolution(extW, extH);
if(!qdutils::MDPVersion::getInstance().is8x26()
if(mHwcContext->mOverlay->isUIScalingOnExternalSupported()
&& (mHwcContext->mMDPDownscaleEnabled || isDRC)) {
// maxArea represents the maximum resolution between