diff options
author | Simon Ser <contact@emersion.fr> | 2023-02-21 10:31:39 +0100 |
---|---|---|
committer | Isaac Freund <mail@isaacfreund.com> | 2023-02-21 09:45:47 +0000 |
commit | 8338d17d7e715a5ae945220e5d7e48abf4247e65 (patch) | |
tree | acfa7b08e739935da8aea726a650df935af8f011 | |
parent | 7215bd1e0f911fcedea802a76edfcde33240daaf (diff) |
backend/drm: drop wlr_drm_layer.pending_{width,height}
No need to store this info in struct wlr_drm_layer. We can just
extract the size when we need it.
-rw-r--r-- | backend/drm/drm.c | 3 | ||||
-rw-r--r-- | backend/drm/libliftoff.c | 9 | ||||
-rw-r--r-- | include/backend/drm/drm.h | 2 |
3 files changed, 6 insertions, 8 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c index 10966940..2c660b8e 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -564,11 +564,8 @@ static bool drm_connector_set_pending_layer_fbs(struct wlr_drm_connector *conn, } if (layer_state->buffer != NULL) { - layer->pending_width = layer_state->buffer->width; - layer->pending_height = layer_state->buffer->height; drm_fb_import(&layer->pending_fb, drm, layer_state->buffer, NULL); } else { - layer->pending_width = layer->pending_height = 0; drm_fb_clear(&layer->pending_fb); } } diff --git a/backend/drm/libliftoff.c b/backend/drm/libliftoff.c index ecc79ce9..90525d24 100644 --- a/backend/drm/libliftoff.c +++ b/backend/drm/libliftoff.c @@ -177,6 +177,12 @@ static bool set_layer_props(struct wlr_drm_backend *drm, const struct wlr_output_layer_state *state, uint64_t zpos) { struct wlr_drm_layer *layer = get_drm_layer(drm, state->layer); + uint32_t width = 0, height = 0; + if (state->buffer != NULL) { + width = state->buffer->width; + height = state->buffer->height; + } + struct wlr_drm_fb *fb = layer->pending_fb; int ret = 0; if (state->buffer == NULL) { @@ -190,9 +196,6 @@ static bool set_layer_props(struct wlr_drm_backend *drm, return false; } - uint32_t width = layer->pending_width; - uint32_t height = layer->pending_height; - uint64_t crtc_x = (uint64_t)state->x; uint64_t crtc_y = (uint64_t)state->y; uint64_t crtc_w = (uint64_t)width; diff --git a/include/backend/drm/drm.h b/include/backend/drm/drm.h index 3b895db3..4b92c5eb 100644 --- a/include/backend/drm/drm.h +++ b/include/backend/drm/drm.h @@ -50,8 +50,6 @@ struct wlr_drm_layer { /* Buffer currently displayed on screen */ struct wlr_drm_fb *current_fb; - int pending_width, pending_height; - // One entry per wlr_drm_backend.planes bool *candidate_planes; }; |