From: Sanghee Kim Date: Thu, 9 Aug 2012 06:31:10 +0000 (-0700) Subject: hwc: support drm video play back. X-Git-Tag: cm-10.1-M1~221 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7bd58627f6422d26e4a1d053a84aba8835bff359;p=GitHub%2FLineageOS%2Fandroid_hardware_samsung_slsi_exynos5.git hwc: support drm video play back. In case of drm video play back, GSC's destination buffer should be allocateed from reserved memory using protected flag in gralloc. If src buffer is protected buffer, dst buffer should be same. Change-Id: I5eb2a698f2ca404a585c436d6536462580ca4ba6 Signed-off-by: Sanghee Kim --- diff --git a/libhwc/hwc.cpp b/libhwc/hwc.cpp index 4e7877a..3378a45 100644 --- a/libhwc/hwc.cpp +++ b/libhwc/hwc.cpp @@ -743,6 +743,7 @@ static int exynos5_config_gsc_m2m(hwc_layer_1_t &layer, src_cfg.vaddr = src_handle->fd2; } src_cfg.format = src_handle->format; + src_cfg.drmMode = !!(src_handle->flags & GRALLOC_USAGE_PROTECTED); dst_cfg.x = 0; dst_cfg.y = 0; @@ -760,7 +761,9 @@ static int exynos5_config_gsc_m2m(hwc_layer_1_t &layer, int usage = GRALLOC_USAGE_SW_READ_NEVER | GRALLOC_USAGE_SW_WRITE_NEVER | GRALLOC_USAGE_HW_COMPOSER; - // TODO: add GRALLOC_USAGE_PROTECTED if source buffer is also protected + + if (src_handle->flags & GRALLOC_USAGE_PROTECTED) + usage |= GRALLOC_USAGE_PROTECTED; int w = ALIGN(WIDTH(layer.displayFrame), GSC_W_ALIGNMENT); int h = ALIGN(HEIGHT(layer.displayFrame), GSC_H_ALIGNMENT); @@ -790,6 +793,7 @@ static int exynos5_config_gsc_m2m(hwc_layer_1_t &layer, dst_cfg.fw = dst_handle->stride; dst_cfg.fh = dst_handle->vstride; dst_cfg.yaddr = dst_handle->fd; + dst_cfg.drmMode = !!(dst_handle->flags & GRALLOC_USAGE_PROTECTED); ALOGV("destination configuration:"); dump_gsc_img(dst_cfg);