[COMMON] media: mfc: parse a new QoS weight
authorJeonghee Kim <jhhhh.kim@samsung.com>
Mon, 6 Aug 2018 06:00:51 +0000 (15:00 +0900)
committerhskang <hs1218.kang@samsung.com>
Sun, 9 Sep 2018 21:39:11 +0000 (06:39 +0900)
Some of the encoder options reduce performance.
If the following options are set, the weight is applied to the QoS calculation.
- B frame, 2-reference, GPB
The weight of each option is not redundant.

Change-Id: Ib97ad28d7a02c50c214b1c0a5f2ac05d631d0197
Signed-off-by: Jeonghee Kim <jhhhh.kim@samsung.com>
drivers/media/platform/exynos/mfc/mfc.c
drivers/media/platform/exynos/mfc/mfc_data_struct.h
drivers/media/platform/exynos/mfc/mfc_qos.c

index 43a404d4796e5e0346324e19536198bc987fc624..83dd38f5660f709b015caf6b980319345427b483 100644 (file)
@@ -1072,6 +1072,7 @@ static void __mfc_parse_dt(struct device_node *np, struct mfc_dev *mfc)
        of_property_read_u32(np, "qos_weight_422", &pdata->qos_weight.weight_422);
        of_property_read_u32(np, "qos_weight_bframe", &pdata->qos_weight.weight_bframe);
        of_property_read_u32(np, "qos_weight_num_of_ref", &pdata->qos_weight.weight_num_of_ref);
+       of_property_read_u32(np, "qos_weight_gpb", &pdata->qos_weight.weight_gpb);
        of_property_read_u32(np, "qos_weight_num_of_tile", &pdata->qos_weight.weight_num_of_tile);
 #endif
 }
index 9b6bc357aa4cc95609dff8419fda529eadf31133..2309c2fa5ae2a48a393e01e117a48a3e0d0fd581 100644 (file)
@@ -409,6 +409,7 @@ struct mfc_qos_weight {
        unsigned int weight_422;
        unsigned int weight_bframe;
        unsigned int weight_num_of_ref;
+       unsigned int weight_gpb;
        unsigned int weight_num_of_tile;
 };
 #endif
index fc401a57c820f89ed36a7aa9f3eb64492439bfc1..43aec5a97f583942c20b56ad663bfd4e8316348e 100644 (file)
@@ -342,11 +342,13 @@ static inline unsigned long __mfc_qos_get_weighted_mb(struct mfc_ctx *ctx,
                if ((IS_H264_ENC(ctx) || IS_HEVC_ENC(ctx)) && p->num_b_frame) {
                        weight = (weight * 100) / qos_weight->weight_bframe;
                        mfc_debug(3, "[QoS] weight: B frame encoding, weight: %d\n", weight / 10);
-               }
-               if ((IS_H264_ENC(ctx) || IS_HEVC_ENC(ctx) || IS_VP8_ENC(ctx) ||
+               } else if ((IS_H264_ENC(ctx) || IS_HEVC_ENC(ctx) || IS_VP8_ENC(ctx) ||
                                        IS_VP9_ENC(ctx)) && (p->num_refs_for_p >= 2)) {
                        weight = (weight * 100) / qos_weight->weight_num_of_ref;
                        mfc_debug(3, "[QoS] weight: num of ref >= 2, weight: %d\n", weight / 10);
+               } else if (IS_HEVC_ENC(ctx) && p->codec.hevc.general_pb_enable) {
+                       weight = (weight * 100) / qos_weight->weight_gpb;
+                       mfc_debug(3, "[QoS] weight: Genaral PB, weight: %d\n", weight / 10);
                }
        }
        if (dec) {