This is an automatic generated email to let you know that the following patch 
were queued:

Subject: media: s5p-mfc: Add support for UHD encoding.
Author:  Aakarsh Jain <aakarsh.j...@samsung.com>
Date:    Wed Dec 13 13:41:01 2023 +0530

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-...@tesla.com
Signed-off-by: Smitha T Murthy <smithatmur...@gmail.com>
Signed-off-by: Aakarsh Jain <aakarsh.j...@samsung.com>
Signed-off-by: Hans Verkuil <hverkuil-ci...@xs4all.nl>

 drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c    |  9 ++++++---
 drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c | 12 ++++++++++++
 2 files changed, 18 insertions(+), 3 deletions(-)

---

diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c 
b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c
index 2f11a1e861e1..67fe0302464f 100644
--- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c
+++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c
@@ -1461,9 +1461,12 @@ static int vidioc_try_fmt(struct file *file, void *priv, 
struct v4l2_format *f)
                        mfc_err("Unsupported format by this MFC version.\n");
                        return -EINVAL;
                }
-
-               v4l_bound_align_image(&pix_fmt_mp->width, 8, 1920, 1,
-                       &pix_fmt_mp->height, 4, 1080, 1, 0);
+               if (IS_MFCV12(dev))
+                       v4l_bound_align_image(&pix_fmt_mp->width, 8, 3840, 1, 
&pix_fmt_mp
+                                       ->height, 4, 2160, 1, 0);
+               else
+                       v4l_bound_align_image(&pix_fmt_mp->width, 8, 1920, 1, 
&pix_fmt_mp
+                                       ->height, 4, 1080, 1, 0);
        } else {
                mfc_err("invalid buf type\n");
                return -EINVAL;
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 */

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
https://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to