From a88b9c5540d679005b5a9f29872112b6c8f519ac Mon Sep 17 00:00:00 2001 From: Asahi Lina Date: Wed, 5 Apr 2023 23:48:42 +0900 Subject: [PATCH] asahi: Locate low VA BOs correctly These need the shader_base added to them. Signed-off-by: Asahi Lina Part-of: --- src/asahi/lib/agx_device.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/asahi/lib/agx_device.c b/src/asahi/lib/agx_device.c index 5010361..959b03c 100644 --- a/src/asahi/lib/agx_device.c +++ b/src/asahi/lib/agx_device.c @@ -385,10 +385,14 @@ agx_debug_fault(struct agx_device *dev, uint64_t addr) for (uint32_t handle = 0; handle < dev->max_handle; handle++) { struct agx_bo *bo = agx_lookup_bo(dev, handle); - if (!bo->dev || bo->ptr.gpu > addr) + uint64_t bo_addr = bo->ptr.gpu; + if (bo->flags & AGX_BO_LOW_VA) + bo_addr += dev->shader_base; + + if (!bo->dev || bo_addr > addr) continue; - if (!best || bo->ptr.gpu > best->ptr.gpu) + if (!best || bo_addr > best->ptr.gpu) best = bo; } -- 2.7.4