From: Arun Iyengar Date: Tue, 01 Dec 2026 10:28:06 +0000 Subject: [PATCH v2 2/2] drm/rockchip: vop2: Give each RK3588 video port its own cluster MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20261201-vop2-axi-primary-v2-2-e111a8c05883@gmail.com> References: <20261201-vop2-axi-primary-v2-0-e111a8c05883@gmail.com> In-Reply-To: <20261201-vop2-axi-primary-v2-0-e111a8c05883@gmail.com> To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Sascha Hauer , Rob Herring Cc: dri-devel@lists.freedesktop.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Chaoyi Chen , Damon Ding , Cristian Ciocaltea , Arun Iyengar X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1796120884; l=3842; i=aiyengar1990@gmail.com; s=20261110; h=from:subject:message-id; bh=hekmvFj47LCwS9rbrlmmO7THAAXaKLtbKlGZRb2aNuk=; b=nuPVxb8V6ClN/GkuvsvwCHBXDNIVyv8I99VlpWomzYAngkGFY23jVYV4ZMzzaA3EvBd1ZyzG3 KEVtpyXvQelD/vRa5CR+ByJ1qtS57P/vxymw9zCEGsWizxwV8mxGK0v X-Developer-Key: i=aiyengar1990@gmail.com; a=ed25519; pk=zXpRgUTrhaFe6jLyPqbBy3ccfkj04w0g2690Wv3mg+0= X-Endpoint-Received: by B4 Relay for aiyengar1990@gmail.com/20261110 with auth_id=1480 List-Id: B4 Relay Submissions Damon Ding asked for POST_BUF_EMPTY to be fixed in the layer setup. On RK3588 Cluster0/1 fetch through AXI0 and Cluster2/3 through AXI1. Each video port takes the first free primary window, so VP0 and VP2 get Cluster0 and Cluster1, both on AXI0. A 4K120 and a 4K60 XR24 primary need about 6 GB/s there, one port delivers about 4.5 GB/s, and VP0 underflows in every frame. aclk_vop at 750 or 850 MHz is the same. On RK3588 give VP N Cluster N as primary plane. Boards that skip a lower video port get a different primary: without VP1, VP2 gets Cluster2 instead of Cluster1. VP0 and VP1 still share AXI0, and overlay planes can still go on any video port. RK3568 and RK3576 are unchanged. A skipped cluster would default below VP2's primary, so give primary planes the lowest default zpos. Signed-off-by: Arun Iyengar --- drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c index bbe86aecf9039..4d054c41baca1 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c @@ -2526,7 +2526,7 @@ static irqreturn_t vop2_isr(int irq, void *data) } static int vop2_plane_init(struct vop2 *vop2, struct vop2_win *win, - unsigned long possible_crtcs) + unsigned long possible_crtcs, unsigned int zpos) { const struct vop2_win_data *win_data = win->data; unsigned int blend_caps = BIT(DRM_MODE_BLEND_PIXEL_NONE) | @@ -2552,7 +2552,7 @@ static int vop2_plane_init(struct vop2 *vop2, struct vop2_win *win, win->data->supported_rotations); drm_plane_create_alpha_property(&win->base); drm_plane_create_blend_mode_property(&win->base, blend_caps); - drm_plane_create_zpos_property(&win->base, win->win_id, 0, + drm_plane_create_zpos_property(&win->base, zpos, 0, vop2->registered_num_wins - 1); return 0; @@ -2583,6 +2583,11 @@ static bool vop2_is_mirror_win(struct vop2_win *win) } } +static const u8 rk3588_vp_primary[] = { + ROCKCHIP_VOP2_CLUSTER0, ROCKCHIP_VOP2_CLUSTER1, + ROCKCHIP_VOP2_CLUSTER2, ROCKCHIP_VOP2_CLUSTER3, +}; + static int vop2_create_crtcs(struct vop2 *vop2) { const struct vop2_data *vop2_data = vop2->data; @@ -2594,6 +2599,7 @@ static int vop2_create_crtcs(struct vop2 *vop2) struct vop2_win *win; u32 possible_crtcs; int i, j, nvp, nvps = 0; + unsigned int zpos; int ret; for (i = 0; i < vop2_data->nr_vps; i++) { @@ -2655,13 +2661,17 @@ static int vop2_create_crtcs(struct vop2 *vop2) if (!(win->data->possible_vp_mask & BIT(vp->id))) continue; + if (vop2->version == VOP_VERSION_RK3588 && + win->data->phys_id != rk3588_vp_primary[vp->id]) + continue; + if (vop2_is_mirror_win(win)) continue; if (win->type == DRM_PLANE_TYPE_PRIMARY) { possible_crtcs = BIT(nvp); vp->primary_plane = win; - ret = vop2_plane_init(vop2, win, possible_crtcs); + ret = vop2_plane_init(vop2, win, possible_crtcs, nvp); if (ret) return dev_err_probe(drm->dev, ret, "failed to init primary plane %s\n", @@ -2677,6 +2687,7 @@ static int vop2_create_crtcs(struct vop2 *vop2) } /* Register all unused window as overlay plane */ + zpos = nvp; for (i = 0; i < vop2->registered_num_wins; i++) { win = &vop2->win[i]; @@ -2702,7 +2713,7 @@ static int vop2_create_crtcs(struct vop2 *vop2) nvp++; } - ret = vop2_plane_init(vop2, win, possible_crtcs); + ret = vop2_plane_init(vop2, win, possible_crtcs, zpos++); if (ret) return dev_err_probe(drm->dev, ret, "failed to init overlay plane %s\n", win->data->name); -- 2.55.0