Include AST2600 in most of the branches for AST2500. Thereby revert
most effects of commit f9bd00e0ea9d ("drm/ast: Create chip AST2600").
The AST2600 used to be treated like an AST2500, which at least gave
usable display output. After introducing AST2600 in the driver without
further updates, lots of functions take the wrong branches.
Handling AST2600 in the AST2500 branches reverts back to the original
settings. The exception are cases where AST2600 meanwhile got its own
branch.
Reported-by: Jocelyn Falempe <jfalempe@xxxxxxxxxx>
Signed-off-by: Thomas Zimmermann <tzimmermann@xxxxxxx>
Suggested-by: Jocelyn Falempe <jfalempe@xxxxxxxxxx>
Fixes: f9bd00e0ea9d ("drm/ast: Create chip AST2600")
Cc: KuoHsiang Chou <kuohsiang_chou@xxxxxxxxxxxxxx>
Cc: Dave Airlie <airlied@xxxxxxxxxx>
Cc: dri-devel@xxxxxxxxxxxxxxxxxxxxx
Cc: <stable@xxxxxxxxxxxxxxx> # v5.11+
---
drivers/gpu/drm/ast/ast_main.c | 4 ++--
drivers/gpu/drm/ast/ast_mode.c | 6 +++---
drivers/gpu/drm/ast/ast_post.c | 6 +++---
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/ast/ast_main.c
b/drivers/gpu/drm/ast/ast_main.c
index d770d5a23c1a..56b2ac138375 100644
--- a/drivers/gpu/drm/ast/ast_main.c
+++ b/drivers/gpu/drm/ast/ast_main.c
@@ -307,7 +307,7 @@ static int ast_get_dram_info(struct drm_device *dev)
default:
ast->dram_bus_width = 16;
ast->dram_type = AST_DRAM_1Gx16;
- if (ast->chip == AST2500)
+ if ((ast->chip == AST2500) || (ast->chip == AST2600))
ast->mclk = 800;
else
ast->mclk = 396;
@@ -319,7 +319,7 @@ static int ast_get_dram_info(struct drm_device *dev)
else
ast->dram_bus_width = 32;
- if (ast->chip == AST2500) {
+ if ((ast->chip == AST2600) || (ast->chip == AST2500)) {
switch (mcr_cfg & 0x03) {
case 0:
ast->dram_type = AST_DRAM_1Gx16;
diff --git a/drivers/gpu/drm/ast/ast_mode.c
b/drivers/gpu/drm/ast/ast_mode.c
index 323af2746aa9..1dde30b98317 100644
--- a/drivers/gpu/drm/ast/ast_mode.c
+++ b/drivers/gpu/drm/ast/ast_mode.c
@@ -310,7 +310,7 @@ static void ast_set_crtc_reg(struct ast_private *ast,
u8 jreg05 = 0, jreg07 = 0, jreg09 = 0, jregAC = 0, jregAD = 0,
jregAE = 0;
u16 temp, precache = 0;
- if ((ast->chip == AST2500) &&
+ if (((ast->chip == AST2600) || (ast->chip == AST2500)) &&
(vbios_mode->enh_table->flags & AST2500PreCatchCRT))
precache = 40;
@@ -428,7 +428,7 @@ static void ast_set_dclk_reg(struct ast_private *ast,
{
const struct ast_vbios_dclk_info *clk_info;
- if (ast->chip == AST2500)
+ if ((ast->chip == AST2600) || (ast->chip == AST2500))
clk_info =
&dclk_table_ast2500[vbios_mode->enh_table->dclk_index];
else
clk_info = &dclk_table[vbios_mode->enh_table->dclk_index];
@@ -476,7 +476,7 @@ static void ast_set_crtthd_reg(struct ast_private
*ast)
ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xa7, 0xe0);
ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xa6, 0xa0);
} else if (ast->chip == AST2300 || ast->chip == AST2400 ||
- ast->chip == AST2500) {
+ ast->chip == AST2500 || ast->chip == AST2600) {
ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xa7, 0x78);
ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xa6, 0x60);
} else if (ast->chip == AST2100 ||
diff --git a/drivers/gpu/drm/ast/ast_post.c
b/drivers/gpu/drm/ast/ast_post.c
index 0aa9cf0fb5c3..eb1ff9084034 100644
--- a/drivers/gpu/drm/ast/ast_post.c
+++ b/drivers/gpu/drm/ast/ast_post.c
@@ -80,7 +80,7 @@ ast_set_def_ext_reg(struct drm_device *dev)
ast_set_index_reg(ast, AST_IO_CRTC_PORT, i, 0x00);
if (ast->chip == AST2300 || ast->chip == AST2400 ||
- ast->chip == AST2500) {
+ ast->chip == AST2500 || ast->chip == AST2600) {
if (pdev->revision >= 0x20)
ext_reg_info = extreginfo_ast2300;
else
@@ -105,7 +105,7 @@ ast_set_def_ext_reg(struct drm_device *dev)
/* Enable RAMDAC for A1 */
reg = 0x04;
if (ast->chip == AST2300 || ast->chip == AST2400 ||
- ast->chip == AST2500)
+ ast->chip == AST2500 || ast->chip == AST2600)
reg |= 0x20;
ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xb6, 0xff, reg);
}
@@ -382,7 +382,7 @@ void ast_post_gpu(struct drm_device *dev)
if (ast->chip == AST2600) {
ast_dp_launch(dev, 1);
} else if (ast->config_mode == ast_use_p2a) {
- if (ast->chip == AST2500)
+ if (ast->chip == AST2500 || ast->chip == AST2600)
ast_post_chip_2500(dev);
else if (ast->chip == AST2300 || ast->chip == AST2400)
ast_post_chip_2300(dev);