|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
From db1a606610e5a528903a4380f30c9934a0c5a134 Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
From: David Herrmann <dh.herrmann@gmail.com>
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Date: Thu, 2 Oct 2014 13:11:53 +0200
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Subject: [PATCH] terminal: fix back-buffer selection on DRM page-flip
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
We currently select front-buffers as new back-buffer if they happen to be
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
the last buffer in our framebuffer-array. Fix this by never selecting a
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
new front buffer as back buffer.
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
src/libsystemd-terminal/grdev-drm.c | 7 +++----
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
1 file changed, 3 insertions(+), 4 deletions(-)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
diff --git a/src/libsystemd-terminal/grdev-drm.c b/src/libsystemd-terminal/grdev-drm.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
index 5393ebf988..7a6e1d993b 100644
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
--- a/src/libsystemd-terminal/grdev-drm.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+++ b/src/libsystemd-terminal/grdev-drm.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -1362,10 +1362,9 @@ static void grdrm_crtc_flip_complete(grdrm_crtc *crtc, uint32_t counter, struct
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
fb = fb_from_base(pipe->base.fbs[i]);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
if (counter != 0 && counter == pipe->counter && fb->flipid == counter) {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
pipe->base.front = &fb->base;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ fb->flipid = 0;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
flipped = true;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- }
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
-
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- if (counter - fb->flipid < UINT16_MAX) {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ } else if (counter - fb->flipid < UINT16_MAX) {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
fb->flipid = 0;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
back = fb;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
} else if (fb->flipid == 0) {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -1373,7 +1372,7 @@ static void grdrm_crtc_flip_complete(grdrm_crtc *crtc, uint32_t counter, struct
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
}
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
}
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- if (!pipe->base.back)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ if (!pipe->base.back && back)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
pipe->base.back = &back->base;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
if (flipped) {
|