diff options
author | Sergei Antonov <saproj@gmail.com> | 2014-04-15 17:18:37 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2014-04-17 23:15:18 -0400 |
commit | 9a11843987b29b7b7eff650bff7d5731ba5117d5 (patch) | |
tree | acdf119610e40bcea51ac79039eb2ec8289eba2d | |
parent | d62c3e7a73f87defb17651109a55d36adedadc6f (diff) |
drm/nouveau/bios: fix a bit shift error introduced by 457e77b
Commit 457e77b26428ab4a24998eecfb99f27fa4195397 added two checks applied to a
value received from nv_rd32(bios, 0x619f04). But after this new piece of code
is executed, the addr local variable does not hold the same value it used to
hold before the commit. Here is what is was assigned in the original code:
(u64)(nv_rd32(bios, 0x619f04) & 0xffffff00) << 8
in the committed code it ends up with this value:
(u64)(nv_rd32(bios, 0x619f04) >> 8) << 8
These expressions are obviously not equivalent.
My Nvidia video card does not show anything on the display when I boot a
kernel containing this commit.
The patch fixes the code so that the new checks are still done, but the
side effect of an incorrect addr value is gone.
Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sergei Antonov <saproj@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r-- | drivers/gpu/drm/nouveau/core/subdev/bios/base.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/core/subdev/bios/base.c b/drivers/gpu/drm/nouveau/core/subdev/bios/base.c index e9df94f96d78..fb0b6b2d1427 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/bios/base.c +++ b/drivers/gpu/drm/nouveau/core/subdev/bios/base.c | |||
@@ -109,7 +109,7 @@ nouveau_bios_shadow_pramin(struct nouveau_bios *bios) | |||
109 | return; | 109 | return; |
110 | } | 110 | } |
111 | 111 | ||
112 | addr = (u64)(addr >> 8) << 8; | 112 | addr = (addr & 0xffffff00) << 8; |
113 | if (!addr) { | 113 | if (!addr) { |
114 | addr = (u64)nv_rd32(bios, 0x001700) << 16; | 114 | addr = (u64)nv_rd32(bios, 0x001700) << 16; |
115 | addr += 0xf0000; | 115 | addr += 0xf0000; |