libgscaler: support gsc's content protection ctrl.
authorSanghee Kim <haya93@samsung.com>
Thu, 9 Aug 2012 06:37:30 +0000 (23:37 -0700)
committerDima Zavin <dima@android.com>
Tue, 28 Aug 2012 07:25:26 +0000 (00:25 -0700)
In case of drm video play back, contents should be protected.
Added gsc's content protection control.

Change-Id: If724de5aaf5cadab8eada160211b1ab3ce1b758a
Signed-off-by: Sanghee Kim <haya93@samsung.com>
libgscaler/exynos_gscaler.c

index a65035851842291e27b086026b8ef71111084093..84171a2b7b1a1c5a16defa7e4e63ff6f5b447000 100644 (file)
@@ -659,6 +659,11 @@ static bool m_exynos_gsc_set_format(
         return false;
     }
 
+    if (exynos_v4l2_s_ctrl(fd, V4L2_CID_CONTENT_PROTECTION, info->mode_drm) < 0) {
+        ALOGE("%s::exynos_v4l2_s_ctrl() fail", __func__);
+        return false;
+    }
+
     req_buf.count  = 1;
     req_buf.type   = info->buf_type;
     req_buf.memory = V4L2_MEMORY_DMABUF;
@@ -1109,21 +1114,6 @@ int exynos_gsc_set_dst_format(
     return 0;
 }
 
-static int exynos_gsc_ctrl_sysmmu(
-    int fd,
-    int flag)
-{
-    int sys_mmu_flag = flag ^ 1;
-
-#if 0 //it will be enabled later
-    if (exynos_v4l2_s_ctrl(fd, V4L2_CID_USE_SYSMMU, sys_mmu_flag) < 0) {
-        ALOGE("%s::exynos_v4l2_s_ctrl(V4L2_CID_USE_SYSMMU) fail", __func__);
-        return -1;
-    }
-#endif
-    return 0;
-}
-
 int exynos_gsc_set_rotation(
     void *handle,
     int   rotation,
@@ -1355,7 +1345,7 @@ int exynos_gsc_m2m_config(void *handle,
 
     ret = exynos_gsc_set_dst_format(gsc_handle, dst_img->fw, dst_img->fh,
                                   dst_img->x, dst_img->y, dst_img->w, dst_img->h,
-                                  dst_color_space, dst_img->cacheable, src_img->drmMode);
+                                  dst_color_space, dst_img->cacheable, dst_img->drmMode);
     if (ret < 0) {
         ALOGE("%s: fail: exynos_gsc_set_dst_format [fw %d fh %d x %d y %d w %d h %d f %x rot %d]",
             __func__, dst_img->fw, dst_img->fh, dst_img->x, dst_img->y, dst_img->w, dst_img->h,
@@ -1510,6 +1500,12 @@ int exynos_gsc_out_config(void *handle,
         return -1;
     }
 
+    if (exynos_v4l2_s_ctrl(gsc_handle->gsc_vd_entity->fd,
+        V4L2_CID_CONTENT_PROTECTION, gsc_handle->src_img.drmMode) < 0) {
+        ALOGE("%s::exynos_v4l2_s_ctrl(V4L2_CID_CONTENT_PROTECTION) fail", __func__);
+        return -1;
+    }
+
       /* set src format  :GSC video dev*/
     fmt.type  = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
     fmt.fmt.pix_mp.width            = gsc_handle->src_img.fw;