mirror of
https://abf.rosa.ru/djam/kernel-5.15.git
synced 2025-02-23 10:32:54 +00:00

Found information about them by vising commits to Mesa.git here: https://github.com/asheplyakov/panfrost-baikalm-howto + viewe git log v5.4.10..45..[alt's tag] of kernel
46 lines
1.6 KiB
Diff
46 lines
1.6 KiB
Diff
From 6d1046bd245b1167b263f76b400c9426fca02113 Mon Sep 17 00:00:00 2001
|
|
From: "Vadim V. Vlasov" <vvv19xx@gmail.com>
|
|
Date: Thu, 26 Nov 2020 18:45:58 +0300
|
|
Subject: [PATCH] drm/panfrost: Fix memory attributes for Mali T620
|
|
|
|
Fix #19
|
|
---
|
|
drivers/gpu/drm/panfrost/panfrost_mmu.c | 8 +++++++-
|
|
1 file changed, 7 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/drivers/gpu/drm/panfrost/panfrost_mmu.c b/drivers/gpu/drm/panfrost/panfrost_mmu.c
|
|
index be8d68fb0e11..9762f3639aff 100644
|
|
--- a/drivers/gpu/drm/panfrost/panfrost_mmu.c
|
|
+++ b/drivers/gpu/drm/panfrost/panfrost_mmu.c
|
|
@@ -123,6 +123,10 @@ static void panfrost_mmu_enable(struct panfrost_device *pfdev, struct panfrost_m
|
|
/* Need to revisit mem attrs.
|
|
* NC is the default, Mali driver is inner WT.
|
|
*/
|
|
+ if (panfrost_model_eq(pfdev, 0x620)) {
|
|
+ memattr &= ~0xf0f0f0ULL;
|
|
+ memattr |= 0x404040;
|
|
+ }
|
|
mmu_write(pfdev, AS_MEMATTR_LO(as_nr), memattr & 0xffffffffUL);
|
|
mmu_write(pfdev, AS_MEMATTR_HI(as_nr), memattr >> 32);
|
|
|
|
@@ -186,7 +190,7 @@ u32 panfrost_mmu_as_get(struct panfrost_device *pfdev, struct panfrost_mmu *mmu)
|
|
atomic_set(&mmu->as_count, 1);
|
|
list_add(&mmu->list, &pfdev->as_lru_list);
|
|
|
|
- dev_dbg(pfdev->dev, "Assigned AS%d to mmu %p, alloc_mask=%lx", as, mmu, pfdev->as_alloc_mask);
|
|
+ dev_dbg(pfdev->dev, "Assigned AS%d to mmu %px, alloc_mask=%lx", as, mmu, pfdev->as_alloc_mask);
|
|
|
|
panfrost_mmu_enable(pfdev, mmu);
|
|
|
|
@@ -287,6 +291,8 @@ int panfrost_mmu_map(struct panfrost_gem_mapping *mapping)
|
|
|
|
if (bo->noexec)
|
|
prot |= IOMMU_NOEXEC;
|
|
+ if (bo->is_heap)
|
|
+ prot |= IOMMU_CACHE;
|
|
|
|
sgt = drm_gem_shmem_get_pages_sgt(obj);
|
|
if (WARN_ON(IS_ERR(sgt)))
|
|
--
|
|
2.31.1
|
|
|