Commit 8c186c83 authored by Ben Skeggs's avatar Ben Skeggs Committed by Dave Airlie

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: default avatarBen Skeggs <bskeggs@redhat.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230918202149.4343-25-skeggsb@gmail.com
parent 0e55453f
...@@ -105,7 +105,7 @@ nvkm_disp_fini(struct nvkm_engine *engine, bool suspend) ...@@ -105,7 +105,7 @@ nvkm_disp_fini(struct nvkm_engine *engine, bool suspend)
struct nvkm_outp *outp; struct nvkm_outp *outp;
if (disp->func->fini) if (disp->func->fini)
disp->func->fini(disp); disp->func->fini(disp, suspend);
list_for_each_entry(outp, &disp->outps, head) { list_for_each_entry(outp, &disp->outps, head) {
if (outp->func->fini) if (outp->func->fini)
...@@ -208,6 +208,9 @@ nvkm_disp_dtor(struct nvkm_engine *engine) ...@@ -208,6 +208,9 @@ nvkm_disp_dtor(struct nvkm_engine *engine)
nvkm_head_del(&head); nvkm_head_del(&head);
} }
if (disp->func->dtor)
disp->func->dtor(disp);
return data; return data;
} }
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include "head.h" #include "head.h"
#include "ior.h" #include "ior.h"
#include <subdev/gsp.h>
#include <subdev/timer.h> #include <subdev/timer.h>
#include <nvif/class.h> #include <nvif/class.h>
...@@ -147,5 +148,8 @@ int ...@@ -147,5 +148,8 @@ int
ga102_disp_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, ga102_disp_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
struct nvkm_disp **pdisp) struct nvkm_disp **pdisp)
{ {
if (nvkm_gsp_rm(device->gsp))
return -ENODEV;
return nvkm_disp_new_(&ga102_disp, device, type, inst, pdisp); return nvkm_disp_new_(&ga102_disp, device, type, inst, pdisp);
} }
...@@ -1154,7 +1154,7 @@ gf119_disp_intr(struct nvkm_disp *disp) ...@@ -1154,7 +1154,7 @@ gf119_disp_intr(struct nvkm_disp *disp)
} }
void void
gf119_disp_fini(struct nvkm_disp *disp) gf119_disp_fini(struct nvkm_disp *disp, bool suspend)
{ {
struct nvkm_device *device = disp->engine.subdev.device; struct nvkm_device *device = disp->engine.subdev.device;
/* disable all interrupts */ /* disable all interrupts */
......
...@@ -1115,7 +1115,7 @@ gv100_disp_intr(struct nvkm_disp *disp) ...@@ -1115,7 +1115,7 @@ gv100_disp_intr(struct nvkm_disp *disp)
} }
void void
gv100_disp_fini(struct nvkm_disp *disp) gv100_disp_fini(struct nvkm_disp *disp, bool suspend)
{ {
struct nvkm_device *device = disp->engine.subdev.device; struct nvkm_device *device = disp->engine.subdev.device;
nvkm_wr32(device, 0x611db0, 0x00000000); nvkm_wr32(device, 0x611db0, 0x00000000);
......
...@@ -1504,7 +1504,7 @@ nv50_disp_intr(struct nvkm_disp *disp) ...@@ -1504,7 +1504,7 @@ nv50_disp_intr(struct nvkm_disp *disp)
} }
void void
nv50_disp_fini(struct nvkm_disp *disp) nv50_disp_fini(struct nvkm_disp *disp, bool suspend)
{ {
struct nvkm_device *device = disp->engine.subdev.device; struct nvkm_device *device = disp->engine.subdev.device;
/* disable all interrupts */ /* disable all interrupts */
......
...@@ -15,9 +15,10 @@ int nvkm_disp_new_(const struct nvkm_disp_func *, struct nvkm_device *, enum nvk ...@@ -15,9 +15,10 @@ int nvkm_disp_new_(const struct nvkm_disp_func *, struct nvkm_device *, enum nvk
void nvkm_disp_vblank(struct nvkm_disp *, int head); void nvkm_disp_vblank(struct nvkm_disp *, int head);
struct nvkm_disp_func { struct nvkm_disp_func {
void (*dtor)(struct nvkm_disp *);
int (*oneinit)(struct nvkm_disp *); int (*oneinit)(struct nvkm_disp *);
int (*init)(struct nvkm_disp *); int (*init)(struct nvkm_disp *);
void (*fini)(struct nvkm_disp *); void (*fini)(struct nvkm_disp *, bool suspend);
void (*intr)(struct nvkm_disp *); void (*intr)(struct nvkm_disp *);
void (*intr_error)(struct nvkm_disp *, int chid); void (*intr_error)(struct nvkm_disp *, int chid);
...@@ -32,7 +33,7 @@ struct nvkm_disp_func { ...@@ -32,7 +33,7 @@ struct nvkm_disp_func {
u16 ramht_size; u16 ramht_size;
const struct nvkm_sclass root; struct nvkm_sclass root;
struct nvkm_disp_user { struct nvkm_disp_user {
struct nvkm_sclass base; struct nvkm_sclass base;
...@@ -44,7 +45,7 @@ struct nvkm_disp_func { ...@@ -44,7 +45,7 @@ struct nvkm_disp_func {
int nv50_disp_oneinit(struct nvkm_disp *); int nv50_disp_oneinit(struct nvkm_disp *);
int nv50_disp_init(struct nvkm_disp *); int nv50_disp_init(struct nvkm_disp *);
void nv50_disp_fini(struct nvkm_disp *); void nv50_disp_fini(struct nvkm_disp *, bool suspend);
void nv50_disp_intr(struct nvkm_disp *); void nv50_disp_intr(struct nvkm_disp *);
extern const struct nvkm_enum nv50_disp_intr_error_type[]; extern const struct nvkm_enum nv50_disp_intr_error_type[];
void nv50_disp_super(struct work_struct *); void nv50_disp_super(struct work_struct *);
...@@ -56,12 +57,12 @@ void nv50_disp_super_2_2(struct nvkm_disp *, struct nvkm_head *); ...@@ -56,12 +57,12 @@ void nv50_disp_super_2_2(struct nvkm_disp *, struct nvkm_head *);
void nv50_disp_super_3_0(struct nvkm_disp *, struct nvkm_head *); void nv50_disp_super_3_0(struct nvkm_disp *, struct nvkm_head *);
int gf119_disp_init(struct nvkm_disp *); int gf119_disp_init(struct nvkm_disp *);
void gf119_disp_fini(struct nvkm_disp *); void gf119_disp_fini(struct nvkm_disp *, bool suspend);
void gf119_disp_intr(struct nvkm_disp *); void gf119_disp_intr(struct nvkm_disp *);
void gf119_disp_super(struct work_struct *); void gf119_disp_super(struct work_struct *);
void gf119_disp_intr_error(struct nvkm_disp *, int); void gf119_disp_intr_error(struct nvkm_disp *, int);
void gv100_disp_fini(struct nvkm_disp *); void gv100_disp_fini(struct nvkm_disp *, bool suspend);
void gv100_disp_intr(struct nvkm_disp *); void gv100_disp_intr(struct nvkm_disp *);
void gv100_disp_super(struct work_struct *); void gv100_disp_super(struct work_struct *);
int gv100_disp_wndw_cnt(struct nvkm_disp *, unsigned long *); int gv100_disp_wndw_cnt(struct nvkm_disp *, unsigned long *);
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include "ior.h" #include "ior.h"
#include <core/gpuobj.h> #include <core/gpuobj.h>
#include <subdev/gsp.h>
#include <subdev/timer.h> #include <subdev/timer.h>
#include <nvif/class.h> #include <nvif/class.h>
...@@ -233,5 +234,8 @@ int ...@@ -233,5 +234,8 @@ int
tu102_disp_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, tu102_disp_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
struct nvkm_disp **pdisp) struct nvkm_disp **pdisp)
{ {
if (nvkm_gsp_rm(device->gsp))
return -ENODEV;
return nvkm_disp_new_(&tu102_disp, device, type, inst, pdisp); return nvkm_disp_new_(&tu102_disp, device, type, inst, pdisp);
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment