diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c index 95487b964313ed..76ba68f1b8d5b3 100644 --- a/drivers/gpu/drm/vc4/vc4_plane.c +++ b/drivers/gpu/drm/vc4/vc4_plane.c @@ -2984,6 +2984,11 @@ int vc4_plane_create_additional_planes(struct drm_device *drm) } drm_for_each_crtc(crtc, drm) { + /* The writeback CRTC has its own, larger set of overlays */ + unsigned int max_zpos = crtc == txp_crtc ? + VC4_NUM_TXP_OVERLAY_PLANES + 1 : + VC4_NUM_OVERLAY_PLANES + 1; + /* Set up the legacy cursor after overlay initialization, * since the zpos fallback is that planes are rendered by plane * ID order, and that then puts the cursor on top. @@ -2993,10 +2998,8 @@ int vc4_plane_create_additional_planes(struct drm_device *drm) if (!IS_ERR(cursor_plane)) { crtc->cursor = cursor_plane; - drm_plane_create_zpos_property(cursor_plane, - VC4_NUM_OVERLAY_PLANES + 1, - 1, - VC4_NUM_OVERLAY_PLANES + 1); + drm_plane_create_zpos_property(cursor_plane, max_zpos, + 1, max_zpos); } }