AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] drm/amdgpu: Add empty HDP flush function to JPEG v4.0.3
@ 2024-07-15 14:47 Jane Jian
  2024-07-15 14:58 ` Christian König
  0 siblings, 1 reply; 6+ messages in thread
From: Jane Jian @ 2024-07-15 14:47 UTC (permalink / raw)
  To: Lijo.Lazar, Haijun.Chang, Victor.Zhao; +Cc: amd-gfx, Lijo Lazar, Jane Jian

From: Lijo Lazar <lijo.lazar@amd.com>

JPEG v4.0.3 doesn't support HDP flush when RRMT is enabled. Instead,
mmsch fw will do the flush.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Jane Jian <Jane.Jian@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c b/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c
index 04d8966423de..ea601047dab0 100644
--- a/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c
+++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c
@@ -621,6 +621,14 @@ static uint64_t jpeg_v4_0_3_dec_ring_get_wptr(struct amdgpu_ring *ring)
 			ring->pipe ? (0x40 * ring->pipe - 0xc80) : 0);
 }
 
+static void jpeg_v4_0_3_ring_emit_hdp_flush(struct amdgpu_ring *ring)
+{
+	/* VCN engine access for HDP flush doesn't work when RRMT is enabled.
+	 * This is a workaround to avoid any HDP flush through VCN ring. Instead
+	 * HDP flush will be done by driver while submitting doorbell.
+	 */
+}
+
 /**
  * jpeg_v4_0_3_dec_ring_set_wptr - set write pointer
  *
@@ -1072,6 +1080,7 @@ static const struct amdgpu_ring_funcs jpeg_v4_0_3_dec_ring_vm_funcs = {
 	.emit_ib = jpeg_v4_0_3_dec_ring_emit_ib,
 	.emit_fence = jpeg_v4_0_3_dec_ring_emit_fence,
 	.emit_vm_flush = jpeg_v4_0_3_dec_ring_emit_vm_flush,
+	.emit_hdp_flush = jpeg_v4_0_3_ring_emit_hdp_flush,
 	.test_ring = amdgpu_jpeg_dec_ring_test_ring,
 	.test_ib = amdgpu_jpeg_dec_ring_test_ib,
 	.insert_nop = jpeg_v4_0_3_dec_ring_nop,
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/3] drm/amdgpu: Add empty HDP flush function to JPEG v4.0.3
  2024-07-15 14:47 [PATCH 1/3] drm/amdgpu: Add empty HDP flush function to JPEG v4.0.3 Jane Jian
@ 2024-07-15 14:58 ` Christian König
  2024-07-15 15:08   ` Lazar, Lijo
  0 siblings, 1 reply; 6+ messages in thread
From: Christian König @ 2024-07-15 14:58 UTC (permalink / raw)
  To: Jane Jian, Lijo.Lazar, Haijun.Chang, Victor.Zhao; +Cc: amd-gfx



Am 15.07.24 um 16:47 schrieb Jane Jian:
> From: Lijo Lazar <lijo.lazar@amd.com>
>
> JPEG v4.0.3 doesn't support HDP flush when RRMT is enabled. Instead,
> mmsch fw will do the flush.
>
> Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
> Signed-off-by: Jane Jian <Jane.Jian@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c | 9 +++++++++
>   1 file changed, 9 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c b/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c
> index 04d8966423de..ea601047dab0 100644
> --- a/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c
> +++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c
> @@ -621,6 +621,14 @@ static uint64_t jpeg_v4_0_3_dec_ring_get_wptr(struct amdgpu_ring *ring)
>   			ring->pipe ? (0x40 * ring->pipe - 0xc80) : 0);
>   }
>   
> +static void jpeg_v4_0_3_ring_emit_hdp_flush(struct amdgpu_ring *ring)
> +{
> +	/* VCN engine access for HDP flush doesn't work when RRMT is enabled.
> +	 * This is a workaround to avoid any HDP flush through VCN ring. Instead
> +	 * HDP flush will be done by driver while submitting doorbell.

I think that should read "HDP flush will be done by firmware ....".

Or is it really the driver which should do this? In this case the patch 
here would be wrong.

Regards,
Christian.

> +	 */
> +}
> +
>   /**
>    * jpeg_v4_0_3_dec_ring_set_wptr - set write pointer
>    *
> @@ -1072,6 +1080,7 @@ static const struct amdgpu_ring_funcs jpeg_v4_0_3_dec_ring_vm_funcs = {
>   	.emit_ib = jpeg_v4_0_3_dec_ring_emit_ib,
>   	.emit_fence = jpeg_v4_0_3_dec_ring_emit_fence,
>   	.emit_vm_flush = jpeg_v4_0_3_dec_ring_emit_vm_flush,
> +	.emit_hdp_flush = jpeg_v4_0_3_ring_emit_hdp_flush,
>   	.test_ring = amdgpu_jpeg_dec_ring_test_ring,
>   	.test_ib = amdgpu_jpeg_dec_ring_test_ib,
>   	.insert_nop = jpeg_v4_0_3_dec_ring_nop,


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/3] drm/amdgpu: Add empty HDP flush function to JPEG v4.0.3
  2024-07-15 14:58 ` Christian König
@ 2024-07-15 15:08   ` Lazar, Lijo
  2024-07-15 15:30     ` Christian König
  0 siblings, 1 reply; 6+ messages in thread
From: Lazar, Lijo @ 2024-07-15 15:08 UTC (permalink / raw)
  To: Christian König, Jane Jian, Haijun.Chang, Victor.Zhao; +Cc: amd-gfx



On 7/15/2024 8:28 PM, Christian König wrote:
> 
> 
> Am 15.07.24 um 16:47 schrieb Jane Jian:
>> From: Lijo Lazar <lijo.lazar@amd.com>
>>
>> JPEG v4.0.3 doesn't support HDP flush when RRMT is enabled. Instead,
>> mmsch fw will do the flush.
>>
>> Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
>> Signed-off-by: Jane Jian <Jane.Jian@amd.com>
>> ---
>>   drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c | 9 +++++++++
>>   1 file changed, 9 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c
>> b/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c
>> index 04d8966423de..ea601047dab0 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c
>> @@ -621,6 +621,14 @@ static uint64_t
>> jpeg_v4_0_3_dec_ring_get_wptr(struct amdgpu_ring *ring)
>>               ring->pipe ? (0x40 * ring->pipe - 0xc80) : 0);
>>   }
>>   +static void jpeg_v4_0_3_ring_emit_hdp_flush(struct amdgpu_ring *ring)
>> +{
>> +    /* VCN engine access for HDP flush doesn't work when RRMT is
>> enabled.
>> +     * This is a workaround to avoid any HDP flush through VCN ring.
>> Instead
>> +     * HDP flush will be done by driver while submitting doorbell.
> 
> I think that should read "HDP flush will be done by firmware ....".
> 
> Or is it really the driver which should do this? In this case the patch
> here would be wrong.
> 

That's a copy-paste mistake. This comment was originally in the initial
version of the patch.

Discussed with Jane and she'll be sending a revised version. Also, there
is a third patch expected which does normalization of register offsets
when submitted through ring.

Thanks,
Lijo

> Regards,
> Christian.
> 
>> +     */
>> +}
>> +
>>   /**
>>    * jpeg_v4_0_3_dec_ring_set_wptr - set write pointer
>>    *
>> @@ -1072,6 +1080,7 @@ static const struct amdgpu_ring_funcs
>> jpeg_v4_0_3_dec_ring_vm_funcs = {
>>       .emit_ib = jpeg_v4_0_3_dec_ring_emit_ib,
>>       .emit_fence = jpeg_v4_0_3_dec_ring_emit_fence,
>>       .emit_vm_flush = jpeg_v4_0_3_dec_ring_emit_vm_flush,
>> +    .emit_hdp_flush = jpeg_v4_0_3_ring_emit_hdp_flush,
>>       .test_ring = amdgpu_jpeg_dec_ring_test_ring,
>>       .test_ib = amdgpu_jpeg_dec_ring_test_ib,
>>       .insert_nop = jpeg_v4_0_3_dec_ring_nop,
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/3] drm/amdgpu: Add empty HDP flush function to JPEG v4.0.3
  2024-07-15 15:08   ` Lazar, Lijo
@ 2024-07-15 15:30     ` Christian König
  0 siblings, 0 replies; 6+ messages in thread
From: Christian König @ 2024-07-15 15:30 UTC (permalink / raw)
  To: Lazar, Lijo, Jane Jian, Haijun.Chang, Victor.Zhao; +Cc: amd-gfx

Am 15.07.24 um 17:08 schrieb Lazar, Lijo:
>
> On 7/15/2024 8:28 PM, Christian König wrote:
>>
>> Am 15.07.24 um 16:47 schrieb Jane Jian:
>>> From: Lijo Lazar <lijo.lazar@amd.com>
>>>
>>> JPEG v4.0.3 doesn't support HDP flush when RRMT is enabled. Instead,
>>> mmsch fw will do the flush.
>>>
>>> Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
>>> Signed-off-by: Jane Jian <Jane.Jian@amd.com>
>>> ---
>>>    drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c | 9 +++++++++
>>>    1 file changed, 9 insertions(+)
>>>
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c
>>> b/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c
>>> index 04d8966423de..ea601047dab0 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c
>>> +++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c
>>> @@ -621,6 +621,14 @@ static uint64_t
>>> jpeg_v4_0_3_dec_ring_get_wptr(struct amdgpu_ring *ring)
>>>                ring->pipe ? (0x40 * ring->pipe - 0xc80) : 0);
>>>    }
>>>    +static void jpeg_v4_0_3_ring_emit_hdp_flush(struct amdgpu_ring *ring)
>>> +{
>>> +    /* VCN engine access for HDP flush doesn't work when RRMT is
>>> enabled.
>>> +     * This is a workaround to avoid any HDP flush through VCN ring.
>>> Instead
>>> +     * HDP flush will be done by driver while submitting doorbell.
>> I think that should read "HDP flush will be done by firmware ....".
>>
>> Or is it really the driver which should do this? In this case the patch
>> here would be wrong.
>>
> That's a copy-paste mistake. This comment was originally in the initial
> version of the patch.

Yeah thought so.

> Discussed with Jane and she'll be sending a revised version. Also, there
> is a third patch expected which does normalization of register offsets
> when submitted through ring.

Another question is if we have ever released JPEG/VCN firmware which 
doesn't do the flush?

If yes then we need a version check here to provide backward 
compatibility with already released firmware.

Regards,
Christian.

>
> Thanks,
> Lijo
>
>> Regards,
>> Christian.
>>
>>> +     */
>>> +}
>>> +
>>>    /**
>>>     * jpeg_v4_0_3_dec_ring_set_wptr - set write pointer
>>>     *
>>> @@ -1072,6 +1080,7 @@ static const struct amdgpu_ring_funcs
>>> jpeg_v4_0_3_dec_ring_vm_funcs = {
>>>        .emit_ib = jpeg_v4_0_3_dec_ring_emit_ib,
>>>        .emit_fence = jpeg_v4_0_3_dec_ring_emit_fence,
>>>        .emit_vm_flush = jpeg_v4_0_3_dec_ring_emit_vm_flush,
>>> +    .emit_hdp_flush = jpeg_v4_0_3_ring_emit_hdp_flush,
>>>        .test_ring = amdgpu_jpeg_dec_ring_test_ring,
>>>        .test_ib = amdgpu_jpeg_dec_ring_test_ib,
>>>        .insert_nop = jpeg_v4_0_3_dec_ring_nop,


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/3] drm/amdgpu: Add empty HDP flush function to JPEG v4.0.3
@ 2024-07-16  7:59 Jane Jian
  2024-07-18  6:12 ` Zhang, Hawking
  0 siblings, 1 reply; 6+ messages in thread
From: Jane Jian @ 2024-07-16  7:59 UTC (permalink / raw)
  To: Lijo.Lazar, Haijun.Chang, Victor.Zhao; +Cc: amd-gfx, Lijo Lazar, Jane Jian

From: Lijo Lazar <lijo.lazar@amd.com>

JPEG v4.0.3 doesn't support HDP flush when RRMT is enabled. Instead,
mmsch fw will do the flush.

This change is necessary for JPEG v4.0.3, no need for backward compatibility

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Jane Jian <Jane.Jian@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c b/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c
index 04d8966423de..30a143ab592d 100644
--- a/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c
+++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c
@@ -621,6 +621,13 @@ static uint64_t jpeg_v4_0_3_dec_ring_get_wptr(struct amdgpu_ring *ring)
 			ring->pipe ? (0x40 * ring->pipe - 0xc80) : 0);
 }
 
+static void jpeg_v4_0_3_ring_emit_hdp_flush(struct amdgpu_ring *ring)
+{
+	/* JPEG engine access for HDP flush doesn't work when RRMT is enabled.
+	 * This is a workaround to avoid any HDP flush through JPEG ring.
+	 */
+}
+
 /**
  * jpeg_v4_0_3_dec_ring_set_wptr - set write pointer
  *
@@ -1072,6 +1079,7 @@ static const struct amdgpu_ring_funcs jpeg_v4_0_3_dec_ring_vm_funcs = {
 	.emit_ib = jpeg_v4_0_3_dec_ring_emit_ib,
 	.emit_fence = jpeg_v4_0_3_dec_ring_emit_fence,
 	.emit_vm_flush = jpeg_v4_0_3_dec_ring_emit_vm_flush,
+	.emit_hdp_flush = jpeg_v4_0_3_ring_emit_hdp_flush,
 	.test_ring = amdgpu_jpeg_dec_ring_test_ring,
 	.test_ib = amdgpu_jpeg_dec_ring_test_ib,
 	.insert_nop = jpeg_v4_0_3_dec_ring_nop,
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* RE: [PATCH 1/3] drm/amdgpu: Add empty HDP flush function to JPEG v4.0.3
  2024-07-16  7:59 Jane Jian
@ 2024-07-18  6:12 ` Zhang, Hawking
  0 siblings, 0 replies; 6+ messages in thread
From: Zhang, Hawking @ 2024-07-18  6:12 UTC (permalink / raw)
  To: Jian, Jane, Lazar, Lijo, Chang, HaiJun, Zhao, Victor
  Cc: amd-gfx@lists.freedesktop.org, Lazar, Lijo, Jian, Jane

[AMD Official Use Only - AMD Internal Distribution Only]

Series is

Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>

Regards,
Hawking
-----Original Message-----
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Jane Jian
Sent: Tuesday, July 16, 2024 15:59
To: Lazar, Lijo <Lijo.Lazar@amd.com>; Chang, HaiJun <HaiJun.Chang@amd.com>; Zhao, Victor <Victor.Zhao@amd.com>
Cc: amd-gfx@lists.freedesktop.org; Lazar, Lijo <Lijo.Lazar@amd.com>; Jian, Jane <Jane.Jian@amd.com>
Subject: [PATCH 1/3] drm/amdgpu: Add empty HDP flush function to JPEG v4.0.3

From: Lijo Lazar <lijo.lazar@amd.com>

JPEG v4.0.3 doesn't support HDP flush when RRMT is enabled. Instead, mmsch fw will do the flush.

This change is necessary for JPEG v4.0.3, no need for backward compatibility

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Jane Jian <Jane.Jian@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c b/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c
index 04d8966423de..30a143ab592d 100644
--- a/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c
+++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c
@@ -621,6 +621,13 @@ static uint64_t jpeg_v4_0_3_dec_ring_get_wptr(struct amdgpu_ring *ring)
                        ring->pipe ? (0x40 * ring->pipe - 0xc80) : 0);  }

+static void jpeg_v4_0_3_ring_emit_hdp_flush(struct amdgpu_ring *ring) {
+       /* JPEG engine access for HDP flush doesn't work when RRMT is enabled.
+        * This is a workaround to avoid any HDP flush through JPEG ring.
+        */
+}
+
 /**
  * jpeg_v4_0_3_dec_ring_set_wptr - set write pointer
  *
@@ -1072,6 +1079,7 @@ static const struct amdgpu_ring_funcs jpeg_v4_0_3_dec_ring_vm_funcs = {
        .emit_ib = jpeg_v4_0_3_dec_ring_emit_ib,
        .emit_fence = jpeg_v4_0_3_dec_ring_emit_fence,
        .emit_vm_flush = jpeg_v4_0_3_dec_ring_emit_vm_flush,
+       .emit_hdp_flush = jpeg_v4_0_3_ring_emit_hdp_flush,
        .test_ring = amdgpu_jpeg_dec_ring_test_ring,
        .test_ib = amdgpu_jpeg_dec_ring_test_ib,
        .insert_nop = jpeg_v4_0_3_dec_ring_nop,
--
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-07-18  6:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-15 14:47 [PATCH 1/3] drm/amdgpu: Add empty HDP flush function to JPEG v4.0.3 Jane Jian
2024-07-15 14:58 ` Christian König
2024-07-15 15:08   ` Lazar, Lijo
2024-07-15 15:30     ` Christian König
  -- strict thread matches above, loose matches on Subject: below --
2024-07-16  7:59 Jane Jian
2024-07-18  6:12 ` Zhang, Hawking

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox