[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1598334505.1969.2.camel@mtksdaap41>
Date: Tue, 25 Aug 2020 13:48:25 +0800
From: Tiffany Lin <tiffany.lin@...iatek.com>
To: Alexandre Courbot <acourbot@...omium.org>
CC: Andrew-CT Chen <andrew-ct.chen@...iatek.com>,
Hans Verkuil <hverkuil-cisco@...all.nl>,
Yunfei Dong <yunfei.dong@...iatek.com>,
Maoguang Meng <maoguang.meng@...iatek.com>,
Matthias Brugger <matthias.bgg@...il.com>,
<linux-media@...r.kernel.org>,
<linux-mediatek@...ts.infradead.org>, <devicetree@...r.kernel.org>,
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v4 16/17] media: mtk-vcodec: venc: set default time per
frame
On Fri, 2020-08-21 at 19:36 +0900, Alexandre Courbot wrote:
> The time per frame was left initialized to 0/0, which make the driver
> fail v4l2-compliance, and also leaves it potentially exposed to doing a
> division by zero.
>
Acked-by: Tiffany Lin <tiffany.lin@...iatek.com>
> Signed-off-by: Alexandre Courbot <acourbot@...omium.org>
> ---
> drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
> index 1b79185cf922..09baac2dbc36 100644
> --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
> +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
> @@ -24,6 +24,9 @@
> #define DFT_CFG_HEIGHT MTK_VENC_MIN_H
> #define MTK_MAX_CTRLS_HINT 20
>
> +#define MTK_DEFAULT_FRAMERATE_NUM 1001
> +#define MTK_DEFAULT_FRAMERATE_DENOM 30000
> +
> static void mtk_venc_worker(struct work_struct *work);
>
> static const struct v4l2_frmsize_stepwise mtk_venc_framesizes = {
> @@ -1197,6 +1200,8 @@ void mtk_vcodec_enc_set_default_params(struct mtk_vcodec_ctx *ctx)
> DFT_CFG_WIDTH * DFT_CFG_HEIGHT;
> ctx->q_data[MTK_Q_DATA_DST].bytesperline[0] = 0;
>
> + ctx->enc_params.framerate_num = MTK_DEFAULT_FRAMERATE_NUM;
> + ctx->enc_params.framerate_denom = MTK_DEFAULT_FRAMERATE_DENOM;
> }
>
> int mtk_vcodec_enc_ctrls_setup(struct mtk_vcodec_ctx *ctx)
Powered by blists - more mailing lists