Lines Matching refs:ctx

78 static int getDpyforExternalDisplay(hwc_context_t *ctx, int dpy) {  in getDpyforExternalDisplay()  argument
79 if(dpy == HWC_DISPLAY_EXTERNAL && ctx->mVirtualonExtActive) in getDpyforExternalDisplay()
91 hwc_context_t* ctx = (hwc_context_t*)(dev); in hwc_registerProcs() local
92 if(!ctx) { in hwc_registerProcs()
96 ctx->proc = procs; in hwc_registerProcs()
100 init_uevent_thread(ctx); in hwc_registerProcs()
101 init_vsync_thread(ctx); in hwc_registerProcs()
104 static void setPaddingRound(hwc_context_t *ctx, int numDisplays, in setPaddingRound() argument
106 ctx->isPaddingRound = false; in setPaddingRound()
110 if((ctx->mPrevHwLayerCount[i] == 1 or in setPaddingRound()
111 ctx->mPrevHwLayerCount[i] == 0) and in setPaddingRound()
118 ctx->isPaddingRound = true; in setPaddingRound()
120 ctx->mPrevHwLayerCount[i] = (int)list->numHwLayers; in setPaddingRound()
122 ctx->mPrevHwLayerCount[i] = 0; in setPaddingRound()
129 static void setDMAState(hwc_context_t *ctx, int numDisplays, in setDMAState() argument
132 if(ctx->mRotMgr->getNumActiveSessions() == 0) in setDMAState()
149 if (UNLIKELY(isYuvBuffer(hnd)) && canUseRotator(ctx, dpy) && in setDMAState()
152 if(ctx->mOverlay->isPipeTypeAttached( in setDMAState()
154 ctx->isPaddingRound = true; in setDMAState()
169 if(ctx->mExtOrientation || ctx->mBufferMirrorMode) { in setDMAState()
170 if(ctx->mOverlay->isPipeTypeAttached( in setDMAState()
172 ctx->isPaddingRound = true; in setDMAState()
181 static void setNumActiveDisplays(hwc_context_t *ctx, int numDisplays, in setNumActiveDisplays() argument
184 ctx->numActiveDisplays = 0; in setNumActiveDisplays()
194 ctx->numActiveDisplays += 1; in setNumActiveDisplays()
199 static void reset(hwc_context_t *ctx, int numDisplays, in reset() argument
214 ctx->mPrevHwLayerCount[i] = (int)list->numHwLayers; in reset()
216 ctx->mPrevHwLayerCount[i] = 0; in reset()
219 if(ctx->mFBUpdate[i]) in reset()
220 ctx->mFBUpdate[i]->reset(); in reset()
221 if(ctx->mCopyBit[i]) in reset()
222 ctx->mCopyBit[i]->reset(); in reset()
223 if(ctx->mLayerRotMap[i]) in reset()
224 ctx->mLayerRotMap[i]->reset(); in reset()
227 ctx->mAD->reset(); in reset()
229 if(ctx->mHWCVirtual) in reset()
230 ctx->mHWCVirtual->destroy(ctx, numDisplays, displays); in reset()
237 static void scaleDisplayFrame(hwc_context_t *ctx, int dpy, in scaleDisplayFrame() argument
239 uint32_t origXres = ctx->dpyAttr[dpy].xres_orig; in scaleDisplayFrame()
240 uint32_t origYres = ctx->dpyAttr[dpy].yres_orig; in scaleDisplayFrame()
241 uint32_t fakeXres = ctx->dpyAttr[dpy].xres; in scaleDisplayFrame()
242 uint32_t fakeYres = ctx->dpyAttr[dpy].yres; in scaleDisplayFrame()
270 hwc_context_t* ctx = (hwc_context_t*)(dev); in hwc_prepare_primary() local
274 ctx->dpyAttr[dpy].isActive) { in hwc_prepare_primary()
276 if (ctx->dpyAttr[dpy].customFBSize) in hwc_prepare_primary()
277 scaleDisplayFrame(ctx, dpy, list); in hwc_prepare_primary()
279 reset_layer_prop(ctx, dpy, (int)list->numHwLayers - 1); in hwc_prepare_primary()
280 setListStats(ctx, list, dpy); in hwc_prepare_primary()
282 fbComp = (ctx->mMDPComp[dpy]->prepare(ctx, list) < 0); in hwc_prepare_primary()
286 if(not ctx->mFBUpdate[dpy]->prepareAndValidate(ctx, list, fbZ)) { in hwc_prepare_primary()
287 ctx->mOverlay->clear(dpy); in hwc_prepare_primary()
288 ctx->mLayerRotMap[dpy]->clear(); in hwc_prepare_primary()
292 if (ctx->mMDP.version < qdutils::MDP_V4_0) { in hwc_prepare_primary()
293 if(ctx->mCopyBit[dpy]) in hwc_prepare_primary()
294 ctx->mCopyBit[dpy]->prepare(ctx, list, dpy); in hwc_prepare_primary()
296 setGPUHint(ctx, list); in hwc_prepare_primary()
304 hwc_context_t* ctx = (hwc_context_t*)(dev); in hwc_prepare_external() local
308 ctx->dpyAttr[dpy].isActive && in hwc_prepare_external()
309 ctx->dpyAttr[dpy].connected) { in hwc_prepare_external()
310 reset_layer_prop(ctx, dpy, (int)list->numHwLayers - 1); in hwc_prepare_external()
311 if(!ctx->dpyAttr[dpy].isPause) { in hwc_prepare_external()
312 ctx->dpyAttr[dpy].isConfiguring = false; in hwc_prepare_external()
313 setListStats(ctx, list, dpy); in hwc_prepare_external()
314 if(ctx->mMDPComp[dpy]->prepare(ctx, list) < 0) { in hwc_prepare_external()
316 if(not ctx->mFBUpdate[dpy]->prepareAndValidate(ctx, list, fbZ)) in hwc_prepare_external()
318 ctx->mOverlay->clear(dpy); in hwc_prepare_external()
319 ctx->mLayerRotMap[dpy]->clear(); in hwc_prepare_external()
340 hwc_context_t* ctx = (hwc_context_t*)(dev); in hwc_prepare() local
342 if (ctx->mPanelResetStatus) { in hwc_prepare()
348 ctx->mDrawLock.lock(); in hwc_prepare()
349 setPaddingRound(ctx,numDisplays,displays); in hwc_prepare()
350 setDMAState(ctx,numDisplays,displays); in hwc_prepare()
351 setNumActiveDisplays(ctx,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()
461 ctx->mOverlay->configBegin(); in hwc_setPowerMode()
462 ctx->mOverlay->configDone(); in hwc_setPowerMode()
463 ctx->mRotMgr->clear(); in hwc_setPowerMode()
469 if(ioctl(ctx->dpyAttr[dpy].fd, FBIOBLANK, value) < 0 ) { in hwc_setPowerMode()
478 ctx->mExtDisplay->setHPD(1); in hwc_setPowerMode()
481 ctx->dpyAttr[dpy].isActive = not(mode == HWC_POWER_MODE_OFF); in hwc_setPowerMode()
485 if(ctx->dpyAttr[HWC_DISPLAY_VIRTUAL].connected) { in hwc_setPowerMode()
488 (not ctx->dpyAttr[dpy].isPause)) { in hwc_setPowerMode()
489 if(!Overlay::displayCommit(ctx->dpyAttr[dpy].fd)) { in hwc_setPowerMode()
494 ctx->dpyAttr[dpy].isActive = not(mode == HWC_POWER_MODE_OFF); in hwc_setPowerMode()
499 if(!Overlay::displayCommit(ctx->dpyAttr[dpy].fd)) { in hwc_setPowerMode()
504 ctx->dpyAttr[dpy].isActive = not(mode == HWC_POWER_MODE_OFF); in hwc_setPowerMode()
518 hwc_context_t* ctx = (hwc_context_t*)(dev); in reset_panel() local
520 if (!ctx->dpyAttr[HWC_DISPLAY_PRIMARY].isActive) { in reset_panel()
522 ctx->mPanelResetStatus = false; in reset_panel()
539 hwc_vsync_control(ctx, HWC_DISPLAY_PRIMARY, 1); in reset_panel()
541 ctx->mPanelResetStatus = false; in reset_panel()
548 hwc_context_t* ctx = (hwc_context_t*)(dev); in hwc_query() local
557 if(ctx->mMDP.hasOverlay) { in hwc_query()
579 static int hwc_set_primary(hwc_context_t *ctx, hwc_display_contents_1_t* list) { in hwc_set_primary() argument
583 if (LIKELY(list) && ctx->dpyAttr[dpy].isActive) { in hwc_set_primary()
588 if(ctx->mCopyBit[dpy]) in hwc_set_primary()
589 copybitDone = ctx->mCopyBit[dpy]->draw(ctx, list, dpy, &fd); in hwc_set_primary()
591 hwc_sync(ctx, list, dpy, fd); in hwc_set_primary()
594 if(ctx->mHwcDebug[dpy]) in hwc_set_primary()
595 ctx->mHwcDebug[dpy]->dumpLayers(list); in hwc_set_primary()
597 if (!ctx->mMDPComp[dpy]->draw(ctx, list)) { in hwc_set_primary()
605 if(copybitDone && ctx->mMDP.version >= qdutils::MDP_V4_0) { in hwc_set_primary()
606 hnd = ctx->mCopyBit[dpy]->getCurrentRenderBuffer(); in hwc_set_primary()
610 if (!ctx->mFBUpdate[dpy]->draw(ctx, hnd)) { in hwc_set_primary()
616 int lSplit = getLeftSplit(ctx, dpy); in hwc_set_primary()
618 ctx->listStats[dpy].lRoi.left, in hwc_set_primary()
619 ctx->listStats[dpy].lRoi.top, in hwc_set_primary()
620 ctx->listStats[dpy].lRoi.right - ctx->listStats[dpy].lRoi.left, in hwc_set_primary()
621 ctx->listStats[dpy].lRoi.bottom - ctx->listStats[dpy].lRoi.top); in hwc_set_primary()
624 ctx->listStats[dpy].rRoi.left - lSplit, in hwc_set_primary()
625 ctx->listStats[dpy].rRoi.top, in hwc_set_primary()
626 ctx->listStats[dpy].rRoi.right - ctx->listStats[dpy].rRoi.left, in hwc_set_primary()
627 ctx->listStats[dpy].rRoi.bottom - ctx->listStats[dpy].rRoi.top); in hwc_set_primary()
629 if(!Overlay::displayCommit(ctx->dpyAttr[dpy].fd, lRoi, rRoi)) { in hwc_set_primary()
640 static int hwc_set_external(hwc_context_t *ctx, in hwc_set_external() argument
649 if (LIKELY(list) && ctx->dpyAttr[dpy].isActive && in hwc_set_external()
650 ctx->dpyAttr[dpy].connected && in hwc_set_external()
651 !ctx->dpyAttr[dpy].isPause) { in hwc_set_external()
656 if(ctx->mCopyBit[dpy]) in hwc_set_external()
657 copybitDone = ctx->mCopyBit[dpy]->draw(ctx, list, dpy, &fd); in hwc_set_external()
660 hwc_sync(ctx, list, dpy, fd); in hwc_set_external()
663 if(ctx->mHwcDebug[dpy]) in hwc_set_external()
664 ctx->mHwcDebug[dpy]->dumpLayers(list); in hwc_set_external()
666 if (!ctx->mMDPComp[dpy]->draw(ctx, list)) { in hwc_set_external()
672 ctx->listStats[dpy].extOnlyLayerIndex; in hwc_set_external()
679 hnd = ctx->mCopyBit[dpy]->getCurrentRenderBuffer(); in hwc_set_external()
683 if (!ctx->mFBUpdate[dpy]->draw(ctx, hnd)) { in hwc_set_external()
689 if(!Overlay::displayCommit(ctx->dpyAttr[dpy].fd)) { in hwc_set_external()
704 hwc_context_t* ctx = (hwc_context_t*)(dev); in hwc_set() local
707 int dpy = getDpyforExternalDisplay(ctx, i); in hwc_set()
710 ret = hwc_set_primary(ctx, list); in hwc_set()
713 ret = hwc_set_external(ctx, list); in hwc_set()
716 if(ctx->mHWCVirtual) in hwc_set()
717 ret = ctx->mHWCVirtual->set(ctx, list); in hwc_set()
727 ctx->mVideoTransFlag = false; in hwc_set()
729 ctx->mDrawLock.unlock(); in hwc_set()
736 hwc_context_t* ctx = (hwc_context_t*)(dev); in hwc_getDisplayConfigs() local
737 disp = getDpyforExternalDisplay(ctx, disp); in hwc_getDisplayConfigs()
751 if(ctx->dpyAttr[disp].connected) { in hwc_getDisplayConfigs()
766 hwc_context_t* ctx = (hwc_context_t*)(dev); in hwc_getDisplayAttributes() local
767 disp = getDpyforExternalDisplay(ctx, disp); in hwc_getDisplayAttributes()
769 if( (disp != HWC_DISPLAY_PRIMARY) && !ctx->dpyAttr[disp].connected) { in hwc_getDisplayAttributes()
789 values[i] = ctx->dpyAttr[disp].vsync_period; in hwc_getDisplayAttributes()
792 values[i] = ctx->dpyAttr[disp].xres; in hwc_getDisplayAttributes()
794 ctx->dpyAttr[disp].xres); in hwc_getDisplayAttributes()
797 values[i] = ctx->dpyAttr[disp].yres; in hwc_getDisplayAttributes()
799 ctx->dpyAttr[disp].yres); in hwc_getDisplayAttributes()
802 values[i] = (int32_t) (ctx->dpyAttr[disp].xdpi*1000.0); in hwc_getDisplayAttributes()
805 values[i] = (int32_t) (ctx->dpyAttr[disp].ydpi*1000.0); in hwc_getDisplayAttributes()
818 hwc_context_t* ctx = (hwc_context_t*)(dev); in hwc_dump() local
819 Locker::Autolock _l(ctx->mDrawLock); in hwc_dump()
822 dumpsys_log(aBuf, " MDPVersion=%d\n", ctx->mMDP.version); in hwc_dump()
823 dumpsys_log(aBuf, " DisplayPanel=%c\n", ctx->mMDP.panel); in hwc_dump()
825 if(ctx->mMDPComp[dpy]) in hwc_dump()
826 ctx->mMDPComp[dpy]->dump(aBuf, ctx); in hwc_dump()
829 ctx->mOverlay->getDump(ovDump, 2048); in hwc_dump()
832 ctx->mRotMgr->getDump(ovDump, 1024); in hwc_dump()