[Nouveau] [PATCH] Fixes while parsing perf tables on GF5

Emil Velikov emil.velikov at yahoo.co.uk
Sun Oct 10 11:26:59 PDT 2010


 From 3dcc41d053357a93e523f0bcca593ed061fdac57 Mon Sep 17 00:00:00 2001
From: Emil Velikov <eeydev at nottingham.ac.uk>
Date: Sun, 10 Oct 2010 19:21:30 +0100
Subject: [PATCH] Fixes while parsing perf tables on GF5

Perf tables v1.2 & 1.3 does not store voltage
Comment that the fanspeed does not apear to be valid for v1.5

Signed-off-by: Emil Velikov <emil.velikov at yahoo.co.uk>
---
  drivers/gpu/drm/nouveau/nouveau_perf.c |    4 +++-
  1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_perf.c  
b/drivers/gpu/drm/nouveau/nouveau_perf.c
index ac62a1b..d3725c1 100644
--- a/drivers/gpu/drm/nouveau/nouveau_perf.c
+++ b/drivers/gpu/drm/nouveau/nouveau_perf.c
@@ -133,8 +133,10 @@ nouveau_perf_init(struct drm_device *dev)
  		case 0x12:
  		case 0x13:
  		case 0x15:
+			/* XXX: Cant we really trust fanspeed on 0x15 */
  			perflvl->fanspeed = entry[55];
-			perflvl->voltage = entry[56];
+			/* Table v 1.2 and 1.3 does not have big enough recordlen to store the  
voltage */
+			perflvl->voltage = (recordlen > 56) ? entry[56] : 0;
  			perflvl->core = ROM32(entry[1]) * 10;
  			perflvl->memory = ROM32(entry[5]) * 20;
  			break;
-- 
1.7.2.3


More information about the Nouveau mailing list