Store the physical base address of the GPU MMIO region in TyrDrmDeviceData. This will be used by the Panthor userspace-MMIO mmap path to derive the physical PFNs inserted into userspace VMAs for USER register page mappings. Co-developed-by: Daniel Almeida Signed-off-by: Daniel Almeida Signed-off-by: Deborah Brouwer --- drivers/gpu/drm/tyr/driver.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/tyr/driver.rs b/drivers/gpu/drm/tyr/driver.rs index e20a5978eed6..2ba0a22a225b 100644 --- a/drivers/gpu/drm/tyr/driver.rs +++ b/drivers/gpu/drm/tyr/driver.rs @@ -19,7 +19,8 @@ drm::ioctl, io::{ poll, - Io, // + Io, + PhysAddr, // }, new_mutex, of, @@ -60,6 +61,9 @@ pub(crate) struct TyrPlatformDriverData { pub(crate) struct TyrDrmDeviceData { pub(crate) pdev: ARef, + /// Physical base address of the MMIO region. + pub(crate) mmio_phys_addr: PhysAddr, + #[pin] clks: Mutex, @@ -119,6 +123,7 @@ fn probe( let mali_regulator = Regulator::::get(pdev.as_ref(), c"mali")?; let sram_regulator = Regulator::::get(pdev.as_ref(), c"sram")?; + let mmio_phys_addr = pdev.resource_by_index(0).ok_or(ENODEV)?.start(); let request = pdev.io_request_by_index(0).ok_or(ENODEV)?; let iomem = Arc::pin_init(request.iomap_sized::(), GFP_KERNEL)?; @@ -140,6 +145,7 @@ fn probe( let data = try_pin_init!(TyrDrmDeviceData { pdev: platform.clone(), + mmio_phys_addr, clks <- new_mutex!(Clocks { core: core_clk, stacks: stacks_clk, -- 2.53.0