summaryrefslogtreecommitdiff
path: root/src/lib/ecore_drm2/ecore_drm2_fb.c
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2017-04-28 12:22:04 -0500
committerDerek Foreman <derekf@osg.samsung.com>2017-05-05 12:53:23 -0500
commitb902ef7c69443a54f64fedcdd07f7a3e0e2fb4fe (patch)
treef2641680f5212c2ccfc3631103147190e1232f26 /src/lib/ecore_drm2/ecore_drm2_fb.c
parent89630ddeb15d38b0f35a85f23c105dc50557e2ce (diff)
ecore_drm2: Make _release_buffer take a state struct instead of fb
Lets us push the NULL set into _release_buffer for some clean up
Diffstat (limited to '')
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_fb.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/lib/ecore_drm2/ecore_drm2_fb.c b/src/lib/ecore_drm2/ecore_drm2_fb.c
index fefd8be6f4..462f41b554 100644
--- a/src/lib/ecore_drm2/ecore_drm2_fb.c
+++ b/src/lib/ecore_drm2/ecore_drm2_fb.c
@@ -209,10 +209,11 @@ ecore_drm2_fb_dirty(Ecore_Drm2_Fb *fb, Eina_Rectangle *rects, unsigned int count
209} 209}
210 210
211static void 211static void
212_release_buffer(Ecore_Drm2_Output *output, Ecore_Drm2_Fb *b) 212_release_buffer(Ecore_Drm2_Output *output, Ecore_Drm2_Output_State *s)
213{ 213{
214 b->busy = EINA_FALSE; 214 s->fb->busy = EINA_FALSE;
215 if (output->release_cb) output->release_cb(output->release_data, b); 215 if (output->release_cb) output->release_cb(output->release_data, s->fb);
216 s->fb = NULL;
216} 217}
217 218
218EAPI Eina_Bool 219EAPI Eina_Bool
@@ -221,7 +222,7 @@ ecore_drm2_fb_flip_complete(Ecore_Drm2_Output *output)
221 EINA_SAFETY_ON_NULL_RETURN_VAL(output, EINA_FALSE); 222 EINA_SAFETY_ON_NULL_RETURN_VAL(output, EINA_FALSE);
222 223
223 if (output->current.fb && (output->current.fb != output->pending.fb)) 224 if (output->current.fb && (output->current.fb != output->pending.fb))
224 _release_buffer(output, output->current.fb); 225 _release_buffer(output, &output->current);
225 output->current.fb = output->pending.fb; 226 output->current.fb = output->pending.fb;
226 output->pending.fb = NULL; 227 output->pending.fb = NULL;
227 228
@@ -393,7 +394,7 @@ _fb_flip(Ecore_Drm2_Output *output)
393 return ret; 394 return ret;
394 } 395 }
395 396
396 if (output->current.fb) _release_buffer(output, output->current.fb); 397 if (output->current.fb) _release_buffer(output, &output->current);
397 output->current.fb = fb; 398 output->current.fb = fb;
398 output->current.fb->busy = EINA_TRUE; 399 output->current.fb->busy = EINA_TRUE;
399 output->next.fb = NULL; 400 output->next.fb = NULL;
@@ -471,7 +472,7 @@ ecore_drm2_fb_flip(Ecore_Drm2_Fb *fb, Ecore_Drm2_Output *output)
471 472
472 if (output->pending.fb) 473 if (output->pending.fb)
473 { 474 {
474 if (output->next.fb) _release_buffer(output, output->next.fb); 475 if (output->next.fb) _release_buffer(output, &output->next);
475 output->next.fb = fb; 476 output->next.fb = fb;
476 if (output->next.fb) output->next.fb->busy = EINA_TRUE; 477 if (output->next.fb) output->next.fb->busy = EINA_TRUE;
477 return 0; 478 return 0;
@@ -525,8 +526,7 @@ ecore_drm2_fb_release(Ecore_Drm2_Output *o, Eina_Bool panic)
525 526
526 if (o->next.fb) 527 if (o->next.fb)
527 { 528 {
528 _release_buffer(o, o->next.fb); 529 _release_buffer(o, &o->next);
529 o->next.fb = NULL;
530 return EINA_TRUE; 530 return EINA_TRUE;
531 } 531 }
532 if (!panic) return EINA_FALSE; 532 if (!panic) return EINA_FALSE;
@@ -541,15 +541,13 @@ ecore_drm2_fb_release(Ecore_Drm2_Output *o, Eina_Bool panic)
541 */ 541 */
542 if (o->current.fb) 542 if (o->current.fb)
543 { 543 {
544 _release_buffer(o, o->current.fb); 544 _release_buffer(o, &o->current);
545 o->current.fb = NULL;
546 return EINA_TRUE; 545 return EINA_TRUE;
547 } 546 }
548 547
549 if (o->pending.fb) 548 if (o->pending.fb)
550 { 549 {
551 _release_buffer(o, o->pending.fb); 550 _release_buffer(o, &o->pending);
552 o->pending.fb = NULL;
553 return EINA_TRUE; 551 return EINA_TRUE;
554 } 552 }
555 553