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

Jocelyn Falempe jfalempe at redhat.com
Tue Jun 20 13:26:51 UTC 2023


On 16/06/2023 15:52, Thomas Zimmermann wrote:
> 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.

That's a very good thing, the handling of different AST revisions was a 
bit messy, and there was bugs when a new one was introduced.
> 
> 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.

I've also tested (remotely) on AST2600

For the whole series:

Reviewed-by: Jocelyn Falempe <jfalempe at redhat.com>
Tested-by: Jocelyn Falempe <jfalempe at redhat.com>

> 
> 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(-)
> 



More information about the dri-devel mailing list