From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Changhuang Liang <changhuang.liang@starfivetech.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Hans Verkuil <hverkuil-cisco@xs4all.nl>,
Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>,
Benjamin Gaignard <benjamin.gaignard@collabora.com>,
Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>,
Mingjia Zhang <mingjia.zhang@mediatek.com>,
Jack Zhu <jack.zhu@starfivetech.com>,
Keith Zhao <keith.zhao@starfivetech.com>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-staging@lists.linux.dev
Subject: Re: [PATCH v5 09/14] staging: media: starfive: Update ISP initialise config for 3A
Date: Mon, 22 Jul 2024 17:53:50 +0300 [thread overview]
Message-ID: <20240722145350.GK13497@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20240709083824.430473-10-changhuang.liang@starfivetech.com>
Hi Changhuang,
Thank you for the patch.
On Tue, Jul 09, 2024 at 01:38:19AM -0700, Changhuang Liang wrote:
> Upadte ISP initialise for 3A statistics collection data.
>
> Signed-off-by: Changhuang Liang <changhuang.liang@starfivetech.com>
> ---
> .../media/starfive/camss/stf-isp-hw-ops.c | 23 +++++++++++++++++++
> .../staging/media/starfive/camss/stf-isp.h | 21 +++++++++++++++++
> 2 files changed, 44 insertions(+)
>
> diff --git a/drivers/staging/media/starfive/camss/stf-isp-hw-ops.c b/drivers/staging/media/starfive/camss/stf-isp-hw-ops.c
> index 3b18d09f2cc6..0bc5e36f952e 100644
> --- a/drivers/staging/media/starfive/camss/stf-isp-hw-ops.c
> +++ b/drivers/staging/media/starfive/camss/stf-isp-hw-ops.c
> @@ -300,6 +300,25 @@ static void stf_isp_config_sat(struct stfcamss *stfcamss)
> stf_isp_reg_write(stfcamss, ISP_REG_YADJ1, YOMAX(0x3ff) | YOMIN(0x1));
> }
>
> +static void stf_isp_config_sc(struct stfcamss *stfcamss)
> +{
> + stf_isp_reg_write(stfcamss, ISP_REG_SCD_CFG_1, AXI_ID(0));
> + stf_isp_reg_write(stfcamss, ISP_REG_SC_CFG_0, HSTART(0) | VSTART(0xc));
> + stf_isp_reg_write(stfcamss, ISP_REG_SC_CFG_1,
> + SC_WIDTH(0x1d) | SC_HEIGHT(0x15) |
> + AWB_PS_GRB_BA(0x10) | SEL_TYPE(0x3));
There's lots of magic values here and below. A comment would be good.
> +}
> +
> +static void stf_isp_config_yhist(struct stfcamss *stfcamss)
> +{
> + stf_isp_reg_write(stfcamss, ISP_REG_YHIST_CFG_0, 0);
> + stf_isp_reg_write(stfcamss, ISP_REG_YHIST_CFG_1,
> + YH_WIDTH(0x77f) | YH_HEIGHT(0x437));
Does this hardcode the size of the histogram window to 1920x1080 ? It
should be made configurable from userspace. Maybe that's handled in
further patches in this series.
> + stf_isp_reg_write(stfcamss, ISP_REG_YHIST_CFG_2,
> + YH_DEC_ETW(2) | YH_DEC_ETH(1));
> + stf_isp_reg_write(stfcamss, ISP_REG_YHIST_CFG_3, 0);
> +}
> +
> int stf_isp_reset(struct stf_isp_dev *isp_dev)
> {
> stf_isp_reg_set_bit(isp_dev->stfcamss, ISP_REG_ISP_CTRL_0,
> @@ -332,7 +351,11 @@ void stf_isp_init_cfg(struct stf_isp_dev *isp_dev)
> stf_isp_config_sharpen(isp_dev->stfcamss);
> stf_isp_config_dnyuv(isp_dev->stfcamss);
> stf_isp_config_sat(isp_dev->stfcamss);
> + stf_isp_config_sc(isp_dev->stfcamss);
> + stf_isp_config_yhist(isp_dev->stfcamss);
>
> + stf_isp_reg_write(isp_dev->stfcamss, ISP_REG_DUMP_CFG_1,
> + DUMP_BURST_LEN(3) | DUMP_SD(0xb80));
> stf_isp_reg_write(isp_dev->stfcamss, ISP_REG_CSI_MODULE_CFG,
> CSI_DUMP_EN | CSI_SC_EN | CSI_AWB_EN |
> CSI_LCCF_EN | CSI_OECF_EN | CSI_OBC_EN | CSI_DEC_EN);
> diff --git a/drivers/staging/media/starfive/camss/stf-isp.h b/drivers/staging/media/starfive/camss/stf-isp.h
> index 0af7b367e57a..eca3ba1ade75 100644
> --- a/drivers/staging/media/starfive/camss/stf-isp.h
> +++ b/drivers/staging/media/starfive/camss/stf-isp.h
> @@ -110,9 +110,19 @@
>
> #define ISP_REG_SCD_CFG_0 0x098
>
> +#define ISP_REG_SCD_CFG_1 0x09c
> +#define AXI_ID(n) ((n) << 24)
> +
> +#define ISP_REG_SC_CFG_0 0x0b8
> +#define VSTART(n) ((n) << 16)
> +#define HSTART(n) ((n) << 0)
> +
> #define ISP_REG_SC_CFG_1 0x0bc
> #define ISP_SC_SEL_MASK GENMASK(31, 30)
> #define SEL_TYPE(n) ((n) << 30)
> +#define AWB_PS_GRB_BA(n) ((n) << 16)
> +#define SC_HEIGHT(n) ((n) << 8)
> +#define SC_WIDTH(n) ((n) << 0)
>
> #define ISP_REG_LCCF_CFG_2 0x0e0
> #define ISP_REG_LCCF_CFG_3 0x0e4
> @@ -312,6 +322,17 @@
> #define DNRM_F(n) ((n) << 16)
> #define CCM_M_DAT(n) ((n) << 0)
>
> +#define ISP_REG_YHIST_CFG_0 0xcc8
> +
> +#define ISP_REG_YHIST_CFG_1 0xccc
> +#define YH_HEIGHT(n) ((n) << 16)
> +#define YH_WIDTH(n) ((n) << 0)
> +
> +#define ISP_REG_YHIST_CFG_2 0xcd0
> +#define YH_DEC_ETH(n) ((n) << 16)
> +#define YH_DEC_ETW(n) ((n) << 0)
> +
> +#define ISP_REG_YHIST_CFG_3 0xcd4
> #define ISP_REG_YHIST_CFG_4 0xcd8
>
> #define ISP_REG_YHIST_ACC_0 0xd00
> --
> 2.25.1
>
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2024-07-22 14:54 UTC|newest]
Thread overview: 55+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-09 8:38 [PATCH v5 00/14] Add ISP 3A for StarFive Changhuang Liang
2024-07-09 8:38 ` [PATCH v5 01/14] media: starfive: Add JH7110 ISP module definitions Changhuang Liang
2024-07-10 9:11 ` Jacopo Mondi
2024-07-22 14:27 ` Laurent Pinchart
2024-07-22 14:33 ` Laurent Pinchart
2024-07-24 2:20 ` 回复: " Changhuang Liang
2024-07-26 23:46 ` Laurent Pinchart
2024-09-14 11:53 ` 回复: " Changhuang Liang
2024-09-15 9:47 ` Laurent Pinchart
2024-09-18 1:56 ` 回复: " Changhuang Liang
2024-07-09 8:38 ` [PATCH v5 02/14] media: Documentation: Add description for StarFive ISP metadata formats Changhuang Liang
2024-07-10 9:22 ` Jacopo Mondi
2024-07-16 12:31 ` 回复: " Changhuang Liang
2024-07-16 14:25 ` Jacopo Mondi
2024-07-17 2:37 ` 回复: " Changhuang Liang
2024-07-17 7:11 ` Jacopo Mondi
2024-07-09 8:38 ` [PATCH v5 03/14] media: videodev2.h, v4l2-ioctl: Add StarFive ISP meta buffer format Changhuang Liang
2024-07-22 14:35 ` Laurent Pinchart
2024-07-09 8:38 ` [PATCH v5 04/14] staging: media: starfive: Add a params sink pad and a scd source pad for ISP Changhuang Liang
2024-07-10 9:51 ` Jacopo Mondi
2024-07-10 13:04 ` 回复: " Changhuang Liang
2024-07-22 14:51 ` Laurent Pinchart
2024-07-09 8:38 ` [PATCH v5 05/14] staging: media: starfive: Separate buffer from ISP hardware operation Changhuang Liang
2024-07-09 8:38 ` [PATCH v5 06/14] staging: media: starfive: Separate buffer be a common file Changhuang Liang
2024-07-09 8:38 ` [PATCH v5 07/14] staging: media: starfive: Separate ISP hardware from capture device Changhuang Liang
2024-07-09 8:38 ` [PATCH v5 08/14] staging: media: starfive: Add for StarFive ISP 3A SC Changhuang Liang
2024-07-10 11:57 ` Jacopo Mondi
2024-07-11 6:48 ` 回复: " Changhuang Liang
2024-07-11 8:26 ` Jacopo Mondi
2024-07-12 8:36 ` 回复: " Changhuang Liang
2024-07-12 11:37 ` Jacopo Mondi
2024-07-12 13:00 ` 回复: " Changhuang Liang
2024-07-12 13:27 ` Jacopo Mondi
2024-07-12 13:37 ` 回复: " Changhuang Liang
2024-07-12 16:25 ` Jacopo Mondi
2024-07-12 16:33 ` Jacopo Mondi
2024-07-15 1:52 ` 回复: " Changhuang Liang
2024-07-09 8:38 ` [PATCH v5 09/14] staging: media: starfive: Update ISP initialise config for 3A Changhuang Liang
2024-07-22 14:53 ` Laurent Pinchart [this message]
2024-07-09 8:38 ` [PATCH v5 10/14] staging: media: starfive: Add V4L2_CAP_IO_MC capability Changhuang Liang
2024-07-10 12:18 ` Jacopo Mondi
2024-07-10 13:10 ` 回复: " Changhuang Liang
2024-07-09 8:38 ` [PATCH v5 11/14] staging: media: starfive: Add ISP params video device Changhuang Liang
2024-07-10 13:07 ` Jacopo Mondi
2024-07-15 7:12 ` Hans Verkuil
2024-07-09 8:38 ` [PATCH v5 12/14] staging: media: starfive: Add ISP parameters hardware configure Changhuang Liang
2024-07-10 13:17 ` Jacopo Mondi
2024-07-12 13:14 ` 回复: " Changhuang Liang
2024-07-09 8:38 ` [PATCH v5 13/14] staging: media: starfive: Drop read support for video capture devices Changhuang Liang
2024-07-22 14:54 ` Laurent Pinchart
2024-07-09 8:38 ` [PATCH v5 14/14] admin-guide: media: Update documents for StarFive Camera Subsystem Changhuang Liang
2024-07-22 14:56 ` Laurent Pinchart
2024-07-24 1:40 ` 回复: " Changhuang Liang
2024-07-10 13:22 ` [PATCH v5 00/14] Add ISP 3A for StarFive Jacopo Mondi
2024-07-11 1:42 ` 回复: " Changhuang Liang
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=20240722145350.GK13497@pendragon.ideasonboard.com \
--to=laurent.pinchart@ideasonboard.com \
--cc=benjamin.gaignard@collabora.com \
--cc=changhuang.liang@starfivetech.com \
--cc=gregkh@linuxfoundation.org \
--cc=hverkuil-cisco@xs4all.nl \
--cc=jack.zhu@starfivetech.com \
--cc=jeanmichel.hautbois@ideasonboard.com \
--cc=keith.zhao@starfivetech.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=mchehab@kernel.org \
--cc=mingjia.zhang@mediatek.com \
--cc=sakari.ailus@linux.intel.com \
--cc=tomi.valkeinen+renesas@ideasonboard.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