From: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
To: Linus Walleij <linusw@kernel.org>
Cc: Jacopo Mondi <jacopo.mondi@ideasonboard.com>,
Nayden.Kanchev@arm.com,
Konstantin Babin <Konstantin.Babin@arm.com>,
Anthony McGivern <anthony.mcgivern@arm.com>,
vincenzo.frascino@arm.com, linus.walleij@arm.com,
Daniel Scally <dan.scally@ideasonboard.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
Jacopo Mondi <jacopo.mondi+renesas@ideasonboard.com>
Subject: Re: [PATCH v2 2/2] media: arm: mali-c55: Add support for RGB Gamma
Date: Fri, 26 Jun 2026 16:52:37 +0200 [thread overview]
Message-ID: <aj6QqZbuN0WJvg2C@zed> (raw)
In-Reply-To: <CAD++jL=RmN0HHYOSg68V5OQggN4uCdWdW2d+qA0GWgUv-51Rmg@mail.gmail.com>
Hi Linus,
thanks for the review
On Fri, Jun 26, 2026 at 12:53:45AM +0200, Linus Walleij wrote:
> Hi Jacopo,
>
> thanks for your patch!
>
> On Tue, Jun 16, 2026 at 4:36 PM Jacopo Mondi
> <jacopo.mondi@ideasonboard.com> wrote:
>
> > From: Jacopo Mondi <jacopo.mondi+renesas@ideasonboard.com>
> >
> > Add support for Gamma curve correction for the Mali C55 ISP.
> >
> > Define a new block in the uAPI using the extensible v4l2-isp format and
> > implement support for configuring the RGB Gamma parameters in the
> > mali-c55 parameters handler.
> >
> > Signed-off-by: Jacopo Mondi <jacopo.mondi+renesas@ideasonboard.com>
> (...)
>
> > +static void mali_c55_params_gamma(struct mali_c55 *mali_c55,
> > + union mali_c55_params_block block,
> > + __u32 offset, __u32 lut_base)
> > +{
> > + const struct mali_c55_params_gamma *params = block.gamma;
> > +
> > + if (block.header->flags & V4L2_ISP_PARAMS_FL_BLOCK_DISABLE) {
> > + mali_c55_ctx_update_bits(mali_c55,
> > + MALI_C55_REG_GAMMA_RGB_ENABLE + offset,
> > + MALI_C55_GAMMA_ENABLE_MASK, 0x00);
> > + return;
> > + }
> > +
> > + mali_c55_ctx_update_bits(mali_c55, MALI_C55_REG_GAMMA_GAINS_1 + offset,
> > + MALI_C55_GAMMA_GAIN_R_MASK, params->gains[0]);
> > + mali_c55_ctx_update_bits(mali_c55, MALI_C55_REG_GAMMA_GAINS_1 + offset,
> > + MALI_C55_GAMMA_GAIN_G_MASK,
> > + MALI_C55_GAMMA_GAIN_G(params->gains[1]));
>
> It is a bit of confusion for the head when GAINS_1 is indexed to
> gains[0] and gains[1] because the register i split.
>
See below
> > + /* We cannot apply parameters to DS if it is not fitted. */
> > + if (!(mali_c55->capabilities & MALI_C55_GPS_DS_PIPE_FITTED))
> > + return;
>
> I suppose this is a HW synthesis thin? Whether DS is fitted or not?
> (Just curious.)
I presume so ?
>
> > @@ -425,11 +425,13 @@ enum mali_c55_interrupts {
> > #define MALI_C55_REG_GAMMA_GAINS_1 0x1c068
> > #define MALI_C55_GAMMA_GAIN_R_MASK GENMASK(11, 0)
> > #define MALI_C55_GAMMA_GAIN_G_MASK GENMASK(27, 16)
>
> Because of my confusion I would rename *GAINS_1
> to *GAINS_RG..
>
> > +#define MALI_C55_GAMMA_GAIN_G(x) ((x) << 16)
> > #define MALI_C55_REG_GAMMA_GAINS_2 0x1c06c
> > #define MALI_C55_GAMMA_GAIN_B_MASK GENMASK(11, 0)
>
> .. and *GAINS_2 to GAINS_B.
>
> This would make it clear what the registers are for.
>
I can certainly do so
> > #define MALI_C55_REG_GAMMA_OFFSETS_1 0x1c070
> > #define MALI_C55_GAMMA_OFFSET_R_MASK GENMASK(11, 0)
> > #define MALI_C55_GAMMA_OFFSET_G_MASK GENMASK(27, 16)
>
> Same here *GAMMA_OFFSETS_RG
Aren't the R and G masks different ?
Or are you suggesting
#define MALI_C55_REG_GAMMA_OFFSETS_RG 0x1c070
>
> > +#define MALI_C55_GAMMA_OFFSET_G(x) ((x) << 16)
> > #define MALI_C55_REG_GAMMA_OFFSETS_2 0x1c074
> > #define MALI_C55_GAMMA_OFFSET_B_MASK GENMASK(11, 0)
>
> Etc.
>
> You might have good reasons for this naming that I don't understand
I think there register names were already there before this patch
didn't they ?
> (like they are named like that in some documentation, I checked the
> register map document but it doesn't seem to name the individual registers
> but call them as a group "fr gamma rgb".
> Maybe I'm looking in the wrong place.
> so either way:
>
> Reviewed-by: Linus Walleij <linusw@kernel.org>
Thanks!
>
> Yours,
> Linus Walleij
>
next prev parent reply other threads:[~2026-06-26 14:52 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-16 14:36 [PATCH v2 0/2] media: mali-c55: Add support for CCM and Gamma Jacopo Mondi
2026-06-16 14:36 ` [PATCH v2 1/2] media: arm: mali-c55: Add support for CCM Jacopo Mondi
2026-06-25 22:35 ` Linus Walleij
2026-06-26 9:44 ` Vincenzo Frascino
2026-06-26 14:45 ` Jacopo Mondi
2026-06-16 14:36 ` [PATCH v2 2/2] media: arm: mali-c55: Add support for RGB Gamma Jacopo Mondi
2026-06-25 22:53 ` Linus Walleij
2026-06-26 14:52 ` Jacopo Mondi [this message]
2026-06-26 17:30 ` Linus Walleij
2026-06-26 9:52 ` Vincenzo Frascino
2026-06-26 14:55 ` Jacopo Mondi
2026-06-18 13:28 ` [PATCH v2 0/2] media: mali-c55: Add support for CCM and Gamma Linus Walleij
2026-06-18 13:51 ` Jacopo Mondi
2026-06-18 14:48 ` Konstantin Ryabitsev
2026-06-18 14:57 ` Jacopo Mondi
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=aj6QqZbuN0WJvg2C@zed \
--to=jacopo.mondi@ideasonboard.com \
--cc=Konstantin.Babin@arm.com \
--cc=Nayden.Kanchev@arm.com \
--cc=anthony.mcgivern@arm.com \
--cc=dan.scally@ideasonboard.com \
--cc=jacopo.mondi+renesas@ideasonboard.com \
--cc=linus.walleij@arm.com \
--cc=linusw@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=vincenzo.frascino@arm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.