From: "Moudy Ho (何宗原)" <Moudy.Ho@mediatek.com>
To: "matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
"mchehab@kernel.org" <mchehab@kernel.org>,
"hverkuil-cisco@xs4all.nl" <hverkuil-cisco@xs4all.nl>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
"linux-mediatek@lists.infradead.org"
<linux-mediatek@lists.infradead.org>,
"chunkuang.hu@kernel.org" <chunkuang.hu@kernel.org>,
Project_Global_Chrome_Upstream_Group
<Project_Global_Chrome_Upstream_Group@mediatek.com>
Subject: Re: [PATCH v5 02/12] media: platform: mtk-mdp3: add chip configuration header file
Date: Mon, 30 Jan 2023 06:07:52 +0000 [thread overview]
Message-ID: <1196d36a2988e1ac90a3b23ffd4315dab44a3777.camel@mediatek.com> (raw)
In-Reply-To: <068ee5ec-6863-2c1d-39a9-b18156d4e57d@xs4all.nl>
On Mon, 2023-01-23 at 16:01 +0100, Hans Verkuil wrote:
> On 13/01/2023 07:40, Moudy Ho wrote:
> > In order to be compatible with more MDP3 chip settings in the
> > future,
> > move the chip-related configuration to a separate header file.
> >
> > Signed-off-by: Moudy Ho <moudy.ho@mediatek.com>
> > ---
> > .../mediatek/mdp3/mt8183/mdp3-plat-mt8183.h | 35
> > +++++++++++++++++++
> > .../platform/mediatek/mdp3/mtk-mdp3-core.c | 27 ++------------
> > 2 files changed, 37 insertions(+), 25 deletions(-)
> > create mode 100644
> > drivers/media/platform/mediatek/mdp3/mt8183/mdp3-plat-mt8183.h
> >
> > diff --git a/drivers/media/platform/mediatek/mdp3/mt8183/mdp3-plat-
> > mt8183.h b/drivers/media/platform/mediatek/mdp3/mt8183/mdp3-plat-
> > mt8183.h
> > new file mode 100644
> > index 000000000000..3084f62e7df5
> > --- /dev/null
> > +++ b/drivers/media/platform/mediatek/mdp3/mt8183/mdp3-plat-
> > mt8183.h
> > @@ -0,0 +1,35 @@
> > +/* SPDX-License-Identifier: GPL-2.0-only */
> > +/*
> > + * Copyright (c) 2022 MediaTek Inc.
> > + * Author: Ping-Hsun Wu <ping-hsun.wu@mediatek.com>
> > + */
> > +
> > +#ifndef __MDP3_PLAT_MT8183_H__
> > +#define __MDP3_PLAT_MT8183_H__
> > +
> > +static const struct mdp_platform_config mt8183_plat_cfg = {
> > + .rdma_support_10bit = true,
> > + .rdma_rsz1_sram_sharing = true,
> > + .rdma_upsample_repeat_only = true,
> > + .rsz_disable_dcm_small_sample = false,
> > + .wrot_filter_constraint = false,
> > +};
> > +
> > +static const struct of_device_id
> > mt8183_mdp_probe_infra[MDP_INFRA_MAX] = {
> > + [MDP_INFRA_MMSYS] = { .compatible = "mediatek,mt8183-mmsys" },
> > + [MDP_INFRA_MUTEX] = { .compatible = "mediatek,mt8183-disp-
> > mutex" },
> > + [MDP_INFRA_SCP] = { .compatible = "mediatek,mt8183-scp" }
> > +};
> > +
> > +static const u32 mt8183_mutex_idx[MDP_MAX_COMP_COUNT] = {
> > + [MDP_COMP_RDMA0] = MUTEX_MOD_IDX_MDP_RDMA0,
> > + [MDP_COMP_RSZ0] = MUTEX_MOD_IDX_MDP_RSZ0,
> > + [MDP_COMP_RSZ1] = MUTEX_MOD_IDX_MDP_RSZ1,
> > + [MDP_COMP_TDSHP0] = MUTEX_MOD_IDX_MDP_TDSHP0,
> > + [MDP_COMP_WROT0] = MUTEX_MOD_IDX_MDP_WROT0,
> > + [MDP_COMP_WDMA] = MUTEX_MOD_IDX_MDP_WDMA,
> > + [MDP_COMP_AAL0] = MUTEX_MOD_IDX_MDP_AAL0,
> > + [MDP_COMP_CCORR0] = MUTEX_MOD_IDX_MDP_CCORR0,
> > +};
>
> I am really not keen on storing variable declarations in a header.
> This belongs
> in a source.
>
> What you typically do is put this in a source together with the
> declaration
> of the mt8183_mdp_driver_data struct for the chip config, and just
> export that
> top-level struct as an extern.
>
> An example of how to do this is
> drivers/media/platform/verisilicon/imx8m_vpu_hw.c.
>
> Regards,
>
> Hans
>
Hi Hans,
Thanks for taking the time to advise, I'll make corresponding
adjustments in the next version.
Sincerely,
Moudy
> > ++#endif /* __MDP3_PLAT_MT8183_H__ */
> > diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c
> > b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c
> > index 2d1f6ae9f080..658037d06250 100644
> > --- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c
> > +++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c
> > @@ -12,33 +12,10 @@
> > #include <linux/remoteproc.h>
> > #include <linux/remoteproc/mtk_scp.h>
> > #include <media/videobuf2-dma-contig.h>
> > +
> > #include "mtk-mdp3-core.h"
> > #include "mtk-mdp3-m2m.h"
> > -
> > -static const struct mdp_platform_config mt8183_plat_cfg = {
> > - .rdma_support_10bit = true,
> > - .rdma_rsz1_sram_sharing = true,
> > - .rdma_upsample_repeat_only = true,
> > - .rsz_disable_dcm_small_sample = false,
> > - .wrot_filter_constraint = false,
> > -};
> > -
> > -static const struct of_device_id
> > mt8183_mdp_probe_infra[MDP_INFRA_MAX] = {
> > - [MDP_INFRA_MMSYS] = { .compatible = "mediatek,mt8183-mmsys" },
> > - [MDP_INFRA_MUTEX] = { .compatible = "mediatek,mt8183-disp-
> > mutex" },
> > - [MDP_INFRA_SCP] = { .compatible = "mediatek,mt8183-scp" }
> > -};
> > -
> > -static const u32 mt8183_mutex_idx[MDP_MAX_COMP_COUNT] = {
> > - [MDP_COMP_RDMA0] = MUTEX_MOD_IDX_MDP_RDMA0,
> > - [MDP_COMP_RSZ0] = MUTEX_MOD_IDX_MDP_RSZ0,
> > - [MDP_COMP_RSZ1] = MUTEX_MOD_IDX_MDP_RSZ1,
> > - [MDP_COMP_TDSHP0] = MUTEX_MOD_IDX_MDP_TDSHP0,
> > - [MDP_COMP_WROT0] = MUTEX_MOD_IDX_MDP_WROT0,
> > - [MDP_COMP_WDMA] = MUTEX_MOD_IDX_MDP_WDMA,
> > - [MDP_COMP_AAL0] = MUTEX_MOD_IDX_MDP_AAL0,
> > - [MDP_COMP_CCORR0] = MUTEX_MOD_IDX_MDP_CCORR0,
> > -};
> > +#include "mt8183/mdp3-plat-mt8183.h"
> >
> > static const struct mtk_mdp_driver_data mt8183_mdp_driver_data = {
> > .mdp_probe_infra = mt8183_mdp_probe_infra,
>
> Appreciate for the time and advice, I'll make corresponding adjust in
> the next version.
next prev parent reply other threads:[~2023-01-30 6:08 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-13 6:40 [PATCH v5 00/12] Add support for multiple chips Moudy Ho
2023-01-13 6:40 ` [PATCH v5 01/12] media: platform: mtk-mdp3: fix potential frame size overflow in mdp_try_fmt_mplane() Moudy Ho
2023-01-13 6:40 ` [PATCH v5 02/12] media: platform: mtk-mdp3: add chip configuration header file Moudy Ho
2023-01-23 15:01 ` Hans Verkuil
2023-01-30 6:07 ` Moudy Ho (何宗原) [this message]
2023-01-13 6:40 ` [PATCH v5 03/12] media: platform: mtk-mdp3: chip config split about component settings Moudy Ho
2023-01-13 6:40 ` [PATCH v5 04/12] media: platform: mtk-mdp3: chip config split about subcomponents Moudy Ho
2023-01-13 6:40 ` [PATCH v5 05/12] media: platform: mtk-mdp3: chip config split about color format Moudy Ho
2023-01-13 6:40 ` [PATCH v5 06/12] media: platform: mtk-mdp3: chip config split about resolution limitations Moudy Ho
2023-01-13 6:40 ` [PATCH v5 07/12] media: platform: mtk-mdp3: chip config split about pipe info Moudy Ho
2023-01-13 6:41 ` [PATCH v5 08/12] media: platform: mtk-mdp3: extend mdp_color format for compressed mode Moudy Ho
2023-01-13 6:41 ` [PATCH v5 09/12] media: platform: mtk-mdp3: dynamically allocate component clocks Moudy Ho
2023-01-13 6:41 ` [PATCH v5 10/12] media: platform: mtk-mdp3: Split general definitions used in MDP3 Moudy Ho
2023-01-13 6:41 ` [PATCH v5 11/12] media: platform: mtk-mdp3: decompose hardware-related information in shared memory Moudy Ho
2023-01-13 6:41 ` [PATCH v5 12/12] media: platform: mtk-mdp3: reconfigure " Moudy Ho
2023-01-23 14:47 ` [PATCH v5 00/12] Add support for multiple chips Hans Verkuil
2023-01-23 15:51 ` 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=1196d36a2988e1ac90a3b23ffd4315dab44a3777.camel@mediatek.com \
--to=moudy.ho@mediatek.com \
--cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
--cc=chunkuang.hu@kernel.org \
--cc=hverkuil-cisco@xs4all.nl \
--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 \
/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®