drm/nouveau/kms/nv50-: decouple window state changes, and update method submisssion
authorBen Skeggs <bskeggs@redhat.com>
Tue, 8 May 2018 10:39:47 +0000 (20:39 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Fri, 18 May 2018 05:01:29 +0000 (15:01 +1000)
This will be required to support Volta.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/dispnv50/disp.c
drivers/gpu/drm/nouveau/dispnv50/wndw.c

index e80d11c9a456e87b33395488ff65d665eb5a3a31..0f2020010aab08670da4b854d072feffad30023d 100644 (file)
@@ -1690,6 +1690,14 @@ nv50_disp_atomic_commit_tail(struct drm_atomic_state *state)
        /* 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_atomic_state *state)
        }
 
        /* 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)
index 8f62c2a811ffb2abdb87832d14f9fb6b532c2b66..0fba4e0a4bb4b8cbf0188eb64c586e5f2a268d74 100644 (file)
@@ -119,8 +119,6 @@ nv50_wndw_flush_clr(struct nv50_wndw *wndw, u32 *interlock, bool flush,
        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 *wndw, u32 *interlock,
        }
 
        interlock[wndw->interlock.type] |= wndw->interlock.data;
-       if (wndw->func->update)
-               wndw->func->update(wndw, interlock);
 }
 
 void