All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Airlie <airlied@gmail.com>
To: dri-devel@lists.freedesktop.org
Cc: nouveau@lists.freedesktop.org, dakr@kernel.org
Subject: [PATCH 3/6] nouveau/gsp: add logging entries for r570
Date: Wed, 29 Jul 2026 14:15:27 +1000	[thread overview]
Message-ID: <20260729041653.3985549-4-airlied@gmail.com> (raw)
In-Reply-To: <20260729041653.3985549-1-airlied@gmail.com>

From: Dave Airlie <airlied@redhat.com>

r570 adds logmnoc and logkrnl. logkrnl is only used for libos3, so
add a flag to pick libos2 out and not init on that.

Signed-off-by: Dave Airlie <airlied@redhat.com>
---
 .../gpu/drm/nouveau/include/nvkm/subdev/gsp.h |  2 ++
 .../drm/nouveau/nvkm/subdev/gsp/rm/r535/gsp.c |  2 ++
 .../drm/nouveau/nvkm/subdev/gsp/rm/r535/rm.c  |  1 +
 .../drm/nouveau/nvkm/subdev/gsp/rm/r570/gsp.c | 23 +++++++++++++++----
 .../drm/nouveau/nvkm/subdev/gsp/rm/r570/rm.c  |  1 +
 .../gpu/drm/nouveau/nvkm/subdev/gsp/rm/rm.h   |  1 +
 6 files changed, 25 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/gsp.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/gsp.h
index 64fed208e4cf..d45351ce08a1 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/gsp.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/gsp.h
@@ -145,6 +145,8 @@ struct nvkm_gsp {
 	struct nvkm_gsp_mem loginit;
 	struct nvkm_gsp_mem logintr;
 	struct nvkm_gsp_mem logrm;
+	struct nvkm_gsp_mem logmnoc;
+	struct nvkm_gsp_mem logkrnl;
 	struct nvkm_gsp_mem rmargs;
 
 	struct nvkm_gsp_mem wpr_meta;
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/gsp.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/gsp.c
index 8e1ad2e79d3e..77a5a1882472 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/gsp.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/gsp.c
@@ -2108,6 +2108,8 @@ r535_gsp_dtor(struct nvkm_gsp *gsp)
 
 	r535_gsp_libos_debugfs_fini(gsp);
 
+	nvkm_gsp_mem_dtor(&gsp->logkrnl);
+	nvkm_gsp_mem_dtor(&gsp->logmnoc);
 	nvkm_gsp_mem_dtor(&gsp->loginit);
 	nvkm_gsp_mem_dtor(&gsp->logintr);
 	nvkm_gsp_mem_dtor(&gsp->logrm);
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/rm.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/rm.c
index a4190676e1ad..e198212df9c5 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/rm.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/rm.c
@@ -11,6 +11,7 @@ r535_wpr_libos2 = {
 	.os_carveout_size = GSP_FW_HEAP_PARAM_OS_SIZE_LIBOS2,
 	.base_size = GSP_FW_HEAP_PARAM_BASE_RM_SIZE_TU10X,
 	.heap_size_min = GSP_FW_HEAP_SIZE_OVERRIDE_LIBOS2_MIN_MB,
+	.is_libos2 = true,
 };
 
 static const struct nvkm_rm_wpr
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r570/gsp.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r570/gsp.c
index 64011430f4c0..d9786830153d 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r570/gsp.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r570/gsp.c
@@ -236,6 +236,7 @@ r570_gsp_libos_init(struct nvkm_gsp *gsp)
 {
 	LibosMemoryRegionInitArgument *args;
 	int ret;
+	int idx;
 
 	ret = nvkm_gsp_mem_ctor(gsp, 0x1000, &gsp->libos);
 	if (ret)
@@ -255,15 +256,27 @@ r570_gsp_libos_init(struct nvkm_gsp *gsp)
 	if (ret)
 		return ret;
 
+	ret = gsp_fill_libos_entry(gsp, &args[3], 0x10000, &gsp->logmnoc, "LOGMNOC");
+	if (ret)
+		return ret;
+
+	idx = 4;
+	if (!gsp->rm->wpr->is_libos2) {
+		ret = gsp_fill_libos_entry(gsp, &args[idx], 0x10000, &gsp->logkrnl, "LOGKRNL");
+		if (ret)
+			return ret;
+		idx++;
+	}
+
 	ret = r535_gsp_rmargs_init(gsp, false);
 	if (ret)
 		return ret;
 
-	args[3].id8  = r535_gsp_libos_id8("RMARGS");
-	args[3].pa   = gsp->rmargs.addr;
-	args[3].size = gsp->rmargs.size;
-	args[3].kind = LIBOS_MEMORY_REGION_CONTIGUOUS;
-	args[3].loc  = LIBOS_MEMORY_REGION_LOC_SYSMEM;
+	args[idx].id8  = r535_gsp_libos_id8("RMARGS");
+	args[idx].pa   = gsp->rmargs.addr;
+	args[idx].size = gsp->rmargs.size;
+	args[idx].kind = LIBOS_MEMORY_REGION_CONTIGUOUS;
+	args[idx].loc  = LIBOS_MEMORY_REGION_LOC_SYSMEM;
 
 #ifdef CONFIG_DEBUG_FS
 	r535_gsp_libos_debugfs_init(gsp);
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r570/rm.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r570/rm.c
index 498658d0c60c..fa012756a731 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r570/rm.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r570/rm.c
@@ -11,6 +11,7 @@ r570_wpr_libos2 = {
 	.os_carveout_size = GSP_FW_HEAP_PARAM_OS_SIZE_LIBOS2,
 	.base_size = GSP_FW_HEAP_PARAM_BASE_RM_SIZE_TU10X,
 	.heap_size_min = GSP_FW_HEAP_SIZE_OVERRIDE_LIBOS2_MIN_MB,
+	.is_libos2 = true,
 };
 
 static const struct nvkm_rm_wpr
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/rm.h b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/rm.h
index cc9f33202673..b77059e0ac12 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/rm.h
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/rm.h
@@ -28,6 +28,7 @@ struct nvkm_rm_wpr {
 	u32 heap_size_non_wpr;
 	u32 rsvd_size_pmu;
 	bool offset_set_by_acr;
+	bool is_libos2;
 };
 
 struct nvkm_rm_api {
-- 
2.55.0


  parent reply	other threads:[~2026-07-29  4:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-29  4:15 nouveau/gsp: some r570 additions and refactoring Dave Airlie
2026-07-29  4:15 ` [PATCH 1/6] nouveau/gsp: refactor libos entry handling for r535 Dave Airlie
2026-07-29  4:15 ` [PATCH 2/6] nouveau/gsp: make libos init per-gsp version Dave Airlie
2026-07-29  4:32   ` sashiko-bot
2026-07-29  4:15 ` Dave Airlie [this message]
2026-07-29  4:33   ` [PATCH 3/6] nouveau/gsp: add logging entries for r570 sashiko-bot
2026-07-29  4:15 ` [PATCH 4/6] nouveau/gsp: refactor the chan allocation arguments into a struct Dave Airlie
2026-07-29  4:15 ` [PATCH 5/6] nouveau/gsp: add some more fields to r570 system info Dave Airlie
2026-07-29  4:29   ` sashiko-bot
2026-07-29  4:15 ` [PATCH 6/6] nouveau: set wpr boost flags like open driver does Dave Airlie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260729041653.3985549-4-airlied@gmail.com \
    --to=airlied@gmail.com \
    --cc=dakr@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=nouveau@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.