All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Heiko Stübner" <heiko@sntech.de>
To: Andy Yan <andyshrk@163.com>
Cc: hjc@rock-chips.com, krzk+dt@kernel.org,
	devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org,
	derek.foreman@collabora.com, detlev.casanova@collabora.com,
	daniel@fooishbar.org, robh@kernel.org,
	sebastian.reichel@collabora.com,
	Andy Yan <andy.yan@rock-chips.com>
Subject: Re: [PATCH v14 02/13] drm/rockchip: vop2: Rename TRANSFORM_OFFSET to TRANSFORM_OFFS
Date: Wed, 12 Feb 2025 11:59:50 +0100	[thread overview]
Message-ID: <4064785.VqM8IeB0Os@diego> (raw)
In-Reply-To: <20250212093530.52961-3-andyshrk@163.com>

Hi Andy,

Am Mittwoch, 12. Februar 2025, 10:34:57 MEZ schrieb Andy Yan:
> From: Andy Yan <andy.yan@rock-chips.com>
> 
> This help avoid "exceeds 100 columns" warning from checkpatch
> 
> Signed-off-by: Andy Yan <andy.yan@rock-chips.com>

I'm not much of a fan of "randomly" renaming individual constants
(especially when one is now named OFFS, while the rest stay at OFFSET)

- on rk3568 VOP2_CLUSTER_WIN0_TRANSFORMED_OFFSET = WIN0 transformed offset
- on rk3588 VOP2_CLUSTER0_WIN0_TRANSFORMED_OFFSET = WIN0 transform offset
- on rk3576 "someone" sadly decided to not provide the 2nd TRM part anymore
  but I guess it'll be the same.

So instead of just dropping parts from the end, you could also follow
the TRM naming and drop the "_AFBC" from the register name instead?

So going to VOP2_WIN_TRANSFORM_OFFSET, this would also reduce the line
length accordingly, and moving the naming closer to the TRM too.

Alternatively, just add a linebreak at the appropriate position instead.

Heiko


> ---
> 
> (no changes since v1)
> 
>  drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 8 ++++----
>  drivers/gpu/drm/rockchip/rockchip_drm_vop2.h | 4 ++--
>  2 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
> index ebc9cb93073c..8e1b742a7550 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
> @@ -1524,7 +1524,7 @@ static void vop2_plane_atomic_update(struct drm_plane *plane,
>  		transform_offset = vop2_afbc_transform_offset(pstate, half_block_en);
>  		vop2_win_write(win, VOP2_WIN_AFBC_HDR_PTR, yrgb_mst);
>  		vop2_win_write(win, VOP2_WIN_AFBC_PIC_SIZE, act_info);
> -		vop2_win_write(win, VOP2_WIN_AFBC_TRANSFORM_OFFSET, transform_offset);
> +		vop2_win_write(win, VOP2_WIN_AFBC_TRANSFORM_OFFS, transform_offset);
>  		vop2_win_write(win, VOP2_WIN_AFBC_PIC_OFFSET, ((src->x1 >> 16) | src->y1));
>  		vop2_win_write(win, VOP2_WIN_AFBC_DSP_OFFSET, (dest->x1 | (dest->y1 << 16)));
>  		vop2_win_write(win, VOP2_WIN_AFBC_PIC_VIR_WIDTH, stride);
> @@ -1535,7 +1535,7 @@ static void vop2_plane_atomic_update(struct drm_plane *plane,
>  	} else {
>  		if (vop2_cluster_window(win)) {
>  			vop2_win_write(win, VOP2_WIN_AFBC_ENABLE, 0);
> -			vop2_win_write(win, VOP2_WIN_AFBC_TRANSFORM_OFFSET, 0);
> +			vop2_win_write(win, VOP2_WIN_AFBC_TRANSFORM_OFFS, 0);
>  		}
>  
>  		vop2_win_write(win, VOP2_WIN_YRGB_VIR, DIV_ROUND_UP(fb->pitches[0], 4));
> @@ -3448,7 +3448,7 @@ static const struct reg_field vop2_cluster_regs[VOP2_WIN_MAX_REG] = {
>  	[VOP2_WIN_AFBC_TILE_NUM] = REG_FIELD(RK3568_CLUSTER_WIN_AFBCD_VIR_WIDTH, 16, 31),
>  	[VOP2_WIN_AFBC_PIC_OFFSET] = REG_FIELD(RK3568_CLUSTER_WIN_AFBCD_PIC_OFFSET, 0, 31),
>  	[VOP2_WIN_AFBC_DSP_OFFSET] = REG_FIELD(RK3568_CLUSTER_WIN_AFBCD_DSP_OFFSET, 0, 31),
> -	[VOP2_WIN_AFBC_TRANSFORM_OFFSET] = REG_FIELD(RK3568_CLUSTER_WIN_AFBCD_TRANSFORM_OFFSET, 0, 31),
> +	[VOP2_WIN_AFBC_TRANSFORM_OFFS] = REG_FIELD(RK3568_CLUSTER_WIN_AFBCD_TRANSFORM_OFFS, 0, 31),
>  	[VOP2_WIN_AFBC_ROTATE_90] = REG_FIELD(RK3568_CLUSTER_WIN_AFBCD_ROTATE_MODE, 0, 0),
>  	[VOP2_WIN_AFBC_ROTATE_270] = REG_FIELD(RK3568_CLUSTER_WIN_AFBCD_ROTATE_MODE, 1, 1),
>  	[VOP2_WIN_XMIRROR] = REG_FIELD(RK3568_CLUSTER_WIN_AFBCD_ROTATE_MODE, 2, 2),
> @@ -3547,7 +3547,7 @@ static const struct reg_field vop2_esmart_regs[VOP2_WIN_MAX_REG] = {
>  	[VOP2_WIN_AFBC_PIC_OFFSET] = { .reg = 0xffffffff },
>  	[VOP2_WIN_AFBC_PIC_SIZE] = { .reg = 0xffffffff },
>  	[VOP2_WIN_AFBC_DSP_OFFSET] = { .reg = 0xffffffff },
> -	[VOP2_WIN_AFBC_TRANSFORM_OFFSET] = { .reg = 0xffffffff },
> +	[VOP2_WIN_AFBC_TRANSFORM_OFFS] = { .reg = 0xffffffff },
>  	[VOP2_WIN_AFBC_HDR_PTR] = { .reg = 0xffffffff },
>  	[VOP2_WIN_AFBC_HALF_BLOCK_EN] = { .reg = 0xffffffff },
>  	[VOP2_WIN_AFBC_ROTATE_270] = { .reg = 0xffffffff },
> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.h b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.h
> index 29cc7fb8f6d8..8510140b0869 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.h
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.h
> @@ -118,7 +118,7 @@ enum vop2_win_regs {
>  	VOP2_WIN_AFBC_PIC_OFFSET,
>  	VOP2_WIN_AFBC_PIC_SIZE,
>  	VOP2_WIN_AFBC_DSP_OFFSET,
> -	VOP2_WIN_AFBC_TRANSFORM_OFFSET,
> +	VOP2_WIN_AFBC_TRANSFORM_OFFS,
>  	VOP2_WIN_AFBC_HDR_PTR,
>  	VOP2_WIN_AFBC_HALF_BLOCK_EN,
>  	VOP2_WIN_AFBC_ROTATE_270,
> @@ -335,7 +335,7 @@ enum dst_factor_mode {
>  #define RK3568_CLUSTER_WIN_DSP_INFO		0x24
>  #define RK3568_CLUSTER_WIN_DSP_ST		0x28
>  #define RK3568_CLUSTER_WIN_SCL_FACTOR_YRGB	0x30
> -#define RK3568_CLUSTER_WIN_AFBCD_TRANSFORM_OFFSET	0x3C
> +#define RK3568_CLUSTER_WIN_AFBCD_TRANSFORM_OFFS	0x3C
>  #define RK3568_CLUSTER_WIN_AFBCD_OUTPUT_CTRL	0x50
>  #define RK3568_CLUSTER_WIN_AFBCD_ROTATE_MODE	0x54
>  #define RK3568_CLUSTER_WIN_AFBCD_HDR_PTR	0x58
> 






WARNING: multiple messages have this Message-ID (diff)
From: "Heiko Stübner" <heiko@sntech.de>
To: Andy Yan <andyshrk@163.com>
Cc: hjc@rock-chips.com, krzk+dt@kernel.org,
	devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org,
	derek.foreman@collabora.com, detlev.casanova@collabora.com,
	daniel@fooishbar.org, robh@kernel.org,
	sebastian.reichel@collabora.com,
	Andy Yan <andy.yan@rock-chips.com>
Subject: Re: [PATCH v14 02/13] drm/rockchip: vop2: Rename TRANSFORM_OFFSET to TRANSFORM_OFFS
Date: Wed, 12 Feb 2025 11:59:50 +0100	[thread overview]
Message-ID: <4064785.VqM8IeB0Os@diego> (raw)
In-Reply-To: <20250212093530.52961-3-andyshrk@163.com>

Hi Andy,

Am Mittwoch, 12. Februar 2025, 10:34:57 MEZ schrieb Andy Yan:
> From: Andy Yan <andy.yan@rock-chips.com>
> 
> This help avoid "exceeds 100 columns" warning from checkpatch
> 
> Signed-off-by: Andy Yan <andy.yan@rock-chips.com>

I'm not much of a fan of "randomly" renaming individual constants
(especially when one is now named OFFS, while the rest stay at OFFSET)

- on rk3568 VOP2_CLUSTER_WIN0_TRANSFORMED_OFFSET = WIN0 transformed offset
- on rk3588 VOP2_CLUSTER0_WIN0_TRANSFORMED_OFFSET = WIN0 transform offset
- on rk3576 "someone" sadly decided to not provide the 2nd TRM part anymore
  but I guess it'll be the same.

So instead of just dropping parts from the end, you could also follow
the TRM naming and drop the "_AFBC" from the register name instead?

So going to VOP2_WIN_TRANSFORM_OFFSET, this would also reduce the line
length accordingly, and moving the naming closer to the TRM too.

Alternatively, just add a linebreak at the appropriate position instead.

Heiko


> ---
> 
> (no changes since v1)
> 
>  drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 8 ++++----
>  drivers/gpu/drm/rockchip/rockchip_drm_vop2.h | 4 ++--
>  2 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
> index ebc9cb93073c..8e1b742a7550 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
> @@ -1524,7 +1524,7 @@ static void vop2_plane_atomic_update(struct drm_plane *plane,
>  		transform_offset = vop2_afbc_transform_offset(pstate, half_block_en);
>  		vop2_win_write(win, VOP2_WIN_AFBC_HDR_PTR, yrgb_mst);
>  		vop2_win_write(win, VOP2_WIN_AFBC_PIC_SIZE, act_info);
> -		vop2_win_write(win, VOP2_WIN_AFBC_TRANSFORM_OFFSET, transform_offset);
> +		vop2_win_write(win, VOP2_WIN_AFBC_TRANSFORM_OFFS, transform_offset);
>  		vop2_win_write(win, VOP2_WIN_AFBC_PIC_OFFSET, ((src->x1 >> 16) | src->y1));
>  		vop2_win_write(win, VOP2_WIN_AFBC_DSP_OFFSET, (dest->x1 | (dest->y1 << 16)));
>  		vop2_win_write(win, VOP2_WIN_AFBC_PIC_VIR_WIDTH, stride);
> @@ -1535,7 +1535,7 @@ static void vop2_plane_atomic_update(struct drm_plane *plane,
>  	} else {
>  		if (vop2_cluster_window(win)) {
>  			vop2_win_write(win, VOP2_WIN_AFBC_ENABLE, 0);
> -			vop2_win_write(win, VOP2_WIN_AFBC_TRANSFORM_OFFSET, 0);
> +			vop2_win_write(win, VOP2_WIN_AFBC_TRANSFORM_OFFS, 0);
>  		}
>  
>  		vop2_win_write(win, VOP2_WIN_YRGB_VIR, DIV_ROUND_UP(fb->pitches[0], 4));
> @@ -3448,7 +3448,7 @@ static const struct reg_field vop2_cluster_regs[VOP2_WIN_MAX_REG] = {
>  	[VOP2_WIN_AFBC_TILE_NUM] = REG_FIELD(RK3568_CLUSTER_WIN_AFBCD_VIR_WIDTH, 16, 31),
>  	[VOP2_WIN_AFBC_PIC_OFFSET] = REG_FIELD(RK3568_CLUSTER_WIN_AFBCD_PIC_OFFSET, 0, 31),
>  	[VOP2_WIN_AFBC_DSP_OFFSET] = REG_FIELD(RK3568_CLUSTER_WIN_AFBCD_DSP_OFFSET, 0, 31),
> -	[VOP2_WIN_AFBC_TRANSFORM_OFFSET] = REG_FIELD(RK3568_CLUSTER_WIN_AFBCD_TRANSFORM_OFFSET, 0, 31),
> +	[VOP2_WIN_AFBC_TRANSFORM_OFFS] = REG_FIELD(RK3568_CLUSTER_WIN_AFBCD_TRANSFORM_OFFS, 0, 31),
>  	[VOP2_WIN_AFBC_ROTATE_90] = REG_FIELD(RK3568_CLUSTER_WIN_AFBCD_ROTATE_MODE, 0, 0),
>  	[VOP2_WIN_AFBC_ROTATE_270] = REG_FIELD(RK3568_CLUSTER_WIN_AFBCD_ROTATE_MODE, 1, 1),
>  	[VOP2_WIN_XMIRROR] = REG_FIELD(RK3568_CLUSTER_WIN_AFBCD_ROTATE_MODE, 2, 2),
> @@ -3547,7 +3547,7 @@ static const struct reg_field vop2_esmart_regs[VOP2_WIN_MAX_REG] = {
>  	[VOP2_WIN_AFBC_PIC_OFFSET] = { .reg = 0xffffffff },
>  	[VOP2_WIN_AFBC_PIC_SIZE] = { .reg = 0xffffffff },
>  	[VOP2_WIN_AFBC_DSP_OFFSET] = { .reg = 0xffffffff },
> -	[VOP2_WIN_AFBC_TRANSFORM_OFFSET] = { .reg = 0xffffffff },
> +	[VOP2_WIN_AFBC_TRANSFORM_OFFS] = { .reg = 0xffffffff },
>  	[VOP2_WIN_AFBC_HDR_PTR] = { .reg = 0xffffffff },
>  	[VOP2_WIN_AFBC_HALF_BLOCK_EN] = { .reg = 0xffffffff },
>  	[VOP2_WIN_AFBC_ROTATE_270] = { .reg = 0xffffffff },
> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.h b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.h
> index 29cc7fb8f6d8..8510140b0869 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.h
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.h
> @@ -118,7 +118,7 @@ enum vop2_win_regs {
>  	VOP2_WIN_AFBC_PIC_OFFSET,
>  	VOP2_WIN_AFBC_PIC_SIZE,
>  	VOP2_WIN_AFBC_DSP_OFFSET,
> -	VOP2_WIN_AFBC_TRANSFORM_OFFSET,
> +	VOP2_WIN_AFBC_TRANSFORM_OFFS,
>  	VOP2_WIN_AFBC_HDR_PTR,
>  	VOP2_WIN_AFBC_HALF_BLOCK_EN,
>  	VOP2_WIN_AFBC_ROTATE_270,
> @@ -335,7 +335,7 @@ enum dst_factor_mode {
>  #define RK3568_CLUSTER_WIN_DSP_INFO		0x24
>  #define RK3568_CLUSTER_WIN_DSP_ST		0x28
>  #define RK3568_CLUSTER_WIN_SCL_FACTOR_YRGB	0x30
> -#define RK3568_CLUSTER_WIN_AFBCD_TRANSFORM_OFFSET	0x3C
> +#define RK3568_CLUSTER_WIN_AFBCD_TRANSFORM_OFFS	0x3C
>  #define RK3568_CLUSTER_WIN_AFBCD_OUTPUT_CTRL	0x50
>  #define RK3568_CLUSTER_WIN_AFBCD_ROTATE_MODE	0x54
>  #define RK3568_CLUSTER_WIN_AFBCD_HDR_PTR	0x58
> 





_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

  reply	other threads:[~2025-02-12 11:06 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-12  9:34 [PATCH v14 00/13] VOP Support for rk3576 Andy Yan
2025-02-12  9:34 ` Andy Yan
2025-02-12  9:34 ` [PATCH v14 01/13] drm/rockchip: vop2: use devm_regmap_field_alloc for cluster-regs Andy Yan
2025-02-12  9:34   ` Andy Yan
2025-02-12  9:34 ` [PATCH v14 02/13] drm/rockchip: vop2: Rename TRANSFORM_OFFSET to TRANSFORM_OFFS Andy Yan
2025-02-12  9:34   ` Andy Yan
2025-02-12 10:59   ` Heiko Stübner [this message]
2025-02-12 10:59     ` Heiko Stübner
2025-02-13 10:52     ` Andy Yan
2025-02-13 10:52       ` Andy Yan
2025-02-12  9:34 ` [PATCH v14 03/13] drm/rockchip: vop2: Add platform specific callback Andy Yan
2025-02-12  9:34   ` Andy Yan
2025-02-12  9:34 ` [PATCH v14 04/13] drm/rockchip: vop2: Merge vop2_cluster/esmart_init function Andy Yan
2025-02-12  9:34   ` Andy Yan
2025-02-14 22:24   ` Heiko Stübner
2025-02-14 22:24     ` Heiko Stübner
2025-02-15  7:34     ` Andy Yan
2025-02-15  7:34       ` Andy Yan
2025-02-12  9:35 ` [PATCH v14 05/13] drm/rockchip: vop2: Support for different layer select configuration between VPs Andy Yan
2025-02-12  9:35   ` Andy Yan
2025-02-12  9:35 ` [PATCH v14 06/13] drm/rockchip: vop2: Introduce vop hardware version Andy Yan
2025-02-12  9:35   ` Andy Yan
2025-02-12  9:35 ` [PATCH v14 07/13] drm/rockchip: vop2: Register the primary plane and overlay plane separately Andy Yan
2025-02-12  9:35   ` Andy Yan
2025-02-12  9:35 ` [PATCH v14 08/13] drm/rockchip: vop2: Set plane possible crtcs by possible vp mask Andy Yan
2025-02-12  9:35   ` Andy Yan
2025-02-12  9:35 ` [PATCH v14 09/13] drm/rockchip: vop2: Add uv swap for cluster window Andy Yan
2025-02-12  9:35   ` Andy Yan
2025-02-12  9:35 ` [PATCH v14 10/13] dt-bindings: display: vop2: describe constraint SoC by SoC Andy Yan
2025-02-12  9:35   ` Andy Yan
2025-02-12  9:36 ` [PATCH v14 11/13] dt-bindings: display: vop2: Add missing rockchip,grf property for rk3566/8 Andy Yan
2025-02-12  9:36   ` [PATCH v14 11/13] dt-bindings: display: vop2: Add missing rockchip, grf " Andy Yan
2025-02-12  9:36   ` [PATCH v14 11/13] dt-bindings: display: vop2: Add missing rockchip,grf " Andy Yan
2025-02-12  9:36 ` [PATCH v14 12/13] dt-bindings: display: vop2: Add rk3576 support Andy Yan
2025-02-12  9:36   ` Andy Yan
2025-02-12  9:36 ` [PATCH v14 13/13] drm/rockchip: vop2: Add support for rk3576 Andy Yan
2025-02-12  9:36   ` Andy Yan

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=4064785.VqM8IeB0Os@diego \
    --to=heiko@sntech.de \
    --cc=andy.yan@rock-chips.com \
    --cc=andyshrk@163.com \
    --cc=daniel@fooishbar.org \
    --cc=derek.foreman@collabora.com \
    --cc=detlev.casanova@collabora.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hjc@rock-chips.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=robh@kernel.org \
    --cc=sebastian.reichel@collabora.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.