mirror of https://gitee.com/openkylin/linux.git
drm/nouveau/gr/gm200: load external firmware and bundles
Load firmware and bundles in GM200's constructor. The previously called GF100 function did not care about the bundles. Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
This commit is contained in:
parent
2e404b0da9
commit
f008d8c7b2
|
@ -138,8 +138,6 @@ int gf100_gr_init(struct gf100_gr *);
|
||||||
|
|
||||||
int gk104_gr_init(struct gf100_gr *);
|
int gk104_gr_init(struct gf100_gr *);
|
||||||
|
|
||||||
int gk20a_gr_new_(const struct gf100_gr_func *, struct nvkm_device *,
|
|
||||||
int, struct nvkm_gr **);
|
|
||||||
int gk20a_gr_init(struct gf100_gr *);
|
int gk20a_gr_init(struct gf100_gr *);
|
||||||
|
|
||||||
int gm200_gr_init(struct gf100_gr *);
|
int gm200_gr_init(struct gf100_gr *);
|
||||||
|
@ -211,6 +209,9 @@ int gk20a_gr_aiv_to_init(struct gf100_gr *, const char *,
|
||||||
int gk20a_gr_av_to_method(struct gf100_gr *, const char *,
|
int gk20a_gr_av_to_method(struct gf100_gr *, const char *,
|
||||||
struct gf100_gr_pack **);
|
struct gf100_gr_pack **);
|
||||||
|
|
||||||
|
int gm200_gr_new_(const struct gf100_gr_func *, struct nvkm_device *, int,
|
||||||
|
struct nvkm_gr **);
|
||||||
|
|
||||||
/* register init value lists */
|
/* register init value lists */
|
||||||
|
|
||||||
extern const struct gf100_gr_init gf100_gr_init_main_0[];
|
extern const struct gf100_gr_init gf100_gr_init_main_0[];
|
||||||
|
|
|
@ -309,9 +309,23 @@ gk20a_gr_init(struct gf100_gr *gr)
|
||||||
return gf100_gr_init_ctxctl(gr);
|
return gf100_gr_init_ctxctl(gr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const struct gf100_gr_func
|
||||||
|
gk20a_gr = {
|
||||||
|
.init = gk20a_gr_init,
|
||||||
|
.set_hww_esr_report_mask = gk20a_gr_set_hww_esr_report_mask,
|
||||||
|
.ppc_nr = 1,
|
||||||
|
.grctx = &gk20a_grctx,
|
||||||
|
.sclass = {
|
||||||
|
{ -1, -1, FERMI_TWOD_A },
|
||||||
|
{ -1, -1, KEPLER_INLINE_TO_MEMORY_A },
|
||||||
|
{ -1, -1, KEPLER_C, &gf100_fermi },
|
||||||
|
{ -1, -1, KEPLER_COMPUTE_A },
|
||||||
|
{}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
int
|
int
|
||||||
gk20a_gr_new_(const struct gf100_gr_func *func, struct nvkm_device *device,
|
gk20a_gr_new(struct nvkm_device *device, int index, struct nvkm_gr **pgr)
|
||||||
int index, struct nvkm_gr **pgr)
|
|
||||||
{
|
{
|
||||||
struct gf100_gr *gr;
|
struct gf100_gr *gr;
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -320,7 +334,7 @@ gk20a_gr_new_(const struct gf100_gr_func *func, struct nvkm_device *device,
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
*pgr = &gr->base;
|
*pgr = &gr->base;
|
||||||
|
|
||||||
ret = gf100_gr_ctor(func, device, index, gr);
|
ret = gf100_gr_ctor(&gk20a_gr, device, index, gr);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
@ -349,24 +363,3 @@ gk20a_gr_new_(const struct gf100_gr_func *func, struct nvkm_device *device,
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct gf100_gr_func
|
|
||||||
gk20a_gr = {
|
|
||||||
.init = gk20a_gr_init,
|
|
||||||
.set_hww_esr_report_mask = gk20a_gr_set_hww_esr_report_mask,
|
|
||||||
.ppc_nr = 1,
|
|
||||||
.grctx = &gk20a_grctx,
|
|
||||||
.sclass = {
|
|
||||||
{ -1, -1, FERMI_TWOD_A },
|
|
||||||
{ -1, -1, KEPLER_INLINE_TO_MEMORY_A },
|
|
||||||
{ -1, -1, KEPLER_C, &gf100_fermi },
|
|
||||||
{ -1, -1, KEPLER_COMPUTE_A },
|
|
||||||
{}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
int
|
|
||||||
gk20a_gr_new(struct nvkm_device *device, int index, struct nvkm_gr **pgr)
|
|
||||||
{
|
|
||||||
return gk20a_gr_new_(&gk20a_gr, device, index, pgr);
|
|
||||||
}
|
|
||||||
|
|
|
@ -351,6 +351,37 @@ gm200_gr_init(struct gf100_gr *gr)
|
||||||
return gm200_gr_init_ctxctl(gr);
|
return gm200_gr_init_ctxctl(gr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
gm200_gr_new_(const struct gf100_gr_func *func, struct nvkm_device *device,
|
||||||
|
int index, struct nvkm_gr **pgr)
|
||||||
|
{
|
||||||
|
struct gf100_gr *gr;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
if (!(gr = kzalloc(sizeof(*gr), GFP_KERNEL)))
|
||||||
|
return -ENOMEM;
|
||||||
|
*pgr = &gr->base;
|
||||||
|
|
||||||
|
ret = gf100_gr_ctor(func, device, index, gr);
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
if ((ret = gf100_gr_ctor_fw(gr, "gr/fecs_inst", &gr->fuc409c)) ||
|
||||||
|
(ret = gf100_gr_ctor_fw(gr, "gr/fecs_data", &gr->fuc409d)))
|
||||||
|
return ret;
|
||||||
|
if ((ret = gf100_gr_ctor_fw(gr, "gr/gpccs_inst", &gr->fuc41ac)) ||
|
||||||
|
(ret = gf100_gr_ctor_fw(gr, "gr/gpccs_data", &gr->fuc41ad)))
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
if ((ret = gk20a_gr_av_to_init(gr, "gr/sw_nonctx", &gr->fuc_sw_nonctx)) ||
|
||||||
|
(ret = gk20a_gr_aiv_to_init(gr, "gr/sw_ctx", &gr->fuc_sw_ctx)) ||
|
||||||
|
(ret = gk20a_gr_av_to_init(gr, "gr/sw_bundle_init", &gr->fuc_bundle)) ||
|
||||||
|
(ret = gk20a_gr_av_to_method(gr, "gr/sw_method_init", &gr->fuc_method)))
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static const struct gf100_gr_func
|
static const struct gf100_gr_func
|
||||||
gm200_gr = {
|
gm200_gr = {
|
||||||
.init = gm200_gr_init,
|
.init = gm200_gr_init,
|
||||||
|
@ -369,5 +400,5 @@ gm200_gr = {
|
||||||
int
|
int
|
||||||
gm200_gr_new(struct nvkm_device *device, int index, struct nvkm_gr **pgr)
|
gm200_gr_new(struct nvkm_device *device, int index, struct nvkm_gr **pgr)
|
||||||
{
|
{
|
||||||
return gf100_gr_new_(&gm200_gr, device, index, pgr);
|
return gm200_gr_new_(&gm200_gr, device, index, pgr);
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,5 +44,5 @@ gm206_gr = {
|
||||||
int
|
int
|
||||||
gm206_gr_new(struct nvkm_device *device, int index, struct nvkm_gr **pgr)
|
gm206_gr_new(struct nvkm_device *device, int index, struct nvkm_gr **pgr)
|
||||||
{
|
{
|
||||||
return gf100_gr_new_(&gm206_gr, device, index, pgr);
|
return gm200_gr_new_(&gm206_gr, device, index, pgr);
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,5 +78,5 @@ gm20b_gr = {
|
||||||
int
|
int
|
||||||
gm20b_gr_new(struct nvkm_device *device, int index, struct nvkm_gr **pgr)
|
gm20b_gr_new(struct nvkm_device *device, int index, struct nvkm_gr **pgr)
|
||||||
{
|
{
|
||||||
return gk20a_gr_new_(&gm20b_gr, device, index, pgr);
|
return gm200_gr_new_(&gm20b_gr, device, index, pgr);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue