mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drm/rockchip: vop2: give rk3576 VP2 a primary plane
@ 2026-07-29 23:24 Tomonori Nakagawa
  2026-07-30  1:56 ` Chaoyi Chen
  2026-08-01 22:35 ` [PATCH v2] " Tomonori Nakagawa
  0 siblings, 2 replies; 5+ messages in thread
From: Tomonori Nakagawa @ 2026-07-29 23:24 UTC (permalink / raw)
  To: Sandy Huang, Heiko Stübner, Andy Yan
  Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Simona Vetter, dri-devel, linux-arm-kernel,
	linux-rockchip, linux-kernel, Tomonori Nakagawa

The rk3576 VOP2 has three video ports. VP0 and VP1 each have a Cluster
window that acts as their primary plane, but VP2 - the port wired to the
DesignWare DP controller - only has Esmart windows, all typed
DRM_PLANE_TYPE_OVERLAY.

The driver requires every active video port to own a
DRM_PLANE_TYPE_PRIMARY plane. When VP2 is driven (a board that uses the
DP output) it finds none, CRTC creation returns -ENOENT, and the whole
VOP2 bind fails, taking down the entire display subsystem.

Promote Esmart0 to DRM_PLANE_TYPE_PRIMARY so VP2 has a primary plane.
Esmart0's possible_vp_mask already includes VP2 (BIT(2)) and its
layer_sel_id[2] = 0 is a valid VP2 layer slot, while VP0 keeps Cluster0
as its primary, so the existing VP0/VP1 assignments are unchanged:

  VP0: primary=Cluster0, overlay=Esmart2
  VP1: primary=Cluster1, overlays=Esmart1, Esmart3
  VP2: primary=Esmart0,  overlays=Esmart1, Esmart2, Esmart3

Tested on Anbernic RG Vita Pro (rk3576) with the DP alt-mode output.

Signed-off-by: Tomonori Nakagawa <jack@supremeoverlordjabs.co>
---
 drivers/gpu/drm/rockchip/rockchip_vop2_reg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/rockchip/rockchip_vop2_reg.c b/drivers/gpu/drm/rockchip/rockchip_vop2_reg.c
index 17eda592b..e7d013dc3 100644
--- a/drivers/gpu/drm/rockchip/rockchip_vop2_reg.c
+++ b/drivers/gpu/drm/rockchip/rockchip_vop2_reg.c
@@ -894,7 +894,7 @@ static const struct vop2_win_data rk3576_vop_win_data[] = {
 		.format_modifiers = format_modifiers,
 		.layer_sel_id = { 2, 0xf, 0, 0xf },
 		.supported_rotations = DRM_MODE_REFLECT_Y,
-		.type = DRM_PLANE_TYPE_OVERLAY,
+		.type = DRM_PLANE_TYPE_PRIMARY,
 		.axi_bus_id = 0,
 		.axi_yrgb_r_id = 0x10,
 		.axi_uv_r_id = 0x11,
-- 
2.54.0



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] drm/rockchip: vop2: give rk3576 VP2 a primary plane
  2026-07-29 23:24 [PATCH] drm/rockchip: vop2: give rk3576 VP2 a primary plane Tomonori Nakagawa
@ 2026-07-30  1:56 ` Chaoyi Chen
  2026-07-30  3:39   ` Tomonori Nakagawa
  2026-08-01 22:35 ` [PATCH v2] " Tomonori Nakagawa
  1 sibling, 1 reply; 5+ messages in thread
From: Chaoyi Chen @ 2026-07-30  1:56 UTC (permalink / raw)
  To: Tomonori Nakagawa, Sandy Huang, Heiko Stübner, Andy Yan
  Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Simona Vetter, dri-devel, linux-arm-kernel,
	linux-rockchip, linux-kernel

Hello Tomonori,

On 7/30/2026 7:24 AM, Tomonori Nakagawa wrote:
> The rk3576 VOP2 has three video ports. VP0 and VP1 each have a Cluster
> window that acts as their primary plane, but VP2 - the port wired to the
> DesignWare DP controller - only has Esmart windows, all typed
> DRM_PLANE_TYPE_OVERLAY.

The description here is not accurate. VP2 can wire to different
display interfaces which depending on your board configuration.

> 
> The driver requires every active video port to own a
> DRM_PLANE_TYPE_PRIMARY plane. When VP2 is driven (a board that uses the
> DP output) it finds none, CRTC creation returns -ENOENT, and the whole
> VOP2 bind fails, taking down the entire display subsystem.
> 
> Promote Esmart0 to DRM_PLANE_TYPE_PRIMARY so VP2 has a primary plane.
> Esmart0's possible_vp_mask already includes VP2 (BIT(2)) and its
> layer_sel_id[2] = 0 is a valid VP2 layer slot, while VP0 keeps Cluster0
> as its primary, so the existing VP0/VP1 assignments are unchanged:
> 
>   VP0: primary=Cluster0, overlay=Esmart2
>   VP1: primary=Cluster1, overlays=Esmart1, Esmart3
>   VP2: primary=Esmart0,  overlays=Esmart1, Esmart2, Esmart3
> 
> Tested on Anbernic RG Vita Pro (rk3576) with the DP alt-mode output.
> 
> Signed-off-by: Tomonori Nakagawa <jack@supremeoverlordjabs.co>
> ---
>  drivers/gpu/drm/rockchip/rockchip_vop2_reg.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/rockchip/rockchip_vop2_reg.c b/drivers/gpu/drm/rockchip/rockchip_vop2_reg.c
> index 17eda592b..e7d013dc3 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_vop2_reg.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_vop2_reg.c
> @@ -894,7 +894,7 @@ static const struct vop2_win_data rk3576_vop_win_data[] = {
>  		.format_modifiers = format_modifiers,
>  		.layer_sel_id = { 2, 0xf, 0, 0xf },
>  		.supported_rotations = DRM_MODE_REFLECT_Y,
> -		.type = DRM_PLANE_TYPE_OVERLAY,
> +		.type = DRM_PLANE_TYPE_PRIMARY,
>  		.axi_bus_id = 0,
>  		.axi_yrgb_r_id = 0x10,
>  		.axi_uv_r_id = 0x11,

-- 
Best, 
Chaoyi

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] drm/rockchip: vop2: give rk3576 VP2 a primary plane
  2026-07-30  1:56 ` Chaoyi Chen
@ 2026-07-30  3:39   ` Tomonori Nakagawa
  2026-07-30  3:49     ` Chaoyi Chen
  0 siblings, 1 reply; 5+ messages in thread
From: Tomonori Nakagawa @ 2026-07-30  3:39 UTC (permalink / raw)
  To: Chaoyi Chen, Sandy Huang, Heiko Stübner, Andy Yan
  Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Simona Vetter, dri-devel, linux-arm-kernel,
	linux-rockchip, linux-kernel

On 2026/07/30 10:56, Chaoyi Chen wrote:
 > The description here is not accurate. VP2 can wire to different
 > display interfaces which depending on your board configuration.

You're right, thanks. VP2 isn't tied to DP - the VP-to-interface
routing is board/DT dependent. The actual issue is the plane topology:
on rk3576 the two Cluster windows (the only DRM_PLANE_TYPE_PRIMARY
windows) both have possible_vp_mask = BIT(0) | BIT(1), so they can only
attach to VP0/VP1. VP2's only attachable windows are the Esmart ones,
which are all DRM_PLANE_TYPE_OVERLAY. So whenever a board's DT wires any
output to video_port2, vop2_create_crtcs() finds no primary plane for it
and fails with -ENOENT ("no primary plane for vp 2").

I'll reword the commit message accordingly (dropping the DP framing) in
a v2. Does the fix itself - promoting Esmart0 to PRIMARY - look
acceptable, or would you prefer a different window or a driver-side
approach for VP2's primary?


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] drm/rockchip: vop2: give rk3576 VP2 a primary plane
  2026-07-30  3:39   ` Tomonori Nakagawa
@ 2026-07-30  3:49     ` Chaoyi Chen
  0 siblings, 0 replies; 5+ messages in thread
From: Chaoyi Chen @ 2026-07-30  3:49 UTC (permalink / raw)
  To: Tomonori Nakagawa, Sandy Huang, Heiko Stübner, Andy Yan
  Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Simona Vetter, dri-devel, linux-arm-kernel,
	linux-rockchip, linux-kernel

On 7/30/2026 11:39 AM, Tomonori Nakagawa wrote:
> On 2026/07/30 10:56, Chaoyi Chen wrote:
>> The description here is not accurate. VP2 can wire to different
>> display interfaces which depending on your board configuration.
> 
> You're right, thanks. VP2 isn't tied to DP - the VP-to-interface
> routing is board/DT dependent. The actual issue is the plane topology:
> on rk3576 the two Cluster windows (the only DRM_PLANE_TYPE_PRIMARY
> windows) both have possible_vp_mask = BIT(0) | BIT(1), so they can only
> attach to VP0/VP1. VP2's only attachable windows are the Esmart ones,
> which are all DRM_PLANE_TYPE_OVERLAY. So whenever a board's DT wires any
> output to video_port2, vop2_create_crtcs() finds no primary plane for it
> and fails with -ENOENT ("no primary plane for vp 2").
> 
> I'll reword the commit message accordingly (dropping the DP framing) in
> a v2. Does the fix itself - promoting Esmart0 to PRIMARY - look
> acceptable, or would you prefer a different window or a driver-side
> approach for VP2's primary?
> 
> 
> 

No, it looks good to me. Let's see if anyone else has any opinions.

-- 
Best, 
Chaoyi


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2] drm/rockchip: vop2: give rk3576 VP2 a primary plane
  2026-07-29 23:24 [PATCH] drm/rockchip: vop2: give rk3576 VP2 a primary plane Tomonori Nakagawa
  2026-07-30  1:56 ` Chaoyi Chen
@ 2026-08-01 22:35 ` Tomonori Nakagawa
  1 sibling, 0 replies; 5+ messages in thread
From: Tomonori Nakagawa @ 2026-08-01 22:35 UTC (permalink / raw)
  To: Chaoyi Chen, Sandy Huang, Heiko Stübner, Andy Yan
  Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Simona Vetter, dri-devel, linux-arm-kernel,
	linux-rockchip, linux-kernel, Tomonori Nakagawa

On rk3576 the two Cluster windows are the only windows typed
DRM_PLANE_TYPE_PRIMARY, and both have possible_vp_mask = BIT(0) | BIT(1),
so they can only be attached to VP0 or VP1. VP2's only attachable
windows are the Esmart windows, which are all DRM_PLANE_TYPE_OVERLAY.

vop2_create_crtcs() requires every video port a board wires up (an output
endpoint on video_portN) to own a DRM_PLANE_TYPE_PRIMARY plane. On a
board whose DT routes any interface to VP2, no attachable primary plane
is found and probe fails with -ENOENT ("no primary plane for vp 2"),
tearing down the whole VOP2.

Promote Esmart0 to DRM_PLANE_TYPE_PRIMARY. Its possible_vp_mask is
BIT(0) | BIT(2); since vop2_create_crtcs() assigns primaries in window
array order and Cluster0/Cluster1 precede Esmart0, VP0 and VP1 still take
Cluster0/Cluster1, and only VP2 gains Esmart0 as its primary:

  VP0: primary Cluster0
  VP1: primary Cluster1
  VP2: primary Esmart0

Tested on Anbernic RG Vita Pro (rk3576), which routes its DP output to
VP2.

Signed-off-by: Tomonori Nakagawa <jack@supremeoverlordjabs.co>
---
v2: reword the commit message per Chaoyi Chen's review - VP2 is not
    DP-specific; describe the plane topology instead (the two
    PRIMARY-typed Cluster windows are limited to VP0/VP1 by
    possible_vp_mask, so VP2 has no attachable primary). No functional
    change.

 drivers/gpu/drm/rockchip/rockchip_vop2_reg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/rockchip/rockchip_vop2_reg.c b/drivers/gpu/drm/rockchip/rockchip_vop2_reg.c
index 17eda592b..e7d013dc3 100644
--- a/drivers/gpu/drm/rockchip/rockchip_vop2_reg.c
+++ b/drivers/gpu/drm/rockchip/rockchip_vop2_reg.c
@@ -894,7 +894,7 @@ static const struct vop2_win_data rk3576_vop_win_data[] = {
 		.format_modifiers = format_modifiers,
 		.layer_sel_id = { 2, 0xf, 0, 0xf },
 		.supported_rotations = DRM_MODE_REFLECT_Y,
-		.type = DRM_PLANE_TYPE_OVERLAY,
+		.type = DRM_PLANE_TYPE_PRIMARY,
 		.axi_bus_id = 0,
 		.axi_yrgb_r_id = 0x10,
 		.axi_uv_r_id = 0x11,
-- 
2.54.0



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-08-01 22:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-29 23:24 [PATCH] drm/rockchip: vop2: give rk3576 VP2 a primary plane Tomonori Nakagawa
2026-07-30  1:56 ` Chaoyi Chen
2026-07-30  3:39   ` Tomonori Nakagawa
2026-07-30  3:49     ` Chaoyi Chen
2026-08-01 22:35 ` [PATCH v2] " Tomonori Nakagawa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®