summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTapani Pälli <tapani.palli@intel.com>2021-07-28 10:21:52 +0300
committerTapani Pälli <tapani.palli@intel.com>2021-08-09 05:38:50 +0300
commite47b72e931cb1451f001349fac13b38acb986ce3 (patch)
tree13b1f68de983156cf05bed76c64f9570cd88c193
parent13677a909276a162e98112c65c1b3364741fae04 (diff)
crocus: take a reference to memobj bo in crocus_resource_from_memobj
This is the same fix as commit 2d87ea31665 for iris driver. Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Nanley Chery <nanley.g.chery@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10609>
-rw-r--r--src/gallium/drivers/crocus/crocus_resource.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gallium/drivers/crocus/crocus_resource.c b/src/gallium/drivers/crocus/crocus_resource.c
index 5adca55233f..5e234fd7013 100644
--- a/src/gallium/drivers/crocus/crocus_resource.c
+++ b/src/gallium/drivers/crocus/crocus_resource.c
@@ -901,6 +901,8 @@ crocus_resource_from_memobj(struct pipe_screen *pscreen,
res->offset = offset;
res->external_format = memobj->format;
+ crocus_bo_reference(memobj->bo);
+
return &res->base.b;
}
@@ -1949,8 +1951,6 @@ crocus_memobj_create_from_handle(struct pipe_screen *pscreen,
memobj->format = whandle->format;
memobj->stride = whandle->stride;
- crocus_bo_reference(memobj->bo);
-
return &memobj->b;
}