diff options
author | Ilia Mirkin <imirkin@alum.mit.edu> | 2017-01-19 22:56:30 -0500 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2017-01-31 05:05:26 -0500 |
commit | 24bf7ae359b8cca165bb30742d2b1c03a1eb23af (patch) | |
tree | 6aeadac4a9dee3adc155b2bf65a72cdc8e1e2ed4 | |
parent | d347583a39e2df609a9e40c835f72d3614665b53 (diff) |
drm/nouveau/nv1a,nv1f/disp: fix memory clock rate retrieval
Based on the xf86-video-nv code, NFORCE (NV1A) and NFORCE2 (NV1F) have a
different way of retrieving clocks. See the
nv_hw.c:nForceUpdateArbitrationSettings function in the original code
for how these clocks were accessed.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54587
Cc: stable@vger.kernel.org
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r-- | drivers/gpu/drm/nouveau/dispnv04/hw.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/dispnv04/hw.c b/drivers/gpu/drm/nouveau/dispnv04/hw.c index 74856a8b8f35..e64f52464ecf 100644 --- a/drivers/gpu/drm/nouveau/dispnv04/hw.c +++ b/drivers/gpu/drm/nouveau/dispnv04/hw.c | |||
@@ -222,6 +222,7 @@ nouveau_hw_get_clock(struct drm_device *dev, enum nvbios_pll_type plltype) | |||
222 | uint32_t mpllP; | 222 | uint32_t mpllP; |
223 | 223 | ||
224 | pci_read_config_dword(pci_get_bus_and_slot(0, 3), 0x6c, &mpllP); | 224 | pci_read_config_dword(pci_get_bus_and_slot(0, 3), 0x6c, &mpllP); |
225 | mpllP = (mpllP >> 8) & 0xf; | ||
225 | if (!mpllP) | 226 | if (!mpllP) |
226 | mpllP = 4; | 227 | mpllP = 4; |
227 | 228 | ||
@@ -232,7 +233,7 @@ nouveau_hw_get_clock(struct drm_device *dev, enum nvbios_pll_type plltype) | |||
232 | uint32_t clock; | 233 | uint32_t clock; |
233 | 234 | ||
234 | pci_read_config_dword(pci_get_bus_and_slot(0, 5), 0x4c, &clock); | 235 | pci_read_config_dword(pci_get_bus_and_slot(0, 5), 0x4c, &clock); |
235 | return clock; | 236 | return clock / 1000; |
236 | } | 237 | } |
237 | 238 | ||
238 | ret = nouveau_hw_get_pllvals(dev, plltype, &pllvals); | 239 | ret = nouveau_hw_get_pllvals(dev, plltype, &pllvals); |