From: Tzung-Bi Shih <tzungbi@google.com>
To: Alexandre Courbot <acourbot@chromium.org>
Cc: Tiffany Lin <tiffany.lin@mediatek.com>,
Andrew-CT Chen <andrew-ct.chen@mediatek.com>,
Hans Verkuil <hverkuil-cisco@xs4all.nl>,
Dafna Hirschfeld <dafna.hirschfeld@collabora.com>,
Yunfei Dong <yunfei.dong@mediatek.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
linux-media@vger.kernel.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
"moderated list:ARM/Mediatek SoC support"
<linux-mediatek@lists.infradead.org>
Subject: Re: [PATCH v5 11/14] media: mtk-vcodec: vdec: support stateless H.264 decoding
Date: Fri, 21 May 2021 21:38:13 +0800 [thread overview]
Message-ID: <CA+Px+wXXtsmG2q4aJ4Em1pzFcA-mA6CuATfXKevNyEOuBq+zYw@mail.gmail.com> (raw)
In-Reply-To: <20210519143011.1175546-12-acourbot@chromium.org>
On Wed, May 19, 2021 at 10:31 PM Alexandre Courbot
<acourbot@chromium.org> wrote:
> +#include "../vdec_drv_if.h"
> +#include "../mtk_vcodec_util.h"
> +#include "../mtk_vcodec_dec.h"
> +#include "../mtk_vcodec_intr.h"
> +#include "../vdec_vpu_if.h"
> +#include "../vdec_drv_base.h"
Would be good practice to sort them.
> +static int allocate_predication_buf(struct vdec_h264_slice_inst *inst)
> +{
> + int err = 0;
No need to initialize. It will be overridden soon.
> +static void free_predication_buf(struct vdec_h264_slice_inst *inst)
> +{
> + struct mtk_vcodec_mem *mem = NULL;
> +
> + mtk_vcodec_debug_enter(inst);
> +
> + inst->vsi_ctx.pred_buf_dma = 0;
> + mem = &inst->pred_buf;
Is it possible to inline to the variable declaration? Or mem no need
to initialize.
> +static int alloc_mv_buf(struct vdec_h264_slice_inst *inst,
> + struct vdec_pic_info *pic)
> +{
> + int i;
> + int err;
> + struct mtk_vcodec_mem *mem = NULL;
No need to initialize. It will be overridden soon.
> +static void free_mv_buf(struct vdec_h264_slice_inst *inst)
> +{
> + int i;
> + struct mtk_vcodec_mem *mem = NULL;
No need to initialize. It will be overridden soon.
> +static int vdec_h264_slice_init(struct mtk_vcodec_ctx *ctx)
> +{
> + struct vdec_h264_slice_inst *inst = NULL;
No need to initialize. It will be overridden soon.
> +static void vdec_h264_slice_deinit(void *h_vdec)
> +{
> + struct vdec_h264_slice_inst *inst =
> + (struct vdec_h264_slice_inst *)h_vdec;
No need to cast from void *.
> +static int vdec_h264_slice_decode(void *h_vdec, struct mtk_vcodec_mem *bs,
> + struct vdec_fb *fb, bool *res_chg)
> +{
> + struct vdec_h264_slice_inst *inst =
> + (struct vdec_h264_slice_inst *)h_vdec;
No need to cast from void *.
> + const struct v4l2_ctrl_h264_decode_params *dec_params =
> + get_ctrl_ptr(inst->ctx, V4L2_CID_STATELESS_H264_DECODE_PARAMS);
> + struct vdec_vpu_inst *vpu = &inst->vpu;
> + uint32_t data[2];
> + uint64_t y_fb_dma;
> + uint64_t c_fb_dma;
> + int err;
> +
> + /* bs NULL means flush decoder */
> + if (bs == NULL)
To neat, !bs.
> +static int vdec_h264_slice_get_param(void *h_vdec,
> + enum vdec_get_param_type type, void *out)
> +{
> + struct vdec_h264_slice_inst *inst =
> + (struct vdec_h264_slice_inst *)h_vdec;
No need to cast from void *.
next prev parent reply other threads:[~2021-05-21 13:38 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-19 14:29 [PATCH v5 00/14] media: mtk-vcodec: support for MT8183 decoder Alexandre Courbot
2021-05-19 14:29 ` [PATCH v5 01/14] media: mtk-vcodec: vdec: Support H264 profile control Alexandre Courbot
2021-05-21 13:36 ` Tzung-Bi Shih
2021-05-19 14:29 ` [PATCH v5 02/14] media: mtk-vcodec: vdec: use helpers in VIDIOC_(TRY_)DECODER_CMD Alexandre Courbot
2021-05-21 13:37 ` Tzung-Bi Shih
2021-05-19 14:30 ` [PATCH v5 03/14] media: mtk-vcodec: vdec: clamp OUTPUT resolution to hardware limits Alexandre Courbot
2021-05-21 13:37 ` Tzung-Bi Shih
2021-05-19 14:30 ` [PATCH v5 04/14] media: mtk-vcodec: make flush buffer reusable by encoder Alexandre Courbot
2021-05-21 13:37 ` Tzung-Bi Shih
2021-05-19 14:30 ` [PATCH v5 05/14] media: mtk-vcodec: venc: support START and STOP commands Alexandre Courbot
2021-05-21 13:37 ` Tzung-Bi Shih
2021-05-27 10:10 ` Alexandre Courbot
2021-05-28 7:03 ` Dafna Hirschfeld
2021-05-28 7:43 ` Dafna Hirschfeld
2021-07-05 5:04 ` Alexandre Courbot
2021-07-05 5:04 ` Alexandre Courbot
2021-07-06 15:17 ` Enric Balletbo Serra
2021-05-19 14:30 ` [PATCH v5 06/14] media: mtk-vcodec: vdec: move stateful ops into their own file Alexandre Courbot
2021-05-21 13:37 ` Tzung-Bi Shih
2021-05-27 10:10 ` Alexandre Courbot
2021-05-19 14:30 ` [PATCH v5 07/14] media: mtk-vcodec: vdec: handle firmware version field Alexandre Courbot
2021-05-21 13:37 ` Tzung-Bi Shih
2021-05-19 14:30 ` [PATCH v5 08/14] media: mtk-vcodec: support version 2 of decoder firmware ABI Alexandre Courbot
2021-05-21 13:37 ` Tzung-Bi Shih
2021-05-19 14:30 ` [PATCH v5 09/14] media: add Mediatek's MM21 format Alexandre Courbot
2021-05-21 13:37 ` Tzung-Bi Shih
2021-05-19 14:30 ` [PATCH v5 10/14] media: mtk-vcodec: vdec: support stateless API Alexandre Courbot
2021-05-21 13:38 ` Tzung-Bi Shih
2021-05-19 14:30 ` [PATCH v5 11/14] media: mtk-vcodec: vdec: support stateless H.264 decoding Alexandre Courbot
2021-05-21 13:38 ` Tzung-Bi Shih [this message]
2021-05-27 10:10 ` Alexandre Courbot
2021-05-19 14:30 ` [PATCH v5 12/14] media: mtk-vcodec: vdec: add media device if using stateless api Alexandre Courbot
2021-05-21 13:38 ` Tzung-Bi Shih
2021-05-19 14:30 ` [PATCH v5 13/14] dt-bindings: media: document mediatek,mt8183-vcodec-dec Alexandre Courbot
2021-05-19 14:30 ` [PATCH v5 14/14] media: mtk-vcodec: enable MT8183 decoder Alexandre Courbot
2021-05-21 13:38 ` Tzung-Bi Shih
2021-05-27 8:08 ` [PATCH v5 00/14] media: mtk-vcodec: support for " Hans Verkuil
2021-05-27 10:10 ` Alexandre Courbot
2021-05-27 10:18 ` Hans Verkuil
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CA+Px+wXXtsmG2q4aJ4Em1pzFcA-mA6CuATfXKevNyEOuBq+zYw@mail.gmail.com \
--to=tzungbi@google.com \
--cc=acourbot@chromium.org \
--cc=andrew-ct.chen@mediatek.com \
--cc=dafna.hirschfeld@collabora.com \
--cc=hverkuil-cisco@xs4all.nl \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=mchehab@kernel.org \
--cc=tiffany.lin@mediatek.com \
--cc=yunfei.dong@mediatek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).