Setup libva correctly in gralloc buffer mode.

BZ: 34659

Gralloc buffer in NV12 format has stride aligned to 512B,
update va parameters accordingly.

Change-Id: Ia88f54af430acb60ebb2bdee6789cbe535619f95
Signed-off-by: Chang Ying <ying.chang@intel.com>
Reviewed-on: http://android.intel.com:8080/66723
Reviewed-by: Yuan, Shengquan <shengquan.yuan@intel.com>
Reviewed-by: Tang, Richard <richard.tang@intel.com>
Reviewed-by: Wang, Elaine <elaine.wang@intel.com>
Reviewed-by: Feng, Wei <wei.feng@intel.com>
Reviewed-by: Jiang, Fei <fei.jiang@intel.com>
Reviewed-by: Shi, PingX <pingx.shi@intel.com>
Tested-by: Shi, PingX <pingx.shi@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
diff --git a/videoencoder/VideoEncoderBase.cpp b/videoencoder/VideoEncoderBase.cpp
index aaa230e..d511ec1 100644
--- a/videoencoder/VideoEncoderBase.cpp
+++ b/videoencoder/VideoEncoderBase.cpp
@@ -1562,7 +1562,8 @@
     LOG_I("gfxhandle = %d\n", map->value);
 
     vaSurfaceAttrib.count = 1;
-    vaSurfaceAttrib.luma_stride = map->vinfo.lumaStride;
+    // OMX_INTEL_COLOR_FormatYUV420PackedSemiPlanar
+    vaSurfaceAttrib.luma_stride = (mComParams.resolution.width + 0x1ff) & (~0x1ff);
     vaSurfaceAttrib.pixel_format = map->vinfo.format;
     vaSurfaceAttrib.width = mComParams.resolution.width;
     vaSurfaceAttrib.height = mComParams.resolution.height;