Commit ebaf3e70 authored by Karol Herbst's avatar Karol Herbst Committed by Ben Skeggs

drm/nouveau/fb/ram: Use Kepler implementation on Maxwell

This enables memory reclocking on Maxwell. Sadly without a PMU firmware it
is useless for gm20x gpus.
Signed-off-by: default avatarKarol Herbst <karolherbst@gmail.com>
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 114653c7
...@@ -24,6 +24,7 @@ int gf100_ram_ctor(const struct nvkm_ram_func *, struct nvkm_fb *, ...@@ -24,6 +24,7 @@ int gf100_ram_ctor(const struct nvkm_ram_func *, struct nvkm_fb *,
int gf100_ram_get(struct nvkm_ram *, u64, u32, u32, u32, struct nvkm_mem **); int gf100_ram_get(struct nvkm_ram *, u64, u32, u32, u32, struct nvkm_mem **);
void gf100_ram_put(struct nvkm_ram *, struct nvkm_mem **); void gf100_ram_put(struct nvkm_ram *, struct nvkm_mem **);
int gk104_ram_ctor(struct nvkm_fb *, struct nvkm_ram **, u32);
int gk104_ram_init(struct nvkm_ram *ram); int gk104_ram_init(struct nvkm_ram *ram);
/* RAM type-specific MR calculation routines */ /* RAM type-specific MR calculation routines */
......
...@@ -1537,6 +1537,12 @@ gk104_ram_func = { ...@@ -1537,6 +1537,12 @@ gk104_ram_func = {
int int
gk104_ram_new(struct nvkm_fb *fb, struct nvkm_ram **pram) gk104_ram_new(struct nvkm_fb *fb, struct nvkm_ram **pram)
{
return gk104_ram_ctor(fb, pram, 0x022554);
}
int
gk104_ram_ctor(struct nvkm_fb *fb, struct nvkm_ram **pram, u32 maskaddr)
{ {
struct nvkm_subdev *subdev = &fb->subdev; struct nvkm_subdev *subdev = &fb->subdev;
struct nvkm_device *device = subdev->device; struct nvkm_device *device = subdev->device;
...@@ -1552,7 +1558,7 @@ gk104_ram_new(struct nvkm_fb *fb, struct nvkm_ram **pram) ...@@ -1552,7 +1558,7 @@ gk104_ram_new(struct nvkm_fb *fb, struct nvkm_ram **pram)
return -ENOMEM; return -ENOMEM;
*pram = &ram->base; *pram = &ram->base;
ret = gf100_ram_ctor(&gk104_ram_func, fb, 0x022554, &ram->base); ret = gf100_ram_ctor(&gk104_ram_func, fb, maskaddr, &ram->base);
if (ret) if (ret)
return ret; return ret;
......
...@@ -23,18 +23,8 @@ ...@@ -23,18 +23,8 @@
*/ */
#include "ram.h" #include "ram.h"
static const struct nvkm_ram_func
gm107_ram_func = {
.init = gk104_ram_init,
.get = gf100_ram_get,
.put = gf100_ram_put,
};
int int
gm107_ram_new(struct nvkm_fb *fb, struct nvkm_ram **pram) gm107_ram_new(struct nvkm_fb *fb, struct nvkm_ram **pram)
{ {
if (!(*pram = kzalloc(sizeof(**pram), GFP_KERNEL))) return gk104_ram_ctor(fb, pram, 0x021c14);
return -ENOMEM;
return gf100_ram_ctor(&gm107_ram_func, fb, 0x021c14, *pram);
} }
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