diff options
author | Wink Saville <wink@saville.com> | 2006-11-10 21:27:52 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-11-13 16:40:42 +0100 |
commit | e40c67597eac7a0b0e676867517b01a5a57f7b4b (patch) | |
tree | 842f4cc8ad5739c9935e4ca1aca8ad0743de54da /drivers/video/nvidia/nv_hw.c | |
parent | [PATCH] IPMI: Fix more && typos (diff) | |
download | linux-e40c67597eac7a0b0e676867517b01a5a57f7b4b.tar.xz 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.c | 12 |
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); |