liboverlay: Remove waitForVsync, getOvPipeType APIs
Remove waitForVsync support. Vsync will be done explicitly by clients outside of overlay. Remove support for the unused getOvPipeType API. Remove redundant state checks in class Overlay Change-Id: I34f00e1334bbd9fad130bdefeaf0426ebbd638a1
This commit is contained in:
parent
97d3484b12
commit
a710720dbd
@ -143,11 +143,6 @@ bool ExtOnly::draw(hwc_context_t *ctx, hwc_layer_list_t *list)
|
||||
ALOGE("%s: queueBuffer failed for external", __FUNCTION__);
|
||||
ret = false;
|
||||
}
|
||||
// Wait for external vsync to be done
|
||||
if (!ov.waitForVsync(ovutils::OV_PIPE0)) {
|
||||
ALOGE("%s: waitForVsync failed for external", __FUNCTION__);
|
||||
ret = false;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
ALOGE("%s Unused state %s", __FUNCTION__,
|
||||
|
@ -345,11 +345,6 @@ bool VideoOverlay::draw(hwc_context_t *ctx, hwc_layer_list_t *list)
|
||||
ALOGE("%s: queueBuffer failed for primary", __FUNCTION__);
|
||||
ret = false;
|
||||
}
|
||||
// Wait for external vsync to be done
|
||||
if (!ov.waitForVsync(ovutils::OV_PIPE1)) {
|
||||
ALOGE("%s: waitForVsync failed for external", __FUNCTION__);
|
||||
ret = false;
|
||||
}
|
||||
break;
|
||||
case ovutils::OV_2D_VIDEO_ON_PANEL:
|
||||
// Play primary
|
||||
@ -370,11 +365,6 @@ bool VideoOverlay::draw(hwc_context_t *ctx, hwc_layer_list_t *list)
|
||||
ALOGE("%s: queueBuffer failed for cc external", __FUNCTION__);
|
||||
ret = false;
|
||||
}
|
||||
// Wait for external vsync to be done
|
||||
if (!ov.waitForVsync(ovutils::OV_PIPE1)) {
|
||||
ALOGE("%s: waitForVsync failed for external", __FUNCTION__);
|
||||
ret = false;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
ALOGE("%s Unused state %s", __FUNCTION__,
|
||||
|
@ -75,9 +75,6 @@ bool getOverlay(int fd, mdp_overlay& ov);
|
||||
/* MSMFB_OVERLAY_PLAY */
|
||||
bool play(int fd, msmfb_overlay_data& od);
|
||||
|
||||
/* MSMFB_OVERLAY_PLAY_WAIT */
|
||||
bool waitForVsync(int fd, msmfb_overlay_data& od);
|
||||
|
||||
/* MSMFB_OVERLAY_3D */
|
||||
bool set3D(int fd, msmfb_overlay_3d& ov);
|
||||
|
||||
@ -191,15 +188,6 @@ inline bool play(int fd, msmfb_overlay_data& od) {
|
||||
return true;
|
||||
}
|
||||
|
||||
inline bool waitForVsync(int fd, msmfb_overlay_data& od) {
|
||||
if (ioctl(fd, MSMFB_OVERLAY_PLAY_WAIT, &od) < 0) {
|
||||
ALOGE("Failed to call ioctl MSMFB_OVERLAY_PLAY_WAIT err=%s",
|
||||
strerror(errno));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
inline bool set3D(int fd, msmfb_overlay_3d& ov) {
|
||||
if (ioctl(fd, MSMFB_OVERLAY_3D, &ov) < 0) {
|
||||
ALOGE("Failed to call ioctl MSMFB_OVERLAY_3D err=%s",
|
||||
|
@ -36,6 +36,35 @@
|
||||
|
||||
namespace overlay {
|
||||
|
||||
//Helper
|
||||
bool isStateValid(const utils::eOverlayState& st) {
|
||||
switch (st) {
|
||||
case utils::OV_CLOSED:
|
||||
ALOGE("Overlay %s failed, state is OV_CLOSED; set state first",
|
||||
__FUNCTION__);
|
||||
return false;
|
||||
break;
|
||||
case utils::OV_2D_VIDEO_ON_PANEL:
|
||||
case utils::OV_2D_VIDEO_ON_PANEL_TV:
|
||||
case utils::OV_2D_VIDEO_ON_TV:
|
||||
case utils::OV_3D_VIDEO_ON_2D_PANEL:
|
||||
case utils::OV_3D_VIDEO_ON_3D_PANEL:
|
||||
case utils::OV_3D_VIDEO_ON_3D_TV:
|
||||
case utils::OV_3D_VIDEO_ON_2D_PANEL_2D_TV:
|
||||
case utils::OV_UI_MIRROR:
|
||||
case utils::OV_2D_TRUE_UI_MIRROR:
|
||||
case utils::OV_BYPASS_1_LAYER:
|
||||
case utils::OV_BYPASS_2_LAYER:
|
||||
case utils::OV_BYPASS_3_LAYER:
|
||||
case utils::OV_DUAL_DISP:
|
||||
break;
|
||||
default:
|
||||
OVASSERT(false, "%s Unknown state %d", __FUNCTION__, st);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Overlay::Overlay(): mOv(0) {
|
||||
}
|
||||
|
||||
@ -51,28 +80,11 @@ bool Overlay::commit(utils::eDest dest)
|
||||
"%s Overlay and Rotator should be init at this point",
|
||||
__FUNCTION__);
|
||||
utils::eOverlayState st = mState.state();
|
||||
switch (st) {
|
||||
case utils::OV_2D_VIDEO_ON_PANEL:
|
||||
case utils::OV_2D_VIDEO_ON_PANEL_TV:
|
||||
case utils::OV_2D_VIDEO_ON_TV:
|
||||
case utils::OV_3D_VIDEO_ON_2D_PANEL:
|
||||
case utils::OV_3D_VIDEO_ON_3D_PANEL:
|
||||
case utils::OV_3D_VIDEO_ON_3D_TV:
|
||||
case utils::OV_3D_VIDEO_ON_2D_PANEL_2D_TV:
|
||||
case utils::OV_UI_MIRROR:
|
||||
case utils::OV_2D_TRUE_UI_MIRROR:
|
||||
case utils::OV_BYPASS_1_LAYER:
|
||||
case utils::OV_BYPASS_2_LAYER:
|
||||
case utils::OV_BYPASS_3_LAYER:
|
||||
case utils::OV_DUAL_DISP:
|
||||
if(!mOv->commit(dest)) {
|
||||
ALOGE("Overlay %s failed", __FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
OVASSERT(false, "%s Unknown state %d", __FUNCTION__, st);
|
||||
if(isStateValid(st)) {
|
||||
if(!mOv->commit(dest)) {
|
||||
ALOGE("Overlay %s failed", __FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -84,60 +96,11 @@ bool Overlay::queueBuffer(int fd, uint32_t offset,
|
||||
"%s Overlay and Rotator should be init at this point",
|
||||
__FUNCTION__);
|
||||
utils::eOverlayState st = mState.state();
|
||||
switch (st) {
|
||||
case utils::OV_2D_VIDEO_ON_PANEL:
|
||||
case utils::OV_2D_VIDEO_ON_PANEL_TV:
|
||||
case utils::OV_2D_VIDEO_ON_TV:
|
||||
case utils::OV_3D_VIDEO_ON_2D_PANEL:
|
||||
case utils::OV_3D_VIDEO_ON_3D_PANEL:
|
||||
case utils::OV_3D_VIDEO_ON_3D_TV:
|
||||
case utils::OV_3D_VIDEO_ON_2D_PANEL_2D_TV:
|
||||
case utils::OV_UI_MIRROR:
|
||||
case utils::OV_2D_TRUE_UI_MIRROR:
|
||||
case utils::OV_BYPASS_1_LAYER:
|
||||
case utils::OV_BYPASS_2_LAYER:
|
||||
case utils::OV_BYPASS_3_LAYER:
|
||||
case utils::OV_DUAL_DISP:
|
||||
if(!mOv->queueBuffer(fd, offset, dest)) {
|
||||
ALOGE("Overlay %s failed", __FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
OVASSERT(false, "%s Unknown state %d", __FUNCTION__, st);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Overlay::waitForVsync(utils::eDest dest)
|
||||
{
|
||||
OVASSERT(mOv,
|
||||
"%s Overlay and Rotator should be init at this point",
|
||||
__FUNCTION__);
|
||||
utils::eOverlayState st = mState.state();
|
||||
switch (st) {
|
||||
case utils::OV_2D_VIDEO_ON_PANEL:
|
||||
case utils::OV_2D_VIDEO_ON_PANEL_TV:
|
||||
case utils::OV_2D_VIDEO_ON_TV:
|
||||
case utils::OV_3D_VIDEO_ON_2D_PANEL:
|
||||
case utils::OV_3D_VIDEO_ON_3D_PANEL:
|
||||
case utils::OV_3D_VIDEO_ON_3D_TV:
|
||||
case utils::OV_3D_VIDEO_ON_2D_PANEL_2D_TV:
|
||||
case utils::OV_UI_MIRROR:
|
||||
case utils::OV_2D_TRUE_UI_MIRROR:
|
||||
case utils::OV_BYPASS_1_LAYER:
|
||||
case utils::OV_BYPASS_2_LAYER:
|
||||
case utils::OV_BYPASS_3_LAYER:
|
||||
case utils::OV_DUAL_DISP:
|
||||
if(!mOv->waitForVsync(dest)) {
|
||||
ALOGE("Overlay %s failed", __FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
OVASSERT(false, "%s Unknown state %d", __FUNCTION__, st);
|
||||
if(isStateValid(st)) {
|
||||
if(!mOv->queueBuffer(fd, offset, dest)) {
|
||||
ALOGE("Overlay %s failed", __FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -149,28 +112,11 @@ bool Overlay::setCrop(const utils::Dim& d,
|
||||
"%s Overlay and Rotator should be init at this point",
|
||||
__FUNCTION__);
|
||||
utils::eOverlayState st = mState.state();
|
||||
switch (st) {
|
||||
case utils::OV_2D_VIDEO_ON_PANEL:
|
||||
case utils::OV_2D_VIDEO_ON_PANEL_TV:
|
||||
case utils::OV_2D_VIDEO_ON_TV:
|
||||
case utils::OV_3D_VIDEO_ON_2D_PANEL:
|
||||
case utils::OV_3D_VIDEO_ON_3D_PANEL:
|
||||
case utils::OV_3D_VIDEO_ON_3D_TV:
|
||||
case utils::OV_3D_VIDEO_ON_2D_PANEL_2D_TV:
|
||||
case utils::OV_UI_MIRROR:
|
||||
case utils::OV_2D_TRUE_UI_MIRROR:
|
||||
case utils::OV_BYPASS_1_LAYER:
|
||||
case utils::OV_BYPASS_2_LAYER:
|
||||
case utils::OV_BYPASS_3_LAYER:
|
||||
case utils::OV_DUAL_DISP:
|
||||
if(!mOv->setCrop(d, dest)) {
|
||||
ALOGE("Overlay %s failed", __FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
OVASSERT(false, "%s Unknown state %d", __FUNCTION__, st);
|
||||
if(isStateValid(st)) {
|
||||
if(!mOv->setCrop(d, dest)) {
|
||||
ALOGE("Overlay %s failed", __FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -181,28 +127,11 @@ bool Overlay::setPosition(const utils::Dim& d,
|
||||
"%s Overlay and Rotator should be init at this point",
|
||||
__FUNCTION__);
|
||||
utils::eOverlayState st = mState.state();
|
||||
switch (st) {
|
||||
case utils::OV_2D_VIDEO_ON_PANEL:
|
||||
case utils::OV_2D_VIDEO_ON_PANEL_TV:
|
||||
case utils::OV_2D_VIDEO_ON_TV:
|
||||
case utils::OV_3D_VIDEO_ON_2D_PANEL:
|
||||
case utils::OV_3D_VIDEO_ON_3D_PANEL:
|
||||
case utils::OV_3D_VIDEO_ON_3D_TV:
|
||||
case utils::OV_3D_VIDEO_ON_2D_PANEL_2D_TV:
|
||||
case utils::OV_UI_MIRROR:
|
||||
case utils::OV_2D_TRUE_UI_MIRROR:
|
||||
case utils::OV_BYPASS_1_LAYER:
|
||||
case utils::OV_BYPASS_2_LAYER:
|
||||
case utils::OV_BYPASS_3_LAYER:
|
||||
case utils::OV_DUAL_DISP:
|
||||
if(!mOv->setPosition(d, dest)) {
|
||||
ALOGE("Overlay %s failed", __FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
OVASSERT(false, "setPos Unknown state %d", st);
|
||||
if(isStateValid(st)) {
|
||||
if(!mOv->setPosition(d, dest)) {
|
||||
ALOGE("Overlay %s failed", __FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -214,28 +143,11 @@ bool Overlay::setTransform(const int orient,
|
||||
static_cast<utils::eTransform>(orient);
|
||||
|
||||
utils::eOverlayState st = mState.state();
|
||||
switch (st) {
|
||||
case utils::OV_2D_VIDEO_ON_PANEL:
|
||||
case utils::OV_2D_VIDEO_ON_PANEL_TV:
|
||||
case utils::OV_2D_VIDEO_ON_TV:
|
||||
case utils::OV_3D_VIDEO_ON_2D_PANEL:
|
||||
case utils::OV_3D_VIDEO_ON_3D_PANEL:
|
||||
case utils::OV_3D_VIDEO_ON_3D_TV:
|
||||
case utils::OV_3D_VIDEO_ON_2D_PANEL_2D_TV:
|
||||
case utils::OV_UI_MIRROR:
|
||||
case utils::OV_2D_TRUE_UI_MIRROR:
|
||||
case utils::OV_BYPASS_1_LAYER:
|
||||
case utils::OV_BYPASS_2_LAYER:
|
||||
case utils::OV_BYPASS_3_LAYER:
|
||||
case utils::OV_DUAL_DISP:
|
||||
if(!mOv->setTransform(transform, dest)) {
|
||||
ALOGE("Overlay %s failed", __FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
OVASSERT(false, "%s Unknown state %d", __FUNCTION__ , st);
|
||||
if(isStateValid(st)) {
|
||||
if(!mOv->setTransform(transform, dest)) {
|
||||
ALOGE("Overlay %s failed", __FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -247,40 +159,12 @@ bool Overlay::setSource(const utils::PipeArgs args[utils::MAX_PIPES],
|
||||
args[0], args[1], args[2] };
|
||||
utils::eOverlayState st = mState.state();
|
||||
|
||||
switch (st) {
|
||||
case utils::OV_CLOSED:
|
||||
ALOGE("Overlay %s failed, state is OV_CLOSED, set state first",
|
||||
__FUNCTION__);
|
||||
return false;
|
||||
break;
|
||||
case utils::OV_2D_VIDEO_ON_PANEL:
|
||||
case utils::OV_3D_VIDEO_ON_2D_PANEL:
|
||||
case utils::OV_UI_MIRROR:
|
||||
case utils::OV_BYPASS_1_LAYER:
|
||||
case utils::OV_BYPASS_2_LAYER:
|
||||
case utils::OV_BYPASS_3_LAYER:
|
||||
case utils::OV_DUAL_DISP:
|
||||
break;
|
||||
case utils::OV_3D_VIDEO_ON_3D_PANEL:
|
||||
case utils::OV_3D_VIDEO_ON_3D_TV:
|
||||
//TODO set zorder for channel 1 as 1 in 3D pipe
|
||||
case utils::OV_2D_VIDEO_ON_PANEL_TV:
|
||||
case utils::OV_2D_VIDEO_ON_TV:
|
||||
case utils::OV_3D_VIDEO_ON_2D_PANEL_2D_TV:
|
||||
break;
|
||||
case utils::OV_2D_TRUE_UI_MIRROR:
|
||||
// TODO Set zorder, external VG pipe (video) gets 0, RGB pipe (UI) gets 1
|
||||
break;
|
||||
default:
|
||||
OVASSERT(false, "%s Unknown state %d", __FUNCTION__, st);
|
||||
if(isStateValid(st)) {
|
||||
if (!mOv->setSource(margs, dest)) {
|
||||
ALOGE("Overlay %s failed", __FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!mOv->setSource(margs, dest)) {
|
||||
ALOGE("Overlay %s failed", __FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -57,7 +57,6 @@ public:
|
||||
|
||||
bool queueBuffer(int fd, uint32_t offset,
|
||||
utils::eDest dest = utils::OV_PIPE_ALL);
|
||||
bool waitForVsync(utils::eDest dest = utils::OV_PIPE1);
|
||||
|
||||
void dump() const;
|
||||
|
||||
|
@ -119,9 +119,6 @@ public:
|
||||
/* queue buffer to the overlay */
|
||||
bool queueBuffer(int fd, uint32_t offset);
|
||||
|
||||
/* wait for vsync to be done */
|
||||
bool waitForVsync();
|
||||
|
||||
/* sump the state of the obj */
|
||||
void dump() const;
|
||||
|
||||
@ -218,15 +215,6 @@ inline bool Data::queueBuffer(int fd, uint32_t offset) {
|
||||
return mMdp.play(fd, offset);
|
||||
}
|
||||
|
||||
inline bool Data::waitForVsync() {
|
||||
// Call mdp waitForVsync
|
||||
if(!mMdp.waitForVsync()){
|
||||
ALOGE("Error in MDP %s", __FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
inline void Data::dump() const {
|
||||
ALOGE("== Dump Data MDP start ==");
|
||||
mMdp.dump();
|
||||
|
@ -72,9 +72,6 @@ public:
|
||||
virtual bool queueBuffer(int fd, uint32_t offset,
|
||||
utils::eDest dest = utils::OV_PIPE_ALL) = 0;
|
||||
|
||||
/* Wait for vsync to be done on dest */
|
||||
virtual bool waitForVsync(utils::eDest dest = utils::OV_PIPE1) = 0;
|
||||
|
||||
/* Crop existing destination using Dim coordinates */
|
||||
virtual bool setCrop(const utils::Dim& d,
|
||||
utils::eDest dest = utils::OV_PIPE_ALL) = 0;
|
||||
@ -92,9 +89,6 @@ public:
|
||||
virtual bool setSource(const utils::PipeArgs[utils::MAX_PIPES],
|
||||
utils::eDest dest = utils::OV_PIPE_ALL) = 0;
|
||||
|
||||
/* Get the overlay pipe type */
|
||||
virtual utils::eOverlayPipeType getOvPipeType(utils::eDest dest) const = 0;
|
||||
|
||||
/* Dump underlying state */
|
||||
virtual void dump() const = 0;
|
||||
};
|
||||
@ -110,11 +104,6 @@ public:
|
||||
bool setTransform(const utils::eTransform& param) { return true; }
|
||||
bool setSource(const utils::PipeArgs& args) { return true; }
|
||||
bool queueBuffer(int fd, uint32_t offset) { return true; }
|
||||
bool waitForVsync() { return true; }
|
||||
// NullPipe will return by val here as opposed to other Pipes.
|
||||
utils::eOverlayPipeType getOvPipeType() const {
|
||||
return utils::OV_PIPE_TYPE_NULL;
|
||||
}
|
||||
void dump() const {}
|
||||
};
|
||||
|
||||
@ -157,8 +146,6 @@ public:
|
||||
utils::eDest dest = utils::OV_PIPE_ALL);
|
||||
virtual bool queueBuffer(int fd, uint32_t offset,
|
||||
utils::eDest dest = utils::OV_PIPE_ALL);
|
||||
virtual bool waitForVsync(utils::eDest dest = utils::OV_PIPE1);
|
||||
virtual utils::eOverlayPipeType getOvPipeType(utils::eDest dest) const;
|
||||
virtual void dump() const;
|
||||
|
||||
private:
|
||||
@ -615,63 +602,6 @@ bool OverlayImpl<P0, P1, P2>::queueBuffer(int fd, uint32_t offset,
|
||||
return true;
|
||||
}
|
||||
|
||||
template <class P0, class P1, class P2>
|
||||
bool OverlayImpl<P0, P1, P2>::waitForVsync(utils::eDest dest)
|
||||
{
|
||||
OVASSERT(mPipe0 && mPipe1 && mPipe2,
|
||||
"%s: Pipes are null p0=%p p1=%p p2=%p",
|
||||
__FUNCTION__, mPipe0, mPipe1, mPipe2);
|
||||
|
||||
if (utils::OV_PIPE0 & dest) {
|
||||
if(!mPipe0->waitForVsync()) {
|
||||
ALOGE("OverlayImpl p0 failed to waitForVsync");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (utils::OV_PIPE1 & dest) {
|
||||
if(!mPipe1->waitForVsync()) {
|
||||
ALOGE("OverlayImpl p1 failed to waitForVsync");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (utils::OV_PIPE2 & dest) {
|
||||
if(!mPipe2->waitForVsync()) {
|
||||
ALOGE("OverlayImpl p2 failed to waitForVsync");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
template <class P0, class P1, class P2>
|
||||
utils::eOverlayPipeType OverlayImpl<P0, P1, P2>::getOvPipeType(
|
||||
utils::eDest dest) const
|
||||
{
|
||||
OVASSERT(utils::isValidDest(dest), "%s: OverlayImpl invalid dest=%d",
|
||||
__FUNCTION__, dest);
|
||||
|
||||
if (utils::OV_PIPE0 & dest) {
|
||||
OVASSERT(mPipe0, "%s: OverlayImpl pipe0 is null", __FUNCTION__);
|
||||
return mPipe0->getOvPipeType();
|
||||
}
|
||||
|
||||
if (utils::OV_PIPE1 & dest) {
|
||||
OVASSERT(mPipe1, "%s: OverlayImpl pipe1 is null", __FUNCTION__);
|
||||
return mPipe1->getOvPipeType();
|
||||
}
|
||||
|
||||
if (utils::OV_PIPE2 & dest) {
|
||||
OVASSERT(mPipe2, "%s: OverlayImpl pipe2 is null", __FUNCTION__);
|
||||
return mPipe2->getOvPipeType();
|
||||
}
|
||||
|
||||
// Should never get here
|
||||
return utils::OV_PIPE_TYPE_NULL;
|
||||
}
|
||||
|
||||
template <class P0, class P1, class P2>
|
||||
void OverlayImpl<P0, P1, P2>::dump() const
|
||||
{
|
||||
|
@ -221,9 +221,6 @@ public:
|
||||
/* calls wrapper play */
|
||||
bool play(int fd, uint32_t offset);
|
||||
|
||||
/* calls wrapper waitForVsync */
|
||||
bool waitForVsync();
|
||||
|
||||
/* dump state of the object */
|
||||
void dump() const;
|
||||
private:
|
||||
@ -493,15 +490,6 @@ inline bool MdpData::play(int fd, uint32_t offset) {
|
||||
return true;
|
||||
}
|
||||
|
||||
inline bool MdpData::waitForVsync() {
|
||||
if(!mdp_wrapper::waitForVsync(mFd.getFD(), mOvData)){
|
||||
ALOGE("%s failed", __FUNCTION__);
|
||||
dump();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
} // overlay
|
||||
|
||||
#endif // OVERLAY_MDP_H
|
||||
|
@ -268,25 +268,11 @@ enum eMdpFlags {
|
||||
OV_MDP_FLAGS_NONE = 0,
|
||||
OV_MDP_PIPE_SHARE = MDP_OV_PIPE_SHARE,
|
||||
OV_MDP_DEINTERLACE = MDP_DEINTERLACE,
|
||||
OV_MDP_PLAY_NOWAIT = MDP_OV_PLAY_NOWAIT, //deprecated
|
||||
OV_MDP_SECURE_OVERLAY_SESSION = MDP_SECURE_OVERLAY_SESSION,
|
||||
OV_MDP_SOURCE_ROTATED_90 = MDP_SOURCE_ROTATED_90,
|
||||
OV_MDP_MEMORY_ID_TYPE_FB = MDP_MEMORY_ID_TYPE_FB,
|
||||
};
|
||||
|
||||
enum eOverlayPipeType {
|
||||
OV_PIPE_TYPE_NULL,
|
||||
OV_PIPE_TYPE_BYPASS,
|
||||
OV_PIPE_TYPE_GENERIC,
|
||||
OV_PIPE_TYPE_VIDEO_EXT,
|
||||
OV_PIPE_TYPE_M3D_EXTERNAL,
|
||||
OV_PIPE_TYPE_M3D_PRIMARY,
|
||||
OV_PIPE_TYPE_RGB,
|
||||
OV_PIPE_TYPE_S3D_EXTERNAL,
|
||||
OV_PIPE_TYPE_S3D_PRIMARY,
|
||||
OV_PIPE_TYPE_UI_MIRROR
|
||||
};
|
||||
|
||||
enum eZorder {
|
||||
ZORDER_0,
|
||||
ZORDER_1,
|
||||
|
@ -54,12 +54,10 @@ public:
|
||||
bool close();
|
||||
bool commit();
|
||||
bool queueBuffer(int fd, uint32_t offset);
|
||||
bool waitForVsync();
|
||||
bool setCrop(const utils::Dim& d);
|
||||
bool setPosition(const utils::Dim& dim);
|
||||
bool setTransform(const utils::eTransform& param);
|
||||
bool setSource(const utils::PipeArgs& args);
|
||||
utils::eOverlayPipeType getOvPipeType() const;
|
||||
void dump() const;
|
||||
private:
|
||||
overlay::GenericPipe<utils::EXTERNAL> mM3d;
|
||||
@ -86,12 +84,10 @@ public:
|
||||
bool close();
|
||||
bool commit();
|
||||
bool queueBuffer(int fd, uint32_t offset);
|
||||
bool waitForVsync();
|
||||
bool setCrop(const utils::Dim& d);
|
||||
bool setPosition(const utils::Dim& dim);
|
||||
bool setTransform(const utils::eTransform& param);
|
||||
bool setSource(const utils::PipeArgs& args);
|
||||
utils::eOverlayPipeType getOvPipeType() const;
|
||||
void dump() const;
|
||||
private:
|
||||
overlay::GenericPipe<utils::PRIMARY> mM3d;
|
||||
@ -118,12 +114,10 @@ public:
|
||||
bool close();
|
||||
bool commit();
|
||||
bool queueBuffer(int fd, uint32_t offset);
|
||||
bool waitForVsync();
|
||||
bool setCrop(const utils::Dim& d);
|
||||
bool setPosition(const utils::Dim& dim);
|
||||
bool setTransform(const utils::eTransform& param);
|
||||
bool setSource(const utils::PipeArgs& args);
|
||||
utils::eOverlayPipeType getOvPipeType() const;
|
||||
void dump() const;
|
||||
private:
|
||||
overlay::GenericPipe<utils::EXTERNAL> mS3d;
|
||||
@ -150,12 +144,10 @@ public:
|
||||
bool close();
|
||||
bool commit();
|
||||
bool queueBuffer(int fd, uint32_t offset);
|
||||
bool waitForVsync();
|
||||
bool setCrop(const utils::Dim& d);
|
||||
bool setPosition(const utils::Dim& dim);
|
||||
bool setTransform(const utils::eTransform& param);
|
||||
bool setSource(const utils::PipeArgs& args);
|
||||
utils::eOverlayPipeType getOvPipeType() const;
|
||||
void dump() const;
|
||||
private:
|
||||
/* needed for 3D related IOCTL */
|
||||
@ -196,9 +188,6 @@ inline bool M3DExtPipe<CHAN>::queueBuffer(int fd, uint32_t offset) {
|
||||
return mM3d.queueBuffer(fd, offset);
|
||||
}
|
||||
template <int CHAN>
|
||||
inline bool M3DExtPipe<CHAN>::waitForVsync() {
|
||||
return mM3d.waitForVsync(); }
|
||||
template <int CHAN>
|
||||
inline bool M3DExtPipe<CHAN>::setCrop(const utils::Dim& d) {
|
||||
utils::Dim _dim;
|
||||
if(!utils::getCropS3D<CHAN>(d, _dim, mM3Dfmt)){
|
||||
@ -237,10 +226,6 @@ inline bool M3DExtPipe<CHAN>::setSource(const utils::PipeArgs& args)
|
||||
return mM3d.setSource(args);
|
||||
}
|
||||
template <int CHAN>
|
||||
inline utils::eOverlayPipeType M3DExtPipe<CHAN>::getOvPipeType() const {
|
||||
return utils::OV_PIPE_TYPE_M3D_EXTERNAL;
|
||||
}
|
||||
template <int CHAN>
|
||||
inline void M3DExtPipe<CHAN>::dump() const {
|
||||
ALOGE("M3DExtPipe Pipe fmt=%d", mM3Dfmt);
|
||||
mM3d.dump();
|
||||
@ -272,9 +257,6 @@ inline bool M3DPrimaryPipe<CHAN>::queueBuffer(int fd, uint32_t offset) {
|
||||
return mM3d.queueBuffer(fd, offset);
|
||||
}
|
||||
template <int CHAN>
|
||||
inline bool M3DPrimaryPipe<CHAN>::waitForVsync() {
|
||||
return mM3d.waitForVsync(); }
|
||||
template <int CHAN>
|
||||
inline bool M3DPrimaryPipe<CHAN>::setCrop(const utils::Dim& d) {
|
||||
utils::Dim _dim;
|
||||
if(!utils::getCropS3D<CHAN>(d, _dim, mM3Dfmt)){
|
||||
@ -300,10 +282,6 @@ inline bool M3DPrimaryPipe<CHAN>::setSource(const utils::PipeArgs& args)
|
||||
return mM3d.setSource(args);
|
||||
}
|
||||
template <int CHAN>
|
||||
inline utils::eOverlayPipeType M3DPrimaryPipe<CHAN>::getOvPipeType() const {
|
||||
return utils::OV_PIPE_TYPE_M3D_PRIMARY;
|
||||
}
|
||||
template <int CHAN>
|
||||
inline void M3DPrimaryPipe<CHAN>::dump() const {
|
||||
ALOGE("M3DPrimaryPipe Pipe fmt=%d", mM3Dfmt);
|
||||
mM3d.dump();
|
||||
@ -337,9 +315,6 @@ inline bool S3DExtPipe<CHAN>::queueBuffer(int fd, uint32_t offset) {
|
||||
return mS3d.queueBuffer(fd, offset);
|
||||
}
|
||||
template <int CHAN>
|
||||
inline bool S3DExtPipe<CHAN>::waitForVsync() {
|
||||
return mS3d.waitForVsync(); }
|
||||
template <int CHAN>
|
||||
inline bool S3DExtPipe<CHAN>::setCrop(const utils::Dim& d) {
|
||||
utils::Dim _dim;
|
||||
if(!utils::getCropS3D<CHAN>(d, _dim, mS3Dfmt)){
|
||||
@ -371,10 +346,6 @@ inline bool S3DExtPipe<CHAN>::setSource(const utils::PipeArgs& args) {
|
||||
return mS3d.setSource(args);
|
||||
}
|
||||
template <int CHAN>
|
||||
inline utils::eOverlayPipeType S3DExtPipe<CHAN>::getOvPipeType() const {
|
||||
return utils::OV_PIPE_TYPE_S3D_EXTERNAL;
|
||||
}
|
||||
template <int CHAN>
|
||||
inline void S3DExtPipe<CHAN>::dump() const {
|
||||
ALOGE("S3DExtPipe Pipe fmt=%d", mS3Dfmt);
|
||||
mS3d.dump();
|
||||
@ -419,9 +390,6 @@ inline bool S3DPrimaryPipe<CHAN>::queueBuffer(int fd, uint32_t offset) {
|
||||
return mS3d.queueBuffer(fd, offset);
|
||||
}
|
||||
template <int CHAN>
|
||||
inline bool S3DPrimaryPipe<CHAN>::waitForVsync() {
|
||||
return mS3d.waitForVsync(); }
|
||||
template <int CHAN>
|
||||
inline bool S3DPrimaryPipe<CHAN>::setCrop(const utils::Dim& d) {
|
||||
utils::Dim _dim;
|
||||
if(!utils::getCropS3D<CHAN>(d, _dim, mS3Dfmt)){
|
||||
@ -487,10 +455,6 @@ inline bool S3DPrimaryPipe<CHAN>::setSource(const utils::PipeArgs& args)
|
||||
return mS3d.setSource(args);
|
||||
}
|
||||
template <int CHAN>
|
||||
inline utils::eOverlayPipeType S3DPrimaryPipe<CHAN>::getOvPipeType() const {
|
||||
return utils::OV_PIPE_TYPE_S3D_PRIMARY;
|
||||
}
|
||||
template <int CHAN>
|
||||
inline void S3DPrimaryPipe<CHAN>::dump() const {
|
||||
ALOGE("S3DPrimaryPipe Pipe fmt=%d", mS3Dfmt);
|
||||
mS3d.dump();
|
||||
|
@ -63,8 +63,6 @@ public:
|
||||
/* Data APIs */
|
||||
/* queue buffer to the overlay */
|
||||
bool queueBuffer(int fd, uint32_t offset);
|
||||
/* wait for vsync to be done */
|
||||
bool waitForVsync();
|
||||
|
||||
/* return cached startup args */
|
||||
const utils::PipeArgs& getArgs() const;
|
||||
@ -90,9 +88,6 @@ public:
|
||||
/* return Ctrl fd. Used for S3D */
|
||||
int getCtrlFd() const;
|
||||
|
||||
/* Get the overlay pipe type */
|
||||
utils::eOverlayPipeType getOvPipeType() const;
|
||||
|
||||
/* dump the state of the object */
|
||||
void dump() const;
|
||||
private:
|
||||
@ -280,12 +275,6 @@ inline int GenericPipe<PANEL>::getCtrlFd() const {
|
||||
return mCtrlData.ctrl.getFd();
|
||||
}
|
||||
|
||||
template <int PANEL>
|
||||
inline bool GenericPipe<PANEL>::waitForVsync() {
|
||||
OVASSERT(isOpen(), "State is closed, cannot waitForVsync");
|
||||
return mCtrlData.data.waitForVsync();
|
||||
}
|
||||
|
||||
template <int PANEL>
|
||||
inline utils::Dim GenericPipe<PANEL>::getAspectRatio(
|
||||
const utils::Whf& whf) const
|
||||
@ -312,11 +301,6 @@ inline utils::Dim GenericPipe<PANEL>::getCrop() const
|
||||
return mCtrlData.ctrl.getCrop();
|
||||
}
|
||||
|
||||
template <int PANEL>
|
||||
inline utils::eOverlayPipeType GenericPipe<PANEL>::getOvPipeType() const {
|
||||
return utils::OV_PIPE_TYPE_GENERIC;
|
||||
}
|
||||
|
||||
template <int PANEL>
|
||||
void GenericPipe<PANEL>::dump() const
|
||||
{
|
||||
|
@ -50,12 +50,10 @@ public:
|
||||
bool close();
|
||||
bool commit();
|
||||
bool queueBuffer(int fd, uint32_t offset);
|
||||
bool waitForVsync();
|
||||
bool setCrop(const utils::Dim& dim);
|
||||
bool setPosition(const utils::Dim& dim);
|
||||
bool setTransform(const utils::eTransform& param);
|
||||
bool setSource(const utils::PipeArgs& args);
|
||||
utils::eOverlayPipeType getOvPipeType() const;
|
||||
void dump() const;
|
||||
private:
|
||||
overlay::GenericPipe<ovutils::EXTERNAL> mUI;
|
||||
@ -79,8 +77,6 @@ inline bool UIMirrorPipe::commit() { return mUI.commit(); }
|
||||
inline bool UIMirrorPipe::queueBuffer(int fd, uint32_t offset) {
|
||||
return mUI.queueBuffer(fd, offset);
|
||||
}
|
||||
inline bool UIMirrorPipe::waitForVsync() {
|
||||
return mUI.waitForVsync(); }
|
||||
inline bool UIMirrorPipe::setCrop(const utils::Dim& dim) {
|
||||
return mUI.setCrop(dim); }
|
||||
|
||||
@ -162,9 +158,6 @@ inline bool UIMirrorPipe::setSource(const utils::PipeArgs& args) {
|
||||
|
||||
return mUI.setSource(arg);
|
||||
}
|
||||
inline utils::eOverlayPipeType UIMirrorPipe::getOvPipeType() const {
|
||||
return utils::OV_PIPE_TYPE_UI_MIRROR;
|
||||
}
|
||||
inline void UIMirrorPipe::dump() const {
|
||||
ALOGE("UI Mirror Pipe");
|
||||
mUI.dump();
|
||||
|
@ -50,12 +50,10 @@ public:
|
||||
bool close();
|
||||
bool commit();
|
||||
bool queueBuffer(int fd, uint32_t offset);
|
||||
bool waitForVsync();
|
||||
bool setCrop(const utils::Dim& dim);
|
||||
bool setPosition(const utils::Dim& dim);
|
||||
bool setTransform(const utils::eTransform& param);
|
||||
bool setSource(const utils::PipeArgs& args);
|
||||
utils::eOverlayPipeType getOvPipeType() const;
|
||||
void dump() const;
|
||||
private:
|
||||
overlay::GenericPipe<ovutils::EXTERNAL> mVideoExt;
|
||||
@ -74,9 +72,6 @@ inline bool VideoExtPipe::commit() { return mVideoExt.commit(); }
|
||||
inline bool VideoExtPipe::queueBuffer(int fd, uint32_t offset) {
|
||||
return mVideoExt.queueBuffer(fd, offset);
|
||||
}
|
||||
inline bool VideoExtPipe::waitForVsync() {
|
||||
return mVideoExt.waitForVsync();
|
||||
}
|
||||
inline bool VideoExtPipe::setCrop(const utils::Dim& dim) {
|
||||
return mVideoExt.setCrop(dim);
|
||||
}
|
||||
@ -105,9 +100,6 @@ inline bool VideoExtPipe::setSource(const utils::PipeArgs& args) {
|
||||
utils::PipeArgs arg(args);
|
||||
return mVideoExt.setSource(arg);
|
||||
}
|
||||
inline utils::eOverlayPipeType VideoExtPipe::getOvPipeType() const {
|
||||
return utils::OV_PIPE_TYPE_VIDEO_EXT;
|
||||
}
|
||||
inline void VideoExtPipe::dump() const {
|
||||
ALOGE("Video Ext Pipe");
|
||||
mVideoExt.dump();
|
||||
|
Loading…
x
Reference in New Issue
Block a user