<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<p style="font-family:Arial;font-size:10pt;color:#0000FF;margin:15pt;" align="Left">
[AMD Official Use Only]<br>
</p>
<br>
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
</div>
Reviewed-by:<span style="color:#c0c0c0"> </span>James<span style="color:#c0c0c0">
</span>Zhu<span style="color:#c0c0c0"> </span><James.Zhu@amd.com><span style="color:#c0c0c0">
</span><span style="color:#ff9d04">for</span><span style="color:#c0c0c0"> </span>
the<span style="color:#c0c0c0"> </span>series
<div>
<div id="Signature">
<div>
<div id="divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Arial,Helvetica,sans-serif">
<p style="margin-top: 0px; margin-bottom: 0px;"></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><br>
</p>
<p style="margin-top: 0px; margin-bottom: 0px;">James Zhu<br>
</p>
</div>
</div>
</div>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Gopalakrishnan, Veerabadhran (Veera) <Veerabadhran.Gopalakrishnan@amd.com><br>
<b>Sent:</b> Tuesday, July 13, 2021 2:48 PM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc:</b> Liu, Leo <Leo.Liu@amd.com>; Zhu, James <James.Zhu@amd.com>; Zhang, Boyuan <Boyuan.Zhang@amd.com>; Rao, Srinath <Srinath.rao@amd.com>; Gopalakrishnan, Veerabadhran (Veera) <Veerabadhran.Gopalakrishnan@amd.com><br>
<b>Subject:</b> [PATCH 1/2] amdgpu/nv.c - Added video codec support for Yellow Carp</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">From: Veerabadhran Gopalakrishnan <veerabadhran.gopalakrishnan@amd.com><br>
<br>
Added the supported codecs in the video capabilities query.<br>
<br>
Signed-off-by: Veerabadhran Gopalakrishnan <veerabadhran.gopalakrishnan@amd.com><br>
---<br>
 drivers/gpu/drm/amd/amdgpu/nv.c | 20 +++++++++++++++++++-<br>
 1 file changed, 19 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c<br>
index 94a2c0742..04f6cf38c 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/nv.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/nv.c<br>
@@ -333,6 +333,19 @@ static const struct amdgpu_video_codecs bg_video_codecs_encode = {<br>
         .codec_array = NULL,<br>
 };<br>
 <br>
+/* Yellow Carp*/<br>
+static const struct amdgpu_video_codec_info yc_video_codecs_decode_array[] = {<br>
+       {codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG4_AVC, 4096, 4906, 52)},<br>
+       {codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_HEVC, 8192, 4352, 186)},<br>
+       {codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_VP9, 8192, 4352, 0)},<br>
+       {codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_JPEG, 4096, 4096, 0)},<br>
+};<br>
+<br>
+static const struct amdgpu_video_codecs yc_video_codecs_decode = {<br>
+       .codec_count = ARRAY_SIZE(bg_video_codecs_decode_array),<br>
+       .codec_array = bg_video_codecs_decode_array,<br>
+};<br>
+<br>
 static int nv_query_video_codecs(struct amdgpu_device *adev, bool encode,<br>
                                  const struct amdgpu_video_codecs **codecs)<br>
 {<br>
@@ -353,12 +366,17 @@ static int nv_query_video_codecs(struct amdgpu_device *adev, bool encode,<br>
         case CHIP_NAVY_FLOUNDER:<br>
         case CHIP_DIMGREY_CAVEFISH:<br>
         case CHIP_VANGOGH:<br>
-       case CHIP_YELLOW_CARP:<br>
                 if (encode)<br>
                         *codecs = &nv_video_codecs_encode;<br>
                 else<br>
                         *codecs = &sc_video_codecs_decode;<br>
                 return 0;<br>
+       case CHIP_YELLOW_CARP:<br>
+               if (encode)<br>
+                       *codecs = &nv_video_codecs_encode;<br>
+               else<br>
+                       *codecs = &yc_video_codecs_decode;<br>
+               return 0;<br>
         case CHIP_BEIGE_GOBY:<br>
                 if (encode)<br>
                         *codecs = &bg_video_codecs_encode;<br>
-- <br>
2.25.1<br>
<br>
</div>
</span></font></div>
</div>
</body>
</html>