From: moudy.ho <moudy.ho@mediatek.com>
To: Hans Verkuil <hverkuil-cisco@xs4all.nl>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Rob Herring <robh+dt@kernel.org>,
Matthias Brugger <matthias.bgg@gmail.com>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>
Cc: Chun-Kuang Hu <chunkuang.hu@kernel.org>,
Rob Landley <rob@landley.net>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
<linux-media@vger.kernel.org>, <devicetree@vger.kernel.org>,
<linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-mediatek@lists.infradead.org>,
Alexandre Courbot <acourbot@chromium.org>, <tfiga@chromium.org>,
<drinkcat@chromium.org>, <pihsun@chromium.org>,
<hsinyi@google.com>,
Benjamin Gaignard <benjamin.gaignard@collabora.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
daoyuan huang <daoyuan.huang@mediatek.com>,
Ping-Hsun Wu <ping-hsun.wu@mediatek.com>,
<allen-kh.cheng@mediatek.com>, <xiandong.wang@mediatek.com>,
<randy.wu@mediatek.com>, <jason-jh.lin@mediatek.com>,
<roy-cw.yeh@mediatek.com>, <river.cheng@mediatek.com>,
<Project_Global_Chrome_Upstream_Group@mediatek.com>,
<cellopoint.kai@gmail.com>
Subject: Re: [DKIM] [PATCH v21 4/4] media: platform: mtk-mdp3: add Mediatek MDP3 driver
Date: Mon, 11 Jul 2022 16:11:11 +0800 [thread overview]
Message-ID: <ddb4b31e85f1614cb9a84bdf7644d0f16e5f5427.camel@mediatek.com> (raw)
In-Reply-To: <d93b51b3-9c94-4842-891c-cd3547ae8712@xs4all.nl>
Hi Hans,
Thanks for your review, and appreciate for all comments and
suggestions.
I'll go through each "dev_info" one by one and replace the unnecessary
with "dev_dbg" or just remove it.
In addition, I will adjust other inappropriate settings as suggested.
On Fri, 2022-07-08 at 10:08 +0200, Hans Verkuil wrote:
> Hi Moudy,
>
> Some comments below:
>
> On 7/6/22 09:54, Moudy Ho wrote:
> > This patch adds driver for Mediatek's Media Data Path ver.3 (MDP3).
> > It provides the following functions:
> > color transform, format conversion, resize, crop, rotate, flip
> > and additional image quality enhancement.
> >
> > The MDP3 driver is mainly used for Google Chromebook products to
> > import the new architecture to set the HW settings as shown below:
> > User -> V4L2 framework
> > -> MDP3 driver -> SCP (setting calculations)
> > -> MDP3 driver -> CMDQ (GCE driver) -> HW
> >
> > Each modules' related operation control is sited in mtk-mdp3-comp.c
> > Each modules' register table is defined in file with "mdp_reg_"
> > prefix
> > GCE related API, operation control sited in mtk-mdp3-cmdq.c
> > V4L2 m2m device functions are implemented in mtk-mdp3-m2m.c
> > Probe, power, suspend/resume, system level functions are defined in
> > mtk-mdp3-core.c
> >
> > v4l2-compliance 1.22.1, 32 bits, 32-bit time_t
> >
> > Compliance test for mtk-mdp3 device /dev/video2:
> >
> > Driver Info:
> > Driver name : mtk-mdp3
> > Card type : 14001000.mdp3-rdma0
>
> Card type is expected to be a human readable name, and that's not the
> case
> here.
>
> > Bus info : platform:mtk-mdp3
>
> <snip>
[snip]
> > diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-regs.c
> > b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-regs.c
> > new file mode 100644
> > index 000000000000..18874eb7851c
> > --- /dev/null
> > +++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-regs.c
[snip]
> > +/* Plane size that is accepted by MDP HW */
> > +static u32 mdp_fmt_get_plane_size(const struct mdp_format *fmt,
> > + u32 stride, u32 height, unsigned int
> > plane)
> > +{
> > + enum mdp_color c = fmt->mdp_color;
> > + u32 bytesperline;
> > +
> > + bytesperline = (stride * fmt->row_depth[0])
> > + / MDP_COLOR_BITS_PER_PIXEL(c);
> > + if (plane == 0)
> > + return bytesperline * height;
> > + if (plane < MDP_COLOR_GET_PLANE_COUNT(c)) {
> > + height = height >> MDP_COLOR_GET_V_SUBSAMPLE(c);
> > + if (MDP_COLOR_IS_BLOCK_MODE(c))
> > + bytesperline = bytesperline * 2;
> > + return bytesperline * height;
> > + }
> > + return 0;
> > +}
> > +
> > +static void mdp_prepare_buffer(struct img_image_buffer *b,
> > + struct mdp_frame *frame, struct
> > vb2_buffer *vb)
> > +{
> > + struct v4l2_pix_format_mplane *pix_mp = &frame-
> > >format.fmt.pix_mp;
> > + unsigned int i;
> > +
> > + b->format.colorformat = frame->mdp_fmt->mdp_color;
> > + b->format.ycbcr_prof = frame->ycbcr_prof;
> > + for (i = 0; i < pix_mp->num_planes; ++i) {
> > + u32 stride = mdp_fmt_get_stride(frame->mdp_fmt,
> > + pix_mp->plane_fmt[i].bytesperline, i);
> > +
> > + b->format.plane_fmt[i].stride = stride;
> > + /*
> > + * TODO : The way to pass an offset within a DMA-buf
> > + * is not defined in V4L2 specification, so we abuse
> > + * data_offset for now. Fix it when we have the right
> > interface,
> > + * including any necessary validation and potential
> > alignment
> > + * issues.
> > + */
> > + b->format.plane_fmt[i].size =
> > + mdp_fmt_get_plane_size(frame->mdp_fmt, stride,
> > + pix_mp->height, i) -
> > + vb-
> > >planes[i].data_offset;
> > + b->iova[i] = vb2_dma_contig_plane_dma_addr(vb, i) +
> > + vb->planes[i].data_offset;
>
> Why do you need data_offset? What is the use case? Obviously I can't
> merge a driver that abuses an API.
>
Apologize for not incorporating the previously discussed results into
this version due to my carelessness, I will correct it in the next
version.
https://patchwork.kernel.org/project/linux-mediatek/patch/20210623091457.18002-1-moudy.ho@mediatek.com/
> > + }
> > + for (; i < MDP_COLOR_GET_PLANE_COUNT(b->format.colorformat);
> > ++i) {
> > + u32 stride = mdp_fmt_get_stride_contig(frame->mdp_fmt,
> > + b->format.plane_fmt[0].stride, i);
> > +
> > + b->format.plane_fmt[i].stride = stride;
> > + b->format.plane_fmt[i].size =
> > + mdp_fmt_get_plane_size(frame->mdp_fmt, stride,
> > + pix_mp->height, i);
> > + b->iova[i] = b->iova[i - 1] + b->format.plane_fmt[i -
> > 1].size;
> > + }
> > + b->usage = frame->usage;
> > +}
> > +
> > +void mdp_set_src_config(struct img_input *in,
> > + struct mdp_frame *frame, struct vb2_buffer *vb)
> > +{
> > + in->buffer.format.width = frame->format.fmt.pix_mp.width;
> > + in->buffer.format.height = frame->format.fmt.pix_mp.height;
> > + mdp_prepare_buffer(&in->buffer, frame, vb);
> > +}
[snip]
>
> Regards,
>
> Hans
Many thanks,
Moudy
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
prev parent reply other threads:[~2022-07-11 9:13 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-06 7:54 [PATCH v21 0/4] media: mediatek: support mdp3 on mt8183 platform Moudy Ho
2022-07-06 7:54 ` [PATCH v21 1/4] dt-binding: mediatek: add bindings for MediaTek MDP3 components Moudy Ho
2022-07-06 7:54 ` [PATCH v21 2/4] dt-binding: mediatek: add bindings for MediaTek CCORR and WDMA Moudy Ho
2022-07-06 7:54 ` [PATCH v21 3/4] arm64: dts: mt8183: add Mediatek MDP3 nodes Moudy Ho
[not found] ` <20220706075454.15569-5-moudy.ho@mediatek.com>
2022-07-08 8:08 ` [DKIM] [PATCH v21 4/4] media: platform: mtk-mdp3: add Mediatek MDP3 driver Hans Verkuil
2022-07-08 8:20 ` Laurent Pinchart
2022-07-11 8:25 ` moudy.ho
2022-07-11 8:11 ` moudy.ho [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=ddb4b31e85f1614cb9a84bdf7644d0f16e5f5427.camel@mediatek.com \
--to=moudy.ho@mediatek.com \
--cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
--cc=acourbot@chromium.org \
--cc=allen-kh.cheng@mediatek.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=benjamin.gaignard@collabora.com \
--cc=cellopoint.kai@gmail.com \
--cc=chunkuang.hu@kernel.org \
--cc=daoyuan.huang@mediatek.com \
--cc=devicetree@vger.kernel.org \
--cc=drinkcat@chromium.org \
--cc=hsinyi@google.com \
--cc=hverkuil-cisco@xs4all.nl \
--cc=jason-jh.lin@mediatek.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=laurent.pinchart@ideasonboard.com \
--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=matthias.bgg@gmail.com \
--cc=mchehab@kernel.org \
--cc=pihsun@chromium.org \
--cc=ping-hsun.wu@mediatek.com \
--cc=randy.wu@mediatek.com \
--cc=river.cheng@mediatek.com \
--cc=rob@landley.net \
--cc=robh+dt@kernel.org \
--cc=roy-cw.yeh@mediatek.com \
--cc=tfiga@chromium.org \
--cc=xiandong.wang@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).