Fixed the video playback messy issues by hardware decoding by libva.

Bug: 29160724
Bug: IMINAN-49451

Originall the width calculation of NV12_VED/NV12_VEDT formats was hacked
in gralloc HAL, so moved this hacking into HWC HAL.

Change-Id: I94afcc1e16f42540ed5826423d4bb52c494b6b45
Signed-off-by: Austin Hu <[email protected]>
diff --git a/moorefield_hdmi/ips/tangier/TngGrallocBuffer.cpp b/moorefield_hdmi/ips/tangier/TngGrallocBuffer.cpp
index 47d36d4..5984ea5 100644
--- a/moorefield_hdmi/ips/tangier/TngGrallocBuffer.cpp
+++ b/moorefield_hdmi/ips/tangier/TngGrallocBuffer.cpp
@@ -15,6 +15,7 @@
 */
 #include <common/utils/HwcTrace.h>
 #include <ips/tangier/TngGrallocBuffer.h>
+#include <khronos/openmax/OMX_IntelVideoExt.h>
 
 namespace android {
 namespace intel {
@@ -47,7 +48,11 @@
     }
 
     mFormat = grallocHandle->iFormat;
-    mWidth = grallocHandle->iWidth;
+    if (mFormat == OMX_INTEL_COLOR_FormatYUV420PackedSemiPlanar ||
+        mFormat == OMX_INTEL_COLOR_FormatYUV420PackedSemiPlanar_Tiled) {
+        mWidth = grallocHandle->aiStride[0];
+    } else
+        mWidth = grallocHandle->iWidth;
     mHeight = grallocHandle->iHeight;
     mUsage = grallocHandle->usage;
     mKey = grallocHandle->ui64Stamp;