1 From b583024119e8ea35f7a6d2d8b143c0eb390afa70 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Fri, 1 Apr 2022 11:31:38 +0100
4 Subject: [PATCH] drm/vc4: Force trigger of dlist update on margins
7 When the margins are changed, the dlist needs to be regenerated
8 with the changed updated dest regions for each of the planes.
10 Setting the zpos_changed flag is sufficient to trigger that
11 without doing a full modeset, therefore set it should the
14 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
16 drivers/gpu/drm/vc4/vc4_crtc.c | 14 ++++++++++----
17 drivers/gpu/drm/vc4/vc4_drv.h | 7 +------
18 2 files changed, 11 insertions(+), 10 deletions(-)
20 --- a/drivers/gpu/drm/vc4/vc4_crtc.c
21 +++ b/drivers/gpu/drm/vc4/vc4_crtc.c
22 @@ -757,10 +757,16 @@ static int vc4_crtc_atomic_check(struct
23 if (conn_state->crtc != crtc)
26 - vc4_state->margins.left = conn_state->tv.margins.left;
27 - vc4_state->margins.right = conn_state->tv.margins.right;
28 - vc4_state->margins.top = conn_state->tv.margins.top;
29 - vc4_state->margins.bottom = conn_state->tv.margins.bottom;
30 + if (memcmp(&vc4_state->margins, &conn_state->tv.margins,
31 + sizeof(vc4_state->margins))) {
32 + memcpy(&vc4_state->margins, &conn_state->tv.margins,
33 + sizeof(vc4_state->margins));
35 + /* Need to force the dlist entries for all planes to be
36 + * updated so that the dest rectangles are changed.
38 + crtc_state->zpos_changed = true;
43 --- a/drivers/gpu/drm/vc4/vc4_drv.h
44 +++ b/drivers/gpu/drm/vc4/vc4_drv.h
45 @@ -581,12 +581,7 @@ struct vc4_crtc_state {
47 unsigned int assigned_channel;
53 - unsigned int bottom;
55 + struct drm_connector_tv_margins margins;
57 unsigned long hvs_load;