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

Subject: media: s5p-mfc: Add support for rate controls in MFCv12
Author:  Aakarsh Jain <aakarsh.j...@samsung.com>
Date:    Wed Dec 13 13:41:00 2023 +0530

In MFCv12, the rc configs are changed with support for CBR loose,
CBR tight and Variable Bitrate (VBR) added.

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>

 .../platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c      | 22 ++++++++++++++++++----
 .../platform/samsung/s5p-mfc/s5p_mfc_opr_v6.h      |  1 +
 2 files changed, 19 insertions(+), 4 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 36aebca11313..4a0d0e228e78 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
@@ -992,10 +992,24 @@ static int s5p_mfc_set_enc_params(struct s5p_mfc_ctx *ctx)
 
        /* reaction coefficient */
        if (p->rc_frame) {
-               if (p->rc_reaction_coeff < TIGHT_CBR_MAX) /* tight CBR */
-                       writel(1, mfc_regs->e_rc_mode);
-               else                                      /* loose CBR */
-                       writel(2, mfc_regs->e_rc_mode);
+               if (IS_MFCV12(dev)) {
+                       /* loose CBR */
+                       if (p->rc_reaction_coeff < LOOSE_CBR_MAX)
+                               writel(1, mfc_regs->e_rc_mode);
+                       /* tight CBR */
+                       else if (p->rc_reaction_coeff < TIGHT_CBR_MAX)
+                               writel(0, mfc_regs->e_rc_mode);
+                       /* VBR */
+                       else
+                               writel(2, mfc_regs->e_rc_mode);
+               } else {
+                       /* tight CBR */
+                       if (p->rc_reaction_coeff < TIGHT_CBR_MAX)
+                               writel(1, mfc_regs->e_rc_mode);
+                       /* loose CBR */
+                       else
+                               writel(2, mfc_regs->e_rc_mode);
+               }
        }
 
        /* seq header ctrl */
diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.h 
b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.h
index ff582eea4217..94ecb0e6e7c7 100644
--- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.h
+++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.h
@@ -40,6 +40,7 @@
 #define ENC_H264_LEVEL_MAX             42
 #define ENC_MPEG4_VOP_TIME_RES_MAX     ((1 << 16) - 1)
 #define FRAME_DELTA_H264_H263          1
+#define LOOSE_CBR_MAX                  5
 #define TIGHT_CBR_MAX                  10
 #define ENC_HEVC_RC_FRAME_RATE_MAX     ((1 << 16) - 1)
 #define ENC_HEVC_QP_INDEX_MIN          -12

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

Reply via email to