aboutsummaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2022-12-06 17:23:18 +0100
committerSimon Ser <contact@emersion.fr>2022-12-07 17:44:51 +0100
commitbc2d2e853b577b18db268da6e5bbc1141c24d001 (patch)
treef8c6b0a002705bada3e287f87f2bee82c9c312d2 /backend
parent72d1fd14468d719692711819e5d0a7026cda1965 (diff)
backend/drm: stop using goto in set_plane_props()
We only have one error code-path, no need for goto here.
Diffstat (limited to 'backend')
-rw-r--r--backend/drm/atomic.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/backend/drm/atomic.c b/backend/drm/atomic.c
index c882fff9..c337782c 100644
--- a/backend/drm/atomic.c
+++ b/backend/drm/atomic.c
@@ -176,8 +176,9 @@ static void set_plane_props(struct atomic *atom, struct wlr_drm_backend *drm,
const union wlr_drm_plane_props *props = &plane->props;
struct wlr_drm_fb *fb = plane_get_next_fb(plane);
if (fb == NULL) {
- wlr_log(WLR_ERROR, "Failed to acquire FB");
- goto error;
+ wlr_log(WLR_ERROR, "Failed to acquire FB for plane %"PRIu32, plane->id);
+ atom->failed = true;
+ return;
}
uint32_t width = fb->wlr_buf->width;
@@ -194,12 +195,6 @@ static void set_plane_props(struct atomic *atom, struct wlr_drm_backend *drm,
atomic_add(atom, id, props->crtc_id, crtc_id);
atomic_add(atom, id, props->crtc_x, (uint64_t)x);
atomic_add(atom, id, props->crtc_y, (uint64_t)y);
-
- return;
-
-error:
- wlr_log(WLR_ERROR, "Failed to set plane %"PRIu32" properties", plane->id);
- atom->failed = true;
}
static bool atomic_crtc_commit(struct wlr_drm_connector *conn,