Merge "hwc: Handle layers marked as PROTECTED flag as secure"
This commit is contained in:
committed by
Gerrit - the friendly Code Review server
commit
87b476742f
@@ -470,8 +470,10 @@ bool MDPComp::isValidDimension(hwc_context_t *ctx, hwc_layer_1_t *layer) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//XXX: Investigate doing this with pixel phase on MDSS
|
//XXX: Investigate doing this with pixel phase on MDSS
|
||||||
if(!isSecureBuffer(hnd) && isNonIntegralSourceCrop(layer->sourceCropf))
|
if((!isSecureBuffer(hnd) || !isProtectedBuffer(hnd)) &&
|
||||||
|
isNonIntegralSourceCrop(layer->sourceCropf)) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
hwc_rect_t crop = integerizeSourceCrop(layer->sourceCropf);
|
hwc_rect_t crop = integerizeSourceCrop(layer->sourceCropf);
|
||||||
hwc_rect_t dst = layer->displayFrame;
|
hwc_rect_t dst = layer->displayFrame;
|
||||||
@@ -1866,7 +1868,8 @@ void MDPComp::updateYUV(hwc_context_t* ctx, hwc_display_contents_1_t* list,
|
|||||||
} else {
|
} else {
|
||||||
if(frame.isFBComposed[nYuvIndex]) {
|
if(frame.isFBComposed[nYuvIndex]) {
|
||||||
private_handle_t *hnd = (private_handle_t *)layer->handle;
|
private_handle_t *hnd = (private_handle_t *)layer->handle;
|
||||||
if(!secureOnly || isSecureBuffer(hnd)) {
|
if(!secureOnly || isSecureBuffer(hnd) ||
|
||||||
|
isProtectedBuffer(hnd)) {
|
||||||
frame.isFBComposed[nYuvIndex] = false;
|
frame.isFBComposed[nYuvIndex] = false;
|
||||||
frame.fbCount--;
|
frame.fbCount--;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1196,7 +1196,8 @@ void setListStats(hwc_context_t *ctx,
|
|||||||
ctx->listStats[dpy].yuvIndices[i] = -1;
|
ctx->listStats[dpy].yuvIndices[i] = -1;
|
||||||
ctx->listStats[dpy].yuv4k2kIndices[i] = -1;
|
ctx->listStats[dpy].yuv4k2kIndices[i] = -1;
|
||||||
|
|
||||||
if (isSecureBuffer(hnd)) {
|
if (isSecureBuffer(hnd) || isProtectedBuffer(hnd)) {
|
||||||
|
// Protected Buffer must be treated as Secure Layer
|
||||||
ctx->listStats[dpy].isSecurePresent = true;
|
ctx->listStats[dpy].isSecurePresent = true;
|
||||||
if(not isYuvBuffer(hnd)) {
|
if(not isYuvBuffer(hnd)) {
|
||||||
// cache secureRGB layer parameters like we cache for YUV layers
|
// cache secureRGB layer parameters like we cache for YUV layers
|
||||||
|
|||||||
@@ -538,12 +538,12 @@ static inline bool isYUVSplitNeeded(const private_handle_t* hnd) {
|
|||||||
(hnd->width > maxPipeWidth));
|
(hnd->width > maxPipeWidth));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns true if the buffer is secure
|
// Returns true if the buffer is secure(using secure heap)
|
||||||
static inline bool isSecureBuffer(const private_handle_t* hnd) {
|
static inline bool isSecureBuffer(const private_handle_t* hnd) {
|
||||||
return (hnd && (private_handle_t::PRIV_FLAGS_SECURE_BUFFER & hnd->flags));
|
return (hnd && (private_handle_t::PRIV_FLAGS_SECURE_BUFFER & hnd->flags));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns true if the buffer is protected
|
// Returns true if the buffer is protected(L3 using IOMMU heap)
|
||||||
static inline bool isProtectedBuffer(const private_handle_t* hnd) {
|
static inline bool isProtectedBuffer(const private_handle_t* hnd) {
|
||||||
return (hnd && (private_handle_t::PRIV_FLAGS_PROTECTED_BUFFER & hnd->flags));
|
return (hnd && (private_handle_t::PRIV_FLAGS_PROTECTED_BUFFER & hnd->flags));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user