mirror of
https://github.com/genodelabs/genode.git
synced 2025-03-22 03:55:26 +00:00
mesa: zero buffer objects upon release
Freshly allocated BOs from libdrm have to be zeroed. Since the libdrm/iris caches VRAM allocations, we don't want to attach/detach parts of dataspaces at every allocation. Some objects are used long (through caching in the iris Gallium driver). Therefore, zero object on release where the region might already be mapped. issue #5224
This commit is contained in:
parent
138f5fe61a
commit
af8b13e88c
@ -1 +1 @@
|
||||
789aefc660587ea3b3376a0b8ed076a75214ba05
|
||||
aa79191d2f974902ddcf8f081ca84955037f33c9
|
||||
|
@ -17,6 +17,7 @@ PATCHES := src/lib/mesa/patches/dri2.patch \
|
||||
src/lib/mesa/patches/etnaviv.patch \
|
||||
src/lib/mesa/patches/intel_gen.patch \
|
||||
src/lib/mesa/patches/iris_bufmgr.patch \
|
||||
src/lib/mesa/patches/iris_bufmgr_zero.patch \
|
||||
src/lib/mesa/patches/iris_utrace.patch \
|
||||
src/lib/mesa/patches/lima.patch \
|
||||
src/lib/mesa/patches/loader_fds.patch \
|
||||
|
25
repos/libports/src/lib/mesa/patches/iris_bufmgr_zero.patch
Normal file
25
repos/libports/src/lib/mesa/patches/iris_bufmgr_zero.patch
Normal file
@ -0,0 +1,25 @@
|
||||
Freshly allocated BOs from libdrm have to be zeroed. Since the libdrm/iris
|
||||
caches VRAM allocations, we don't want to attach/detach parts of dataspaces at
|
||||
every allocation. Some objects are used long (through caching in the iris
|
||||
Gallium driver). Therefore, zero on object release where the region might
|
||||
already be mapped.
|
||||
diff --git a/src/lib/mesa/src/gallium/drivers/iris/iris_bufmgr.c b/src/lib/mesa/src/gallium/drivers/iris/iris_bufmgr.c
|
||||
index 98483f3..759e986 100644
|
||||
--- a/src/lib/mesa/src/gallium/drivers/iris/iris_bufmgr.c
|
||||
+++ b/src/lib/mesa/src/gallium/drivers/iris/iris_bufmgr.c
|
||||
@@ -1461,6 +1461,15 @@ bo_close(struct iris_bo *bo)
|
||||
simple_mtx_assert_locked(&bufmgr->lock);
|
||||
assert(iris_bo_is_real(bo));
|
||||
|
||||
+#ifdef __GENODE__
|
||||
+ /*
|
||||
+ * Zero buffers released here because they will get re-used and we want to
|
||||
+ * avoid attach/detach RM cycle if they are already mapped.
|
||||
+ */
|
||||
+ bo->zeroed = false;
|
||||
+ zero_bo(bo->bufmgr, BO_ALLOC_ZEROED|MAP_ASYNC, bo);
|
||||
+#endif
|
||||
+
|
||||
if (iris_bo_is_external(bo)) {
|
||||
struct hash_entry *entry;
|
||||
|
Loading…
x
Reference in New Issue
Block a user