drm/nouveau/sec: switch to instanced constructor
Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
This commit is contained in:
parent
e73d371a73
commit
400c2a456c
@ -60,7 +60,6 @@ struct nvkm_device {
|
||||
struct notifier_block nb;
|
||||
} acpi;
|
||||
|
||||
struct nvkm_engine *sec;
|
||||
struct nvkm_sec2 *sec2;
|
||||
struct nvkm_sw *sw;
|
||||
struct nvkm_engine *vic;
|
||||
@ -105,7 +104,6 @@ struct nvkm_device_chip {
|
||||
#undef NVKM_LAYOUT_INST
|
||||
#undef NVKM_LAYOUT_ONCE
|
||||
|
||||
int (*sec )(struct nvkm_device *, int idx, struct nvkm_engine **);
|
||||
int (*sec2 )(struct nvkm_device *, int idx, struct nvkm_sec2 **);
|
||||
int (*sw )(struct nvkm_device *, int idx, struct nvkm_sw **);
|
||||
int (*vic )(struct nvkm_device *, int idx, struct nvkm_engine **);
|
||||
|
@ -42,4 +42,5 @@ NVKM_LAYOUT_ONCE(NVKM_ENGINE_MSVLD , struct nvkm_engine , msvld)
|
||||
NVKM_LAYOUT_INST(NVKM_ENGINE_NVDEC , struct nvkm_nvdec , nvdec, 3)
|
||||
NVKM_LAYOUT_INST(NVKM_ENGINE_NVENC , struct nvkm_nvenc , nvenc, 3)
|
||||
NVKM_LAYOUT_ONCE(NVKM_ENGINE_PM , struct nvkm_pm , pm)
|
||||
NVKM_LAYOUT_ONCE(NVKM_ENGINE_SEC , struct nvkm_engine , sec)
|
||||
NVKM_LAYOUT_ONCE(NVKM_ENGINE_VP , struct nvkm_engine , vp)
|
||||
|
@ -63,12 +63,8 @@ void nvkm_falcon_del(struct nvkm_falcon **);
|
||||
int nvkm_falcon_get(struct nvkm_falcon *, const struct nvkm_subdev *);
|
||||
void nvkm_falcon_put(struct nvkm_falcon *, const struct nvkm_subdev *);
|
||||
|
||||
int nvkm_falcon_new__(const struct nvkm_falcon_func *, bool old, struct nvkm_device *,
|
||||
int nvkm_falcon_new_(const struct nvkm_falcon_func *, struct nvkm_device *,
|
||||
enum nvkm_subdev_type, int inst, bool enable, u32 addr, struct nvkm_engine **);
|
||||
#define nvkm_falcon_new__o(f,d,i, e,a,s) nvkm_falcon_new__((f), true, (d), (i), -1 , (e), (a), (s))
|
||||
#define nvkm_falcon_new__n(f,d,t,i,e,a,s) nvkm_falcon_new__((f), false, (d), (t), (i), (e), (a), (s))
|
||||
#define nvkm_falcon_new___(_1,_2,_3,_4,_5,_6,_7,IMPL,...) IMPL
|
||||
#define nvkm_falcon_new_(A...) nvkm_falcon_new___(A, nvkm_falcon_new__n, nvkm_falcon_new__o)(A)
|
||||
|
||||
struct nvkm_falcon_func {
|
||||
struct {
|
||||
|
@ -2,5 +2,5 @@
|
||||
#ifndef __NVKM_SEC_H__
|
||||
#define __NVKM_SEC_H__
|
||||
#include <engine/falcon.h>
|
||||
int g98_sec_new(struct nvkm_device *, int, struct nvkm_engine **);
|
||||
int g98_sec_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_engine **);
|
||||
#endif
|
||||
|
@ -33,7 +33,6 @@ nvkm_subdev_type[NVKM_SUBDEV_NR] = {
|
||||
#include <core/layout.h>
|
||||
#undef NVKM_LAYOUT_ONCE
|
||||
#undef NVKM_LAYOUT_INST
|
||||
[NVKM_ENGINE_SEC ] = "sec",
|
||||
[NVKM_ENGINE_SEC2 ] = "sec2",
|
||||
[NVKM_ENGINE_SW ] = "sw",
|
||||
[NVKM_ENGINE_VIC ] = "vic",
|
||||
|
@ -1102,7 +1102,7 @@ nv98_chipset = {
|
||||
.msppp = { 0x00000001, g98_msppp_new },
|
||||
.msvld = { 0x00000001, g98_msvld_new },
|
||||
.pm = { 0x00000001, g84_pm_new },
|
||||
.sec = g98_sec_new,
|
||||
.sec = { 0x00000001, g98_sec_new },
|
||||
.sw = nv50_sw_new,
|
||||
};
|
||||
|
||||
@ -1266,7 +1266,7 @@ nvaa_chipset = {
|
||||
.msppp = { 0x00000001, g98_msppp_new },
|
||||
.msvld = { 0x00000001, g98_msvld_new },
|
||||
.pm = { 0x00000001, g84_pm_new },
|
||||
.sec = g98_sec_new,
|
||||
.sec = { 0x00000001, g98_sec_new },
|
||||
.sw = nv50_sw_new,
|
||||
};
|
||||
|
||||
@ -1298,7 +1298,7 @@ nvac_chipset = {
|
||||
.msppp = { 0x00000001, g98_msppp_new },
|
||||
.msvld = { 0x00000001, g98_msvld_new },
|
||||
.pm = { 0x00000001, g84_pm_new },
|
||||
.sec = g98_sec_new,
|
||||
.sec = { 0x00000001, g98_sec_new },
|
||||
.sw = nv50_sw_new,
|
||||
};
|
||||
|
||||
@ -3162,7 +3162,6 @@ nvkm_device_ctor(const struct nvkm_device_func *func,
|
||||
#include <core/layout.h>
|
||||
#undef NVKM_LAYOUT_INST
|
||||
#undef NVKM_LAYOUT_ONCE
|
||||
_(NVKM_ENGINE_SEC , sec);
|
||||
_(NVKM_ENGINE_SEC2 , sec2);
|
||||
_(NVKM_ENGINE_SW , sw);
|
||||
_(NVKM_ENGINE_VIC , vic);
|
||||
|
@ -335,7 +335,7 @@ nvkm_falcon = {
|
||||
};
|
||||
|
||||
int
|
||||
nvkm_falcon_new__(const struct nvkm_falcon_func *func, bool old, struct nvkm_device *device,
|
||||
nvkm_falcon_new_(const struct nvkm_falcon_func *func, struct nvkm_device *device,
|
||||
enum nvkm_subdev_type type, int inst, bool enable, u32 addr,
|
||||
struct nvkm_engine **pengine)
|
||||
{
|
||||
@ -351,5 +351,5 @@ nvkm_falcon_new__(const struct nvkm_falcon_func *func, bool old, struct nvkm_dev
|
||||
falcon->data.size = func->data.size;
|
||||
*pengine = &falcon->engine;
|
||||
|
||||
return nvkm_engine_ctor_(&nvkm_falcon, old, device, type, inst, enable, &falcon->engine);
|
||||
return nvkm_engine_ctor(&nvkm_falcon, device, type, inst, enable, &falcon->engine);
|
||||
}
|
||||
|
@ -74,9 +74,8 @@ g98_sec = {
|
||||
};
|
||||
|
||||
int
|
||||
g98_sec_new(struct nvkm_device *device, int index,
|
||||
g98_sec_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
|
||||
struct nvkm_engine **pengine)
|
||||
{
|
||||
return nvkm_falcon_new_(&g98_sec, device, index,
|
||||
true, 0x087000, pengine);
|
||||
return nvkm_falcon_new_(&g98_sec, device, type, inst, true, 0x087000, pengine);
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ g98_devinit_disable(struct nvkm_devinit *init)
|
||||
if (!(r00154c & 0x00000020))
|
||||
nvkm_subdev_disable(device, NVKM_ENGINE_MSVLD, 0);
|
||||
if (!(r00154c & 0x00000040))
|
||||
disable |= (1ULL << NVKM_ENGINE_SEC);
|
||||
nvkm_subdev_disable(device, NVKM_ENGINE_SEC, 0);
|
||||
|
||||
return disable;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user