Lines Matching refs:ctx
72 hwc_context_t* ctx = (hwc_context_t*)(dev); in hwc_registerProcs() local
73 if(!ctx) { in hwc_registerProcs()
77 ctx->proc = procs; in hwc_registerProcs()
81 init_uevent_thread(ctx); in hwc_registerProcs()
82 init_vsync_thread(ctx); in hwc_registerProcs()
86 static void reset(hwc_context_t *ctx, int numDisplays, in reset() argument
88 memset(ctx->listStats, 0, sizeof(ctx->listStats)); in reset()
102 if(ctx->mFBUpdate[i]) in reset()
103 ctx->mFBUpdate[i]->reset(); in reset()
104 if(ctx->mCopyBit[i]) in reset()
105 ctx->mCopyBit[i]->reset(); in reset()
106 if(ctx->mLayerRotMap[i]) in reset()
107 ctx->mLayerRotMap[i]->reset(); in reset()
112 static void reset_layer_prop(hwc_context_t* ctx, int dpy, int numAppLayers) { in reset_layer_prop() argument
113 if(ctx->layerProp[dpy]) { in reset_layer_prop()
114 delete[] ctx->layerProp[dpy]; in reset_layer_prop()
115 ctx->layerProp[dpy] = NULL; in reset_layer_prop()
117 ctx->layerProp[dpy] = new LayerProp[numAppLayers]; in reset_layer_prop()
120 static int display_commit(hwc_context_t *ctx, int dpy) { in display_commit() argument
121 int fbFd = ctx->dpyAttr[dpy].fd; in display_commit()
139 hwc_context_t* ctx = (hwc_context_t*)(dev); in hwc_prepare_primary() local
141 if(UNLIKELY(!ctx->mBasePipeSetup)) in hwc_prepare_primary()
142 setupBasePipe(ctx); in hwc_prepare_primary()
144 ctx->dpyAttr[dpy].isActive) { in hwc_prepare_primary()
145 reset_layer_prop(ctx, dpy, list->numHwLayers - 1); in hwc_prepare_primary()
149 setListStats(ctx, list, dpy); in hwc_prepare_primary()
150 int fbZOrder = ctx->mMDPComp[dpy]->prepare(ctx, list); in hwc_prepare_primary()
152 ctx->mFBUpdate[dpy]->prepare(ctx, list, fbZOrder); in hwc_prepare_primary()
168 hwc_context_t* ctx = (hwc_context_t*)(dev); in hwc_prepare_external() local
171 ctx->dpyAttr[dpy].isActive && in hwc_prepare_external()
172 ctx->dpyAttr[dpy].connected) { in hwc_prepare_external()
173 reset_layer_prop(ctx, dpy, list->numHwLayers - 1); in hwc_prepare_external()
176 if(!ctx->dpyAttr[dpy].isPause) { in hwc_prepare_external()
178 ctx->mExtDispConfiguring = false; in hwc_prepare_external()
179 setListStats(ctx, list, dpy); in hwc_prepare_external()
180 int fbZOrder = ctx->mMDPComp[dpy]->prepare(ctx, list); in hwc_prepare_external()
182 ctx->mFBUpdate[dpy]->prepare(ctx, list, fbZOrder); in hwc_prepare_external()
212 hwc_context_t* ctx = (hwc_context_t*)(dev); in hwc_prepare() local
213 Locker::Autolock _l(ctx->mBlankLock); in hwc_prepare()
214 reset(ctx, numDisplays, displays); in hwc_prepare()
216 ctx->mOverlay->configBegin(); in hwc_prepare()
217 ctx->mRotMgr->configBegin(); in hwc_prepare()
218 ctx->mNeedsRotator = false; in hwc_prepare()
237 ctx->mOverlay->configDone(); in hwc_prepare()
238 ctx->mRotMgr->configDone(); in hwc_prepare()
247 hwc_context_t* ctx = (hwc_context_t*)(dev); in hwc_eventControl() local
248 Locker::Autolock _l(ctx->mBlankLock); in hwc_eventControl()
249 if(!ctx->dpyAttr[dpy].isActive) { in hwc_eventControl()
257 if (ctx->vstate.enable == enable) in hwc_eventControl()
259 ret = hwc_vsync_control(ctx, dpy, enable); in hwc_eventControl()
261 ctx->vstate.enable = !!enable; in hwc_eventControl()
274 hwc_context_t* ctx = (hwc_context_t*)(dev); in hwc_blank() local
276 Locker::Autolock _l(ctx->mBlankLock); in hwc_blank()
284 ctx->mOverlay->configBegin(); in hwc_blank()
285 ctx->mOverlay->configDone(); in hwc_blank()
286 ctx->mRotMgr->clear(); in hwc_blank()
291 ret = ioctl(ctx->dpyAttr[dpy].fd, FBIOBLANK, in hwc_blank()
294 ret = ioctl(ctx->dpyAttr[dpy].fd, FBIOBLANK,FB_BLANK_UNBLANK); in hwc_blank()
302 if (display_commit(ctx, dpy) < 0) { in hwc_blank()
315 ctx->mExtDisplay->setHPD(1); in hwc_blank()
317 ctx->dpyAttr[dpy].isActive = !blank; in hwc_blank()
332 hwc_context_t* ctx = (hwc_context_t*)(dev); in hwc_query() local
341 if(ctx->mMDP.hasOverlay) in hwc_query()
353 static int hwc_set_primary(hwc_context_t *ctx, hwc_display_contents_1_t* list) { in hwc_set_primary() argument
358 if (LIKELY(list) && ctx->dpyAttr[dpy].isActive) { in hwc_set_primary()
363 if(ctx->mCopyBit[dpy]) in hwc_set_primary()
364 copybitDone = ctx->mCopyBit[dpy]->draw(ctx, list, dpy, &fd); in hwc_set_primary()
366 hwc_sync(ctx, list, dpy, fd); in hwc_set_primary()
368 if (!ctx->mMDPComp[dpy]->draw(ctx, list)) { in hwc_set_primary()
377 hnd = ctx->mCopyBit[dpy]->getCurrentRenderBuffer(); in hwc_set_primary()
381 if (!ctx->mFBUpdate[dpy]->draw(ctx, hnd)) { in hwc_set_primary()
387 if (display_commit(ctx, dpy) < 0) { in hwc_set_primary()
397 static int hwc_set_external(hwc_context_t *ctx, in hwc_set_external() argument
402 Locker::Autolock _l(ctx->mExtSetLock); in hwc_set_external()
404 if (LIKELY(list) && ctx->dpyAttr[dpy].isActive && in hwc_set_external()
405 !ctx->dpyAttr[dpy].isPause && in hwc_set_external()
406 ctx->dpyAttr[dpy].connected) { in hwc_set_external()
411 if(ctx->mCopyBit[dpy]) in hwc_set_external()
412 copybitDone = ctx->mCopyBit[dpy]->draw(ctx, list, dpy, &fd); in hwc_set_external()
415 hwc_sync(ctx, list, dpy, fd); in hwc_set_external()
417 if (!ctx->mMDPComp[dpy]->draw(ctx, list)) { in hwc_set_external()
424 hnd = ctx->mCopyBit[dpy]->getCurrentRenderBuffer(); in hwc_set_external()
428 if (!ctx->mFBUpdate[dpy]->draw(ctx, hnd)) { in hwc_set_external()
434 if (display_commit(ctx, dpy) < 0) { in hwc_set_external()
444 static int hwc_set_virtual(hwc_context_t *ctx, in hwc_set_virtual() argument
465 hwc_context_t* ctx = (hwc_context_t*)(dev); in hwc_set() local
466 Locker::Autolock _l(ctx->mBlankLock); in hwc_set()
471 ret = hwc_set_primary(ctx, list); in hwc_set()
474 ret = hwc_set_external(ctx, list, i); in hwc_set()
477 ret = hwc_set_virtual(ctx, list, i); in hwc_set()
493 hwc_context_t* ctx = (hwc_context_t*)(dev); in hwc_getDisplayConfigs() local
506 if(ctx->dpyAttr[HWC_DISPLAY_EXTERNAL].connected) { in hwc_getDisplayConfigs()
521 hwc_context_t* ctx = (hwc_context_t*)(dev); in hwc_getDisplayAttributes() local
523 if(disp == HWC_DISPLAY_EXTERNAL && !ctx->dpyAttr[disp].connected) { in hwc_getDisplayAttributes()
543 values[i] = ctx->dpyAttr[disp].vsync_period; in hwc_getDisplayAttributes()
546 values[i] = ctx->dpyAttr[disp].xres; in hwc_getDisplayAttributes()
548 ctx->dpyAttr[disp].xres); in hwc_getDisplayAttributes()
551 values[i] = ctx->dpyAttr[disp].yres; in hwc_getDisplayAttributes()
553 ctx->dpyAttr[disp].yres); in hwc_getDisplayAttributes()
556 values[i] = (int32_t) (ctx->dpyAttr[disp].xdpi*1000.0); in hwc_getDisplayAttributes()
559 values[i] = (int32_t) (ctx->dpyAttr[disp].ydpi*1000.0); in hwc_getDisplayAttributes()
572 hwc_context_t* ctx = (hwc_context_t*)(dev); in hwc_dump() local
575 dumpsys_log(aBuf, " MDPVersion=%d\n", ctx->mMDP.version); in hwc_dump()
576 dumpsys_log(aBuf, " DisplayPanel=%c\n", ctx->mMDP.panel); in hwc_dump()
578 if(ctx->mMDPComp[dpy]) in hwc_dump()
579 ctx->mMDPComp[dpy]->dump(aBuf); in hwc_dump()
582 ctx->mOverlay->getDump(ovDump, 2048); in hwc_dump()
585 ctx->mRotMgr->getDump(ovDump, 2048); in hwc_dump()