diff options
author | Karol Herbst <karolherbst@gmail.com> | 2016-07-17 15:36:49 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2016-10-12 03:29:28 -0400 |
commit | ebaf3e70aabea8e3d86d977ab96261d7452b7a0d (patch) | |
tree | 10178022461987138251b6e0d45fbadbd2058365 | |
parent | 114653c7593a4dd52cc1721b0d325d43b00e2371 (diff) |
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: Karol Herbst <karolherbst@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/fb/ram.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgk104.c | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgm107.c | 12 |
3 files changed, 9 insertions, 12 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ram.h b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ram.h index b9ec0ae6723a..b60068b7d8f9 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ram.h +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ram.h | |||
@@ -24,6 +24,7 @@ int gf100_ram_ctor(const struct nvkm_ram_func *, struct nvkm_fb *, | |||
24 | int gf100_ram_get(struct nvkm_ram *, u64, u32, u32, u32, struct nvkm_mem **); | 24 | int gf100_ram_get(struct nvkm_ram *, u64, u32, u32, u32, struct nvkm_mem **); |
25 | void gf100_ram_put(struct nvkm_ram *, struct nvkm_mem **); | 25 | void gf100_ram_put(struct nvkm_ram *, struct nvkm_mem **); |
26 | 26 | ||
27 | int gk104_ram_ctor(struct nvkm_fb *, struct nvkm_ram **, u32); | ||
27 | int gk104_ram_init(struct nvkm_ram *ram); | 28 | int gk104_ram_init(struct nvkm_ram *ram); |
28 | 29 | ||
29 | /* RAM type-specific MR calculation routines */ | 30 | /* RAM type-specific MR calculation routines */ |
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgk104.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgk104.c index 93b30d92776c..7904fa41acef 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgk104.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgk104.c | |||
@@ -1538,6 +1538,12 @@ gk104_ram_func = { | |||
1538 | int | 1538 | int |
1539 | gk104_ram_new(struct nvkm_fb *fb, struct nvkm_ram **pram) | 1539 | gk104_ram_new(struct nvkm_fb *fb, struct nvkm_ram **pram) |
1540 | { | 1540 | { |
1541 | return gk104_ram_ctor(fb, pram, 0x022554); | ||
1542 | } | ||
1543 | |||
1544 | int | ||
1545 | gk104_ram_ctor(struct nvkm_fb *fb, struct nvkm_ram **pram, u32 maskaddr) | ||
1546 | { | ||
1541 | struct nvkm_subdev *subdev = &fb->subdev; | 1547 | struct nvkm_subdev *subdev = &fb->subdev; |
1542 | struct nvkm_device *device = subdev->device; | 1548 | struct nvkm_device *device = subdev->device; |
1543 | struct nvkm_bios *bios = device->bios; | 1549 | struct nvkm_bios *bios = device->bios; |
@@ -1552,7 +1558,7 @@ gk104_ram_new(struct nvkm_fb *fb, struct nvkm_ram **pram) | |||
1552 | return -ENOMEM; | 1558 | return -ENOMEM; |
1553 | *pram = &ram->base; | 1559 | *pram = &ram->base; |
1554 | 1560 | ||
1555 | ret = gf100_ram_ctor(&gk104_ram_func, fb, 0x022554, &ram->base); | 1561 | ret = gf100_ram_ctor(&gk104_ram_func, fb, maskaddr, &ram->base); |
1556 | if (ret) | 1562 | if (ret) |
1557 | return ret; | 1563 | return ret; |
1558 | 1564 | ||
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgm107.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgm107.c index 43d807f6ca71..ac862d1d77bd 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgm107.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgm107.c | |||
@@ -23,18 +23,8 @@ | |||
23 | */ | 23 | */ |
24 | #include "ram.h" | 24 | #include "ram.h" |
25 | 25 | ||
26 | static const struct nvkm_ram_func | ||
27 | gm107_ram_func = { | ||
28 | .init = gk104_ram_init, | ||
29 | .get = gf100_ram_get, | ||
30 | .put = gf100_ram_put, | ||
31 | }; | ||
32 | |||
33 | int | 26 | int |
34 | gm107_ram_new(struct nvkm_fb *fb, struct nvkm_ram **pram) | 27 | gm107_ram_new(struct nvkm_fb *fb, struct nvkm_ram **pram) |
35 | { | 28 | { |
36 | if (!(*pram = kzalloc(sizeof(**pram), GFP_KERNEL))) | 29 | return gk104_ram_ctor(fb, pram, 0x021c14); |
37 | return -ENOMEM; | ||
38 | |||
39 | return gf100_ram_ctor(&gm107_ram_func, fb, 0x021c14, *pram); | ||
40 | } | 30 | } |