Lines Matching refs:ctx
42 static void setup(hwc_context_t* ctx, int dpy) in setup() argument
44 ctx->mFBUpdate[dpy] = IFBUpdate::getObject(ctx, dpy); in setup()
45 ctx->mMDPComp[dpy] = MDPComp::getObject(ctx, dpy); in setup()
48 static void clear(hwc_context_t* ctx, int dpy) in clear() argument
50 if(ctx->mFBUpdate[dpy]) { in clear()
51 delete ctx->mFBUpdate[dpy]; in clear()
52 ctx->mFBUpdate[dpy] = NULL; in clear()
54 if(ctx->mMDPComp[dpy]) { in clear()
55 delete ctx->mMDPComp[dpy]; in clear()
56 ctx->mMDPComp[dpy] = NULL; in clear()
70 static bool getPanelResetStatus(hwc_context_t* ctx, const char* strUdata, int len) in getPanelResetStatus() argument
79 ctx->mPanelResetStatus = true; in getPanelResetStatus()
102 void handle_pause(hwc_context_t* ctx, int dpy) { in handle_pause() argument
103 if(ctx->mHWCVirtual) { in handle_pause()
104 ctx->mHWCVirtual->pause(ctx, dpy); in handle_pause()
109 void handle_resume(hwc_context_t* ctx, int dpy) { in handle_resume() argument
110 if(ctx->mHWCVirtual) { in handle_resume()
111 ctx->mHWCVirtual->resume(ctx, dpy); in handle_resume()
116 static void teardownWfd(hwc_context_t* ctx) { in teardownWfd() argument
121 Locker::Autolock _l(ctx->mDrawLock); in teardownWfd()
122 clear(ctx, HWC_DISPLAY_VIRTUAL); in teardownWfd()
123 ctx->dpyAttr[HWC_DISPLAY_VIRTUAL].connected = false; in teardownWfd()
124 ctx->dpyAttr[HWC_DISPLAY_VIRTUAL].isActive = false; in teardownWfd()
127 ctx->mVirtualDisplay->teardown(); in teardownWfd()
130 if(ctx->mVirtualonExtActive) { in teardownWfd()
133 ctx->proc->hotplug(ctx->proc, HWC_DISPLAY_EXTERNAL, in teardownWfd()
136 Locker::Autolock _l(ctx->mDrawLock); in teardownWfd()
137 ctx->mVirtualonExtActive = false; in teardownWfd()
141 ctx->mWfdSyncLock.lock(); in teardownWfd()
144 ctx->mWfdSyncLock.wait(); in teardownWfd()
148 ctx->mWfdSyncLock.unlock(); in teardownWfd()
151 static void handle_uevent(hwc_context_t* ctx, const char* udata, int len) in handle_uevent() argument
153 bool bpanelReset = getPanelResetStatus(ctx, udata, len); in handle_uevent()
155 ctx->proc->invalidate(ctx->proc); in handle_uevent()
174 if(!ctx->dpyAttr[dpy].connected){ in handle_uevent()
180 Locker::Autolock _l(ctx->mDrawLock); in handle_uevent()
181 clear(ctx, dpy); in handle_uevent()
182 ctx->dpyAttr[dpy].connected = false; in handle_uevent()
183 ctx->dpyAttr[dpy].isActive = false; in handle_uevent()
186 ctx->mExtDisplay->teardown(); in handle_uevent()
188 ctx->mVirtualDisplay->teardown(); in handle_uevent()
194 ctx->mVirtualonExtActive) { in handle_uevent()
197 ctx->proc->hotplug(ctx->proc, HWC_DISPLAY_EXTERNAL, in handle_uevent()
199 ctx->mVirtualonExtActive = false; in handle_uevent()
200 ctx->mQService->onHdmiHotplug((int)ctx->dpyAttr[dpy].connected); in handle_uevent()
207 if(ctx->dpyAttr[dpy].connected) { in handle_uevent()
221 Locker::Autolock _l(ctx->mDrawLock); in handle_uevent()
222 ctx->dpyAttr[dpy].isConfiguring = true; in handle_uevent()
223 ctx->proc->invalidate(ctx->proc); in handle_uevent()
226 usleep(ctx->dpyAttr[HWC_DISPLAY_PRIMARY].vsync_period in handle_uevent()
230 if(ctx->dpyAttr[HWC_DISPLAY_VIRTUAL].connected) { in handle_uevent()
244 !ctx->mVirtualonExtActive)) { in handle_uevent()
245 teardownWfd(ctx); in handle_uevent()
248 ctx->mExtDisplay->configure(); in handle_uevent()
251 Locker::Autolock _l(ctx->mDrawLock); in handle_uevent()
253 ctx->mVirtualonExtActive = true; in handle_uevent()
260 ctx->mVirtualonExtActive = false; in handle_uevent()
263 ctx->mVirtualDisplay->configure(); in handle_uevent()
266 Locker::Autolock _l(ctx->mDrawLock); in handle_uevent()
267 setup(ctx, dpy); in handle_uevent()
268 ctx->dpyAttr[dpy].isPause = false; in handle_uevent()
269 ctx->dpyAttr[dpy].connected = true; in handle_uevent()
270 ctx->dpyAttr[dpy].isConfiguring = true; in handle_uevent()
273 ctx->mVirtualonExtActive) { in handle_uevent()
277 ctx->proc->hotplug(ctx->proc,HWC_DISPLAY_EXTERNAL, in handle_uevent()
279 ctx->mQService->onHdmiHotplug(ctx->dpyAttr[dpy].connected); in handle_uevent()
285 ctx->dpyAttr[HWC_DISPLAY_VIRTUAL].isActive = true; in handle_uevent()
292 handle_pause(ctx, dpy); in handle_uevent()
301 handle_resume(ctx, dpy); in handle_uevent()
316 hwc_context_t * ctx = reinterpret_cast<hwc_context_t *>(param); in uevent_loop() local
327 handle_uevent(ctx, udata, len); in uevent_loop()
333 void init_uevent_thread(hwc_context_t* ctx) in init_uevent_thread() argument
339 ret = pthread_create(&uevent_thread, NULL, uevent_loop, (void*) ctx); in init_uevent_thread()