Skip to content

Commit d6cbe63

Browse files
jammyaspeedThomas Zimmermann
authored andcommitted
drm/ast: Fix video broken in some resolutions on ast2600
Some cases are not handled well for ast2600. Signed-off-by: Jammy Huang <[email protected]> Signed-off-by: Thomas Zimmermann <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 71dee03 commit d6cbe63

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

drivers/gpu/drm/ast/ast_mode.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ static void ast_set_crtc_reg(struct ast_private *ast,
313313
u8 jreg05 = 0, jreg07 = 0, jreg09 = 0, jregAC = 0, jregAD = 0, jregAE = 0;
314314
u16 temp, precache = 0;
315315

316-
if ((ast->chip == AST2500) &&
316+
if ((ast->chip == AST2500 || ast->chip == AST2600) &&
317317
(vbios_mode->enh_table->flags & AST2500PreCatchCRT))
318318
precache = 40;
319319

@@ -354,6 +354,12 @@ static void ast_set_crtc_reg(struct ast_private *ast,
354354
ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xAC, 0x00, jregAC);
355355
ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xAD, 0x00, jregAD);
356356

357+
// Workaround for HSync Time non octave pixels (1920x1080@60Hz HSync 44 pixels);
358+
if ((ast->chip == AST2600) && (mode->crtc_vdisplay == 1080))
359+
ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xFC, 0xFD, 0x02);
360+
else
361+
ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xFC, 0xFD, 0x00);
362+
357363
/* vert timings */
358364
temp = (mode->crtc_vtotal) - 2;
359365
if (temp & 0x100)
@@ -431,7 +437,7 @@ static void ast_set_dclk_reg(struct ast_private *ast,
431437
{
432438
const struct ast_vbios_dclk_info *clk_info;
433439

434-
if (ast->chip == AST2500)
440+
if ((ast->chip == AST2500) || (ast->chip == AST2600))
435441
clk_info = &dclk_table_ast2500[vbios_mode->enh_table->dclk_index];
436442
else
437443
clk_info = &dclk_table[vbios_mode->enh_table->dclk_index];

0 commit comments

Comments
 (0)