hwc: Populate frame rate in rotator set
- Populate frame_rate in rotator set, so that driver can vote for honest BW for rotator based on frame rate. - If metadata contains source fps, frame_rate will be set to source fps, else it will be set to primary refresh rate. - frame_rate will be populated for primary with source fps from metada, only when secondary is not active. Change-Id: Icaacd0ed67ec09591d31868591680d2e86fe54a2
This commit is contained in:
@@ -101,7 +101,8 @@ bool FBUpdateNonSplit::preRotateExtDisplay(hwc_context_t *ctx,
|
|||||||
// viewFrame with sourceCrop to avoid those black bars
|
// viewFrame with sourceCrop to avoid those black bars
|
||||||
sourceCrop = getIntersection(sourceCrop, ctx->mViewFrame[mDpy]);
|
sourceCrop = getIntersection(sourceCrop, ctx->mViewFrame[mDpy]);
|
||||||
//Configure rotator for pre-rotation
|
//Configure rotator for pre-rotation
|
||||||
if(configRotator(mRot, info, sourceCrop, mdpFlags, orient, 0) < 0) {
|
if(configRotator(mRot, info, sourceCrop, mdpFlags, orient, 0,
|
||||||
|
ctx->dpyAttr[HWC_DISPLAY_PRIMARY].refreshRate) < 0) {
|
||||||
ALOGE("%s: configRotator Failed!", __FUNCTION__);
|
ALOGE("%s: configRotator Failed!", __FUNCTION__);
|
||||||
mRot = NULL;
|
mRot = NULL;
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -3103,8 +3103,14 @@ int MDPCompSrcSplit::configure(hwc_context_t *ctx, hwc_layer_1_t *layer,
|
|||||||
BwcPM::setBwc(ctx, mDpy, hnd, crop, dst, transform, downscale,
|
BwcPM::setBwc(ctx, mDpy, hnd, crop, dst, transform, downscale,
|
||||||
mdpFlags);
|
mdpFlags);
|
||||||
}
|
}
|
||||||
|
uint32_t frame_rate = ctx->dpyAttr[HWC_DISPLAY_PRIMARY].refreshRate;
|
||||||
|
if(!mDpy && !isSecondaryConnected(ctx)) {
|
||||||
|
if(metadata && (metadata->operation & UPDATE_REFRESH_RATE))
|
||||||
|
frame_rate = metadata->refreshrate;
|
||||||
|
}
|
||||||
//Configure rotator for pre-rotation
|
//Configure rotator for pre-rotation
|
||||||
if(configRotator(*rot, whf, crop, mdpFlags, orient, downscale) < 0) {
|
if(configRotator(*rot, whf, crop, mdpFlags, orient, downscale,
|
||||||
|
frame_rate) < 0) {
|
||||||
ALOGE("%s: configRotator failed!", __FUNCTION__);
|
ALOGE("%s: configRotator failed!", __FUNCTION__);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1922,7 +1922,8 @@ void setMdpFlags(hwc_context_t *ctx, hwc_layer_1_t *layer,
|
|||||||
|
|
||||||
int configRotator(Rotator *rot, Whf& whf,
|
int configRotator(Rotator *rot, Whf& whf,
|
||||||
hwc_rect_t& crop, const eMdpFlags& mdpFlags,
|
hwc_rect_t& crop, const eMdpFlags& mdpFlags,
|
||||||
const eTransform& orient, const int& downscale) {
|
const eTransform& orient, const int& downscale,
|
||||||
|
const uint32_t& frame_rate) {
|
||||||
|
|
||||||
// Fix alignments for TILED format
|
// Fix alignments for TILED format
|
||||||
if(whf.format == MDP_Y_CRCB_H2V2_TILE ||
|
if(whf.format == MDP_Y_CRCB_H2V2_TILE ||
|
||||||
@@ -1939,6 +1940,7 @@ int configRotator(Rotator *rot, Whf& whf,
|
|||||||
rot->setCrop(rotCrop);
|
rot->setCrop(rotCrop);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rot->setFrameRate(frame_rate);
|
||||||
rot->setFlags(mdpFlags);
|
rot->setFlags(mdpFlags);
|
||||||
rot->setTransform(orient);
|
rot->setTransform(orient);
|
||||||
rot->setDownscale(downscale);
|
rot->setDownscale(downscale);
|
||||||
@@ -2226,8 +2228,14 @@ int configureNonSplit(hwc_context_t *ctx, hwc_layer_1_t *layer,
|
|||||||
ctx->mLayerRotMap[dpy]->add(layer, *rot);
|
ctx->mLayerRotMap[dpy]->add(layer, *rot);
|
||||||
BwcPM::setBwc(ctx, dpy, hnd, crop, dst, transform, downscale,
|
BwcPM::setBwc(ctx, dpy, hnd, crop, dst, transform, downscale,
|
||||||
mdpFlags);
|
mdpFlags);
|
||||||
|
uint32_t frame_rate = ctx->dpyAttr[HWC_DISPLAY_PRIMARY].refreshRate;
|
||||||
|
if(!dpy && !isSecondaryConnected(ctx)) {
|
||||||
|
if(metadata && (metadata->operation & UPDATE_REFRESH_RATE))
|
||||||
|
frame_rate = metadata->refreshrate;
|
||||||
|
}
|
||||||
//Configure rotator for pre-rotation
|
//Configure rotator for pre-rotation
|
||||||
if(configRotator(*rot, whf, crop, mdpFlags, orient, downscale) < 0) {
|
if(configRotator(*rot, whf, crop, mdpFlags, orient, downscale,
|
||||||
|
frame_rate) < 0) {
|
||||||
ALOGE("%s: configRotator failed!", __FUNCTION__);
|
ALOGE("%s: configRotator failed!", __FUNCTION__);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -2335,8 +2343,14 @@ int configureSplit(hwc_context_t *ctx, hwc_layer_1_t *layer,
|
|||||||
(*rot) = ctx->mRotMgr->getNext();
|
(*rot) = ctx->mRotMgr->getNext();
|
||||||
if((*rot) == NULL) return -1;
|
if((*rot) == NULL) return -1;
|
||||||
ctx->mLayerRotMap[dpy]->add(layer, *rot);
|
ctx->mLayerRotMap[dpy]->add(layer, *rot);
|
||||||
|
uint32_t frame_rate = ctx->dpyAttr[HWC_DISPLAY_PRIMARY].refreshRate;
|
||||||
|
if(!dpy && !isSecondaryConnected(ctx)) {
|
||||||
|
if(metadata && (metadata->operation & UPDATE_REFRESH_RATE))
|
||||||
|
frame_rate = metadata->refreshrate;
|
||||||
|
}
|
||||||
//Configure rotator for pre-rotation
|
//Configure rotator for pre-rotation
|
||||||
if(configRotator(*rot, whf, crop, mdpFlagsL, orient, downscale) < 0) {
|
if(configRotator(*rot, whf, crop, mdpFlagsL, orient, downscale,
|
||||||
|
frame_rate) < 0) {
|
||||||
ALOGE("%s: configRotator failed!", __FUNCTION__);
|
ALOGE("%s: configRotator failed!", __FUNCTION__);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -2459,8 +2473,14 @@ int configure3DVideo(hwc_context_t *ctx, hwc_layer_1_t *layer,
|
|||||||
(*rot) = ctx->mRotMgr->getNext();
|
(*rot) = ctx->mRotMgr->getNext();
|
||||||
if((*rot) == NULL) return -1;
|
if((*rot) == NULL) return -1;
|
||||||
ctx->mLayerRotMap[dpy]->add(layer, *rot);
|
ctx->mLayerRotMap[dpy]->add(layer, *rot);
|
||||||
|
uint32_t frame_rate = ctx->dpyAttr[HWC_DISPLAY_PRIMARY].refreshRate;
|
||||||
|
if(!dpy && !isSecondaryConnected(ctx)) {
|
||||||
|
if(metadata && (metadata->operation & UPDATE_REFRESH_RATE))
|
||||||
|
frame_rate = metadata->refreshrate;
|
||||||
|
}
|
||||||
//Configure rotator for pre-rotation
|
//Configure rotator for pre-rotation
|
||||||
if(configRotator(*rot, whf, crop, mdpFlagsL, orient, downscale) < 0) {
|
if(configRotator(*rot, whf, crop, mdpFlagsL, orient, downscale,
|
||||||
|
frame_rate) < 0) {
|
||||||
ALOGE("%s: configRotator failed!", __FUNCTION__);
|
ALOGE("%s: configRotator failed!", __FUNCTION__);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -2577,8 +2597,14 @@ int configureSourceSplit(hwc_context_t *ctx, hwc_layer_1_t *layer,
|
|||||||
(*rot) = ctx->mRotMgr->getNext();
|
(*rot) = ctx->mRotMgr->getNext();
|
||||||
if((*rot) == NULL) return -1;
|
if((*rot) == NULL) return -1;
|
||||||
ctx->mLayerRotMap[dpy]->add(layer, *rot);
|
ctx->mLayerRotMap[dpy]->add(layer, *rot);
|
||||||
|
uint32_t frame_rate = ctx->dpyAttr[HWC_DISPLAY_PRIMARY].refreshRate;
|
||||||
|
if(!dpy && !isSecondaryConnected(ctx)) {
|
||||||
|
if(metadata && (metadata->operation & UPDATE_REFRESH_RATE))
|
||||||
|
frame_rate = metadata->refreshrate;
|
||||||
|
}
|
||||||
//Configure rotator for pre-rotation
|
//Configure rotator for pre-rotation
|
||||||
if(configRotator(*rot, whf, crop, mdpFlagsL, orient, downscale) < 0) {
|
if(configRotator(*rot, whf, crop, mdpFlagsL, orient, downscale,
|
||||||
|
frame_rate) < 0) {
|
||||||
ALOGE("%s: configRotator failed!", __FUNCTION__);
|
ALOGE("%s: configRotator failed!", __FUNCTION__);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -420,7 +420,8 @@ void setMdpFlags(hwc_context_t *ctx, hwc_layer_1_t *layer,
|
|||||||
|
|
||||||
int configRotator(overlay::Rotator *rot, ovutils::Whf& whf,
|
int configRotator(overlay::Rotator *rot, ovutils::Whf& whf,
|
||||||
hwc_rect_t& crop, const ovutils::eMdpFlags& mdpFlags,
|
hwc_rect_t& crop, const ovutils::eMdpFlags& mdpFlags,
|
||||||
const ovutils::eTransform& orient, const int& downscale);
|
const ovutils::eTransform& orient, const int& downscale,
|
||||||
|
const uint32_t& frame_rate);
|
||||||
|
|
||||||
int configMdp(overlay::Overlay *ov, const ovutils::PipeArgs& parg,
|
int configMdp(overlay::Overlay *ov, const ovutils::PipeArgs& parg,
|
||||||
const ovutils::eTransform& orient, const hwc_rect_t& crop,
|
const ovutils::eTransform& orient, const hwc_rect_t& crop,
|
||||||
|
|||||||
@@ -126,6 +126,10 @@ void MdpRot::setCrop(const utils::Dim& /*crop*/) {
|
|||||||
// NO-OP for non-mdss rotator due to possible h/w limitations
|
// NO-OP for non-mdss rotator due to possible h/w limitations
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MdpRot::setFrameRate(uint32_t /*frame_rate*/) {
|
||||||
|
// NO-OP for non-mdss rotator
|
||||||
|
}
|
||||||
|
|
||||||
void MdpRot::setFlags(const utils::eMdpFlags& flags) {
|
void MdpRot::setFlags(const utils::eMdpFlags& flags) {
|
||||||
mRotImgInfo.secure = 0;
|
mRotImgInfo.secure = 0;
|
||||||
if(flags & utils::OV_MDP_SECURE_OVERLAY_SESSION)
|
if(flags & utils::OV_MDP_SECURE_OVERLAY_SESSION)
|
||||||
|
|||||||
@@ -129,6 +129,10 @@ void MdssRot::setDownscale(int downscale) {
|
|||||||
mDownscale = downscale;
|
mDownscale = downscale;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MdssRot::setFrameRate(uint32_t frame_rate) {
|
||||||
|
mRotInfo.frame_rate = frame_rate;
|
||||||
|
}
|
||||||
|
|
||||||
void MdssRot::setFlags(const utils::eMdpFlags& flags) {
|
void MdssRot::setFlags(const utils::eMdpFlags& flags) {
|
||||||
mRotInfo.flags = flags;
|
mRotInfo.flags = flags;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -97,6 +97,7 @@ public:
|
|||||||
virtual bool queueBuffer(int fd, uint32_t offset) = 0;
|
virtual bool queueBuffer(int fd, uint32_t offset) = 0;
|
||||||
virtual void dump() const = 0;
|
virtual void dump() const = 0;
|
||||||
virtual void getDump(char *buf, size_t len) const = 0;
|
virtual void getDump(char *buf, size_t len) const = 0;
|
||||||
|
virtual void setFrameRate(uint32_t frame_rate) = 0;
|
||||||
inline void setCurrBufReleaseFd(const int& fence) {
|
inline void setCurrBufReleaseFd(const int& fence) {
|
||||||
mMem.setCurrBufReleaseFd(fence);
|
mMem.setCurrBufReleaseFd(fence);
|
||||||
}
|
}
|
||||||
@@ -150,6 +151,7 @@ public:
|
|||||||
virtual bool queueBuffer(int fd, uint32_t offset);
|
virtual bool queueBuffer(int fd, uint32_t offset);
|
||||||
virtual void dump() const;
|
virtual void dump() const;
|
||||||
virtual void getDump(char *buf, size_t len) const;
|
virtual void getDump(char *buf, size_t len) const;
|
||||||
|
virtual void setFrameRate(uint32_t frame_rate);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
explicit MdpRot();
|
explicit MdpRot();
|
||||||
@@ -222,6 +224,7 @@ public:
|
|||||||
virtual bool queueBuffer(int fd, uint32_t offset);
|
virtual bool queueBuffer(int fd, uint32_t offset);
|
||||||
virtual void dump() const;
|
virtual void dump() const;
|
||||||
virtual void getDump(char *buf, size_t len) const;
|
virtual void getDump(char *buf, size_t len) const;
|
||||||
|
virtual void setFrameRate(uint32_t frame_rate);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
explicit MdssRot();
|
explicit MdssRot();
|
||||||
|
|||||||
Reference in New Issue
Block a user