summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2014-10-02 13:11:53 +0200
committerDavid Herrmann <dh.herrmann@gmail.com>2014-10-03 15:57:00 +0200
commitdb1a606610e5a528903a4380f30c9934a0c5a134 (patch)
tree93805c43ee1ff25ab09406ae4d951d7cd7391c99 /src
parent754fc0c720eb998b8e47e695c12807ced0ff3602 (diff)
terminal: fix back-buffer selection on DRM page-flip
We currently select front-buffers as new back-buffer if they happen to be the last buffer in our framebuffer-array. Fix this by never selecting a new front buffer as back buffer.
Diffstat (limited to 'src')
-rw-r--r--src/libsystemd-terminal/grdev-drm.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/libsystemd-terminal/grdev-drm.c b/src/libsystemd-terminal/grdev-drm.c
index 5393ebf988..7a6e1d993b 100644
--- a/src/libsystemd-terminal/grdev-drm.c
+++ b/src/libsystemd-terminal/grdev-drm.c
@@ -1362,10 +1362,9 @@ static void grdrm_crtc_flip_complete(grdrm_crtc *crtc, uint32_t counter, struct
fb = fb_from_base(pipe->base.fbs[i]);
if (counter != 0 && counter == pipe->counter && fb->flipid == counter) {
pipe->base.front = &fb->base;
+ fb->flipid = 0;
flipped = true;
- }
-
- if (counter - fb->flipid < UINT16_MAX) {
+ } else if (counter - fb->flipid < UINT16_MAX) {
fb->flipid = 0;
back = fb;
} else if (fb->flipid == 0) {
@@ -1373,7 +1372,7 @@ static void grdrm_crtc_flip_complete(grdrm_crtc *crtc, uint32_t counter, struct
}
}
- if (!pipe->base.back)
+ if (!pipe->base.back && back)
pipe->base.back = &back->base;
if (flipped) {