From: Jeonghee Kim Date: Thu, 15 Mar 2018 08:51:20 +0000 (+0900) Subject: media: mfc: add QoS request for MFC X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=28e1e61b015c814ba53151428e82d48c8f586528;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git media: mfc: add QoS request for MFC Change-Id: I144e96c6197c4eb5b1d48d85d64a17d0cc65cc67 Signed-off-by: Jeonghee Kim --- diff --git a/drivers/media/platform/exynos/mfc/s5p_mfc.c b/drivers/media/platform/exynos/mfc/s5p_mfc.c index d27b81f633ef..e753cd3deff6 100644 --- a/drivers/media/platform/exynos/mfc/s5p_mfc.c +++ b/drivers/media/platform/exynos/mfc/s5p_mfc.c @@ -849,6 +849,7 @@ static int mfc_parse_mfc_qos_platdata(struct device_node *np, char *node_name, } of_property_read_u32(np_qos, "thrd_mb", &qosdata->threshold_mb); + of_property_read_u32(np_qos, "freq_mfc", &qosdata->freq_mfc); of_property_read_u32(np_qos, "freq_int", &qosdata->freq_int); of_property_read_u32(np_qos, "freq_mif", &qosdata->freq_mif); of_property_read_u32(np_qos, "freq_cpu", &qosdata->freq_cpu); @@ -1189,8 +1190,9 @@ static int s5p_mfc_probe(struct platform_device *pdev) atomic_set(&dev->qos_req_cur, 0); for (i = 0; i < dev->pdata->num_qos_steps; i++) { - mfc_info_dev("QoS table[%d] int : %d, mif : %d\n", + mfc_info_dev("QoS table[%d] mfc: %d, int : %d, mif : %d\n", i, + dev->pdata->qos_table[i].freq_mfc, dev->pdata->qos_table[i].freq_int, dev->pdata->qos_table[i].freq_mif); } diff --git a/drivers/media/platform/exynos/mfc/s5p_mfc_data_struct.h b/drivers/media/platform/exynos/mfc/s5p_mfc_data_struct.h index 121ff5ff4a28..6a75fc6e19c8 100644 --- a/drivers/media/platform/exynos/mfc/s5p_mfc_data_struct.h +++ b/drivers/media/platform/exynos/mfc/s5p_mfc_data_struct.h @@ -723,6 +723,7 @@ struct s5p_mfc_dev { #ifdef CONFIG_MFC_USE_BUS_DEVFREQ struct list_head qos_queue; atomic_t qos_req_cur; + struct pm_qos_request qos_req_mfc; struct pm_qos_request qos_req_int; struct pm_qos_request qos_req_mif; #ifdef CONFIG_ARM_EXYNOS_MP_CPUFREQ diff --git a/drivers/media/platform/exynos/mfc/s5p_mfc_qos.c b/drivers/media/platform/exynos/mfc/s5p_mfc_qos.c index a3e9cc45c8dd..1e362618cb82 100644 --- a/drivers/media/platform/exynos/mfc/s5p_mfc_qos.c +++ b/drivers/media/platform/exynos/mfc/s5p_mfc_qos.c @@ -33,9 +33,13 @@ static void mfc_qos_operate(struct s5p_mfc_ctx *ctx, int opr_type, int idx) switch (opr_type) { case MFC_QOS_ADD: - MFC_TRACE_CTX("++ QOS add[%d] (int:%d, mif:%d)\n", - idx, qos_table[idx].freq_int, qos_table[idx].freq_mif); + MFC_TRACE_CTX("++ QOS add[%d] (mfc: %d, int:%d, mif:%d)\n", + idx, qos_table[idx].freq_mfc, + qos_table[idx].freq_int, qos_table[idx].freq_mif); + pm_qos_add_request(&dev->qos_req_mfc, + PM_QOS_MFC_THROUGHPUT, + qos_table[idx].freq_mfc); pm_qos_add_request(&dev->qos_req_int, PM_QOS_DEVICE_THROUGHPUT, qos_table[idx].freq_int); @@ -59,19 +63,22 @@ static void mfc_qos_operate(struct s5p_mfc_ctx *ctx, int opr_type, int idx) #endif atomic_set(&dev->qos_req_cur, idx + 1); - MFC_TRACE_CTX("-- QOS add[%d] (int:%d, mif:%d, mo:%d, mo_10bit:%d, mo_uhd_enc:%d)\n", - idx, qos_table[idx].freq_int, qos_table[idx].freq_mif, - qos_table[idx].mo_value, qos_table[idx].mo_10bit_value, - qos_table[idx].mo_uhd_enc60_value); - mfc_debug(2, "QOS add[%d] (int:%d, mif:%d, mo:%d, mo_10bit:%d, mo_uhd_enc:%d)\n", - idx, qos_table[idx].freq_int, qos_table[idx].freq_mif, - qos_table[idx].mo_value, qos_table[idx].mo_10bit_value, - qos_table[idx].mo_uhd_enc60_value); + MFC_TRACE_CTX("-- QOS add[%d] (mfc: %d, int:%d, mif:%d, mo:%d, mo10:%d, moenc:%d)\n", + idx, qos_table[idx].freq_mfc, qos_table[idx].freq_int, + qos_table[idx].freq_mif, qos_table[idx].mo_value, + qos_table[idx].mo_10bit_value, qos_table[idx].mo_uhd_enc60_value); + mfc_debug(2, "QOS add[%d] (mfc: %d, int:%d, mif:%d, mo:%d, mo10:%d, moenc:%d)\n", + idx, qos_table[idx].freq_mfc, qos_table[idx].freq_int, + qos_table[idx].freq_mif, qos_table[idx].mo_value, + qos_table[idx].mo_10bit_value, qos_table[idx].mo_uhd_enc60_value); break; case MFC_QOS_UPDATE: - MFC_TRACE_CTX("++ QOS update[%d] (int:%d, mif:%d)\n", - idx, qos_table[idx].freq_int, qos_table[idx].freq_mif); + MFC_TRACE_CTX("++ QOS update[%d] (mfc: %d, int:%d, mif:%d)\n", + idx, qos_table[idx].freq_mfc, + qos_table[idx].freq_int, qos_table[idx].freq_mif); + pm_qos_update_request(&dev->qos_req_mfc, + qos_table[idx].freq_mfc); pm_qos_update_request(&dev->qos_req_int, qos_table[idx].freq_int); pm_qos_update_request(&dev->qos_req_mif, @@ -91,18 +98,19 @@ static void mfc_qos_operate(struct s5p_mfc_ctx *ctx, int opr_type, int idx) #endif atomic_set(&dev->qos_req_cur, idx + 1); - MFC_TRACE_CTX("-- QOS update[%d] (int:%d, mif:%d, mo:%d, mo_10bit:%d, mo_uhd_enc:%d)\n", - idx, qos_table[idx].freq_int, qos_table[idx].freq_mif, - qos_table[idx].mo_value, qos_table[idx].mo_10bit_value, - qos_table[idx].mo_uhd_enc60_value); - mfc_debug(2, "QOS update[%d] (int:%d, mif:%d, mo:%d, mo_10bit:%d, mo_uhd_enc:%d)\n", - idx, qos_table[idx].freq_int, qos_table[idx].freq_mif, - qos_table[idx].mo_value, qos_table[idx].mo_10bit_value, - qos_table[idx].mo_uhd_enc60_value); + MFC_TRACE_CTX("-- QOS update[%d] (mfc: %d, int:%d, mif:%d, mo:%d, mo10:%d, moenc:%d)\n", + idx, qos_table[idx].freq_mfc, qos_table[idx].freq_int, + qos_table[idx].freq_mif, qos_table[idx].mo_value, + qos_table[idx].mo_10bit_value, qos_table[idx].mo_uhd_enc60_value); + mfc_debug(2, "QOS update[%d] (mfc: %d, int:%d, mif:%d, mo:%d, mo10:%d, moenc:%d)\n", + idx, qos_table[idx].freq_mfc, qos_table[idx].freq_int, + qos_table[idx].freq_mif, qos_table[idx].mo_value, + qos_table[idx].mo_10bit_value, qos_table[idx].mo_uhd_enc60_value); break; case MFC_QOS_REMOVE: MFC_TRACE_CTX("++ QOS remove\n"); + pm_qos_remove_request(&dev->qos_req_mfc); pm_qos_remove_request(&dev->qos_req_int); pm_qos_remove_request(&dev->qos_req_mif); @@ -156,11 +164,12 @@ static void mfc_qos_set(struct s5p_mfc_ctx *ctx, int i) struct s5p_mfc_platdata *pdata = dev->pdata; struct s5p_mfc_qos *qos_table = pdata->qos_table; - mfc_debug(2, "QoS table[%d] covered mb %d ~ %d (int:%d, mif:%d)\n", + mfc_debug(2, "QoS table[%d] covered mb %d ~ %d (mfc: %d, int:%d, mif:%d)\n", i, qos_table[i].threshold_mb, i == pdata->num_qos_steps - 1 ? pdata->max_mb : qos_table[i + 1].threshold_mb, - qos_table[i].freq_int, qos_table[i].freq_mif); + qos_table[i].freq_mfc, qos_table[i].freq_int, + qos_table[i].freq_mif); #ifdef CONFIG_EXYNOS_BTS if (mfc_bw->peak != dev->mfc_bw.peak) {