* [PATCH] drm/nouveau/fb: restore init() for ramgp102
@ 2024-09-03 23:16 Ben Skeggs
2024-09-05 11:07 ` Danilo Krummrich
0 siblings, 1 reply; 2+ messages in thread
From: Ben Skeggs @ 2024-09-03 23:16 UTC (permalink / raw)
To: nouveau; +Cc: Ben Skeggs
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.
Bug: https://gitlab.freedesktop.org/drm/nouveau/-/issues/319
Fixes: 2c0c15a22fa0 ("drm/nouveau/fb/gp102-ga100: switch to simpler vram size detection method")
Signed-off-by: Ben Skeggs <bskeggs@nvidia.com>
---
drivers/gpu/drm/nouveau/nvkm/subdev/fb/ram.h | 2 ++
drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgp100.c | 2 +-
drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgp102.c | 1 +
3 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ram.h b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ram.h
index 50f0c1914f58..4c3f74396579 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ram.h
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ram.h
@@ -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 *);
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgp100.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgp100.c
index 378f6fb70990..8987a21e81d1 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgp100.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgp100.c
@@ -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;
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgp102.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgp102.c
index 8550f5e47347..b6b6ee59019d 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgp102.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgp102.c
@@ -5,6 +5,7 @@
static const struct nvkm_ram_func
gp102_ram = {
+ .init = gp100_ram_init,
};
int
--
2.45.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drm/nouveau/fb: restore init() for ramgp102
2024-09-03 23:16 [PATCH] drm/nouveau/fb: restore init() for ramgp102 Ben Skeggs
@ 2024-09-05 11:07 ` Danilo Krummrich
0 siblings, 0 replies; 2+ messages in thread
From: Danilo Krummrich @ 2024-09-05 11:07 UTC (permalink / raw)
To: Ben Skeggs; +Cc: nouveau
Hi Ben,
On 9/4/24 1:16 AM, Ben Skeggs wrote:
> 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.
>
> Bug: https://gitlab.freedesktop.org/drm/nouveau/-/issues/319
Please use 'Closes:' instead and CC stable.
- Danilo
> Fixes: 2c0c15a22fa0 ("drm/nouveau/fb/gp102-ga100: switch to simpler vram size detection method")
> Signed-off-by: Ben Skeggs <bskeggs@nvidia.com>
> ---
> drivers/gpu/drm/nouveau/nvkm/subdev/fb/ram.h | 2 ++
> drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgp100.c | 2 +-
> drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgp102.c | 1 +
> 3 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ram.h b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ram.h
> index 50f0c1914f58..4c3f74396579 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ram.h
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ram.h
> @@ -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 *);
> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgp100.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgp100.c
> index 378f6fb70990..8987a21e81d1 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgp100.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgp100.c
> @@ -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;
> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgp102.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgp102.c
> index 8550f5e47347..b6b6ee59019d 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgp102.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgp102.c
> @@ -5,6 +5,7 @@
>
> static const struct nvkm_ram_func
> gp102_ram = {
> + .init = gp100_ram_init,
> };
>
> int
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-09-05 11:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-03 23:16 [PATCH] drm/nouveau/fb: restore init() for ramgp102 Ben Skeggs
2024-09-05 11:07 ` Danilo Krummrich
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox