Re: [Nouveau] [PATCH] drm/nvc0/pm: read core/shader/memory clocks (more) correctly

2011-04-17 Thread Ben Skeggs
On Sun, 2011-04-17 at 17:10 +0200, Martin Peres wrote:
 ---
  drivers/gpu/drm/nouveau/nouveau_perf.c |6 +++---
  1 files changed, 3 insertions(+), 3 deletions(-)
 
 diff --git a/drivers/gpu/drm/nouveau/nouveau_perf.c 
 b/drivers/gpu/drm/nouveau/nouveau_perf.c
 index 950caba..d64a98a 100644
 --- a/drivers/gpu/drm/nouveau/nouveau_perf.c
 +++ b/drivers/gpu/drm/nouveau/nouveau_perf.c
 @@ -177,9 +177,9 @@ nouveau_perf_init(struct drm_device *dev)
  #define subent(n) entry[perf[2] + ((n) * perf[3])]
   perflvl-fanspeed = 0; /*XXX*/
   perflvl-voltage = entry[2];
 - perflvl-core = (ROM16(subent(0))  0xfff) * 1000;
 - perflvl-shader = (ROM16(subent(1))  0xfff) * 1000;
 - perflvl-memory = (ROM16(subent(2))  0xfff) * 1000;
 + perflvl-core = (ROM16(subent(3))  0xfff) * 1000;
 + perflvl-shader = (ROM16(subent(3))  0xfff) / 2 * 1000;
 + perflvl-memory = (ROM16(subent(5))  0xfff) * 1000;
Um, NACK.  This is *definitely* very very wrong on NVA8, which uses
version 0x40 of this table too.

Ben.

   break;
   }
  


___
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau


Re: [Nouveau] [PATCH] drm/nvc0/pm: read core/shader/memory clocks (more) correctly

2011-04-17 Thread Martin Peres

Le 18/04/2011 00:32, Ben Skeggs a écrit :

On Sun, 2011-04-17 at 17:10 +0200, Martin Peres wrote:

---
  drivers/gpu/drm/nouveau/nouveau_perf.c |6 +++---
  1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_perf.c 
b/drivers/gpu/drm/nouveau/nouveau_perf.c
index 950caba..d64a98a 100644
--- a/drivers/gpu/drm/nouveau/nouveau_perf.c
+++ b/drivers/gpu/drm/nouveau/nouveau_perf.c
@@ -177,9 +177,9 @@ nouveau_perf_init(struct drm_device *dev)
  #define subent(n) entry[perf[2] + ((n) * perf[3])]
perflvl-fanspeed = 0; /*XXX*/
perflvl-voltage = entry[2];
-   perflvl-core = (ROM16(subent(0))  0xfff) * 1000;
-   perflvl-shader = (ROM16(subent(1))  0xfff) * 1000;
-   perflvl-memory = (ROM16(subent(2))  0xfff) * 1000;
+   perflvl-core = (ROM16(subent(3))  0xfff) * 1000;
+   perflvl-shader = (ROM16(subent(3))  0xfff) / 2 * 1000;
+   perflvl-memory = (ROM16(subent(5))  0xfff) * 1000;

Um, NACK.  This is *definitely* very very wrong on NVA8, which uses
version 0x40 of this table too.

Ben.
Crap, I would have sworn this table was introduced for Fermi! Sorry for 
the noise then, I'll try to find a fix for that (other than looking at 
the codename).

___
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau


Re: [Nouveau] [PATCH] drm/nvc0/pm: read core/shader/memory clocks (more) correctly

2011-04-17 Thread Ben Skeggs
On Mon, 2011-04-18 at 00:54 +0200, Martin Peres wrote:
 Le 18/04/2011 00:32, Ben Skeggs a écrit :
  On Sun, 2011-04-17 at 17:10 +0200, Martin Peres wrote:
  ---
drivers/gpu/drm/nouveau/nouveau_perf.c |6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
 
  diff --git a/drivers/gpu/drm/nouveau/nouveau_perf.c 
  b/drivers/gpu/drm/nouveau/nouveau_perf.c
  index 950caba..d64a98a 100644
  --- a/drivers/gpu/drm/nouveau/nouveau_perf.c
  +++ b/drivers/gpu/drm/nouveau/nouveau_perf.c
  @@ -177,9 +177,9 @@ nouveau_perf_init(struct drm_device *dev)
#define subent(n) entry[perf[2] + ((n) * perf[3])]
 perflvl-fanspeed = 0; /*XXX*/
 perflvl-voltage = entry[2];
  -  perflvl-core = (ROM16(subent(0))  0xfff) * 1000;
  -  perflvl-shader = (ROM16(subent(1))  0xfff) * 1000;
  -  perflvl-memory = (ROM16(subent(2))  0xfff) * 1000;
  +  perflvl-core = (ROM16(subent(3))  0xfff) * 1000;
  +  perflvl-shader = (ROM16(subent(3))  0xfff) / 2 * 1000;
  +  perflvl-memory = (ROM16(subent(5))  0xfff) * 1000;
  Um, NACK.  This is *definitely* very very wrong on NVA8, which uses
  version 0x40 of this table too.
 
  Ben.
 Crap, I would have sworn this table was introduced for Fermi! Sorry for 
 the noise then, I'll try to find a fix for that (other than looking at 
 the codename).
I'm highly skeptical that it's correct on fermi too, but, I can't check
that myself right now.  I shall do it during the week however.

Ben.


___
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau


Re: [Nouveau] [PATCH] drm/nvc0/pm: read core/shader/memory clocks (more) correctly

2011-04-17 Thread Martin Peres

Le 18/04/2011 00:56, Ben Skeggs a écrit :

On Mon, 2011-04-18 at 00:54 +0200, Martin Peres wrote:

Le 18/04/2011 00:32, Ben Skeggs a écrit :

On Sun, 2011-04-17 at 17:10 +0200, Martin Peres wrote:

---
   drivers/gpu/drm/nouveau/nouveau_perf.c |6 +++---
   1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_perf.c 
b/drivers/gpu/drm/nouveau/nouveau_perf.c
index 950caba..d64a98a 100644
--- a/drivers/gpu/drm/nouveau/nouveau_perf.c
+++ b/drivers/gpu/drm/nouveau/nouveau_perf.c
@@ -177,9 +177,9 @@ nouveau_perf_init(struct drm_device *dev)
   #define subent(n) entry[perf[2] + ((n) * perf[3])]
perflvl-fanspeed = 0; /*XXX*/
perflvl-voltage = entry[2];
-   perflvl-core = (ROM16(subent(0))   0xfff) * 1000;
-   perflvl-shader = (ROM16(subent(1))   0xfff) * 1000;
-   perflvl-memory = (ROM16(subent(2))   0xfff) * 1000;
+   perflvl-core = (ROM16(subent(3))   0xfff) * 1000;
+   perflvl-shader = (ROM16(subent(3))   0xfff) / 2 * 
1000;
+   perflvl-memory = (ROM16(subent(5))   0xfff) * 1000;

Um, NACK.  This is *definitely* very very wrong on NVA8, which uses
version 0x40 of this table too.

Ben.

Crap, I would have sworn this table was introduced for Fermi! Sorry for
the noise then, I'll try to find a fix for that (other than looking at
the codename).

I'm highly skeptical that it's correct on fermi too, but, I can't check
that myself right now.  I shall do it during the week however.

Ben.
I was also highly skeptical about this, but I looked at all the vbios 
and it seemed good on all of them.


Then, I looked at tools like nibitor or Fermi bios editor 
(http://www.xtremesystems.org/forums/showthread.php?t=256367) which also 
highlights the subentries 3 and 5.


I'll look further and try to see if ramcfg could help us select the 
right subentries.

___
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau