AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Leo Liu <leo.liu@amd.com>
To: "Christian König" <christian.koenig@amd.com>,
	"Horace Chen" <horace.chen@amd.com>,
	amd-gfx@lists.freedesktop.org
Cc: Jack Xiao <Jack.Xiao@amd.com>, Feifei Xu <Feifei.Xu@amd.com>,
	Haijun Chang <HaiJun.Chang@amd.com>,
	Deucher Alexander <Alexander.Deucher@amd.com>,
	Evan Quan <Evan.Quan@amd.com>, Monk Liu <Monk.Liu@amd.com>,
	Hawking Zhang <Hawking.Zhang@amd.com>
Subject: Re: [PATCH] drm/amdgpu: Clear VCN cache when hw_init
Date: Wed, 5 Jul 2023 15:57:59 -0400	[thread overview]
Message-ID: <1fb0cf4f-3ea4-cd0a-64e9-9d6f22e968f3@amd.com> (raw)
In-Reply-To: <9c19a828-15ed-c37a-2c07-acf29f489541@amd.com>

What Christian says is correct, esp. during the playback or encode, when 
suspend/resume happens, it will save the FW context, and after resume, 
it will continue the job to where it left during the suspend. Will this 
apply to SRIOV case? Since the changes only within the SRIOV code, 
please make sure that also please specify the SRIOV from your patch 
subject and commit message.

Regards,

Leo


On 2023-06-30 07:38, Christian König wrote:
> Am 20.06.23 um 15:29 schrieb Horace Chen:
>> [Why]
>> VCN will use some framebuffer space as its cache. It needs to
>> be reset when reset happens, such as FLR. Otherwise some error
>> may be kept after the reset.
>
> Well this doesn't make sense at all.
>
> The full content of adev->vcn.inst[i].cpu_addr is saved and restored 
> during suspend/resume and IIRC GPU resets as well.
>
> See functions amdgpu_vcn_suspend() and amdgpu_vcn_resume().
>
> Please let Leo's team take a look at this and review the change before 
> it is committed.
>
> Regards,
> Christian.
>
>>
>> Signed-off-by: Horace Chen <horace.chen@amd.com>
>> ---
>>   drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c | 3 +++
>>   1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c 
>> b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c
>> index b48bb5212488..2db73a964031 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c
>> @@ -1292,6 +1292,7 @@ static int vcn_v4_0_start_sriov(struct 
>> amdgpu_device *adev)
>>               cache_size);
>>             cache_addr = adev->vcn.inst[i].gpu_addr + offset;
>> +        memset(adev->vcn.inst[i].cpu_addr + offset, 0, 
>> AMDGPU_VCN_STACK_SIZE);
>>           MMSCH_V4_0_INSERT_DIRECT_WT(SOC15_REG_OFFSET(VCN, i,
>>               regUVD_LMI_VCPU_CACHE1_64BIT_BAR_LOW),
>>               lower_32_bits(cache_addr));
>> @@ -1307,6 +1308,8 @@ static int vcn_v4_0_start_sriov(struct 
>> amdgpu_device *adev)
>>             cache_addr = adev->vcn.inst[i].gpu_addr + offset +
>>               AMDGPU_VCN_STACK_SIZE;
>> +        memset(adev->vcn.inst[i].cpu_addr + offset + 
>> AMDGPU_VCN_STACK_SIZE, 0,
>> +            AMDGPU_VCN_STACK_SIZE);
>>           MMSCH_V4_0_INSERT_DIRECT_WT(SOC15_REG_OFFSET(VCN, i,
>>               regUVD_LMI_VCPU_CACHE2_64BIT_BAR_LOW),
>>               lower_32_bits(cache_addr));
>

  reply	other threads:[~2023-07-05 19:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-20 13:29 [PATCH] drm/amdgpu: Clear VCN cache when hw_init Horace Chen
2023-06-21  9:25 ` Deng, Emily
2023-06-30 11:38 ` Christian König
2023-07-05 19:57   ` Leo Liu [this message]
2023-07-06  7:24     ` Christian König
2023-07-06  8:56       ` Chen, Horace
2023-07-06 13:56         ` Alex Deucher

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=1fb0cf4f-3ea4-cd0a-64e9-9d6f22e968f3@amd.com \
    --to=leo.liu@amd.com \
    --cc=Alexander.Deucher@amd.com \
    --cc=Evan.Quan@amd.com \
    --cc=Feifei.Xu@amd.com \
    --cc=HaiJun.Chang@amd.com \
    --cc=Hawking.Zhang@amd.com \
    --cc=Jack.Xiao@amd.com \
    --cc=Monk.Liu@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=horace.chen@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