rzg2l_du_vsp_get_drm_plane() scans all DRM planes for a matching
pipe_index, but with multiple VSP instances two planes belonging to
different VSPs can share the same index.  Add a vsp pointer check so
the search is scoped to the CRTC's own VSP instance.

No functional change for single-VSP platforms.

Signed-off-by: Tommaso Merciai <[email protected]>
---
v6->v7:
 - New patch.

 drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c 
b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c
index bc205c25cd21..1edbcb9f134f 100644
--- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c
+++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c
@@ -80,7 +80,8 @@ struct drm_plane *rzg2l_du_vsp_get_drm_plane(struct 
rzg2l_du_crtc *crtc,
        drm_for_each_plane(plane, &rcdu->ddev) {
                struct rzg2l_du_vsp_plane *vsp_plane = 
to_rzg2l_vsp_plane(plane);
 
-               if (vsp_plane->index == pipe_index)
+               if (vsp_plane->vsp == crtc->vsp &&
+                   vsp_plane->index == pipe_index)
                        break;
        }
 
-- 
2.54.0

Reply via email to