summaryrefslogtreecommitdiff
path: root/src/lib/ecore_drm2/ecore_drm2_fb.c
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2017-04-27 16:43:06 -0500
committerDerek Foreman <derekf@osg.samsung.com>2017-05-05 12:53:22 -0500
commit8143abff2cbdeff0d2eb5fcf93817efda24688ee (patch)
treee45eaf63bdf931611dd98e17dcc19624c8d44694 /src/lib/ecore_drm2/ecore_drm2_fb.c
parent63dbf061a993a3a81c03bc79806b646003c85e4e (diff)
ecore_drm2: Replace output fbs with state structs
next, pending, and current are going to have to deal with atomic state instead of just fbs soon
Diffstat (limited to '')
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_fb.c66
1 files changed, 33 insertions, 33 deletions
diff --git a/src/lib/ecore_drm2/ecore_drm2_fb.c b/src/lib/ecore_drm2/ecore_drm2_fb.c
index 52cf55af9a..1a3b40c5f8 100644
--- a/src/lib/ecore_drm2/ecore_drm2_fb.c
+++ b/src/lib/ecore_drm2/ecore_drm2_fb.c
@@ -220,12 +220,12 @@ ecore_drm2_fb_flip_complete(Ecore_Drm2_Output *output)
220{ 220{
221 EINA_SAFETY_ON_NULL_RETURN_VAL(output, EINA_FALSE); 221 EINA_SAFETY_ON_NULL_RETURN_VAL(output, EINA_FALSE);
222 222
223 if (output->current && (output->current != output->pending)) 223 if (output->current.fb && (output->current.fb != output->pending.fb))
224 _release_buffer(output, output->current); 224 _release_buffer(output, output->current.fb);
225 output->current = output->pending; 225 output->current.fb = output->pending.fb;
226 output->pending = NULL; 226 output->pending.fb = NULL;
227 227
228 return !!output->next; 228 return !!output->next.fb;
229} 229}
230 230
231Eina_Bool 231Eina_Bool
@@ -375,29 +375,29 @@ _fb_flip(Ecore_Drm2_Output *output, Ecore_Drm2_Fb *fb)
375 int count = 0; 375 int count = 0;
376 int ret = 0; 376 int ret = 0;
377 377
378 if (output->pending) 378 if (output->pending.fb)
379 { 379 {
380 if (output->next) _release_buffer(output, output->next); 380 if (output->next.fb) _release_buffer(output, output->next.fb);
381 output->next = fb; 381 output->next.fb = fb;
382 if (output->next) output->next->busy = EINA_TRUE; 382 if (output->next.fb) output->next.fb->busy = EINA_TRUE;
383 return 0; 383 return 0;
384 } 384 }
385 if (!fb) fb = output->next; 385 if (!fb) fb = output->next.fb;
386 386
387 /* So we can generate a tick by flipping to the current fb */ 387 /* So we can generate a tick by flipping to the current fb */
388 if (!fb) fb = output->current; 388 if (!fb) fb = output->current.fb;
389 389
390 if (output->next) 390 if (output->next.fb)
391 { 391 {
392 output->next->busy = EINA_FALSE; 392 output->next.fb->busy = EINA_FALSE;
393 output->next = NULL; 393 output->next.fb = NULL;
394 } 394 }
395 395
396 /* If we don't have an fb to set by now, BAIL! */ 396 /* If we don't have an fb to set by now, BAIL! */
397 if (!fb) return -1; 397 if (!fb) return -1;
398 398
399 if ((!output->current) || 399 if ((!output->current.fb) ||
400 (output->current->strides[0] != fb->strides[0])) 400 (output->current.fb->strides[0] != fb->strides[0]))
401 { 401 {
402 ret = 402 ret =
403 sym_drmModeSetCrtc(fb->fd, output->crtc_id, fb->id, 403 sym_drmModeSetCrtc(fb->fd, output->crtc_id, fb->id,
@@ -411,10 +411,10 @@ _fb_flip(Ecore_Drm2_Output *output, Ecore_Drm2_Fb *fb)
411 return ret; 411 return ret;
412 } 412 }
413 413
414 if (output->current) _release_buffer(output, output->current); 414 if (output->current.fb) _release_buffer(output, output->current.fb);
415 output->current = fb; 415 output->current.fb = fb;
416 output->current->busy = EINA_TRUE; 416 output->current.fb->busy = EINA_TRUE;
417 output->next = NULL; 417 output->next.fb = NULL;
418 /* We used to return here, but now that the ticker is fixed this 418 /* We used to return here, but now that the ticker is fixed this
419 * can leave us hanging waiting for a tick to happen forever. 419 * can leave us hanging waiting for a tick to happen forever.
420 * Instead, we now fall through the the flip path to make sure 420 * Instead, we now fall through the the flip path to make sure
@@ -469,13 +469,13 @@ _fb_flip(Ecore_Drm2_Output *output, Ecore_Drm2_Fb *fb)
469 } 469 }
470 else if (ret < 0) 470 else if (ret < 0)
471 { 471 {
472 output->next = fb; 472 output->next.fb = fb;
473 output->next->busy = EINA_TRUE; 473 output->next.fb->busy = EINA_TRUE;
474 return 0; 474 return 0;
475 } 475 }
476 476
477 output->pending = fb; 477 output->pending.fb = fb;
478 output->pending->busy = EINA_TRUE; 478 output->pending.fb->busy = EINA_TRUE;
479 479
480 return 0; 480 return 0;
481} 481}
@@ -517,10 +517,10 @@ ecore_drm2_fb_release(Ecore_Drm2_Output *o, Eina_Bool panic)
517{ 517{
518 EINA_SAFETY_ON_NULL_RETURN_VAL(o, EINA_FALSE); 518 EINA_SAFETY_ON_NULL_RETURN_VAL(o, EINA_FALSE);
519 519
520 if (o->next) 520 if (o->next.fb)
521 { 521 {
522 _release_buffer(o, o->next); 522 _release_buffer(o, o->next.fb);
523 o->next = NULL; 523 o->next.fb = NULL;
524 return EINA_TRUE; 524 return EINA_TRUE;
525 } 525 }
526 if (!panic) return EINA_FALSE; 526 if (!panic) return EINA_FALSE;
@@ -533,17 +533,17 @@ ecore_drm2_fb_release(Ecore_Drm2_Output *o, Eina_Bool panic)
533 /* If we have to release these we're going to see tearing. 533 /* If we have to release these we're going to see tearing.
534 * Try to reclaim in decreasing order of visual awfulness 534 * Try to reclaim in decreasing order of visual awfulness
535 */ 535 */
536 if (o->current) 536 if (o->current.fb)
537 { 537 {
538 _release_buffer(o, o->current); 538 _release_buffer(o, o->current.fb);
539 o->current = NULL; 539 o->current.fb = NULL;
540 return EINA_TRUE; 540 return EINA_TRUE;
541 } 541 }
542 542
543 if (o->pending) 543 if (o->pending.fb)
544 { 544 {
545 _release_buffer(o, o->pending); 545 _release_buffer(o, o->pending.fb);
546 o->pending = NULL; 546 o->pending.fb = NULL;
547 return EINA_TRUE; 547 return EINA_TRUE;
548 } 548 }
549 549