[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <eba83b14-e704-464a-b4c4-19322e70d177@linaro.org>
Date: Mon, 19 Aug 2024 12:05:40 +0100
From: Bryan O'Donoghue <bryan.odonoghue@...aro.org>
To: Depeng Shao <quic_depengs@...cinc.com>, rfoss@...nel.org,
todor.too@...il.com, mchehab@...nel.org, robh@...nel.org,
krzk+dt@...nel.org, conor+dt@...nel.org
Cc: linux-arm-msm@...r.kernel.org, linux-media@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
kernel@...cinc.com, Yongsheng Li <quic_yon@...cinc.com>
Subject: Re: [PATCH 13/13] media: qcom: camss: Add support for VFE hardware
version Titan 780
On 12/08/2024 15:41, Depeng Shao wrote:
> +#define VFE_BUS_WM_CFG(n) (BUS_REG_BASE + 0x200 + (n) * 0x100)
<snip>
> +#define RDI_WM(n) ((vfe_is_lite(vfe) ? 0x0 : 0x17) + (n))
> +
> +static void vfe_wm_start(struct vfe_device *vfe, u8 wm, struct vfe_line *line)
> +{
> + struct v4l2_pix_format_mplane *pix =
> + &line->video_out.active_fmt.fmt.pix_mp;
> +
> + wm = RDI_WM(wm); /* map to actual WM used (from wm=RDI index) */
OK so one more point here.
The non-lite VFE has I think in the case of sm8550 twenty seven
different bus clients.
The above code takes a given index - take the example of index 0 meaning
RDI0 and
1. Determines if is_lite() is true deriving a jump of 0 or 0x17
2. Uses this index as a further offset to functions such as
VFE_BUS_WM_CFG(n)
3. In no way articulates which bus client is which.
So for a non lite case -> RDI0 is bus client # 23
The code we have for CAMSS just assumes RDI is the only client we are
programming - which I'm not proposing to change for now, however the
code is very not obvious in what it is doing here.
This BTW isn't a criticism of what you've done here but, even though I
have access to the registers in front of me, I had to spend about 30
minutes looking up and verifying these offsets.
That's not sustainable.
Could you please add a comment which details what each index relates to.
/*
* Bus client mapping
*
* 0 = VID_Y ?
* 1 = VID_C
* .. etc
* .. etc
* 23 = RDI0
* 24 = RDI1
*/
I'll try to apply a similar level of index documentation for existing
upstream submissions so that working out client mappings is less tedious
and will be requiring these mappings for new VFE silicon enabling code
upstream.
---
bod
Powered by blists - more mailing lists