public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Jack Zhu <jack.zhu@starfivetech.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
	Robert Foss <rfoss@kernel.org>, Todor Tomov <todor.too@gmail.com>,
	bryan.odonoghue@linaro.org, Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Hans Verkuil <hverkuil-cisco@xs4all.nl>,
	Eugen Hristev <eugen.hristev@collabora.com>,
	Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org, changhuang.liang@starfivetech.com
Subject: Re: [PATCH v7 5/6] media: starfive: camss: Add ISP driver
Date: Wed, 2 Aug 2023 13:48:40 +0300	[thread overview]
Message-ID: <20230802104840.GC5269@pendragon.ideasonboard.com> (raw)
In-Reply-To: <2504080f-86af-161f-5c0d-284e89e33ce1@starfivetech.com>

Hi Jack,

On Wed, Aug 02, 2023 at 05:57:57PM +0800, Jack Zhu wrote:
> On 2023/7/28 4:41, Laurent Pinchart wrote:
> > On Mon, Jun 19, 2023 at 07:28:37PM +0800, Jack Zhu wrote:
> >> Add ISP driver for StarFive Camera Subsystem.
> >> 
> >> Signed-off-by: Jack Zhu <jack.zhu@starfivetech.com>
> >> ---
> >>  .../media/platform/starfive/camss/Makefile    |   2 +
> >>  .../media/platform/starfive/camss/stf_camss.c |  76 ++-
> >>  .../media/platform/starfive/camss/stf_camss.h |   3 +
> >>  .../media/platform/starfive/camss/stf_isp.c   | 519 ++++++++++++++++++
> >>  .../media/platform/starfive/camss/stf_isp.h   | 479 ++++++++++++++++
> >>  .../platform/starfive/camss/stf_isp_hw_ops.c  | 468 ++++++++++++++++
> >>  6 files changed, 1544 insertions(+), 3 deletions(-)
> >>  create mode 100644 drivers/media/platform/starfive/camss/stf_isp.c
> >>  create mode 100644 drivers/media/platform/starfive/camss/stf_isp.h
> >>  create mode 100644 drivers/media/platform/starfive/camss/stf_isp_hw_ops.c

[snip]

> >> diff --git a/drivers/media/platform/starfive/camss/stf_isp.c b/drivers/media/platform/starfive/camss/stf_isp.c
> >> new file mode 100644
> >> index 000000000000..933a583b398c
> >> --- /dev/null
> >> +++ b/drivers/media/platform/starfive/camss/stf_isp.c
> >> @@ -0,0 +1,519 @@
> >> +// SPDX-License-Identifier: GPL-2.0
> >> +/*
> >> + * stf_isp.c
> >> + *
> >> + * StarFive Camera Subsystem - ISP Module
> >> + *
> >> + * Copyright (C) 2021-2023 StarFive Technology Co., Ltd.
> >> + */
> >> +#include <linux/firmware.h>
> > 
> > This doesn't seem needed.
> > 
> >> +#include <media/v4l2-event.h>
> >> +
> >> +#include "stf_camss.h"
> >> +
> >> +#define SINK_FORMATS_INDEX    0
> >> +#define UO_FORMATS_INDEX      1
> > 
> > What does "UO" stand for ?
> 
> "UO" is Usual Out, just represents output. :-)

Maybe "out", "output" or "source" would make the code easier to read
then ?

> >> +
> >> +static int isp_set_selection(struct v4l2_subdev *sd,
> >> +			     struct v4l2_subdev_state *state,
> >> +			     struct v4l2_subdev_selection *sel);
> >> +
> >> +static const struct isp_format isp_formats_sink[] = {
> >> +	{ MEDIA_BUS_FMT_SRGGB10_1X10, 10 },
> >> +	{ MEDIA_BUS_FMT_SGRBG10_1X10, 10 },
> >> +	{ MEDIA_BUS_FMT_SGBRG10_1X10, 10 },
> >> +	{ MEDIA_BUS_FMT_SBGGR10_1X10, 10 },
> >> +};

[snip]

> >> diff --git a/drivers/media/platform/starfive/camss/stf_isp.h b/drivers/media/platform/starfive/camss/stf_isp.h
> >> new file mode 100644
> >> index 000000000000..1e5c98482350
> >> --- /dev/null
> >> +++ b/drivers/media/platform/starfive/camss/stf_isp.h
> >> @@ -0,0 +1,479 @@

[snip]

> >> +/* The output line of ISP */
> > 
> > What is an ISP "line" ?
> 
> A pipeline contains ISP.

Patch 6/6 uses STF_ISP_LINE_MAX to iterate over the ISP lines. This
makes the code somehow generic, but you only support a single line at
the moment. Does this or other SoCs in your product line integrate the
same ISP with multiple lines ? If so, would it be possible to share a
block diagram, to better understand the other hardware architectures
that this driver will need to support in the future ?

> >> +enum isp_line_id {
> >> +	STF_ISP_LINE_INVALID = -1,
> >> +	STF_ISP_LINE_SRC = 1,
> >> +	STF_ISP_LINE_MAX = STF_ISP_LINE_SRC
> >> +};

[snip]

> >> +void stf_isp_init_cfg(struct stf_isp_dev *isp_dev)
> >> +{
> >> +	stf_isp_reg_write(isp_dev->stfcamss, ISP_REG_DC_CFG_1, DC_AXI_ID(0x0));
> >> +	stf_isp_reg_write(isp_dev->stfcamss, ISP_REG_DEC_CFG,
> >> +			  DEC_V_KEEP(0x0) |
> >> +			  DEC_V_PERIOD(0x0) |
> >> +			  DEC_H_KEEP(0x0) |
> >> +			  DEC_H_PERIOD(0x0));
> >> +
> >> +	stf_isp_config_obc(isp_dev->stfcamss);
> >> +	stf_isp_config_oecf(isp_dev->stfcamss);
> >> +	stf_isp_config_lccf(isp_dev->stfcamss);
> >> +	stf_isp_config_awb(isp_dev->stfcamss);
> >> +	stf_isp_config_grgb(isp_dev->stfcamss);
> >> +	stf_isp_config_cfa(isp_dev->stfcamss);
> >> +	stf_isp_config_ccm(isp_dev->stfcamss);
> >> +	stf_isp_config_gamma(isp_dev->stfcamss);
> >> +	stf_isp_config_r2y(isp_dev->stfcamss);
> >> +	stf_isp_config_y_curve(isp_dev->stfcamss);
> >> +	stf_isp_config_sharpen(isp_dev->stfcamss);
> >> +	stf_isp_config_dnyuv(isp_dev->stfcamss);
> >> +	stf_isp_config_sat(isp_dev->stfcamss);
> > 
> > All these parameters are hardcoded, why are they not exposed to
> > userspace ?
> 
> Here is a basic startup configuration for the ISP registers. The
> function name is confusing, as if it is configuring a specific
> function. In fact, it is just a basic init configuration.

Did I miss a place in the patch series where all these parameters can be
configured by userspace, or is that not possible at the moment ? If it
isn't possible, do you plan to implement that ?

> >> +
> >> +	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);
> >> +	stf_isp_reg_write(isp_dev->stfcamss, ISP_REG_ISP_CTRL_1,
> >> +			  CTRL_SAT(1) | CTRL_DBC | CTRL_CTC | CTRL_YHIST |
> >> +			  CTRL_YCURVE | CTRL_BIYUV | CTRL_SCE | CTRL_EE |
> >> +			  CTRL_CCE | CTRL_RGE | CTRL_CME | CTRL_AE | CTRL_CE);
> >> +}

[snip]

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2023-08-02 10:49 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-19 11:28 [PATCH v7 0/6] Add StarFive Camera Subsystem driver Jack Zhu
2023-06-19 11:28 ` [PATCH v7 1/6] media: dt-bindings: Add JH7110 Camera Subsystem Jack Zhu
2023-06-19 11:28 ` [PATCH v7 2/6] media: admin-guide: Add starfive_camss.rst for Starfive " Jack Zhu
2023-07-26 11:26   ` Bryan O'Donoghue
2023-07-26 22:26     ` Jack Zhu
2023-07-27 10:23     ` Laurent Pinchart
2023-07-31  3:39       ` Jack Zhu
2023-06-19 11:28 ` [PATCH v7 3/6] media: starfive: camss: Add basic driver Jack Zhu
2023-07-26 10:55   ` Bryan O'Donoghue
2023-07-26 22:14     ` Jack Zhu
2023-07-26 10:58   ` Bryan O'Donoghue
2023-07-26 22:18     ` Jack Zhu
2023-07-27 11:33   ` Laurent Pinchart
2023-08-01  3:24     ` Jack Zhu
2023-08-01 18:45       ` Laurent Pinchart
2023-08-02  1:22         ` Jack Zhu
2023-06-19 11:28 ` [PATCH v7 4/6] media: starfive: camss: Add video driver Jack Zhu
2023-07-27  8:49   ` Hans Verkuil
2023-08-01  6:23     ` Jack Zhu
2023-08-01 18:47       ` Laurent Pinchart
2023-08-02  1:26         ` Jack Zhu
2023-07-27 15:25   ` Laurent Pinchart
2023-08-02  2:57     ` Jack Zhu
2023-08-02  9:13       ` Laurent Pinchart
2023-06-19 11:28 ` [PATCH v7 5/6] media: starfive: camss: Add ISP driver Jack Zhu
2023-06-22  3:29   ` kernel test robot
2023-07-26  9:11   ` Hans Verkuil
2023-07-26 10:01     ` Jack Zhu
2023-07-27 20:41   ` Laurent Pinchart
2023-08-02  9:57     ` Jack Zhu
2023-08-02 10:48       ` Laurent Pinchart [this message]
2023-08-03  2:41         ` Jack Zhu
2023-08-03 22:07           ` Laurent Pinchart
2023-06-19 11:28 ` [PATCH v7 6/6] media: starfive: camss: Add VIN driver Jack Zhu
2023-07-27 20:49   ` Laurent Pinchart
2023-08-02  9:58     ` Jack Zhu
2023-08-02 10:38       ` Laurent Pinchart
2023-08-03  2:44         ` Jack Zhu
2023-08-03 22:18           ` Laurent Pinchart
2023-08-04 11:14             ` Jack Zhu
2023-08-24 13:38               ` Laurent Pinchart
2023-07-10  5:45 ` [PATCH v7 0/6] Add StarFive Camera Subsystem driver Jack Zhu
2023-07-26  7:28 ` Jack Zhu

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=20230802104840.GC5269@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=bryan.odonoghue@linaro.org \
    --cc=changhuang.liang@starfivetech.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=eugen.hristev@collabora.com \
    --cc=ezequiel@vanguardiasur.com.ar \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=jack.zhu@starfivetech.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=rfoss@kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=todor.too@gmail.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