Lines Matching refs:ctx
80 hwc_context_t* ctx = (hwc_context_t*)(dev); in hwc_registerProcs() local
81 if(!ctx) { in hwc_registerProcs()
85 ctx->proc = procs; in hwc_registerProcs()
89 init_uevent_thread(ctx); in hwc_registerProcs()
90 init_vsync_thread(ctx); in hwc_registerProcs()
93 static void setPaddingRound(hwc_context_t *ctx, int numDisplays, in setPaddingRound() argument
95 ctx->isPaddingRound = false; in setPaddingRound()
99 if((ctx->mPrevHwLayerCount[i] == 1 or in setPaddingRound()
100 ctx->mPrevHwLayerCount[i] == 0) and in setPaddingRound()
107 ctx->isPaddingRound = true; in setPaddingRound()
109 ctx->mPrevHwLayerCount[i] = (int)list->numHwLayers; in setPaddingRound()
111 ctx->mPrevHwLayerCount[i] = 0; in setPaddingRound()
118 static void setDMAState(hwc_context_t *ctx, int numDisplays, in setDMAState() argument
121 ctx->isDMAStateChanging = false; in setDMAState()
122 if(ctx->mRotMgr->getNumActiveSessions() == 0) in setDMAState()
139 if (canUseRotator(ctx, dpy) && in setDMAState()
140 (has90Transform(layer) || getRotDownscale(ctx, layer)) in setDMAState()
141 && isRotationDoable(ctx, hnd)) { in setDMAState()
142 if(not (ctx->mOverlay->isDMAMultiplexingSupported() && in setDMAState()
144 if(ctx->mOverlay->isPipeTypeAttached( in setDMAState()
146 ctx->isDMAStateChanging = true; in setDMAState()
161 if(ctx->mExtOrientation || ctx->mBufferMirrorMode) { in setDMAState()
162 if(ctx->mOverlay->isPipeTypeAttached( in setDMAState()
164 ctx->isDMAStateChanging = true; in setDMAState()
173 static void setNumActiveDisplays(hwc_context_t *ctx, int numDisplays, in setNumActiveDisplays() argument
176 ctx->numActiveDisplays = 0; in setNumActiveDisplays()
186 ctx->numActiveDisplays += 1; in setNumActiveDisplays()
191 static bool isHotPluggable(hwc_context_t *ctx, int dpy) { in isHotPluggable() argument
194 ctx->mHDMIDisplay->isHDMIPrimaryDisplay())); in isHotPluggable()
197 static void reset(hwc_context_t *ctx, int numDisplays, in reset() argument
215 if(ctx->mMDPComp[i]) in reset()
216 ctx->mMDPComp[i]->reset(); in reset()
217 if(ctx->mFBUpdate[i]) in reset()
218 ctx->mFBUpdate[i]->reset(); in reset()
219 if(ctx->mCopyBit[i]) in reset()
220 ctx->mCopyBit[i]->reset(); in reset()
221 if(ctx->mLayerRotMap[i]) in reset()
222 ctx->mLayerRotMap[i]->reset(); in reset()
225 ctx->mAD->reset(); in reset()
229 static void scaleDisplayFrame(hwc_context_t *ctx, int dpy, in scaleDisplayFrame() argument
231 uint32_t origXres = ctx->dpyAttr[dpy].xres; in scaleDisplayFrame()
232 uint32_t origYres = ctx->dpyAttr[dpy].yres; in scaleDisplayFrame()
233 uint32_t newXres = ctx->dpyAttr[dpy].xres_new; in scaleDisplayFrame()
234 uint32_t newYres = ctx->dpyAttr[dpy].yres_new; in scaleDisplayFrame()
253 hwc_context_t* ctx = (hwc_context_t*)(dev); in hwc_configure_color_temp() local
261 cool != ctx->mCoolColorTemperatureEnabled) { in hwc_configure_color_temp()
262 ctx->mCoolColorTemperatureEnabled = cool; in hwc_configure_color_temp()
283 hwc_context_t* ctx = (hwc_context_t*)(dev); in hwc_prepare_primary() local
286 if (!ctx->mDefaultModeApplied) in hwc_prepare_primary()
287 applyDefaultMode(ctx); in hwc_prepare_primary()
288 if (LIKELY(list && list->numHwLayers > 1) && ctx->dpyAttr[dpy].connected && in hwc_prepare_primary()
289 (ctx->dpyAttr[dpy].isActive || in hwc_prepare_primary()
290 ctx->mHDMIDisplay->isHDMIPrimaryDisplay()) in hwc_prepare_primary()
291 && !ctx->dpyAttr[dpy].isPause) { in hwc_prepare_primary()
295 if (!ctx->dpyAttr[dpy].isActive) { in hwc_prepare_primary()
300 int cableConnected = ctx->mHDMIDisplay->getConnectedState(); in hwc_prepare_primary()
301 if ((cableConnected == 1) && !ctx->dpyAttr[dpy].connected) { in hwc_prepare_primary()
302 qhwc::handle_online(ctx, dpy); in hwc_prepare_primary()
304 ctx->mHDMIDisplay->activateDisplay(); in hwc_prepare_primary()
305 ctx->dpyAttr[dpy].isActive = true; in hwc_prepare_primary()
308 if (ctx->dpyAttr[dpy].customFBSize && in hwc_prepare_primary()
310 scaleDisplayFrame(ctx, dpy, list); in hwc_prepare_primary()
312 reset_layer_prop(ctx, dpy, (int)list->numHwLayers - 1); in hwc_prepare_primary()
313 setListStats(ctx, list, dpy); in hwc_prepare_primary()
315 fbComp = (ctx->mMDPComp[dpy]->prepare(ctx, list) < 0); in hwc_prepare_primary()
319 if(not ctx->mFBUpdate[dpy]->prepareAndValidate(ctx, list, fbZ)) { in hwc_prepare_primary()
320 ctx->mOverlay->clear(dpy); in hwc_prepare_primary()
321 ctx->mLayerRotMap[dpy]->clear(); in hwc_prepare_primary()
325 if (ctx->mMDP.version < qdutils::MDP_V4_0) { in hwc_prepare_primary()
326 if(ctx->mCopyBit[dpy]) in hwc_prepare_primary()
327 ctx->mCopyBit[dpy]->prepare(ctx, list, dpy); in hwc_prepare_primary()
329 setGPUHint(ctx, list); in hwc_prepare_primary()
337 hwc_context_t* ctx = (hwc_context_t*)(dev); in hwc_prepare_external() local
341 ctx->dpyAttr[dpy].isActive && in hwc_prepare_external()
342 ctx->dpyAttr[dpy].connected) { in hwc_prepare_external()
343 reset_layer_prop(ctx, dpy, (int)list->numHwLayers - 1); in hwc_prepare_external()
344 if(!ctx->dpyAttr[dpy].isPause) { in hwc_prepare_external()
345 ctx->dpyAttr[dpy].isConfiguring = false; in hwc_prepare_external()
346 setListStats(ctx, list, dpy); in hwc_prepare_external()
347 if(ctx->mMDPComp[dpy]->prepare(ctx, list) < 0) { in hwc_prepare_external()
349 if(not ctx->mFBUpdate[dpy]->prepareAndValidate(ctx, list, fbZ)) in hwc_prepare_external()
351 ctx->mOverlay->clear(dpy); in hwc_prepare_external()
352 ctx->mLayerRotMap[dpy]->clear(); in hwc_prepare_external()
373 hwc_context_t* ctx = (hwc_context_t*)(dev); in hwc_prepare() local
375 if (ctx->mPanelResetStatus) { in hwc_prepare()
381 ctx->mDrawLock.lock(); in hwc_prepare()
382 setPaddingRound(ctx, (int)numDisplays, displays); in hwc_prepare()
383 setDMAState(ctx, (int)numDisplays, displays); in hwc_prepare()
384 setNumActiveDisplays(ctx, (int)numDisplays, displays); in hwc_prepare()
385 reset(ctx, (int)numDisplays, displays); in hwc_prepare()
387 ctx->mOverlay->configBegin(); in hwc_prepare()
388 ctx->mRotMgr->configBegin(); in hwc_prepare()
393 resetROI(ctx, dpy); in hwc_prepare()
402 if(ctx->mHWCVirtual) in hwc_prepare()
403 ret = ctx->mHWCVirtual->prepare(dev, list); in hwc_prepare()
410 ctx->mOverlay->configDone(); in hwc_prepare()
411 ctx->mRotMgr->configDone(); in hwc_prepare()
416 if(ctx->mHWCVirtual) in hwc_prepare()
417 ctx->mHWCVirtual->destroy(ctx, numDisplays, displays); in hwc_prepare()
427 hwc_context_t* ctx = (hwc_context_t*)(dev); in hwc_eventControl() local
430 if (ctx->vstate.enable == enable) in hwc_eventControl()
432 ret = hwc_vsync_control(ctx, dpy, enable); in hwc_eventControl()
434 ctx->vstate.enable = !!enable; in hwc_eventControl()
441 Locker::Autolock _l(ctx->mDrawLock); in hwc_eventControl()
443 ctx->deviceOrientation = enable; in hwc_eventControl()
457 hwc_context_t* ctx = (hwc_context_t*)(dev); in hwc_setPowerMode() local
460 Locker::Autolock _l(ctx->mDrawLock); in hwc_setPowerMode()
469 ctx->mOverlay->configBegin(); in hwc_setPowerMode()
470 ctx->mOverlay->configDone(); in hwc_setPowerMode()
471 ctx->mRotMgr->clear(); in hwc_setPowerMode()
490 if(ctx->mHDMIDisplay->isHDMIPrimaryDisplay()) { in hwc_setPowerMode()
491 if(ctx->dpyAttr[dpy].connected) { in hwc_setPowerMode()
497 (!Overlay::displayCommit(ctx->dpyAttr[dpy].fd))) { in hwc_setPowerMode()
503 if(ioctl(ctx->dpyAttr[dpy].fd, FBIOBLANK, value) < 0 ) { in hwc_setPowerMode()
509 if(mode == HWC_POWER_MODE_NORMAL && !ctx->mHPDEnabled) { in hwc_setPowerMode()
512 ctx->mHDMIDisplay->setHPD(1); in hwc_setPowerMode()
513 ctx->mHPDEnabled = true; in hwc_setPowerMode()
516 ctx->dpyAttr[dpy].isActive = not(mode == HWC_POWER_MODE_OFF); in hwc_setPowerMode()
521 if(ctx->dpyAttr[HWC_DISPLAY_VIRTUAL].connected) { in hwc_setPowerMode()
524 (not ctx->dpyAttr[dpy].isPause)) { in hwc_setPowerMode()
525 if(!Overlay::displayCommit(ctx->dpyAttr[dpy].fd)) { in hwc_setPowerMode()
530 ctx->dpyAttr[dpy].isActive = not(mode == HWC_POWER_MODE_OFF); in hwc_setPowerMode()
535 if(!Overlay::displayCommit(ctx->dpyAttr[dpy].fd)) { in hwc_setPowerMode()
540 ctx->dpyAttr[dpy].isActive = not(mode == HWC_POWER_MODE_OFF); in hwc_setPowerMode()
557 hwc_context_t* ctx = (hwc_context_t*)(dev); in reset_panel() local
559 if (!ctx->dpyAttr[HWC_DISPLAY_PRIMARY].isActive) { in reset_panel()
561 ctx->mPanelResetStatus = false; in reset_panel()
578 hwc_vsync_control(ctx, HWC_DISPLAY_PRIMARY, 1); in reset_panel()
580 ctx->mPanelResetStatus = false; in reset_panel()
587 hwc_context_t* ctx = (hwc_context_t*)(dev); in hwc_query() local
596 if(ctx->mMDP.hasOverlay) { in hwc_query()
619 static int hwc_set_primary(hwc_context_t *ctx, hwc_display_contents_1_t* list) { in hwc_set_primary() argument
623 if (LIKELY(list) && ctx->dpyAttr[dpy].isActive in hwc_set_primary()
624 && !ctx->dpyAttr[dpy].isPause) { in hwc_set_primary()
630 if (ctx->mCopyBit[dpy]) { in hwc_set_primary()
631 if (ctx->mMDP.version < qdutils::MDP_V4_0) in hwc_set_primary()
632 copybitDone = ctx->mCopyBit[dpy]->draw(ctx, list, dpy, &fd); in hwc_set_primary()
634 fd = ctx->mMDPComp[dpy]->drawOverlap(ctx, list); in hwc_set_primary()
638 hwc_sync(ctx, list, dpy, fd); in hwc_set_primary()
641 if(ctx->mHwcDebug[dpy]) in hwc_set_primary()
642 ctx->mHwcDebug[dpy]->dumpLayers(list); in hwc_set_primary()
644 if (!ctx->mMDPComp[dpy]->draw(ctx, list)) { in hwc_set_primary()
652 if(copybitDone && ctx->mMDP.version >= qdutils::MDP_V4_0) { in hwc_set_primary()
653 hnd = ctx->mCopyBit[dpy]->getCurrentRenderBuffer(); in hwc_set_primary()
656 if(isAbcInUse(ctx) == true) { in hwc_set_primary()
657 int index = ctx->listStats[dpy].renderBufIndexforABC; in hwc_set_primary()
663 if (!ctx->mFBUpdate[dpy]->draw(ctx, hnd)) { in hwc_set_primary()
673 (isDisplaySplit(ctx, dpy) ? getLeftSplit(ctx, dpy) : 0); in hwc_set_primary()
675 ctx->listStats[dpy].lRoi.left, in hwc_set_primary()
676 ctx->listStats[dpy].lRoi.top, in hwc_set_primary()
677 ctx->listStats[dpy].lRoi.right - ctx->listStats[dpy].lRoi.left, in hwc_set_primary()
678 ctx->listStats[dpy].lRoi.bottom - ctx->listStats[dpy].lRoi.top); in hwc_set_primary()
681 ctx->listStats[dpy].rRoi.left - lSplit, in hwc_set_primary()
682 ctx->listStats[dpy].rRoi.top, in hwc_set_primary()
683 ctx->listStats[dpy].rRoi.right - ctx->listStats[dpy].rRoi.left, in hwc_set_primary()
684 ctx->listStats[dpy].rRoi.bottom - ctx->listStats[dpy].rRoi.top); in hwc_set_primary()
686 if(!Overlay::displayCommit(ctx->dpyAttr[dpy].fd, lRoi, rRoi)) { in hwc_set_primary()
697 static int hwc_set_external(hwc_context_t *ctx, in hwc_set_external() argument
706 if (LIKELY(list) && ctx->dpyAttr[dpy].isActive && in hwc_set_external()
707 ctx->dpyAttr[dpy].connected && in hwc_set_external()
708 !ctx->dpyAttr[dpy].isPause) { in hwc_set_external()
713 if(ctx->mCopyBit[dpy]) in hwc_set_external()
714 copybitDone = ctx->mCopyBit[dpy]->draw(ctx, list, dpy, &fd); in hwc_set_external()
717 hwc_sync(ctx, list, dpy, fd); in hwc_set_external()
720 if(ctx->mHwcDebug[dpy]) in hwc_set_external()
721 ctx->mHwcDebug[dpy]->dumpLayers(list); in hwc_set_external()
723 if (!ctx->mMDPComp[dpy]->draw(ctx, list)) { in hwc_set_external()
730 hnd = ctx->mCopyBit[dpy]->getCurrentRenderBuffer(); in hwc_set_external()
734 if (!ctx->mFBUpdate[dpy]->draw(ctx, hnd)) { in hwc_set_external()
740 if(!Overlay::displayCommit(ctx->dpyAttr[dpy].fd)) { in hwc_set_external()
755 hwc_context_t* ctx = (hwc_context_t*)(dev); in hwc_set() local
760 ret = hwc_set_primary(ctx, list); in hwc_set()
763 ret = hwc_set_external(ctx, list); in hwc_set()
766 if(ctx->mHWCVirtual) in hwc_set()
767 ret = ctx->mHWCVirtual->set(ctx, list); in hwc_set()
777 ctx->mVideoTransFlag = false; in hwc_set()
779 ctx->mDrawLock.unlock(); in hwc_set()
785 hwc_context_t* ctx = (hwc_context_t*)(dev); in hwc_getDisplayConfigs() local
787 Locker::Autolock _l(ctx->mDrawLock); in hwc_getDisplayConfigs()
788 bool hotPluggable = isHotPluggable(ctx, disp); in hwc_getDisplayConfigs()
791 if ((hotPluggable || isVirtualDisplay) && !ctx->dpyAttr[disp].connected) { in hwc_getDisplayConfigs()
804 ctx->mHDMIDisplay->getDisplayConfigs(configs, numConfigs); in hwc_getDisplayConfigs()
806 if(ctx->mColorMode->getNumModes() > 0) { in hwc_getDisplayConfigs()
807 *numConfigs = ctx->mColorMode->getNumModes(); in hwc_getDisplayConfigs()
818 ctx->mHDMIDisplay->getDisplayConfigs(configs, numConfigs); in hwc_getDisplayConfigs()
831 hwc_context_t* ctx = (hwc_context_t*)(dev); in hwc_getDisplayAttributes() local
833 Locker::Autolock _l(ctx->mDrawLock); in hwc_getDisplayAttributes()
834 bool hotPluggable = isHotPluggable(ctx, disp); in hwc_getDisplayAttributes()
837 if ((hotPluggable || isVirtualDisplay) && !ctx->dpyAttr[disp].connected) { in hwc_getDisplayAttributes()
845 ret = ctx->mHDMIDisplay->getAttrForConfig(config, xres, yres, refresh); in hwc_getDisplayAttributes()
857 hotPluggable ? refresh : ctx->dpyAttr[disp].vsync_period; in hwc_getDisplayAttributes()
860 if (ctx->dpyAttr[disp].customFBSize) in hwc_getDisplayAttributes()
861 values[i] = ctx->dpyAttr[disp].xres_new; in hwc_getDisplayAttributes()
863 values[i] = hotPluggable ? xres : ctx->dpyAttr[disp].xres; in hwc_getDisplayAttributes()
869 if (ctx->dpyAttr[disp].customFBSize) in hwc_getDisplayAttributes()
870 values[i] = ctx->dpyAttr[disp].yres_new; in hwc_getDisplayAttributes()
872 values[i] = hotPluggable ? yres : ctx->dpyAttr[disp].yres; in hwc_getDisplayAttributes()
877 values[i] = (int32_t) (ctx->dpyAttr[disp].xdpi*1000.0); in hwc_getDisplayAttributes()
880 values[i] = (int32_t) (ctx->dpyAttr[disp].ydpi*1000.0); in hwc_getDisplayAttributes()
883 values[i] = ctx->mColorMode->getModeForIndex(config); in hwc_getDisplayAttributes()
896 hwc_context_t* ctx = (hwc_context_t*)(dev); in hwc_dump() local
897 Locker::Autolock _l(ctx->mDrawLock); in hwc_dump()
900 dumpsys_log(aBuf, " MDPVersion=%d\n", ctx->mMDP.version); in hwc_dump()
901 dumpsys_log(aBuf, " DisplayPanel=%c\n", ctx->mMDP.panel); in hwc_dump()
903 ctx->dpyAttr[HWC_DISPLAY_PRIMARY].dynRefreshRate); in hwc_dump()
905 if(ctx->mMDPComp[dpy]) in hwc_dump()
906 ctx->mMDPComp[dpy]->dump(aBuf, ctx); in hwc_dump()
909 ctx->mOverlay->getDump(ovDump, 2048); in hwc_dump()
912 ctx->mRotMgr->getDump(ovDump, 1024); in hwc_dump()
924 hwc_context_t* ctx = (hwc_context_t*)(dev); in hwc_getActiveConfig() local
926 Locker::Autolock _l(ctx->mDrawLock); in hwc_getActiveConfig()
927 bool hotPluggable = isHotPluggable(ctx, disp); in hwc_getActiveConfig()
930 if ((hotPluggable || isVirtualDisplay) && !ctx->dpyAttr[disp].connected) { in hwc_getActiveConfig()
938 return ctx->mColorMode->getActiveModeIndex(); in hwc_getActiveConfig()
943 return ctx->mHDMIDisplay->getActiveConfig(); in hwc_getActiveConfig()
948 hwc_context_t* ctx = (hwc_context_t*)(dev); in hwc_setActiveConfig() local
950 Locker::Autolock _l(ctx->mDrawLock); in hwc_setActiveConfig()
951 bool hotPluggable = isHotPluggable(ctx, disp); in hwc_setActiveConfig()
954 if ((hotPluggable || isVirtualDisplay) && !ctx->dpyAttr[disp].connected) { in hwc_setActiveConfig()
962 return ctx->mColorMode->applyModeByIndex(index); in hwc_setActiveConfig()
968 return ctx->mHDMIDisplay->setActiveConfig(index); in hwc_setActiveConfig()