[Nouveau] [Bug 71620] nouveau_fence_wait_uevent NULL pointer dereference

2014-08-16 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=71620

Ilia Mirkin  changed:

   What|Removed |Added

 CC||mattia@gmail.com

--- Comment #6 from Ilia Mirkin  ---
*** Bug 82704 has been marked as a duplicate of this bug. ***

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau


[Nouveau] [Bug 82704] [NV92] null deref in nouveau_fence_wait_uevent

2014-08-16 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=82704

Ilia Mirkin  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |DUPLICATE
Summary|kernel bug  |[NV92] null deref in
   ||nouveau_fence_wait_uevent

--- Comment #3 from Ilia Mirkin  ---


*** This bug has been marked as a duplicate of bug 71620 ***

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau


Re: [Nouveau] Coordinate systems on on nv10-era cards

2014-08-16 Thread Ilia Mirkin
Just to close the loop on this, I tracked down what the issue was --
vbo state updates weren't happening properly, which in turn messed all
sorts of things up. Fixed in
http://cgit.freedesktop.org/mesa/mesa/commit/?id=8867ffbf95808dfa82029ad89d1571799a242d4d

On Fri, Aug 15, 2014 at 3:00 AM, Ilia Mirkin  wrote:
> So I did a lot more debugging on this. I wrote a program that draws a
> triangle to an fbo, and then blits that to fb 0. If I draw the
> triangle with
>
>   glBegin(GL_TRIANGLES);
> glColor3f(1, 0, 0); glVertex3f(-0.6*128 + 128, -0.75*128 + 128, 0.5);
> glColor3f(0, 1, 0); glVertex3f(0.6*128 + 128, -0.75*128 + 128, 0);
> glColor3f(0, 0, 1); glVertex3f(128, 0.75*128 + 128, 0);
>   glEnd();
>
> Then all is well. However if I do:
>
>   float verts[3][6] = {
> { -0.6*128 + 128, -0.75*128 + 128, 0.5, 1, 0, 0 },
> { 0.6*128 + 128, -0.75*128 + 128, 0, 0, 1, 0 },
> { 128, 0.75*128 + 128, 0, 0, 0, 1 },
>   };
>
>   glVertexPointer(3, GL_FLOAT, 24, verts);
>   glColorPointer(3, GL_FLOAT, 24, &verts[0][3]);
>   glEnableClientState(GL_VERTEX_ARRAY);
>   glEnableClientState(GL_COLOR_ARRAY);
>
>   glDrawArrays(GL_TRIANGLES, 0, 3);
>
>   glDisableClientState(GL_VERTEX_ARRAY);
>   glDisableClientState(GL_COLOR_ARRAY);
>
> Then I see the failure. Looking at the pushbuf for where the blit
> happens (after the draw), for the working case, I'm seeing
>
> PB: 0x2c22   NV17_3D.VTXBUF_FMT[0] = { TYPE = V32_FLOAT | FIELDS =
> 2 | STRIDE = 44 }
> PB: 0x2c22   NV17_3D.VTXBUF_FMT[0x3] = { TYPE = V32_FLOAT | FIELDS
> = 2 | STRIDE = 44 }
>
> (0 = position, 3 = texcoord0)
>
> and for the bad case:
>
> PB: 0x0c32   NV17_3D.VTXBUF_FMT[0] = { TYPE = V32_FLOAT | FIELDS =
> 3 | STRIDE = 12 }
> PB: 0x0c32   NV17_3D.VTXBUF_FMT[0x1] = { TYPE = V32_FLOAT | FIELDS
> = 3 | STRIDE = 12 }
>
> (1 = color) which is the exact same setup as the one used to perform
> the draw. I'm guessing whatever meta_BlitFramebuffer is doing isn't
> sufficiently overriding the original vbo setup. (Although the actual
> addresses of the buffers are now different, so it's not completely
> ignoring the vertices used for the blit...)
>
> I'll keep looking at this, but if anyone has any ideas, let me know.
>
>
> On Sun, Aug 10, 2014 at 7:32 PM, Ilia Mirkin  wrote:
>> Hello,
>>
>> I'm trying to debug why fbo-copyteximage-simple is failing, and I'm...
>> failing. It's an extremely simple test. I'm pretty sure that the
>> copyteximage part of it has nothing to do with the failure, at least
>> it behaves identically when I just return tex instead of copiex_tex.
>>
>> Without any modifications, the test just renders one big red square. I
>> think there's something wrong with the coordinate systems since if I
>> change
>>
>> glColor4fv(red);
>> piglit_draw_rect(0, 0, TEX_WIDTH / 2, TEX_HEIGHT / 2);
>>
>> to instead be
>>
>> piglit_draw_rect(1, 1, TEX_WIDTH / 2, TEX_HEIGHT / 2);
>>
>> Then the result is all black. So I think that the coordinates are
>> being scaled up somewhere they're not supposed to be (or, conversely,
>> not being scaled down when they are supposed to be). The projection
>> matrix sent to the card is {x - 128, y - 128, z * 32767.5, 1 }. Should
>> it be scaling the coordinates down to the -1, 1 range instead? i.e. is
>> get_viewport_scale() just totally wrong? Or something in
>> nv10_emit_projection?
>>
>> Ideas welcome :)
>>
>>   -ilia
___
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau


[Nouveau] [PATCH 3/3] gm107/therm: add PWM fan support v2

2014-08-16 Thread Martin Peres
v2: change the copyright ownership from "Nouveau Community" to myself, as per
Illia's recommendation.

Signed-off-by: Martin Peres 
---
 drm/Kbuild|  1 +
 drm/core/subdev/therm/gm107.c |  1 +
 nvkm/engine/device/gm100.c|  4 +-
 nvkm/include/subdev/therm.h   |  1 +
 nvkm/subdev/therm/Makefile.am |  3 +-
 nvkm/subdev/therm/fan.c   |  9 -
 nvkm/subdev/therm/gm107.c | 93 +++
 nvkm/subdev/therm/nvd0.c  |  2 +-
 nvkm/subdev/therm/priv.h  |  2 +
 9 files changed, 109 insertions(+), 7 deletions(-)
 create mode 12 drm/core/subdev/therm/gm107.c
 create mode 100644 nvkm/subdev/therm/gm107.c

diff --git a/drm/Kbuild b/drm/Kbuild
index 75aa5e3..c663181 100644
--- a/drm/Kbuild
+++ b/drm/Kbuild
@@ -191,6 +191,7 @@ nouveau-y += core/subdev/therm/nv50.o
 nouveau-y += core/subdev/therm/nv84.o
 nouveau-y += core/subdev/therm/nva3.o
 nouveau-y += core/subdev/therm/nvd0.o
+nouveau-y += core/subdev/therm/gm107.o
 nouveau-y += core/subdev/timer/base.o
 nouveau-y += core/subdev/timer/nv04.o
 nouveau-y += core/subdev/timer/gk20a.o
diff --git a/drm/core/subdev/therm/gm107.c b/drm/core/subdev/therm/gm107.c
new file mode 12
index 000..aafc986
--- /dev/null
+++ b/drm/core/subdev/therm/gm107.c
@@ -0,0 +1 @@
+../../../../nvkm/subdev/therm/gm107.c
\ No newline at end of file
diff --git a/nvkm/engine/device/gm100.c b/nvkm/engine/device/gm100.c
index 377ec0b..136dd98 100644
--- a/nvkm/engine/device/gm100.c
+++ b/nvkm/engine/device/gm100.c
@@ -63,9 +63,7 @@ gm100_identify(struct nouveau_device *device)
device->oclass[NVDEV_SUBDEV_GPIO   ] =  nve0_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C] =  nvd0_i2c_oclass;
device->oclass[NVDEV_SUBDEV_CLOCK  ] = &nve0_clock_oclass;
-#if 0
-   device->oclass[NVDEV_SUBDEV_THERM  ] = &nvd0_therm_oclass;
-#endif
+   device->oclass[NVDEV_SUBDEV_THERM  ] = &gm107_therm_oclass;
device->oclass[NVDEV_SUBDEV_MXM] = &nv50_mxm_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] =  gm107_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] =  gk20a_mc_oclass;
diff --git a/nvkm/include/subdev/therm.h b/nvkm/include/subdev/therm.h
index d4a6817..a437597 100644
--- a/nvkm/include/subdev/therm.h
+++ b/nvkm/include/subdev/therm.h
@@ -78,5 +78,6 @@ extern struct nouveau_oclass nv50_therm_oclass;
 extern struct nouveau_oclass nv84_therm_oclass;
 extern struct nouveau_oclass nva3_therm_oclass;
 extern struct nouveau_oclass nvd0_therm_oclass;
+extern struct nouveau_oclass gm107_therm_oclass;
 
 #endif
diff --git a/nvkm/subdev/therm/Makefile.am b/nvkm/subdev/therm/Makefile.am
index 460e4a0..b4f6da6 100644
--- a/nvkm/subdev/therm/Makefile.am
+++ b/nvkm/subdev/therm/Makefile.am
@@ -11,6 +11,7 @@ libtherm_la_SOURCES = base.c \
  nv50.c \
  nv84.c \
  nva3.c \
- nvd0.c
+ nvd0.c \
+ gm107.c
 
 include $(srcdir)/../Makefile.subdev
diff --git a/nvkm/subdev/therm/fan.c b/nvkm/subdev/therm/fan.c
index 016990a..402c9be 100644
--- a/nvkm/subdev/therm/fan.c
+++ b/nvkm/subdev/therm/fan.c
@@ -31,6 +31,8 @@
 #include 
 #include 
 
+#include 
+
 static int
 nouveau_fan_update(struct nouveau_fan *fan, bool immediate, int target)
 {
@@ -275,8 +277,11 @@ nouveau_therm_fan_ctor(struct nouveau_therm *therm)
/* other random init... */
nouveau_therm_fan_set_defaults(therm);
nvbios_perf_fan_parse(bios, &priv->fan->perf);
-   if (nvbios_therm_fan_parse(bios, &priv->fan->bios))
-   nv_error(therm, "parsing the thermal table failed\n");
+   if (nvbios_fan_parse(bios, &priv->fan->bios)) {
+   nv_debug(therm, "parsing the fan table failed\n");
+   if (nvbios_therm_fan_parse(bios, &priv->fan->bios))
+   nv_error(therm, "parsing both fan tables failed\n");
+   }
nouveau_therm_fan_safety_checks(therm);
return 0;
 }
diff --git a/nvkm/subdev/therm/gm107.c b/nvkm/subdev/therm/gm107.c
new file mode 100644
index 000..2c58733
--- /dev/null
+++ b/nvkm/subdev/therm/gm107.c
@@ -0,0 +1,93 @@
+/*
+ * Copyright 2014 Martin Peres
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT

[Nouveau] [PATCH 3/3] gm107/therm: add PWM fan support

2014-08-16 Thread Martin Peres
From: Martin Peres 

Signed-off-by: Martin Peres 
---
 drm/Kbuild|  1 +
 drm/core/subdev/therm/gm107.c |  1 +
 nvkm/engine/device/gm100.c|  4 +-
 nvkm/include/subdev/therm.h   |  1 +
 nvkm/subdev/therm/Makefile.am |  3 +-
 nvkm/subdev/therm/fan.c   |  9 -
 nvkm/subdev/therm/gm107.c | 93 +++
 nvkm/subdev/therm/nvd0.c  |  2 +-
 nvkm/subdev/therm/priv.h  |  2 +
 9 files changed, 109 insertions(+), 7 deletions(-)
 create mode 12 drm/core/subdev/therm/gm107.c
 create mode 100644 nvkm/subdev/therm/gm107.c

diff --git a/drm/Kbuild b/drm/Kbuild
index 75aa5e3..c663181 100644
--- a/drm/Kbuild
+++ b/drm/Kbuild
@@ -191,6 +191,7 @@ nouveau-y += core/subdev/therm/nv50.o
 nouveau-y += core/subdev/therm/nv84.o
 nouveau-y += core/subdev/therm/nva3.o
 nouveau-y += core/subdev/therm/nvd0.o
+nouveau-y += core/subdev/therm/gm107.o
 nouveau-y += core/subdev/timer/base.o
 nouveau-y += core/subdev/timer/nv04.o
 nouveau-y += core/subdev/timer/gk20a.o
diff --git a/drm/core/subdev/therm/gm107.c b/drm/core/subdev/therm/gm107.c
new file mode 12
index 000..aafc986
--- /dev/null
+++ b/drm/core/subdev/therm/gm107.c
@@ -0,0 +1 @@
+../../../../nvkm/subdev/therm/gm107.c
\ No newline at end of file
diff --git a/nvkm/engine/device/gm100.c b/nvkm/engine/device/gm100.c
index 377ec0b..136dd98 100644
--- a/nvkm/engine/device/gm100.c
+++ b/nvkm/engine/device/gm100.c
@@ -63,9 +63,7 @@ gm100_identify(struct nouveau_device *device)
device->oclass[NVDEV_SUBDEV_GPIO   ] =  nve0_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C] =  nvd0_i2c_oclass;
device->oclass[NVDEV_SUBDEV_CLOCK  ] = &nve0_clock_oclass;
-#if 0
-   device->oclass[NVDEV_SUBDEV_THERM  ] = &nvd0_therm_oclass;
-#endif
+   device->oclass[NVDEV_SUBDEV_THERM  ] = &gm107_therm_oclass;
device->oclass[NVDEV_SUBDEV_MXM] = &nv50_mxm_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] =  gm107_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] =  gk20a_mc_oclass;
diff --git a/nvkm/include/subdev/therm.h b/nvkm/include/subdev/therm.h
index d4a6817..a437597 100644
--- a/nvkm/include/subdev/therm.h
+++ b/nvkm/include/subdev/therm.h
@@ -78,5 +78,6 @@ extern struct nouveau_oclass nv50_therm_oclass;
 extern struct nouveau_oclass nv84_therm_oclass;
 extern struct nouveau_oclass nva3_therm_oclass;
 extern struct nouveau_oclass nvd0_therm_oclass;
+extern struct nouveau_oclass gm107_therm_oclass;
 
 #endif
diff --git a/nvkm/subdev/therm/Makefile.am b/nvkm/subdev/therm/Makefile.am
index 460e4a0..b4f6da6 100644
--- a/nvkm/subdev/therm/Makefile.am
+++ b/nvkm/subdev/therm/Makefile.am
@@ -11,6 +11,7 @@ libtherm_la_SOURCES = base.c \
  nv50.c \
  nv84.c \
  nva3.c \
- nvd0.c
+ nvd0.c \
+ gm107.c
 
 include $(srcdir)/../Makefile.subdev
diff --git a/nvkm/subdev/therm/fan.c b/nvkm/subdev/therm/fan.c
index 016990a..402c9be 100644
--- a/nvkm/subdev/therm/fan.c
+++ b/nvkm/subdev/therm/fan.c
@@ -31,6 +31,8 @@
 #include 
 #include 
 
+#include 
+
 static int
 nouveau_fan_update(struct nouveau_fan *fan, bool immediate, int target)
 {
@@ -275,8 +277,11 @@ nouveau_therm_fan_ctor(struct nouveau_therm *therm)
/* other random init... */
nouveau_therm_fan_set_defaults(therm);
nvbios_perf_fan_parse(bios, &priv->fan->perf);
-   if (nvbios_therm_fan_parse(bios, &priv->fan->bios))
-   nv_error(therm, "parsing the thermal table failed\n");
+   if (nvbios_fan_parse(bios, &priv->fan->bios)) {
+   nv_debug(therm, "parsing the fan table failed\n");
+   if (nvbios_therm_fan_parse(bios, &priv->fan->bios))
+   nv_error(therm, "parsing both fan tables failed\n");
+   }
nouveau_therm_fan_safety_checks(therm);
return 0;
 }
diff --git a/nvkm/subdev/therm/gm107.c b/nvkm/subdev/therm/gm107.c
new file mode 100644
index 000..e5015fa
--- /dev/null
+++ b/nvkm/subdev/therm/gm107.c
@@ -0,0 +1,93 @@
+/*
+ * Copyright 2014 Nouveau Community
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR P

[Nouveau] [PATCH 1/3] bios/fan: add support for maxwell's fan management table

2014-08-16 Thread Martin Peres
From: Martin Peres 

Re-use the therm-exported fan structure with only two minor modifications:
- pwm_freq: u16 -> u32;
- add fan_type (toggle or PWM)

Signed-off-by: Martin Peres 
---
 drm/Kbuild |  1 +
 drm/core/include/subdev/bios/fan.h |  1 +
 drm/core/subdev/bios/fan.c |  1 +
 nvkm/include/subdev/bios/fan.h |  8 
 nvkm/include/subdev/bios/therm.h   | 10 +++-
 nvkm/subdev/bios/Makefile.am   |  3 +-
 nvkm/subdev/bios/fan.c | 94 ++
 7 files changed, 116 insertions(+), 2 deletions(-)
 create mode 12 drm/core/include/subdev/bios/fan.h
 create mode 12 drm/core/subdev/bios/fan.c
 create mode 100644 nvkm/include/subdev/bios/fan.h
 create mode 100644 nvkm/subdev/bios/fan.c

diff --git a/drm/Kbuild b/drm/Kbuild
index f5d7f7c..75aa5e3 100644
--- a/drm/Kbuild
+++ b/drm/Kbuild
@@ -52,6 +52,7 @@ nouveau-y += core/subdev/bios/vmap.o
 nouveau-y += core/subdev/bios/volt.o
 nouveau-y += core/subdev/bios/xpio.o
 nouveau-y += core/subdev/bios/P0260.o
+nouveau-y += core/subdev/bios/fan.o
 nouveau-y += core/subdev/bus/hwsq.o
 nouveau-y += core/subdev/bus/nv04.o
 nouveau-y += core/subdev/bus/nv31.o
diff --git a/drm/core/include/subdev/bios/fan.h 
b/drm/core/include/subdev/bios/fan.h
new file mode 12
index 000..b56c338
--- /dev/null
+++ b/drm/core/include/subdev/bios/fan.h
@@ -0,0 +1 @@
+../../../../../nvkm/include/subdev/bios/fan.h
\ No newline at end of file
diff --git a/drm/core/subdev/bios/fan.c b/drm/core/subdev/bios/fan.c
new file mode 12
index 000..fe14fa4
--- /dev/null
+++ b/drm/core/subdev/bios/fan.c
@@ -0,0 +1 @@
+../../../../nvkm/subdev/bios/fan.c
\ No newline at end of file
diff --git a/nvkm/include/subdev/bios/fan.h b/nvkm/include/subdev/bios/fan.h
new file mode 100644
index 000..119d087
--- /dev/null
+++ b/nvkm/include/subdev/bios/fan.h
@@ -0,0 +1,8 @@
+#ifndef __NVBIOS_FAN_H__
+#define __NVBIOS_FAN_H__
+
+#include 
+
+u16 nvbios_fan_parse(struct nouveau_bios *bios, struct nvbios_therm_fan *fan);
+
+#endif
diff --git a/nvkm/include/subdev/bios/therm.h b/nvkm/include/subdev/bios/therm.h
index 8dc5051..295d093 100644
--- a/nvkm/include/subdev/bios/therm.h
+++ b/nvkm/include/subdev/bios/therm.h
@@ -23,6 +23,12 @@ struct nvbios_therm_sensor {
struct nvbios_therm_threshold thrs_shutdown;
 };
 
+enum nvbios_therm_fan_type {
+   NVBIOS_THERM_FAN_UNK = 0,
+   NVBIOS_THERM_FAN_TOGGLE = 1,
+   NVBIOS_THERM_FAN_PWM = 2,
+};
+
 /* no vbios have more than 6 */
 #define NOUVEAU_TEMP_FAN_TRIP_MAX 10
 struct nouveau_therm_trip_point {
@@ -38,7 +44,9 @@ enum nvbios_therm_fan_mode {
 };
 
 struct nvbios_therm_fan {
-   u16 pwm_freq;
+   enum nvbios_therm_fan_type type;
+
+   u32 pwm_freq;
 
u8 min_duty;
u8 max_duty;
diff --git a/nvkm/subdev/bios/Makefile.am b/nvkm/subdev/bios/Makefile.am
index 120b941..3ad1daf 100644
--- a/nvkm/subdev/bios/Makefile.am
+++ b/nvkm/subdev/bios/Makefile.am
@@ -22,6 +22,7 @@ libbios_la_SOURCES = base.c \
 vmap.c \
 volt.c \
 xpio.c \
-P0260.c
+P0260.c \
+fan.c
 
 include $(srcdir)/../Makefile.subdev
diff --git a/nvkm/subdev/bios/fan.c b/nvkm/subdev/bios/fan.c
new file mode 100644
index 000..17c05b9
--- /dev/null
+++ b/nvkm/subdev/bios/fan.c
@@ -0,0 +1,94 @@
+/*
+ * Copyright 2014 Martin Peres
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Authors: Martin Peres
+ */
+
+#include 
+#include 
+#include 
+
+u16
+nvbios_fan_table(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len)
+{
+   struct bit_entry bit_P;
+   u16 fan = 0x;
+
+   if (!bit_entry(bios, 'P', &bit_P)) {
+   if (bit_P.version == 2 && bit_P.length >= 0x5a)
+   fan = nv_ro16(bios, bit_P.offset + 0x58);
+
+   if (fan) {
+   *ver

[Nouveau] [PATCH 2/3] therm/fan: do not use the pwm mode when the vbios tells us to use the toggle

2014-08-16 Thread Martin Peres
From: Martin Peres 

Signed-off-by: Martin Peres 
---
 nvkm/subdev/therm/fanpwm.c | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/nvkm/subdev/therm/fanpwm.c b/nvkm/subdev/therm/fanpwm.c
index 9a5c073..c629d7f 100644
--- a/nvkm/subdev/therm/fanpwm.c
+++ b/nvkm/subdev/therm/fanpwm.c
@@ -25,6 +25,8 @@
 
 #include 
 #include 
+#include 
+#include 
 
 #include "priv.h"
 
@@ -86,11 +88,15 @@ nouveau_fanpwm_create(struct nouveau_therm *therm, struct 
dcb_gpio_func *func)
 {
struct nouveau_device *device = nv_device(therm);
struct nouveau_therm_priv *tpriv = (void *)therm;
+   struct nouveau_bios *bios = nouveau_bios(therm);
struct nouveau_fanpwm_priv *priv;
+   struct nvbios_therm_fan fan;
u32 divs, duty;
 
+   nvbios_fan_parse(bios, &fan);
+
if (!nouveau_boolopt(device->cfgopt, "NvFanPWM", func->param) ||
-   !therm->pwm_ctrl ||
+   !therm->pwm_ctrl || fan.type == NVBIOS_THERM_FAN_TOGGLE ||
 therm->pwm_get(therm, func->line, &divs, &duty) == -ENODEV)
return -ENODEV;
 
-- 
2.0.0

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


[Nouveau] [Bug 82704] kernel bug

2014-08-16 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=82704

--- Comment #1 from mattia.b89  ---
Created attachment 104734
  --> https://bugs.freedesktop.org/attachment.cgi?id=104734&action=edit
mpv log

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau


[Nouveau] [Bug 82704] kernel bug

2014-08-16 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=82704

--- Comment #2 from mattia.b89  ---
Created attachment 104735
  --> https://bugs.freedesktop.org/attachment.cgi?id=104735&action=edit
vdpauinfo log

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau


[Nouveau] [Bug 82704] New: kernel bug

2014-08-16 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=82704

  Priority: medium
Bug ID: 82704
  Assignee: nouveau@lists.freedesktop.org
   Summary: kernel bug
  Severity: normal
Classification: Unclassified
OS: All
  Reporter: mattia@gmail.com
  Hardware: Other
Status: NEW
   Version: 10.2
 Component: Drivers/DRI/nouveau
   Product: Mesa

Created attachment 104733
  --> https://bugs.freedesktop.org/attachment.cgi?id=104733&action=edit
dmesg

X freezes sometimes when I play video.
I was playing an .avi (MPEG-4) with mpv (log attached) when casually
gnome-shell freezes. Anyway I was able to change VT, login, save dmesg
(attached) and reboot

because I think it's a VDPAU related problem, I attach a log of vdpauinfo

Relevant specs are:
 archlinux x86_64
 nouveau-1.0.10-3
 mesa-10.2.5-1
 mpv-0.5.0-1
 libva-vdpau-driver-0.7.4-1
 libvdpau-0.8-1
 libvdpau-va-gl-0.3.4-1
 lib32-libvdpau-0.8-1
 nouveau-fw-325.15-1


 nvidia 9800GT 512MB

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau