hwc: Enable sync-pt for rotator on B-family
Enable sync-pt for rotator on B-family. The already existing MSMFB_BUF_SYNC ioctl is used, with an extra member for session_id from rotator. Change-Id: Ib0ef6b1bc5cf1e6437090a217d7f731a3440f84b
This commit is contained in:
committed by
Gerrit - the friendly Code Review server
parent
dd29d9f238
commit
e9b5a8f04d
@@ -903,16 +903,11 @@ int hwc_sync(hwc_context_t *ctx, hwc_display_contents_1_t* list, int dpy,
|
||||
int count = 0;
|
||||
int releaseFd = -1;
|
||||
int fbFd = -1;
|
||||
int rotFd = -1;
|
||||
bool swapzero = false;
|
||||
int mdpVersion = qdutils::MDPVersion::getInstance().getMDPVersion();
|
||||
|
||||
struct mdp_buf_sync data;
|
||||
memset(&data, 0, sizeof(data));
|
||||
//Until B-family supports sync for rotator
|
||||
#ifdef MDSS_TARGET
|
||||
data.flags = MDP_BUF_SYNC_FLAG_WAIT;
|
||||
#endif
|
||||
data.acq_fen_fd = acquireFd;
|
||||
data.rel_fen_fd = &releaseFd;
|
||||
|
||||
@@ -921,34 +916,37 @@ int hwc_sync(hwc_context_t *ctx, hwc_display_contents_1_t* list, int dpy,
|
||||
if(atoi(property) == 0)
|
||||
swapzero = true;
|
||||
}
|
||||
|
||||
bool isExtAnimating = false;
|
||||
if(dpy)
|
||||
isExtAnimating = ctx->listStats[dpy].isDisplayAnimating;
|
||||
|
||||
//Send acquireFenceFds to rotator
|
||||
#ifdef MDSS_TARGET
|
||||
//TODO B-family
|
||||
#else
|
||||
//A-family
|
||||
int rotFd = ctx->mRotMgr->getRotDevFd();
|
||||
struct msm_rotator_buf_sync rotData;
|
||||
|
||||
for(uint32_t i = 0; i < ctx->mLayerRotMap[dpy]->getCount(); i++) {
|
||||
int rotFd = ctx->mRotMgr->getRotDevFd();
|
||||
int rotReleaseFd = -1;
|
||||
struct mdp_buf_sync rotData;
|
||||
memset(&rotData, 0, sizeof(rotData));
|
||||
int& acquireFenceFd =
|
||||
ctx->mLayerRotMap[dpy]->getLayer(i)->acquireFenceFd;
|
||||
rotData.acq_fen_fd = acquireFenceFd;
|
||||
rotData.acq_fen_fd =
|
||||
&ctx->mLayerRotMap[dpy]->getLayer(i)->acquireFenceFd;
|
||||
rotData.rel_fen_fd = &rotReleaseFd; //driver to populate this
|
||||
rotData.session_id = ctx->mLayerRotMap[dpy]->getRot(i)->getSessId();
|
||||
ioctl(rotFd, MSM_ROTATOR_IOCTL_BUFFER_SYNC, &rotData);
|
||||
close(acquireFenceFd);
|
||||
int ret = 0;
|
||||
ret = ioctl(rotFd, MSMFB_BUFFER_SYNC, &rotData);
|
||||
if(ret < 0) {
|
||||
ALOGE("%s: ioctl MSMFB_BUFFER_SYNC failed for rot sync, err=%s",
|
||||
__FUNCTION__, strerror(errno));
|
||||
} else {
|
||||
close(ctx->mLayerRotMap[dpy]->getLayer(i)->acquireFenceFd);
|
||||
//For MDP to wait on.
|
||||
acquireFenceFd = dup(rotData.rel_fen_fd);
|
||||
ctx->mLayerRotMap[dpy]->getLayer(i)->acquireFenceFd =
|
||||
dup(rotReleaseFd);
|
||||
//A buffer is free to be used by producer as soon as its copied to
|
||||
//rotator.
|
||||
//rotator
|
||||
ctx->mLayerRotMap[dpy]->getLayer(i)->releaseFenceFd =
|
||||
rotData.rel_fen_fd;
|
||||
rotReleaseFd;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
//Accumulate acquireFenceFds for MDP
|
||||
for(uint32_t i = 0; i < list->numHwLayers; i++) {
|
||||
@@ -1022,14 +1020,8 @@ int hwc_sync(hwc_context_t *ctx, hwc_display_contents_1_t* list, int dpy,
|
||||
if (ctx->mCopyBit[dpy])
|
||||
ctx->mCopyBit[dpy]->setReleaseFd(releaseFd);
|
||||
|
||||
#ifdef MDSS_TARGET
|
||||
//TODO When B is implemented remove #ifdefs from here
|
||||
//The API called applies to RotMem buffers
|
||||
#else
|
||||
//A-family
|
||||
//Signals when MDP finishes reading rotator buffers.
|
||||
ctx->mLayerRotMap[dpy]->setReleaseFd(releaseFd);
|
||||
#endif
|
||||
|
||||
// if external is animating, close the relaseFd
|
||||
if(isExtAnimating) {
|
||||
|
||||
@@ -174,11 +174,10 @@ void RotMgr::getDump(char *buf, size_t len) {
|
||||
}
|
||||
|
||||
int RotMgr::getRotDevFd() {
|
||||
//2nd check just in case
|
||||
if(mRotDevFd < 0 && Rotator::getRotatorHwType() == Rotator::TYPE_MDP) {
|
||||
mRotDevFd = ::open("/dev/msm_rotator", O_RDWR, 0);
|
||||
if(mRotDevFd < 0 && Rotator::getRotatorHwType() == Rotator::TYPE_MDSS) {
|
||||
mRotDevFd = ::open("/dev/graphics/fb0", O_RDWR, 0);
|
||||
if(mRotDevFd < 0) {
|
||||
ALOGE("%s failed to open rotator device", __FUNCTION__);
|
||||
ALOGE("%s failed to open fb0", __FUNCTION__);
|
||||
}
|
||||
}
|
||||
return mRotDevFd;
|
||||
|
||||
@@ -237,11 +237,11 @@ public:
|
||||
* Expects a NULL terminated buffer of big enough size.
|
||||
*/
|
||||
void getDump(char *buf, size_t len);
|
||||
int getRotDevFd(); //Called on A-fam only
|
||||
int getRotDevFd();
|
||||
private:
|
||||
overlay::Rotator *mRot[MAX_ROT_SESS];
|
||||
int mUseCount;
|
||||
int mRotDevFd; //A-fam
|
||||
int mRotDevFd;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user