[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <PSAPR06MB4805914FEC5EF65B0D1CC6BC8CC09@PSAPR06MB4805.apcprd06.prod.outlook.com>
Date: Tue, 3 May 2022 00:38:05 +0000
From: Kuo-Hsiang Chou <kuohsiang_chou@...eedtech.com>
To: Thomas Zimmermann <tzimmermann@...e.de>,
"dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
CC: Ryan Chen <ryan_chen@...eedtech.com>,
"airlied@...ux.ie" <airlied@...ux.ie>,
清水修(o-shimizu)-台灣NEC
<o-shimizu@....com.tw>, Jenmin Yuan <jenmin_yuan@...eedtech.com>,
"airlied@...hat.com" <airlied@...hat.com>,
Arc Sung <arc_sung@...eedtech.com>,
Luke Chen <luke_chen@...eedtech.com>
Subject: RE: [PATCH] drm/ast: Atomic CR/SR reg R/W
Hi Thomas,
Thanks for your kindly assistance.
Regards
Kuo-Hsiang Chou
-----Original Message-----
From: Thomas Zimmermann [mailto:tzimmermann@...e.de]
Sent: Monday, May 02, 2022 10:33 PM
To: Kuo-Hsiang Chou <kuohsiang_chou@...eedtech.com>; dri-devel@...ts.freedesktop.org; linux-kernel@...r.kernel.org
Cc: Ryan Chen <ryan_chen@...eedtech.com>; airlied@...ux.ie; 清水修(o-shimizu)-台灣NEC <o-shimizu@....com.tw>; Jenmin Yuan <jenmin_yuan@...eedtech.com>; airlied@...hat.com; Arc Sung <arc_sung@...eedtech.com>; Luke Chen <luke_chen@...eedtech.com>
Subject: Re: [PATCH] drm/ast: Atomic CR/SR reg R/W
Hi
Am 06.12.21 um 02:38 schrieb Kuo-Hsiang Chou:
> I'm not going to merge this patch. As I said, I don't think it fixes the problem. Mouse movement and resolution switching should not interfere with each other. The DRM framework should guarantee that.
> OK, thanks for your confirmation.
>
> I cannot reproduce the issue, but there's most likely something else happening here. How can the system switch resolution and change the mouse at the same time?
> Sure, we will check if there is a 100 percent method to reproduce the issue.
> Thanks for your responses.
I've been away for a while; sorry for all this taking so long. I've meanwhile been able to reproduce the problem. It happens when GNOME concurrently tries to set the video mode and read the available video modes from EDID. Reading EDID is not protected against concurrent mode setting or cursor movement.
I've posted a patchset that should fix the problem. See [1].
Best regards
Thomas
[1]
https://lore.kernel.org/dri-devel/20220502142514.2174-1-tzimmermann@suse.de/T/#t
>
> Regards,
> Kuo-Hsiang Chou
>
> Best regards
> Thomas
>
>>
>> Hi Tomas,
>> Good day!
>> May I understand the review status, or is there anything I can do to improve it? Thanks!
>>
>> Best Regards,
>> Kuo-Hsiang Chou
>>
>> Best Regards,
>> Kuo-Hsiang Chou
>>
>> Best regards
>> Thomas
>>
>>>
>>> Signed-off-by: KuoHsiang Chou <kuohsiang_chou@...eedtech.com>
>>> ---
>>> drivers/gpu/drm/ast/ast_main.c | 48 +++++++++++++++++++++++++---------
>>> 1 file changed, 36 insertions(+), 12 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/ast/ast_main.c
>>> b/drivers/gpu/drm/ast/ast_main.c index 79a361867..1d8fa70c5 100644
>>> --- a/drivers/gpu/drm/ast/ast_main.c
>>> +++ b/drivers/gpu/drm/ast/ast_main.c
>>> @@ -41,28 +41,52 @@ void ast_set_index_reg_mask(struct ast_private *ast,
>>> uint32_t base, uint8_t index,
>>> uint8_t mask, uint8_t val)
>>> {
>>> - u8 tmp;
>>> - ast_io_write8(ast, base, index);
>>> - tmp = (ast_io_read8(ast, base + 1) & mask) | val;
>>> - ast_set_index_reg(ast, base, index, tmp);
>>> + uint16_t volatile usData;
>>> + uint8_t volatile jData;
>>> +
>>> + do {
>>> + ast_io_write8(ast, base, index);
>>> + usData = ast_io_read16(ast, base);
>>> + } while ((uint8_t)(usData) != index);
>>> +
>>> + jData = (uint8_t)(usData >> 8);
>>> + jData &= mask;
>>> + jData |= val;
>>> + usData = ((uint16_t) jData << 8) | (uint16_t) index;
>>> + ast_io_write16(ast, base, usData);
>>> }
>>>
>>> uint8_t ast_get_index_reg(struct ast_private *ast,
>>> uint32_t base, uint8_t index)
>>> {
>>> - uint8_t ret;
>>> - ast_io_write8(ast, base, index);
>>> - ret = ast_io_read8(ast, base + 1);
>>> - return ret;
>>> + uint16_t volatile usData;
>>> + uint8_t volatile jData;
>>> +
>>> + do {
>>> + ast_io_write8(ast, base, index);
>>> + usData = ast_io_read16(ast, base);
>>> + } while ((uint8_t)(usData) != index);
>>> +
>>> + jData = (uint8_t)(usData >> 8);
>>> +
>>> + return jData;
>>> }
>>>
>>> uint8_t ast_get_index_reg_mask(struct ast_private *ast,
>>> uint32_t base, uint8_t index, uint8_t mask)
>>> {
>>> - uint8_t ret;
>>> - ast_io_write8(ast, base, index);
>>> - ret = ast_io_read8(ast, base + 1) & mask;
>>> - return ret;
>>> + uint16_t volatile usData;
>>> + uint8_t volatile jData;
>>> +
>>> + do {
>>> + ast_io_write8(ast, base, index);
>>> + usData = ast_io_read16(ast, base);
>>> + } while ((uint8_t)(usData) != index);
>>> +
>>> + jData = (uint8_t)(usData >> 8);
>>> + jData &= mask;
>>> +
>>> + return jData;
>>> }
>>>
>>> static void ast_detect_config_mode(struct drm_device *dev, u32
>>> *scu_rev)
>>> --
>>> 2.18.4
>>>
>>
>> --
>> Thomas Zimmermann
>> Graphics Driver Developer
>> SUSE Software Solutions Germany GmbH
>> Maxfeldstr. 5, 90409 Nürnberg, Germany (HRB 36809, AG Nürnberg)
>> Geschäftsführer: Felix Imendörffer
>>
>
> --
> 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
--
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
Powered by blists - more mailing lists