diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2013-12-03 01:09:55 (GMT) |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2014-01-23 03:39:02 (GMT) |
commit | 1a894c069d9790d398bb27767a6cc57d3c2f3146 (patch) | |
tree | fbe12bf39257053ea0039865e18906351e39a9ba /drivers | |
parent | a8ccbb7701d41a772d839acb3d81d7f9ac84c678 (diff) | |
download | linux-1a894c069d9790d398bb27767a6cc57d3c2f3146.tar.xz |
drm/nouveau/fb/gddr5: make sure we update mr7 when we're supposed to
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/nouveau/core/subdev/fb/gddr5.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/gpu/drm/nouveau/core/subdev/fb/gddr5.c b/drivers/gpu/drm/nouveau/core/subdev/fb/gddr5.c index 16f0117..66fe959 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/fb/gddr5.c +++ b/drivers/gpu/drm/nouveau/core/subdev/fb/gddr5.c @@ -25,6 +25,14 @@ #include <subdev/bios.h> #include "priv.h" +/* binary driver only executes this path if the condition (a) is true + * for any configuration (combination of rammap+ramcfg+timing) that + * can be reached on a given card. for now, we will execute the branch + * unconditionally in the hope that a "false everywhere" in the bios + * tables doesn't actually mean "don't touch this". + */ +#define NOTE00(a) 1 + int nouveau_gddr5_calc(struct nouveau_ram *ram, bool nuts) { @@ -99,10 +107,11 @@ nouveau_gddr5_calc(struct nouveau_ram *ram, bool nuts) ram->mr[6] |= (vo & 0xff) << 4; ram->mr[6] |= (pd & 0x01) << 0; - if (!(ram->mr[7] & 0x100)) - vr = 0; /* binary driver does this.. bug? */ - ram->mr[7] &= ~0x388; - ram->mr[7] |= (vr & 0x03) << 8; + if (NOTE00(vr)) { + ram->mr[7] &= ~0x300; + ram->mr[7] |= (vr & 0x03) << 8; + } + ram->mr[7] &= ~0x088; ram->mr[7] |= (vh & 0x01) << 7; ram->mr[7] |= (lf & 0x01) << 3; |