|
Zbigniew Jędrzejewski-Szmek |
db38be |
From f08f302732c0597c83ec6b8022aa82faffb116f9 Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
From: David Herrmann <dh.herrmann@gmail.com>
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
Date: Sat, 11 Oct 2014 18:49:20 +0200
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
Subject: [PATCH] terminal/grdrm: force deep modeset on enter
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
Usually, when our session is activated (or re-configurated) we should be
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
able to try a page-flip to our buffer. The kernel driver should reject it
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
if it is incompatible. As it turns out, drivers don't do this. Therefore,
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
we now force a deep modeset if we're not sure what mode is set.
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
This has the side-effect that we might get glitches on session-switches
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
(depending on driver behavior). However, there's no way around this and it
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
is what everyone does so far. Most drivers still detect if we keep the
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
mode and so don't touch the clocks. Therefore, we just get a regular async
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
flip.
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
---
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
src/libsystemd-terminal/grdev-drm.c | 15 ++++++++++++++-
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
1 file changed, 14 insertions(+), 1 deletion(-)
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
diff --git a/src/libsystemd-terminal/grdev-drm.c b/src/libsystemd-terminal/grdev-drm.c
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
index 232321c0e2..dba6db2691 100644
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
--- a/src/libsystemd-terminal/grdev-drm.c
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
+++ b/src/libsystemd-terminal/grdev-drm.c
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
@@ -1158,8 +1158,21 @@ static int grdrm_crtc_commit_flip(grdrm_crtc *crtc, grdev_fb *basefb) {
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
assert(basefb);
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
assert(pipe);
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
- if (!crtc->applied && !grdrm_modes_compatible(&crtc->kern.mode, &crtc->set.mode))
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
+ if (!crtc->applied) {
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
+ if (!grdrm_modes_compatible(&crtc->kern.mode, &crtc->set.mode))
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
+ return 0;
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
+
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
+ /* TODO: Theoretically, we should be able to page-flip to our
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
+ * framebuffer here. We didn't perform any deep modeset, but the
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
+ * DRM driver is really supposed to reject our page-flip in case
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
+ * the FB is not compatible. We then properly fall back to a
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
+ * deep modeset.
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
+ * As it turns out, drivers don't to this. Therefore, we need to
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
+ * perform a full modeset on enter now. We might avoid this in
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
+ * the future with fixed drivers.. */
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
+
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
return 0;
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
+ }
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
fb = fb_from_base(basefb);
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
|