linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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 5/7] drm/nouveau/pci: add nvkm_pcie_get_speed
Date: Wed, 14 Aug 2019 23:31:16 +0200	[thread overview]
Message-ID: <20190814213118.28473-6-kherbst@redhat.com> (raw)
In-Reply-To: <20190814213118.28473-1-kherbst@redhat.com>

v2: fixed compilation error

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/include/nvkm/subdev/pci.h | 1 +
 drivers/gpu/drm/nouveau/nvkm/subdev/pci/pcie.c    | 8 ++++++++
 2 files changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/pci.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/pci.h
index 4803a4fad4a2..b29101e485f9 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/pci.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/pci.h
@@ -53,4 +53,5 @@ int gp100_pci_new(struct nvkm_device *, int, struct nvkm_pci **);
 
 /* pcie functions */
 int nvkm_pcie_set_link(struct nvkm_pci *, enum nvkm_pcie_speed, u8 width);
+enum nvkm_pcie_speed nvkm_pcie_get_speed(struct nvkm_pci *);
 #endif
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/pci/pcie.c b/drivers/gpu/drm/nouveau/nvkm/subdev/pci/pcie.c
index d71e5db5028a..03be24930c0e 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/pci/pcie.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/pci/pcie.c
@@ -163,3 +163,11 @@ nvkm_pcie_set_link(struct nvkm_pci *pci, enum nvkm_pcie_speed speed, u8 width)
 
 	return ret;
 }
+
+enum nvkm_pcie_speed
+nvkm_pcie_get_speed(struct nvkm_pci *pci)
+{
+	if (!pci || !pci_is_pcie(pci->pdev) || !pci->func->pcie.cur_speed)
+		return -ENODEV;
+	return pci->func->pcie.cur_speed(pci);
+}
-- 
2.21.0


  parent reply	other threads:[~2019-08-14 21:31 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 ` [PATCH 4/7] drm/nouveau/pci: enable pcie link changes for pascal Karol Herbst
2019-08-14 21:31 ` Karol Herbst [this message]
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-6-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).