aboutsummaryrefslogtreecommitdiff
path: root/render/allocator
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2021-09-02 10:50:09 +0200
committerKenny Levinsen <kl@kl.wtf>2021-09-03 22:13:38 +0200
commit38cd1b4f4fa8f82944fb0d378bcde3242e0a69ff (patch)
tree4b82ee3498b81e18511382205a5ffe6511099528 /render/allocator
parent5aa5137faed6aa85336b776822aea8ccf2dfa590 (diff)
render/allocator/gbm: add log message for gbm_bo_get_fd_for_plane
Makes it easier to find out which branch is taken when debugging issues like [1]. [1]: https://github.com/swaywm/wlroots/issues/3156
Diffstat (limited to 'render/allocator')
-rw-r--r--render/allocator/gbm.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/render/allocator/gbm.c b/render/allocator/gbm.c
index 0092afd6..86e4749b 100644
--- a/render/allocator/gbm.c
+++ b/render/allocator/gbm.c
@@ -36,8 +36,13 @@ static bool export_gbm_bo(struct gbm_bo *bo,
int32_t handle = -1;
for (i = 0; i < attribs.n_planes; ++i) {
#if HAS_GBM_BO_GET_FD_FOR_PLANE
- attribs.fd[i] = gbm_bo_get_fd_for_plane(bo, i);
(void)handle;
+
+ attribs.fd[i] = gbm_bo_get_fd_for_plane(bo, i);
+ if (attribs.fd[i] < 0) {
+ wlr_log(WLR_ERROR, "gbm_bo_get_fd_for_plane failed");
+ goto error_fd;
+ }
#else
// GBM is lacking a function to get a FD for a given plane. Instead,
// check all planes have the same handle. We can't use
@@ -57,12 +62,11 @@ static bool export_gbm_bo(struct gbm_bo *bo,
}
attribs.fd[i] = gbm_bo_get_fd(bo);
-#endif
-
if (attribs.fd[i] < 0) {
wlr_log(WLR_ERROR, "gbm_bo_get_fd failed");
goto error_fd;
}
+#endif
attribs.offset[i] = gbm_bo_get_offset(bo, i);
attribs.stride[i] = gbm_bo_get_stride_for_plane(bo, i);