stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jocelyn Falempe <jfalempe@redhat.com>
To: Thomas Zimmermann <tzimmermann@suse.de>,
	airlied@redhat.com, airlied@linux.ie, daniel@ffwll.ch,
	regressions@leemhuis.info, kuohsiang_chou@aspeedtech.com
Cc: dri-devel@lists.freedesktop.org, stable@vger.kernel.org
Subject: Re: [PATCH] drm/ast: Treat AST2600 like AST2500 in most places
Date: Wed, 8 Jun 2022 09:41:16 +0200	[thread overview]
Message-ID: <2c26c0c9-7a5e-4ffa-95cf-42c6bc6ae88d@redhat.com> (raw)
In-Reply-To: <3528fa40-987f-2467-35a5-93397d968ee8@suse.de>

On 07/06/2022 14:07, Thomas Zimmermann wrote:
> Jocelyn, do you have a way of getting this patch tested?

Thanks for sending this patch.
I'm sorry I'm not able to test it directly.
It's a bit complex to try an upstream kernel on the machine we found the 
regression, I will do my best to get it tested, but no promise.

Also be careful when backporting to stable kernel, as the patch may 
apply, but some other "if (AST2500)" logic might be missing the AST2600 
check.

> 
> Am 07.06.22 um 14:02 schrieb Thomas Zimmermann:
>> 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@redhat.com>
>> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
>> Suggested-by: Jocelyn Falempe <jfalempe@redhat.com>
>> Fixes: f9bd00e0ea9d ("drm/ast: Create chip AST2600")
>> Cc: KuoHsiang Chou <kuohsiang_chou@aspeedtech.com>
>> Cc: Dave Airlie <airlied@redhat.com>
>> Cc: dri-devel@lists.freedesktop.org
>> Cc: <stable@vger.kernel.org> # 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);
> 


  reply	other threads:[~2022-06-08  8:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-07 12:02 [PATCH] drm/ast: Treat AST2600 like AST2500 in most places Thomas Zimmermann
2022-06-07 12:07 ` Thomas Zimmermann
2022-06-08  7:41   ` Jocelyn Falempe [this message]
     [not found] ` <PSAPR06MB4805B23B053F80C0F23A8C6C8CA49@PSAPR06MB4805.apcprd06.prod.outlook.com>
2022-06-08 13:16   ` Jocelyn Falempe
2022-06-09  2:32     ` Kuo-Hsiang Chou
2022-06-09  7:06       ` Jocelyn Falempe
2022-06-09  7:13         ` Thomas Zimmermann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2c26c0c9-7a5e-4ffa-95cf-42c6bc6ae88d@redhat.com \
    --to=jfalempe@redhat.com \
    --cc=airlied@linux.ie \
    --cc=airlied@redhat.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kuohsiang_chou@aspeedtech.com \
    --cc=regressions@leemhuis.info \
    --cc=stable@vger.kernel.org \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).