Skip to content

Commit f19a78b

Browse files
committed
drm/asahi: RiiR page tables
1 parent 39ce531 commit f19a78b

5 files changed

Lines changed: 620 additions & 230 deletions

File tree

drivers/gpu/drm/asahi/alloc.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ use crate::object::{
3636
use crate::util::RangeExt;
3737

3838
use core::cmp::Ordering;
39+
use core::fmt;
3940
use core::fmt::{
40-
self,
4141
Debug,
4242
Formatter, //
4343
};
@@ -469,7 +469,7 @@ impl RawAllocation for SimpleAllocation {
469469
pub(crate) struct SimpleAllocator {
470470
dev: AsahiDevRef,
471471
range: Range<u64>,
472-
prot: u32,
472+
prot: mmu::Prot,
473473
vm: mmu::Vm,
474474
min_align: usize,
475475
cpu_maps: bool,
@@ -484,7 +484,7 @@ impl SimpleAllocator {
484484
vm: &mmu::Vm,
485485
range: Range<u64>,
486486
min_align: usize,
487-
prot: u32,
487+
prot: mmu::Prot,
488488
_block_size: usize,
489489
mut cpu_maps: bool,
490490
_name: fmt::Arguments<'_>,
@@ -678,7 +678,7 @@ pub(crate) struct HeapAllocator {
678678
dev: AsahiDevRef,
679679
range: Range<u64>,
680680
top: u64,
681-
prot: u32,
681+
prot: mmu::Prot,
682682
vm: mmu::Vm,
683683
min_align: usize,
684684
block_size: usize,
@@ -698,7 +698,7 @@ impl HeapAllocator {
698698
vm: &mmu::Vm,
699699
range: Range<u64>,
700700
min_align: usize,
701-
prot: u32,
701+
prot: mmu::Prot,
702702
block_size: usize,
703703
mut cpu_maps: bool,
704704
name: fmt::Arguments<'_>,

drivers/gpu/drm/asahi/asahi.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ mod mem;
2020
mod microseq;
2121
mod mmu;
2222
mod object;
23+
mod pgtable;
2324
mod queue;
2425
mod regs;
2526
mod slotalloc;

drivers/gpu/drm/asahi/gem.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ impl ObjectRef {
9999
vm: &crate::mmu::Vm,
100100
range: Range<u64>,
101101
alignment: u64,
102-
prot: u32,
102+
prot: mmu::Prot,
103103
guard: bool,
104104
) -> Result<crate::mmu::KernelMapping> {
105105
// Only used for kernel objects now
@@ -116,7 +116,7 @@ impl ObjectRef {
116116
obj_range: Range<usize>,
117117
range: Range<u64>,
118118
alignment: u64,
119-
prot: u32,
119+
prot: mmu::Prot,
120120
guard: bool,
121121
) -> Result<crate::mmu::KernelMapping> {
122122
if obj_range.end > self.gem.size() {
@@ -137,7 +137,7 @@ impl ObjectRef {
137137
&mut self,
138138
vm: &crate::mmu::Vm,
139139
addr: u64,
140-
prot: u32,
140+
prot: mmu::Prot,
141141
guard: bool,
142142
) -> Result<crate::mmu::KernelMapping> {
143143
if self.gem.flags & uapi::drm_asahi_gem_flags_DRM_ASAHI_GEM_VM_PRIVATE != 0

0 commit comments

Comments
 (0)