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.
This commit is contained in:
Simon Ser 2020-12-09 14:50:39 +01:00
parent 0aefa18690
commit c89b131f29
3 changed files with 62 additions and 65 deletions

View file

@ -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