Skip to content

Commit 56c36f5

Browse files
Ben Skeggsairlied
authored andcommitted
drm/nouveau/gsp: add hal for fifo.chan.doorbell_handle
The doorbell register on GB20x GPUs has additional fields. Signed-off-by: Ben Skeggs <[email protected]> Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Timur Tabi <[email protected]> Tested-by: Timur Tabi <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
1 parent 32cb1cc commit 56c36f5

File tree

10 files changed

+25
-2
lines changed

10 files changed

+25
-2
lines changed

drivers/gpu/drm/nouveau/nvkm/engine/fifo/priv.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include <core/enum.h>
77
struct nvkm_cctx;
88
struct nvkm_cgrp;
9+
struct nvkm_chan;
910
struct nvkm_engn;
1011
struct nvkm_memory;
1112
struct nvkm_runl;
@@ -195,6 +196,7 @@ extern const struct nvkm_chan_func_ramfc gv100_chan_ramfc;
195196

196197
void tu102_fifo_intr_ctxsw_timeout_info(struct nvkm_engn *, u32 info);
197198
extern const struct nvkm_fifo_func_mmu_fault tu102_fifo_mmu_fault;
199+
u32 tu102_chan_doorbell_handle(struct nvkm_chan *);
198200

199201
int ga100_fifo_runl_ctor(struct nvkm_fifo *);
200202
int ga100_fifo_nonstall_ctor(struct nvkm_fifo *);

drivers/gpu/drm/nouveau/nvkm/engine/fifo/tu102.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
#include <nvif/class.h>
3333

34-
static u32
34+
u32
3535
tu102_chan_doorbell_handle(struct nvkm_chan *chan)
3636
{
3737
return (chan->cgrp->runl->id << 16) | chan->id;

drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/ad10x.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
*/
55
#include "gpu.h"
66

7+
#include <engine/fifo/priv.h>
8+
79
#include <nvif/class.h>
810

911
const struct nvkm_rm_gpu
@@ -21,6 +23,7 @@ ad10x_gpu = {
2123

2224
.fifo.chan = {
2325
.class = AMPERE_CHANNEL_GPFIFO_A,
26+
.doorbell_handle = tu102_chan_doorbell_handle,
2427
},
2528

2629
.ce.class = AMPERE_DMA_COPY_B,

drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/ga100.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
*/
55
#include "gpu.h"
66

7+
#include <engine/fifo/priv.h>
8+
79
#include <nvif/class.h>
810

911
const struct nvkm_rm_gpu
@@ -12,6 +14,7 @@ ga100_gpu = {
1214

1315
.fifo.chan = {
1416
.class = AMPERE_CHANNEL_GPFIFO_A,
17+
.doorbell_handle = tu102_chan_doorbell_handle,
1518
},
1619

1720
.ce.class = AMPERE_DMA_COPY_A,

drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/ga1xx.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
*/
55
#include "gpu.h"
66

7+
#include <engine/fifo/priv.h>
8+
79
#include <nvif/class.h>
810

911
const struct nvkm_rm_gpu
@@ -21,6 +23,7 @@ ga1xx_gpu = {
2123

2224
.fifo.chan = {
2325
.class = AMPERE_CHANNEL_GPFIFO_A,
26+
.doorbell_handle = tu102_chan_doorbell_handle,
2427
},
2528

2629
.ce.class = AMPERE_DMA_COPY_B,

drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/gb10x.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
*/
55
#include "gpu.h"
66

7+
#include <engine/fifo/priv.h>
8+
79
#include <nvif/class.h>
810

911
const struct nvkm_rm_gpu
@@ -12,6 +14,7 @@ gb10x_gpu = {
1214

1315
.fifo.chan = {
1416
.class = BLACKWELL_CHANNEL_GPFIFO_A,
17+
.doorbell_handle = tu102_chan_doorbell_handle,
1518
},
1619

1720
.ce.class = BLACKWELL_DMA_COPY_A,

drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/gh100.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
*/
55
#include "gpu.h"
66

7+
#include <engine/fifo/priv.h>
8+
79
#include <nvif/class.h>
810

911
const struct nvkm_rm_gpu
@@ -12,6 +14,7 @@ gh100_gpu = {
1214

1315
.fifo.chan = {
1416
.class = HOPPER_CHANNEL_GPFIFO_A,
17+
.doorbell_handle = tu102_chan_doorbell_handle,
1518
},
1619

1720
.ce.class = HOPPER_DMA_COPY_A,

drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/gpu.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ struct nvkm_rm_gpu {
2525
struct {
2626
struct {
2727
u32 class;
28+
u32 (*doorbell_handle)(struct nvkm_chan *);
2829
} chan;
2930
} fifo;
3031

drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/fifo.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@
4141
static u32
4242
r535_chan_doorbell_handle(struct nvkm_chan *chan)
4343
{
44-
return (chan->cgrp->runl->id << 16) | chan->id;
44+
struct nvkm_gsp *gsp = chan->rm.object.client->gsp;
45+
46+
return gsp->rm->gpu->fifo.chan.doorbell_handle(chan);
4547
}
4648

4749
static void

drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/tu1xx.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
*/
55
#include "gpu.h"
66

7+
#include <engine/fifo/priv.h>
8+
79
#include <nvif/class.h>
810

911
const struct nvkm_rm_gpu
@@ -21,6 +23,7 @@ tu1xx_gpu = {
2123

2224
.fifo.chan = {
2325
.class = TURING_CHANNEL_GPFIFO_A,
26+
.doorbell_handle = tu102_chan_doorbell_handle,
2427
},
2528

2629
.ce.class = TURING_DMA_COPY_A,

0 commit comments

Comments
 (0)