drm/msm/sde: trigger plane modeset on buffer pitch change
Need to check the buffer pitches and trigger a source rectangle
update if they change to avoid possible smmu faults.
Change-Id: I6d692e7e1d8090c8dc7a11eee7f6c3643edc71ff
Signed-off-by: Lloyd Atkinson <latkinso@codeaurora.org>
diff --git a/drivers/gpu/drm/msm/sde/sde_plane.c b/drivers/gpu/drm/msm/sde/sde_plane.c
index 1989e89..12b9ffa 100644
--- a/drivers/gpu/drm/msm/sde/sde_plane.c
+++ b/drivers/gpu/drm/msm/sde/sde_plane.c
@@ -842,7 +842,9 @@
} else if (state->fb->pixel_format != old_state->fb->pixel_format) {
DBG("%s: format change!", psde->pipe_name);
pstate->mode_changed = true;
- } else {
+ }
+
+ if (!pstate->mode_changed) {
uint64_t *new_mods = state->fb->modifier;
uint64_t *old_mods = old_state->fb->modifier;
int i;
@@ -856,6 +858,22 @@
}
}
}
+
+ if (!pstate->mode_changed) {
+ uint32_t *new_pitches = state->fb->pitches;
+ uint32_t *old_pitches = old_state->fb->pitches;
+ int i;
+
+ for (i = 0; i < ARRAY_SIZE(state->fb->pitches); i++) {
+ if (new_pitches[i] != old_pitches[i]) {
+ DBG("%s: pitches change plane %d: %u, %u",
+ psde->pipe_name, i, old_pitches[i],
+ new_pitches[i]);
+ pstate->mode_changed = true;
+ break;
+ }
+ }
+ }
}
static int sde_plane_atomic_check(struct drm_plane *plane,