Lines Matching refs:ctx
88 static int getDpyforExternalDisplay(hwc_context_t *ctx, int dpy) { in getDpyforExternalDisplay() argument
89 if(dpy == HWC_DISPLAY_EXTERNAL && ctx->mVirtualonExtActive) in getDpyforExternalDisplay()
101 hwc_context_t* ctx = (hwc_context_t*)(dev); in hwc_registerProcs() local
102 if(!ctx) { in hwc_registerProcs()
106 ctx->proc = procs; in hwc_registerProcs()
110 init_uevent_thread(ctx); in hwc_registerProcs()
111 init_vsync_thread(ctx); in hwc_registerProcs()
114 static void setPaddingRound(hwc_context_t *ctx, int numDisplays, in setPaddingRound() argument
116 ctx->isPaddingRound = false; in setPaddingRound()
120 if((ctx->mPrevHwLayerCount[i] == 1 or in setPaddingRound()
121 ctx->mPrevHwLayerCount[i] == 0) and in setPaddingRound()
128 ctx->isPaddingRound = true; in setPaddingRound()
130 ctx->mPrevHwLayerCount[i] = (int)list->numHwLayers; in setPaddingRound()
132 ctx->mPrevHwLayerCount[i] = 0; in setPaddingRound()
139 static void setDMAState(hwc_context_t *ctx, int numDisplays, in setDMAState() argument
142 if(ctx->mRotMgr->getNumActiveSessions() == 0) in setDMAState()
159 if (canUseRotator(ctx, dpy) && in setDMAState()
160 has90Transform(layer) && isRotationDoable(ctx, hnd)) { in setDMAState()
161 if(not ctx->mOverlay->isDMAMultiplexingSupported()) { in setDMAState()
162 if(ctx->mOverlay->isPipeTypeAttached( in setDMAState()
164 ctx->isPaddingRound = true; in setDMAState()
179 if(ctx->mExtOrientation || ctx->mBufferMirrorMode) { in setDMAState()
180 if(ctx->mOverlay->isPipeTypeAttached( in setDMAState()
182 ctx->isPaddingRound = true; in setDMAState()
191 static void setNumActiveDisplays(hwc_context_t *ctx, int numDisplays, in setNumActiveDisplays() argument
194 ctx->numActiveDisplays = 0; in setNumActiveDisplays()
204 ctx->numActiveDisplays += 1; in setNumActiveDisplays()
209 static void reset(hwc_context_t *ctx, int numDisplays, in reset() argument
227 if(ctx->mMDPComp[i]) in reset()
228 ctx->mMDPComp[i]->reset(); in reset()
229 if(ctx->mFBUpdate[i]) in reset()
230 ctx->mFBUpdate[i]->reset(); in reset()
231 if(ctx->mCopyBit[i]) in reset()
232 ctx->mCopyBit[i]->reset(); in reset()
233 if(ctx->mLayerRotMap[i]) in reset()
234 ctx->mLayerRotMap[i]->reset(); in reset()
237 ctx->mAD->reset(); in reset()
238 if(ctx->mHWCVirtual) in reset()
239 ctx->mHWCVirtual->destroy(ctx, numDisplays, displays); in reset()
242 static void scaleDisplayFrame(hwc_context_t *ctx, int dpy, in scaleDisplayFrame() argument
244 uint32_t origXres = ctx->dpyAttr[dpy].xres; in scaleDisplayFrame()
245 uint32_t origYres = ctx->dpyAttr[dpy].yres; in scaleDisplayFrame()
246 uint32_t newXres = ctx->dpyAttr[dpy].xres_new; in scaleDisplayFrame()
247 uint32_t newYres = ctx->dpyAttr[dpy].yres_new; in scaleDisplayFrame()
268 hwc_context_t* ctx = (hwc_context_t*)(dev); in hwc_prepare_primary() local
272 ctx->dpyAttr[dpy].isActive) { in hwc_prepare_primary()
274 if (ctx->dpyAttr[dpy].customFBSize && in hwc_prepare_primary()
276 scaleDisplayFrame(ctx, dpy, list); in hwc_prepare_primary()
278 reset_layer_prop(ctx, dpy, (int)list->numHwLayers - 1); in hwc_prepare_primary()
279 setListStats(ctx, list, dpy); in hwc_prepare_primary()
281 fbComp = (ctx->mMDPComp[dpy]->prepare(ctx, list) < 0); in hwc_prepare_primary()
285 if(not ctx->mFBUpdate[dpy]->prepareAndValidate(ctx, list, fbZ)) { in hwc_prepare_primary()
286 ctx->mOverlay->clear(dpy); in hwc_prepare_primary()
287 ctx->mLayerRotMap[dpy]->clear(); in hwc_prepare_primary()
291 if (ctx->mMDP.version < qdutils::MDP_V4_0) { in hwc_prepare_primary()
292 if(ctx->mCopyBit[dpy]) in hwc_prepare_primary()
293 ctx->mCopyBit[dpy]->prepare(ctx, list, dpy); in hwc_prepare_primary()
295 setGPUHint(ctx, list); in hwc_prepare_primary()
303 hwc_context_t* ctx = (hwc_context_t*)(dev); in hwc_prepare_external() local
307 ctx->dpyAttr[dpy].isActive && in hwc_prepare_external()
308 ctx->dpyAttr[dpy].connected) { in hwc_prepare_external()
309 reset_layer_prop(ctx, dpy, (int)list->numHwLayers - 1); in hwc_prepare_external()
310 if(!ctx->dpyAttr[dpy].isPause) { in hwc_prepare_external()
311 ctx->dpyAttr[dpy].isConfiguring = false; in hwc_prepare_external()
312 setListStats(ctx, list, dpy); in hwc_prepare_external()
313 if(ctx->mMDPComp[dpy]->prepare(ctx, list) < 0) { in hwc_prepare_external()
315 if(not ctx->mFBUpdate[dpy]->prepareAndValidate(ctx, list, fbZ)) in hwc_prepare_external()
317 ctx->mOverlay->clear(dpy); in hwc_prepare_external()
318 ctx->mLayerRotMap[dpy]->clear(); in hwc_prepare_external()
339 hwc_context_t* ctx = (hwc_context_t*)(dev); in hwc_prepare() local
342 ctx->mDrawLock.lock(); in hwc_prepare()
344 if (ctx->mPanelResetStatus) { in hwc_prepare()
349 setPaddingRound(ctx, (int)numDisplays, displays); in hwc_prepare()
350 setDMAState(ctx, (int)numDisplays, displays); in hwc_prepare()
351 setNumActiveDisplays(ctx, (int)numDisplays, displays); in hwc_prepare()
352 reset(ctx, (int)numDisplays, displays); in hwc_prepare()
354 ctx->mOverlay->configBegin(); in hwc_prepare()
355 ctx->mRotMgr->configBegin(); in hwc_prepare()
360 int dpy = getDpyforExternalDisplay(ctx, i); in hwc_prepare()
369 if(ctx->mHWCVirtual) in hwc_prepare()
370 ret = ctx->mHWCVirtual->prepare(dev, list); in hwc_prepare()
377 ctx->mOverlay->configDone(); in hwc_prepare()
378 ctx->mRotMgr->configDone(); in hwc_prepare()
389 hwc_context_t* ctx = (hwc_context_t*)(dev); in hwc_eventControl() local
392 if (ctx->vstate.enable == enable) in hwc_eventControl()
394 ret = hwc_vsync_control(ctx, dpy, enable); in hwc_eventControl()
396 ctx->vstate.enable = !!enable; in hwc_eventControl()
403 Locker::Autolock _l(ctx->mDrawLock); in hwc_eventControl()
405 ctx->deviceOrientation = enable; in hwc_eventControl()
419 hwc_context_t* ctx = (hwc_context_t*)(dev); in hwc_setPowerMode() local
422 Locker::Autolock _l(ctx->mDrawLock); in hwc_setPowerMode()
431 ctx->mOverlay->configBegin(); in hwc_setPowerMode()
432 ctx->mOverlay->configDone(); in hwc_setPowerMode()
433 ctx->mRotMgr->clear(); in hwc_setPowerMode()
450 ctx->dpyAttr[dpy].lastPowerMode = value; in hwc_setPowerMode()
453 if(ioctl(ctx->dpyAttr[dpy].fd, FBIOBLANK, value) < 0 ) { in hwc_setPowerMode()
462 ctx->mExtDisplay->setHPD(1); in hwc_setPowerMode()
465 ctx->dpyAttr[dpy].isActive = not(mode == HWC_POWER_MODE_OFF); in hwc_setPowerMode()
469 if(ctx->dpyAttr[HWC_DISPLAY_VIRTUAL].connected) { in hwc_setPowerMode()
472 (not ctx->dpyAttr[dpy].isPause)) { in hwc_setPowerMode()
473 if(!Overlay::displayCommit(ctx->dpyAttr[dpy].fd)) { in hwc_setPowerMode()
478 ctx->dpyAttr[dpy].isActive = not(mode == HWC_POWER_MODE_OFF); in hwc_setPowerMode()
483 if(!Overlay::displayCommit(ctx->dpyAttr[dpy].fd)) { in hwc_setPowerMode()
488 ctx->dpyAttr[dpy].isActive = not(mode == HWC_POWER_MODE_OFF); in hwc_setPowerMode()
502 hwc_context_t* ctx = (hwc_context_t*)(dev); in reset_panel() local
504 if (!ctx->dpyAttr[HWC_DISPLAY_PRIMARY].isActive) { in reset_panel()
506 ctx->mPanelResetStatus = false; in reset_panel()
511 ret = ioctl(ctx->dpyAttr[HWC_DISPLAY_PRIMARY].fd, FBIOBLANK, in reset_panel()
520 ret = ioctl(ctx->dpyAttr[HWC_DISPLAY_PRIMARY].fd, FBIOBLANK, in reset_panel()
521 ctx->dpyAttr[HWC_DISPLAY_PRIMARY].lastPowerMode); in reset_panel()
524 ctx->dpyAttr[HWC_DISPLAY_PRIMARY].lastPowerMode, in reset_panel()
527 hwc_vsync_control(ctx, HWC_DISPLAY_PRIMARY, 1); in reset_panel()
529 ctx->mPanelResetStatus = false; in reset_panel()
536 hwc_context_t* ctx = (hwc_context_t*)(dev); in hwc_query() local
545 if(ctx->mMDP.hasOverlay) { in hwc_query()
581 static int hwc_set_primary(hwc_context_t *ctx, hwc_display_contents_1_t* list) { in hwc_set_primary() argument
585 if (LIKELY(list) && ctx->dpyAttr[dpy].isActive) { in hwc_set_primary()
591 if (ctx->mCopyBit[dpy]) { in hwc_set_primary()
592 if (ctx->mMDP.version < qdutils::MDP_V4_0) in hwc_set_primary()
593 copybitDone = ctx->mCopyBit[dpy]->draw(ctx, list, dpy, &fd); in hwc_set_primary()
595 fd = ctx->mMDPComp[dpy]->drawOverlap(ctx, list); in hwc_set_primary()
618 hwc_sync(ctx, list, dpy, fd); in hwc_set_primary()
621 if(ctx->mHwcDebug[dpy]) in hwc_set_primary()
622 ctx->mHwcDebug[dpy]->dumpLayers(list); in hwc_set_primary()
624 if (!ctx->mMDPComp[dpy]->draw(ctx, list)) { in hwc_set_primary()
629 if(copybitDone && ctx->mMDP.version >= qdutils::MDP_V4_0) { in hwc_set_primary()
630 hnd = ctx->mCopyBit[dpy]->getCurrentRenderBuffer(); in hwc_set_primary()
633 if(isAbcInUse(ctx) == true) { in hwc_set_primary()
634 int index = ctx->listStats[dpy].renderBufIndexforABC; in hwc_set_primary()
640 if (!ctx->mFBUpdate[dpy]->draw(ctx, hnd)) { in hwc_set_primary()
646 int lSplit = getLeftSplit(ctx, dpy); in hwc_set_primary()
648 ctx->listStats[dpy].lRoi.left, in hwc_set_primary()
649 ctx->listStats[dpy].lRoi.top, in hwc_set_primary()
650 ctx->listStats[dpy].lRoi.right - ctx->listStats[dpy].lRoi.left, in hwc_set_primary()
651 ctx->listStats[dpy].lRoi.bottom - ctx->listStats[dpy].lRoi.top); in hwc_set_primary()
654 ctx->listStats[dpy].rRoi.left - lSplit, in hwc_set_primary()
655 ctx->listStats[dpy].rRoi.top, in hwc_set_primary()
656 ctx->listStats[dpy].rRoi.right - ctx->listStats[dpy].rRoi.left, in hwc_set_primary()
657 ctx->listStats[dpy].rRoi.bottom - ctx->listStats[dpy].rRoi.top); in hwc_set_primary()
659 if(!Overlay::displayCommit(ctx->dpyAttr[dpy].fd, lRoi, rRoi)) { in hwc_set_primary()
670 static int hwc_set_external(hwc_context_t *ctx, in hwc_set_external() argument
679 if (LIKELY(list) && ctx->dpyAttr[dpy].isActive && in hwc_set_external()
680 ctx->dpyAttr[dpy].connected && in hwc_set_external()
681 !ctx->dpyAttr[dpy].isPause) { in hwc_set_external()
686 if(ctx->mCopyBit[dpy]) in hwc_set_external()
687 copybitDone = ctx->mCopyBit[dpy]->draw(ctx, list, dpy, &fd); in hwc_set_external()
690 hwc_sync(ctx, list, dpy, fd); in hwc_set_external()
693 if(ctx->mHwcDebug[dpy]) in hwc_set_external()
694 ctx->mHwcDebug[dpy]->dumpLayers(list); in hwc_set_external()
696 if (!ctx->mMDPComp[dpy]->draw(ctx, list)) { in hwc_set_external()
702 ctx->listStats[dpy].extOnlyLayerIndex; in hwc_set_external()
709 hnd = ctx->mCopyBit[dpy]->getCurrentRenderBuffer(); in hwc_set_external()
713 if (!ctx->mFBUpdate[dpy]->draw(ctx, hnd)) { in hwc_set_external()
719 if(!Overlay::displayCommit(ctx->dpyAttr[dpy].fd)) { in hwc_set_external()
734 hwc_context_t* ctx = (hwc_context_t*)(dev); in hwc_set() local
737 int dpy = getDpyforExternalDisplay(ctx, i); in hwc_set()
740 ret = hwc_set_primary(ctx, list); in hwc_set()
743 ret = hwc_set_external(ctx, list); in hwc_set()
746 if(ctx->mHWCVirtual) in hwc_set()
747 ret = ctx->mHWCVirtual->set(ctx, list); in hwc_set()
757 ctx->mVideoTransFlag = false; in hwc_set()
759 ctx->mDrawLock.unlock(); in hwc_set()
766 hwc_context_t* ctx = (hwc_context_t*)(dev); in hwc_getDisplayConfigs() local
767 disp = getDpyforExternalDisplay(ctx, disp); in hwc_getDisplayConfigs()
781 if(ctx->dpyAttr[disp].connected) { in hwc_getDisplayConfigs()
796 hwc_context_t* ctx = (hwc_context_t*)(dev); in hwc_getDisplayAttributes() local
797 disp = getDpyforExternalDisplay(ctx, disp); in hwc_getDisplayAttributes()
799 if( (disp != HWC_DISPLAY_PRIMARY) && !ctx->dpyAttr[disp].connected) { in hwc_getDisplayAttributes()
819 values[i] = ctx->dpyAttr[disp].vsync_period; in hwc_getDisplayAttributes()
822 if (ctx->dpyAttr[disp].customFBSize) in hwc_getDisplayAttributes()
823 values[i] = ctx->dpyAttr[disp].xres_new; in hwc_getDisplayAttributes()
825 values[i] = ctx->dpyAttr[disp].xres; in hwc_getDisplayAttributes()
831 if (ctx->dpyAttr[disp].customFBSize) in hwc_getDisplayAttributes()
832 values[i] = ctx->dpyAttr[disp].yres_new; in hwc_getDisplayAttributes()
834 values[i] = ctx->dpyAttr[disp].yres; in hwc_getDisplayAttributes()
839 values[i] = (int32_t) (ctx->dpyAttr[disp].xdpi*1000.0); in hwc_getDisplayAttributes()
842 values[i] = (int32_t) (ctx->dpyAttr[disp].ydpi*1000.0); in hwc_getDisplayAttributes()
855 hwc_context_t* ctx = (hwc_context_t*)(dev); in hwc_dump() local
856 Locker::Autolock _l(ctx->mDrawLock); in hwc_dump()
859 dumpsys_log(aBuf, " MDPVersion=%d\n", ctx->mMDP.version); in hwc_dump()
860 dumpsys_log(aBuf, " DisplayPanel=%c\n", ctx->mMDP.panel); in hwc_dump()
861 if(ctx->vstate.fakevsync) in hwc_dump()
864 if(ctx->mMDPComp[dpy]) in hwc_dump()
865 ctx->mMDPComp[dpy]->dump(aBuf, ctx); in hwc_dump()
868 ctx->mOverlay->getDump(ovDump, 2048); in hwc_dump()
871 ctx->mRotMgr->getDump(ovDump, 1024); in hwc_dump()