drm/nouveau/kms/gv100-: move window ownership setup into modesetting path
[linux-2.6-microblaze.git] / drivers / gpu / drm / nouveau / dispnv50 / corec37d.c
index 40d9b65..f414171 100644 (file)
 
 #include <nouveau_bo.h>
 
+void
+corec37d_wndw_owner(struct nv50_core *core)
+{
+       const u32 windows = 8; /*XXX*/
+       u32 *push, i;
+       if ((push = evo_wait(&core->chan, 2 * windows))) {
+               for (i = 0; i < windows; i++) {
+                       evo_mthd(push, 0x1000 + (i * 0x080), 1);
+                       evo_data(push, i >> 1);
+               }
+               evo_kick(push, &core->chan);
+       }
+}
+
 void
 corec37d_update(struct nv50_core *core, u32 *interlock, bool ntfy)
 {
@@ -76,12 +90,11 @@ corec37d_init(struct nv50_core *core)
 {
        const u32 windows = 8; /*XXX*/
        u32 *push, i;
-       if ((push = evo_wait(&core->chan, 2 + 6 * windows + 2))) {
+       if ((push = evo_wait(&core->chan, 2 + 5 * windows + 2))) {
                evo_mthd(push, 0x0208, 1);
                evo_data(push, core->chan.sync.handle);
                for (i = 0; i < windows; i++) {
-                       evo_mthd(push, 0x1000 + (i * 0x080), 3);
-                       evo_data(push, i >> 1);
+                       evo_mthd(push, 0x1004 + (i * 0x080), 2);
                        evo_data(push, 0x0000001f);
                        evo_data(push, 0x00000000);
                        evo_mthd(push, 0x1010 + (i * 0x080), 1);
@@ -90,6 +103,7 @@ corec37d_init(struct nv50_core *core)
                evo_mthd(push, 0x0200, 1);
                evo_data(push, 0x00000001);
                evo_kick(push, &core->chan);
+               core->assign_windows = true;
        }
 }
 
@@ -99,6 +113,7 @@ corec37d = {
        .ntfy_init = corec37d_ntfy_init,
        .ntfy_wait_done = corec37d_ntfy_wait_done,
        .update = corec37d_update,
+       .wndw.owner = corec37d_wndw_owner,
        .head = &headc37d,
        .sor = &sorc37d,
 };