drm/amdgpu: add HW_IP_VCN_UNIFIED type
Subsystems (3)
PATCH v4 1/1 drm/amdgpu: add HW_IP_VCN_UNIFIED type
From VCN4, AMDGPU_HW_IP_VCN_UNIFIED is used to support both encoding and decoding jobs, it re-uses the same queue number of AMDGPU_HW_IP_VCN_ENC.
--- include/uapi/drm/amdgpu_drm.h | 6 ++++++ 1 file changed, 6 insertions(+)
include/uapi/drm/amdgpu_drm.h +6 -0
@@ -560,6 +560,12 @@ struct drm_amdgpu_gem_va {#define AMDGPU_HW_IP_UVD_ENC 5#define AMDGPU_HW_IP_VCN_DEC 6#define AMDGPU_HW_IP_VCN_ENC 7 +/** +* From VCN4, AMDGPU_HW_IP_VCN_UNIFIED is used to support +* both encoding and decoding jobs, it re-uses the same +* queue number of AMDGPU_HW_IP_VCN_ENC. +*/ +#define AMDGPU_HW_IP_VCN_UNIFIED AMDGPU_HW_IP_VCN_ENC#define AMDGPU_HW_IP_VCN_JPEG 8#define AMDGPU_HW_IP_NUM 9
Signature · 1 line
2.25.1
[AMD Official Use Only - General]
-----Original Message-----
From: Dong, Ruijing <[email protected]>
Sent: July 15, 2022 4:04 PM
To: Koenig, Christian <[email protected]>; [email protected]
Cc: Deucher, Alexander <[email protected]>; Liu, Leo <[email protected]>; Dong, Ruijing <[email protected]>
Subject: [PATCH v4] drm/amdgpu: add HW_IP_VCN_UNIFIED type
From VCN4, AMDGPU_HW_IP_VCN_UNIFIED is used to support both encoding and decoding jobs, it re-uses the same queue number of AMDGPU_HW_IP_VCN_ENC.
--- include/uapi/drm/amdgpu_drm.h | 6 ++++++ 1 file changed, 6 insertions(+)
include/uapi/drm/amdgpu_drm.h +6 -0
@@ -560,6 +560,12 @@ struct drm_amdgpu_gem_va {#define AMDGPU_HW_IP_UVD_ENC 5#define AMDGPU_HW_IP_VCN_DEC 6#define AMDGPU_HW_IP_VCN_ENC 7 +/** +* From VCN4, AMDGPU_HW_IP_VCN_UNIFIED is used to support +* both encoding and decoding jobs, it re-uses the same +* queue number of AMDGPU_HW_IP_VCN_ENC. +*/ +#define AMDGPU_HW_IP_VCN_UNIFIED AMDGPU_HW_IP_VCN_ENC#define AMDGPU_HW_IP_VCN_JPEG 8#define AMDGPU_HW_IP_NUM 9
--
2.25.1
Christian König
maintainerAm 15.07.22 um 22:04 schrieb Ruijing Dong:
Quoted 16 lines
From VCN4,
AMDGPU_HW_IP_VCN_UNIFIEDis used to support
both encoding and decoding jobs, it re-uses the same queue number ofAMDGPU_HW_IP_VCN_ENC.Signed-off-by Ruijing Dong <[email protected]>--- include/uapi/drm/amdgpu_drm.h | 6 ++++++ 1 file changed, 6 insertions(+)include/uapi/drm/amdgpu_drm.h +0
-0
include/uapi/drm/amdgpu_drm.h struct drm_amdgpu_gem_va { · line 563
Quoted 4 lines
include/uapi/drm/amdgpu_drm.h +1
-0@@ -560,6 +560,12 @@ struct drm_amdgpu_gem_va {#define AMDGPU_HW_IP_UVD_ENC 5#define AMDGPU_HW_IP_VCN_DEC 6#define AMDGPU_HW_IP_VCN_ENC 7 +/**
Please don't use "/**" here, that is badly formated for a kerneldoc comment.
include/uapi/drm/amdgpu_drm.h struct drm_amdgpu_gem_va { · line 568
Quoted 5 lines
include/uapi/drm/amdgpu_drm.h +5
-0+* From VCN4, AMDGPU_HW_IP_VCN_UNIFIED is used to support +* both encoding and decoding jobs, it re-uses the same +* queue number of AMDGPU_HW_IP_VCN_ENC. +*/ +#define AMDGPU_HW_IP_VCN_UNIFIED AMDGPU_HW_IP_VCN_ENC
I'm still in doubt that adding another define with the same value as AMDGPU_HW_IP_VCN_ENC is a good idea.
Instead we should just add the comment to AMDGPU_HW_IP_VCN_ENC.
Regards,
Christian.
Quoted 3 lines
include/uapi/drm/amdgpu_drm.h +0
-0#define AMDGPU_HW_IP_VCN_JPEG 8#define AMDGPU_HW_IP_NUM 9
Quoted 24 lines · Christian König
Am 15.07.22 um 22:04 schrieb Ruijing Dong:
Quoted 16 lines
From VCN4,
AMDGPU_HW_IP_VCN_UNIFIEDis used to support both encoding and decoding jobs, it re-uses the same queue number ofAMDGPU_HW_IP_VCN_ENC.Signed-off-by Ruijing Dong <[email protected]>---
include/uapi/drm/amdgpu_drm.h| 6 ++++++1 file changed, 6 insertions(+)include/uapi/drm/amdgpu_drm.h +0
-0include/uapi/drm/amdgpu_drm.h struct drm_amdgpu_gem_va { · line 563
Quoted 4 lines
include/uapi/drm/amdgpu_drm.h +1
-0@@ -560,6 +560,12 @@ struct drm_amdgpu_gem_va { #define AMDGPU_HW_IP_UVD_ENC 5 #define AMDGPU_HW_IP_VCN_DEC 6 #define AMDGPU_HW_IP_VCN_ENC 7 +/** Please don't use "/**" here, that is badly formated for a kerneldoc comment.
Quoted 7 lines
include/uapi/drm/amdgpu_drm.h struct drm_amdgpu_gem_va { · line 568
Quoted 5 lines
include/uapi/drm/amdgpu_drm.h +5
-0+* From VCN4, AMDGPU_HW_IP_VCN_UNIFIED is used to support +* both encoding and decoding jobs, it re-uses the same +* queue number of AMDGPU_HW_IP_VCN_ENC. +*/ +#define AMDGPU_HW_IP_VCN_UNIFIED AMDGPU_HW_IP_VCN_ENCI'm still in doubt that adding another define with the same value as
AMDGPU_HW_IP_VCN_ENCis a good idea.
Hi Christian,
From VCN4, there is no VCN dec and enc ring type any more, the decode/encode will go through the unified queue, so using AMDGPU_HW_IP_VCN_ENC is no longer accurate . Keeping AMDGPU_HW_IP_VCN_ENC type is for legacy HW, and the new AMDGPU_HW_IP_VCN_UNIFIED just happen to use the same HW ring as legacy encode ring, so reuse the value, and that is the whole idea.
Thanks,
Leo
Quoted 10 lines
Instead we should just add the comment to
AMDGPU_HW_IP_VCN_ENC.Regards,
Christian.Quoted 2 lines
include/uapi/drm/amdgpu_drm.h +0
-0#define AMDGPU_HW_IP_VCN_JPEG 8 #define AMDGPU_HW_IP_NUM 9
Christian König
maintainerAm 18.07.22 um 15:48 schrieb Leo Liu:
Quoted 32 lines · Christian König
Quoted 30 lines
Am 15.07.22 um 22:04 schrieb Ruijing Dong:
Quoted 16 lines
From VCN4,
AMDGPU_HW_IP_VCN_UNIFIEDis used to support both encoding and decoding jobs, it re-uses the same queue number ofAMDGPU_HW_IP_VCN_ENC.Signed-off-by Ruijing Dong <[email protected]>---
include/uapi/drm/amdgpu_drm.h| 6 ++++++1 file changed, 6 insertions(+)include/uapi/drm/amdgpu_drm.h +0
-0include/uapi/drm/amdgpu_drm.h struct drm_amdgpu_gem_va { · line 563
Quoted 4 lines
include/uapi/drm/amdgpu_drm.h +1
-0@@ -560,6 +560,12 @@ struct drm_amdgpu_gem_va { #define AMDGPU_HW_IP_UVD_ENC 5 #define AMDGPU_HW_IP_VCN_DEC 6 #define AMDGPU_HW_IP_VCN_ENC 7 +/** Please don't use "/**" here, that is badly formated for a kerneldoc comment.
Quoted 5 lines
include/uapi/drm/amdgpu_drm.h +5
-0+* From VCN4, AMDGPU_HW_IP_VCN_UNIFIED is used to support +* both encoding and decoding jobs, it re-uses the same +* queue number of AMDGPU_HW_IP_VCN_ENC. +*/ +#define AMDGPU_HW_IP_VCN_UNIFIED AMDGPU_HW_IP_VCN_ENC
Quoted 5 lines
Quoted 1 line
I'm still in doubt that adding another define with the same value as
AMDGPU_HW_IP_VCN_ENCis a good idea.Hi Christian,
From VCN4, there is no VCN dec and enc ring type any more, the decode/encode will go through the unified queue, so using
AMDGPU_HW_IP_VCN_ENCis no longer accurate . KeepingAMDGPU_HW_IP_VCN_ENCtype is for legacy HW, and the newAMDGPU_HW_IP_VCN_UNIFIEDjust happen to use the same HW ring as legacy encode ring, so reuse the value, and that is the whole idea.
Yeah, I understand your reasoning I just don't see it this way.
What happened is that the encode ring was extended with decode functionality. In other words we still use the same format for encoding, we just added another one for decoding as well.
Renaming the enum and adding AMDGPU_HW_IP_VCN_UNIFIED suggests that this is something completely new, which is not the case here. The encoding commands stay the same, don't they?
So to sum it up my suggestion is to stick with AMDGPU_HW_IP_VCN_ENC and just document on the definition that this is used for both encode as well as decode starting with VCN4.
Regards,
Christian.
Quoted 16 lines
Thanks,
Leo
Quoted 10 lines
Instead we should just add the comment to
AMDGPU_HW_IP_VCN_ENC.Regards,
Christian.Quoted 2 lines
include/uapi/drm/amdgpu_drm.h +0
-0#define AMDGPU_HW_IP_VCN_JPEG 8 #define AMDGPU_HW_IP_NUM 9
[AMD Official Use Only - General]
Quoted 1 line
Quoted 1 line
What happened is that the encode ring was extended with decode functionality. In other words we still use the same format for encoding, we just added another one for decoding as well.
Just to clarify the format difference between legacy encoding and unified queue, we can do either way in the code.
Unified queue requires a different format. The original encoding/decoding format cannot be used in unified queue, which requires to have two new headers, "engine info" to indicate the coming IB package type, encoding or decoding; and the "signature header" to guarantee the coming IB package's integrity, if this failed, the whole IB package will be discarded by VCN FW. That is why I was thinking to have a bias of AMDGPU_HW_IP_VCN_ENC could be better in the future.
Thanks,
Ruijing
-----Original Message-----
From: Koenig, Christian <[email protected]>
Sent: Monday, July 18, 2022 9:54 AM
To: Liu, Leo <[email protected]>; Dong, Ruijing <[email protected]>; [email protected]
Cc: Deucher, Alexander <[email protected]>
Subject: Re: [PATCH v4] drm/amdgpu: add HW_IP_VCN_UNIFIED type
Am 18.07.22 um 15:48 schrieb Leo Liu:
Quoted 38 lines · Christian König
Quoted 27 lines
Am 15.07.22 um 22:04 schrieb Ruijing Dong:
Quoted 18 lines
From VCN4,
AMDGPU_HW_IP_VCN_UNIFIEDis used to support both
encoding and decoding jobs, it re-uses the same queue number ofAMDGPU_HW_IP_VCN_ENC.link:
https://gitlab.freedesktop.org/mesa/drm/-/merge_requests/245/commitsSigned-off-by Ruijing Dong <[email protected]>--- include/uapi/drm/amdgpu_drm.h | 6 ++++++ 1 file changed, 6 insertions(+)(quoted diff) +0
-0
b/include/uapi/drm/amdgpu_drm.hindex18d3246d636e..e268cd3cdb12100644include/uapi/drm/amdgpu_drm.h struct drm_amdgpu_gem_va { · line 563
Quoted 4 lines
include/uapi/drm/amdgpu_drm.h +1
-0@@ -560,6 +560,12 @@ struct drm_amdgpu_gem_va {#define AMDGPU_HW_IP_UVD_ENC 5#define AMDGPU_HW_IP_VCN_DEC 6#define AMDGPU_HW_IP_VCN_ENC 7 +/** Please don't use "/**" here, that is badly formated for a kerneldoc comment.
Quoted 8 lines
include/uapi/drm/amdgpu_drm.h struct drm_amdgpu_gem_va { · line 568
Quoted 5 lines
include/uapi/drm/amdgpu_drm.h +5
-0+* From VCN4, AMDGPU_HW_IP_VCN_UNIFIED is used to support +* both encoding and decoding jobs, it re-uses the same +* queue number of AMDGPU_HW_IP_VCN_ENC. +*/ +#define AMDGPU_HW_IP_VCN_UNIFIED AMDGPU_HW_IP_VCN_ENCI'm still in doubt that adding another define with the same value as
AMDGPU_HW_IP_VCN_ENCis a good idea.
Quoted 8 lines
Hi Christian,
From VCN4, there is no VCN dec and enc ring type any more, the decode/encode will go through the unified queue, so using
AMDGPU_HW_IP_VCN_ENCis no longer accurate . KeepingAMDGPU_HW_IP_VCN_ENCtype is for legacy HW, and the newAMDGPU_HW_IP_VCN_UNIFIEDjust happen to use the same HW ring as legacy encode ring, so reuse the value, and that is the whole idea.
Yeah, I understand your reasoning I just don't see it this way.
What happened is that the encode ring was extended with decode functionality. In other words we still use the same format for encoding, we just added another one for decoding as well.
Renaming the enum and adding AMDGPU_HW_IP_VCN_UNIFIED suggests that this is something completely new, which is not the case here. The encoding commands stay the same, don't they?
So to sum it up my suggestion is to stick with AMDGPU_HW_IP_VCN_ENC and just document on the definition that this is used for both encode as well as decode starting with VCN4.
Regards,
Christian.
Quoted 16 lines
Thanks,
Leo
Quoted 10 lines
Instead we should just add the comment to
AMDGPU_HW_IP_VCN_ENC.Regards,
Christian.Quoted 2 lines
include/uapi/drm/amdgpu_drm.h +0
-0#define AMDGPU_HW_IP_VCN_JPEG 8#define AMDGPU_HW_IP_NUM 9
Christian König
maintainerAm 18.07.22 um 16:14 schrieb Dong, Ruijing:
Quoted 6 lines
[AMD Official Use Only - General]
Quoted 1 line
Quoted 1 line
What happened is that the encode ring was extended with decode functionality. In other words we still use the same format for encoding, we just added another one for decoding as well.
Just to clarify the format difference between legacy encoding and unified queue, we can do either way in the code.
Unified queue requires a different format. The original encoding/decoding format cannot be used in unified queue, which requires to have two new headers, "engine info" to indicate the coming IB package type, encoding or decoding; and the "signature header" to guarantee the coming IB package's integrity, if this failed, the whole IB package will be discarded by VCN FW. That is why I was thinking to have a bias of
AMDGPU_HW_IP_VCN_ENCcould be better in the future.
Yeah, but the remaining packet format is the same. And as far as I know you guys don't plan do clone that for some reason, don't you?
Adding another name for the same enum value can potentially be much more confusing than the fact that the encode ring now takes a bunch of more commands to do both encoding and decoding.
Regards,
Christian.
Quoted 78 lines
Thanks,
Ruijing-----Original Message-----
From: Koenig, Christian <[email protected]>
Sent: Monday, July 18, 2022 9:54 AM
To: Liu, Leo <[email protected]>; Dong, Ruijing <[email protected]>; [email protected]
Cc: Deucher, Alexander <[email protected]>
Subject: Re: [PATCH v4] drm/amdgpu: addHW_IP_VCN_UNIFIEDtypeAm 18.07.22 um 15:48 schrieb Leo Liu:
Quoted 34 lines · Christian König
Quoted 26 lines
Am 15.07.22 um 22:04 schrieb Ruijing Dong:
Quoted 18 lines
From VCN4,
AMDGPU_HW_IP_VCN_UNIFIEDis used to support both
encoding and decoding jobs, it re-uses the same queue number ofAMDGPU_HW_IP_VCN_ENC.link:
https://gitlab.freedesktop.org/mesa/drm/-/merge_requests/245/commitsSigned-off-by Ruijing Dong <[email protected]>--- include/uapi/drm/amdgpu_drm.h | 6 ++++++ 1 file changed, 6 insertions(+)(quoted diff) +0
-0
b/include/uapi/drm/amdgpu_drm.hindex18d3246d636e..e268cd3cdb12100644include/uapi/drm/amdgpu_drm.h struct drm_amdgpu_gem_va { · line 563
Quoted 4 lines
include/uapi/drm/amdgpu_drm.h +1
-0@@ -560,6 +560,12 @@ struct drm_amdgpu_gem_va {#define AMDGPU_HW_IP_UVD_ENC 5#define AMDGPU_HW_IP_VCN_DEC 6#define AMDGPU_HW_IP_VCN_ENC 7 +/** Please don't use "/**" here, that is badly formated for a kerneldoc comment.
Quoted 7 lines
include/uapi/drm/amdgpu_drm.h struct drm_amdgpu_gem_va { · line 568
Quoted 5 lines
include/uapi/drm/amdgpu_drm.h +5
-0+* From VCN4, AMDGPU_HW_IP_VCN_UNIFIED is used to support +* both encoding and decoding jobs, it re-uses the same +* queue number of AMDGPU_HW_IP_VCN_ENC. +*/ +#define AMDGPU_HW_IP_VCN_UNIFIED AMDGPU_HW_IP_VCN_ENCI'm still in doubt that adding another define with the same value as
AMDGPU_HW_IP_VCN_ENCis a good idea.Quoted 8 lines
Hi Christian,
From VCN4, there is no VCN dec and enc ring type any more, the
decode/encode will go through the unified queue, so usingAMDGPU_HW_IP_VCN_ENCis no longer accurate . KeepingAMDGPU_HW_IP_VCN_ENCtype is for legacy HW, and the newAMDGPU_HW_IP_VCN_UNIFIEDjust happen to use the same HW ring as legacy encode ring, so reuse the value, and that is the whole idea.Yeah, I understand your reasoning I just don't see it this way.
What happened is that the encode ring was extended with decode functionality. In other words we still use the same format for encoding, we just added another one for decoding as well.
Renaming the enum and adding
AMDGPU_HW_IP_VCN_UNIFIEDsuggests that this is something completely new, which is not the case here. The encoding commands stay the same, don't they?So to sum it up my suggestion is to stick with
AMDGPU_HW_IP_VCN_ENCand just document on the definition that this is used for both encode as well as decode starting with VCN4.Regards,
Christian.Quoted 13 lines
Thanks,
Leo
Quoted 8 lines
Instead we should just add the comment to
AMDGPU_HW_IP_VCN_ENC.Regards,
Christian.Quoted 2 lines
include/uapi/drm/amdgpu_drm.h +0
-0#define AMDGPU_HW_IP_VCN_JPEG 8#define AMDGPU_HW_IP_NUM 9
[AMD Official Use Only - General]
No, we don't plan to clone another one. I will modify the comment only and remove the bias.
Thanks
Ruijing
-----Original Message-----
From: Koenig, Christian <[email protected]>
Sent: Monday, July 18, 2022 10:37 AM
To: Dong, Ruijing <[email protected]>; Liu, Leo <[email protected]>; [email protected]
Cc: Deucher, Alexander <[email protected]>
Subject: Re: [PATCH v4] drm/amdgpu: add HW_IP_VCN_UNIFIED type
Am 18.07.22 um 16:14 schrieb Dong, Ruijing:
Quoted 6 lines
[AMD Official Use Only - General]
Quoted 1 line
Quoted 1 line
What happened is that the encode ring was extended with decode functionality. In other words we still use the same format for encoding, we just added another one for decoding as well.
Just to clarify the format difference between legacy encoding and unified queue, we can do either way in the code.
Unified queue requires a different format. The original encoding/decoding format cannot be used in unified queue, which requires to have two new headers, "engine info" to indicate the coming IB package type, encoding or decoding; and the "signature header" to guarantee the coming IB package's integrity, if this failed, the whole IB package will be discarded by VCN FW. That is why I was thinking to have a bias of
AMDGPU_HW_IP_VCN_ENCcould be better in the future.
Yeah, but the remaining packet format is the same. And as far as I know you guys don't plan do clone that for some reason, don't you?
Adding another name for the same enum value can potentially be much more confusing than the fact that the encode ring now takes a bunch of more commands to do both encoding and decoding.
Regards,
Christian.
Quoted 80 lines
Thanks,
Ruijing-----Original Message-----
From: Koenig, Christian <[email protected]>
Sent: Monday, July 18, 2022 9:54 AM
To: Liu, Leo <[email protected]>; Dong, Ruijing <[email protected]>; [email protected]
Cc: Deucher, Alexander <[email protected]>
Subject: Re: [PATCH v4] drm/amdgpu: addHW_IP_VCN_UNIFIEDtypeAm 18.07.22 um 15:48 schrieb Leo Liu:
Quoted 35 lines · Christian König
Quoted 27 lines
Am 15.07.22 um 22:04 schrieb Ruijing Dong:
Quoted 19 lines
From VCN4,
AMDGPU_HW_IP_VCN_UNIFIEDis used to support both
encoding and decoding jobs, it re-uses the same queue number ofAMDGPU_HW_IP_VCN_ENC.link:
https://gitlab.freedesktop.org/mesa/drm/-/merge_requests/245/commit
sSigned-off-by Ruijing Dong <[email protected]>--- include/uapi/drm/amdgpu_drm.h | 6 ++++++ 1 file changed, 6 insertions(+)(quoted diff) +0
-0
b/include/uapi/drm/amdgpu_drm.hindex18d3246d636e..e268cd3cdb12100644include/uapi/drm/amdgpu_drm.h struct drm_amdgpu_gem_va { · line 563
Quoted 4 lines
include/uapi/drm/amdgpu_drm.h +1
-0@@ -560,6 +560,12 @@ struct drm_amdgpu_gem_va {#define AMDGPU_HW_IP_UVD_ENC 5#define AMDGPU_HW_IP_VCN_DEC 6#define AMDGPU_HW_IP_VCN_ENC 7 +/** Please don't use "/**" here, that is badly formated for a kerneldoc comment.
Quoted 7 lines
include/uapi/drm/amdgpu_drm.h struct drm_amdgpu_gem_va { · line 568
Quoted 5 lines
include/uapi/drm/amdgpu_drm.h +5
-0+* From VCN4, AMDGPU_HW_IP_VCN_UNIFIED is used to support +* both encoding and decoding jobs, it re-uses the same +* queue number of AMDGPU_HW_IP_VCN_ENC. +*/ +#define AMDGPU_HW_IP_VCN_UNIFIED AMDGPU_HW_IP_VCN_ENCI'm still in doubt that adding another define with the same value as
AMDGPU_HW_IP_VCN_ENCis a good idea.Quoted 8 lines
Hi Christian,
From VCN4, there is no VCN dec and enc ring type any more, the
decode/encode will go through the unified queue, so usingAMDGPU_HW_IP_VCN_ENCis no longer accurate . KeepingAMDGPU_HW_IP_VCN_ENCtype is for legacy HW, and the newAMDGPU_HW_IP_VCN_UNIFIEDjust happen to use the same HW ring as legacy encode ring, so reuse the value, and that is the whole idea.Yeah, I understand your reasoning I just don't see it this way.
What happened is that the encode ring was extended with decode functionality. In other words we still use the same format for encoding, we just added another one for decoding as well.
Renaming the enum and adding
AMDGPU_HW_IP_VCN_UNIFIEDsuggests that this is something completely new, which is not the case here. The encoding commands stay the same, don't they?So to sum it up my suggestion is to stick with
AMDGPU_HW_IP_VCN_ENCand just document on the definition that this is used for both encode as well as decode starting with VCN4.Regards,
Christian.Quoted 13 lines
Thanks,
Leo
Quoted 8 lines
Instead we should just add the comment to
AMDGPU_HW_IP_VCN_ENC.Regards,
Christian.Quoted 2 lines
include/uapi/drm/amdgpu_drm.h +0
-0#define AMDGPU_HW_IP_VCN_JPEG 8#define AMDGPU_HW_IP_NUM 9