lkml.org 
[lkml]   [2021]   [Dec]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [EXT] Re: [PATCH v13 08/13] media: amphion: add v4l2 m2m vpu decoder stateful driver
Date
> -----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

>
> > + 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;
> > +}
> > +
\
 
 \ /
  Last update: 2021-12-03 06:44    [W:0.164 / U:0.460 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site