dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/14] drm/ast: Refactor the device-detection code
@ 2023-06-16 13:52 Thomas Zimmermann
  2023-06-16 13:52 ` [PATCH 01/14] drm/ast: Fix DRAM init on AST2200 Thomas Zimmermann
                   ` (15 more replies)
  0 siblings, 16 replies; 39+ messages in thread
From: Thomas Zimmermann @ 2023-06-16 13:52 UTC (permalink / raw)
  To: airlied, jfalempe, daniel, jammy_huang; +Cc: Thomas Zimmermann, dri-devel

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 somehting 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 s single function. Both need to be done in the same place
and affect each other.

Tested on AST1100 and AST2300.

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   |  97 +++++++---
 drivers/gpu/drm/ast/ast_main.c  | 320 +++++++++++++++++++-------------
 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, 294 insertions(+), 240 deletions(-)

-- 
2.41.0


^ permalink raw reply	[flat|nested] 39+ messages in thread

end of thread, other threads:[~2023-06-21 11:53 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-16 13:52 [PATCH 00/14] drm/ast: Refactor the device-detection code Thomas Zimmermann
2023-06-16 13:52 ` [PATCH 01/14] drm/ast: Fix DRAM init on AST2200 Thomas Zimmermann
2023-06-16 14:32   ` [01/14] " Sui Jingfeng
2023-06-16 13:52 ` [PATCH 02/14] drm/ast: Remove vga2_clone field Thomas Zimmermann
2023-06-16 16:31   ` [02/14] " Sui Jingfeng
2023-06-16 13:52 ` [PATCH 03/14] drm/ast: Implement register helpers in ast_drv.h Thomas Zimmermann
2023-06-17  6:54   ` [03/14] " Sui Jingfeng
2023-06-16 13:52 ` [PATCH 04/14] drm/ast: Remove dead else branch in POST code Thomas Zimmermann
2023-06-16 13:52 ` [PATCH 05/14] drm/ast: Remove device POSTing and config from chip detection Thomas Zimmermann
2023-06-16 13:52 ` [PATCH 06/14] drm/ast: Set PCI config before accessing I/O registers Thomas Zimmermann
2023-06-17  7:54   ` [06/14] " Sui Jingfeng
2023-06-19  8:16     ` Thomas Zimmermann
2023-06-19  8:46       ` Sui Jingfeng
2023-06-17  8:01   ` Sui Jingfeng
2023-06-19  7:59     ` Thomas Zimmermann
2023-06-19  8:08       ` Sui Jingfeng
2023-06-19  8:19       ` Sui Jingfeng
2023-06-19  8:24         ` Thomas Zimmermann
2023-06-16 13:52 ` [PATCH 07/14] drm/ast: Enable and unlock device access early during init Thomas Zimmermann
2023-06-16 13:52 ` [PATCH 08/14] drm/ast: Set up release action right after enabling MMIO Thomas Zimmermann
2023-06-19  1:57   ` [08/14] " Sui Jingfeng
2023-06-19  8:22     ` Thomas Zimmermann
2023-06-21 11:48       ` Thomas Zimmermann
2023-06-21 11:53         ` Sui Jingfeng
2023-06-16 13:52 ` [PATCH 09/14] drm/ast: Distinguish among chip generations Thomas Zimmermann
2023-06-17  8:35   ` [09/14] " Sui Jingfeng
2023-06-19  8:22     ` Thomas Zimmermann
2023-06-19  8:29       ` Sui Jingfeng
2023-06-16 13:52 ` [PATCH 10/14] drm/ast: Detect AST 1300 model Thomas Zimmermann
2023-06-16 13:52 ` [PATCH 11/14] drm/ast: Detect AST 1400 model Thomas Zimmermann
2023-06-16 13:52 ` [PATCH 12/14] drm/ast: Detect AST 2510 model Thomas Zimmermann
2023-06-16 13:52 ` [PATCH 13/14] drm/ast: Move widescreen- and tx-chip detection into separate helpers Thomas Zimmermann
2023-06-18  9:35   ` [13/14] " Sui Jingfeng
2023-06-19  2:53   ` Sui Jingfeng
2023-06-16 13:52 ` [PATCH 14/14] drm/ast: Merge config and chip detection Thomas Zimmermann
2023-06-19  3:15   ` [14/14] " Sui Jingfeng
2023-06-19  8:40     ` Thomas Zimmermann
2023-06-16 14:30 ` [PATCH 00/14] drm/ast: Refactor the device-detection code Sui Jingfeng
2023-06-20 13:26 ` Jocelyn Falempe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox