diff options
author | Simon Ser <contact@emersion.fr> | 2020-12-09 14:50:39 +0100 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2020-12-18 10:48:44 +0100 |
commit | c89b131f29343c6c91f24cdb259c5dd6663dd80e (patch) | |
tree | 69c8c3f77b0ff0b993ef887766b83068caf03cf9 /include/backend/drm/drm.h | |
parent | 0aefa186906420f2a8f37f2f823a533c9187e7f5 (diff) |
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.
Diffstat (limited to 'include/backend/drm/drm.h')
-rw-r--r-- | include/backend/drm/drm.h | 8 |
1 files changed, 7 insertions, 1 deletions
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 |