From: Irui Wang <irui.wang@mediatek.com>
To: AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
"Hans Verkuil" <hverkuil-cisco@xs4all.nl>,
Tzung-Bi Shih <tzungbi@chromium.org>,
"Rob Herring" <robh+dt@kernel.org>,
Alexandre Courbot <acourbot@chromium.org>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Matthias Brugger <matthias.bgg@gmail.com>,
Tomasz Figa <tfiga@google.com>, Yong Wu <yong.wu@mediatek.com>,
Tiffany Lin <tiffany.lin@mediatek.com>,
"Andrew-CT Chen" <andrew-ct.chen@mediatek.com>
Cc: Hsin-Yi Wang <hsinyi@chromium.org>,
Maoguang Meng <maoguang.meng@mediatek.com>,
Longfei Wang <longfei.wang@mediatek.com>,
Yunfei Dong <yunfei.dong@mediatek.com>,
Fritz Koenig <frkoenig@chromium.org>,
<linux-media@vger.kernel.org>, <devicetree@vger.kernel.org>,
<linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<srv_heupstream@mediatek.com>,
<linux-mediatek@lists.infradead.org>,
<Project_Global_Chrome_Upstream_Group@mediatek.com>
Subject: Re: [PATCH v3, 00/10] Enable two H264 encoder core on MT8195
Date: Mon, 21 Mar 2022 09:38:49 +0800 [thread overview]
Message-ID: <9fe3230c05f12623e951f5c1f9c741222f326c64.camel@mediatek.com> (raw)
In-Reply-To: <aae7c675-6be4-03f1-a8fb-121faae320c2@collabora.com>
Dear Angelo,
Thanks for your comments.
On Fri, 2022-03-18 at 15:04 +0100, AngeloGioacchino Del Regno wrote:
> Il 17/03/22 09:22, Irui Wang ha scritto:
> > MT8195 has two H264 encoder cores, they have their own power-
> > domains,
> > clocks, interrupts, register base. The two H264 encoder cores can
> > work
> > together to achieve higher performance, it's a core mode called
> > frame-racing, one core has 4K@30fps performance, two cores can
> > achieve
> > 4K@60fps.
> > The two encoder core encoding process looks like this:
> >
> > VENC Core0: frm#0....frm#2....frm#4....
> > VENC Core1: ..frm#1....frm#3....frm#5....
> >
> > This series of patches are used to enable the two H264 encoder
> > cores,
> > encoding process will be changed:
> > As-Is: Synchronous
> > V4L2_VIDIOC_QBUF#0 --> device_run(triger encoder) --> wait encoder
> > IRQ -->
> > encoding done with result --> job_finish
> > V4l2_VIDIOC_QBUF#1 --> device_run(triger encoder) --> wait encoder
> > IRQ -->
> > encoding done with result --> job_finish
> > ...
> >
> > To-Be: Asynchronous
> > V4L2_VIDIOC_QBUF#0 --> device_run(triger encoder) --> job_finish
> > ..V4l2_VIDIOC_QBUF#1 --> device_run(triger encoder) --> job_finish
> > (venc core0 may encode done here, done the encoding result to
> > client)
> > V4L2_VIDIOC_QBUF#2 --> device_run(triger encoder) --> job_finish.
> >
> > There is no "wait encoder IRQ" synchronous call during frame-racing
> > mode
> > encoding process, it can full use the two encoder cores to achieve
> > higher
> > performance.
> >
>
> Hello Irui,
> like v1 and v2, also this version of the series will crash the kernel
> when
> trying to encode.
As mentioned before, dual core encoding need more encoding working
buffers in patch-8:
media: mtk-vcodec: Add more extra processing for venc_multi_core mode
a new structure, struct venc_multi_core_vsi defined for it,
encoding processing like this:
kernel --> ipi message --> scp firmware(userspace), vsi is a share
memory to transfer data between kernel and user, so, the definition of
vsi must be the same in kernel and userspace. otherwise, errors will be
occurred, for example, kernel crash.
When we enable dual core encoding in this patch, the
venc_multi_core_vsi used in kernel, but scp(userspace) still use the
older one vsi(struct venc_h264_vsi), the crash happened.
Maybe we would find out how to resolve the limitations, many thanks for
your review.
>
> Before pushing the next series, you shall ensure that it is not
> crashing
> the entire kernel, hence, please test your code with gstreamer.
>
>
> Please use the following pipeline to test:
>
> gst-launch-1.0 videotestsrc num-buffers=100 ! v4l2h264enc ! queue !
> h264parse !
> qtmux ! filesink location=test.mov
>
>
> Regards,
> Angelo
Thanks
Best Regards
prev parent reply other threads:[~2022-03-21 1:39 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-17 8:22 Irui Wang
2022-03-17 8:22 ` [PATCH v3, 01/10] media: mtk-vcodec: Use core type to indicate h264 and vp8 enc Irui Wang
2022-03-17 8:22 ` [PATCH v3, 02/10] media: mtk-vcodec: export encoder functions Irui Wang
2022-03-17 8:22 ` [PATCH v3, 03/10] dt-bindings: media: mtk-vcodec: Adds encoder cores dt-bindings for mt8195 Irui Wang
2022-03-17 23:32 ` Miles Chen
2022-03-25 20:57 ` Rob Herring
2022-03-26 2:00 ` Irui Wang
2022-03-28 13:48 ` Rob Herring
2022-03-29 1:26 ` Irui Wang
2022-03-29 13:09 ` Rob Herring
2022-03-30 8:48 ` Irui Wang
2022-03-31 18:00 ` Rob Herring
2022-03-17 8:22 ` [PATCH v3, 04/10] media: mtk-vcodec: Enable venc dual core usage Irui Wang
2022-03-17 8:22 ` [PATCH v3, 05/10] media: mtk-vcodec: mtk-vcodec: Rewrite venc power manage interface Irui Wang
2022-03-17 8:22 ` [PATCH v3, 06/10] media: mtk-vcodec: Add venc power on/off interface Irui Wang
2022-03-17 8:22 ` [PATCH v3, 07/10] media: mtk-vcodec: Rewrite venc clock interface Irui Wang
2022-03-17 8:22 ` [PATCH v3, 08/10] media: mtk-vcodec: Add more extra processing for venc_multi_core mode Irui Wang
2022-03-17 8:22 ` [PATCH v3, 09/10] media: mtk-vcodec: Add venc_multi_core mode encode process Irui Wang
2022-03-17 8:22 ` [PATCH v3, 10/10] media: mtk-vcodec: Done encode result to client Irui Wang
2022-03-18 14:04 ` [PATCH v3, 00/10] Enable two H264 encoder core on MT8195 AngeloGioacchino Del Regno
2022-03-21 1:38 ` Irui Wang [this message]
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=9fe3230c05f12623e951f5c1f9c741222f326c64.camel@mediatek.com \
--to=irui.wang@mediatek.com \
--cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
--cc=acourbot@chromium.org \
--cc=andrew-ct.chen@mediatek.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=devicetree@vger.kernel.org \
--cc=frkoenig@chromium.org \
--cc=hsinyi@chromium.org \
--cc=hverkuil-cisco@xs4all.nl \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=longfei.wang@mediatek.com \
--cc=maoguang.meng@mediatek.com \
--cc=matthias.bgg@gmail.com \
--cc=mchehab@kernel.org \
--cc=robh+dt@kernel.org \
--cc=srv_heupstream@mediatek.com \
--cc=tfiga@google.com \
--cc=tiffany.lin@mediatek.com \
--cc=tzungbi@chromium.org \
--cc=yong.wu@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
all inboxes | Powered by JetHome®