r600: Remove HEVC related code since HEVC is not supported
authorThong Thai <thong.thai@amd.com>
Thu, 19 Dec 2019 19:53:47 +0000 (14:53 -0500)
committerMarge Bot <eric+marge@anholt.net>
Fri, 3 Jan 2020 16:30:22 +0000 (16:30 +0000)
Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3153>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3153>

src/gallium/drivers/r600/radeon_uvd.c
src/gallium/drivers/r600/radeon_video.c

index 5c46731a48074963c93820762d25c20534358108..e7107c0b49bda29eeac4257f4425484ac400d86a 100644 (file)
@@ -216,9 +216,6 @@ static uint32_t profile2stream_type(struct ruvd_decoder *dec, unsigned family)
        case PIPE_VIDEO_FORMAT_MPEG4:
                return RUVD_CODEC_MPEG4;
 
-       case PIPE_VIDEO_FORMAT_HEVC:
-               return RUVD_CODEC_H265;
-
        case PIPE_VIDEO_FORMAT_JPEG:
                return RUVD_CODEC_MJPEG;
 
@@ -360,20 +357,6 @@ static unsigned calc_dpb_size(struct ruvd_decoder *dec)
                break;
        }
 
-       case PIPE_VIDEO_FORMAT_HEVC:
-               if (dec->base.width * dec->base.height >= 4096*2000)
-                       max_references = MAX2(max_references, 8);
-               else
-                       max_references = MAX2(max_references, 17);
-
-               width = align (width, 16);
-               height = align (height, 16);
-               if (dec->base.profile == PIPE_VIDEO_PROFILE_HEVC_MAIN_10)
-                       dpb_size = align((align(width, get_db_pitch_alignment(dec)) * height * 9) / 4, 256) * max_references;
-               else
-                       dpb_size = align((align(width, get_db_pitch_alignment(dec)) * height * 3) / 2, 256) * max_references;
-               break;
-
        case PIPE_VIDEO_FORMAT_VC1:
                // the firmware seems to allways assume a minimum of ref frames
                max_references = MAX2(NUM_VC1_REFS, max_references);
@@ -665,19 +648,6 @@ static struct ruvd_h265 get_h265_msg(struct ruvd_decoder *dec, struct pipe_video
                        result.direct_reflist[i][j] = pic->RefPicList[i][j];
        }
 
-       if (pic->base.profile == PIPE_VIDEO_PROFILE_HEVC_MAIN_10) {
-               if (target->buffer_format == PIPE_FORMAT_P010 ||
-                       target->buffer_format == PIPE_FORMAT_P016) {
-                       result.p010_mode = 1;
-                       result.msb_mode = 1;
-               } else {
-                       result.luma_10to8 = 5;
-                       result.chroma_10to8 = 5;
-                       result.sclr_luma10to8 = 4;
-                       result.sclr_chroma10to8 = 4;
-               }
-       }
-
        /* TODO
        result.highestTid;
        result.isNonRef;
@@ -1197,24 +1167,6 @@ static void ruvd_end_frame(struct pipe_video_codec *decoder,
                dec->msg->body.decode.codec.h264 = get_h264_msg(dec, (struct pipe_h264_picture_desc*)picture);
                break;
 
-       case PIPE_VIDEO_FORMAT_HEVC:
-               dec->msg->body.decode.codec.h265 = get_h265_msg(dec, target, (struct pipe_h265_picture_desc*)picture);
-               if (dec->ctx.res == NULL) {
-                       unsigned ctx_size;
-                       if (dec->base.profile == PIPE_VIDEO_PROFILE_HEVC_MAIN_10)
-                               ctx_size = calc_ctx_size_h265_main10(dec, (struct pipe_h265_picture_desc*)picture);
-                       else
-                               ctx_size = calc_ctx_size_h265_main(dec);
-                       if (!rvid_create_buffer(dec->screen, &dec->ctx, ctx_size, PIPE_USAGE_DEFAULT)) {
-                               RVID_ERR("Can't allocated context buffer.\n");
-                       }
-                       rvid_clear_buffer(decoder->context, &dec->ctx);
-               }
-
-               if (dec->ctx.res)
-                       dec->msg->body.decode.dpb_reserved = dec->ctx.res->buf->size;
-               break;
-
        case PIPE_VIDEO_FORMAT_VC1:
                dec->msg->body.decode.codec.vc1 = get_vc1_msg((struct pipe_vc1_picture_desc*)picture);
                break;
index 9149629a38c768bd48fd3080102b349e8bf41d18..81c1a5e511b38786cc5947bb8f9555ba3f0310a3 100644 (file)
@@ -278,10 +278,7 @@ int rvid_get_video_param(struct pipe_screen *screen,
        case PIPE_VIDEO_CAP_MAX_HEIGHT:
                return 1152;
        case PIPE_VIDEO_CAP_PREFERED_FORMAT:
-               if (profile == PIPE_VIDEO_PROFILE_HEVC_MAIN_10)
-                       return PIPE_FORMAT_P016;
-               else
-                       return PIPE_FORMAT_NV12;
+               return PIPE_FORMAT_NV12;
 
        case PIPE_VIDEO_CAP_PREFERS_INTERLACED:
        case PIPE_VIDEO_CAP_SUPPORTS_INTERLACED:
@@ -293,9 +290,7 @@ int rvid_get_video_param(struct pipe_screen *screen,
                } else {
                        enum pipe_video_format format = u_reduce_video_profile(profile);
 
-                       if (format == PIPE_VIDEO_FORMAT_HEVC)
-                               return false; //The firmware doesn't support interlaced HEVC.
-                       else if (format == PIPE_VIDEO_FORMAT_JPEG)
+                       if (format == PIPE_VIDEO_FORMAT_JPEG)
                                return false;
                        return true;
                }
@@ -322,9 +317,6 @@ int rvid_get_video_param(struct pipe_screen *screen,
                case PIPE_VIDEO_PROFILE_MPEG4_AVC_MAIN:
                case PIPE_VIDEO_PROFILE_MPEG4_AVC_HIGH:
                        return 41;
-               case PIPE_VIDEO_PROFILE_HEVC_MAIN:
-               case PIPE_VIDEO_PROFILE_HEVC_MAIN_10:
-                       return 186;
                default:
                        return 0;
                }
@@ -338,11 +330,6 @@ bool rvid_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 */
-       if (profile == PIPE_VIDEO_PROFILE_HEVC_MAIN_10)
-               return (format == PIPE_FORMAT_NV12) ||
-                       (format == PIPE_FORMAT_P016);
-
        /* we can only handle this one with UVD */
        if (profile != PIPE_VIDEO_PROFILE_UNKNOWN)
                return format == PIPE_FORMAT_NV12;