diff options
author | Thomas Zimmermann <tzimmermann@suse.de> | 2023-06-21 14:53:44 +0200 |
---|---|---|
committer | Thomas Zimmermann <tzimmermann@suse.de> | 2023-06-27 14:26:36 +0200 |
commit | 6bd576da31872006d8489cadc1ee2fe03653fc8d (patch) | |
tree | 2288d78d1dcabe126c5b52891cb55a0f1601eda9 /drivers/gpu/drm/ast | |
parent | drm/ast: Distinguish among chip generations (diff) | |
download | linux-6bd576da31872006d8489cadc1ee2fe03653fc8d.tar.xz linux-6bd576da31872006d8489cadc1ee2fe03653fc8d.zip |
drm/ast: Detect AST 1300 model
Detect the 4th-generation AST 1300. Allows to simplify the code
for widescreen support.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Tested-by: Jocelyn Falempe <jfalempe@redhat.com> # AST2600
Link: https://patchwork.freedesktop.org/patch/msgid/20230621130032.3568-11-tzimmermann@suse.de
Diffstat (limited to 'drivers/gpu/drm/ast')
-rw-r--r-- | drivers/gpu/drm/ast/ast_drv.h | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/ast/ast_main.c | 15 |
2 files changed, 12 insertions, 5 deletions
diff --git a/drivers/gpu/drm/ast/ast_drv.h b/drivers/gpu/drm/ast/ast_drv.h index 803d72a60506..8199834f8fbe 100644 --- a/drivers/gpu/drm/ast/ast_drv.h +++ b/drivers/gpu/drm/ast/ast_drv.h @@ -67,7 +67,7 @@ enum ast_chip { AST2150 = __AST_CHIP(3, 1), /* 4th gen */ AST2300 = __AST_CHIP(4, 0), - AST1300 = __AST_CHIP(4, 1), // unused + AST1300 = __AST_CHIP(4, 1), AST1050 = __AST_CHIP(4, 2), // unused /* 5th gen */ AST2400 = __AST_CHIP(5, 0), diff --git a/drivers/gpu/drm/ast/ast_main.c b/drivers/gpu/drm/ast/ast_main.c index 8fc412fe296c..7513924a5437 100644 --- a/drivers/gpu/drm/ast/ast_main.c +++ b/drivers/gpu/drm/ast/ast_main.c @@ -169,8 +169,16 @@ static int ast_detect_chip(struct drm_device *dev, bool need_post, u32 scu_rev) ast->chip = AST2400; drm_info(dev, "AST 2400 detected\n"); } else if (pdev->revision >= 0x20) { - ast->chip = AST2300; - drm_info(dev, "AST 2300 detected\n"); + switch (scu_rev & 0x300) { + case 0x0000: + ast->chip = AST1300; + drm_info(dev, "AST 1300 detected\n"); + break; + default: + ast->chip = AST2300; + drm_info(dev, "AST 2300 detected\n"); + break; + } } else if (pdev->revision >= 0x10) { switch (scu_rev & 0x0300) { case 0x0200: @@ -208,8 +216,7 @@ static int ast_detect_chip(struct drm_device *dev, bool need_post, u32 scu_rev) ast->support_wide_screen = true; else { ast->support_wide_screen = false; - if (ast->chip == AST2300 && - (scu_rev & 0x300) == 0x0) /* ast1300 */ + if (ast->chip == AST1300) ast->support_wide_screen = true; if (ast->chip == AST2400 && (scu_rev & 0x300) == 0x100) /* ast1400 */ |