Commit 212e88fe authored by Ben Skeggs's avatar Ben Skeggs Committed by Wen Zhiwei
Browse files

drm/nouveau/fb: restore init() for ramgp102

stable inclusion
from stable-v6.6.52
commit def80cdb2676bbbded7139fc5a52b7a5efc8cbe5
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IAYXOD

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=def80cdb2676bbbded7139fc5a52b7a5efc8cbe5

--------------------------------

commit 6db9df4f7055eb4ea339e7b83ca676edd9ec1277 upstream.

init() was removed from ramgp102 when reworking the memory detection, as
it was thought that the code was only necessary when the driver performs
mclk changes, which nouveau doesn't support on pascal.

However, it turns out that we still need to execute this on some GPUs to
restore settings after DEVINIT, so revert to the original behaviour.

v2: fix tags in commit message, cc stable

Closes: https://gitlab.freedesktop.org/drm/nouveau/-/issues/319


Fixes: 2c0c15a2 ("drm/nouveau/fb/gp102-ga100: switch to simpler vram size detection method")
Cc: stable@vger.kernel.org # 6.6+
Signed-off-by: default avatarBen Skeggs <bskeggs@nvidia.com>
Signed-off-by: default avatarDanilo Krummrich <dakr@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20240904232418.8590-1-bskeggs@nvidia.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarWen Zhiwei <wenzhiwei@kylinos.cn>
parent 73453d29
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -46,6 +46,8 @@ u32 gm107_ram_probe_fbp(const struct nvkm_ram_func *,
u32 gm200_ram_probe_fbp_amount(const struct nvkm_ram_func *, u32,
			       struct nvkm_device *, int, int *);

int gp100_ram_init(struct nvkm_ram *);

/* RAM type-specific MR calculation routines */
int nvkm_sddr2_calc(struct nvkm_ram *);
int nvkm_sddr3_calc(struct nvkm_ram *);
+1 −1
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@
#include <subdev/bios/init.h>
#include <subdev/bios/rammap.h>

static int
int
gp100_ram_init(struct nvkm_ram *ram)
{
	struct nvkm_subdev *subdev = &ram->fb->subdev;
+1 −0
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@

static const struct nvkm_ram_func
gp102_ram = {
	.init = gp100_ram_init,
};

int