hqd: Restrict decimation when layer format is macro-tile
When layer format is macro-tile, decimation cannot be supported.
Add necessary checks to bail out for such use-case.
Change-Id: I711f07a2963a76280a08887d04770cd418d8bd1e
diff --git a/libhwcomposer/hwc_mdpcomp.cpp b/libhwcomposer/hwc_mdpcomp.cpp
index 028af47..d864290 100644
--- a/libhwcomposer/hwc_mdpcomp.cpp
+++ b/libhwcomposer/hwc_mdpcomp.cpp
@@ -45,10 +45,12 @@
bool MDPComp::sEnablePartialFrameUpdate = false;
int MDPComp::sMaxPipesPerMixer = MAX_PIPES_PER_MIXER;
bool MDPComp::sEnable4k2kYUVSplit = false;
-
+bool MDPComp::sSrcSplitEnabled = false;
MDPComp* MDPComp::getObject(hwc_context_t *ctx, const int& dpy) {
+
if(isDisplaySplit(ctx, dpy)) {
if(qdutils::MDPVersion::getInstance().isSrcSplit()) {
+ sSrcSplitEnabled = true;
return new MDPCompSrcSplit(dpy);
}
return new MDPCompSplit(dpy);
@@ -341,25 +343,38 @@
return false;
if((w_scale > 1.0f) || (h_scale > 1.0f)) {
- const uint32_t downscale =
+ const uint32_t maxMDPDownscale =
qdutils::MDPVersion::getInstance().getMaxMDPDownscale();
const float w_dscale = w_scale;
const float h_dscale = h_scale;
if(ctx->mMDP.version >= qdutils::MDSS_V5) {
- /* Workaround for downscales larger than 4x.
- * Will be removed once decimator block is enabled for MDSS
- */
+
if(!qdutils::MDPVersion::getInstance().supportsDecimation()) {
- if(crop_w > MAX_DISPLAY_DIM || w_dscale > downscale ||
- h_dscale > downscale)
+ /* On targets that doesnt support Decimation (eg.,8x26)
+ * maximum downscale support is overlay pipe downscale.
+ */
+ if(crop_w > MAX_DISPLAY_DIM || w_dscale > maxMDPDownscale ||
+ h_dscale > maxMDPDownscale)
return false;
} else {
- if(w_dscale > 64 || h_dscale > 64)
+ // Decimation on macrotile format layers is not supported.
+ if(isTileRendered(hnd)) {
+ /* MDP can read maximum MAX_DISPLAY_DIM width.
+ * Bail out if
+ * 1. Src crop > MAX_DISPLAY_DIM on nonsplit MDPComp
+ * 2. exceeds maximum downscale limit
+ */
+ if(((crop_w > MAX_DISPLAY_DIM) && !sSrcSplitEnabled) ||
+ w_dscale > maxMDPDownscale ||
+ h_dscale > maxMDPDownscale) {
+ return false;
+ }
+ } else if(w_dscale > 64 || h_dscale > 64)
return false;
}
} else { //A-family
- if(w_dscale > downscale || h_dscale > downscale)
+ if(w_dscale > maxMDPDownscale || h_dscale > maxMDPDownscale)
return false;
}
}
diff --git a/libhwcomposer/hwc_mdpcomp.h b/libhwcomposer/hwc_mdpcomp.h
index 94199e3..22b8baf 100644
--- a/libhwcomposer/hwc_mdpcomp.h
+++ b/libhwcomposer/hwc_mdpcomp.h
@@ -226,6 +226,7 @@
/* Handles the timeout event from kernel, if the value is set to true */
static bool sHandleTimeout;
static int sMaxPipesPerMixer;
+ static bool sSrcSplitEnabled;
static IdleInvalidator *idleInvalidator;
struct FrameInfo mCurrentFrame;
struct LayerCache mCachedFrame;