Skip to content

Commit ddd39a7

Browse files
authored
drm/vc4: Force trigger of dlist update on margins change (#4970)
When the margins are changed, the dlist needs to be regenerated with the changed updated dest regions for each of the planes. Setting the zpos_changed flag is sufficient to trigger that without doing a full modeset, therefore set it should the margins be changed. Signed-off-by: Dave Stevenson <[email protected]>
1 parent 6f921e9 commit ddd39a7

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

drivers/gpu/drm/vc4/vc4_crtc.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -728,10 +728,16 @@ static int vc4_crtc_atomic_check(struct drm_crtc *crtc,
728728
if (conn_state->crtc != crtc)
729729
continue;
730730

731-
vc4_state->margins.left = conn_state->tv.margins.left;
732-
vc4_state->margins.right = conn_state->tv.margins.right;
733-
vc4_state->margins.top = conn_state->tv.margins.top;
734-
vc4_state->margins.bottom = conn_state->tv.margins.bottom;
731+
if (memcmp(&vc4_state->margins, &conn_state->tv.margins,
732+
sizeof(vc4_state->margins))) {
733+
memcpy(&vc4_state->margins, &conn_state->tv.margins,
734+
sizeof(vc4_state->margins));
735+
736+
/* Need to force the dlist entries for all planes to be
737+
* updated so that the dest rectangles are changed.
738+
*/
739+
crtc_state->zpos_changed = true;
740+
}
735741
break;
736742
}
737743

drivers/gpu/drm/vc4/vc4_drv.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -589,12 +589,7 @@ struct vc4_crtc_state {
589589
bool txp_armed;
590590
unsigned int assigned_channel;
591591

592-
struct {
593-
unsigned int left;
594-
unsigned int right;
595-
unsigned int top;
596-
unsigned int bottom;
597-
} margins;
592+
struct drm_connector_tv_margins margins;
598593

599594
unsigned long hvs_load;
600595

0 commit comments

Comments
 (0)