Skip to content

Commit 5dca433

Browse files
committed
Merge tag 'topic/drm-next-nouveau-r570-2025-05-19-1' of https://gitlab.freedesktop.org/drm/kernel into drm-next
drm/nouveau: r570 and hopper/blackwell support This series implements support for booting GSP-RM firmware version 570.144, and adds support for GH100, GB10x, and GB20x GPUs. Signed-off-by: Dave Airlie <[email protected]>
2 parents 7cf346f + 6cc6e08 commit 5dca433

File tree

343 files changed

+14630
-8101
lines changed

Some content is hidden

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

343 files changed

+14630
-8101
lines changed

drivers/gpu/drm/display/drm_dp_helper.c

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2137,14 +2137,17 @@ static int drm_dp_i2c_xfer(struct i2c_adapter *adapter, struct i2c_msg *msgs,
21372137

21382138
for (i = 0; i < num; i++) {
21392139
msg.address = msgs[i].addr;
2140-
drm_dp_i2c_msg_set_request(&msg, &msgs[i]);
2141-
/* Send a bare address packet to start the transaction.
2142-
* Zero sized messages specify an address only (bare
2143-
* address) transaction.
2144-
*/
2145-
msg.buffer = NULL;
2146-
msg.size = 0;
2147-
err = drm_dp_i2c_do_msg(aux, &msg);
2140+
2141+
if (!aux->no_zero_sized) {
2142+
drm_dp_i2c_msg_set_request(&msg, &msgs[i]);
2143+
/* Send a bare address packet to start the transaction.
2144+
* Zero sized messages specify an address only (bare
2145+
* address) transaction.
2146+
*/
2147+
msg.buffer = NULL;
2148+
msg.size = 0;
2149+
err = drm_dp_i2c_do_msg(aux, &msg);
2150+
}
21482151

21492152
/*
21502153
* Reset msg.request in case in case it got
@@ -2163,6 +2166,8 @@ static int drm_dp_i2c_xfer(struct i2c_adapter *adapter, struct i2c_msg *msgs,
21632166
msg.buffer = msgs[i].buf + j;
21642167
msg.size = min(transfer_size, msgs[i].len - j);
21652168

2169+
if (j + msg.size == msgs[i].len && aux->no_zero_sized)
2170+
msg.request &= ~DP_AUX_I2C_MOT;
21662171
err = drm_dp_i2c_drain_msg(aux, &msg);
21672172

21682173
/*
@@ -2180,15 +2185,17 @@ static int drm_dp_i2c_xfer(struct i2c_adapter *adapter, struct i2c_msg *msgs,
21802185
}
21812186
if (err >= 0)
21822187
err = num;
2183-
/* Send a bare address packet to close out the transaction.
2184-
* Zero sized messages specify an address only (bare
2185-
* address) transaction.
2186-
*/
2187-
msg.request &= ~DP_AUX_I2C_MOT;
2188-
msg.buffer = NULL;
2189-
msg.size = 0;
2190-
(void)drm_dp_i2c_do_msg(aux, &msg);
21912188

2189+
if (!aux->no_zero_sized) {
2190+
/* Send a bare address packet to close out the transaction.
2191+
* Zero sized messages specify an address only (bare
2192+
* address) transaction.
2193+
*/
2194+
msg.request &= ~DP_AUX_I2C_MOT;
2195+
msg.buffer = NULL;
2196+
msg.size = 0;
2197+
(void)drm_dp_i2c_do_msg(aux, &msg);
2198+
}
21922199
return err;
21932200
}
21942201

drivers/gpu/drm/nouveau/Kbuild

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
ccflags-y += -I $(src)/include
33
ccflags-y += -I $(src)/include/nvkm
44
ccflags-y += -I $(src)/nvkm
5+
ccflags-y += -I $(src)/nvkm/subdev/gsp
56
ccflags-y += -I $(src)
67

78
# NVKM - HW resource manager
@@ -68,5 +69,6 @@ nouveau-y += nv17_fence.o
6869
nouveau-y += nv50_fence.o
6970
nouveau-y += nv84_fence.o
7071
nouveau-y += nvc0_fence.o
72+
nouveau-y += gv100_fence.o
7173

7274
obj-$(CONFIG_DRM_NOUVEAU) += nouveau.o

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

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -768,9 +768,7 @@ static void nv_crtc_destroy(struct drm_crtc *crtc)
768768
disp->image[nv_crtc->index] = NULL;
769769
}
770770

771-
nouveau_bo_unmap(nv_crtc->cursor.nvbo);
772-
nouveau_bo_unpin(nv_crtc->cursor.nvbo);
773-
nouveau_bo_fini(nv_crtc->cursor.nvbo);
771+
nouveau_bo_unpin_del(&nv_crtc->cursor.nvbo);
774772
nvif_event_dtor(&nv_crtc->vblank);
775773
nvif_head_dtor(&nv_crtc->head);
776774
kfree(nv_crtc);
@@ -1303,6 +1301,7 @@ nv04_crtc_vblank_handler(struct nvif_event *event, void *repv, u32 repc)
13031301
int
13041302
nv04_crtc_create(struct drm_device *dev, int crtc_num)
13051303
{
1304+
struct nouveau_cli *cli = &nouveau_drm(dev)->client;
13061305
struct nouveau_display *disp = nouveau_display(dev);
13071306
struct nouveau_crtc *nv_crtc;
13081307
struct drm_plane *primary;
@@ -1336,20 +1335,9 @@ nv04_crtc_create(struct drm_device *dev, int crtc_num)
13361335
drm_crtc_helper_add(&nv_crtc->base, &nv04_crtc_helper_funcs);
13371336
drm_mode_crtc_set_gamma_size(&nv_crtc->base, 256);
13381337

1339-
ret = nouveau_bo_new(&nouveau_drm(dev)->client, 64*64*4, 0x100,
1340-
NOUVEAU_GEM_DOMAIN_VRAM, 0, 0x0000, NULL, NULL,
1341-
&nv_crtc->cursor.nvbo);
1342-
if (!ret) {
1343-
ret = nouveau_bo_pin(nv_crtc->cursor.nvbo,
1344-
NOUVEAU_GEM_DOMAIN_VRAM, false);
1345-
if (!ret) {
1346-
ret = nouveau_bo_map(nv_crtc->cursor.nvbo);
1347-
if (ret)
1348-
nouveau_bo_unpin(nv_crtc->cursor.nvbo);
1349-
}
1350-
if (ret)
1351-
nouveau_bo_fini(nv_crtc->cursor.nvbo);
1352-
}
1338+
ret = nouveau_bo_new_map(cli, NOUVEAU_GEM_DOMAIN_VRAM, 64 * 64 * 4, &nv_crtc->cursor.nvbo);
1339+
if (ret)
1340+
return ret;
13531341

13541342
nv04_cursor_init(nv_crtc);
13551343

drivers/gpu/drm/nouveau/dispnv50/Kbuild

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ nouveau-y += dispnv50/core907d.o
99
nouveau-y += dispnv50/core917d.o
1010
nouveau-y += dispnv50/corec37d.o
1111
nouveau-y += dispnv50/corec57d.o
12+
nouveau-y += dispnv50/coreca7d.o
1213

1314
nouveau-$(CONFIG_DEBUG_FS) += dispnv50/crc.o
1415
nouveau-$(CONFIG_DEBUG_FS) += dispnv50/crc907d.o
1516
nouveau-$(CONFIG_DEBUG_FS) += dispnv50/crcc37d.o
1617
nouveau-$(CONFIG_DEBUG_FS) += dispnv50/crcc57d.o
18+
nouveau-$(CONFIG_DEBUG_FS) += dispnv50/crcca7d.o
1719

1820
nouveau-y += dispnv50/dac507d.o
1921
nouveau-y += dispnv50/dac907d.o
@@ -31,6 +33,7 @@ nouveau-y += dispnv50/head907d.o
3133
nouveau-y += dispnv50/head917d.o
3234
nouveau-y += dispnv50/headc37d.o
3335
nouveau-y += dispnv50/headc57d.o
36+
nouveau-y += dispnv50/headca7d.o
3437

3538
nouveau-y += dispnv50/wimm.o
3639
nouveau-y += dispnv50/wimmc37b.o
@@ -39,6 +42,7 @@ nouveau-y += dispnv50/wndw.o
3942
nouveau-y += dispnv50/wndwc37e.o
4043
nouveau-y += dispnv50/wndwc57e.o
4144
nouveau-y += dispnv50/wndwc67e.o
45+
nouveau-y += dispnv50/wndwca7e.o
4246

4347
nouveau-y += dispnv50/base.o
4448
nouveau-y += dispnv50/base507c.o

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ nv50_core_new(struct nouveau_drm *drm, struct nv50_core **pcore)
4242
int version;
4343
int (*new)(struct nouveau_drm *, s32, struct nv50_core **);
4444
} cores[] = {
45+
{ GB202_DISP_CORE_CHANNEL_DMA, 0, coreca7d_new },
4546
{ AD102_DISP_CORE_CHANNEL_DMA, 0, corec57d_new },
4647
{ GA102_DISP_CORE_CHANNEL_DMA, 0, corec57d_new },
4748
{ TU102_DISP_CORE_CHANNEL_DMA, 0, corec57d_new },

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77

88
struct nv50_core {
99
const struct nv50_core_func *func;
10+
struct nv50_disp *disp;
11+
1012
struct nv50_dmac chan;
13+
1114
bool assign_windows;
1215
};
1316

@@ -18,6 +21,7 @@ struct nv50_core_func {
1821
int (*init)(struct nv50_core *);
1922
void (*ntfy_init)(struct nouveau_bo *, u32 offset);
2023
int (*caps_init)(struct nouveau_drm *, struct nv50_disp *);
24+
u32 caps_class;
2125
int (*ntfy_wait_done)(struct nouveau_bo *, u32 offset,
2226
struct nvif_device *);
2327
int (*update)(struct nv50_core *, u32 *interlock, bool ntfy);
@@ -70,4 +74,6 @@ int corec37d_wndw_owner(struct nv50_core *);
7074
extern const struct nv50_outp_func sorc37d;
7175

7276
int corec57d_new(struct nouveau_drm *, s32, struct nv50_core **);
77+
78+
int coreca7d_new(struct nouveau_drm *, s32, struct nv50_core **);
7379
#endif

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ core507d_new_(const struct nv50_core_func *func, struct nouveau_drm *drm,
165165
if (!(core = *pcore = kzalloc(sizeof(*core), GFP_KERNEL)))
166166
return -ENOMEM;
167167
core->func = func;
168+
core->disp = disp;
168169

169170
ret = nv50_dmac_create(drm,
170171
&oclass, 0, &args, sizeof(args),

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ int corec37d_caps_init(struct nouveau_drm *drm, struct nv50_disp *disp)
105105
int ret;
106106

107107
ret = nvif_object_ctor(&disp->disp->object, "dispCaps", 0,
108-
GV100_DISP_CAPS, NULL, 0, &disp->caps);
108+
disp->core->func->caps_class, NULL, 0, &disp->caps);
109109
if (ret) {
110110
NV_ERROR(drm,
111111
"Failed to init notifier caps region: %d\n",
@@ -162,6 +162,7 @@ corec37d = {
162162
.init = corec37d_init,
163163
.ntfy_init = corec37d_ntfy_init,
164164
.caps_init = corec37d_caps_init,
165+
.caps_class = GV100_DISP_CAPS,
165166
.ntfy_wait_done = corec37d_ntfy_wait_done,
166167
.update = corec37d_update,
167168
.wndw.owner = corec37d_wndw_owner,

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "core.h"
2323
#include "head.h"
2424

25+
#include <nvif/class.h>
2526
#include <nvif/pushc37b.h>
2627

2728
#include <nvhw/class/clc57d.h>
@@ -63,6 +64,7 @@ corec57d = {
6364
.init = corec57d_init,
6465
.ntfy_init = corec37d_ntfy_init,
6566
.caps_init = corec37d_caps_init,
67+
.caps_class = GV100_DISP_CAPS,
6668
.ntfy_wait_done = corec37d_ntfy_wait_done,
6769
.update = corec37d_update,
6870
.wndw.owner = corec37d_wndw_owner,
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
/* SPDX-License-Identifier: MIT
2+
*
3+
* Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.
4+
*/
5+
#include "core.h"
6+
#include "head.h"
7+
8+
#include <nvif/class.h>
9+
#include <nvif/pushc97b.h>
10+
11+
#include <nvhw/class/clca7d.h>
12+
13+
#include <nouveau_bo.h>
14+
15+
static int
16+
coreca7d_update(struct nv50_core *core, u32 *interlock, bool ntfy)
17+
{
18+
const u64 ntfy_addr = core->disp->sync->offset + NV50_DISP_CORE_NTFY;
19+
const u32 ntfy_hi = upper_32_bits(ntfy_addr);
20+
const u32 ntfy_lo = lower_32_bits(ntfy_addr);
21+
struct nvif_push *push = &core->chan.push;
22+
int ret;
23+
24+
ret = PUSH_WAIT(push, 5 + (ntfy ? 5 + 2 : 0));
25+
if (ret)
26+
return ret;
27+
28+
if (ntfy) {
29+
PUSH_MTHD(push, NVCA7D, SET_SURFACE_ADDRESS_HI_NOTIFIER, ntfy_hi,
30+
31+
SET_SURFACE_ADDRESS_LO_NOTIFIER,
32+
NVVAL(NVCA7D, SET_SURFACE_ADDRESS_LO_NOTIFIER, ADDRESS_LO, ntfy_lo >> 4) |
33+
NVDEF(NVCA7D, SET_SURFACE_ADDRESS_LO_NOTIFIER, TARGET, PHYSICAL_NVM) |
34+
NVDEF(NVCA7D, SET_SURFACE_ADDRESS_LO_NOTIFIER, ENABLE, ENABLE));
35+
36+
PUSH_MTHD(push, NVCA7D, SET_NOTIFIER_CONTROL,
37+
NVDEF(NVCA7D, SET_NOTIFIER_CONTROL, MODE, WRITE) |
38+
NVDEF(NVCA7D, SET_NOTIFIER_CONTROL, NOTIFY, ENABLE));
39+
}
40+
41+
PUSH_MTHD(push, NVCA7D, SET_INTERLOCK_FLAGS, interlock[NV50_DISP_INTERLOCK_CURS],
42+
SET_WINDOW_INTERLOCK_FLAGS, interlock[NV50_DISP_INTERLOCK_WNDW]);
43+
44+
PUSH_MTHD(push, NVCA7D, UPDATE,
45+
NVDEF(NVCA7D, UPDATE, RELEASE_ELV, TRUE) |
46+
NVDEF(NVCA7D, UPDATE, SPECIAL_HANDLING, NONE) |
47+
NVDEF(NVCA7D, UPDATE, INHIBIT_INTERRUPTS, FALSE));
48+
49+
if (ntfy) {
50+
PUSH_MTHD(push, NVCA7D, SET_NOTIFIER_CONTROL,
51+
NVDEF(NVCA7D, SET_NOTIFIER_CONTROL, NOTIFY, DISABLE));
52+
}
53+
54+
return PUSH_KICK(push);
55+
}
56+
57+
static int
58+
coreca7d_init(struct nv50_core *core)
59+
{
60+
struct nvif_push *push = &core->chan.push;
61+
const u32 windows = 8, heads = 4;
62+
int ret, i;
63+
64+
ret = PUSH_WAIT(push, windows * 6 + heads * 6);
65+
if (ret)
66+
return ret;
67+
68+
for (i = 0; i < windows; i++) {
69+
PUSH_MTHD(push, NVCA7D, WINDOW_SET_WINDOW_FORMAT_USAGE_BOUNDS(i),
70+
NVDEF(NVCA7D, WINDOW_SET_WINDOW_FORMAT_USAGE_BOUNDS, RGB_PACKED1BPP, TRUE) |
71+
NVDEF(NVCA7D, WINDOW_SET_WINDOW_FORMAT_USAGE_BOUNDS, RGB_PACKED2BPP, TRUE) |
72+
NVDEF(NVCA7D, WINDOW_SET_WINDOW_FORMAT_USAGE_BOUNDS, RGB_PACKED4BPP, TRUE) |
73+
NVDEF(NVCA7D, WINDOW_SET_WINDOW_FORMAT_USAGE_BOUNDS, RGB_PACKED8BPP, TRUE),
74+
75+
WINDOW_SET_WINDOW_ROTATED_FORMAT_USAGE_BOUNDS(i), 0x00000000);
76+
77+
PUSH_MTHD(push, NVCA7D, WINDOW_SET_WINDOW_USAGE_BOUNDS(i),
78+
NVVAL(NVCA7D, WINDOW_SET_WINDOW_USAGE_BOUNDS, MAX_PIXELS_FETCHED_PER_LINE, 0x7fff) |
79+
NVDEF(NVCA7D, WINDOW_SET_WINDOW_USAGE_BOUNDS, ILUT_ALLOWED, TRUE) |
80+
NVDEF(NVCA7D, WINDOW_SET_WINDOW_USAGE_BOUNDS, INPUT_SCALER_TAPS, TAPS_2) |
81+
NVDEF(NVCA7D, WINDOW_SET_WINDOW_USAGE_BOUNDS, UPSCALING_ALLOWED, FALSE),
82+
83+
WINDOW_SET_PHYSICAL(i), BIT(i));
84+
}
85+
86+
for (i = 0; i < heads; i++) {
87+
PUSH_MTHD(push, NVCA7D, HEAD_SET_HEAD_USAGE_BOUNDS(i),
88+
NVDEF(NVCA7D, HEAD_SET_HEAD_USAGE_BOUNDS, CURSOR, USAGE_W256_H256) |
89+
NVDEF(NVCA7D, HEAD_SET_HEAD_USAGE_BOUNDS, OLUT_ALLOWED, TRUE) |
90+
NVDEF(NVCA7D, HEAD_SET_HEAD_USAGE_BOUNDS, OUTPUT_SCALER_TAPS, TAPS_2) |
91+
NVDEF(NVCA7D, HEAD_SET_HEAD_USAGE_BOUNDS, UPSCALING_ALLOWED, TRUE));
92+
93+
PUSH_MTHD(push, NVCA7D, HEAD_SET_TILE_MASK(i), BIT(i));
94+
95+
PUSH_MTHD(push, NVCA7D, TILE_SET_TILE_SIZE(i), 0);
96+
}
97+
98+
core->assign_windows = true;
99+
return PUSH_KICK(push);
100+
}
101+
102+
static const struct nv50_core_func
103+
coreca7d = {
104+
.init = coreca7d_init,
105+
.ntfy_init = corec37d_ntfy_init,
106+
.caps_init = corec37d_caps_init,
107+
.caps_class = GB202_DISP_CAPS,
108+
.ntfy_wait_done = corec37d_ntfy_wait_done,
109+
.update = coreca7d_update,
110+
.wndw.owner = corec37d_wndw_owner,
111+
.head = &headca7d,
112+
.sor = &sorc37d,
113+
#if IS_ENABLED(CONFIG_DEBUG_FS)
114+
.crc = &crcca7d,
115+
#endif
116+
};
117+
118+
int
119+
coreca7d_new(struct nouveau_drm *drm, s32 oclass, struct nv50_core **pcore)
120+
{
121+
return core507d_new_(&coreca7d, drm, oclass, pcore);
122+
}

0 commit comments

Comments
 (0)