Skip to content

drm/panthor: Localize register access by component

Karunika Choo dri-devel lkml 3 versions – Applied

Status from this message: Pushed to drm-misc-next.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest8 patches 12 repliesApplied
  2. v28 patches 20 repliesSuperseded
  3. v18 patches 15 repliesSuperseded

Changes in v3 from the cover letter

- Picked up Acks and Reviewed-bys from Boris, Liviu, and Steve.
- Cleaned up definition of pwr->iomem and pwr->irq.iomem.
- Link to v2: https://lore.kernel.org/all/[email protected]/

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/8drm/panthor: Pass an iomem pointer to GPU register access helpersdrivers/gpu/drm/panthor/panthor_device.c drivers/gpu/drm/panthor/panthor_device.h drivers/gpu/drm/panthor/panthor_drv.c +6 more+146 -1431 reply
2/8drm/panthor: Split register definitions by componentsdrivers/gpu/drm/panthor/panthor_device.c drivers/gpu/drm/panthor/panthor_drv.c drivers/gpu/drm/panthor/panthor_fw.c +12 more+318 -3011 reply
3/8drm/panthor: Replace cross-component register accesses with helpersdrivers/gpu/drm/panthor/panthor_device.c drivers/gpu/drm/panthor/panthor_drv.c drivers/gpu/drm/panthor/panthor_fw.c +5 more+61 -371 reply
4/8drm/panthor: Store IRQ register base iomem pointer in panthor_irqdrivers/gpu/drm/panthor/panthor_device.h drivers/gpu/drm/panthor/panthor_fw.c drivers/gpu/drm/panthor/panthor_fw_regs.h +5 more+42 -203 replies
5/8drm/panthor: Use a local iomem base for GPU registersdrivers/gpu/drm/panthor/panthor_gpu.c drivers/gpu/drm/panthor/panthor_gpu_regs.h drivers/gpu/drm/panthor/panthor_hw.c+56 -470 replies
6/8drm/panthor: Use a local iomem base for PWR registersdrivers/gpu/drm/panthor/panthor_hw.c drivers/gpu/drm/panthor/panthor_pwr.c drivers/gpu/drm/panthor/panthor_pwr_regs.h+79 -583 replies
7/8drm/panthor: Use a local iomem base for firmware control registersdrivers/gpu/drm/panthor/panthor_fw.c drivers/gpu/drm/panthor/panthor_fw_regs.h+17 -141 reply
8/8drm/panthor: Use a local iomem base for MMU AS registersdrivers/gpu/drm/panthor/panthor_mmu.c drivers/gpu/drm/panthor/panthor_mmu_regs.h+25 -201 reply

Reviews trailers per patch

All 8 patches have a Reviewed-by or Acked-by.

PatchSteven PriceLiviu DudauBoris Brezillon
1/8R-b R-b A-b T-b
2/8R-b R-b A-b T-b
3/8R-b R-b A-b T-b
4/8R-b R-b R-b T-b
5/8R-b R-b
6/8R-b R-b A-b
7/8R-b R-b A-b T-b
8/8R-b R-b A-b T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v3 thread

Cover letter [PATCH v3 0/8] drm/panthor: Localize register access by component

Hi all,

This series refactors the panthor register access paths so that each component uses its own local iomem base instead of relying on the global device mapping throughout the driver.

Today a number of register definitions and helpers are still expressed in terms of the full device register space, which makes it easy for one component to reach into another component's registers.

The series prepares the driver for a cleaner per-component layout in 3 steps:
- make the low-level GPU register helpers operate on an iomem pointer rather than a panthor_device pointer
- split register definitions and move cross-component accesses behind helpers owned by the relevant component
- convert GPU, PWR, firmware and MMU code to use component-local iomem bases, while keeping IRQ handling on a dedicated IRQ-local base.

The end result is that register accesses become more obviously scoped to the component that owns them, cross-component register accesses are removed from callers, and the common IRQ helpers no longer depend on absolute register offsets.

No functional change is intended.

v3:
- Picked up Acks and Reviewed-bys from Boris, Liviu, and Steve.
- Cleaned up definition of pwr->iomem and pwr->irq.iomem.
- Link to v2: https://lore.kernel.org/all/[email protected]/
v2:
- Picked up Acks from Boris.
- Moved GPU_ID definitions into panthor_gpu_regs.h and deleted panthor_hw_regs.h
- Fixed incorrect spelling of timestamp helper functions.
- Changed IRQ request function to take an iomem pointer instead of an offset.
- Update panthor_gpu_info_init() to use the correct block-local iomem pointers for register accesses.
- Link to v1: https://lore.kernel.org/all/[email protected]/

Kind regards,
Karunika

Karunika Choo (8):
drm/panthor: Pass an iomem pointer to GPU register access helpers drm/panthor: Split register definitions by components drm/panthor: Replace cross-component register accesses with helpers drm/panthor: Store IRQ register base iomem pointer in panthor_irq drm/panthor: Use a local iomem base for GPU registers drm/panthor: Use a local iomem base for PWR registers drm/panthor: Use a local iomem base for firmware control registers drm/panthor: Use a local iomem base for MMU AS registers

 drivers/gpu/drm/panthor/panthor_device.c   |  28 +-
 drivers/gpu/drm/panthor/panthor_device.h   |  92 ++++---
 drivers/gpu/drm/panthor/panthor_drv.c      |   7 +-
 drivers/gpu/drm/panthor/panthor_fw.c       |  40 ++-
 drivers/gpu/drm/panthor/panthor_fw.h       |   1 +
 drivers/gpu/drm/panthor/panthor_fw_regs.h  |  29 ++
 drivers/gpu/drm/panthor/panthor_gpu.c      | 101 +++++--
 drivers/gpu/drm/panthor/panthor_gpu.h      |   6 +
 drivers/gpu/drm/panthor/panthor_gpu_regs.h | 119 +++++++++
 drivers/gpu/drm/panthor/panthor_heap.c     |   2 +-
 drivers/gpu/drm/panthor/panthor_hw.c       |  54 ++--
 drivers/gpu/drm/panthor/panthor_hw.h       |   2 +-
 drivers/gpu/drm/panthor/panthor_mmu.c      |  46 ++--
 drivers/gpu/drm/panthor/panthor_mmu_regs.h |  69 +++++
 drivers/gpu/drm/panthor/panthor_pwr.c      |  93 ++++---
 drivers/gpu/drm/panthor/panthor_pwr_regs.h |  79 ++++++
 drivers/gpu/drm/panthor/panthor_regs.h     | 291 ---------------------
 drivers/gpu/drm/panthor/panthor_sched.c    |   5 +-
 18 files changed, 584 insertions(+), 480 deletions(-)
 create mode 100644 drivers/gpu/drm/panthor/panthor_fw_regs.h
 create mode 100644 drivers/gpu/drm/panthor/panthor_gpu_regs.h
 create mode 100644 drivers/gpu/drm/panthor/panthor_mmu_regs.h
 create mode 100644 drivers/gpu/drm/panthor/panthor_pwr_regs.h
 delete mode 100644 drivers/gpu/drm/panthor/panthor_regs.h

--
2.43.0