From 2e0d9c8521d93733f59f44f9957b4244af31effc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20S=C3=B6ntgen?= Date: Tue, 12 Oct 2021 16:59:36 +0200 Subject: [PATCH] libdrm: short-cut tiling in iris back end Apparently the iris driver does not make use of tiling by the kernel, so we shortcut the 'SET_TILING' call to keep iris happy with this quickfix. However, tiling information may get lost, if the iris driver ever calls 'MMAP_GTT' and no fence is configured for the buffer. A follow-up commit should address this shortcoming in the future. Issue #4284 --- repos/libports/src/lib/libdrm/ioctl_iris.cc | 32 ++------------------- 1 file changed, 2 insertions(+), 30 deletions(-) diff --git a/repos/libports/src/lib/libdrm/ioctl_iris.cc b/repos/libports/src/lib/libdrm/ioctl_iris.cc index 82e59b2042..90b8eeb5c3 100644 --- a/repos/libports/src/lib/libdrm/ioctl_iris.cc +++ b/repos/libports/src/lib/libdrm/ioctl_iris.cc @@ -620,36 +620,8 @@ class Drm_call int _device_gem_set_tiling(void *arg) { - auto const p = reinterpret_cast(arg); - Gpu::Buffer_id const id { .value = p->handle }; - uint32_t const mode = p->tiling_mode; - uint32_t const stride = p->stride; - uint32_t const swizzle = p->swizzle_mode; - - if (verbose_ioctl) { - Genode::error(__func__, ": ", - "handle: ", id.value, " " - "mode: ", mode, " " - "stride: ", stride , " " - "swizzle: ", swizzle); - } - - bool ok = false; - try { - _buffer_space.apply(id, [&] (Buffer &b) { - - /* we need a valid GGTT mapping for fencing */ - if (!b.map_cap.valid() && !_map_buffer(b)) - return; - - uint32_t const m = (stride << 16) | (mode == 1 ? 1 : 0); - ok = _gpu_session.set_tiling(b.id(), m); - }); - } catch (Genode::Id_space::Unknown_id) { - Genode::error(__func__, ": invalid handle: ", id.value); - } - - return ok ? 0 : -1; + (void)arg; + return 0; } int _device_gem_sw_finish(void *)