From f55eacac98c2a78466b578c394beca580d41d7ac Mon Sep 17 00:00:00 2001 From: Kenny Levinsen Date: Thu, 26 Sep 2024 00:40:13 +0200 Subject: [PATCH 1/5] backend/drm: Do not log on test commit failure A test commit failure is a normal condition, and can easily end up happening once per frame, such as when direct scan-out is attempted. Only log when non-test commits fail. --- backend/drm/atomic.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/backend/drm/atomic.c b/backend/drm/atomic.c index 16b08f7a1..b7717355a 100644 --- a/backend/drm/atomic.c +++ b/backend/drm/atomic.c @@ -71,16 +71,14 @@ static bool atomic_commit(struct atomic *atom, struct wlr_drm_backend *drm, int ret = drmModeAtomicCommit(drm->fd, atom->req, flags, page_flip); if (ret != 0) { - enum wlr_log_importance log_level = WLR_ERROR; if (flags & DRM_MODE_ATOMIC_TEST_ONLY) { - log_level = WLR_DEBUG; + return false; } - if (state->connectors_len == 1) { struct wlr_drm_connector *conn = state->connectors[0].connector; - wlr_drm_conn_log_errno(conn, log_level, "Atomic commit failed"); + wlr_drm_conn_log_errno(conn, WLR_ERROR, "Atomic commit failed"); } else { - wlr_log_errno(log_level, "Atomic commit failed"); + wlr_log_errno(WLR_ERROR, "Atomic commit failed"); } char *flags_str = atomic_commit_flags_str(flags); wlr_log(WLR_DEBUG, "(Atomic commit flags: %s)", From 8acff5050814a3564e6c44d6f543725504091923 Mon Sep 17 00:00:00 2001 From: Kenny Levinsen Date: Wed, 25 Sep 2024 23:42:01 +0200 Subject: [PATCH 2/5] backend/drm: Remove DMA-BUF import logging It's not an unusual situation for a dma-buf import to fail. --- backend/drm/drm.c | 2 -- backend/drm/fb.c | 4 ---- 2 files changed, 6 deletions(-) diff --git a/backend/drm/drm.c b/backend/drm/drm.c index a20442d40..267262205 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -756,8 +756,6 @@ static bool drm_connector_state_update_primary_fb(struct wlr_drm_connector *conn &plane->formats); wlr_buffer_unlock(local_buf); if (!ok) { - wlr_drm_conn_log(conn, WLR_DEBUG, - "Failed to import buffer for scan-out"); return false; } diff --git a/backend/drm/fb.c b/backend/drm/fb.c index 575f32d91..89161665c 100644 --- a/backend/drm/fb.c +++ b/backend/drm/fb.c @@ -144,7 +144,6 @@ static struct wlr_drm_fb *drm_fb_create(struct wlr_drm_backend *drm, struct wlr_buffer *buf, const struct wlr_drm_format_set *formats) { struct wlr_dmabuf_attributes attribs; if (!wlr_buffer_get_dmabuf(buf, &attribs)) { - wlr_log(WLR_DEBUG, "Failed to get DMA-BUF from buffer"); return NULL; } @@ -169,9 +168,6 @@ static struct wlr_drm_fb *drm_fb_create(struct wlr_drm_backend *drm, wlr_drm_format_set_has(formats, info->opaque_substitute, attribs.modifier)) { attribs.format = info->opaque_substitute; } else { - wlr_log(WLR_DEBUG, "Buffer format 0x%"PRIX32" with modifier " - "0x%"PRIX64" cannot be scanned out", - attribs.format, attribs.modifier); goto error_fb; } } From faf3cd8abe2b759e0f2f558279218906bc10d062 Mon Sep 17 00:00:00 2001 From: Kenny Levinsen Date: Wed, 25 Sep 2024 22:17:25 +0200 Subject: [PATCH 3/5] output/output: Remove per-frame direct-scanout logging Logging that direct scanout was not attempted on every frame is just noise and not productive. --- types/output/output.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/types/output/output.c b/types/output/output.c index 2dcd24229..e4fab9be9 100644 --- a/types/output/output.c +++ b/types/output/output.c @@ -896,7 +896,6 @@ const struct wlr_drm_format_set *wlr_output_get_primary_formats( bool wlr_output_is_direct_scanout_allowed(struct wlr_output *output) { if (output->attach_render_locks > 0) { - wlr_log(WLR_DEBUG, "Direct scan-out disabled by lock"); return false; } @@ -905,8 +904,6 @@ bool wlr_output_is_direct_scanout_allowed(struct wlr_output *output) { wl_list_for_each(cursor, &output->cursors, link) { if (cursor->enabled && cursor->visible && cursor != output->hardware_cursor) { - wlr_log(WLR_DEBUG, - "Direct scan-out disabled by software cursor"); return false; } } From a85eb14f1cf29917182c5de52ddf5d160e8b8c3c Mon Sep 17 00:00:00 2001 From: Kenny Levinsen Date: Wed, 25 Sep 2024 22:18:55 +0200 Subject: [PATCH 4/5] output/cursor: Lock software cursor on no hw support There is no need for us to repeatedly try hardware cursors if there is no support. Lock software cursors to skip future tests. --- types/output/cursor.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/types/output/cursor.c b/types/output/cursor.c index 7bc8d0d69..2a6354950 100644 --- a/types/output/cursor.c +++ b/types/output/cursor.c @@ -203,6 +203,14 @@ static struct wlr_buffer *render_cursor_buffer(struct wlr_output_cursor *cursor) const struct wlr_output_cursor_size *sizes = output->impl->get_cursor_sizes(cursor->output, &sizes_len); + if (sizes == NULL) { + // No cursor support + wlr_log(WLR_DEBUG, "Output '%s' has no cursor support, disabling permanently", + output->name); + output->software_cursor_locks++; + return NULL; + } + bool found = false; for (size_t i = 0; i < sizes_len; i++) { struct wlr_output_cursor_size size = sizes[i]; From 28f851d1f847eb53089f3f36707436c4630e6d53 Mon Sep 17 00:00:00 2001 From: Kenny Levinsen Date: Wed, 25 Sep 2024 22:18:29 +0200 Subject: [PATCH 5/5] output/cursor: Do not log on software cursor fallback --- types/output/cursor.c | 1 - 1 file changed, 1 deletion(-) diff --git a/types/output/cursor.c b/types/output/cursor.c index 2a6354950..2dbb12108 100644 --- a/types/output/cursor.c +++ b/types/output/cursor.c @@ -428,7 +428,6 @@ bool output_cursor_set_texture(struct wlr_output_cursor *cursor, return true; } - wlr_log(WLR_DEBUG, "Falling back to software cursor on output '%s'", output->name); output_disable_hardware_cursor(output); output_cursor_damage_whole(cursor); return true;