From 92b683627a2c163c8839fdf116b75860fe3a2782 Mon Sep 17 00:00:00 2001 From: Ricardo Cerqueira Date: Fri, 27 Jul 2012 00:24:22 +0100 Subject: [PATCH] overlay: Allow disabling secure playback If the device's kernel isn't fully prepared for secure content playback, having the secure field in the msm_rotator_img_info struct will cause issues while playing out video. The correct set of patches to the kernel (MDP, maybe vidc) needs to be figured out for this to be enabled; to disable it, add QCOM_NO_SECURE_PLAYBACK to the device's CFLAGS. (and remove "secure" from msm_rotator_img_info) Change-Id: I7949e918163e0acb2d6eb3d8881b04fb07b2be2c --- liboverlay/overlayRotator.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/liboverlay/overlayRotator.cpp b/liboverlay/overlayRotator.cpp index 306e28f..7e17df7 100644 --- a/liboverlay/overlayRotator.cpp +++ b/liboverlay/overlayRotator.cpp @@ -73,9 +73,11 @@ void MdpRot::setSource(const overlay::utils::Whf& awhf) { } void MdpRot::setFlags(const utils::eMdpFlags& flags) { +#ifndef QCOM_NO_SECURE_PLAYBACK mRotImgInfo.secure = 0; if(flags & utils::OV_MDP_SECURE_OVERLAY_SESSION) mRotImgInfo.secure = 1; +#endif } void MdpRot::setTransform(const utils::eTransform& rot, const bool& rotUsed) @@ -117,10 +119,15 @@ bool MdpRot::commit() { bool MdpRot::open_i(uint32_t numbufs, uint32_t bufsz) { OvMem mem; + int secureFlag = 0; OVASSERT(MAP_FAILED == mem.addr(), "MAP failed in open_i"); - if(!mem.open(numbufs, bufsz, mRotImgInfo.secure)){ +#ifndef QCOM_NO_SECURE_PLAYBACK + secureFlag = mRotImgInfo.secure; +#endif + + if(!mem.open(numbufs, bufsz, secureFlag)){ ALOGE("%s: Failed to open", __func__); mem.close(); return false;