Skip to content

Commit a143bc5

Browse files
committed
Merge branch '00.06-gr-ampere' of https://gitlab.freedesktop.org/skeggsb/nouveau into drm-next
This is the pull request for a whole bunch of fixes and prep-work that was done to support Ampere acceleration prior to GSP-RM being available. It uses the ACR firmware released by NVIDIA in linux-firmware, as we do on earlier GPUs. The work to support running on top of GSP-RM also heavily depends on various pieces of this series. In addition to the new HW support, general stability of the driver should be improved, especially around recovering HW from bugs that can be generated by userspace driver components. Signed-off-by: Dave Airlie <[email protected]> From: Ben Skeggs <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/CABDvA==s+nZD0n7CuRWLPE=Pj+02CN13r+ZQJxoHQ_EmR+o=XQ@mail.gmail.com
2 parents 49e8e63 + c4bdac7 commit a143bc5

File tree

407 files changed

+15740
-13236
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

407 files changed

+15740
-13236
lines changed

drivers/gpu/drm/nouveau/Kbuild

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,6 @@ nouveau-y += nouveau_bios.o
5454
nouveau-y += nouveau_connector.o
5555
nouveau-y += nouveau_display.o
5656
nouveau-y += nouveau_dp.o
57-
nouveau-y += nouveau_fbcon.o
58-
nouveau-y += nv04_fbcon.o
59-
nouveau-y += nv50_fbcon.o
60-
nouveau-y += nvc0_fbcon.o
6157
include $(src)/dispnv04/Kbuild
6258
include $(src)/dispnv50/Kbuild
6359

drivers/gpu/drm/nouveau/dispnv04/crtc.c

Lines changed: 16 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
* DEALINGS IN THE SOFTWARE.
2424
*/
2525
#include <drm/drm_crtc_helper.h>
26+
#include <drm/drm_fb_helper.h>
2627
#include <drm/drm_fourcc.h>
2728
#include <drm/drm_plane_helper.h>
2829
#include <drm/drm_vblank.h>
@@ -37,7 +38,6 @@
3738
#include "nouveau_crtc.h"
3839
#include "hw.h"
3940
#include "nvreg.h"
40-
#include "nouveau_fbcon.h"
4141
#include "disp.h"
4242
#include "nouveau_dma.h"
4343

@@ -761,7 +761,8 @@ static void nv_crtc_destroy(struct drm_crtc *crtc)
761761
nouveau_bo_unmap(nv_crtc->cursor.nvbo);
762762
nouveau_bo_unpin(nv_crtc->cursor.nvbo);
763763
nouveau_bo_ref(NULL, &nv_crtc->cursor.nvbo);
764-
nvif_notify_dtor(&nv_crtc->vblank);
764+
nvif_event_dtor(&nv_crtc->vblank);
765+
nvif_head_dtor(&nv_crtc->head);
765766
kfree(nv_crtc);
766767
}
767768

@@ -914,14 +915,6 @@ nv04_crtc_mode_set_base_atomic(struct drm_crtc *crtc,
914915
struct drm_framebuffer *fb,
915916
int x, int y, enum mode_set_atomic state)
916917
{
917-
struct nouveau_drm *drm = nouveau_drm(crtc->dev);
918-
struct drm_device *dev = drm->dev;
919-
920-
if (state == ENTER_ATOMIC_MODE_SET)
921-
nouveau_fbcon_accel_save_disable(dev);
922-
else
923-
nouveau_fbcon_accel_restore(dev);
924-
925918
return nv04_crtc_do_mode_set_base(crtc, fb, x, y, true);
926919
}
927920

@@ -1080,10 +1073,10 @@ nv04_finish_page_flip(struct nouveau_channel *chan,
10801073
}
10811074

10821075
int
1083-
nv04_flip_complete(struct nvif_notify *notify)
1076+
nv04_flip_complete(struct nvif_event *event, void *argv, u32 argc)
10841077
{
1085-
struct nouveau_cli *cli = (void *)notify->object->client;
1086-
struct nouveau_drm *drm = cli->drm;
1078+
struct nv04_display *disp = container_of(event, typeof(*disp), flip);
1079+
struct nouveau_drm *drm = disp->drm;
10871080
struct nouveau_channel *chan = drm->channel;
10881081
struct nv04_page_flip_state state;
10891082

@@ -1094,7 +1087,7 @@ nv04_flip_complete(struct nvif_notify *notify)
10941087
state.bpp / 8);
10951088
}
10961089

1097-
return NVIF_NOTIFY_KEEP;
1090+
return NVIF_EVENT_KEEP;
10981091
}
10991092

11001093
static int
@@ -1279,13 +1272,13 @@ static const struct drm_plane_funcs nv04_primary_plane_funcs = {
12791272
DRM_PLANE_NON_ATOMIC_FUNCS,
12801273
};
12811274

1282-
static int nv04_crtc_vblank_handler(struct nvif_notify *notify)
1275+
static int
1276+
nv04_crtc_vblank_handler(struct nvif_event *event, void *repv, u32 repc)
12831277
{
1284-
struct nouveau_crtc *nv_crtc =
1285-
container_of(notify, struct nouveau_crtc, vblank);
1278+
struct nouveau_crtc *nv_crtc = container_of(event, struct nouveau_crtc, vblank);
12861279

12871280
drm_crtc_handle_vblank(&nv_crtc->base);
1288-
return NVIF_NOTIFY_KEEP;
1281+
return NVIF_EVENT_KEEP;
12891282
}
12901283

12911284
int
@@ -1341,14 +1334,10 @@ nv04_crtc_create(struct drm_device *dev, int crtc_num)
13411334

13421335
nv04_cursor_init(nv_crtc);
13431336

1344-
ret = nvif_notify_ctor(&disp->disp.object, "kmsVbl", nv04_crtc_vblank_handler,
1345-
false, NV04_DISP_NTFY_VBLANK,
1346-
&(struct nvif_notify_head_req_v0) {
1347-
.head = nv_crtc->index,
1348-
},
1349-
sizeof(struct nvif_notify_head_req_v0),
1350-
sizeof(struct nvif_notify_head_rep_v0),
1351-
&nv_crtc->vblank);
1337+
ret = nvif_head_ctor(&disp->disp, nv_crtc->base.name, nv_crtc->index, &nv_crtc->head);
1338+
if (ret)
1339+
return ret;
13521340

1353-
return ret;
1341+
return nvif_head_vblank_event_ctor(&nv_crtc->head, "kmsVbl", nv04_crtc_vblank_handler,
1342+
false, &nv_crtc->vblank);
13541343
}

drivers/gpu/drm/nouveau/dispnv04/disp.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ nv04_display_fini(struct drm_device *dev, bool runtime, bool suspend)
6161
struct drm_crtc *crtc;
6262

6363
/* Disable flip completion events. */
64-
nvif_notify_put(&disp->flip);
64+
nvif_event_block(&disp->flip);
6565

6666
/* Disable vblank interrupts. */
6767
NVWriteCRTC(dev, 0, NV_PCRTC_INTR_EN_0, 0);
@@ -121,7 +121,7 @@ nv04_display_init(struct drm_device *dev, bool resume, bool runtime)
121121
encoder->enc_save(&encoder->base.base);
122122

123123
/* Enable flip completion events. */
124-
nvif_notify_get(&disp->flip);
124+
nvif_event_allow(&disp->flip);
125125

126126
if (!resume)
127127
return 0;
@@ -202,7 +202,7 @@ nv04_display_destroy(struct drm_device *dev)
202202

203203
nouveau_hw_save_vga_fonts(dev, 0);
204204

205-
nvif_notify_dtor(&disp->flip);
205+
nvif_event_dtor(&disp->flip);
206206

207207
nouveau_display(dev)->priv = NULL;
208208
vfree(disp);
@@ -227,6 +227,8 @@ nv04_display_create(struct drm_device *dev)
227227
if (!disp)
228228
return -ENOMEM;
229229

230+
disp->drm = drm;
231+
230232
nvif_object_map(&drm->client.device.object, NULL, 0);
231233

232234
nouveau_display(dev)->priv = disp;
@@ -239,9 +241,10 @@ nv04_display_create(struct drm_device *dev)
239241

240242
/* Request page flip completion event. */
241243
if (drm->channel) {
242-
nvif_notify_ctor(&drm->channel->nvsw, "kmsFlip", nv04_flip_complete,
243-
false, NV04_NVSW_NTFY_UEVENT,
244-
NULL, 0, 0, &disp->flip);
244+
ret = nvif_event_ctor(&drm->channel->nvsw, "kmsFlip", 0, nv04_flip_complete,
245+
true, NULL, 0, &disp->flip);
246+
if (ret)
247+
return ret;
245248
}
246249

247250
nouveau_hw_save_vga_fonts(dev, 1);

drivers/gpu/drm/nouveau/dispnv04/disp.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
#include "nouveau_display.h"
88

9+
#include <nvif/event.h>
10+
911
struct nouveau_encoder;
1012

1113
enum nv04_fp_display_regs {
@@ -84,7 +86,8 @@ struct nv04_display {
8486
uint32_t saved_vga_font[4][16384];
8587
uint32_t dac_users[4];
8688
struct nouveau_bo *image[2];
87-
struct nvif_notify flip;
89+
struct nvif_event flip;
90+
struct nouveau_drm *drm;
8891
};
8992

9093
static inline struct nv04_display *
@@ -179,5 +182,5 @@ nouveau_bios_run_init_table(struct drm_device *dev, u16 table,
179182
);
180183
}
181184

182-
int nv04_flip_complete(struct nvif_notify *);
185+
int nv04_flip_complete(struct nvif_event *, void *, u32);
183186
#endif

drivers/gpu/drm/nouveau/dispnv50/crc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ void nv50_crc_atomic_set(struct nv50_head *head,
463463
if (!outp)
464464
return;
465465

466-
func->set_src(head, outp->or, nv50_crc_source_type(outp, asyh->crc.src),
466+
func->set_src(head, outp->outp.or.id, nv50_crc_source_type(outp, asyh->crc.src),
467467
&crc->ctx[crc->ctx_idx]);
468468
}
469469

0 commit comments

Comments
 (0)