summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/vc4/vc4_plane.c
diff options
context:
space:
mode:
authorMaxime Ripard <mripard@kernel.org>2024-06-21 17:20:51 +0200
committerDave Stevenson <dave.stevenson@raspberrypi.com>2024-09-09 14:02:54 +0200
commit74c3b7c63b5e718a97881f8d80bef02f8a94a2b2 (patch)
tree13f5e92b6609a0b5a3902f7adc69a869cd5e73c7 /drivers/gpu/drm/vc4/vc4_plane.c
parentdrm/vc4: plane: Change ptr0_offset to an array (diff)
downloadlinux-74c3b7c63b5e718a97881f8d80bef02f8a94a2b2.tar.xz
linux-74c3b7c63b5e718a97881f8d80bef02f8a94a2b2.zip
drm/vc4: hvs: Rework LBM alignment
With the introduction of the support for BCM2712, the check of whether we're running on vc5 or not to compute the LBM alignment requirement doesn't work anymore. Moreover, the LBM size will need to be computed in words for the BCM2712, while we've had sizes in bytes so far. Aligning on either 64 or 32 words is thus fairly harmful on BCM2712, so let's just explicitly align the size when needed, and then call drm_mm_insert_node_generic() with an alignment of 1. Signed-off-by: Maxime Ripard <mripard@kernel.org> Reviewed-by: Maxime Ripard <mripard@kernel.org> Link: https://patchwork.freedesktop.org/patch/msgid/20240621152055.4180873-28-dave.stevenson@raspberrypi.com Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Diffstat (limited to '')
-rw-r--r--drivers/gpu/drm/vc4/vc4_plane.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c
index a4965226595d..4c61ef4f4142 100644
--- a/drivers/gpu/drm/vc4/vc4_plane.c
+++ b/drivers/gpu/drm/vc4/vc4_plane.c
@@ -756,6 +756,11 @@ static int vc4_plane_allocate_lbm(struct drm_plane_state *state)
if (!lbm_size)
return 0;
+ if (vc4->gen == VC4_GEN_5)
+ lbm_size = ALIGN(lbm_size, 64);
+ else if (vc4->gen == VC4_GEN_4)
+ lbm_size = ALIGN(lbm_size, 32);
+
drm_dbg_driver(drm, "[PLANE:%d:%s] LBM Allocation Size: %u\n",
plane->base.id, plane->name, lbm_size);
@@ -771,8 +776,7 @@ static int vc4_plane_allocate_lbm(struct drm_plane_state *state)
spin_lock_irqsave(&vc4->hvs->mm_lock, irqflags);
ret = drm_mm_insert_node_generic(&vc4->hvs->lbm_mm,
&vc4_state->lbm,
- lbm_size,
- vc4->gen == VC4_GEN_5 ? 64 : 32,
+ lbm_size, 1,
0, 0);
spin_unlock_irqrestore(&vc4->hvs->mm_lock, irqflags);