|
@@ -220,6 +220,12 @@ static int s5p_mfc_alloc_codec_buffers_v6(struct s5p_mfc_ctx *ctx)
|
|
|
S5P_FIMV_SCRATCH_BUFFER_ALIGN_V6);
|
|
|
ctx->bank1.size = ctx->scratch_buf_size;
|
|
|
break;
|
|
|
+ case S5P_MFC_CODEC_HEVC_DEC:
|
|
|
+ mfc_debug(2, "Use min scratch buffer size\n");
|
|
|
+ ctx->bank1.size =
|
|
|
+ ctx->scratch_buf_size +
|
|
|
+ (ctx->mv_count * ctx->mv_size);
|
|
|
+ break;
|
|
|
case S5P_MFC_CODEC_H264_ENC:
|
|
|
if (IS_MFCV10(dev)) {
|
|
|
mfc_debug(2, "Use min scratch buffer size\n");
|
|
@@ -321,6 +327,7 @@ static int s5p_mfc_alloc_instance_buffer_v6(struct s5p_mfc_ctx *ctx)
|
|
|
switch (ctx->codec_mode) {
|
|
|
case S5P_MFC_CODEC_H264_DEC:
|
|
|
case S5P_MFC_CODEC_H264_MVC_DEC:
|
|
|
+ case S5P_MFC_CODEC_HEVC_DEC:
|
|
|
ctx->ctx.size = buf_size->h264_dec_ctx;
|
|
|
break;
|
|
|
case S5P_MFC_CODEC_MPEG4_DEC:
|
|
@@ -434,6 +441,10 @@ static void s5p_mfc_dec_calc_dpb_size_v6(struct s5p_mfc_ctx *ctx)
|
|
|
ctx->mv_size = S5P_MFC_DEC_MV_SIZE_V6(ctx->img_width,
|
|
|
ctx->img_height);
|
|
|
}
|
|
|
+ } else if (ctx->codec_mode == S5P_MFC_CODEC_HEVC_DEC) {
|
|
|
+ ctx->mv_size = s5p_mfc_dec_hevc_mv_size(ctx->img_width,
|
|
|
+ ctx->img_height);
|
|
|
+ ctx->mv_size = ALIGN(ctx->mv_size, 32);
|
|
|
} else {
|
|
|
ctx->mv_size = 0;
|
|
|
}
|
|
@@ -515,7 +526,8 @@ static int s5p_mfc_set_dec_frame_buffer_v6(struct s5p_mfc_ctx *ctx)
|
|
|
buf_size1 -= ctx->scratch_buf_size;
|
|
|
|
|
|
if (ctx->codec_mode == S5P_FIMV_CODEC_H264_DEC ||
|
|
|
- ctx->codec_mode == S5P_FIMV_CODEC_H264_MVC_DEC){
|
|
|
+ ctx->codec_mode == S5P_FIMV_CODEC_H264_MVC_DEC ||
|
|
|
+ ctx->codec_mode == S5P_FIMV_CODEC_HEVC_DEC) {
|
|
|
writel(ctx->mv_size, mfc_regs->d_mv_buffer_size);
|
|
|
writel(ctx->mv_count, mfc_regs->d_num_mv);
|
|
|
}
|
|
@@ -538,7 +550,8 @@ static int s5p_mfc_set_dec_frame_buffer_v6(struct s5p_mfc_ctx *ctx)
|
|
|
mfc_regs->d_second_plane_dpb + i * 4);
|
|
|
}
|
|
|
if (ctx->codec_mode == S5P_MFC_CODEC_H264_DEC ||
|
|
|
- ctx->codec_mode == S5P_MFC_CODEC_H264_MVC_DEC) {
|
|
|
+ ctx->codec_mode == S5P_MFC_CODEC_H264_MVC_DEC ||
|
|
|
+ ctx->codec_mode == S5P_MFC_CODEC_HEVC_DEC) {
|
|
|
for (i = 0; i < ctx->mv_count; i++) {
|
|
|
/* To test alignment */
|
|
|
align_gap = buf_addr1;
|