From c89b131f29343c6c91f24cdb259c5dd6663dd80e Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Wed, 9 Dec 2020 14:50:39 +0100 Subject: backend/drm: introduce wlr_drm_conn_log Simplify and unify connector-specific logging with a new wlr_drm_conn_log macro. This makes it easier to understand which connector a failure is about, without having to explicitly integrate the connector name in each log message. --- include/backend/drm/drm.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'include/backend/drm') diff --git a/include/backend/drm/drm.h b/include/backend/drm/drm.h index ea3cdbd4..9ee62ead 100644 --- a/include/backend/drm/drm.h +++ b/include/backend/drm/drm.h @@ -110,9 +110,10 @@ struct wlr_drm_mode { }; struct wlr_drm_connector { - struct wlr_output output; + struct wlr_output output; // only valid if state != DISCONNECTED struct wlr_drm_backend *backend; + char name[24]; enum wlr_drm_connector_state state; struct wlr_output_mode *desired_mode; bool desired_enabled; @@ -155,4 +156,9 @@ size_t drm_crtc_get_gamma_lut_size(struct wlr_drm_backend *drm, struct wlr_drm_fb *plane_get_next_fb(struct wlr_drm_plane *plane); +#define wlr_drm_conn_log(conn, verb, fmt, ...) \ + wlr_log(verb, "connector %s: " fmt, conn->output.name, ##__VA_ARGS__) +#define wlr_drm_conn_log_errno(conn, verb, fmt, ...) \ + wlr_log_errno(verb, "connector %s: " fmt, conn->output.name, ##__VA_ARGS__) + #endif -- cgit v1.2.3