liboverlay: Rotator-assisted MDP downscaling of videos.
Engage the rotator to assist MDP in performing video downscale for
primary and external. This saves bandwidth and avoids causing the
driver to make too many panel mode switches between BLT (writeback)
and non-BLT (direct) modes.
Change-Id: Icfabc2c0f978a23cf96c78a9976cf69cea697b5f
CRs-Fixed: 434852
diff --git a/libhwcomposer/hwc_fbupdate.cpp b/libhwcomposer/hwc_fbupdate.cpp
index ecbf813..e0331ad 100644
--- a/libhwcomposer/hwc_fbupdate.cpp
+++ b/libhwcomposer/hwc_fbupdate.cpp
@@ -89,7 +89,7 @@
info,
ovutils::ZORDER_0,
ovutils::IS_FG_SET,
- ovutils::ROT_FLAG_DISABLED);
+ ovutils::ROT_FLAGS_NONE);
ov.setSource(parg, dest);
hwc_rect_t sourceCrop = layer->sourceCrop;
@@ -193,7 +193,7 @@
info,
ovutils::ZORDER_0,
ovutils::IS_FG_SET,
- ovutils::ROT_FLAG_DISABLED);
+ ovutils::ROT_FLAGS_NONE);
ov.setSource(pargL, destL);
ovutils::eMdpFlags mdpFlagsR = mdpFlagsL;
@@ -202,7 +202,7 @@
info,
ovutils::ZORDER_0,
ovutils::IS_FG_SET,
- ovutils::ROT_FLAG_DISABLED);
+ ovutils::ROT_FLAGS_NONE);
ov.setSource(pargR, destR);
hwc_rect_t sourceCrop = layer->sourceCrop;
diff --git a/libhwcomposer/hwc_mdpcomp.cpp b/libhwcomposer/hwc_mdpcomp.cpp
index 2e58b93..bbea007 100644
--- a/libhwcomposer/hwc_mdpcomp.cpp
+++ b/libhwcomposer/hwc_mdpcomp.cpp
@@ -20,6 +20,7 @@
#include <sys/ioctl.h>
#include "external.h"
#include "qdMetaData.h"
+#include "mdp_version.h"
namespace qhwc {
@@ -325,11 +326,17 @@
orient = static_cast<ovutils::eTransform>(layer->transform);
}
+ ovutils::eRotFlags rotFlags = ovutils::ROT_FLAGS_NONE;
+ if(isYuvBuffer(hnd) && (ctx->mMDP.version >= qdutils::MDP_V4_2 &&
+ ctx->mMDP.version < qdutils::MDSS_V5)) {
+ rotFlags = ovutils::ROT_DOWNSCALE_ENABLED;
+ }
+
ovutils::PipeArgs parg(mdpFlags,
info,
zOrder,
ovutils::IS_FG_OFF,
- ovutils::ROT_FLAG_DISABLED);
+ rotFlags);
ov.setSource(parg, dest);
diff --git a/libhwcomposer/hwc_video.cpp b/libhwcomposer/hwc_video.cpp
index 13f3cdd..41d4365 100644
--- a/libhwcomposer/hwc_video.cpp
+++ b/libhwcomposer/hwc_video.cpp
@@ -20,6 +20,7 @@
#include "hwc_video.h"
#include "hwc_utils.h"
#include "qdMetaData.h"
+#include "mdp_version.h"
namespace qhwc {
@@ -119,11 +120,17 @@
isFgFlag = ovutils::IS_FG_SET;
}
+ ovutils::eRotFlags rotFlags = ovutils::ROT_FLAGS_NONE;
+ if(ctx->mMDP.version >= qdutils::MDP_V4_2 &&
+ ctx->mMDP.version < qdutils::MDSS_V5) {
+ rotFlags = ovutils::ROT_DOWNSCALE_ENABLED;
+ }
+
ovutils::PipeArgs parg(mdpFlags,
info,
ovutils::ZORDER_1,
isFgFlag,
- ovutils::ROT_FLAG_DISABLED);
+ rotFlags);
ov.setSource(parg, dest);