drm/nouveau/kms/nv50-: separate blocklinear vs linear pitch
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:30 +0000 (15:01 +1000)
Will be required to support Volta.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/dispnv50/atom.h
drivers/gpu/drm/nouveau/dispnv50/base507c.c
drivers/gpu/drm/nouveau/dispnv50/base827c.c
drivers/gpu/drm/nouveau/dispnv50/base907c.c
drivers/gpu/drm/nouveau/dispnv50/head507d.c
drivers/gpu/drm/nouveau/dispnv50/head827d.c
drivers/gpu/drm/nouveau/dispnv50/head907d.c
drivers/gpu/drm/nouveau/dispnv50/wndw.c

index 3e9e8832d0dd129b0f79ea80a67dd24483fb0c4f..0409947bf196259165e3a2d63e1c292f70f31aab 100644 (file)
@@ -63,7 +63,8 @@ struct nv50_head_atom {
                u8  format;
                u8  kind:7;
                u8  layout:1;
-               u8  block:4;
+               u8  blockh:4;
+               u16 blocks:12;
                u32 pitch:20;
                u16 x;
                u16 y;
@@ -175,7 +176,8 @@ struct nv50_wndw_atom {
                u8  format;
                u8  kind:7;
                u8  layout:1;
-               u8  block:4;
+               u8  blockh:4;
+               u16 blocks[3];
                u32 pitch[3];
                u16 w;
                u16 h;
index 5d664d75b64517d3e071233947e2d9b2a6ae3a00..d5e295ca2caa54530d0bd29e47cc0c3bccde3915 100644 (file)
@@ -67,8 +67,9 @@ base507c_image_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
                evo_data(push, 0x00000000);
                evo_data(push, asyw->image.h << 16 | asyw->image.w);
                evo_data(push, asyw->image.layout << 20 |
-                              asyw->image.pitch[0] |
-                              asyw->image.block);
+                              (asyw->image.pitch[0] >> 8) << 8 |
+                              asyw->image.blocks[0] << 8 |
+                              asyw->image.blockh);
                evo_data(push, asyw->image.kind << 16 |
                               asyw->image.format << 8);
                evo_kick(push, &wndw->wndw);
index d886858a57240b70378b8c4888672522aac58529..73646819a0d686c0270b5084f90c3d89ed08bcf3 100644 (file)
@@ -36,8 +36,9 @@ base827c_image_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
                evo_data(push, 0x00000000);
                evo_data(push, asyw->image.h << 16 | asyw->image.w);
                evo_data(push, asyw->image.layout << 20 |
-                              asyw->image.pitch[0] |
-                              asyw->image.block);
+                              (asyw->image.pitch[0] >> 8) << 8 |
+                              asyw->image.blocks[0] << 8 |
+                              asyw->image.blockh);
                evo_data(push, asyw->image.format << 8);
                evo_kick(push, &wndw->wndw);
        }
index 2643592ad827cfb4cecdc8c9c529eb325fd18b9d..8edc0598bda83debd7a453d8a3c6f2b35bbef09b 100644 (file)
@@ -36,8 +36,9 @@ base907c_image_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
                evo_data(push, 0x00000000);
                evo_data(push, asyw->image.h << 16 | asyw->image.w);
                evo_data(push, asyw->image.layout << 24 |
-                              asyw->image.pitch[0] |
-                              asyw->image.block);
+                              (asyw->image.pitch[0] >> 8) << 8 |
+                              asyw->image.blocks[0] << 8 |
+                              asyw->image.blockh);
                evo_data(push, asyw->image.format << 8);
                evo_kick(push, &wndw->wndw);
        }
index 75575c33c5d674bfef471e7ba6ca9455d6878acd..8a8aa9b69ef8334a710ab0c51db1b1d0d670c859 100644 (file)
@@ -151,8 +151,9 @@ head507d_core_set(struct nv50_head *head, struct nv50_head_atom *asyh)
                evo_mthd(push, 0x0868 + head->base.index * 0x400, 4);
                evo_data(push, asyh->core.h << 16 | asyh->core.w);
                evo_data(push, asyh->core.layout << 20 |
-                              asyh->core.pitch >> 8 << 8 |
-                              asyh->core.block);
+                              (asyh->core.pitch >> 8) << 8 |
+                              asyh->core.blocks << 8 |
+                              asyh->core.blockh);
                evo_data(push, asyh->core.kind << 16 |
                               asyh->core.format << 8);
                evo_data(push, asyh->core.handle);
@@ -196,7 +197,8 @@ head507d_core_calc(struct nv50_head *head, struct nv50_head_atom *asyh)
        asyh->core.format = 0xcf;
        asyh->core.kind = 0;
        asyh->core.layout = 1;
-       asyh->core.block = 0;
+       asyh->core.blockh = 0;
+       asyh->core.blocks = 0;
        asyh->core.pitch = ALIGN(asyh->core.w, 64) * 4;
 }
 
index ddc143bac3055c332cabf28648dff6e692eecee7..ae33e21790ee7b4605fcef838bf1a81ab5d25a6c 100644 (file)
@@ -64,7 +64,8 @@ head827d_core_set(struct nv50_head *head, struct nv50_head_atom *asyh)
                evo_data(push, asyh->core.h << 16 | asyh->core.w);
                evo_data(push, asyh->core.layout << 20 |
                               (asyh->core.pitch >> 8) << 8 |
-                              asyh->core.block);
+                              asyh->core.blocks << 8 |
+                              asyh->core.blockh);
                evo_data(push, asyh->core.format << 8);
                evo_data(push, asyh->core.handle);
                evo_mthd(push, 0x08c0 + head->base.index * 0x400, 1);
index 0fa0159bfafb8d11ffb7c46ffdbb70afc9a154db..a05dfccadcfa6178b42733c0d98be3939a0a93ee 100644 (file)
@@ -172,7 +172,8 @@ head907d_core_set(struct nv50_head *head, struct nv50_head_atom *asyh)
                evo_data(push, asyh->core.h << 16 | asyh->core.w);
                evo_data(push, asyh->core.layout << 24 |
                               (asyh->core.pitch >> 8) << 8 |
-                              asyh->core.block);
+                              asyh->core.blocks << 8 |
+                              asyh->core.blockh);
                evo_data(push, asyh->core.format << 8);
                evo_data(push, asyh->core.handle);
                evo_mthd(push, 0x04b0 + head->base.index * 0x300, 1);
index fbaf8b7ed203aa5dd08bba6b7f7e49ab22c344be..b96dc3d4dab5932454bc1494eea06d1289fd71c5 100644 (file)
@@ -225,13 +225,15 @@ nv50_wndw_atomic_check_acquire(struct nv50_wndw *wndw, bool modeset,
                if (asyw->image.kind) {
                        asyw->image.layout = 0;
                        if (drm->client.device.info.chipset >= 0xc0)
-                               asyw->image.block = fb->nvbo->mode >> 4;
+                               asyw->image.blockh = fb->nvbo->mode >> 4;
                        else
-                               asyw->image.block = fb->nvbo->mode;
-                       asyw->image.pitch[0] = (fb->base.pitches[0] / 4) << 4;
+                               asyw->image.blockh = fb->nvbo->mode;
+                       asyw->image.blocks[0] = fb->base.pitches[0] / 64;
+                       asyw->image.pitch[0] = 0;
                } else {
                        asyw->image.layout = 1;
-                       asyw->image.block  = 0;
+                       asyw->image.blockh = 0;
+                       asyw->image.blocks[0] = 0;
                        asyw->image.pitch[0] = fb->base.pitches[0];
                }