From: Ming Qian <ming.qian@nxp.com>
To: Nicolas Dufresne <nicolas@ndufresne.ca>,
"mchehab@kernel.org" <mchehab@kernel.org>,
"shawnguo@kernel.org" <shawnguo@kernel.org>,
"robh+dt@kernel.org" <robh+dt@kernel.org>,
"s.hauer@pengutronix.de" <s.hauer@pengutronix.de>
Cc: "hverkuil-cisco@xs4all.nl" <hverkuil-cisco@xs4all.nl>,
"kernel@pengutronix.de" <kernel@pengutronix.de>,
"festevam@gmail.com" <festevam@gmail.com>,
dl-linux-imx <linux-imx@nxp.com>,
Aisheng Dong <aisheng.dong@nxp.com>,
"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: RE: [EXT] Re: [PATCH v9 07/13] media: amphion: add v4l2 m2m vpu encoder stateful driver
Date: Fri, 24 Sep 2021 01:47:51 +0000 [thread overview]
Message-ID: <AM6PR04MB6341F798765924998642258BE7A49@AM6PR04MB6341.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <f39555c5f6ef46eed95462fec80012767e0cb136.camel@ndufresne.ca>
> -----Original Message-----
> From: Nicolas Dufresne [mailto:nicolas@ndufresne.ca]
> Sent: Thursday, September 23, 2021 10:23 PM
> To: Ming Qian <ming.qian@nxp.com>; mchehab@kernel.org;
> shawnguo@kernel.org; robh+dt@kernel.org; s.hauer@pengutronix.de
> Cc: hverkuil-cisco@xs4all.nl; kernel@pengutronix.de; festevam@gmail.com;
> dl-linux-imx <linux-imx@nxp.com>; Aisheng Dong <aisheng.dong@nxp.com>;
> linux-media@vger.kernel.org; linux-kernel@vger.kernel.org;
> devicetree@vger.kernel.org; linux-arm-kernel@lists.infradead.org
> Subject: [EXT] Re: [PATCH v9 07/13] media: amphion: add v4l2 m2m vpu
> encoder stateful driver
>
> Caution: EXT Email
>
> Le lundi 13 septembre 2021 à 17:11 +0800, Ming Qian a écrit :
> > This consists of video encoder implementation plus encoder controls.
> >
> > Signed-off-by: Ming Qian <ming.qian@nxp.com>
> > Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
> > Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
> > ---
> > drivers/media/platform/amphion/venc.c | 1382
> > +++++++++++++++++++++++++
> > 1 file changed, 1382 insertions(+)
> > create mode 100644 drivers/media/platform/amphion/venc.c
> >
> > diff --git a/drivers/media/platform/amphion/venc.c
> > b/drivers/media/platform/amphion/venc.c
> > new file mode 100644
> > index 000000000000..fdc9a59009ba
> > --- /dev/null
> > +++ b/drivers/media/platform/amphion/venc.c
> > @@ -0,0 +1,1382 @@
> > +// SPDX-License-Identifier: GPL-2.0
> > +/*
> > + * Copyright 2020-2021 NXP
> > + */
> > +
> > +#define TAG "ENC"
> > +
> > +#include <linux/init.h>
> > +#include <linux/interconnect.h>
> > +#include <linux/ioctl.h>
> > +#include <linux/list.h>
> > +#include <linux/kernel.h>
> > +#include <linux/module.h>
> > +#include <linux/delay.h>
> > +#include <linux/videodev2.h>
> > +#include <linux/ktime.h>
> > +#include <media/v4l2-device.h>
> > +#include <media/v4l2-event.h>
> > +#include <media/v4l2-mem2mem.h>
> > +#include <media/v4l2-ioctl.h>
> > +#include <media/videobuf2-v4l2.h>
> > +#include <media/videobuf2-dma-contig.h> #include
> > +<media/videobuf2-vmalloc.h> #include "vpu.h"
> > +#include "vpu_defs.h"
> > +#include "vpu_core.h"
> > +#include "vpu_helpers.h"
> > +#include "vpu_v4l2.h"
> > +#include "vpu_cmds.h"
> > +#include "vpu_rpc.h"
> > +#include "vpu_log.h"
> > +
> > +#define VENC_OUTPUT_ENABLE (1 << 0)
> > +#define VENC_CAPTURE_ENABLE (1 << 1)
> > +#define VENC_ENABLE_MASK (VENC_OUTPUT_ENABLE |
> VENC_CAPTURE_ENABLE)
> > +#define VENC_MAX_BUF_CNT 8
> > +
> > +struct venc_t {
> > + struct vpu_encode_params params;
> > + u32 request_key_frame;
> > + u32 input_ready;
> > + u32 cpb_size;
> > + bool bitrate_change;
> > +
> > + struct vpu_buffer enc[VENC_MAX_BUF_CNT];
> > + struct vpu_buffer ref[VENC_MAX_BUF_CNT];
> > + struct vpu_buffer act[VENC_MAX_BUF_CNT];
> > + struct list_head frames;
> > + u32 frame_count;
> > + u32 encode_count;
> > + u32 ready_count;
> > + u32 enable;
> > + u32 stopped;
> > +
> > + u32 skipped_count;
> > + u32 skipped_bytes;
> > +
> > + wait_queue_head_t wq;
> > +};
> > +
> > +struct venc_frame_t {
> > + struct list_head list;
> > + struct vpu_enc_pic_info info;
> > + u32 bytesused;
> > + s64 timestamp;
> > +};
> > +
> > +static const struct vpu_format venc_formats[] = {
> > + {
> > + .pixfmt = V4L2_PIX_FMT_NV12,
> > + .num_planes = 2,
> > + .type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,
>
> pixmp->num_planes is the number of allocation. V4L2_PIX_FMT_NV12 must
> pixmp->come with
> 1 allocation and [0] V4L2_PIX_FMT_NV12M must come with 2 allocations.
>
> [0]
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.ke
> rnel.org%2Fdoc%2Fhtml%2Fv4.10%2Fmedia%2Fuapi%2Fv4l%2Fpixfmt-nv12m
> .html&data=04%7C01%7Cming.qian%40nxp.com%7Cb1b9aac4f17a446f1
> cf008d97e9d975d%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C6
> 37680037585331278%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwM
> DAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata
> =AlH44y9iNomGKenkm4%2F1sfowhqX%2Fivc3z4FTlCgilfA%3D&reserved
> =0
>
> This currently confuses GStreamer and prevent encoding.
>
OK, I'll try to support V4L2_PIX_FMT_NV12M in the next version
next prev parent reply other threads:[~2021-09-24 1:47 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-13 9:11 [PATCH v9 00/13] amphion video decoder/encoder driver Ming Qian
2021-09-13 9:11 ` [PATCH v9 01/13] dt-bindings: media: amphion: add amphion video codec bindings Ming Qian
2021-09-13 9:11 ` [PATCH v9 02/13] media:Add nt8 and nt10 video format Ming Qian
2021-09-13 9:11 ` [PATCH v9 03/13] media: amphion: add amphion vpu device driver Ming Qian
2021-09-13 9:11 ` [PATCH v9 04/13] media: amphion: add vpu core driver Ming Qian
2021-09-22 13:10 ` Nicolas Dufresne
2021-09-23 10:32 ` [EXT] " Ming Qian
2021-09-23 14:27 ` Nicolas Dufresne
2021-09-24 1:52 ` [EXT] " Ming Qian
2021-09-13 9:11 ` [PATCH v9 05/13] media: amphion: implement vpu core communication based on mailbox Ming Qian
2021-09-13 9:11 ` [PATCH v9 06/13] media: amphion: add vpu v4l2 m2m support Ming Qian
2021-09-23 14:39 ` Nicolas Dufresne
2021-09-24 1:58 ` [EXT] " Ming Qian
2021-09-13 9:11 ` [PATCH v9 07/13] media: amphion: add v4l2 m2m vpu encoder stateful driver Ming Qian
2021-09-23 14:22 ` Nicolas Dufresne
2021-09-24 1:47 ` Ming Qian [this message]
2021-09-13 9:11 ` [PATCH v9 08/13] media: amphion: add v4l2 m2m vpu decoder " Ming Qian
2021-09-13 9:11 ` [PATCH v9 09/13] media: amphion: implement windsor encoder rpc interface Ming Qian
2021-09-13 9:11 ` [PATCH v9 10/13] media: amphion: implement malone decoder " Ming Qian
2021-09-13 9:11 ` [PATCH v9 11/13] ARM64: dts: freescale: imx8q: add imx vpu codec entries Ming Qian
2021-09-22 12:55 ` Nicolas Dufresne
2021-09-23 10:31 ` [EXT] " Ming Qian
2021-09-23 13:27 ` Nicolas Dufresne
2021-09-13 9:11 ` [PATCH v9 12/13] firmware: imx: scu-pd: imx8q: add vpu mu resources Ming Qian
2021-09-13 9:11 ` [PATCH v9 13/13] MAINTAINERS: add AMPHION VPU CODEC V4L2 driver entry Ming Qian
2021-09-22 14:13 ` [PATCH v9 00/13] amphion video decoder/encoder driver Nicolas Dufresne
2021-09-23 10:45 ` [EXT] " Ming Qian
2021-09-23 13:33 ` Nicolas Dufresne
2021-09-24 1:43 ` Ming Qian
2021-10-11 9:12 ` 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=AM6PR04MB6341F798765924998642258BE7A49@AM6PR04MB6341.eurprd04.prod.outlook.com \
--to=ming.qian@nxp.com \
--cc=aisheng.dong@nxp.com \
--cc=devicetree@vger.kernel.org \
--cc=festevam@gmail.com \
--cc=hverkuil-cisco@xs4all.nl \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-imx@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=nicolas@ndufresne.ca \
--cc=robh+dt@kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
/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).