Skip to content

Commit 90f8a75

Browse files
committed
drm/asahi: Move the unknown dummy page to the top of the address space
Signed-off-by: Asahi Lina <[email protected]>
1 parent 9a7aeae commit 90f8a75

3 files changed

Lines changed: 12 additions & 7 deletions

File tree

drivers/gpu/drm/asahi/file.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,6 @@ const VM_DRV_GPU_END: u64 = 0x70_ffffffff;
172172
const VM_DRV_GPUFW_START: u64 = 0x71_00000000;
173173
/// End address of the kernel-managed GPU/FW shared mapping region.
174174
const VM_DRV_GPUFW_END: u64 = 0x71_ffffffff;
175-
/// Address of a special dummy page?
176-
const VM_UNK_PAGE: u64 = 0x6f_ffff8000;
177175

178176
impl drm::file::DriverFile for File {
179177
type Driver = driver::AsahiDriver;
@@ -348,7 +346,8 @@ impl File {
348346
);
349347
let mut dummy_obj = gem::new_kernel_object(device, 0x4000)?;
350348
dummy_obj.vmap()?.as_mut_slice().fill(0);
351-
let dummy_mapping = dummy_obj.map_at(&vm, VM_UNK_PAGE, mmu::PROT_GPU_SHARED_RW, true)?;
349+
let dummy_mapping =
350+
dummy_obj.map_at(&vm, mmu::IOVA_UNK_PAGE, mmu::PROT_GPU_SHARED_RW, true)?;
352351

353352
mod_dev_dbg!(device, "[File {} VM {}]: VM created\n", file_id, id);
354353
resv.store(Box::try_new(Vm {

drivers/gpu/drm/asahi/initdata.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -484,10 +484,12 @@ impl<'a> InitDataBuilder::ver<'a> {
484484
#[ver(V < V13_0B4)]
485485
unk_10: U64(0x1_00000000),
486486
unk_18: U64(0xffc00000),
487-
unk_20: U64(0x11_00000000),
488-
unk_28: U64(0x11_00000000),
489-
// userspace address?
490-
unk_30: U64(0x6f_ffff8000),
487+
// USC start
488+
unk_20: U64(0), // U64(0x11_00000000),
489+
unk_28: U64(0), // U64(0x11_00000000),
490+
// Unknown page
491+
//unk_30: U64(0x6f_ffff8000),
492+
unk_30: U64(mmu::IOVA_UNK_PAGE),
491493
// unmapped?
492494
unkptr_38: U64(0xffffffa0_11800000),
493495
// TODO: yuv matrices

drivers/gpu/drm/asahi/mmu.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ const TTBR_ASID_SHIFT: usize = 48;
8787

8888
const PTE_TABLE: u64 = 0x3; // BIT(0) | BIT(1)
8989

90+
/// Address of a special dummy page?
91+
//const IOVA_UNK_PAGE: u64 = 0x6f_ffff8000;
92+
pub(crate) const IOVA_UNK_PAGE: u64 = IOVA_USER_TOP - 2 * UAT_PGSZ as u64;
93+
9094
// KernelMapping protection types
9195

9296
// Note: prot::CACHE means "cache coherency", which for UAT means *uncached*,

0 commit comments

Comments
 (0)