Lines Matching refs:ctx
62 void HWCVirtualVDS::init(hwc_context_t *ctx) { in init() argument
64 ctx->mFBUpdate[dpy] = in init()
65 IFBUpdate::getObject(ctx, dpy); in init()
66 ctx->mMDPComp[dpy] = MDPComp::getObject(ctx, dpy); in init()
68 if(ctx->mFBUpdate[dpy]) in init()
69 ctx->mFBUpdate[dpy]->reset(); in init()
70 if(ctx->mMDPComp[dpy]) in init()
71 ctx->mMDPComp[dpy]->reset(); in init()
74 void HWCVirtualVDS::destroy(hwc_context_t *ctx, size_t /*numDisplays*/, in destroy() argument
79 if(ctx->dpyAttr[dpy].connected && (displays[dpy] == NULL)) { in destroy()
80 ctx->dpyAttr[dpy].connected = false; in destroy()
81 ctx->dpyAttr[dpy].isPause = false; in destroy()
83 if(ctx->mFBUpdate[dpy]) { in destroy()
84 delete ctx->mFBUpdate[dpy]; in destroy()
85 ctx->mFBUpdate[dpy] = NULL; in destroy()
87 if(ctx->mMDPComp[dpy]) { in destroy()
88 delete ctx->mMDPComp[dpy]; in destroy()
89 ctx->mMDPComp[dpy] = NULL; in destroy()
96 ctx->mWfdSyncLock.lock(); in destroy()
97 ctx->mWfdSyncLock.signal(); in destroy()
98 ctx->mWfdSyncLock.unlock(); in destroy()
106 hwc_context_t* ctx = (hwc_context_t*)(dev); in prepare() local
110 reset_layer_prop(ctx, dpy, (int)list->numHwLayers - 1); in prepare()
115 ctx->dpyAttr[dpy].xres = fbWidth; in prepare()
116 ctx->dpyAttr[dpy].yres = fbHeight; in prepare()
118 if(ctx->dpyAttr[dpy].connected == false) { in prepare()
119 ctx->dpyAttr[dpy].connected = true; in prepare()
120 ctx->dpyAttr[dpy].isPause = false; in prepare()
123 ctx->dpyAttr[dpy].vsync_period in prepare()
124 = ctx->dpyAttr[HWC_DISPLAY_PRIMARY].vsync_period; in prepare()
125 init(ctx); in prepare()
130 if(!ctx->dpyAttr[dpy].isPause) { in prepare()
131 ctx->dpyAttr[dpy].isConfiguring = false; in prepare()
132 ctx->dpyAttr[dpy].fd = Writeback::getInstance()->getFbFd(); in prepare()
136 setListStats(ctx, list, dpy); in prepare()
138 if(ctx->mMDPComp[dpy]->prepare(ctx, list) < 0) { in prepare()
140 if(not ctx->mFBUpdate[dpy]->prepareAndValidate(ctx, list, fbZ)) in prepare()
142 ctx->mOverlay->clear(dpy); in prepare()
143 ctx->mLayerRotMap[dpy]->clear(); in prepare()
161 int HWCVirtualVDS::set(hwc_context_t *ctx, hwc_display_contents_1_t *list) { in set() argument
170 if(ctx->dpyAttr[dpy].connected in set()
171 && (!ctx->dpyAttr[dpy].isPause)) in set()
190 hwc_sync(ctx, list, dpy, fd); in set()
193 if(ctx->mHwcDebug[dpy]) in set()
194 ctx->mHwcDebug[dpy]->dumpLayers(list); in set()
196 if (!ctx->mMDPComp[dpy]->draw(ctx, list)) { in set()
206 if (fbLayer->handle && !ctx->mFBUpdate[dpy]->draw(ctx, in set()
214 if(!Overlay::displayCommit(ctx->dpyAttr[dpy].fd)) { in set()
247 void HWCVirtualVDS::pause(hwc_context_t* ctx, int dpy) { in pause() argument
249 Locker::Autolock _l(ctx->mDrawLock); in pause()
250 ctx->dpyAttr[dpy].isActive = true; in pause()
251 ctx->dpyAttr[dpy].isPause = true; in pause()
252 ctx->proc->invalidate(ctx->proc); in pause()
254 usleep(ctx->dpyAttr[HWC_DISPLAY_PRIMARY].vsync_period in pause()
259 Locker::Autolock _l(ctx->mDrawLock); in pause()
261 if (!Overlay::displayCommit(ctx->dpyAttr[dpy].fd)) { in pause()
265 ctx->proc->invalidate(ctx->proc); in pause()
270 void HWCVirtualVDS::resume(hwc_context_t* ctx, int dpy) { in resume() argument
272 Locker::Autolock _l(ctx->mDrawLock); in resume()
273 ctx->dpyAttr[dpy].isConfiguring = true; in resume()
274 ctx->dpyAttr[dpy].isActive = true; in resume()
275 ctx->proc->invalidate(ctx->proc); in resume()
277 usleep(ctx->dpyAttr[HWC_DISPLAY_PRIMARY].vsync_period in resume()
281 Locker::Autolock _l(ctx->mDrawLock); in resume()
282 ctx->dpyAttr[dpy].isPause = false; in resume()
283 ctx->proc->invalidate(ctx->proc); in resume()
294 hwc_context_t* ctx = (hwc_context_t*)(dev); in prepare() local
298 ctx->dpyAttr[dpy].isActive && in prepare()
299 ctx->dpyAttr[dpy].connected) { in prepare()
300 reset_layer_prop(ctx, dpy, (int)list->numHwLayers - 1); in prepare()
301 if(!ctx->dpyAttr[dpy].isPause) { in prepare()
302 ctx->dpyAttr[dpy].isConfiguring = false; in prepare()
303 setListStats(ctx, list, dpy); in prepare()
304 if(ctx->mMDPComp[dpy]->prepare(ctx, list) < 0) { in prepare()
306 if(not ctx->mFBUpdate[dpy]->prepareAndValidate(ctx, list, fbZ)) in prepare()
308 ctx->mOverlay->clear(dpy); in prepare()
309 ctx->mLayerRotMap[dpy]->clear(); in prepare()
326 int HWCVirtualV4L2::set(hwc_context_t *ctx, hwc_display_contents_1_t *list) { in set() argument
332 if (LIKELY(list) && ctx->dpyAttr[dpy].isActive && in set()
333 ctx->dpyAttr[dpy].connected && in set()
334 !ctx->dpyAttr[dpy].isPause) { in set()
339 if(ctx->mCopyBit[dpy]) in set()
340 copybitDone = ctx->mCopyBit[dpy]->draw(ctx, list, dpy, &fd); in set()
343 hwc_sync(ctx, list, dpy, fd); in set()
346 if(ctx->mHwcDebug[dpy]) in set()
347 ctx->mHwcDebug[dpy]->dumpLayers(list); in set()
349 if (!ctx->mMDPComp[dpy]->draw(ctx, list)) { in set()
355 ctx->listStats[dpy].extOnlyLayerIndex; in set()
362 hnd = ctx->mCopyBit[dpy]->getCurrentRenderBuffer(); in set()
366 if (!ctx->mFBUpdate[dpy]->draw(ctx, hnd)) { in set()
372 if(!Overlay::displayCommit(ctx->dpyAttr[dpy].fd)) { in set()
391 void HWCVirtualV4L2::pause(hwc_context_t* ctx, int dpy) { in pause() argument
393 Locker::Autolock _l(ctx->mDrawLock); in pause()
394 ctx->dpyAttr[dpy].isActive = true; in pause()
395 ctx->dpyAttr[dpy].isPause = true; in pause()
396 ctx->proc->invalidate(ctx->proc); in pause()
398 usleep(ctx->dpyAttr[HWC_DISPLAY_PRIMARY].vsync_period in pause()
403 Locker::Autolock _l(ctx->mDrawLock); in pause()
405 if (!Overlay::displayCommit(ctx->dpyAttr[dpy].fd)) { in pause()
413 void HWCVirtualV4L2::resume(hwc_context_t* ctx, int dpy){ in resume() argument
418 Locker::Autolock _l(ctx->mDrawLock); in resume()
427 ctx->mVirtualDisplay->configure(); in resume()
429 ctx->dpyAttr[dpy].isConfiguring = true; in resume()
430 ctx->dpyAttr[dpy].isActive = true; in resume()
431 ctx->proc->invalidate(ctx->proc); in resume()
433 usleep(ctx->dpyAttr[HWC_DISPLAY_PRIMARY].vsync_period in resume()
437 Locker::Autolock _l(ctx->mDrawLock); in resume()
438 ctx->dpyAttr[dpy].isPause = false; in resume()
439 ctx->proc->invalidate(ctx->proc); in resume()