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
diff --git a/liboverlay/overlayMdpRot.cpp b/liboverlay/overlayMdpRot.cpp
index d322897..b5a90ad 100755
--- a/liboverlay/overlayMdpRot.cpp
+++ b/liboverlay/overlayMdpRot.cpp
@@ -126,6 +126,10 @@
// 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) {
mRotImgInfo.secure = 0;
if(flags & utils::OV_MDP_SECURE_OVERLAY_SESSION)
diff --git a/liboverlay/overlayMdssRot.cpp b/liboverlay/overlayMdssRot.cpp
index 87e134a..39b240d 100644
--- a/liboverlay/overlayMdssRot.cpp
+++ b/liboverlay/overlayMdssRot.cpp
@@ -129,6 +129,10 @@
mDownscale = downscale;
}
+void MdssRot::setFrameRate(uint32_t frame_rate) {
+ mRotInfo.frame_rate = frame_rate;
+}
+
void MdssRot::setFlags(const utils::eMdpFlags& flags) {
mRotInfo.flags = flags;
}
diff --git a/liboverlay/overlayRotator.h b/liboverlay/overlayRotator.h
index e045b44..0766c86 100644
--- a/liboverlay/overlayRotator.h
+++ b/liboverlay/overlayRotator.h
@@ -97,6 +97,7 @@
virtual bool queueBuffer(int fd, uint32_t offset) = 0;
virtual void dump() 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) {
mMem.setCurrBufReleaseFd(fence);
}
@@ -150,6 +151,7 @@
virtual bool queueBuffer(int fd, uint32_t offset);
virtual void dump() const;
virtual void getDump(char *buf, size_t len) const;
+ virtual void setFrameRate(uint32_t frame_rate);
private:
explicit MdpRot();
@@ -222,6 +224,7 @@
virtual bool queueBuffer(int fd, uint32_t offset);
virtual void dump() const;
virtual void getDump(char *buf, size_t len) const;
+ virtual void setFrameRate(uint32_t frame_rate);
private:
explicit MdssRot();