diff options
author | Roy Spliet <r.spliet@student.tudelft.nl> | 2010-10-04 17:01:08 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2010-10-04 19:59:43 -0400 |
commit | a845fff841b13678b2d80f10425aba87db840e4a (patch) | |
tree | b94b3bda5b9a6cc5650585d5072788ab72949cc6 /drivers/gpu/drm/nouveau | |
parent | ca8e7c6ccdfb9a77de9b9719e6ef768373fb607c (diff) |
drm/nouveau: fix thinkos in mem timing table recordlen check
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_mem.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_mem.c b/drivers/gpu/drm/nouveau/nouveau_mem.c index 00b31b5e16c..a163c7c612e 100644 --- a/drivers/gpu/drm/nouveau/nouveau_mem.c +++ b/drivers/gpu/drm/nouveau/nouveau_mem.c | |||
@@ -35,6 +35,8 @@ | |||
35 | #include "drm_sarea.h" | 35 | #include "drm_sarea.h" |
36 | #include "nouveau_drv.h" | 36 | #include "nouveau_drv.h" |
37 | 37 | ||
38 | #define MIN(a,b) a < b ? a : b | ||
39 | |||
38 | /* | 40 | /* |
39 | * NV10-NV40 tiling helpers | 41 | * NV10-NV40 tiling helpers |
40 | */ | 42 | */ |
@@ -717,14 +719,14 @@ nouveau_mem_timing_init(struct drm_device *dev) | |||
717 | tUNK_19 = 1; | 719 | tUNK_19 = 1; |
718 | tUNK_20 = 0; | 720 | tUNK_20 = 0; |
719 | tUNK_21 = 0; | 721 | tUNK_21 = 0; |
720 | switch (recordlen) { | 722 | switch (MIN(recordlen,21)) { |
721 | case 0x21: | 723 | case 21: |
722 | tUNK_21 = entry[21]; | 724 | tUNK_21 = entry[21]; |
723 | case 0x20: | 725 | case 20: |
724 | tUNK_20 = entry[20]; | 726 | tUNK_20 = entry[20]; |
725 | case 0x19: | 727 | case 19: |
726 | tUNK_19 = entry[19]; | 728 | tUNK_19 = entry[19]; |
727 | case 0x18: | 729 | case 18: |
728 | tUNK_18 = entry[18]; | 730 | tUNK_18 = entry[18]; |
729 | default: | 731 | default: |
730 | tUNK_0 = entry[0]; | 732 | tUNK_0 = entry[0]; |