From: Sunyoung Kang Date: Tue, 3 Jul 2018 02:15:38 +0000 (+0900) Subject: [COMMON] media: mfc: DRV4.0: rename functions X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b4949b7fb4bce08d31d8ee800d3323a24220019c;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [COMMON] media: mfc: DRV4.0: rename functions This renames the function names according to naming rule and uses intuitive name. naming rule: mfc_dec/enc__ Change-Id: I4393bc3b3920b3eba36a0f6b69ade6c7e5af0634 Signed-off-by: Sunyoung Kang --- diff --git a/drivers/media/platform/exynos/mfc/mfc_buf.c b/drivers/media/platform/exynos/mfc/mfc_buf.c index 17c10e470679..8ef61c60f56e 100644 --- a/drivers/media/platform/exynos/mfc/mfc_buf.c +++ b/drivers/media/platform/exynos/mfc/mfc_buf.c @@ -199,7 +199,7 @@ void mfc_release_instance_context(struct mfc_ctx *ctx) mfc_debug_leave(); } -static void __mfc_calc_dec_codec_buffer_size(struct mfc_ctx *ctx) +static void __mfc_dec_calc_codec_buffer_size(struct mfc_ctx *ctx) { struct mfc_dec *dec; int i; @@ -276,7 +276,7 @@ static void __mfc_calc_dec_codec_buffer_size(struct mfc_ctx *ctx) NUM_MPEG4_LF_BUF); } -static void __mfc_calc_enc_codec_buffer_size(struct mfc_ctx *ctx) +static void __mfc_enc_calc_codec_buffer_size(struct mfc_ctx *ctx) { struct mfc_enc *enc; unsigned int mb_width, mb_height; @@ -396,9 +396,9 @@ int mfc_alloc_codec_buffers(struct mfc_ctx *ctx) } if (ctx->type == MFCINST_DECODER) { - __mfc_calc_dec_codec_buffer_size(ctx); + __mfc_dec_calc_codec_buffer_size(ctx); } else if (ctx->type == MFCINST_ENCODER) { - __mfc_calc_enc_codec_buffer_size(ctx); + __mfc_enc_calc_codec_buffer_size(ctx); } else { mfc_err_ctx("invalid type: %d\n", ctx->type); return -EINVAL; diff --git a/drivers/media/platform/exynos/mfc/mfc_dec_ctrl.c b/drivers/media/platform/exynos/mfc/mfc_dec_ctrl.c index 958434cbb635..b1dceffdf551 100644 --- a/drivers/media/platform/exynos/mfc/mfc_dec_ctrl.c +++ b/drivers/media/platform/exynos/mfc/mfc_dec_ctrl.c @@ -392,7 +392,7 @@ static int mfc_dec_init_ctx_ctrls(struct mfc_ctx *ctx) return 0; } -static void __mfc_dec_remove_buf_ctrls(struct list_head *head) +static void __mfc_dec_cleanup_buf_ctrls(struct list_head *head) { struct mfc_buf_ctrl *buf_ctrl; @@ -478,7 +478,7 @@ static int mfc_dec_init_buf_ctrls(struct mfc_ctx *ctx, mfc_ctrl_list[i].id, mfc_ctrl_list[i].type); - __mfc_dec_remove_buf_ctrls(head); + __mfc_dec_cleanup_buf_ctrls(head); return -ENOMEM; } @@ -535,7 +535,7 @@ static int mfc_dec_cleanup_buf_ctrls(struct mfc_ctx *ctx, return -EINVAL; } - __mfc_dec_remove_buf_ctrls(head); + __mfc_dec_cleanup_buf_ctrls(head); return 0; } @@ -667,7 +667,7 @@ static int mfc_dec_get_buf_ctrls_val(struct mfc_ctx *ctx, struct list_head *head return 0; } -static int mfc_dec_set_buf_ctrls_val_nal_q_dec(struct mfc_ctx *ctx, +static int mfc_dec_set_buf_ctrls_val_nal_q(struct mfc_ctx *ctx, struct list_head *head, DecoderInputStr *pInStr) { struct mfc_buf_ctrl *buf_ctrl; @@ -702,7 +702,7 @@ static int mfc_dec_set_buf_ctrls_val_nal_q_dec(struct mfc_ctx *ctx, return 0; } -static int mfc_dec_get_buf_ctrls_val_nal_q_dec(struct mfc_ctx *ctx, +static int mfc_dec_get_buf_ctrls_val_nal_q(struct mfc_ctx *ctx, struct list_head *head, DecoderOutputStr *pOutStr) { struct mfc_dec *dec = ctx->dec_priv; @@ -888,8 +888,8 @@ struct mfc_ctrls_ops decoder_ctrls_ops = { .to_ctx_ctrls = mfc_dec_to_ctx_ctrls, .set_buf_ctrls_val = mfc_dec_set_buf_ctrls_val, .get_buf_ctrls_val = mfc_dec_get_buf_ctrls_val, - .set_buf_ctrls_val_nal_q_dec = mfc_dec_set_buf_ctrls_val_nal_q_dec, - .get_buf_ctrls_val_nal_q_dec = mfc_dec_get_buf_ctrls_val_nal_q_dec, + .set_buf_ctrls_val_nal_q_dec = mfc_dec_set_buf_ctrls_val_nal_q, + .get_buf_ctrls_val_nal_q_dec = mfc_dec_get_buf_ctrls_val_nal_q, .recover_buf_ctrls_val = mfc_dec_recover_buf_ctrls_val, .get_buf_update_val = mfc_dec_get_buf_update_val, .recover_buf_ctrls_nal_q = mfc_dec_recover_buf_ctrls_nal_q, diff --git a/drivers/media/platform/exynos/mfc/mfc_enc_ctrl.c b/drivers/media/platform/exynos/mfc/mfc_enc_ctrl.c index eb83d5f10e89..c6cf3d3f1f72 100644 --- a/drivers/media/platform/exynos/mfc/mfc_enc_ctrl.c +++ b/drivers/media/platform/exynos/mfc/mfc_enc_ctrl.c @@ -1209,7 +1209,7 @@ static int mfc_enc_get_buf_ctrls_val(struct mfc_ctx *ctx, struct list_head *head return 0; } -static int mfc_enc_set_buf_ctrls_val_nal_q_enc(struct mfc_ctx *ctx, +static int mfc_enc_set_buf_ctrls_val_nal_q(struct mfc_ctx *ctx, struct list_head *head, EncoderInputStr *pInStr) { struct mfc_buf_ctrl *buf_ctrl; @@ -1455,7 +1455,7 @@ static int mfc_enc_set_buf_ctrls_val_nal_q_enc(struct mfc_ctx *ctx, return 0; } -static int mfc_enc_get_buf_ctrls_val_nal_q_enc(struct mfc_ctx *ctx, +static int mfc_enc_get_buf_ctrls_val_nal_q(struct mfc_ctx *ctx, struct list_head *head, EncoderOutputStr *pOutStr) { struct mfc_buf_ctrl *buf_ctrl; @@ -1616,7 +1616,7 @@ struct mfc_ctrls_ops encoder_ctrls_ops = { .get_buf_ctrls_val = mfc_enc_get_buf_ctrls_val, .recover_buf_ctrls_val = mfc_enc_recover_buf_ctrls_val, .get_buf_update_val = mfc_enc_get_buf_update_val, - .set_buf_ctrls_val_nal_q_enc = mfc_enc_set_buf_ctrls_val_nal_q_enc, - .get_buf_ctrls_val_nal_q_enc = mfc_enc_get_buf_ctrls_val_nal_q_enc, + .set_buf_ctrls_val_nal_q_enc = mfc_enc_set_buf_ctrls_val_nal_q, + .get_buf_ctrls_val_nal_q_enc = mfc_enc_get_buf_ctrls_val_nal_q, .recover_buf_ctrls_nal_q = mfc_enc_recover_buf_ctrls_nal_q, }; diff --git a/drivers/media/platform/exynos/mfc/mfc_hw_reg_api.h b/drivers/media/platform/exynos/mfc/mfc_hw_reg_api.h index 542d47883fff..a3d15bb14984 100644 --- a/drivers/media/platform/exynos/mfc/mfc_hw_reg_api.h +++ b/drivers/media/platform/exynos/mfc/mfc_hw_reg_api.h @@ -21,7 +21,7 @@ #define mfc_get_int_reason() (MFC_READL(MFC_REG_RISC2HOST_CMD) \ & MFC_REG_RISC2HOST_CMD_MASK) -#define mfc_clear_int_sfr() \ +#define mfc_clear_int() \ do { \ MFC_WRITEL(0, MFC_REG_RISC2HOST_CMD); \ MFC_WRITEL(0, MFC_REG_RISC2HOST_INT); \ diff --git a/drivers/media/platform/exynos/mfc/mfc_isr.c b/drivers/media/platform/exynos/mfc/mfc_isr.c index 25d7dc69d9b0..afd32f3f1d61 100644 --- a/drivers/media/platform/exynos/mfc/mfc_isr.c +++ b/drivers/media/platform/exynos/mfc/mfc_isr.c @@ -1067,7 +1067,7 @@ static int __mfc_handle_seq_dec(struct mfc_ctx *ctx) for (i = 0; i < ctx->dst_fmt->num_planes; i++) ctx->min_dpb_size[i] = mfc_get_min_dpb_size(i); - mfc_dec_store_crop_info(ctx); + mfc_dec_get_crop_info(ctx); dec->mv_count = mfc_get_mv_count(); if (CODEC_10BIT(ctx) && dev->pdata->support_10bit) { if (mfc_get_luma_bit_depth_minus8() || @@ -1204,7 +1204,7 @@ static int __mfc_handle_seq_enc(struct mfc_ctx *ctx) return 0; } -static inline int is_err_condition(unsigned int err) +static inline int __mfc_is_err_condition(unsigned int err) { if (err == MFC_REG_ERR_NO_AVAILABLE_DPB || err == MFC_REG_ERR_INSUFFICIENT_DPB_SIZE || @@ -1269,7 +1269,7 @@ static inline int __mfc_nal_q_irq(struct mfc_dev *dev, if (nal_q_handle->nal_q_exception) mfc_set_bit(nal_q_handle->nal_q_out_handle->nal_q_ctx, &dev->work_bits); - mfc_clear_int_sfr(); + mfc_clear_int(); if (!nal_q_handle->nal_q_exception) mfc_nal_q_clock_off(dev, nal_q_handle); @@ -1283,7 +1283,7 @@ static inline int __mfc_nal_q_irq(struct mfc_dev *dev, mfc_debug(2, "[NALQ] return to created state\n"); mfc_nal_q_cleanup_queue(dev); mfc_nal_q_cleanup_clock(dev); - mfc_clear_int_sfr(); + mfc_clear_int(); mfc_pm_clock_off(dev); mfc_wake_up_dev(dev, reason, err); @@ -1294,7 +1294,7 @@ static inline int __mfc_nal_q_irq(struct mfc_dev *dev, nal_q_handle->nal_q_state == NAL_Q_STATE_STOPPED) { mfc_err_dev("[NALQ] Should not be here! state: %d, int reason : %d\n", nal_q_handle->nal_q_state, reason); - mfc_clear_int_sfr(); + mfc_clear_int(); ret = -1; } else { @@ -1319,7 +1319,7 @@ static inline int __mfc_handle_done_frame(struct mfc_ctx *ctx, if (ctx->type == MFCINST_DECODER) { if (ctx->state == MFCINST_SPECIAL_PARSING_NAL) { - mfc_clear_int_sfr(); + mfc_clear_int(); mfc_pm_clock_off(dev); mfc_clear_bit(ctx->num, &dev->work_bits); mfc_change_state(ctx, MFCINST_RUNNING); @@ -1380,7 +1380,7 @@ static int __mfc_irq_dev(struct mfc_dev *dev, unsigned int reason, unsigned int case MFC_REG_R2H_CMD_FW_STATUS_RET: case MFC_REG_R2H_CMD_SLEEP_RET: case MFC_REG_R2H_CMD_WAKEUP_RET: - mfc_clear_int_sfr(); + mfc_clear_int(); mfc_wake_up_dev(dev, reason, err); return 0; } @@ -1509,7 +1509,7 @@ irqreturn_t mfc_irq(int irq, void *priv) (err && (reason != MFC_REG_R2H_CMD_ERR_RET))) call_dop(dev, dump_regs, dev); - if (is_err_condition(err)) + if (__mfc_is_err_condition(err)) call_dop(dev, dump_and_stop_debug_mode, dev); if (dev->nal_q_handle) { @@ -1533,7 +1533,7 @@ irqreturn_t mfc_irq(int irq, void *priv) ctx = dev->ctx[dev->curr_ctx]; if (!ctx) { mfc_err_dev("no mfc context to run\n"); - mfc_clear_int_sfr(); + mfc_clear_int(); mfc_pm_clock_off(dev); goto irq_end; } @@ -1543,7 +1543,7 @@ irqreturn_t mfc_irq(int irq, void *priv) goto irq_end; /* clean-up interrupt */ - mfc_clear_int_sfr(); + mfc_clear_int(); if ((ctx->state != MFCINST_RES_CHANGE_INIT) && (mfc_ctx_ready(ctx) == 0)) mfc_clear_bit(ctx->num, &dev->work_bits); diff --git a/drivers/media/platform/exynos/mfc/mfc_otf.c b/drivers/media/platform/exynos/mfc/mfc_otf.c index 981d1c41535e..f35524335b05 100644 --- a/drivers/media/platform/exynos/mfc/mfc_otf.c +++ b/drivers/media/platform/exynos/mfc/mfc_otf.c @@ -33,7 +33,7 @@ #include "mfc_buf.h" #include "mfc_mem.h" -static struct mfc_fmt *__mfc_enc_hwfc_find_format(unsigned int pixelformat) +static struct mfc_fmt *__mfc_otf_find_hwfc_format(unsigned int pixelformat) { unsigned long i; @@ -56,7 +56,7 @@ static int __mfc_otf_set_buf_info(struct mfc_ctx *ctx) mfc_debug_enter(); - ctx->src_fmt = __mfc_enc_hwfc_find_format(buf_info->pixel_format); + ctx->src_fmt = __mfc_otf_find_hwfc_format(buf_info->pixel_format); if (!ctx->src_fmt) { mfc_err_ctx("[OTF] failed to set source format\n"); return -EINVAL; diff --git a/drivers/media/platform/exynos/mfc/mfc_reg_api.h b/drivers/media/platform/exynos/mfc/mfc_reg_api.h index 08bf6ba37302..25754a8d9ff6 100644 --- a/drivers/media/platform/exynos/mfc/mfc_reg_api.h +++ b/drivers/media/platform/exynos/mfc/mfc_reg_api.h @@ -205,7 +205,7 @@ static inline void mfc_update_nal_queue_input_count(struct mfc_dev *dev, MFC_WRITEL(input_count, MFC_REG_NAL_QUEUE_INPUT_COUNT); } -static inline void mfc_dec_store_crop_info(struct mfc_ctx *ctx) +static inline void mfc_dec_get_crop_info(struct mfc_ctx *ctx) { struct mfc_dev *dev = ctx->dev; struct mfc_dec *dec = ctx->dec_priv; diff --git a/drivers/media/platform/exynos/mfc/mfc_watchdog.c b/drivers/media/platform/exynos/mfc/mfc_watchdog.c index 64a3d8e43528..75b5bd3404c1 100644 --- a/drivers/media/platform/exynos/mfc/mfc_watchdog.c +++ b/drivers/media/platform/exynos/mfc/mfc_watchdog.c @@ -142,7 +142,7 @@ static void __mfc_save_logging_sfr(struct mfc_dev *dev) #endif } -static void __mfc_display_state(struct mfc_dev *dev) +static void __mfc_dump_state(struct mfc_dev *dev) { nal_queue_handle *nal_q_handle = dev->nal_q_handle; int i; @@ -179,7 +179,7 @@ static void __mfc_display_state(struct mfc_dev *dev) dev->ctx[i]->int_err); } -static void __mfc_print_trace(struct mfc_dev *dev) +static void __mfc_dump_trace(struct mfc_dev *dev) { int i, cnt, trace_cnt; @@ -269,8 +269,8 @@ void __mfc_dump_buffer_info(struct mfc_dev *dev) static void __mfc_dump_info_without_regs(struct mfc_dev *dev) { - __mfc_display_state(dev); - __mfc_print_trace(dev); + __mfc_dump_state(dev); + __mfc_dump_trace(dev); } static void __mfc_dump_info(struct mfc_dev *dev)