|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
From f919ad9d3dc3e25f6eed268fe7eb5e922bcdb3b6 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: Sat, 20 Sep 2014 11:41:34 +0200
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Subject: [PATCH] terminal: restructure some logging calls in grdrm
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Multiple issues here:
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
1) Don't print excessive card dumps on each resync. Disable it and make
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
developers add it themselves.
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
2) Ignore EINVAL on page-flips. Some cards don't support page-flips, so
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
we'd print it on each frame. Maybe, at some point, the kernel will add
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
support to retrieve capabilities for that. Until then, simply ignore
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
it.
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
3) Replace the now dropped card-dump with a short message about resyncing
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
the card.
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
src/libsystemd-terminal/grdev-drm.c | 15 ++++++++++++---
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
1 file changed, 12 insertions(+), 3 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 3936a029fa..5cebb0609e 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 |
@@ -1177,8 +1177,12 @@ static int grdrm_crtc_commit_flip(grdrm_crtc *crtc, grdev_fb **slot) {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
r = ioctl(card->fd, DRM_IOCTL_MODE_PAGE_FLIP, &page_flip);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
if (r < 0) {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
r = -errno;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- log_debug("grdrm: %s: cannot schedule page-flip on crtc %" PRIu32 ": %m",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- card->base.name, crtc->object.id);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ /* Avoid excessive logging on EINVAL; it is currently not
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ * possible to see whether cards support page-flipping, so
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ * avoid logging on each frame. */
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ if (r != -EINVAL)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ log_debug("grdrm: %s: cannot schedule page-flip on crtc %" PRIu32 ": %m",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ card->base.name, crtc->object.id);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
if (grdrm_card_async(card, r))
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
return r;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -2145,6 +2149,8 @@ static void grdrm_card_hotplug(grdrm_card *card) {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
if (!card->running)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
return;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ log_debug("grdrm: %s/%s: reconfigure card", card->base.session->name, card->base.name);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
card->ready = false;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
r = grdrm_card_resync(card);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
if (r < 0) {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -2155,7 +2161,10 @@ static void grdrm_card_hotplug(grdrm_card *card) {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
grdev_session_pin(card->base.session);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- grdrm_card_print(card);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ /* debug statement to print card information */
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ if (0)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ grdrm_card_print(card);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
grdrm_card_configure(card);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
card->ready = true;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|