Re: [PATCH] nouveau/gsp: add kconfig option to enable GSP paths by default

2024-02-13 Thread Dave Airlie
(ignore this one, sent another just after)

On Wed, 14 Feb 2024 at 13:40, Dave Airlie  wrote:
>
> From: Dave Airlie 
>
> Turing and Ampere will continue to use the old paths by default,
> but we should allow distros to decide what the policy is.
>
> Signed-off-by: Dave Airlie 
> ---
>  drivers/gpu/drm/nouveau/Kconfig| 8 
>  drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c | 3 +++
>  2 files changed, 11 insertions(+)
>
> diff --git a/drivers/gpu/drm/nouveau/Kconfig b/drivers/gpu/drm/nouveau/Kconfig
> index 1e6aaf95ff7c..ceef470c9fbf 100644
> --- a/drivers/gpu/drm/nouveau/Kconfig
> +++ b/drivers/gpu/drm/nouveau/Kconfig
> @@ -100,3 +100,11 @@ config DRM_NOUVEAU_SVM
> help
>   Say Y here if you want to enable experimental support for
>   Shared Virtual Memory (SVM).
> +
> +config DRM_NOUVEAU_GSP_DEFAULT
> +   bool "Use GSP firmware for Turing/Ampere (needs firmware installed)"
> +   depends on DRM_NOUVEAU
> +   default n
> +   help
> + Say Y here if you want to use the GSP codepaths by default on
> + Turing and Ampere GPUs.
> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c 
> b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c
> index a41735ab6068..fadbb892 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c
> @@ -2313,6 +2313,9 @@ r535_gsp_load(struct nvkm_gsp *gsp, int ver, const 
> struct nvkm_gsp_fwif *fwif)
> struct nvkm_subdev *subdev = &gsp->subdev;
> int ret;
>
> +#if IS_ENABLED(CONFIG_DRM_NOUVEAU_GSP_DEFAULT)
> +   fwif->enable = true;
> +#endif
> if (!nvkm_boolopt(subdev->device->cfgopt, "NvGspRm", fwif->enable))
> return -EINVAL;
>
> --
> 2.43.0
>


[PATCH] nouveau/gsp: add kconfig option to enable GSP paths by default

2024-02-13 Thread Dave Airlie
From: Dave Airlie 

Turing and Ampere will continue to use the old paths by default,
but we should allow distros to decide what the policy is.

Signed-off-by: Dave Airlie 
---
 drivers/gpu/drm/nouveau/Kconfig| 8 
 drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c | 6 +-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/nouveau/Kconfig b/drivers/gpu/drm/nouveau/Kconfig
index 1e6aaf95ff7c..ceef470c9fbf 100644
--- a/drivers/gpu/drm/nouveau/Kconfig
+++ b/drivers/gpu/drm/nouveau/Kconfig
@@ -100,3 +100,11 @@ config DRM_NOUVEAU_SVM
help
  Say Y here if you want to enable experimental support for
  Shared Virtual Memory (SVM).
+
+config DRM_NOUVEAU_GSP_DEFAULT
+   bool "Use GSP firmware for Turing/Ampere (needs firmware installed)"
+   depends on DRM_NOUVEAU
+   default n
+   help
+ Say Y here if you want to use the GSP codepaths by default on
+ Turing and Ampere GPUs.
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c 
b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c
index a41735ab6068..a64c81385682 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c
@@ -2312,8 +2312,12 @@ r535_gsp_load(struct nvkm_gsp *gsp, int ver, const 
struct nvkm_gsp_fwif *fwif)
 {
struct nvkm_subdev *subdev = &gsp->subdev;
int ret;
+   bool enable_gsp = fwif->enable;
 
-   if (!nvkm_boolopt(subdev->device->cfgopt, "NvGspRm", fwif->enable))
+#if IS_ENABLED(CONFIG_DRM_NOUVEAU_GSP_DEFAULT)
+   enable_gsp = true;
+#endif
+   if (!nvkm_boolopt(subdev->device->cfgopt, "NvGspRm", enable_gsp))
return -EINVAL;
 
if ((ret = r535_gsp_load_fw(gsp, "gsp", fwif->ver, &gsp->fws.rm)) ||
-- 
2.43.0



[PATCH] nouveau/gsp: add kconfig option to enable GSP paths by default

2024-02-13 Thread Dave Airlie
From: Dave Airlie 

Turing and Ampere will continue to use the old paths by default,
but we should allow distros to decide what the policy is.

Signed-off-by: Dave Airlie 
---
 drivers/gpu/drm/nouveau/Kconfig| 8 
 drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c | 3 +++
 2 files changed, 11 insertions(+)

diff --git a/drivers/gpu/drm/nouveau/Kconfig b/drivers/gpu/drm/nouveau/Kconfig
index 1e6aaf95ff7c..ceef470c9fbf 100644
--- a/drivers/gpu/drm/nouveau/Kconfig
+++ b/drivers/gpu/drm/nouveau/Kconfig
@@ -100,3 +100,11 @@ config DRM_NOUVEAU_SVM
help
  Say Y here if you want to enable experimental support for
  Shared Virtual Memory (SVM).
+
+config DRM_NOUVEAU_GSP_DEFAULT
+   bool "Use GSP firmware for Turing/Ampere (needs firmware installed)"
+   depends on DRM_NOUVEAU
+   default n
+   help
+ Say Y here if you want to use the GSP codepaths by default on
+ Turing and Ampere GPUs.
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c 
b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c
index a41735ab6068..fadbb892 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c
@@ -2313,6 +2313,9 @@ r535_gsp_load(struct nvkm_gsp *gsp, int ver, const struct 
nvkm_gsp_fwif *fwif)
struct nvkm_subdev *subdev = &gsp->subdev;
int ret;
 
+#if IS_ENABLED(CONFIG_DRM_NOUVEAU_GSP_DEFAULT)
+   fwif->enable = true;
+#endif
if (!nvkm_boolopt(subdev->device->cfgopt, "NvGspRm", fwif->enable))
return -EINVAL;
 
-- 
2.43.0