From: Dave Airlie <airlied@gmail.com>
To: dri-devel@lists.freedesktop.org
Cc: nouveau@lists.freedesktop.org, dakr@kernel.org
Subject: [PATCH 5/6] nouveau/gsp: add some more fields to r570 system info
Date: Wed, 29 Jul 2026 14:15:29 +1000 [thread overview]
Message-ID: <20260729041653.3985549-6-airlied@gmail.com> (raw)
In-Reply-To: <20260729041653.3985549-1-airlied@gmail.com>
From: Dave Airlie <airlied@redhat.com>
This just adds the pci io bar, link cap and os page size to the r570.
Signed-off-by: Dave Airlie <airlied@redhat.com>
---
drivers/gpu/drm/nouveau/include/nvkm/core/device.h | 2 ++
drivers/gpu/drm/nouveau/nvkm/engine/device/pci.c | 13 +++++++++++++
.../gpu/drm/nouveau/nvkm/subdev/gsp/rm/r570/gsp.c | 5 +++++
3 files changed, 20 insertions(+)
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/device.h b/drivers/gpu/drm/nouveau/include/nvkm/core/device.h
index 954a89d43bad..68b2d8a0b78c 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/core/device.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/core/device.h
@@ -86,6 +86,7 @@ enum nvkm_bar_id {
NVKM_BAR0_PRI,
NVKM_BAR1_FB,
NVKM_BAR2_INST,
+ NVKM_BAR3_IO,
};
struct nvkm_device_func {
@@ -99,6 +100,7 @@ struct nvkm_device_func {
resource_size_t (*resource_addr)(struct nvkm_device *, enum nvkm_bar_id);
resource_size_t (*resource_size)(struct nvkm_device *, enum nvkm_bar_id);
bool cpu_coherent;
+ int (*link_cap)(struct nvkm_device *, u32 *lnk_cap);
};
struct nvkm_device_quirk {
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/pci.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/pci.c
index 248623b91e29..7cfa21d9abaa 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/device/pci.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/pci.c
@@ -1576,6 +1576,10 @@ nvkm_device_pci_resource_idx(struct nvkm_device_pci *pdev, enum nvkm_bar_id bar)
if (bar == NVKM_BAR2_INST)
return idx;
+ idx += (pci_resource_flags(pdev->pdev, idx) & IORESOURCE_MEM_64) ? 2 : 1;
+ if (bar == NVKM_BAR3_IO)
+ return idx;
+
WARN_ON(1);
return -1;
}
@@ -1628,6 +1632,14 @@ nvkm_device_pci_preinit(struct nvkm_device *device)
return 0;
}
+static int
+nvkm_device_pci_link_cap(struct nvkm_device *device, u32 *lnk_cap)
+{
+ struct nvkm_device_pci *pdev = nvkm_device_pci(device);
+
+ return pcie_capability_read_dword(pdev->pdev, PCI_EXP_LNKCAP, lnk_cap);
+}
+
static void *
nvkm_device_pci_dtor(struct nvkm_device *device)
{
@@ -1646,6 +1658,7 @@ nvkm_device_pci_func = {
.resource_addr = nvkm_device_pci_resource_addr,
.resource_size = nvkm_device_pci_resource_size,
.cpu_coherent = !IS_ENABLED(CONFIG_ARM),
+ .link_cap = nvkm_device_pci_link_cap,
};
int
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 d9786830153d..857eda1e7439 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
@@ -165,6 +165,7 @@ r570_gsp_set_system_info(struct nvkm_gsp *gsp)
info->gpuPhysAddr = device->func->resource_addr(device, NVKM_BAR0_PRI);
info->gpuPhysFbAddr = device->func->resource_addr(device, NVKM_BAR1_FB);
info->gpuPhysInstAddr = device->func->resource_addr(device, NVKM_BAR2_INST);
+ info->gpuPhysIoAddr = device->func->resource_addr(device, NVKM_BAR3_IO);
info->nvDomainBusDeviceFunc = pci_dev_id(pdev);
info->maxUserVa = TASK_SIZE;
info->pciConfigMirrorBase = device->pci->func->cfg.addr;
@@ -175,6 +176,10 @@ r570_gsp_set_system_info(struct nvkm_gsp *gsp)
r570_gsp_acpi_info(gsp, &info->acpiMethodData);
info->bIsPrimary = video_is_primary_device(device->dev);
info->bPreserveVideoMemoryAllocations = false;
+ info->hostPageSize = PAGE_SIZE;
+
+ if (device->func->link_cap)
+ device->func->link_cap(device, &info->pcieConfigReg.linkCap);
return nvkm_gsp_rpc_wr(gsp, info, NVKM_GSP_RPC_REPLY_NOSEQ);
}
--
2.55.0
next prev 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 ` [PATCH 3/6] nouveau/gsp: add logging entries for r570 Dave Airlie
2026-07-29 4:33 ` 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 ` Dave Airlie [this message]
2026-07-29 4:29 ` [PATCH 5/6] nouveau/gsp: add some more fields to r570 system info 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-6-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.