summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/ast
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2023-06-21 15:53:46 +0300
committerThomas Zimmermann <tzimmermann@suse.de>2023-06-27 15:26:38 +0300
commit52c29330ebdd592483a98f5e46c60af83084cc7f (patch)
tree5f90c755d9eae71cd1f42963b4dbce2063487eb7 /drivers/gpu/drm/ast
parent86d86d1ba24b3bc16706d4b72735e54c14ffc982 (diff)
downloadlinux-52c29330ebdd592483a98f5e46c60af83084cc7f.tar.xz
drm/ast: Detect AST 2510 model
Detect the 6th-generation AST 2510. 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-13-tzimmermann@suse.de
Diffstat (limited to 'drivers/gpu/drm/ast')
-rw-r--r--drivers/gpu/drm/ast/ast_drv.h2
-rw-r--r--drivers/gpu/drm/ast/ast_main.c14
2 files changed, 11 insertions, 5 deletions
diff --git a/drivers/gpu/drm/ast/ast_drv.h b/drivers/gpu/drm/ast/ast_drv.h
index 876ebbd3b60e..3f6e0c984523 100644
--- a/drivers/gpu/drm/ast/ast_drv.h
+++ b/drivers/gpu/drm/ast/ast_drv.h
@@ -75,7 +75,7 @@ enum ast_chip {
AST1250 = __AST_CHIP(5, 2), // unused
/* 6th gen */
AST2500 = __AST_CHIP(6, 0),
- AST2510 = __AST_CHIP(6, 1), // unused
+ AST2510 = __AST_CHIP(6, 1),
AST2520 = __AST_CHIP(6, 2), // unused
/* 7th gen */
AST2600 = __AST_CHIP(7, 0),
diff --git a/drivers/gpu/drm/ast/ast_main.c b/drivers/gpu/drm/ast/ast_main.c
index cbfe93c7929d..f2f8a054c52c 100644
--- a/drivers/gpu/drm/ast/ast_main.c
+++ b/drivers/gpu/drm/ast/ast_main.c
@@ -163,8 +163,15 @@ static int ast_detect_chip(struct drm_device *dev, bool need_post, u32 scu_rev)
ast->chip = AST2600;
drm_info(dev, "AST 2600 detected\n");
} else if (pdev->revision >= 0x40) {
- ast->chip = AST2500;
- drm_info(dev, "AST 2500 detected\n");
+ switch (scu_rev & 0x300) {
+ case 0x0100:
+ ast->chip = AST2510;
+ drm_info(dev, "AST 2510 detected\n");
+ break;
+ default:
+ ast->chip = AST2500;
+ drm_info(dev, "AST 2500 detected\n");
+ }
} else if (pdev->revision >= 0x30) {
switch (scu_rev & 0x300) {
case 0x0100:
@@ -227,8 +234,7 @@ static int ast_detect_chip(struct drm_device *dev, bool need_post, u32 scu_rev)
ast->support_wide_screen = true;
if (ast->chip == AST1400)
ast->support_wide_screen = true;
- if (ast->chip == AST2500 &&
- scu_rev == 0x100) /* ast2510 */
+ if (ast->chip == AST2510)
ast->support_wide_screen = true;
if (IS_AST_GEN7(ast))
ast->support_wide_screen = true;