backend/drm: add wlr_drm_connector_state.conn

Allows one to get back the connector from its state. Avoids having
to pass both structs around as function arguments.
This commit is contained in:
Simon Ser 2022-12-06 19:18:48 +01:00
parent addf4a4e7c
commit bf5114df6f
2 changed files with 2 additions and 0 deletions

View file

@ -354,6 +354,7 @@ static void drm_connector_state_init(struct wlr_drm_connector_state *state,
struct wlr_drm_connector *conn,
const struct wlr_output_state *base) {
memset(state, 0, sizeof(*state));
state->conn = conn;
state->base = base;
state->modeset = base->allow_artifacts;
state->active = (base->committed & WLR_OUTPUT_STATE_ENABLED) ?

View file

@ -93,6 +93,7 @@ struct wlr_drm_mode {
};
struct wlr_drm_connector_state {
struct wlr_drm_connector *conn;
const struct wlr_output_state *base;
bool modeset;
bool active;