All of lore.kernel.org
 help / color / mirror / Atom feed
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 v13 08/13] media: amphion: add v4l2 m2m vpu decoder stateful driver
Date: Fri, 3 Dec 2021 06:01:53 +0000	[thread overview]
Message-ID: <AM6PR04MB6341537EBD82451CA14A5E3EE76A9@AM6PR04MB6341.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <AM6PR04MB6341AC4C0057B09DB8A58234E76A9@AM6PR04MB6341.eurprd04.prod.outlook.com>

> -----Original Message-----
> From: Ming Qian
> Sent: Friday, December 3, 2021 1:43 PM
> To: Nicolas Dufresne <nicolas@ndufresne.ca>; 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: RE: [EXT] Re: [PATCH v13 08/13] media: amphion: add v4l2 m2m vpu
> decoder stateful driver
> 
> > -----Original Message-----
> > From: Nicolas Dufresne [mailto:nicolas@ndufresne.ca]
> > Sent: Friday, December 3, 2021 12:56 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 v13 08/13] media: amphion: add v4l2 m2m vpu
> > decoder stateful driver
> >
> > Caution: EXT Email
> >
> > Le mardi 30 novembre 2021 à 17:48 +0800, Ming Qian a écrit :
> > > This consists of video decoder implementation plus decoder 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/vdec.c | 1680
> > +++++++++++++++++++++++++
> 
> 
> > > +
> > > +static void vdec_init_fmt(struct vpu_inst *inst) {
> > > +     struct vdec_t *vdec = inst->priv;
> > > +     const struct vpu_format *fmt;
> > > +     int i;
> > > +
> > > +     fmt = vpu_helper_find_format(inst, inst->cap_format.type,
> > vdec->codec_info.pixfmt);
> > > +     inst->out_format.width = vdec->codec_info.width;
> > > +     inst->out_format.height = vdec->codec_info.height;
> > > +     inst->cap_format.width = vdec->codec_info.decoded_width;
> > > +     inst->cap_format.height = vdec->codec_info.decoded_height;
> > > +     inst->cap_format.pixfmt = vdec->codec_info.pixfmt;
> > > +     if (fmt) {
> > > +             inst->cap_format.num_planes = fmt->num_planes;
> > > +             inst->cap_format.flags = fmt->flags;
> > > +     }
> > > +     for (i = 0; i < inst->cap_format.num_planes; i++) {
> > > +             inst->cap_format.bytesperline[i] =
> > vdec->codec_info.bytesperline[i];
> > > +             inst->cap_format.sizeimage[i] =
> > vdec->codec_info.sizeimage[i];
> > > +     }
> > > +     if (vdec->codec_info.progressive)
> > > +             inst->cap_format.field = V4L2_FIELD_NONE;
> > > +     else
> > > +             inst->cap_format.field = V4L2_FIELD_INTERLACED;
> >
> > As a followup, this should be conditional to the chosen pixel format.
> > If I understood correct, you produce interlaced is only produce for
> > linear NV12, for tiled the fields are outputed seperated in their
> > respective v4l2_buffer. Note sure where yet, but the V4L2 spec
> > requires you to pair the fields by using the same seq_num on both.
> 
> The amphion vpu will store the two fields into one v4l2_buf, So I'll change
> V4L2_FIELD_INTERLACED to V4L2_FIELD_SEQ_TB
> 

Hi Nicolas,
    Seems gstreamer doesn't support V4L2_FIELD_SEQ_TB yet.

  switch (fmt.fmt.pix.field) {
    case V4L2_FIELD_ANY:
    case V4L2_FIELD_NONE:
      interlace_mode = GST_VIDEO_INTERLACE_MODE_PROGRESSIVE;
      break;
    case V4L2_FIELD_INTERLACED:
    case V4L2_FIELD_INTERLACED_TB:
    case V4L2_FIELD_INTERLACED_BT:
      interlace_mode = GST_VIDEO_INTERLACE_MODE_INTERLEAVED;
      break;
    case V4L2_FIELD_ALTERNATE:
      interlace_mode = GST_VIDEO_INTERLACE_MODE_ALTERNATE;
      break;
    default:
      goto unsupported_field;
  }

> >
> > > +     if (vdec->codec_info.color_primaries ==
> V4L2_COLORSPACE_DEFAULT)
> > > +             vdec->codec_info.color_primaries =
> > V4L2_COLORSPACE_REC709;
> > > +     if (vdec->codec_info.transfer_chars == V4L2_XFER_FUNC_DEFAULT)
> > > +             vdec->codec_info.transfer_chars = V4L2_XFER_FUNC_709;
> > > +     if (vdec->codec_info.matrix_coeffs == V4L2_YCBCR_ENC_DEFAULT)
> > > +             vdec->codec_info.matrix_coeffs = V4L2_YCBCR_ENC_709;
> > > +     if (vdec->codec_info.full_range == V4L2_QUANTIZATION_DEFAULT)
> > > +             vdec->codec_info.full_range =
> > V4L2_QUANTIZATION_LIM_RANGE;
> > > +}
> > > +

WARNING: multiple messages have this Message-ID (diff)
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 v13 08/13] media: amphion: add v4l2 m2m vpu decoder stateful driver
Date: Fri, 3 Dec 2021 06:01:53 +0000	[thread overview]
Message-ID: <AM6PR04MB6341537EBD82451CA14A5E3EE76A9@AM6PR04MB6341.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <AM6PR04MB6341AC4C0057B09DB8A58234E76A9@AM6PR04MB6341.eurprd04.prod.outlook.com>

> -----Original Message-----
> From: Ming Qian
> Sent: Friday, December 3, 2021 1:43 PM
> To: Nicolas Dufresne <nicolas@ndufresne.ca>; 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: RE: [EXT] Re: [PATCH v13 08/13] media: amphion: add v4l2 m2m vpu
> decoder stateful driver
> 
> > -----Original Message-----
> > From: Nicolas Dufresne [mailto:nicolas@ndufresne.ca]
> > Sent: Friday, December 3, 2021 12:56 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 v13 08/13] media: amphion: add v4l2 m2m vpu
> > decoder stateful driver
> >
> > Caution: EXT Email
> >
> > Le mardi 30 novembre 2021 à 17:48 +0800, Ming Qian a écrit :
> > > This consists of video decoder implementation plus decoder 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/vdec.c | 1680
> > +++++++++++++++++++++++++
> 
> 
> > > +
> > > +static void vdec_init_fmt(struct vpu_inst *inst) {
> > > +     struct vdec_t *vdec = inst->priv;
> > > +     const struct vpu_format *fmt;
> > > +     int i;
> > > +
> > > +     fmt = vpu_helper_find_format(inst, inst->cap_format.type,
> > vdec->codec_info.pixfmt);
> > > +     inst->out_format.width = vdec->codec_info.width;
> > > +     inst->out_format.height = vdec->codec_info.height;
> > > +     inst->cap_format.width = vdec->codec_info.decoded_width;
> > > +     inst->cap_format.height = vdec->codec_info.decoded_height;
> > > +     inst->cap_format.pixfmt = vdec->codec_info.pixfmt;
> > > +     if (fmt) {
> > > +             inst->cap_format.num_planes = fmt->num_planes;
> > > +             inst->cap_format.flags = fmt->flags;
> > > +     }
> > > +     for (i = 0; i < inst->cap_format.num_planes; i++) {
> > > +             inst->cap_format.bytesperline[i] =
> > vdec->codec_info.bytesperline[i];
> > > +             inst->cap_format.sizeimage[i] =
> > vdec->codec_info.sizeimage[i];
> > > +     }
> > > +     if (vdec->codec_info.progressive)
> > > +             inst->cap_format.field = V4L2_FIELD_NONE;
> > > +     else
> > > +             inst->cap_format.field = V4L2_FIELD_INTERLACED;
> >
> > As a followup, this should be conditional to the chosen pixel format.
> > If I understood correct, you produce interlaced is only produce for
> > linear NV12, for tiled the fields are outputed seperated in their
> > respective v4l2_buffer. Note sure where yet, but the V4L2 spec
> > requires you to pair the fields by using the same seq_num on both.
> 
> The amphion vpu will store the two fields into one v4l2_buf, So I'll change
> V4L2_FIELD_INTERLACED to V4L2_FIELD_SEQ_TB
> 

Hi Nicolas,
    Seems gstreamer doesn't support V4L2_FIELD_SEQ_TB yet.

  switch (fmt.fmt.pix.field) {
    case V4L2_FIELD_ANY:
    case V4L2_FIELD_NONE:
      interlace_mode = GST_VIDEO_INTERLACE_MODE_PROGRESSIVE;
      break;
    case V4L2_FIELD_INTERLACED:
    case V4L2_FIELD_INTERLACED_TB:
    case V4L2_FIELD_INTERLACED_BT:
      interlace_mode = GST_VIDEO_INTERLACE_MODE_INTERLEAVED;
      break;
    case V4L2_FIELD_ALTERNATE:
      interlace_mode = GST_VIDEO_INTERLACE_MODE_ALTERNATE;
      break;
    default:
      goto unsupported_field;
  }

> >
> > > +     if (vdec->codec_info.color_primaries ==
> V4L2_COLORSPACE_DEFAULT)
> > > +             vdec->codec_info.color_primaries =
> > V4L2_COLORSPACE_REC709;
> > > +     if (vdec->codec_info.transfer_chars == V4L2_XFER_FUNC_DEFAULT)
> > > +             vdec->codec_info.transfer_chars = V4L2_XFER_FUNC_709;
> > > +     if (vdec->codec_info.matrix_coeffs == V4L2_YCBCR_ENC_DEFAULT)
> > > +             vdec->codec_info.matrix_coeffs = V4L2_YCBCR_ENC_709;
> > > +     if (vdec->codec_info.full_range == V4L2_QUANTIZATION_DEFAULT)
> > > +             vdec->codec_info.full_range =
> > V4L2_QUANTIZATION_LIM_RANGE;
> > > +}
> > > +
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2021-12-03  6:01 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-30  9:48 [PATCH v13 00/13] amphion video decoder/encoder driver Ming Qian
2021-11-30  9:48 ` Ming Qian
2021-11-30  9:48 ` [PATCH v13 01/13] dt-bindings: media: amphion: add amphion video codec bindings Ming Qian
2021-11-30  9:48   ` Ming Qian
2021-11-30  9:48 ` [PATCH v13 02/13] media:Add nv12mt_8l128 and nv12mt_10be_8l128 video format Ming Qian
2021-11-30  9:48   ` Ming Qian
2021-12-02  9:39   ` Hans Verkuil
2021-12-02  9:39     ` Hans Verkuil
2021-12-02 10:02     ` [EXT] " Ming Qian
2021-12-02 10:02       ` Ming Qian
2021-11-30  9:48 ` [PATCH v13 03/13] media: amphion: add amphion vpu device driver Ming Qian
2021-11-30  9:48   ` Ming Qian
2021-12-02  9:44   ` Hans Verkuil
2021-12-02  9:44     ` Hans Verkuil
2021-12-02 10:03     ` [EXT] " Ming Qian
2021-12-02 10:03       ` Ming Qian
2021-11-30  9:48 ` [PATCH v13 04/13] media: amphion: add vpu core driver Ming Qian
2021-11-30  9:48   ` Ming Qian
2021-12-02  9:04   ` Hans Verkuil
2021-12-02  9:04     ` Hans Verkuil
2021-12-02  9:13     ` [EXT] " Ming Qian
2021-12-02  9:24     ` Ming Qian
2021-12-02  9:24       ` Ming Qian
2021-12-02  9:54   ` Hans Verkuil
2021-12-02  9:54     ` Hans Verkuil
2021-12-02 10:07     ` [EXT] " Ming Qian
2021-11-30  9:48 ` [PATCH v13 05/13] media: amphion: implement vpu core communication based on mailbox Ming Qian
2021-11-30  9:48   ` Ming Qian
2021-11-30  9:48 ` [PATCH v13 06/13] media: amphion: add vpu v4l2 m2m support Ming Qian
2021-11-30  9:48   ` Ming Qian
2021-12-02 10:29   ` Hans Verkuil
2021-12-02 10:29     ` Hans Verkuil
2021-12-03  1:54     ` [EXT] " Ming Qian
2021-12-03  1:54       ` Ming Qian
2021-12-03  4:48   ` Nicolas Dufresne
2021-12-03  4:48     ` Nicolas Dufresne
2021-11-30  9:48 ` [PATCH v13 07/13] media: amphion: add v4l2 m2m vpu encoder stateful driver Ming Qian
2021-11-30  9:48   ` Ming Qian
2021-12-02 10:41   ` Hans Verkuil
2021-12-02 10:41     ` Hans Verkuil
2021-11-30  9:48 ` [PATCH v13 08/13] media: amphion: add v4l2 m2m vpu decoder " Ming Qian
2021-11-30  9:48   ` Ming Qian
2021-12-03  4:55   ` Nicolas Dufresne
2021-12-03  4:55     ` Nicolas Dufresne
2021-12-03  5:42     ` [EXT] " Ming Qian
2021-12-03  5:42       ` Ming Qian
2021-12-03  6:01       ` Ming Qian [this message]
2021-12-03  6:01         ` Ming Qian
2021-12-03 15:09         ` Nicolas Dufresne
2021-12-03 15:09           ` Nicolas Dufresne
2021-12-04  2:39           ` Ming Qian
2021-12-04  2:39             ` Ming Qian
2021-11-30  9:48 ` [PATCH v13 09/13] media: amphion: implement windsor encoder rpc interface Ming Qian
2021-11-30  9:48   ` Ming Qian
2021-11-30  9:48 ` [PATCH v13 10/13] media: amphion: implement malone decoder " Ming Qian
2021-11-30  9:48   ` Ming Qian
2021-11-30  9:48 ` [PATCH v13 11/13] ARM64: dts: freescale: imx8q: add imx vpu codec entries Ming Qian
2021-11-30  9:48   ` Ming Qian
2021-11-30  9:48 ` [PATCH v13 12/13] firmware: imx: scu-pd: imx8q: add vpu mu resources Ming Qian
2021-11-30  9:48   ` Ming Qian
2021-11-30  9:48 ` [PATCH v13 13/13] MAINTAINERS: add AMPHION VPU CODEC V4L2 driver entry Ming Qian
2021-11-30  9:48   ` Ming Qian

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=AM6PR04MB6341537EBD82451CA14A5E3EE76A9@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.