summaryrefslogtreecommitdiff
path: root/src/lib/ecore_drm2/ecore_drm2_fb.c
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2017-05-15 14:29:55 -0500
committerDerek Foreman <derekf@osg.samsung.com>2017-05-15 16:22:12 -0500
commit88f328efd2d92f02c6a680872263227d3ac95f8d (patch)
tree1d6bc3d49fbc81286e63f90d9bd086ac1c1ce31a /src/lib/ecore_drm2/ecore_drm2_fb.c
parentddfc6f0632e3099632f98504e9ffcd341250ed1e (diff)
ecore_drm2: Clear next fb if we use it
Fixes a race that's either really hard to hit if you're a developer or really easy to hit if you're a user. Thanks to ApB for the debug assistance. Fix T5484
Diffstat (limited to '')
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_fb.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/ecore_drm2/ecore_drm2_fb.c b/src/lib/ecore_drm2/ecore_drm2_fb.c
index 114280b62d..71ea60df18 100644
--- a/src/lib/ecore_drm2/ecore_drm2_fb.c
+++ b/src/lib/ecore_drm2/ecore_drm2_fb.c
@@ -548,12 +548,16 @@ ecore_drm2_fb_flip(Ecore_Drm2_Fb *fb, Ecore_Drm2_Output *output)
548 output->next.fb = fb; 548 output->next.fb = fb;
549 return 0; 549 return 0;
550 } 550 }
551 if (!fb) fb = output->next.fb; 551 if (!fb)
552 {
553 fb = output->next.fb;
554 output->next.fb = NULL;
555 }
552 556
553 /* So we can generate a tick by flipping to the current fb */ 557 /* So we can generate a tick by flipping to the current fb */
554 if (!fb) fb = output->current.fb; 558 if (!fb) fb = output->current.fb;
555 559
556 if (output->next.fb && fb != output->next.fb) 560 if (output->next.fb)
557 _release_buffer(output, &output->next); 561 _release_buffer(output, &output->next);
558 562
559 /* If we don't have an fb to set by now, BAIL! */ 563 /* If we don't have an fb to set by now, BAIL! */