Skip to content

Commit fc01d1f

Browse files
committed
Merge branch 'linux-5.9' of git://github.com/skeggsb/linux into drm-next
- Conversion of all push buffer emission to a new set of macros, with better safety, sanity-checking, debug ability, and the use of NVIDIA's class headers. The headers have been trimmed to just what we use as they're rather extensive, the full versions can be found on NVIDIA's github[1]. - Proper push buffer space management for EVO/NVD channels. - Fixes to firmware loading behaviour in odd situations (various combinations of missing/incompatible FW). - runpm reference leak fixes - crc compile fixes without debugfs - 2MiB system memory pages support on Pascal and newer - misc other cleanups Signed-off-by: Dave Airlie <[email protected]> From: Ben Skeggs <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/ <CACAvsv6XYgiXDK6TpvsjMo+8AkrMw7ZxmA=vKk6Gd-xuv6txBA@mail.gmail.com
2 parents 3afe676 + 0059a90 commit fc01d1f

File tree

217 files changed

+9921
-2945
lines changed

Some content is hidden

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

217 files changed

+9921
-2945
lines changed

drivers/gpu/drm/nouveau/Kbuild

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@ nouveau-y += nouveau_vga.o
3232

3333
# DRM - memory management
3434
nouveau-y += nouveau_bo.o
35+
nouveau-y += nouveau_bo0039.o
36+
nouveau-y += nouveau_bo5039.o
37+
nouveau-y += nouveau_bo74c1.o
38+
nouveau-y += nouveau_bo85b5.o
39+
nouveau-y += nouveau_bo9039.o
40+
nouveau-y += nouveau_bo90b5.o
41+
nouveau-y += nouveau_boa0b5.o
3542
nouveau-y += nouveau_gem.o
3643
nouveau-$(CONFIG_DRM_NOUVEAU_SVM) += nouveau_svm.o
3744
nouveau-$(CONFIG_DRM_NOUVEAU_SVM) += nouveau_dmem.o

drivers/gpu/drm/nouveau/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,14 @@ config NOUVEAU_DEBUG_MMU
7676
help
7777
Say Y here if you want to enable verbose MMU debug output.
7878

79+
config NOUVEAU_DEBUG_PUSH
80+
bool "Enable additional push buffer debugging"
81+
depends on DRM_NOUVEAU
82+
default n
83+
help
84+
Say Y here if you want to enable verbose push buffer debug output
85+
and sanity checks.
86+
7987
config DRM_NOUVEAU_BACKLIGHT
8088
bool "Support for backlight control"
8189
depends on DRM_NOUVEAU

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

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@
4444
#include <subdev/bios/pll.h>
4545
#include <subdev/clk.h>
4646

47+
#include <nvif/push006c.h>
48+
4749
#include <nvif/event.h>
4850
#include <nvif/cl0046.h>
4951

@@ -759,7 +761,7 @@ static void nv_crtc_destroy(struct drm_crtc *crtc)
759761
nouveau_bo_unmap(nv_crtc->cursor.nvbo);
760762
nouveau_bo_unpin(nv_crtc->cursor.nvbo);
761763
nouveau_bo_ref(NULL, &nv_crtc->cursor.nvbo);
762-
nvif_notify_fini(&nv_crtc->vblank);
764+
nvif_notify_dtor(&nv_crtc->vblank);
763765
kfree(nv_crtc);
764766
}
765767

@@ -1105,6 +1107,7 @@ nv04_page_flip_emit(struct nouveau_channel *chan,
11051107
struct nouveau_fence_chan *fctx = chan->fence;
11061108
struct nouveau_drm *drm = chan->drm;
11071109
struct drm_device *dev = drm->dev;
1110+
struct nvif_push *push = chan->chan.push;
11081111
unsigned long flags;
11091112
int ret;
11101113

@@ -1119,13 +1122,12 @@ nv04_page_flip_emit(struct nouveau_channel *chan,
11191122
goto fail;
11201123

11211124
/* Emit the pageflip */
1122-
ret = RING_SPACE(chan, 2);
1125+
ret = PUSH_WAIT(push, 2);
11231126
if (ret)
11241127
goto fail;
11251128

1126-
BEGIN_NV04(chan, NvSubSw, NV_SW_PAGE_FLIP, 1);
1127-
OUT_RING (chan, 0x00000000);
1128-
FIRE_RING (chan);
1129+
PUSH_NVSQ(push, NV_SW, NV_SW_PAGE_FLIP, 0x00000000);
1130+
PUSH_KICK(push);
11291131

11301132
ret = nouveau_fence_new(chan, false, pfence);
11311133
if (ret)
@@ -1155,13 +1157,15 @@ nv04_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb,
11551157
struct nouveau_cli *cli;
11561158
struct nouveau_fence *fence;
11571159
struct nv04_display *dispnv04 = nv04_display(dev);
1160+
struct nvif_push *push;
11581161
int head = nouveau_crtc(crtc)->index;
11591162
int ret;
11601163

11611164
chan = drm->channel;
11621165
if (!chan)
11631166
return -ENODEV;
11641167
cli = (void *)chan->user.client;
1168+
push = chan->chan.push;
11651169

11661170
s = kzalloc(sizeof(*s), GFP_KERNEL);
11671171
if (!s)
@@ -1203,18 +1207,14 @@ nv04_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb,
12031207

12041208
/* Emit a page flip */
12051209
if (swap_interval) {
1206-
ret = RING_SPACE(chan, 8);
1210+
ret = PUSH_WAIT(push, 8);
12071211
if (ret)
12081212
goto fail_unreserve;
12091213

1210-
BEGIN_NV04(chan, NvSubImageBlit, 0x012c, 1);
1211-
OUT_RING (chan, 0);
1212-
BEGIN_NV04(chan, NvSubImageBlit, 0x0134, 1);
1213-
OUT_RING (chan, head);
1214-
BEGIN_NV04(chan, NvSubImageBlit, 0x0100, 1);
1215-
OUT_RING (chan, 0);
1216-
BEGIN_NV04(chan, NvSubImageBlit, 0x0130, 1);
1217-
OUT_RING (chan, 0);
1214+
PUSH_NVSQ(push, NV05F, 0x012c, 0);
1215+
PUSH_NVSQ(push, NV05F, 0x0134, head);
1216+
PUSH_NVSQ(push, NV05F, 0x0100, 0);
1217+
PUSH_NVSQ(push, NV05F, 0x0130, 0);
12181218
}
12191219

12201220
nouveau_bo_ref(new_bo, &dispnv04->image[head]);
@@ -1351,7 +1351,7 @@ nv04_crtc_create(struct drm_device *dev, int crtc_num)
13511351

13521352
nv04_cursor_init(nv_crtc);
13531353

1354-
ret = nvif_notify_init(&disp->disp.object, nv04_crtc_vblank_handler,
1354+
ret = nvif_notify_ctor(&disp->disp.object, "kmsVbl", nv04_crtc_vblank_handler,
13551355
false, NV04_DISP_NTFY_VBLANK,
13561356
&(struct nvif_notify_head_req_v0) {
13571357
.head = nv_crtc->index,

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include "nouveau_connector.h"
3232
#include "nouveau_bo.h"
3333
#include "nouveau_gem.h"
34+
#include "nouveau_chan.h"
3435

3536
#include <nvif/if0004.h>
3637

@@ -178,7 +179,7 @@ nv04_display_destroy(struct drm_device *dev)
178179

179180
nouveau_hw_save_vga_fonts(dev, 0);
180181

181-
nvif_notify_fini(&disp->flip);
182+
nvif_notify_dtor(&disp->flip);
182183

183184
nouveau_display(dev)->priv = NULL;
184185
kfree(disp);
@@ -214,8 +215,8 @@ nv04_display_create(struct drm_device *dev)
214215
dev->driver_features &= ~DRIVER_ATOMIC;
215216

216217
/* Request page flip completion event. */
217-
if (drm->nvsw.client) {
218-
nvif_notify_init(&drm->nvsw, nv04_flip_complete,
218+
if (drm->channel) {
219+
nvif_notify_ctor(&drm->channel->nvsw, "kmsFlip", nv04_flip_complete,
219220
false, NV04_NVSW_NTFY_UEVENT,
220221
NULL, 0, 0, &disp->flip);
221222
}

drivers/gpu/drm/nouveau/dispnv50/base.h

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,10 @@ int base507c_acquire(struct nv50_wndw *, struct nv50_wndw_atom *,
1111
struct nv50_head_atom *);
1212
void base507c_release(struct nv50_wndw *, struct nv50_wndw_atom *,
1313
struct nv50_head_atom *);
14-
void base507c_sema_set(struct nv50_wndw *, struct nv50_wndw_atom *);
15-
void base507c_sema_clr(struct nv50_wndw *);
16-
void base507c_ntfy_set(struct nv50_wndw *, struct nv50_wndw_atom *);
17-
void base507c_ntfy_clr(struct nv50_wndw *);
18-
void base507c_xlut_set(struct nv50_wndw *, struct nv50_wndw_atom *);
19-
void base507c_xlut_clr(struct nv50_wndw *);
20-
void base507c_image_clr(struct nv50_wndw *);
21-
void base507c_update(struct nv50_wndw *, u32 *);
14+
int base507c_sema_set(struct nv50_wndw *, struct nv50_wndw_atom *);
15+
int base507c_sema_clr(struct nv50_wndw *);
16+
int base507c_xlut_set(struct nv50_wndw *, struct nv50_wndw_atom *);
17+
int base507c_xlut_clr(struct nv50_wndw *);
2218

2319
int base827c_new(struct nouveau_drm *, int, s32, struct nv50_wndw **);
2420

0 commit comments

Comments
 (0)