summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucas Stach <l.stach@pengutronix.de>2020-10-28 10:40:01 +0100
committerLucas Stach <l.stach@pengutronix.de>2020-10-28 10:41:21 +0100
commite6386d1b99366ea7559438c0d3abd2ae2d6d61ac (patch)
treef59b47c4b08807e05221d13002ce8230ddec31e8
parent26326be53e30da9c101075fda081d38ea9ec758d (diff)
downloadkmscube-e6386d1b99366ea7559438c0d3abd2ae2d6d61ac.tar.gz
drm: grab correct handle for plane != 0
Multiplanar formats can have different BOs for each plane, so call the correct GBM function to get the handle for a specific plane.
-rw-r--r--drm-common.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drm-common.c b/drm-common.c
index 50a286d..5c9cca2 100644
--- a/drm-common.c
+++ b/drm-common.c
@@ -32,6 +32,9 @@
#include "common.h"
#include "drm-common.h"
+WEAK union gbm_bo_handle
+gbm_bo_get_handle_for_plane(struct gbm_bo *bo, int plane);
+
WEAK uint64_t
gbm_bo_get_modifier(struct gbm_bo *bo);
@@ -75,15 +78,16 @@ struct drm_fb * drm_fb_get_from_bo(struct gbm_bo *bo)
height = gbm_bo_get_height(bo);
format = gbm_bo_get_format(bo);
- if (gbm_bo_get_modifier && gbm_bo_get_plane_count &&
- gbm_bo_get_stride_for_plane && gbm_bo_get_offset) {
+ if (gbm_bo_get_handle_for_plane && gbm_bo_get_modifier &&
+ gbm_bo_get_plane_count && gbm_bo_get_stride_for_plane &&
+ gbm_bo_get_offset) {
uint64_t modifiers[4] = {0};
modifiers[0] = gbm_bo_get_modifier(bo);
const int num_planes = gbm_bo_get_plane_count(bo);
for (int i = 0; i < num_planes; i++) {
+ handles[i] = gbm_bo_get_handle_for_plane(bo, i).u32;
strides[i] = gbm_bo_get_stride_for_plane(bo, i);
- handles[i] = gbm_bo_get_handle(bo).u32;
offsets[i] = gbm_bo_get_offset(bo, i);
modifiers[i] = modifiers[0];
}