From: Karol Herbst <kherbst@redhat.com>
To: linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org,
dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org
Cc: Karol Herbst <kherbst@redhat.com>, Lyude Paul <lyude@redhat.com>,
Alex Hung <alex.hung@canonical.com>,
"Rafael J . Wysocki" <rafael.j.wysocki@intel.com>,
Dave Airlie <airlied@redhat.com>, Ben Skeggs <bskeggs@redhat.com>
Subject: [PATCH 4/7] drm/nouveau/pci: enable pcie link changes for pascal
Date: Wed, 14 Aug 2019 23:31:15 +0200 [thread overview]
Message-ID: <20190814213118.28473-5-kherbst@redhat.com> (raw)
In-Reply-To: <20190814213118.28473-1-kherbst@redhat.com>
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
CC: Alex Hung <alex.hung@canonical.com>
CC: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
CC: Dave Airlie <airlied@redhat.com>
CC: Lyude Paul <lyude@redhat.com>
CC: Ben Skeggs <bskeggs@redhat.com>
---
drivers/gpu/drm/nouveau/nvkm/subdev/pci/gk104.c | 8 ++++----
drivers/gpu/drm/nouveau/nvkm/subdev/pci/gp100.c | 10 ++++++++++
drivers/gpu/drm/nouveau/nvkm/subdev/pci/priv.h | 5 +++++
3 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/pci/gk104.c b/drivers/gpu/drm/nouveau/nvkm/subdev/pci/gk104.c
index e68030507d88..664890185e15 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/pci/gk104.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/pci/gk104.c
@@ -23,7 +23,7 @@
*/
#include "priv.h"
-static int
+int
gk104_pcie_version_supported(struct nvkm_pci *pci)
{
return (nvkm_rd32(pci->subdev.device, 0x8c1c0) & 0x4) == 0x4 ? 2 : 1;
@@ -108,7 +108,7 @@ gk104_pcie_lnkctl_speed(struct nvkm_pci *pci)
return -1;
}
-static enum nvkm_pcie_speed
+enum nvkm_pcie_speed
gk104_pcie_max_speed(struct nvkm_pci *pci)
{
u32 max_speed = nvkm_rd32(pci->subdev.device, 0x8c1c0) & 0x300000;
@@ -146,7 +146,7 @@ gk104_pcie_set_link_speed(struct nvkm_pci *pci, enum nvkm_pcie_speed speed)
nvkm_mask(device, 0x8c040, 0x1, 0x1);
}
-static int
+int
gk104_pcie_init(struct nvkm_pci * pci)
{
enum nvkm_pcie_speed lnkctl_speed, max_speed, cap_speed;
@@ -178,7 +178,7 @@ gk104_pcie_init(struct nvkm_pci * pci)
return 0;
}
-static int
+int
gk104_pcie_set_link(struct nvkm_pci *pci, enum nvkm_pcie_speed speed, u8 width)
{
struct nvkm_subdev *subdev = &pci->subdev;
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/pci/gp100.c b/drivers/gpu/drm/nouveau/nvkm/subdev/pci/gp100.c
index 82c5234a06ff..eb19c7a44561 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/pci/gp100.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/pci/gp100.c
@@ -35,6 +35,16 @@ gp100_pci_func = {
.wr08 = nv40_pci_wr08,
.wr32 = nv40_pci_wr32,
.msi_rearm = gp100_pci_msi_rearm,
+
+ .pcie.init = gk104_pcie_init,
+ .pcie.set_link = gk104_pcie_set_link,
+
+ .pcie.max_speed = gk104_pcie_max_speed,
+ .pcie.cur_speed = g84_pcie_cur_speed,
+
+ .pcie.set_version = gf100_pcie_set_version,
+ .pcie.version = gf100_pcie_version,
+ .pcie.version_supported = gk104_pcie_version_supported,
};
int
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/pci/priv.h b/drivers/gpu/drm/nouveau/nvkm/subdev/pci/priv.h
index 7009aad86b6e..162ed5dc6fc3 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/pci/priv.h
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/pci/priv.h
@@ -54,6 +54,11 @@ int gf100_pcie_cap_speed(struct nvkm_pci *);
int gf100_pcie_init(struct nvkm_pci *);
int gf100_pcie_set_link(struct nvkm_pci *, enum nvkm_pcie_speed, u8);
+int gk104_pcie_init(struct nvkm_pci *);
+int gk104_pcie_set_link(struct nvkm_pci *, enum nvkm_pcie_speed, u8 width);
+enum nvkm_pcie_speed gk104_pcie_max_speed(struct nvkm_pci *);
+int gk104_pcie_version_supported(struct nvkm_pci *);
+
int nvkm_pcie_oneinit(struct nvkm_pci *);
int nvkm_pcie_init(struct nvkm_pci *);
#endif
--
2.21.0
next prev parent reply other threads:[~2019-08-14 21:32 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-14 21:31 [PATCH 0/7] Adding a proper workaround for fixing RTD3 issues with Nouveau Karol Herbst
2019-08-14 21:31 ` [PATCH 1/7] Revert "ACPI / OSI: Add OEM _OSI string to enable dGPU direct output" Karol Herbst
2019-08-14 21:49 ` Alex Hung
2019-08-14 22:47 ` [Nouveau] " Dave Airlie
2019-08-15 13:55 ` Mario.Limonciello
2019-08-15 14:04 ` Karol Herbst
2019-08-15 14:13 ` Alex Deucher
2019-08-15 14:15 ` Karol Herbst
2019-08-15 14:17 ` Alex Deucher
2019-08-15 14:23 ` Mario.Limonciello
2019-08-15 14:35 ` Karol Herbst
2019-08-15 14:41 ` Alex Deucher
2019-08-15 14:19 ` Mario.Limonciello
2019-08-15 14:25 ` Karol Herbst
2019-08-15 14:34 ` Mario.Limonciello
2019-08-15 14:36 ` Karol Herbst
2019-08-15 14:37 ` Alex Deucher
2019-08-15 14:56 ` Takashi Iwai
2019-08-15 16:19 ` Mario.Limonciello
2019-08-15 17:43 ` Takashi Iwai
2019-08-15 18:34 ` Alex Deucher
2019-08-15 14:59 ` Alex Deucher
2019-08-15 14:11 ` Daniel Vetter
2019-08-19 9:52 ` Rafael J. Wysocki
2019-09-05 15:51 ` Karol Herbst
2019-09-05 16:26 ` Rafael J. Wysocki
2019-09-09 21:07 ` Alex Hung
2019-10-21 2:14 ` Alex Hung
2019-10-21 8:14 ` Rafael J. Wysocki
2019-10-21 8:48 ` Karol Herbst
2019-10-21 8:54 ` Rafael J. Wysocki
2019-09-05 16:35 ` Alex Deucher
2019-08-14 21:31 ` [PATCH 2/7] Revert "ACPI / OSI: Add OEM _OSI string to enable NVidia HDMI audio" Karol Herbst
2020-12-10 17:59 ` Lyude Paul
2019-08-14 21:31 ` [PATCH 3/7] Revert "ACPI / OSI: Add OEM _OSI strings to disable NVidia RTD3" Karol Herbst
2019-08-14 23:34 ` Alex Hung
2019-08-15 4:44 ` Karol Herbst
2019-08-14 21:31 ` Karol Herbst [this message]
2019-08-14 21:31 ` [PATCH 5/7] drm/nouveau/pci: add nvkm_pcie_get_speed Karol Herbst
2019-08-14 21:31 ` [PATCH 6/7] drm/nouveau/pci: save the boot pcie link speed and restore it on fini Karol Herbst
2019-08-14 21:31 ` [PATCH 7/7] drm/nouveau: abort runtime suspend if we hit an error Karol Herbst
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=20190814213118.28473-5-kherbst@redhat.com \
--to=kherbst@redhat.com \
--cc=airlied@redhat.com \
--cc=alex.hung@canonical.com \
--cc=bskeggs@redhat.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lyude@redhat.com \
--cc=nouveau@lists.freedesktop.org \
--cc=rafael.j.wysocki@intel.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).