All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jocelyn Falempe <jfalempe@redhat.com>
To: Thomas Zimmermann <tzimmermann@suse.de>,
	airlied@redhat.com, daniel@ffwll.ch,
	kuohsiang_chou@aspeedtech.com, jammy_huang@aspeedtech.com,
	ilpo.jarvinen@cs.helsinki.fi
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 8/8] drm/ast: Avoid reprogramming primary-plane scanout address
Date: Tue, 11 Oct 2022 19:09:08 +0200	[thread overview]
Message-ID: <3bfddaa7-e6b2-e9ff-c1a9-7d1fcfd86530@redhat.com> (raw)
In-Reply-To: <1f29c829-fcca-eec6-50c8-0a35d7c31599@suse.de>

On 11/10/2022 16:59, Thomas Zimmermann wrote:
> Hi
> 
> Am 11.10.22 um 16:21 schrieb Jocelyn Falempe:
>> On 10/10/2022 12:36, Thomas Zimmermann wrote:
>>> Some AST-based BMCs stop display output for up to 5 seconds after
>>> reprogramming the scanout address. As the address is fixed, avoid
>>> re-setting the address' value.
>>>
>>> Reported-by: Jocelyn Falempe <jfalempe@redhat.com>
>>> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
>>> ---
>>>   drivers/gpu/drm/ast/ast_mode.c | 12 ++++++++++--
>>>   1 file changed, 10 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/ast/ast_mode.c 
>>> b/drivers/gpu/drm/ast/ast_mode.c
>>> index 1b991658290b..54a9643d86ce 100644
>>> --- a/drivers/gpu/drm/ast/ast_mode.c
>>> +++ b/drivers/gpu/drm/ast/ast_mode.c
>>> @@ -672,9 +672,17 @@ static void 
>>> ast_primary_plane_helper_atomic_update(struct drm_plane *plane,
>>>       }
>>>       ast_set_offset_reg(ast, fb);
>>> -    ast_set_start_address_crt1(ast, (u32)ast_plane->offset);
>>> -    ast_set_index_reg_mask(ast, AST_IO_SEQ_PORT, 0x1, 0xdf, 0x00);
>>> +    /*
>>> +     * Some BMCs stop scanning out the video signal after the driver
>>> +     * reprogrammed the scanout address. This stalls display output
>>> +     * for several seconds and makes the display unusable. Therefore
>>> +     * only reprogram the address after enabling the plane.
>>> +     */
>>> +    if (!old_fb && fb) {
>>> +        ast_set_start_address_crt1(ast, (u32)ast_plane->offset);
>>> +        ast_set_index_reg_mask(ast, AST_IO_SEQ_PORT, 0x1, 0xdf, 0x00);
>>> +    }
>>>   }
>>
>> I've tested the series, and BMC is still very slow with Gnome/Wayland.
>>
>> It's because ast_set_offset_reg() also trigger a 5s freeze of the BMC.
>>
>> I added this, and it works well:
>>
>> if (!old_fb || old_fb->pitches[0] != fb->pitches[0])
>>      ast_set_offset_reg(ast, fb);
> 
> Great thanks for testing. I'll add this to the next version.
> 
> I wonder if that problem is in all ast chips or just this one. :/

My test machine has an AST2600, but I think it depends mostly on the BMC 
firmware.
Anyway it's not useful to reprogram the same value on the registers for 
each frame. And that's the good thing about atomic interface, because we 
have previous and next state, it's easy to check if the registers need 
to be updated.

> 
> Best regards
> Thomas
> 
>>
>>
>>>   static void ast_primary_plane_helper_atomic_disable(struct 
>>> drm_plane *plane,
>>
>>
>>
>>
> 

-- 

Jocelyn


  reply	other threads:[~2022-10-11 17:09 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-10 10:36 [PATCH 0/8] drm/ast: Convert ast driver to SHMEM Thomas Zimmermann
2022-10-10 10:36 ` [PATCH 1/8] drm/ast: Acquire I/O-register lock in atomic_commit_tail function Thomas Zimmermann
2022-10-11 17:13   ` Jocelyn Falempe
2022-10-10 10:36 ` [PATCH 2/8] drm/ast: Call drm_atomic_helper_check_plane_state() unconditionally Thomas Zimmermann
2022-10-10 10:36 ` [PATCH 3/8] drm/ast: Do not call drm_atomic_add_affected_planes() Thomas Zimmermann
2022-10-10 17:06   ` Javier Martinez Canillas
2022-10-10 10:36 ` [PATCH 4/8] drm/ast: Remove cursor double buffering Thomas Zimmermann
2022-10-10 10:36 ` [PATCH 5/8] drm/ast: Rename struct ast_cursor_plane to struct ast_plane Thomas Zimmermann
2022-10-10 10:36 ` [PATCH 6/8] drm/ast: Style cleanups in plane code Thomas Zimmermann
2022-10-10 10:36 ` [PATCH 7/8] drm/ast: Convert ast to SHMEM Thomas Zimmermann
2022-10-11 17:17   ` Jocelyn Falempe
2022-10-10 10:36 ` [PATCH 8/8] drm/ast: Avoid reprogramming primary-plane scanout address Thomas Zimmermann
2022-10-11 14:21   ` Jocelyn Falempe
2022-10-11 14:59     ` Thomas Zimmermann
2022-10-11 17:09       ` Jocelyn Falempe [this message]
2022-10-11 17:26 ` [PATCH 0/8] drm/ast: Convert ast driver to SHMEM Jocelyn Falempe

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=3bfddaa7-e6b2-e9ff-c1a9-7d1fcfd86530@redhat.com \
    --to=jfalempe@redhat.com \
    --cc=airlied@redhat.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=ilpo.jarvinen@cs.helsinki.fi \
    --cc=jammy_huang@aspeedtech.com \
    --cc=kuohsiang_chou@aspeedtech.com \
    --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 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.