hwcomposer: In Mdss,secure content policy applies to layer buffer
In Mdss, mSecureMode is never set, instead the secure content flag
has been set/unset on each layer buffer.
Change-Id: I3283533c11206e189ce70dbc84776b2cff3a909d
diff --git a/libhwcomposer/hwc_video.cpp b/libhwcomposer/hwc_video.cpp
index 16d0c89..13f3cdd 100644
--- a/libhwcomposer/hwc_video.cpp
+++ b/libhwcomposer/hwc_video.cpp
@@ -52,19 +52,20 @@
//index guaranteed to be not -1 at this point
hwc_layer_1_t *layer = &list->hwLayers[yuvIndex];
-
- private_handle_t *hnd = (private_handle_t *)layer->handle;
- if(ctx->mSecureMode) {
- if (! isSecureBuffer(hnd)) {
- ALOGD_IF(VIDEO_DEBUG, "%s: Handle non-secure video layer"
- "during secure playback gracefully", __FUNCTION__);
- return false;
- }
- } else {
- if (isSecureBuffer(hnd)) {
- ALOGD_IF(VIDEO_DEBUG, "%s: Handle secure video layer"
- "during non-secure playback gracefully", __FUNCTION__);
- return false;
+ if (isSecureModePolicy(ctx->mMDP.version)) {
+ private_handle_t *hnd = (private_handle_t *)layer->handle;
+ if(ctx->mSecureMode) {
+ if (! isSecureBuffer(hnd)) {
+ ALOGD_IF(VIDEO_DEBUG, "%s: Handle non-secure video layer"
+ "during secure playback gracefully", __FUNCTION__);
+ return false;
+ }
+ } else {
+ if (isSecureBuffer(hnd)) {
+ ALOGD_IF(VIDEO_DEBUG, "%s: Handle secure video layer"
+ "during non-secure playback gracefully", __FUNCTION__);
+ return false;
+ }
}
}
if(configure(ctx, dpy, layer)) {