Skip to content

Commit 8c186c8

Browse files
Ben Skeggsairlied
authored andcommitted
drm/nouveau/disp/tu102-: prepare for GSP-RM
- (temporarily) disable if GSP-RM detected, will be added later - pass "suspend" flag down to chipset-specific DISP code Signed-off-by: Ben Skeggs <[email protected]> Signed-off-by: Dave Airlie <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 0e55453 commit 8c186c8

File tree

7 files changed

+21
-9
lines changed

7 files changed

+21
-9
lines changed

drivers/gpu/drm/nouveau/nvkm/engine/disp/base.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ nvkm_disp_fini(struct nvkm_engine *engine, bool suspend)
105105
struct nvkm_outp *outp;
106106

107107
if (disp->func->fini)
108-
disp->func->fini(disp);
108+
disp->func->fini(disp, suspend);
109109

110110
list_for_each_entry(outp, &disp->outps, head) {
111111
if (outp->func->fini)
@@ -208,6 +208,9 @@ nvkm_disp_dtor(struct nvkm_engine *engine)
208208
nvkm_head_del(&head);
209209
}
210210

211+
if (disp->func->dtor)
212+
disp->func->dtor(disp);
213+
211214
return data;
212215
}
213216

drivers/gpu/drm/nouveau/nvkm/engine/disp/ga102.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "head.h"
2525
#include "ior.h"
2626

27+
#include <subdev/gsp.h>
2728
#include <subdev/timer.h>
2829

2930
#include <nvif/class.h>
@@ -147,5 +148,8 @@ int
147148
ga102_disp_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
148149
struct nvkm_disp **pdisp)
149150
{
151+
if (nvkm_gsp_rm(device->gsp))
152+
return -ENODEV;
153+
150154
return nvkm_disp_new_(&ga102_disp, device, type, inst, pdisp);
151155
}

drivers/gpu/drm/nouveau/nvkm/engine/disp/gf119.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1154,7 +1154,7 @@ gf119_disp_intr(struct nvkm_disp *disp)
11541154
}
11551155

11561156
void
1157-
gf119_disp_fini(struct nvkm_disp *disp)
1157+
gf119_disp_fini(struct nvkm_disp *disp, bool suspend)
11581158
{
11591159
struct nvkm_device *device = disp->engine.subdev.device;
11601160
/* disable all interrupts */

drivers/gpu/drm/nouveau/nvkm/engine/disp/gv100.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1115,7 +1115,7 @@ gv100_disp_intr(struct nvkm_disp *disp)
11151115
}
11161116

11171117
void
1118-
gv100_disp_fini(struct nvkm_disp *disp)
1118+
gv100_disp_fini(struct nvkm_disp *disp, bool suspend)
11191119
{
11201120
struct nvkm_device *device = disp->engine.subdev.device;
11211121
nvkm_wr32(device, 0x611db0, 0x00000000);

drivers/gpu/drm/nouveau/nvkm/engine/disp/nv50.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1504,7 +1504,7 @@ nv50_disp_intr(struct nvkm_disp *disp)
15041504
}
15051505

15061506
void
1507-
nv50_disp_fini(struct nvkm_disp *disp)
1507+
nv50_disp_fini(struct nvkm_disp *disp, bool suspend)
15081508
{
15091509
struct nvkm_device *device = disp->engine.subdev.device;
15101510
/* disable all interrupts */

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ int nvkm_disp_new_(const struct nvkm_disp_func *, struct nvkm_device *, enum nvk
1515
void nvkm_disp_vblank(struct nvkm_disp *, int head);
1616

1717
struct nvkm_disp_func {
18+
void (*dtor)(struct nvkm_disp *);
1819
int (*oneinit)(struct nvkm_disp *);
1920
int (*init)(struct nvkm_disp *);
20-
void (*fini)(struct nvkm_disp *);
21+
void (*fini)(struct nvkm_disp *, bool suspend);
2122
void (*intr)(struct nvkm_disp *);
2223
void (*intr_error)(struct nvkm_disp *, int chid);
2324

@@ -32,7 +33,7 @@ struct nvkm_disp_func {
3233

3334
u16 ramht_size;
3435

35-
const struct nvkm_sclass root;
36+
struct nvkm_sclass root;
3637

3738
struct nvkm_disp_user {
3839
struct nvkm_sclass base;
@@ -44,7 +45,7 @@ struct nvkm_disp_func {
4445

4546
int nv50_disp_oneinit(struct nvkm_disp *);
4647
int nv50_disp_init(struct nvkm_disp *);
47-
void nv50_disp_fini(struct nvkm_disp *);
48+
void nv50_disp_fini(struct nvkm_disp *, bool suspend);
4849
void nv50_disp_intr(struct nvkm_disp *);
4950
extern const struct nvkm_enum nv50_disp_intr_error_type[];
5051
void nv50_disp_super(struct work_struct *);
@@ -56,12 +57,12 @@ void nv50_disp_super_2_2(struct nvkm_disp *, struct nvkm_head *);
5657
void nv50_disp_super_3_0(struct nvkm_disp *, struct nvkm_head *);
5758

5859
int gf119_disp_init(struct nvkm_disp *);
59-
void gf119_disp_fini(struct nvkm_disp *);
60+
void gf119_disp_fini(struct nvkm_disp *, bool suspend);
6061
void gf119_disp_intr(struct nvkm_disp *);
6162
void gf119_disp_super(struct work_struct *);
6263
void gf119_disp_intr_error(struct nvkm_disp *, int);
6364

64-
void gv100_disp_fini(struct nvkm_disp *);
65+
void gv100_disp_fini(struct nvkm_disp *, bool suspend);
6566
void gv100_disp_intr(struct nvkm_disp *);
6667
void gv100_disp_super(struct work_struct *);
6768
int gv100_disp_wndw_cnt(struct nvkm_disp *, unsigned long *);

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include "ior.h"
2626

2727
#include <core/gpuobj.h>
28+
#include <subdev/gsp.h>
2829
#include <subdev/timer.h>
2930

3031
#include <nvif/class.h>
@@ -233,5 +234,8 @@ int
233234
tu102_disp_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
234235
struct nvkm_disp **pdisp)
235236
{
237+
if (nvkm_gsp_rm(device->gsp))
238+
return -ENODEV;
239+
236240
return nvkm_disp_new_(&tu102_disp, device, type, inst, pdisp);
237241
}

0 commit comments

Comments
 (0)