radeonsi: add 10-bit HEVC encode support for VCN2.0 devices
authorThong Thai <thong.thai@amd.com>
Tue, 3 Mar 2020 19:10:33 +0000 (14:10 -0500)
committerMarge Bot <eric+marge@anholt.net>
Fri, 6 Mar 2020 16:10:40 +0000 (16:10 +0000)
Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4033>

src/gallium/drivers/radeonsi/si_get.c

index dad1c7431b4deee96e26157e3477a5c108d84dbe..8a8627d7e711806bfdea2a8f2c3751a3498e455b 100644 (file)
@@ -560,12 +560,14 @@ static int si_get_video_param(struct pipe_screen *screen,
        if (entrypoint == PIPE_VIDEO_ENTRYPOINT_ENCODE) {
                switch (param) {
                case PIPE_VIDEO_CAP_SUPPORTED:
-                       return (codec == PIPE_VIDEO_FORMAT_MPEG4_AVC &&
-                               (si_vce_is_fw_version_supported(sscreen) ||
-                               sscreen->info.family >= CHIP_RAVEN)) ||
+                       return ((codec == PIPE_VIDEO_FORMAT_MPEG4_AVC &&
+                               (sscreen->info.family >= CHIP_RAVEN ||
+                                si_vce_is_fw_version_supported(sscreen))) ||
                                (profile == PIPE_VIDEO_PROFILE_HEVC_MAIN &&
                                (sscreen->info.family >= CHIP_RAVEN ||
-                               si_radeon_uvd_enc_supported(sscreen)));
+                                si_radeon_uvd_enc_supported(sscreen))) ||
+                               (profile == PIPE_VIDEO_PROFILE_HEVC_MAIN_10 &&
+                                sscreen->info.family >= CHIP_RENOIR));
                case PIPE_VIDEO_CAP_NPOT_TEXTURES:
                        return 1;
                case PIPE_VIDEO_CAP_MAX_WIDTH:
@@ -710,10 +712,11 @@ static bool si_vid_is_format_supported(struct pipe_screen *screen,
                                       enum pipe_video_profile profile,
                                       enum pipe_video_entrypoint entrypoint)
 {
-       /* HEVC 10 bit decoding should use P016 instead of NV12 if possible */
+       /* HEVC 10 bit decoding should use P010 instead of NV12 if possible */
        if (profile == PIPE_VIDEO_PROFILE_HEVC_MAIN_10)
                return (format == PIPE_FORMAT_NV12) ||
-                       (format == PIPE_FORMAT_P016);
+                      (format == PIPE_FORMAT_P010) ||
+                      (format == PIPE_FORMAT_P016);
 
        /* Vp9 profile 2 supports 10 bit decoding using P016 */
        if (profile == PIPE_VIDEO_PROFILE_VP9_PROFILE2)