From 2407a7e6c1fa32f753f7595d92e02f15b9679370 Mon Sep 17 00:00:00 2001 From: Nanley Chery Date: Thu, 30 Dec 2021 18:38:16 -0500 Subject: [PATCH] iris: Pick the right BO in iris_resource_get_param MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pick the clear color BO if the clear color plane is being queried. This avoids picking a NULL aux BO on XeHP. When creating shared resources, we place the gallium-visible planes in the same buffer object. However, when importing them, we aren't very strict about each plane sharing the same BO. So, instead of just using res->bo, we use a couple ternaries to figure out the right one. Reviewed-by: Francisco Jerez Reviewed-by: Tapani Pälli Part-of: --- src/gallium/drivers/iris/iris_resource.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/iris/iris_resource.c b/src/gallium/drivers/iris/iris_resource.c index 7fe2355da66..a2981fcaaa7 100644 --- a/src/gallium/drivers/iris/iris_resource.c +++ b/src/gallium/drivers/iris/iris_resource.c @@ -1589,7 +1589,8 @@ iris_resource_get_param(struct pipe_screen *pscreen, iris_resource_disable_aux_on_first_query(resource, handle_usage); iris_resource_disable_suballoc_on_first_query(pscreen, ctx, res); - struct iris_bo *bo = wants_aux ? res->aux.bo : res->bo; + struct iris_bo *bo = wants_cc ? res->aux.clear_color_bo : + wants_aux ? res->aux.bo : res->bo; assert(iris_bo_is_real(bo));