hwc/overlay: Get rot dest dimensions instead of manipulating source
Currently for Mdss rotator we manipulate the layer buffer dimensions
to be equal to what rotator's destination dimensions would be, so that
these could be fed to MDP. Instead, this patch introduces APIs in
rotator so that hwc can directly query destination crop, width, height,
format from rotator.
This also simplifies the updateSource() and configRotator() helpers.
Change-Id: I501d998f2e0574683c764af9422742b2426ba0c7
diff --git a/liboverlay/overlayMdpRot.cpp b/liboverlay/overlayMdpRot.cpp
index f456029..bb985d7 100755
--- a/liboverlay/overlayMdpRot.cpp
+++ b/liboverlay/overlayMdpRot.cpp
@@ -19,6 +19,7 @@
#include "overlayUtils.h"
#include "overlayRotator.h"
+#include "gr.h"
namespace ovutils = overlay::utils;
@@ -47,6 +48,24 @@
return mRotImgInfo.dst.format;
}
+//Added for completeness. Not expected to be called.
+utils::Whf MdpRot::getDstWhf() const {
+ int alW = 0, alH = 0;
+ int halFormat = ovutils::getHALFormat(mRotImgInfo.dst.format);
+ getBufferSizeAndDimensions(mRotImgInfo.dst.width, mRotImgInfo.dst.height,
+ halFormat, alW, alH);
+ return utils::Whf(alW, alH, mRotImgInfo.dst.format);
+}
+
+//Added for completeness. Not expected to be called.
+utils::Dim MdpRot::getDstDimensions() const {
+ int alW = 0, alH = 0;
+ int halFormat = ovutils::getHALFormat(mRotImgInfo.dst.format);
+ getBufferSizeAndDimensions(mRotImgInfo.dst.width, mRotImgInfo.dst.height,
+ halFormat, alW, alH);
+ return utils::Dim(0, 0, alW, alH);
+}
+
uint32_t MdpRot::getSessId() const { return mRotImgInfo.session_id; }
void MdpRot::setDownscale(int ds) {