summaryrefslogtreecommitdiffstats
path: root/drivers/video/nvidia/nv_hw.c
diff options
context:
space:
mode:
authorWink Saville <wink@saville.com>2006-11-10 12:27:52 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2006-11-13 07:40:42 -0800
commite40c67597eac7a0b0e676867517b01a5a57f7b4b (patch)
tree842f4cc8ad5739c9935e4ca1aca8ad0743de54da /drivers/video/nvidia/nv_hw.c
parent7947d2cc2c2e01125a393de83862d02b621999fe (diff)
downloadblackbird-op-linux-e40c67597eac7a0b0e676867517b01a5a57f7b4b.tar.gz
blackbird-op-linux-e40c67597eac7a0b0e676867517b01a5a57f7b4b.zip
[PATCH] Patch for nvidia divide by zero error for 7600 pci-express card
The following patch resolves the divide by zero error I encountered on my system: http://marc.10east.com/?l=linux-fbdev-devel&m=116058257024413&w=2 I accomplished this by merging what I thought was appropriate from: http://webcvs.freedesktop.org/xorg/driver/xf86-video-nv/src/ Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/video/nvidia/nv_hw.c')
-rw-r--r--drivers/video/nvidia/nv_hw.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/video/nvidia/nv_hw.c b/drivers/video/nvidia/nv_hw.c
index 9ed640d35728..ea426115c6f9 100644
--- a/drivers/video/nvidia/nv_hw.c
+++ b/drivers/video/nvidia/nv_hw.c
@@ -145,12 +145,18 @@ static void nvGetClocks(struct nvidia_par *par, unsigned int *MClk,
if (par->Architecture >= NV_ARCH_40) {
pll = NV_RD32(par->PMC, 0x4020);
- P = (pll >> 16) & 0x03;
+ P = (pll >> 16) & 0x07;
pll = NV_RD32(par->PMC, 0x4024);
M = pll & 0xFF;
N = (pll >> 8) & 0xFF;
- MB = (pll >> 16) & 0xFF;
- NB = (pll >> 24) & 0xFF;
+ if (((par->Chipset & 0xfff0) == 0x0290) ||
+ ((par->Chipset & 0xfff0) == 0x0390)) {
+ MB = 1;
+ NB = 1;
+ } else {
+ MB = (pll >> 16) & 0xFF;
+ NB = (pll >> 24) & 0xFF;
+ }
*MClk = ((N * NB * par->CrystalFreqKHz) / (M * MB)) >> P;
pll = NV_RD32(par->PMC, 0x4000);
OpenPOWER on IntegriCloud