Skip to content

drm/ast: Refactor the device-detection code

Thomas Zimmermann dri-devel stable 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest14 patches 7 repliesIn review
  2. v114 patches 24 repliesSuperseded

Changes in v2 from the cover letter

* use standard 16-bit PCI access (Jingfeng)
* various cleanups

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/14drm/ast: Fix DRAM init on AST2200drivers/gpu/drm/ast/ast_post.c+1 -10 replies
2/14drm/ast: Remove vga2_clone fielddrivers/gpu/drm/ast/ast_drv.h drivers/gpu/drm/ast/ast_main.c+0 -20 replies
3/14drm/ast: Implement register helpers in ast_drv.hdrivers/gpu/drm/ast/ast_drv.h drivers/gpu/drm/ast/ast_main.c+24 -380 replies
4/14drm/ast: Remove dead else branch in POST codedrivers/gpu/drm/ast/ast_post.c+3 -90 replies
5/14drm/ast: Remove device POSTing and config from chip detectiondrivers/gpu/drm/ast/ast_main.c+25 -270 replies
6/14drm/ast: Set PCI config before accessing I/O registersdrivers/gpu/drm/ast/ast_drv.h drivers/gpu/drm/ast/ast_main.c drivers/gpu/drm/ast/ast_post.c+21 -74 replies
7/14drm/ast: Enable and unlock device access early during initdrivers/gpu/drm/ast/ast_drv.h drivers/gpu/drm/ast/ast_main.c drivers/gpu/drm/ast/ast_mm.c +1 more+30 -390 replies
8/14drm/ast: Set up release action right after enabling MMIOdrivers/gpu/drm/ast/ast_main.c+19 -190 replies
9/14drm/ast: Distinguish among chip generationsdrivers/gpu/drm/ast/ast_dp501.c drivers/gpu/drm/ast/ast_drv.h drivers/gpu/drm/ast/ast_main.c +2 more+89 -571 reply
10/14drm/ast: Detect AST 1300 modeldrivers/gpu/drm/ast/ast_drv.h drivers/gpu/drm/ast/ast_main.c+12 -50 replies
11/14drm/ast: Detect AST 1400 modeldrivers/gpu/drm/ast/ast_drv.h drivers/gpu/drm/ast/ast_main.c+11 -50 replies
12/14drm/ast: Detect AST 2510 modeldrivers/gpu/drm/ast/ast_drv.h drivers/gpu/drm/ast/ast_main.c+11 -50 replies
13/14drm/ast: Move widescreen and tx-chip detection into separate helpersdrivers/gpu/drm/ast/ast_main.c+15 -30 replies
14/14drm/ast: Merge config and chip detectiondrivers/gpu/drm/ast/ast_main.c+57 -511 reply

Reviews trailers per patch

All 14 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchSui JingfengJocelyn FalempeJammy Huang
SeriesR-b
1/14R-b R-b T-b
2/14R-b R-b T-b
3/14R-b R-b T-b
4/14R-b T-b
5/14R-b T-b
6/14R-b R-b T-b
7/14R-b T-b
8/14T-b R-b R-b T-b
9/14R-b R-b T-b
10/14R-b T-b
11/14R-b T-b
12/14R-b T-b
13/14R-b T-b R-b T-b
14/14R-b R-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 v2 thread

Cover letter [PATCH v2 00/14] drm/ast: Refactor the device-detection code

Ast's code for detecting the device type and features is convoluted. It mixes up several state fields, chip types and sub-models. Rework the driver into something more understandable.

Patches 1 fixes a long-standing bug. The affected code has never worked correctly.

Patches 2 to 8 make various changes to the init code, or remove dead and duplicated code paths.

Patch 9 introduces chip generations. Until now, ast used the value of enum ast_chip to represent a certain set of related modes, and also used the enum to represent individal models. This makes the driver code hard to understand in certain places. The patch encodes a chip generation in each model enum and converts the driver to use it.

Patches 10 to 12 replace duplicated model checks with the correct enum value. Detection of wide-screen functionality and the transmitter chip can then be moved into individual functions in patch 13.

Patch 14 merges the detection of the silicon revision and the chip model into a single function. Both need to be done in the same place and affect each other.

Tested on AST1100 and AST2300.

v2:
* use standard 16-bit PCI access (Jingfeng)
* various cleanups

Thomas Zimmermann (14):
drm/ast: Fix DRAM init on AST2200
drm/ast: Remove vga2_clone field
drm/ast: Implement register helpers in ast_drv.h
drm/ast: Remove dead else branch in POST code
drm/ast: Remove device POSTing and config from chip detection drm/ast: Set PCI config before accessing I/O registers drm/ast: Enable and unlock device access early during init drm/ast: Set up release action right after enabling MMIO drm/ast: Distinguish among chip generations
drm/ast: Detect AST 1300 model
drm/ast: Detect AST 1400 model
drm/ast: Detect AST 2510 model
drm/ast: Move widescreen and tx-chip detection into separate helpers drm/ast: Merge config and chip detection

 drivers/gpu/drm/ast/ast_dp501.c |   6 +-
 drivers/gpu/drm/ast/ast_drv.h   |  94 +++++++---
 drivers/gpu/drm/ast/ast_main.c  | 319 +++++++++++++++++++-------------
 drivers/gpu/drm/ast/ast_mm.c    |   2 -
 drivers/gpu/drm/ast/ast_mode.c  |  35 ++--
 drivers/gpu/drm/ast/ast_post.c  |  74 ++------
 6 files changed, 290 insertions(+), 240 deletions(-)

base-commit: 32e260cd0d16cee6f33e747679f168d63ea54bf6
prerequisite-patch-id: 0aa359f6144c4015c140c8a6750be19099c676fb
prerequisite-patch-id: c67e5d886a47b7d0266d81100837557fda34cb24
prerequisite-patch-id: cbc453ee02fae02af22fbfdce56ab732c7a88c36
prerequisite-patch-id: d3145eae4b35a1290199af6ff6cd5abfebc82033
prerequisite-patch-id: 242b6bc45675f1f1a62572542d75c89d4864f15a

Signature · 1 line
2.41.0