Lines Matching refs:ctx
51 void HWCVirtualVDS::init(hwc_context_t *ctx) { in init() argument
53 ctx->mFBUpdate[dpy] = in init()
54 IFBUpdate::getObject(ctx, dpy); in init()
55 ctx->mMDPComp[dpy] = MDPComp::getObject(ctx, dpy); in init()
57 if(ctx->mFBUpdate[dpy]) in init()
58 ctx->mFBUpdate[dpy]->reset(); in init()
59 if(ctx->mMDPComp[dpy]) in init()
60 ctx->mMDPComp[dpy]->reset(); in init()
63 void HWCVirtualVDS::destroy(hwc_context_t *ctx, size_t /*numDisplays*/, in destroy() argument
68 if(ctx->dpyAttr[dpy].connected && (displays[dpy] == NULL)) { in destroy()
69 ctx->dpyAttr[dpy].connected = false; in destroy()
70 ctx->dpyAttr[dpy].isPause = false; in destroy()
72 if(ctx->mFBUpdate[dpy]) { in destroy()
73 delete ctx->mFBUpdate[dpy]; in destroy()
74 ctx->mFBUpdate[dpy] = NULL; in destroy()
76 if(ctx->mMDPComp[dpy]) { in destroy()
77 delete ctx->mMDPComp[dpy]; in destroy()
78 ctx->mMDPComp[dpy] = NULL; in destroy()
85 ctx->mWfdSyncLock.lock(); in destroy()
86 ctx->mWfdSyncLock.signal(); in destroy()
87 ctx->mWfdSyncLock.unlock(); in destroy()
95 hwc_context_t* ctx = (hwc_context_t*)(dev); in prepare() local
99 reset_layer_prop(ctx, dpy, (int)list->numHwLayers - 1); in prepare()
104 ctx->dpyAttr[dpy].xres = fbWidth; in prepare()
105 ctx->dpyAttr[dpy].yres = fbHeight; in prepare()
107 if(ctx->dpyAttr[dpy].connected == false) { in prepare()
108 ctx->dpyAttr[dpy].connected = true; in prepare()
109 ctx->dpyAttr[dpy].isPause = false; in prepare()
112 ctx->dpyAttr[dpy].vsync_period in prepare()
113 = ctx->dpyAttr[HWC_DISPLAY_PRIMARY].vsync_period; in prepare()
114 init(ctx); in prepare()
117 ctx->isPaddingRound = true; in prepare()
119 if(!ctx->dpyAttr[dpy].isPause) { in prepare()
120 ctx->dpyAttr[dpy].isConfiguring = false; in prepare()
121 ctx->dpyAttr[dpy].fd = Writeback::getInstance()->getFbFd(); in prepare()
125 setListStats(ctx, list, dpy); in prepare()
127 if(ctx->mMDPComp[dpy]->prepare(ctx, list) < 0) { in prepare()
129 if(not ctx->mFBUpdate[dpy]->prepareAndValidate(ctx, list, fbZ)) in prepare()
131 ctx->mOverlay->clear(dpy); in prepare()
132 ctx->mLayerRotMap[dpy]->clear(); in prepare()
149 int HWCVirtualVDS::set(hwc_context_t *ctx, hwc_display_contents_1_t *list) { in set() argument
158 if(ctx->dpyAttr[dpy].connected in set()
159 && (!ctx->dpyAttr[dpy].isPause)) in set()
178 hwc_sync(ctx, list, dpy, fd); in set()
180 if (!ctx->mMDPComp[dpy]->draw(ctx, list)) { in set()
190 if (fbLayer->handle && !ctx->mFBUpdate[dpy]->draw(ctx, in set()
198 if(!Overlay::displayCommit(ctx->dpyAttr[dpy].fd)) { in set()
218 void HWCVirtualVDS::pause(hwc_context_t* ctx, int dpy) { in pause() argument
220 Locker::Autolock _l(ctx->mDrawLock); in pause()
221 ctx->dpyAttr[dpy].isActive = true; in pause()
222 ctx->dpyAttr[dpy].isPause = true; in pause()
223 ctx->proc->invalidate(ctx->proc); in pause()
225 usleep(ctx->dpyAttr[HWC_DISPLAY_PRIMARY].vsync_period in pause()
230 void HWCVirtualVDS::resume(hwc_context_t* ctx, int dpy) { in resume() argument
232 Locker::Autolock _l(ctx->mDrawLock); in resume()
233 ctx->dpyAttr[dpy].isConfiguring = true; in resume()
234 ctx->dpyAttr[dpy].isActive = true; in resume()
235 ctx->proc->invalidate(ctx->proc); in resume()
237 usleep(ctx->dpyAttr[HWC_DISPLAY_PRIMARY].vsync_period in resume()
241 Locker::Autolock _l(ctx->mDrawLock); in resume()
242 ctx->dpyAttr[dpy].isPause = false; in resume()
243 ctx->proc->invalidate(ctx->proc); in resume()
254 hwc_context_t* ctx = (hwc_context_t*)(dev); in prepare() local
258 ctx->dpyAttr[dpy].isActive && in prepare()
259 ctx->dpyAttr[dpy].connected && in prepare()
260 canUseMDPforVirtualDisplay(ctx,list)) { in prepare()
261 reset_layer_prop(ctx, dpy, (int)list->numHwLayers - 1); in prepare()
262 if(!ctx->dpyAttr[dpy].isPause) { in prepare()
263 ctx->dpyAttr[dpy].isConfiguring = false; in prepare()
264 setListStats(ctx, list, dpy); in prepare()
265 if(ctx->mMDPComp[dpy]->prepare(ctx, list) < 0) { in prepare()
267 if(not ctx->mFBUpdate[dpy]->prepareAndValidate(ctx, list, fbZ)) in prepare()
269 ctx->mOverlay->clear(dpy); in prepare()
270 ctx->mLayerRotMap[dpy]->clear(); in prepare()
287 int HWCVirtualV4L2::set(hwc_context_t *ctx, hwc_display_contents_1_t *list) { in set() argument
293 if (LIKELY(list) && ctx->dpyAttr[dpy].isActive && in set()
294 ctx->dpyAttr[dpy].connected && in set()
295 (!ctx->dpyAttr[dpy].isPause) && in set()
296 canUseMDPforVirtualDisplay(ctx,list)) { in set()
301 if(ctx->mCopyBit[dpy]) in set()
302 copybitDone = ctx->mCopyBit[dpy]->draw(ctx, list, dpy, &fd); in set()
305 hwc_sync(ctx, list, dpy, fd); in set()
308 if(ctx->mHwcDebug[dpy]) in set()
309 ctx->mHwcDebug[dpy]->dumpLayers(list); in set()
311 if (!ctx->mMDPComp[dpy]->draw(ctx, list)) { in set()
317 ctx->listStats[dpy].extOnlyLayerIndex; in set()
324 hnd = ctx->mCopyBit[dpy]->getCurrentRenderBuffer(); in set()
328 if (!ctx->mFBUpdate[dpy]->draw(ctx, hnd)) { in set()
334 if(!Overlay::displayCommit(ctx->dpyAttr[dpy].fd)) { in set()
353 void HWCVirtualV4L2::pause(hwc_context_t* ctx, int dpy) { in pause() argument
355 Locker::Autolock _l(ctx->mDrawLock); in pause()
356 ctx->dpyAttr[dpy].isActive = true; in pause()
357 ctx->dpyAttr[dpy].isPause = true; in pause()
358 ctx->proc->invalidate(ctx->proc); in pause()
360 usleep(ctx->dpyAttr[HWC_DISPLAY_PRIMARY].vsync_period in pause()
365 Locker::Autolock _l(ctx->mDrawLock); in pause()
367 if (!Overlay::displayCommit(ctx->dpyAttr[dpy].fd)) { in pause()
375 void HWCVirtualV4L2::resume(hwc_context_t* ctx, int dpy){ in resume() argument
380 Locker::Autolock _l(ctx->mDrawLock); in resume()
389 ctx->mVirtualDisplay->configure(); in resume()
391 ctx->dpyAttr[dpy].isConfiguring = true; in resume()
392 ctx->dpyAttr[dpy].isActive = true; in resume()
393 ctx->proc->invalidate(ctx->proc); in resume()
395 usleep(ctx->dpyAttr[HWC_DISPLAY_PRIMARY].vsync_period in resume()
399 Locker::Autolock _l(ctx->mDrawLock); in resume()
400 ctx->dpyAttr[dpy].isPause = false; in resume()
401 ctx->proc->invalidate(ctx->proc); in resume()