9779cd512c00786d1456ec9d12259591ad613aea
[openwrt/staging/blocktrron.git] /
1 From c12bd0136e9772e955b5637185415d413d8d5b5c 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 0024/1085] drm/vc4: Force trigger of dlist update on margins
5 change
6
7 When the margins are changed, the dlist needs to be regenerated
8 with the changed updated dest regions for each of the planes.
9
10 Setting the zpos_changed flag is sufficient to trigger that
11 without doing a full modeset, therefore set it should the
12 margins be changed.
13
14 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
15 ---
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(-)
19
20 --- a/drivers/gpu/drm/vc4/vc4_crtc.c
21 +++ b/drivers/gpu/drm/vc4/vc4_crtc.c
22 @@ -752,10 +752,16 @@ int vc4_crtc_atomic_check(struct drm_crt
23 if (conn_state->crtc != crtc)
24 continue;
25
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));
34 +
35 + /* Need to force the dlist entries for all planes to be
36 + * updated so that the dest rectangles are changed.
37 + */
38 + crtc_state->zpos_changed = true;
39 + }
40 break;
41 }
42
43 --- a/drivers/gpu/drm/vc4/vc4_drv.h
44 +++ b/drivers/gpu/drm/vc4/vc4_drv.h
45 @@ -626,12 +626,7 @@ struct vc4_crtc_state {
46 bool txp_armed;
47 unsigned int assigned_channel;
48
49 - struct {
50 - unsigned int left;
51 - unsigned int right;
52 - unsigned int top;
53 - unsigned int bottom;
54 - } margins;
55 + struct drm_connector_tv_margins margins;
56
57 unsigned long hvs_load;
58