merge in lmp-mr1-release history after reset to lmp-mr1-dev
diff --git a/ips/anniedale/AnnOverlayPlane.cpp b/ips/anniedale/AnnOverlayPlane.cpp
index 200f9f9..bfef06f 100755
--- a/ips/anniedale/AnnOverlayPlane.cpp
+++ b/ips/anniedale/AnnOverlayPlane.cpp
@@ -597,6 +597,20 @@
     }
 }
 
+// HSD 4645510:
+// This is a SOC limition, that when source buffer width range is
+// in (960, 1024] - one cache line length, and rotation bit is set
+// in portrait mode, video will show distortion.
+bool AnnOverlayPlane::isSettingRotBitAllowed()
+{
+    uint32_t width = mSrcCrop.w;
+
+    if ((width > 960 && width <= 1024) &&
+            (mTransform == 0 || mTransform == HAL_TRANSFORM_ROT_180))
+        return false;
+    return true;
+}
+
 bool AnnOverlayPlane::flip(void *ctx)
 {
     uint32_t ovadd = 0;
@@ -613,7 +627,8 @@
 
     // enable rotation mode and setup rotation config
     if (mIndex == 0 && mRotationConfig != 0) {
-        ovadd |= (1 << 12);
+        if (isSettingRotBitAllowed())
+            ovadd |= (1 << 12);
         ovadd |= mRotationConfig;
     }
 
@@ -786,6 +801,12 @@
     if (mTransform == 0)
         return true;
 
+    if (!isSettingRotBitAllowed()) {
+        mUseOverlayRotation = false;
+        mRotationConfig = 0;
+        return false;
+    }
+
     // workaround limitation of overlay rotation by falling back to use VA rotated buffer
     bool fallback = false;
     float scaleX = (float)mSrcCrop.w / mPosition.w;
diff --git a/ips/anniedale/AnnOverlayPlane.h b/ips/anniedale/AnnOverlayPlane.h
index a4d2bc6..ed8a197 100755
--- a/ips/anniedale/AnnOverlayPlane.h
+++ b/ips/anniedale/AnnOverlayPlane.h
@@ -51,6 +51,7 @@
 
 private:
     void signalVideoRotation(BufferMapper& mapper);
+    bool isSettingRotBitAllowed();
 protected:
     virtual bool setDataBuffer(BufferMapper& mapper);
     virtual bool flush(uint32_t flags);
diff --git a/ips/common/WsbmWrapper.c b/ips/common/WsbmWrapper.c
index b91619d..08ddefc 100644
--- a/ips/common/WsbmWrapper.c
+++ b/ips/common/WsbmWrapper.c
@@ -177,7 +177,7 @@
 
     ret = wsbmBODataUB(wsbmBuf,
                        align_to(size, 4096), NULL, NULL, 0,
-                       user_pt, -1);
+                       user_pt);
 
     if(ret) {
         ELOGTRACE("wsbmBOData failed with error code %d", ret);
@@ -296,7 +296,7 @@
     }
 
     wsbmBuf = (struct _WsbmBufferObject *)buf;
-    ret = wsbmBODataUB(wsbmBuf, size, NULL, NULL, 0, vaddr, -1);
+    ret = wsbmBODataUB(wsbmBuf, size, NULL, NULL, 0, vaddr);
     if (ret) {
         ELOGTRACE("wsbmBODataUB failed with error code %d", ret);
         return ret;