From: Ben Skeggs <bskeggs@redhat.com>
Date: Tue, 8 May 2018 20:39:47 +1000
Subject: drm/nouveau/kms/nv50-: decouple window state changes, and update
method submisssion
Git-commit: 04fc14be7726edbb34404f69297e74061a8a9563
Patch-mainline: v4.18-rc1
References: FATE#326289 FATE#326079 FATE#326049 FATE#322398 FATE#326166
This will be required to support Volta.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Acked-by: Petr Tesarik <ptesarik@suse.com>
---
drivers/gpu/drm/nouveau/dispnv50/disp.c | 16 ++++++++++++++++
drivers/gpu/drm/nouveau/dispnv50/wndw.c | 4 ----
2 files changed, 16 insertions(+), 4 deletions(-)
--- a/drivers/gpu/drm/nouveau/dispnv50/disp.c
+++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c
@@ -1690,6 +1690,14 @@ nv50_disp_atomic_commit_tail(struct drm_
/* Flush disable. */
if (interlock[NV50_DISP_INTERLOCK_CORE]) {
if (atom->flush_disable) {
+ for_each_new_plane_in_state(state, plane, new_plane_state, i) {
+ struct nv50_wndw *wndw = nv50_wndw(plane);
+ if (interlock[wndw->interlock.type] & wndw->interlock.data) {
+ if (wndw->func->update)
+ wndw->func->update(wndw, interlock);
+ }
+ }
+
nv50_disp_atomic_commit_core(drm, interlock);
memset(interlock, 0x00, sizeof(interlock));
}
@@ -1751,6 +1759,14 @@ nv50_disp_atomic_commit_tail(struct drm_
}
/* Flush update. */
+ for_each_new_plane_in_state(state, plane, new_plane_state, i) {
+ struct nv50_wndw *wndw = nv50_wndw(plane);
+ if (interlock[wndw->interlock.type] & wndw->interlock.data) {
+ if (wndw->func->update)
+ wndw->func->update(wndw, interlock);
+ }
+ }
+
if (interlock[NV50_DISP_INTERLOCK_CORE]) {
if (interlock[NV50_DISP_INTERLOCK_BASE] ||
!atom->state.legacy_cursor_update)
--- a/drivers/gpu/drm/nouveau/dispnv50/wndw.c
+++ b/drivers/gpu/drm/nouveau/dispnv50/wndw.c
@@ -119,8 +119,6 @@ nv50_wndw_flush_clr(struct nv50_wndw *wn
if (clr.image) wndw->func->image_clr(wndw);
interlock[wndw->interlock.type] |= wndw->interlock.data;
- if (flush)
- wndw->func->update(wndw, interlock);
}
void
@@ -142,8 +140,6 @@ nv50_wndw_flush_set(struct nv50_wndw *wn
}
interlock[wndw->interlock.type] |= wndw->interlock.data;
- if (wndw->func->update)
- wndw->func->update(wndw, interlock);
}
void