summaryrefslogtreecommitdiff
path: root/src/lib/ecore_drm2/ecore_drm2_fb.c
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2017-06-09 14:20:05 -0400
committerChris Michael <cp.michael@samsung.com>2017-06-09 14:20:05 -0400
commitbbd18510d690cfc02c20e36850a0aea75fd4e4a0 (patch)
tree78b703385c87acc9d2c61e726fd806090f0443e0 /src/lib/ecore_drm2/ecore_drm2_fb.c
parentde12621c900177b99fd05684f2e101cea9e628f3 (diff)
ecore-drm2: Remove #ifdef HAVE_ATOMIC_DRM
As we now use static_libs/libdrm for compiling ecore-drm2, we can remove the atomic #ifdefs as we can run-time check this now. Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to '')
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_fb.c55
1 files changed, 29 insertions, 26 deletions
diff --git a/src/lib/ecore_drm2/ecore_drm2_fb.c b/src/lib/ecore_drm2/ecore_drm2_fb.c
index c6683f4d3d..56b397ece8 100644
--- a/src/lib/ecore_drm2/ecore_drm2_fb.c
+++ b/src/lib/ecore_drm2/ecore_drm2_fb.c
@@ -248,11 +248,12 @@ _ecore_drm2_fb_buffer_release(Ecore_Drm2_Output *output, Ecore_Drm2_Output_State
248 if (output->release_cb) output->release_cb(output->release_data, s->fb); 248 if (output->release_cb) output->release_cb(output->release_data, s->fb);
249 _ecore_drm2_fb_deref(s->fb); 249 _ecore_drm2_fb_deref(s->fb);
250 s->fb = NULL; 250 s->fb = NULL;
251#ifdef HAVE_ATOMIC_DRM 251 if (_ecore_drm2_use_atomic)
252 if (s->atomic_req) 252 {
253 sym_drmModeAtomicFree(s->atomic_req); 253 if (s->atomic_req)
254 s->atomic_req = NULL; 254 sym_drmModeAtomicFree(s->atomic_req);
255#endif 255 s->atomic_req = NULL;
256 }
256} 257}
257 258
258EAPI Eina_Bool 259EAPI Eina_Bool
@@ -268,21 +269,22 @@ ecore_drm2_fb_flip_complete(Ecore_Drm2_Output *output)
268 output->current.fb = output->pending.fb; 269 output->current.fb = output->pending.fb;
269 output->pending.fb = NULL; 270 output->pending.fb = NULL;
270 271
271#ifdef HAVE_ATOMIC_DRM 272 if (_ecore_drm2_use_atomic)
272 Eina_List *l, *ll; 273 {
273 Ecore_Drm2_Plane *plane; 274 Eina_List *l, *ll;
275 Ecore_Drm2_Plane *plane;
274 276
275 output->current.atomic_req = output->pending.atomic_req; 277 output->current.atomic_req = output->pending.atomic_req;
276 output->pending.atomic_req = NULL; 278 output->pending.atomic_req = NULL;
277 279
278 EINA_LIST_FOREACH_SAFE(output->planes, l, ll, plane) 280 EINA_LIST_FOREACH_SAFE(output->planes, l, ll, plane)
279 { 281 {
280 if (!plane->dead) continue; 282 if (!plane->dead) continue;
281 output->planes = eina_list_remove_list(output->planes, l); 283 output->planes = eina_list_remove_list(output->planes, l);
282 free(plane); 284 free(plane);
285 }
283 } 286 }
284 287
285#endif
286 EINA_LIST_FREE(output->fbs, fb) 288 EINA_LIST_FREE(output->fbs, fb)
287 _ecore_drm2_fb_deref(fb); 289 _ecore_drm2_fb_deref(fb);
288 output->fbs = NULL; 290 output->fbs = NULL;
@@ -293,7 +295,6 @@ ecore_drm2_fb_flip_complete(Ecore_Drm2_Output *output)
293Eina_Bool 295Eina_Bool
294_fb_atomic_flip_test(Ecore_Drm2_Output *output) 296_fb_atomic_flip_test(Ecore_Drm2_Output *output)
295{ 297{
296#ifdef HAVE_ATOMIC_DRM
297 int ret = 0; 298 int ret = 0;
298 Eina_List *l; 299 Eina_List *l;
299 Ecore_Drm2_Crtc_State *cstate; 300 Ecore_Drm2_Crtc_State *cstate;
@@ -303,6 +304,8 @@ _fb_atomic_flip_test(Ecore_Drm2_Output *output)
303 uint32_t flags = DRM_MODE_ATOMIC_NONBLOCK | DRM_MODE_ATOMIC_ALLOW_MODESET | 304 uint32_t flags = DRM_MODE_ATOMIC_NONBLOCK | DRM_MODE_ATOMIC_ALLOW_MODESET |
304 DRM_MODE_ATOMIC_TEST_ONLY; 305 DRM_MODE_ATOMIC_TEST_ONLY;
305 306
307 if (!_ecore_drm2_use_atomic) return EINA_FALSE;
308
306 req = sym_drmModeAtomicAlloc(); 309 req = sym_drmModeAtomicAlloc();
307 if (!req) return EINA_FALSE; 310 if (!req) return EINA_FALSE;
308 311
@@ -401,7 +404,6 @@ _fb_atomic_flip_test(Ecore_Drm2_Output *output)
401err: 404err:
402 DBG("Failed Atomic Test: %m"); 405 DBG("Failed Atomic Test: %m");
403 sym_drmModeAtomicFree(req); 406 sym_drmModeAtomicFree(req);
404#endif
405 407
406 return EINA_FALSE; 408 return EINA_FALSE;
407} 409}
@@ -409,12 +411,13 @@ err:
409static int 411static int
410_fb_atomic_flip(Ecore_Drm2_Output *output) 412_fb_atomic_flip(Ecore_Drm2_Output *output)
411{ 413{
412#ifdef HAVE_ATOMIC_DRM
413 int res = 0; 414 int res = 0;
414 uint32_t flags = 415 uint32_t flags =
415 DRM_MODE_ATOMIC_NONBLOCK | DRM_MODE_PAGE_FLIP_EVENT | 416 DRM_MODE_ATOMIC_NONBLOCK | DRM_MODE_PAGE_FLIP_EVENT |
416 DRM_MODE_ATOMIC_ALLOW_MODESET; 417 DRM_MODE_ATOMIC_ALLOW_MODESET;
417 418
419 if (!_ecore_drm2_use_atomic) return -1;
420
418 /* If we have no req yet, we're flipping to current state. 421 /* If we have no req yet, we're flipping to current state.
419 * rebuild the current state in the prep state */ 422 * rebuild the current state in the prep state */
420 if (!output->prep.atomic_req) _fb_atomic_flip_test(output); 423 if (!output->prep.atomic_req) _fb_atomic_flip_test(output);
@@ -433,9 +436,6 @@ _fb_atomic_flip(Ecore_Drm2_Output *output)
433 } 436 }
434 437
435 return 0; 438 return 0;
436#endif
437
438 return -1;
439} 439}
440 440
441static int 441static int
@@ -578,10 +578,13 @@ ecore_drm2_fb_flip(Ecore_Drm2_Fb *fb, Ecore_Drm2_Output *output)
578 } 578 }
579 output->pending.fb = output->prep.fb; 579 output->pending.fb = output->prep.fb;
580 output->prep.fb = NULL; 580 output->prep.fb = NULL;
581#ifdef HAVE_ATOMIC_DRM 581
582 output->pending.atomic_req = output->prep.atomic_req; 582 if (_ecore_drm2_use_atomic)
583 output->prep.atomic_req = NULL; 583 {
584#endif 584 output->pending.atomic_req = output->prep.atomic_req;
585 output->prep.atomic_req = NULL;
586 }
587
585 return 0; 588 return 0;
586} 589}
587 590