overlay: Fix compressed output buffer size for MDSS Rotator.
Compressed output buffer size calculation for MDSS Rotator needs to
be performed according to destination rectangle (rotated src rect)
due to alignment requirements (like non-BWC calculation).
Change-Id: I6a232d77ca5fce42a1cc3e7f406c9cc4d46553ed
diff --git a/liboverlay/overlayMdssRot.cpp b/liboverlay/overlayMdssRot.cpp
index b8a2417..95f22c6 100644
--- a/liboverlay/overlayMdssRot.cpp
+++ b/liboverlay/overlayMdssRot.cpp
@@ -256,7 +256,7 @@
mRotInfo.src.format); //mdss src and dst formats are same.
if (mRotInfo.flags & ovutils::OV_MDSS_MDP_BWC_EN) {
- opBufSize = calcCompressedBufSize();
+ opBufSize = calcCompressedBufSize(destWhf);
} else {
opBufSize = Rotator::calcOutputBufSize(destWhf);
}
@@ -273,10 +273,10 @@
}
// Calculate the compressed o/p buffer size for BWC
-uint32_t MdssRot::calcCompressedBufSize() {
+uint32_t MdssRot::calcCompressedBufSize(const ovutils::Whf& destWhf) {
uint32_t bufSize = 0;
- int aWidth = ovutils::align(mRotInfo.src_rect.w, 64);
- int aHeight = ovutils::align(mRotInfo.src_rect.h, 4);
+ int aWidth = ovutils::align(destWhf.w, 64);
+ int aHeight = ovutils::align(destWhf.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) * 2;