1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter.git synced 2025-03-09 15:40:20 +00:00
openmptcprouter/6.12/target/linux/bcm27xx/patches-6.12/950-0660-drm-vc4-Assign-32-overlay-planes-to-writeback-only.patch
Ycarus (Yannick Chabanois) bdb9b0046f Add bcm27xx 6.12 test support
2024-12-20 14:17:26 +01:00

71 lines
2.2 KiB
Diff

From f80ecdc739cc5febf4d65874e120abe614af78a6 Mon Sep 17 00:00:00 2001
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
Date: Tue, 15 Aug 2023 15:44:34 +0100
Subject: [PATCH 660/697] drm/vc4: Assign 32 overlay planes to writeback only
Instead of having 48 generic overlay planes, assign 32 to the
writeback connector so that there is no ambiguity in wlroots
when trying to find a plane for composition using the writeback
connector vs display.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
---
drivers/gpu/drm/vc4/vc4_plane.c | 34 +++++++++++++++++++++++++++++++--
1 file changed, 32 insertions(+), 2 deletions(-)
--- a/drivers/gpu/drm/vc4/vc4_plane.c
+++ b/drivers/gpu/drm/vc4/vc4_plane.c
@@ -2610,13 +2610,28 @@ struct drm_plane *vc4_plane_init(struct
return plane;
}
-#define VC4_NUM_OVERLAY_PLANES 48
+#define VC4_NUM_OVERLAY_PLANES 16
+#define VC4_NUM_TXP_OVERLAY_PLANES 32
int vc4_plane_create_additional_planes(struct drm_device *drm)
{
struct drm_plane *cursor_plane;
struct drm_crtc *crtc;
unsigned int i;
+ struct drm_crtc *txp_crtc;
+ uint32_t non_txp_crtc_mask;
+
+ drm_for_each_crtc(crtc, drm) {
+ struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc);
+
+ if (vc4_crtc->feeds_txp) {
+ txp_crtc = crtc;
+ break;
+ }
+ }
+
+ non_txp_crtc_mask = GENMASK(drm->mode_config.num_crtc - 1, 0) -
+ drm_crtc_mask(txp_crtc);
/* Set up some arbitrary number of planes. We're not limited
* by a set number of physical registers, just the space in
@@ -2630,7 +2645,22 @@ int vc4_plane_create_additional_planes(s
for (i = 0; i < VC4_NUM_OVERLAY_PLANES; i++) {
struct drm_plane *plane =
vc4_plane_init(drm, DRM_PLANE_TYPE_OVERLAY,
- GENMASK(drm->mode_config.num_crtc - 1, 0));
+ non_txp_crtc_mask);
+
+ if (IS_ERR(plane))
+ continue;
+
+ /* Create zpos property. Max of all the overlays + 1 primary +
+ * 1 cursor plane on a crtc.
+ */
+ drm_plane_create_zpos_property(plane, i + 1, 1,
+ VC4_NUM_OVERLAY_PLANES + 1);
+ }
+
+ for (i = 0; i < VC4_NUM_TXP_OVERLAY_PLANES; i++) {
+ struct drm_plane *plane =
+ vc4_plane_init(drm, DRM_PLANE_TYPE_OVERLAY,
+ drm_crtc_mask(txp_crtc));
if (IS_ERR(plane))
continue;