Worked around the random CTS testOtherH264ImageReader & DecodeAccuracyTest failure.

Bug: 37283516, 62788295, 38138788, 32717946
BZ: IMINAN-51520, IMINAN-51500, IMINAN-51528

To make the workaround in video kernel mode driver take effect.

Test: Netflix, play movies, youtube

Change-Id: Ia8a73e673b88066c70d51ee686659c3e5adf1611
Signed-off-by: Austin Hu <austin.hu@intel.com>
(cherry picked from commit 531fbe107e8e1186cc54670cc85d941e09ebf81b)
(cherry picked from commit dfc4b4b2cafeb307a4531f88ea4eb13fddf84e3c)
diff --git a/src/psb_drv_video.c b/src/psb_drv_video.c
index 9f5b465..7d46aff 100755
--- a/src/psb_drv_video.c
+++ b/src/psb_drv_video.c
@@ -1496,9 +1496,15 @@
 
     if (obj_config->profile == VAProfileVC1Simple ||
         obj_config->profile == VAProfileVC1Main ||
-        obj_config->profile == VAProfileVC1Advanced) {
+        obj_config->profile == VAProfileVC1Advanced ||
+        obj_config->profile == VAProfileH264Baseline ||
+        obj_config->profile == VAProfileH264Main ||
+        obj_config->profile == VAProfileH264High ||
+        obj_config->profile == VAProfileVP8Version0_3) {
         uint64_t width_in_mb = ((driver_data->render_rect.x + driver_data->render_rect.width + 15) / 16);
+        uint64_t height_in_mb = ((driver_data->render_rect.y + driver_data->render_rect.height + 15) / 16);
         obj_context->ctp_type |= (width_in_mb << 32);
+        obj_context->ctp_type |= (height_in_mb << 48);
     }
 
     /* add ctx_num to save vp8 enc context num to support dual vp8 encoding */
@@ -2200,6 +2206,12 @@
         }
     }
 
+    if ((driver_data->protected & VA_RT_FORMAT_PROTECTED) &&
+		    !(obj_context->ctp_type & VA_RT_FORMAT_PROTECTED)) {
+	    obj_context->ctp_type |= VA_RT_FORMAT_PROTECTED;
+	    psb_update_context(driver_data, obj_context->ctp_type);
+    }
+
     /* if the surface is decode render target, and in displaying */
     if (obj_config &&
         (obj_config->entrypoint != VAEntrypointEncSlice) &&
diff --git a/src/psb_drv_video.h b/src/psb_drv_video.h
index 6df3424..7f404db 100755
--- a/src/psb_drv_video.h
+++ b/src/psb_drv_video.h
@@ -440,7 +440,8 @@
      * bytes[1]: profile
      * bytes[2]: tile stride | rotated tile stride
      * bytes[3]: driver_data->protected
-     * bytes[4]: width_in_mb; pass width kernel for VC1 workaround
+     * bytes[4]: width_in_mb; pass width kernel for VC1/H.264 workaround
+     * bytes[5]: height_in_mb; pass width kernel for VC1/H.264 workaround
      */
     uint64_t ctp_type;