Commit 1878ba0e authored by Kai Uwe Broulik's avatar Kai Uwe Broulik Committed by Kai Uwe Broulik
Browse files

backends/drm: Guard gbm_bo_get_fd_for_plane in dmaBufAttributesForBo



It is guarded elsewhere but not here.

Signed-off-by: default avatarVictoria Fischer <victoria.fischer@mbition.io>
parent 701bfc71
Pipeline #177157 passed with stage
in 31 minutes and 14 seconds
......@@ -6,6 +6,7 @@
#pragma once
#include "config-kwin.h"
#include "dmabuftexture.h"
#include <gbm.h>
......@@ -21,12 +22,23 @@ inline DmaBufAttributes dmaBufAttributesForBo(gbm_bo *bo)
attributes.height = gbm_bo_get_height(bo);
attributes.format = gbm_bo_get_format(bo);
#if HAVE_GBM_BO_GET_FD_FOR_PLANE
for (int i = 0; i < attributes.planeCount; ++i) {
attributes.fd[i] = gbm_bo_get_fd_for_plane(bo, i);
attributes.offset[i] = gbm_bo_get_offset(bo, i);
attributes.pitch[i] = gbm_bo_get_stride_for_plane(bo, i);
attributes.modifier[i] = gbm_bo_get_modifier(bo);
}
#else
if (attributes.planeCount > 1) {
return attributes;
}
attributes.fd[0] = gbm_bo_get_fd(bo);
attributes.offset[0] = gbm_bo_get_offset(bo, 0);
attributes.pitch[0] = gbm_bo_get_stride_for_plane(bo, 0);
attributes.modifier[0] = gbm_bo_get_modifier(bo);
#endif
return attributes;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment