[PATCH 1/2] amdgpu/nv.c - Added video codec support for Yellow Carp

Zhu, James James.Zhu at amd.com
Tue Jul 13 19:17:43 UTC 2021


[AMD Official Use Only]

Reviewed-by: James Zhu <James.Zhu at amd.com> for the series


James Zhu

________________________________
From: Gopalakrishnan, Veerabadhran (Veera) <Veerabadhran.Gopalakrishnan at amd.com>
Sent: Tuesday, July 13, 2021 2:48 PM
To: amd-gfx at lists.freedesktop.org <amd-gfx at lists.freedesktop.org>
Cc: Liu, Leo <Leo.Liu at amd.com>; Zhu, James <James.Zhu at amd.com>; Zhang, Boyuan <Boyuan.Zhang at amd.com>; Rao, Srinath <Srinath.rao at amd.com>; Gopalakrishnan, Veerabadhran (Veera) <Veerabadhran.Gopalakrishnan at amd.com>
Subject: [PATCH 1/2] amdgpu/nv.c - Added video codec support for Yellow Carp

From: Veerabadhran Gopalakrishnan <veerabadhran.gopalakrishnan at amd.com>

Added the supported codecs in the video capabilities query.

Signed-off-by: Veerabadhran Gopalakrishnan <veerabadhran.gopalakrishnan at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/nv.c | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c
index 94a2c0742..04f6cf38c 100644
--- a/drivers/gpu/drm/amd/amdgpu/nv.c
+++ b/drivers/gpu/drm/amd/amdgpu/nv.c
@@ -333,6 +333,19 @@ static const struct amdgpu_video_codecs bg_video_codecs_encode = {
         .codec_array = NULL,
 };

+/* Yellow Carp*/
+static const struct amdgpu_video_codec_info yc_video_codecs_decode_array[] = {
+       {codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG4_AVC, 4096, 4906, 52)},
+       {codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_HEVC, 8192, 4352, 186)},
+       {codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_VP9, 8192, 4352, 0)},
+       {codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_JPEG, 4096, 4096, 0)},
+};
+
+static const struct amdgpu_video_codecs yc_video_codecs_decode = {
+       .codec_count = ARRAY_SIZE(bg_video_codecs_decode_array),
+       .codec_array = bg_video_codecs_decode_array,
+};
+
 static int nv_query_video_codecs(struct amdgpu_device *adev, bool encode,
                                  const struct amdgpu_video_codecs **codecs)
 {
@@ -353,12 +366,17 @@ static int nv_query_video_codecs(struct amdgpu_device *adev, bool encode,
         case CHIP_NAVY_FLOUNDER:
         case CHIP_DIMGREY_CAVEFISH:
         case CHIP_VANGOGH:
-       case CHIP_YELLOW_CARP:
                 if (encode)
                         *codecs = &nv_video_codecs_encode;
                 else
                         *codecs = &sc_video_codecs_decode;
                 return 0;
+       case CHIP_YELLOW_CARP:
+               if (encode)
+                       *codecs = &nv_video_codecs_encode;
+               else
+                       *codecs = &yc_video_codecs_decode;
+               return 0;
         case CHIP_BEIGE_GOBY:
                 if (encode)
                         *codecs = &bg_video_codecs_encode;
--
2.25.1

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20210713/d788b74e/attachment-0001.htm>


More information about the amd-gfx mailing list