Commit a845fff8 authored by Roy Spliet's avatar Roy Spliet Committed by Ben Skeggs

drm/nouveau: fix thinkos in mem timing table recordlen check

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent ca8e7c6c
...@@ -35,6 +35,8 @@ ...@@ -35,6 +35,8 @@
#include "drm_sarea.h" #include "drm_sarea.h"
#include "nouveau_drv.h" #include "nouveau_drv.h"
#define MIN(a,b) a < b ? a : b
/* /*
* NV10-NV40 tiling helpers * NV10-NV40 tiling helpers
*/ */
...@@ -717,14 +719,14 @@ nouveau_mem_timing_init(struct drm_device *dev) ...@@ -717,14 +719,14 @@ nouveau_mem_timing_init(struct drm_device *dev)
tUNK_19 = 1; tUNK_19 = 1;
tUNK_20 = 0; tUNK_20 = 0;
tUNK_21 = 0; tUNK_21 = 0;
switch (recordlen) { switch (MIN(recordlen,21)) {
case 0x21: case 21:
tUNK_21 = entry[21]; tUNK_21 = entry[21];
case 0x20: case 20:
tUNK_20 = entry[20]; tUNK_20 = entry[20];
case 0x19: case 19:
tUNK_19 = entry[19]; tUNK_19 = entry[19];
case 0x18: case 18:
tUNK_18 = entry[18]; tUNK_18 = entry[18];
default: default:
tUNK_0 = entry[0]; tUNK_0 = entry[0];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment