diff options
author | Simon Ser <contact@emersion.fr> | 2021-04-06 17:33:22 +0200 |
---|---|---|
committer | Kenny Levinsen <kl@kl.wtf> | 2021-04-29 19:51:57 +0200 |
commit | 7aba881c474edc5b03af013d81e55a18195296c4 (patch) | |
tree | f036a59cc6d56966c9105ec26e7c9a58f4c4104e /backend/drm/drm.c | |
parent | 31082a0554b5558f6865fdf5c9c9ef3f5afc3e33 (diff) |
backend/drm: remove mode arg from drm_connector_init_renderer
This is now unused.
Diffstat (limited to 'backend/drm/drm.c')
-rw-r--r-- | backend/drm/drm.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c index 5e01ce99..18e17c29 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -657,7 +657,7 @@ static bool drm_connector_pageflip_renderer(struct wlr_drm_connector *conn, } static bool drm_connector_init_renderer(struct wlr_drm_connector *conn, - const struct wlr_output_state *state, struct wlr_drm_mode *mode) { + const struct wlr_output_state *state) { struct wlr_drm_backend *drm = conn->backend; if (conn->state != WLR_DRM_CONN_CONNECTED && @@ -675,8 +675,11 @@ static bool drm_connector_init_renderer(struct wlr_drm_connector *conn, } struct wlr_drm_plane *plane = crtc->primary; - int width = mode->wlr_mode.width; - int height = mode->wlr_mode.height; + drmModeModeInfo mode = {0}; + drm_connector_state_mode(conn, state, &mode); + + int width = mode.hdisplay; + int height = mode.vdisplay; uint32_t format = DRM_FORMAT_ARGB8888; bool modifiers = drm->addfb2_modifiers; @@ -772,8 +775,7 @@ bool drm_connector_set_mode(struct wlr_drm_connector *conn, "Modesetting with '%" PRId32 "x%" PRId32 "@%" PRId32 "mHz'", wlr_mode->width, wlr_mode->height, wlr_mode->refresh); - struct wlr_drm_mode *mode = (struct wlr_drm_mode *)wlr_mode; - if (!drm_connector_init_renderer(conn, state, mode)) { + if (!drm_connector_init_renderer(conn, state)) { wlr_drm_conn_log(conn, WLR_ERROR, "Failed to initialize renderer for plane"); return false; @@ -1211,13 +1213,11 @@ static void realloc_crtcs(struct wlr_drm_backend *drm) { continue; } - struct wlr_drm_mode *mode = - (struct wlr_drm_mode *)conn->output.current_mode; struct wlr_output_state state = { .committed = WLR_OUTPUT_STATE_ENABLED, .enabled = true, }; - if (!drm_connector_init_renderer(conn, &state, mode)) { + if (!drm_connector_init_renderer(conn, &state)) { wlr_drm_conn_log(conn, WLR_ERROR, "Failed to initialize renderer"); wlr_output_update_enabled(&conn->output, false); continue; |