overlay: mdprot: Call rotator start only on config change.
Call ROTATOR_START ioctl only if the rotator config changes. Save the last good config when the start succeeds. Make getSessId()'s return type uint32_t to match the member's. Change-Id: I5ca048ea866316f18d8df14dc08218fca2c82bdf
This commit is contained in:
parent
41c718b253
commit
fe67379a7f
@ -110,12 +110,15 @@ void MdpRot::doTransform() {
|
||||
|
||||
bool MdpRot::commit() {
|
||||
doTransform();
|
||||
if(!overlay::mdp_wrapper::startRotator(mFd.getFD(), mRotImgInfo)) {
|
||||
ALOGE("MdpRot commit failed");
|
||||
dump();
|
||||
return false;
|
||||
if (this->rotConfChanged()) {
|
||||
if(!overlay::mdp_wrapper::startRotator(mFd.getFD(), mRotImgInfo)) {
|
||||
ALOGE("MdpRot commit failed");
|
||||
dump();
|
||||
return false;
|
||||
}
|
||||
this->save();
|
||||
mRotDataInfo.session_id = mRotImgInfo.session_id;
|
||||
}
|
||||
mRotDataInfo.session_id = mRotImgInfo.session_id;
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -190,6 +193,7 @@ bool MdpRot::remap(uint32_t numbufs) {
|
||||
|
||||
void MdpRot::reset() {
|
||||
ovutils::memset0(mRotImgInfo);
|
||||
ovutils::memset0(mLSRotImgInfo);
|
||||
ovutils::memset0(mRotDataInfo);
|
||||
ovutils::memset0(mMem.curr().mRotOffset);
|
||||
ovutils::memset0(mMem.prev().mRotOffset);
|
||||
|
@ -62,7 +62,7 @@ public:
|
||||
virtual void setSrcFB() = 0;
|
||||
|
||||
virtual bool enabled() const = 0;
|
||||
virtual int getSessId() const = 0;
|
||||
virtual uint32_t getSessId() const = 0;
|
||||
virtual int getDstMemId() const = 0;
|
||||
virtual uint32_t getDstOffset() const = 0;
|
||||
virtual void dump() const = 0;
|
||||
@ -105,7 +105,7 @@ public:
|
||||
/* Retusn true if rotator enabled */
|
||||
virtual bool enabled() const = 0;
|
||||
/* returns rotator session id */
|
||||
virtual int getSessId() const = 0;
|
||||
virtual uint32_t getSessId() const = 0;
|
||||
/* get dst (for offset and memory id) non-virt */
|
||||
virtual int getDstMemId() const = 0;
|
||||
virtual uint32_t getDstOffset() const = 0;
|
||||
@ -139,7 +139,7 @@ public:
|
||||
virtual void setEnable();
|
||||
virtual void setDisable();
|
||||
virtual bool enabled () const;
|
||||
virtual int getSessId() const;
|
||||
virtual uint32_t getSessId() const;
|
||||
virtual bool queueBuffer(int fd, uint32_t offset);
|
||||
virtual void dump() const;
|
||||
};
|
||||
@ -164,7 +164,7 @@ public:
|
||||
virtual void setDisable();
|
||||
virtual bool enabled () const;
|
||||
virtual void setSrcFB();
|
||||
virtual int getSessId() const;
|
||||
virtual uint32_t getSessId() const;
|
||||
virtual int getDstMemId() const;
|
||||
virtual uint32_t getDstOffset() const;
|
||||
virtual void dump() const;
|
||||
@ -226,7 +226,7 @@ public:
|
||||
void setRotations(uint32_t r);
|
||||
void setSrcFB();
|
||||
bool enabled() const;
|
||||
int getSessId() const;
|
||||
uint32_t getSessId() const;
|
||||
int getDstMemId() const;
|
||||
uint32_t getDstOffset() const;
|
||||
void dump() const;
|
||||
@ -240,8 +240,17 @@ private:
|
||||
/* reset underlying data, basically memset 0 */
|
||||
void reset();
|
||||
|
||||
/* return true if current rotator config is different
|
||||
* than last known config */
|
||||
bool rotConfChanged() const;
|
||||
|
||||
/* save mRotImgInfo to be last known good config*/
|
||||
void save();
|
||||
|
||||
/* rot info*/
|
||||
msm_rotator_img_info mRotImgInfo;
|
||||
/* Last saved rot info*/
|
||||
msm_rotator_img_info mLSRotImgInfo;
|
||||
/* rot data */
|
||||
msm_rotator_data_info mRotDataInfo;
|
||||
/* Orientation */
|
||||
@ -308,7 +317,7 @@ inline uint32_t Rotator::getDstOffset() const {
|
||||
inline void Rotator::setRotations(uint32_t rot) {
|
||||
mRot->setRotations (rot);
|
||||
}
|
||||
inline int Rotator::getSessId() const {
|
||||
inline uint32_t Rotator::getSessId() const {
|
||||
return mRot->getSessId();
|
||||
}
|
||||
inline void Rotator::dump() const {
|
||||
@ -334,7 +343,7 @@ inline void NullRotator::setRotations(uint32_t) {}
|
||||
inline void NullRotator::setEnable() {}
|
||||
inline void NullRotator::setDisable() {}
|
||||
inline bool NullRotator::enabled() const { return false; }
|
||||
inline int NullRotator::getSessId() const { return -1; }
|
||||
inline uint32_t NullRotator::getSessId() const { return -1; }
|
||||
inline bool NullRotator::queueBuffer(int fd, uint32_t offset) { return true; }
|
||||
inline void NullRotator::setSrcFB() {}
|
||||
inline int NullRotator::getDstMemId() const { return -1; }
|
||||
@ -357,11 +366,21 @@ inline int MdpRot::getDstMemId() const {
|
||||
inline uint32_t MdpRot::getDstOffset() const {
|
||||
return mRotDataInfo.dst.offset;
|
||||
}
|
||||
inline int MdpRot::getSessId() const { return mRotImgInfo.session_id; }
|
||||
inline uint32_t MdpRot::getSessId() const { return mRotImgInfo.session_id; }
|
||||
inline void MdpRot::setSrcFB() {
|
||||
mRotDataInfo.src.flags |= MDP_MEMORY_ID_TYPE_FB;
|
||||
}
|
||||
|
||||
inline void MdpRot::save() {
|
||||
mLSRotImgInfo = mRotImgInfo;
|
||||
}
|
||||
inline bool MdpRot::rotConfChanged() const {
|
||||
// 0 means same
|
||||
if(0 == ::memcmp(&mRotImgInfo, &mLSRotImgInfo,
|
||||
sizeof (msm_rotator_img_info))) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
} // overlay
|
||||
|
||||
#endif // OVERlAY_ROTATOR_H
|
||||
|
Loading…
x
Reference in New Issue
Block a user