devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mehdi Djait <mehdi.djait@bootlin.com>
To: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Cc: Michael Riesch <michael.riesch@wolfvision.net>,
	mchehab@kernel.org, heiko@sntech.de, hverkuil-cisco@xs4all.nl,
	krzysztof.kozlowski+dt@linaro.org, robh+dt@kernel.org,
	conor+dt@kernel.org, ezequiel@vanguardiasur.com.ar,
	linux-media@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com,
	alexandre.belloni@bootlin.com, maxime.chevallier@bootlin.com
Subject: Re: [PATCH v8 0/3] media: rockchip: Add a driver for Rockchip's camera interface
Date: Wed, 25 Oct 2023 12:33:42 +0200	[thread overview]
Message-ID: <ZTjvBgxtMh1YZbYm@pc-70.home> (raw)
In-Reply-To: <ZTjl0xJMTqZfO2Xf@aptenodytes>

Hi Paul, Hi Michael

On Wed, Oct 25, 2023 at 11:54:27AM +0200, Paul Kocialkowski wrote:
> Michael,
> 
> On Wed 25 Oct 23, 11:17, Michael Riesch wrote:
> > Hi Paul,
> > 
> > On 10/25/23 10:43, Paul Kocialkowski wrote:
> > > [...]
> > >>> Here is the detail of my research on the concerned chips. The + at the beginning
> > >>> of the line indicate support in Rockchip's 4.4 tree:
> > >>>
> > >>> - RK3566/RK3568 (2020): CIF pins + VICAP terminology
> > >>> + RK1808 (2019): CIF pins + VIP registers + VIP_MIPI registers
> > >>> + PX30 (2017): VIP pins + VIP registers
> > >>> + RK3328 (2017): CIF pins + VIP terminology
> > >>> - RK3326 (2017): CIF pins + VIP terminology
> > >>> - RK3399 (2016): CIF pins
> > >>> - RK3368 (2015): CIF pins
> > >>> - PX2 (2014-11): CIF pins + CIF registers
> > >>> + RK3126/RK3128 (2014-10): CIF pins + registers
> > >>> + RK3288 (2014-05): CIF pins + VIP terminology
> > >>> - RK3026 (2013): CIF pins + CIF registers
> > >>> - RK3168/RK3188/PX3 (2012): CIF pins + CIF registers
> > >>> - RK3066 (2012): CIF pins + CIF registers
> > >>>
> > >>> Note that there are a few variations over time (added/removed registers), but
> > >>> the offsets of crucial registers are always the same, so we can safely
> > >>> assume this is the same unit in different generations.
> > >>>
> > >>> Since the RK3066 is the first model starting the RK30 lineup I think we can
> > >>> safely use that for the "base" compatible to be used for e.g. the bindings
> > >>> document, instead of px30 which is just one of the many SoCs that use this unit.
> > >>
> > >> Once the name of the driver is defined and adjusted in v9, I can try to
> > >> give the series a shot on my RK3568 board. First attempts to do so

This sounds good!

> > >> basing on Maxime's v5 showed that with a few modifications the DVP
> > >> feature works fine. In a subsequent step, we could discuss the inclusion
> > >> of the MIPI CSI-2 things in order to keep the driver sufficiently general.
> > > 
> > > Nice! I guess there will be a need to introduce a variant structure associated
> > > to each compatible to express the differences betweens these different
> > > generations.
> > 
> > Indeed. If Mehdi and you suggest something, I'd be happy to review.
> 
> Well the be honest the scope of work on our side is really centered on PX30
> and merging this first version.
> 
> > Otherwise, I'll try to come up with something reasonable. IMHO it would
> > make sense (as a first step) to have the clocks and the resets in this
> > structure, as well as a sub-structure that describes the DVP. The latter
> > consists of registers mainly, but maybe supported input/output formats
> > and other things should go in there as well. Also, downstream code has a
> > significant number of
> >     if (some condition including chip_id) A; else B;
> > things that we should probably get rid of with this variant structure.
> 
> Indeed I think we want to try avoid that. Another common option is to define
> capability flags to represent differences between generations in a more
> practical and clean way than explicitly checking chip ids or so.
> 
> > As next step, a sub-structure for MIPI CSI-2 could be defined. RK356X
> > will have one of those, RK3588 will feature even six of them. So we
> > should add a const array to the variant structure.
> > 
> > > Note that we will also probably need to convert the driver over to a MC-centric
> > > approach, but this is of course outside of the scope of this series.
> > 
> > That would absolutely make sense. What is missing, though? (I was
> > wondering that the driver calls media_device_(un)register but no
> > /dev/mediaX device pops up.)
> 
> Switching from video node-centric to MC-centric is more of a semantic change.
> In the first case we expect that subdevs are configured by the video device
> driver and userspace is not expected to change anything in the media topology
> or to configure media entities explicitly.
> 
> In the latter case it's the opposite : the driver should never try to push
> configuration to a subdev and should instead validate that the current
> configuration makes sense.
> 
> Still, I believe should be a media device registered and visible to userspace.
> Mehdi could you take a look at this? Do you see a media device in `media-ctl -p`
> and /dev/mediaX?

Yes I do have a media device

media-ctl -p
Media device information
------------------------
driver          rockchip-cif
model           rk_cif
serial          
bus info        platform:ff490000.video-capture
hw revision     0x0
driver version  6.6.0

Device topology
- entity 1: rockchip_cif (1 pad, 1 link)
            type Node subtype V4L flags 0
            device node name /dev/video0
        pad0: Sink
                <- "tw9900 2-0044":0 [ENABLED]

- entity 5: tw9900 2-0044 (1 pad, 1 link)
            type V4L2 subdev subtype Unknown flags 0
            device node name /dev/v4l-subdev0
        pad0: Source
                [fmt:UYVY8_2X8/720x480 field:none colorspace:smpte170m xfer:709 ycbcr:601]
                -> "rockchip_cif":0 [ENABLED]

> 
> Cheers,
> 
> Paul
> 
> > Best regards,
> > Michael
> > 
> > > 
> > > Cheers,
> > > 
> > > Paul
> > > 
> > >> @Mehdi: If you could Cc: me when you send out v9 it'd be much appreciated.

Of course I will :)

--
Kind Regards
Mehdi Djait

  reply	other threads:[~2023-10-25 10:33 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-16  9:00 [PATCH v8 0/3] media: rockchip: Add a driver for Rockchip's camera interface Mehdi Djait
2023-10-16  9:00 ` [PATCH v8 1/3] media: dt-bindings: media: add bindings for Rockchip VIP Mehdi Djait
2023-10-16  9:00 ` [PATCH v8 2/3] media: rockchip: Add a driver for Rockhip's camera interface Mehdi Djait
2023-10-19 15:40   ` Paul Kocialkowski
2023-10-20 15:38   ` Paul Kocialkowski
2023-10-23 13:28   ` Michael Riesch
2023-10-25  8:49     ` Paul Kocialkowski
2023-10-25  9:38       ` Michael Riesch
2023-10-25  9:48         ` Paul Kocialkowski
2023-10-25 10:28           ` Mehdi Djait
2023-10-16  9:00 ` [PATCH v8 3/3] arm64: dts: rockchip: Add the " Mehdi Djait
2023-10-20 14:10   ` Paul Kocialkowski
2023-10-19 15:33 ` [PATCH v8 0/3] media: rockchip: Add a driver for Rockchip's " Paul Kocialkowski
2023-10-23 13:07   ` Michael Riesch
2023-10-25  8:43     ` Paul Kocialkowski
2023-10-25  9:17       ` Michael Riesch
2023-10-25  9:54         ` Paul Kocialkowski
2023-10-25 10:33           ` Mehdi Djait [this message]
2023-10-25 13:12             ` Michael Riesch

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=ZTjvBgxtMh1YZbYm@pc-70.home \
    --to=mehdi.djait@bootlin.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=ezequiel@vanguardiasur.com.ar \
    --cc=heiko@sntech.de \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=maxime.chevallier@bootlin.com \
    --cc=mchehab@kernel.org \
    --cc=michael.riesch@wolfvision.net \
    --cc=paul.kocialkowski@bootlin.com \
    --cc=robh+dt@kernel.org \
    --cc=thomas.petazzoni@bootlin.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).