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 if(ctx->mVDSEnabled) { in teardownWfd()
142 ctx->mWfdSyncLock.lock(); in teardownWfd()
145 ctx->mWfdSyncLock.wait(); in teardownWfd()
149 ctx->mWfdSyncLock.unlock(); in teardownWfd()
155 usleep(ctx->dpyAttr[HWC_DISPLAY_PRIMARY].vsync_period in teardownWfd()
160 static void handle_uevent(hwc_context_t* ctx, const char* udata, int len) in handle_uevent() argument
162 bool bpanelReset = getPanelResetStatus(ctx, udata, len); in handle_uevent()
164 ctx->proc->invalidate(ctx->proc); in handle_uevent()
183 if(!ctx->dpyAttr[dpy].connected){ in handle_uevent()
189 Locker::Autolock _l(ctx->mDrawLock); in handle_uevent()
190 clear(ctx, dpy); in handle_uevent()
191 ctx->dpyAttr[dpy].connected = false; in handle_uevent()
192 ctx->dpyAttr[dpy].isActive = false; in handle_uevent()
195 ctx->mExtDisplay->teardown(); in handle_uevent()
197 ctx->mVirtualDisplay->teardown(); in handle_uevent()
203 ctx->mVirtualonExtActive) { in handle_uevent()
206 ctx->proc->hotplug(ctx->proc, HWC_DISPLAY_EXTERNAL, in handle_uevent()
208 ctx->mVirtualonExtActive = false; in handle_uevent()
215 if(ctx->dpyAttr[dpy].connected) { in handle_uevent()
229 Locker::Autolock _l(ctx->mDrawLock); in handle_uevent()
230 ctx->dpyAttr[dpy].isConfiguring = true; in handle_uevent()
231 ctx->proc->invalidate(ctx->proc); in handle_uevent()
234 usleep(ctx->dpyAttr[HWC_DISPLAY_PRIMARY].vsync_period in handle_uevent()
238 if(ctx->dpyAttr[HWC_DISPLAY_VIRTUAL].connected) { in handle_uevent()
252 !ctx->mVirtualonExtActive)) { in handle_uevent()
253 teardownWfd(ctx); in handle_uevent()
256 ctx->mExtDisplay->configure(); in handle_uevent()
259 Locker::Autolock _l(ctx->mDrawLock); in handle_uevent()
261 ctx->mVirtualonExtActive = true; in handle_uevent()
268 ctx->mVirtualonExtActive = false; in handle_uevent()
271 ctx->mVirtualDisplay->configure(); in handle_uevent()
274 Locker::Autolock _l(ctx->mDrawLock); in handle_uevent()
275 setup(ctx, dpy); in handle_uevent()
276 ctx->dpyAttr[dpy].isPause = false; in handle_uevent()
277 ctx->dpyAttr[dpy].connected = true; in handle_uevent()
278 ctx->dpyAttr[dpy].isConfiguring = true; in handle_uevent()
281 ctx->mVirtualonExtActive) { in handle_uevent()
285 ctx->proc->hotplug(ctx->proc,HWC_DISPLAY_EXTERNAL, in handle_uevent()
292 ctx->dpyAttr[HWC_DISPLAY_VIRTUAL].isActive = true; in handle_uevent()
299 handle_pause(ctx, dpy); in handle_uevent()
308 handle_resume(ctx, dpy); in handle_uevent()
323 hwc_context_t * ctx = reinterpret_cast<hwc_context_t *>(param); in uevent_loop() local
334 handle_uevent(ctx, udata, len); in uevent_loop()
340 void init_uevent_thread(hwc_context_t* ctx) in init_uevent_thread() argument
346 ret = pthread_create(&uevent_thread, NULL, uevent_loop, (void*) ctx); in init_uevent_thread()