From cf43e0c3da84803782f5e2674a8df37fe5ca70fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20S=C3=B6ntgen?= Date: Thu, 12 Oct 2023 14:39:52 +0200 Subject: [PATCH] libdrm/lima: always map BO with ID 1 --- repos/libports/src/lib/libdrm/ioctl_lima.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/repos/libports/src/lib/libdrm/ioctl_lima.cc b/repos/libports/src/lib/libdrm/ioctl_lima.cc index 5b3624de1c..c48e0623eb 100644 --- a/repos/libports/src/lib/libdrm/ioctl_lima.cc +++ b/repos/libports/src/lib/libdrm/ioctl_lima.cc @@ -797,6 +797,22 @@ class Lima::Call _gpu_context_space.apply(ctx_id, [&] (Gpu_context &gc) { + /* XXX always map buffer id 1 to prevent GP MMU faults */ + { + uint32_t const handle = 1; + Buffer_space::Id const id = { .value = handle }; + if (!gc.buffer_space_contains(id)) { + + (void)_apply_handle(handle, [&] (Gpu::Vram const &v) { + Gpu::Vram_capability cap = _main_ctx->export_vram(v.id()); + if (gc.import_vram(cap, v) == nullptr) { + Genode::error("could force mapping of buffer ", handle); + return; + } + }); + } + } + /* * Check if we have access to all needed buffer objects and * if not import them from the main context that normaly performs