summaryrefslogtreecommitdiff
path: root/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c
diff options
context:
space:
mode:
authorAakarsh Jain <aakarsh.jain@samsung.com>2023-12-13 11:11:01 +0300
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2023-12-13 16:33:49 +0300
commit15fe06f7dcb9cd661ef62720f84cb3b3e0760026 (patch)
tree3e5aa0c0dee8b268acc10a219e06d2a6846e4ece /drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c
parentc639899bb66742f39cd6a0a4c27eb3240e309bff (diff)
downloadlinux-15fe06f7dcb9cd661ef62720f84cb3b3e0760026.tar.xz
media: s5p-mfc: Add support for UHD encoding.
MFC driver had restriction on max resolution of 1080p, updated it for UHD. Added corresponding support to set recommended profile and level for H264 in UHD scenario. Cc: linux-fsd@tesla.com Signed-off-by: Smitha T Murthy <smithatmurthy@gmail.com> Signed-off-by: Aakarsh Jain <aakarsh.jain@samsung.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c')
-rw-r--r--drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c
index 4a0d0e228e78..572293f3b190 100644
--- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c
+++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c
@@ -1071,6 +1071,18 @@ static int s5p_mfc_set_enc_params_h264(struct s5p_mfc_ctx *ctx)
reg |= ((p->num_b_frame & 0x3) << 16);
writel(reg, mfc_regs->e_gop_config);
+ /* UHD encoding case */
+ if (ctx->img_width == 3840 && ctx->img_height == 2160) {
+ if (p_h264->level < 51) {
+ mfc_debug(2, "Set Level 5.1 for UHD\n");
+ p_h264->level = 51;
+ }
+ if (p_h264->profile != 0x2) {
+ mfc_debug(2, "Set High profile for UHD\n");
+ p_h264->profile = 0x2;
+ }
+ }
+
/* profile & level */
reg = 0;
/** level */