Merge "libhwcomposer: libgralloc Set MDP_SMP_FORCE_ALLOC flag"
This commit is contained in:
committed by
Gerrit - the friendly Code Review server
commit
e98a3d6b04
@@ -296,6 +296,7 @@ int IonController::allocate(alloc_data& data, int usage)
|
||||
// for targets/OEMs which do not need HW level protection
|
||||
// do not set ion secure flag & MM heap. Fallback to IOMMU heap.
|
||||
ionFlags |= ION_HEAP(ION_IOMMU_HEAP_ID);
|
||||
data.allocType |= private_handle_t::PRIV_FLAGS_PROTECTED_BUFFER;
|
||||
}
|
||||
} else if(usage & GRALLOC_USAGE_PRIVATE_MM_HEAP) {
|
||||
//MM Heap is exclusively a secure heap.
|
||||
|
||||
@@ -193,6 +193,8 @@ struct private_handle_t : public native_handle {
|
||||
PRIV_FLAGS_NOT_MAPPED = 0x00001000,
|
||||
// Display on external only
|
||||
PRIV_FLAGS_EXTERNAL_ONLY = 0x00002000,
|
||||
// Set by HWC for protected non secure buffers
|
||||
PRIV_FLAGS_PROTECTED_BUFFER = 0x00004000,
|
||||
PRIV_FLAGS_VIDEO_ENCODER = 0x00010000,
|
||||
PRIV_FLAGS_CAMERA_WRITE = 0x00020000,
|
||||
PRIV_FLAGS_CAMERA_READ = 0x00040000,
|
||||
|
||||
@@ -157,6 +157,8 @@ bool FBUpdateNonSplit::configure(hwc_context_t *ctx, hwc_display_contents_1 *lis
|
||||
}
|
||||
|
||||
ovutils::eMdpFlags mdpFlags = ovutils::OV_MDP_BLEND_FG_PREMULT;
|
||||
ovutils::setMdpFlags(mdpFlags,
|
||||
ovutils::OV_MDP_SMP_FORCE_ALLOC);
|
||||
ovutils::eZorder zOrder = static_cast<ovutils::eZorder>(fbZorder);
|
||||
|
||||
hwc_rect_t sourceCrop = integerizeSourceCrop(layer->sourceCropf);
|
||||
@@ -280,6 +282,8 @@ bool FBUpdateSplit::configure(hwc_context_t *ctx,
|
||||
|
||||
overlay::Overlay& ov = *(ctx->mOverlay);
|
||||
ovutils::eMdpFlags mdpFlags = ovutils::OV_MDP_BLEND_FG_PREMULT;
|
||||
ovutils::setMdpFlags(mdpFlags,
|
||||
ovutils::OV_MDP_SMP_FORCE_ALLOC);
|
||||
ovutils::eZorder zOrder = static_cast<ovutils::eZorder>(fbZorder);
|
||||
ovutils::eTransform orient =
|
||||
static_cast<ovutils::eTransform>(layer->transform);
|
||||
@@ -442,6 +446,8 @@ bool FBSrcSplit::configure(hwc_context_t *ctx, hwc_display_contents_1 *list,
|
||||
mTileEnabled));
|
||||
|
||||
ovutils::eMdpFlags mdpFlags = OV_MDP_BLEND_FG_PREMULT;
|
||||
ovutils::setMdpFlags(mdpFlags,
|
||||
ovutils::OV_MDP_SMP_FORCE_ALLOC);
|
||||
ovutils::eZorder zOrder = static_cast<ovutils::eZorder>(fbZorder);
|
||||
|
||||
ovutils::PipeArgs parg(mdpFlags,
|
||||
|
||||
@@ -2075,7 +2075,7 @@ int MDPCompNonSplit::configure(hwc_context_t *ctx, hwc_layer_1_t *layer,
|
||||
PipeLayerPair& PipeLayerPair) {
|
||||
MdpPipeInfoNonSplit& mdp_info =
|
||||
*(static_cast<MdpPipeInfoNonSplit*>(PipeLayerPair.pipeInfo));
|
||||
eMdpFlags mdpFlags = OV_MDP_BACKEND_COMPOSITION;
|
||||
eMdpFlags mdpFlags = ovutils::OV_MDP_FLAGS_NONE;
|
||||
eZorder zOrder = static_cast<eZorder>(mdp_info.zOrder);
|
||||
eDest dest = mdp_info.index;
|
||||
|
||||
@@ -2131,7 +2131,7 @@ int MDPCompNonSplit::configure4k2kYuv(hwc_context_t *ctx, hwc_layer_1_t *layer,
|
||||
MdpYUVPipeInfo& mdp_info =
|
||||
*(static_cast<MdpYUVPipeInfo*>(PipeLayerPair.pipeInfo));
|
||||
eZorder zOrder = static_cast<eZorder>(mdp_info.zOrder);
|
||||
eMdpFlags mdpFlagsL = OV_MDP_BACKEND_COMPOSITION;
|
||||
eMdpFlags mdpFlagsL = ovutils::OV_MDP_FLAGS_NONE;
|
||||
eDest lDest = mdp_info.lIndex;
|
||||
eDest rDest = mdp_info.rIndex;
|
||||
|
||||
@@ -2363,7 +2363,7 @@ int MDPCompSplit::configure4k2kYuv(hwc_context_t *ctx, hwc_layer_1_t *layer,
|
||||
MdpYUVPipeInfo& mdp_info =
|
||||
*(static_cast<MdpYUVPipeInfo*>(PipeLayerPair.pipeInfo));
|
||||
eZorder zOrder = static_cast<eZorder>(mdp_info.zOrder);
|
||||
eMdpFlags mdpFlagsL = OV_MDP_BACKEND_COMPOSITION;
|
||||
eMdpFlags mdpFlagsL = ovutils::OV_MDP_FLAGS_NONE;
|
||||
eDest lDest = mdp_info.lIndex;
|
||||
eDest rDest = mdp_info.rIndex;
|
||||
|
||||
@@ -2383,7 +2383,7 @@ int MDPCompSplit::configure(hwc_context_t *ctx, hwc_layer_1_t *layer,
|
||||
MdpPipeInfoSplit& mdp_info =
|
||||
*(static_cast<MdpPipeInfoSplit*>(PipeLayerPair.pipeInfo));
|
||||
eZorder zOrder = static_cast<eZorder>(mdp_info.zOrder);
|
||||
eMdpFlags mdpFlagsL = OV_MDP_BACKEND_COMPOSITION;
|
||||
eMdpFlags mdpFlagsL = ovutils::OV_MDP_FLAGS_NONE;
|
||||
eDest lDest = mdp_info.lIndex;
|
||||
eDest rDest = mdp_info.rIndex;
|
||||
|
||||
@@ -2630,7 +2630,7 @@ int MDPCompSrcSplit::configure(hwc_context_t *ctx, hwc_layer_1_t *layer,
|
||||
calcExtDisplayPosition(ctx, hnd, mDpy, crop, dst, transform, orient);
|
||||
|
||||
int downscale = getRotDownscale(ctx, layer);
|
||||
eMdpFlags mdpFlags = OV_MDP_BACKEND_COMPOSITION;
|
||||
eMdpFlags mdpFlags = ovutils::OV_MDP_FLAGS_NONE;
|
||||
setMdpFlags(ctx, layer, mdpFlags, downscale, transform);
|
||||
|
||||
if(lDest != OV_INVALID && rDest != OV_INVALID) {
|
||||
|
||||
@@ -1675,6 +1675,13 @@ void setMdpFlags(hwc_context_t *ctx, hwc_layer_1_t *layer,
|
||||
if(isSecureBuffer(hnd)) {
|
||||
ovutils::setMdpFlags(mdpFlags,
|
||||
ovutils::OV_MDP_SECURE_OVERLAY_SESSION);
|
||||
ovutils::setMdpFlags(mdpFlags,
|
||||
ovutils::OV_MDP_SMP_FORCE_ALLOC);
|
||||
}
|
||||
|
||||
if(isProtectedBuffer(hnd)) {
|
||||
ovutils::setMdpFlags(mdpFlags,
|
||||
ovutils::OV_MDP_SMP_FORCE_ALLOC);
|
||||
}
|
||||
|
||||
if(isSecureDisplayBuffer(hnd)) {
|
||||
|
||||
@@ -464,6 +464,12 @@ static inline bool isSecureBuffer(const private_handle_t* hnd) {
|
||||
return (hnd && (private_handle_t::PRIV_FLAGS_SECURE_BUFFER & hnd->flags));
|
||||
}
|
||||
|
||||
// Returns true if the buffer is protected
|
||||
static inline bool isProtectedBuffer(const private_handle_t* hnd) {
|
||||
return (hnd && (private_handle_t::PRIV_FLAGS_PROTECTED_BUFFER & hnd->flags));
|
||||
}
|
||||
|
||||
|
||||
static inline bool isTileRendered(const private_handle_t* hnd) {
|
||||
return (hnd && (private_handle_t::PRIV_FLAGS_TILE_RENDERED & hnd->flags));
|
||||
}
|
||||
|
||||
@@ -223,7 +223,6 @@ enum eMdpFlags {
|
||||
OV_MDP_SECURE_OVERLAY_SESSION = MDP_SECURE_OVERLAY_SESSION,
|
||||
OV_MDP_SECURE_DISPLAY_OVERLAY_SESSION = MDP_SECURE_DISPLAY_OVERLAY_SESSION,
|
||||
OV_MDP_SOURCE_ROTATED_90 = MDP_SOURCE_ROTATED_90,
|
||||
OV_MDP_BACKEND_COMPOSITION = MDP_BACKEND_COMPOSITION,
|
||||
OV_MDP_BLEND_FG_PREMULT = MDP_BLEND_FG_PREMULT,
|
||||
OV_MDP_FLIP_H = MDP_FLIP_LR,
|
||||
OV_MDP_FLIP_V = MDP_FLIP_UD,
|
||||
@@ -232,6 +231,7 @@ enum eMdpFlags {
|
||||
OV_MDSS_MDP_BWC_EN = MDP_BWC_EN,
|
||||
OV_MDSS_MDP_DUAL_PIPE = MDSS_MDP_DUAL_PIPE,
|
||||
OV_MDP_SOLID_FILL = MDP_SOLID_FILL,
|
||||
OV_MDP_SMP_FORCE_ALLOC = MDP_SMP_FORCE_ALLOC,
|
||||
};
|
||||
|
||||
enum eZorder {
|
||||
|
||||
Reference in New Issue
Block a user