From fad66514d61c8dcd5ea32c681af9c1efe575f8ab Mon Sep 17 00:00:00 2001 From: Yiwei Zhang Date: Wed, 15 Dec 2021 08:33:12 +0000 Subject: [PATCH] vrend: set resource size for minigbm allocation Signed-off-by: Yiwei Zhang Reviewed-by: Chia-I Wu --- src/vrend_renderer.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c index a105d18..a5f8549 100644 --- a/src/vrend_renderer.c +++ b/src/vrend_renderer.c @@ -7179,6 +7179,10 @@ static void vrend_resource_gbm_init(struct vrend_resource *gr, uint32_t format) else gr->map_info = VIRGL_RENDERER_MAP_CACHE_WC; + int num_planes = gbm_bo_get_plane_count(bo); + for (int plane = 0; plane < num_planes; plane++) + gr->size += gbm_bo_get_plane_size(bo, plane); + if (!virgl_gbm_gpu_import_required(gr->base.bind)) return;