All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/ast: Fix video broken in some resolutions on ast2600
@ 2022-09-16  9:17 Jammy Huang
  2022-09-20  8:43 ` Thomas Zimmermann
  0 siblings, 1 reply; 3+ messages in thread
From: Jammy Huang @ 2022-09-16  9:17 UTC (permalink / raw)
  To: airlied, tzimmermann, airlied, daniel, dri-devel, linux-kernel

Some cases are not handled well for ast2600.

Signed-off-by: Jammy Huang <jammy_huang@aspeedtech.com>
---
 drivers/gpu/drm/ast/ast_mode.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c
index d327dcbaf032..be9bbc888ac3 100644
--- a/drivers/gpu/drm/ast/ast_mode.c
+++ b/drivers/gpu/drm/ast/ast_mode.c
@@ -314,7 +314,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 == AST2500 || ast->chip == AST2600) &&
 	    (vbios_mode->enh_table->flags & AST2500PreCatchCRT))
 		precache = 40;
 
@@ -355,6 +355,12 @@ static void ast_set_crtc_reg(struct ast_private *ast,
 	ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xAC, 0x00, jregAC);
 	ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xAD, 0x00, jregAD);
 
+	// Workaround for HSync Time non octave pixels (1920x1080@60Hz HSync 44 pixels);
+	if ((ast->chip == AST2600) && (mode->crtc_vdisplay == 1080))
+		ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xFC, 0xFD, 0x02);
+	else
+		ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xFC, 0xFD, 0x00);
+
 	/* vert timings */
 	temp = (mode->crtc_vtotal) - 2;
 	if (temp & 0x100)
@@ -432,7 +438,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 == AST2500) || (ast->chip == AST2600))
 		clk_info = &dclk_table_ast2500[vbios_mode->enh_table->dclk_index];
 	else
 		clk_info = &dclk_table[vbios_mode->enh_table->dclk_index];
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/ast: Fix video broken in some resolutions on ast2600
  2022-09-16  9:17 [PATCH] drm/ast: Fix video broken in some resolutions on ast2600 Jammy Huang
@ 2022-09-20  8:43 ` Thomas Zimmermann
  2022-09-20  8:51   ` Jammy Huang
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Zimmermann @ 2022-09-20  8:43 UTC (permalink / raw)
  To: Jammy Huang, airlied, airlied, daniel, dri-devel, linux-kernel


[-- Attachment #1.1: Type: text/plain, Size: 2140 bytes --]

Hi

Am 16.09.22 um 11:17 schrieb Jammy Huang:
> Some cases are not handled well for ast2600.
> 
> Signed-off-by: Jammy Huang <jammy_huang@aspeedtech.com>
> ---
>   drivers/gpu/drm/ast/ast_mode.c | 10 ++++++++--
>   1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c
> index d327dcbaf032..be9bbc888ac3 100644
> --- a/drivers/gpu/drm/ast/ast_mode.c
> +++ b/drivers/gpu/drm/ast/ast_mode.c
> @@ -314,7 +314,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 == AST2500 || ast->chip == AST2600) &&
>   	    (vbios_mode->enh_table->flags & AST2500PreCatchCRT))
>   		precache = 40;
>   
> @@ -355,6 +355,12 @@ static void ast_set_crtc_reg(struct ast_private *ast,
>   	ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xAC, 0x00, jregAC);
>   	ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xAD, 0x00, jregAD);
>   
> +	// Workaround for HSync Time non octave pixels (1920x1080@60Hz HSync 44 pixels);

Applied to drm-misc-next, but what is an 'octave pixel'?

Best regards
Thomas

> +	if ((ast->chip == AST2600) && (mode->crtc_vdisplay == 1080))
> +		ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xFC, 0xFD, 0x02);
> +	else
> +		ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xFC, 0xFD, 0x00);
> +
>   	/* vert timings */
>   	temp = (mode->crtc_vtotal) - 2;
>   	if (temp & 0x100)
> @@ -432,7 +438,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 == AST2500) || (ast->chip == AST2600))
>   		clk_info = &dclk_table_ast2500[vbios_mode->enh_table->dclk_index];
>   	else
>   		clk_info = &dclk_table[vbios_mode->enh_table->dclk_index];

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/ast: Fix video broken in some resolutions on ast2600
  2022-09-20  8:43 ` Thomas Zimmermann
@ 2022-09-20  8:51   ` Jammy Huang
  0 siblings, 0 replies; 3+ messages in thread
From: Jammy Huang @ 2022-09-20  8:51 UTC (permalink / raw)
  To: Thomas Zimmermann, airlied, airlied, daniel, dri-devel, linux-kernel

Hi Thomas,

On 2022/9/20 下午 04:43, Thomas Zimmermann wrote:
> Hi
>
> Am 16.09.22 um 11:17 schrieb Jammy Huang:
>> Some cases are not handled well for ast2600.
>>
>> Signed-off-by: Jammy Huang <jammy_huang@aspeedtech.com>
>> ---
>>   drivers/gpu/drm/ast/ast_mode.c | 10 ++++++++--
>>   1 file changed, 8 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/ast/ast_mode.c 
>> b/drivers/gpu/drm/ast/ast_mode.c
>> index d327dcbaf032..be9bbc888ac3 100644
>> --- a/drivers/gpu/drm/ast/ast_mode.c
>> +++ b/drivers/gpu/drm/ast/ast_mode.c
>> @@ -314,7 +314,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 == AST2500 || ast->chip == AST2600) &&
>>           (vbios_mode->enh_table->flags & AST2500PreCatchCRT))
>>           precache = 40;
>>   @@ -355,6 +355,12 @@ static void ast_set_crtc_reg(struct 
>> ast_private *ast,
>>       ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xAC, 0x00, jregAC);
>>       ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xAD, 0x00, jregAD);
>>   +    // Workaround for HSync Time non octave pixels (1920x1080@60Hz 
>> HSync 44 pixels);
>
> Applied to drm-misc-next, but what is an 'octave pixel'?

It means to make the pixel number a multiple of 8.


>
> Best regards
> Thomas
>
>> +    if ((ast->chip == AST2600) && (mode->crtc_vdisplay == 1080))
>> +        ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xFC, 0xFD, 
>> 0x02);
>> +    else
>> +        ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xFC, 0xFD, 
>> 0x00);
>> +
>>       /* vert timings */
>>       temp = (mode->crtc_vtotal) - 2;
>>       if (temp & 0x100)
>> @@ -432,7 +438,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 == AST2500) || (ast->chip == AST2600))
>>           clk_info = 
>> &dclk_table_ast2500[vbios_mode->enh_table->dclk_index];
>>       else
>>           clk_info = &dclk_table[vbios_mode->enh_table->dclk_index];
>
-- 
Best Regards
Jammy


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-09-20  8:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-16  9:17 [PATCH] drm/ast: Fix video broken in some resolutions on ast2600 Jammy Huang
2022-09-20  8:43 ` Thomas Zimmermann
2022-09-20  8:51   ` Jammy Huang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.