AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: James Zhu <jamesz@amd.com>
To: Jiansong Chen <Jiansong.Chen@amd.com>, amd-gfx@lists.freedesktop.org
Cc: tao.zhou1@amd.com, james.zhu@amd.com, leo.liu@amd.com,
	hawking.zhang@amd.com
Subject: Re: [PATCH] drm/amdgpu: disable gfxoff if VCN is busy
Date: Fri, 30 Oct 2020 09:06:10 -0400	[thread overview]
Message-ID: <2a04ca91-5999-bbc8-e9cd-7820b7868696@amd.com> (raw)
In-Reply-To: <20201030113710.14291-1-Jiansong.Chen@amd.com>

Hi Jiansong

Pls check inline.

thanks!

James

On 2020-10-30 7:37 a.m., Jiansong Chen wrote:
> Toggle on/off gfxoff during video playback to fix
> gpu hang.
[JZ] It is a workaround, not a fix. Also Arcturus needn't this WA.
> Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
> Change-Id: I5b938c446884268c2cda0801121a53da980e603a
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 10 +++++++---
>   1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
> index 277a8435dd06..444b89413232 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
> @@ -358,6 +358,7 @@ static void amdgpu_vcn_idle_work_handler(struct work_struct *work)
>   	}
>   
>   	if (!fences && !atomic_read(&adev->vcn.total_submission_cnt)) {
> +		amdgpu_gfx_off_ctrl(adev, true);
>   		amdgpu_device_ip_set_powergating_state(adev, AMD_IP_BLOCK_TYPE_VCN,
>   		       AMD_PG_STATE_GATE);
>   	} else {
> @@ -368,13 +369,16 @@ static void amdgpu_vcn_idle_work_handler(struct work_struct *work)
>   void amdgpu_vcn_ring_begin_use(struct amdgpu_ring *ring)
>   {
>   	struct amdgpu_device *adev = ring->adev;
> +	bool set_clocks = !cancel_delayed_work_sync(&adev->vcn.idle_work);
>   
>   	atomic_inc(&adev->vcn.total_submission_cnt);
> -	cancel_delayed_work_sync(&adev->vcn.idle_work);
>   
>   	mutex_lock(&adev->vcn.vcn_pg_lock);
> -	amdgpu_device_ip_set_powergating_state(adev, AMD_IP_BLOCK_TYPE_VCN,
> -	       AMD_PG_STATE_UNGATE);
> +	if (set_clocks) {
> +		amdgpu_gfx_off_ctrl(adev, false);

[JZ] Move the above two lines before mutex_lock(&adev->vcn.vcn_pg_lock);

Since it may cause S3 test failure.

> +		amdgpu_device_ip_set_powergating_state(adev, AMD_IP_BLOCK_TYPE_VCN,
> +			AMD_PG_STATE_UNGATE);
> +	}
>   
>   	if (adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG)	{
>   		struct dpg_pause_state new_state;
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2020-10-30 13:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-30 11:37 [PATCH] drm/amdgpu: disable gfxoff if VCN is busy Jiansong Chen
2020-10-30 11:43 ` Zhang, Hawking
2020-10-30 13:06 ` James Zhu [this message]
2020-10-30 14:58   ` Chen, Jiansong (Simon)

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=2a04ca91-5999-bbc8-e9cd-7820b7868696@amd.com \
    --to=jamesz@amd.com \
    --cc=Jiansong.Chen@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=hawking.zhang@amd.com \
    --cc=james.zhu@amd.com \
    --cc=leo.liu@amd.com \
    --cc=tao.zhou1@amd.com \
    /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