From: "Jernej Škrabec" <jernej.skrabec@gmail.com>
To: wens@kernel.org
Cc: mripard@kernel.org, maarten.lankhorst@linux.intel.com,
tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch,
samuel@sholland.org, dri-devel@lists.freedesktop.org,
linux-arm-kernel@lists.infradead.org,
linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 26/30] drm/sun4i: mixer: Add quirk for number of VI scalers
Date: Tue, 04 Nov 2025 17:50:04 +0100 [thread overview]
Message-ID: <5959058.DvuYhMxLoT@jernej-laptop> (raw)
In-Reply-To: <CAGb2v65RecyHZVUN--oSmtzPDpmUHALd3Pqf79a1fKP9yxD8cA@mail.gmail.com>
Hi Chen-Yu,
Dne ponedeljek, 3. november 2025 ob 18:11:07 Srednjeevropski standardni čas je Chen-Yu Tsai napisal(a):
> On Mon, Oct 13, 2025 at 3:24 AM Jernej Skrabec <jernej.skrabec@gmail.com> wrote:
> >
> > On DE2 and DE3, UI scalers are located right after VI scalers. So in
> > order to calculate proper UI scaler base address, number of VI scalers
> > must be known. In practice, it is same as number of VI channels, but it
> > doesn't need to be.
> >
> > Let's make a quirk for this number. Code for configuring channels and
> > associated functions won't have access to vi_num quirk anymore after
> > rework for independent planes.
> >
> > Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
> > ---
> > drivers/gpu/drm/sun4i/sun8i_mixer.c | 11 +++++++++++
> > drivers/gpu/drm/sun4i/sun8i_mixer.h | 2 ++
> > drivers/gpu/drm/sun4i/sun8i_ui_scaler.c | 10 +++++-----
> > 3 files changed, 18 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/sun4i/sun8i_mixer.c b/drivers/gpu/drm/sun4i/sun8i_mixer.c
> > index 78bbfbe62833..f9131396f22f 100644
> > --- a/drivers/gpu/drm/sun4i/sun8i_mixer.c
> > +++ b/drivers/gpu/drm/sun4i/sun8i_mixer.c
> > @@ -708,6 +708,7 @@ static const struct sun8i_mixer_cfg sun8i_a83t_mixer0_cfg = {
> > .scaler_mask = 0xf,
> > .scanline_yuv = 2048,
> > .de2_fcc_alpha = 1,
> > + .vi_scaler_num = 1,
> > .ui_num = 3,
> > .vi_num = 1,
> > };
> > @@ -718,6 +719,7 @@ static const struct sun8i_mixer_cfg sun8i_a83t_mixer1_cfg = {
> > .scaler_mask = 0x3,
> > .scanline_yuv = 2048,
> > .de2_fcc_alpha = 1,
> > + .vi_scaler_num = 1,
> > .ui_num = 1,
> > .vi_num = 1,
> > };
> > @@ -729,6 +731,7 @@ static const struct sun8i_mixer_cfg sun8i_h3_mixer0_cfg = {
> > .scaler_mask = 0xf,
> > .scanline_yuv = 2048,
> > .de2_fcc_alpha = 1,
> > + .vi_scaler_num = 1,
> > .ui_num = 3,
> > .vi_num = 1,
> > };
> > @@ -740,6 +743,7 @@ static const struct sun8i_mixer_cfg sun8i_r40_mixer0_cfg = {
> > .scaler_mask = 0xf,
> > .scanline_yuv = 2048,
> > .de2_fcc_alpha = 1,
> > + .vi_scaler_num = 1,
> > .ui_num = 3,
> > .vi_num = 1,
> > };
> > @@ -751,6 +755,7 @@ static const struct sun8i_mixer_cfg sun8i_r40_mixer1_cfg = {
> > .scaler_mask = 0x3,
> > .scanline_yuv = 2048,
> > .de2_fcc_alpha = 1,
> > + .vi_scaler_num = 1,
> > .ui_num = 1,
> > .vi_num = 1,
> > };
> > @@ -761,6 +766,7 @@ static const struct sun8i_mixer_cfg sun8i_v3s_mixer_cfg = {
> > .ui_num = 1,
> > .scaler_mask = 0x3,
> > .scanline_yuv = 2048,
> > + .vi_scaler_num = 2,
> > .ccsc = CCSC_MIXER0_LAYOUT,
> > .mod_rate = 150000000,
> > };
> > @@ -772,6 +778,7 @@ static const struct sun8i_mixer_cfg sun20i_d1_mixer0_cfg = {
> > .scaler_mask = 0x3,
> > .scanline_yuv = 2048,
> > .de2_fcc_alpha = 1,
> > + .vi_scaler_num = 1,
> > .ui_num = 1,
> > .vi_num = 1,
> > };
> > @@ -783,6 +790,7 @@ static const struct sun8i_mixer_cfg sun20i_d1_mixer1_cfg = {
> > .scaler_mask = 0x1,
> > .scanline_yuv = 1024,
> > .de2_fcc_alpha = 1,
> > + .vi_scaler_num = 1,
> > .ui_num = 0,
> > .vi_num = 1,
> > };
> > @@ -794,6 +802,7 @@ static const struct sun8i_mixer_cfg sun50i_a64_mixer0_cfg = {
> > .scaler_mask = 0xf,
> > .scanline_yuv = 4096,
> > .de2_fcc_alpha = 1,
> > + .vi_scaler_num = 1,
> > .ui_num = 3,
> > .vi_num = 1,
> > };
> > @@ -805,6 +814,7 @@ static const struct sun8i_mixer_cfg sun50i_a64_mixer1_cfg = {
> > .scaler_mask = 0x3,
> > .scanline_yuv = 2048,
> > .de2_fcc_alpha = 1,
> > + .vi_scaler_num = 1,
> > .ui_num = 1,
> > .vi_num = 1,
> > };
> > @@ -814,6 +824,7 @@ static const struct sun8i_mixer_cfg sun50i_h6_mixer0_cfg = {
> > .mod_rate = 600000000,
> > .scaler_mask = 0xf,
> > .scanline_yuv = 4096,
> > + .vi_scaler_num = 1,
> > .ui_num = 3,
> > .vi_num = 1,
> > };
> > diff --git a/drivers/gpu/drm/sun4i/sun8i_mixer.h b/drivers/gpu/drm/sun4i/sun8i_mixer.h
> > index def07afd37e1..40b800022237 100644
> > --- a/drivers/gpu/drm/sun4i/sun8i_mixer.h
> > +++ b/drivers/gpu/drm/sun4i/sun8i_mixer.h
> > @@ -178,6 +178,7 @@ enum sun8i_mixer_type {
> > * @scaline_yuv: size of a scanline for VI scaler for YUV formats.
> > * @de2_fcc_alpha: use FCC for missing DE2 VI alpha capability
> > * Most DE2 cores has FCC. If number of VI planes is one, enable this.
> > + * @vi_scaler_num: Number of VI scalers. Used on DE2 and DE3.
> > * @map: channel map for DE variants processing YUV separately (DE33)
> > */
> > struct sun8i_mixer_cfg {
> > @@ -189,6 +190,7 @@ struct sun8i_mixer_cfg {
> > unsigned int de_type;
> > unsigned int scanline_yuv;
> > unsigned int de2_fcc_alpha : 1;
> > + unsigned int vi_scaler_num;
>
> This could be a smaller type. Please do a sweep of the struct after the
> refactoring is done and see if any of the types could be shrunk.
A lot of things can be stored in smaller type. However, making things smaller
may be contraproductive. Structs are usually aligned for performance reasons,
so it won't save any memory and accessing them will use extra asm instructions
for zeroing out parts of CPU registers since registers are larger than used
data type.
>
> And just a nitpick, but I would probably insert it above scaler_mask.
>
Will do.
>
> Reviewed-by: Chen-Yu Tsai <wens@kernel.org>
>
Thanks.
Best regards,
Jernej
next prev parent reply other threads:[~2025-11-04 16:50 UTC|newest]
Thread overview: 66+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-12 19:23 [PATCH 00/30] drm/sun4i: Refactor layer code for proper DE33 support Jernej Skrabec
2025-10-12 19:23 ` [PATCH 01/30] drm/sun4i: mixer: Fix up DE33 channel macros Jernej Skrabec
2025-10-19 7:41 ` Chen-Yu Tsai
2025-10-12 19:23 ` [PATCH 02/30] drm/sun4i: mixer: Remove ccsc cfg for >= DE3 Jernej Skrabec
2025-10-19 7:42 ` Chen-Yu Tsai
2025-10-12 19:23 ` [PATCH 03/30] drm/sun4i: de2: Initialize layer fields earlier Jernej Skrabec
2025-10-19 7:44 ` Chen-Yu Tsai
2025-10-12 19:23 ` [PATCH 04/30] drm/sun4i: ui_layer: Move check from update to check callback Jernej Skrabec
2025-10-19 8:24 ` Chen-Yu Tsai
2025-10-12 19:23 ` [PATCH 05/30] drm/sun4i: vi_layer: " Jernej Skrabec
2025-10-19 8:25 ` Chen-Yu Tsai
2025-10-12 19:23 ` [PATCH 06/30] drm/sun4i: layers: Make atomic commit functions void Jernej Skrabec
2025-10-19 8:51 ` Chen-Yu Tsai
2025-10-12 19:23 ` [PATCH 07/30] drm/sun4i: Move blender config from layers to mixer Jernej Skrabec
2025-10-27 16:00 ` Chen-Yu Tsai
2025-10-27 18:11 ` Jernej Škrabec
2025-10-12 19:23 ` [PATCH 08/30] drm/sun4i: ui layer: Write attributes in one go Jernej Skrabec
2025-10-27 16:04 ` Chen-Yu Tsai
2025-10-27 18:13 ` Jernej Škrabec
2025-10-27 18:16 ` Chen-Yu Tsai
2025-10-12 19:23 ` [PATCH 09/30] drm/sun4i: vi " Jernej Skrabec
2025-10-27 16:24 ` Chen-Yu Tsai
2025-10-12 19:23 ` [PATCH 10/30] drm/sun4i: mixer: Remove setting layer enable bit Jernej Skrabec
2025-10-27 16:28 ` Chen-Yu Tsai
2025-10-12 19:23 ` [PATCH 11/30] drm/sun4i: de2/de3: Simplify CSC config interface Jernej Skrabec
2025-10-27 16:49 ` Chen-Yu Tsai
2025-10-12 19:23 ` [PATCH 12/30] drm/sun4i: csc: Simplify arguments with taking plane state Jernej Skrabec
2025-10-27 16:51 ` Chen-Yu Tsai
2025-10-12 19:23 ` [PATCH 13/30] drm/sun4i: de2/de3: Move plane type determination to mixer Jernej Skrabec
2025-10-27 17:14 ` Chen-Yu Tsai
2025-10-12 19:23 ` [PATCH 14/30] drm/sun4i: ui_layer: Change index meaning Jernej Skrabec
2025-10-27 16:59 ` Chen-Yu Tsai
2025-10-12 19:23 ` [PATCH 15/30] drm/sun4i: layer: move num of planes calc out of layer code Jernej Skrabec
2025-10-27 16:55 ` Chen-Yu Tsai
2025-10-12 19:23 ` [PATCH 16/30] drm/sun4i: ui_layer: use layer struct instead of multiple args Jernej Skrabec
2025-10-27 17:43 ` Chen-Yu Tsai
2025-10-12 19:23 ` [PATCH 17/30] drm/sun4i: vi_layer: " Jernej Skrabec
2025-10-27 17:45 ` Chen-Yu Tsai
2025-10-12 19:23 ` [PATCH 18/30] drm/sun4i: ui_scaler: use layer instead of mixer for args Jernej Skrabec
2025-10-27 17:49 ` Chen-Yu Tsai
2025-10-12 19:23 ` [PATCH 19/30] drm/sun4i: vi_scaler: " Jernej Skrabec
2025-10-27 17:50 ` Chen-Yu Tsai
2025-10-12 19:23 ` [PATCH 20/30] drm/sun4i: layers: Make regmap for layers configurable Jernej Skrabec
2025-11-03 15:14 ` Chen-Yu Tsai
2025-10-12 19:23 ` [PATCH 21/30] drm/sun4i: csc: use layer arg instead of mixer Jernej Skrabec
2025-11-03 14:56 ` Chen-Yu Tsai
2025-10-12 19:23 ` [PATCH 22/30] drm/sun4i: layers: add physical index arg Jernej Skrabec
2025-11-03 15:11 ` Chen-Yu Tsai
2025-10-12 19:23 ` [PATCH 23/30] drm/sun4i: vi_scaler: Update DE33 base calculation Jernej Skrabec
2025-11-03 17:00 ` Chen-Yu Tsai
2025-10-12 19:23 ` [PATCH 24/30] drm/sun4i: mixer: Convert heuristics to quirk Jernej Skrabec
2025-11-03 17:05 ` Chen-Yu Tsai
2025-10-12 19:23 ` [PATCH 25/30] drm/sun4i: ui_scaler: drop sanity checks Jernej Skrabec
2025-11-03 17:05 ` Chen-Yu Tsai
2025-10-12 19:23 ` [PATCH 26/30] drm/sun4i: mixer: Add quirk for number of VI scalers Jernej Skrabec
2025-11-03 17:11 ` Chen-Yu Tsai
2025-11-04 16:50 ` Jernej Škrabec [this message]
2025-10-12 19:23 ` [PATCH 27/30] drm/sun4i: mixer: split out layer config Jernej Skrabec
2025-11-03 17:20 ` Chen-Yu Tsai
2025-10-12 19:23 ` [PATCH 28/30] drm/sun4i: layer: replace mixer with layer struct Jernej Skrabec
2025-11-03 17:31 ` Chen-Yu Tsai
2025-10-12 19:23 ` [PATCH 29/30] drm/sun4i: vi_scaler: Find mixer from crtc Jernej Skrabec
2025-11-03 17:33 ` Chen-Yu Tsai
2025-10-12 19:23 ` [PATCH 30/30] drm/sun4i: Nuke mixer pointer from layer code Jernej Skrabec
2025-11-03 17:34 ` Chen-Yu Tsai
2025-10-31 7:50 ` [PATCH 00/30] drm/sun4i: Refactor layer code for proper DE33 support Ryan Walklin
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=5959058.DvuYhMxLoT@jernej-laptop \
--to=jernej.skrabec@gmail.com \
--cc=airlied@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sunxi@lists.linux.dev \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=samuel@sholland.org \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
--cc=wens@kernel.org \
/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