release-request-b6f2d5b3-a3d6-410f-b58f-c85ba8187177-for-git_oc-mr1-release-4173087 snap-temp-L93200000081515229

Change-Id: I94efc9f5112703d56dd190a7f2e240e20b91c217
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 73bfcda..0d7ea60 100755
--- a/src/psb_drv_video.h
+++ b/src/psb_drv_video.h
@@ -439,7 +439,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;