Re: [PATCH 58/74] media: uapi: Add CAMSS ISP statistics definition
From: Gjorgji Rosikopulos (Consultant)
Date: Thu Oct 08 2026 - 11:19:28 EST
Hi Bryan,
On 10/8/2026 4:40 PM, Bryan O'Donoghue wrote:
> On 08/10/2026 12:23, Gjorgji Rosikopulos (Consultant) wrote:
>>> +/* Number of bins in a Bayer histogram. */
>>> +#define CAMSS_STATS_BHIST_BINS 1024
>>> +
>>> +/**
>>> + * struct camss_stats_bhist - Bayer histogram
>>> + *
>>> + * Histogram of the luma of each 2x2 Bayer quad inside the histogram's region,
>>> + * over CAMSS_STATS_BHIST_BINS equal bins spanning its input range. Quads
>>> + * whose luma falls outside the input range are not counted.
>>> + *
>>> + * @header: block header; @header.type = CAMSS_STATS_AEC_BHIST
>>> + * @bins: number of quads per bin
>>> + */
>>> +struct camss_stats_bhist {
>>> + struct v4l2_isp_block_header header;
>> I think that the whole format is not correct, having header is preventing address alignment
>> of the buffer for the stats, as i have mentioned in the next patch copying the statistics
>> on each frame is not correct, just to have generic statistics format in userspace.
>
> Err no I'll disagree with you there.
>
> Since we are introducing stats on the qcom side we get to be the first -
> or close to first - system to implement extensible self-describing stats
> which is the mirror to the params.
>
> Extensible stats lands in 7.3 so IMO there's no reason not to use it.
>
> Also I think its kind of a crap design to have extensible params but not
> extensible stats.
>
> It should be all or nothing. I don't see a gigantic problem in copying
> in data and then looking at how to accommodate dma straight into the
> stats output with block alignments later.
Well i dont see reason to accept copying of the data in the first place,
i have no time to check the exact structure but the statistics are
not same as parameters, usually there is structure mirroring exact
layout of the hw, parameters need to be parsed and written to the memory.
There should be a way the header to give exact offset of the data in the
memory and that will create a hole min with page size maybe bigger.
There should be some common sense here adding everything in the kernel to have
generic UAPI should not be at the price of copy overhead.
>
> The extensible header facilitates next-hopping anyway so userspace
> shouldn't have to change once we DMA to the aligned regions.
>
> Also if that is not supported by extensible stats then it _should_ be
> supported by extensible stats - i.e. it should be possible to DMA
> directly into the output buffer and pad the blocks as much as you need.
Here i disagree we should have proper implementation in first merged series.
The question is what we will do with the first header which describes first block.
I need to check exactly the discussion and implementation for this topic.
~Gjorgji