Skip to content

Commit bd7ffbc

Browse files
Alyssa RosenzweigSteven Price
authored andcommitted
drm/panfrost: Clamp lock region to Bifrost minimum
When locking a region, we currently clamp to a PAGE_SIZE as the minimum lock region. While this is valid for Midgard, it is invalid for Bifrost, where the minimum locking size is 8x larger than the 4k page size. Add a hardware definition for the minimum lock region size (corresponding to KBASE_LOCK_REGION_MIN_SIZE_LOG2 in kbase) and respect it. Signed-off-by: Alyssa Rosenzweig <[email protected]> Tested-by: Chris Morgan <[email protected]> Reviewed-by: Steven Price <[email protected]> Reviewed-by: Rob Herring <[email protected]> Cc: <[email protected]> Signed-off-by: Steven Price <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent a77b588 commit bd7ffbc

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

drivers/gpu/drm/panfrost/panfrost_mmu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ static void lock_region(struct panfrost_device *pfdev, u32 as_nr,
6666
/* The size is encoded as ceil(log2) minus(1), which may be calculated
6767
* with fls. The size must be clamped to hardware bounds.
6868
*/
69-
size = max_t(u64, size, PAGE_SIZE);
69+
size = max_t(u64, size, AS_LOCK_REGION_MIN_SIZE);
7070
region_width = fls64(size - 1) - 1;
7171
region |= region_width;
7272

drivers/gpu/drm/panfrost/panfrost_regs.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,8 @@
316316
#define AS_FAULTSTATUS_ACCESS_TYPE_READ (0x2 << 8)
317317
#define AS_FAULTSTATUS_ACCESS_TYPE_WRITE (0x3 << 8)
318318

319+
#define AS_LOCK_REGION_MIN_SIZE (1ULL << 15)
320+
319321
#define gpu_write(dev, reg, data) writel(data, dev->iomem + reg)
320322
#define gpu_read(dev, reg) readl(dev->iomem + reg)
321323

0 commit comments

Comments
 (0)