Skip to content

drm/ast: Detect device type before init

Thomas Zimmermann dri-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest10 patches 3 repliesIn review
  2. v110 patches 3 repliesSuperseded

Changes in v2 from the cover letter

* add missing break statements (Jocelyn)
* fix length test for I/O range

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10drm/ast: Turn ioregs_lock to modeset_lockdrivers/gpu/drm/ast/ast_drv.h drivers/gpu/drm/ast/ast_main.c drivers/gpu/drm/ast/ast_mode.c+17 -160 replies
2/10drm/ast: Rework I/O register setupdrivers/gpu/drm/ast/ast_main.c drivers/gpu/drm/ast/ast_reg.h+31 -100 replies
3/10drm/ast: Retrieve I/O-memory ranges without ast devicedrivers/gpu/drm/ast/ast_main.c+11 -60 replies
4/10drm/ast: Add I/O helpers without ast devicedrivers/gpu/drm/ast/ast_drv.h+56 -171 reply
5/10drm/ast: Enable VGA without ast device instancedrivers/gpu/drm/ast/ast_main.c drivers/gpu/drm/ast/ast_reg.h+19 -190 replies
6/10drm/ast: Enable MMIO without ast device instancedrivers/gpu/drm/ast/ast_main.c drivers/gpu/drm/ast/ast_reg.h+11 -70 replies
7/10drm/ast: Partially implement POST without ast device instancedrivers/gpu/drm/ast/ast_drv.h drivers/gpu/drm/ast/ast_main.c drivers/gpu/drm/ast/ast_post.c+47 -300 replies
8/10drm/ast: Add enum ast_config_modedrivers/gpu/drm/ast/ast_drv.h+8 -50 replies
9/10drm/ast: Detect ast device type and config mode without ast devicedrivers/gpu/drm/ast/ast_main.c+59 -470 replies
10/10drm/ast: Move detection code into PCI probe helperdrivers/gpu/drm/ast/ast_drv.c drivers/gpu/drm/ast/ast_drv.h drivers/gpu/drm/ast/ast_main.c+274 -2690 replies

Reviews trailers per patch

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

PatchJocelyn FalempeSui Jingfeng
SeriesT-b
1/10R-b
2/10R-b
3/10R-b
4/10R-b
5/10R-b
6/10R-b
7/10R-b
8/10R-b
9/10R-b
10/10R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 00/10] drm/ast: Detect device type before init

Detecting the ast device's chipset type and configuration mode involves several registers, DT properties and possibly POSTing parts of the chip. It is preferable to do this before initializing the DRM driver, so that that each chip type can have an individual setup code.

The patchset addresses the problem by moving all early detection code before the allocation of the ast device.

Patch one gets a lock out of the way. The lock is only relevant for mode setting. Move it there.

Patches 2 and 3 rework the detection of the correct I/O memory ranges. It is now self-contained, more readable and works without an instance of struct ast_device.

Patches 4 to 7 rework the setup of various registers that are required for detection. Access helpers for I/O can now operate without an instance of struct ast_device. The setup functions operate on the I/O ranges that have been made available with patch 3, but again without struct ast_device.

With the detection's internals done, patches 8 and 9 rework the chip's and config-mode's detection code to operate without struct ast_device as well.

Finally, patch 10 moves the detection code into the PCI probe function. it runs before any of the DRM device code. The function for creating an ast device, ast_device_create(), receives the detected I/O memory ranges, chip type and configuration mode.

This cleans up the detection code. There is more chip-specific code in other parts of the driver. In a later patch, the ast device setup can be split up so that each chip type gets its own code path that does not interfere with other chips.

Tested on AST1100 and AST2100.

v2:
* add missing break statements (Jocelyn)
* fix length test for I/O range

Thomas Zimmermann (10):
drm/ast: Turn ioregs_lock to modeset_lock
drm/ast: Rework I/O register setup
drm/ast: Retrieve I/O-memory ranges without ast device drm/ast: Add I/O helpers without ast device
drm/ast: Enable VGA without ast device instance drm/ast: Enable MMIO without ast device instance drm/ast: Partially implement POST without ast device instance drm/ast: Add enum ast_config_mode
drm/ast: Detect ast device type and config mode without ast device drm/ast: Move detection code into PCI probe helper

 drivers/gpu/drm/ast/ast_drv.c  | 263 ++++++++++++++++++++++++++++++++-
 drivers/gpu/drm/ast/ast_drv.h  | 101 +++++++++----
 drivers/gpu/drm/ast/ast_main.c | 244 ++----------------------------
 drivers/gpu/drm/ast/ast_mode.c |  26 ++--
 drivers/gpu/drm/ast/ast_post.c |  73 +++++----
 drivers/gpu/drm/ast/ast_reg.h  |  12 +-
 6 files changed, 413 insertions(+), 306 deletions(-)

base-commit: b7816c393496dc4497c1327310821407f7171d8b
prerequisite-patch-id: 0aa359f6144c4015c140c8a6750be19099c676fb
prerequisite-patch-id: c67e5d886a47b7d0266d81100837557fda34cb24
prerequisite-patch-id: cbc453ee02fae02af22fbfdce56ab732c7a88c36

Signature · 1 line
2.42.0