[Nouveau] [PATCH v2 1/7] bios/volt: handle voltage table version 0x50 with 0ed header

2015-12-02 Thread Karol Herbst
Some Kepler cards have no usefull header in the voltage table, which means
nouveau has to read the voltages out of the entries directly.

This patch fixes volting issues on those cards enabling them to switch cstates
---
 drm/nouveau/nvkm/subdev/bios/volt.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drm/nouveau/nvkm/subdev/bios/volt.c 
b/drm/nouveau/nvkm/subdev/bios/volt.c
index 6e0a336..fd2776b 100644
--- a/drm/nouveau/nvkm/subdev/bios/volt.c
+++ b/drm/nouveau/nvkm/subdev/bios/volt.c
@@ -142,7 +142,10 @@ nvbios_volt_entry_parse(struct nvkm_bios *bios, int idx, 
u8 *ver, u8 *len,
info->vid = nvbios_rd08(bios, volt + 0x01) >> 2;
break;
case 0x40:
+   break;
case 0x50:
+   info->voltage = nvbios_rd32(bios, volt) & 0x001f;
+   info->vid = idx;
break;
}
return volt;
-- 
2.6.3

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


[Nouveau] [PATCH v2 2/7] clk: drop cstates with too high voltage

2015-12-02 Thread Karol Herbst
To support boosting, vbios' seems to have fasters cstate than the actual base 
clock.
We should definitly drop all those with a higher voltage than the max voltage
stated in the vbios.

This fixes reclocking issues mostly on high-end kepler cards where the highest
cstates goes way beyond the max voltage supported

v2: don't depend on the order of the vid entries
---
 drm/nouveau/include/nvkm/subdev/volt.h |  4 
 drm/nouveau/nvkm/subdev/clk/base.c |  6 ++
 drm/nouveau/nvkm/subdev/volt/base.c| 18 --
 3 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/drm/nouveau/include/nvkm/subdev/volt.h 
b/drm/nouveau/include/nvkm/subdev/volt.h
index b458d04..32c1a22 100644
--- a/drm/nouveau/include/nvkm/subdev/volt.h
+++ b/drm/nouveau/include/nvkm/subdev/volt.h
@@ -12,8 +12,12 @@ struct nvkm_volt {
u32 uv;
u8 vid;
} vid[256];
+
+   u32 max_voltage;
+   u32 min_voltage;
 };
 
+int nvkm_volt_map(struct nvkm_volt *volt, u8 id);
 int nvkm_volt_get(struct nvkm_volt *);
 int nvkm_volt_set_id(struct nvkm_volt *, u8 id, int condition);
 
diff --git a/drm/nouveau/nvkm/subdev/clk/base.c 
b/drm/nouveau/nvkm/subdev/clk/base.c
index dc8682c..d731bc3 100644
--- a/drm/nouveau/nvkm/subdev/clk/base.c
+++ b/drm/nouveau/nvkm/subdev/clk/base.c
@@ -138,16 +138,22 @@ static int
 nvkm_cstate_new(struct nvkm_clk *clk, int idx, struct nvkm_pstate *pstate)
 {
struct nvkm_bios *bios = clk->subdev.device->bios;
+   struct nvkm_volt *volt = clk->subdev.device->volt;
const struct nvkm_domain *domain = clk->domains;
struct nvkm_cstate *cstate = NULL;
struct nvbios_cstepX cstepX;
u8  ver, hdr;
u16 data;
+   int voltage;
 
data = nvbios_cstepXp(bios, idx, , , );
if (!data)
return -ENOENT;
 
+   voltage = nvkm_volt_map(volt, cstepX.voltage);
+   if (volt && (voltage > volt->max_voltage || voltage < 
volt->min_voltage))
+   return -EINVAL;
+
cstate = kzalloc(sizeof(*cstate), GFP_KERNEL);
if (!cstate)
return -ENOMEM;
diff --git a/drm/nouveau/nvkm/subdev/volt/base.c 
b/drm/nouveau/nvkm/subdev/volt/base.c
index 50b5649..7104168 100644
--- a/drm/nouveau/nvkm/subdev/volt/base.c
+++ b/drm/nouveau/nvkm/subdev/volt/base.c
@@ -65,7 +65,7 @@ nvkm_volt_set(struct nvkm_volt *volt, u32 uv)
return ret;
 }
 
-static int
+int
 nvkm_volt_map(struct nvkm_volt *volt, u8 id)
 {
struct nvkm_bios *bios = volt->subdev.device->bios;
@@ -120,6 +120,9 @@ nvkm_volt_parse_bios(struct nvkm_bios *bios, struct 
nvkm_volt *volt)
 
data = nvbios_volt_parse(bios, , , , , );
if (data && info.vidmask && info.base && info.step) {
+   volt->min_voltage = info.min;
+   volt->max_voltage = info.max;
+
for (i = 0; i < info.vidmask + 1; i++) {
if (info.base >= info.min &&
info.base <= info.max) {
@@ -138,9 +141,18 @@ nvkm_volt_parse_bios(struct nvkm_bios *bios, struct 
nvkm_volt *volt)
volt->vid[volt->vid_nr].uv = ivid.voltage;
volt->vid[volt->vid_nr].vid = ivid.vid;
volt->vid_nr++;
+
+   if (volt->min_voltage == 0)
+   volt->min_voltage = ivid.voltage;
+   else
+   volt->min_voltage = 
min(volt->min_voltage, ivid.voltage);
+   volt->max_voltage = max(volt->max_voltage, 
ivid.voltage);
}
}
volt->vid_mask = info.vidmask;
+   } else if (data && info.type == NVBIOS_VOLT_PWM) {
+   volt->min_voltage = info.base;
+   volt->max_voltage = info.base + info.pwm_range;
}
 }
 
@@ -181,8 +193,10 @@ nvkm_volt_ctor(const struct nvkm_volt_func *func, struct 
nvkm_device *device,
volt->func = func;
 
/* Assuming the non-bios device should build the voltage table later */
-   if (bios)
+   if (bios) {
nvkm_volt_parse_bios(bios, volt);
+   nvkm_debug(>subdev, "min: %iuv max: %iuv\n", 
volt->min_voltage, volt->max_voltage);
+   }
 
if (volt->vid_nr) {
for (i = 0; i < volt->vid_nr; i++) {
-- 
2.6.3

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


[Nouveau] [RFC PATCH v2 0/7] stabilize kepler reclocking

2015-12-02 Thread Karol Herbst
this series solves different issues we encounter on kepler cards while 
reclocking:

1. core clock doesn't change at all and produces a volting error (patch 1)
this can happen when the voltage table has only 0ed values in the header
so we have to parse the entries itself, which contain the right voltages
2. kepler won't clock to highest cstates (patch 2)
this happens, because there are entries in the cstep table with too 
high voltages attached
in this case we should simply drop those cstates, because they can't 
even be used by the gpu
the voltage limit is found in the voltage map table
3. higher voltage used than on blob/Windows (patch 3-4)
this happened, because previously nouveau didn't know how the read the 
max voltage for boosting out of the vbios
like patch 2 we simply drop all cstates with voltage higher than this 
one
4. heat issues after clocking to highest pstate (patch 5-7)
sometimes the gpu is able to handle the highest cstate, but the gpu 
isn't build for that high voltages
in that case we should just parse the baseclock table, which tells us 
the clocks the gpu is intented to run with

the last patches also introduce a new config option: NvBoost

0: no boosting/cstates, this will stick with the base clocks from the PM_Mode 
table
1: highest clock available is the base clock (default)
2: highest clock available is the boost clock
3: all cstates are available (still limited by gpu and boost voltage)

because this will regress performance on some cards, the new option should be 
advertised later on, but I think
it is a better idea to be safe here, because otherwise nouveau can easily go 
above the TDP of the gpu and this
leads to complete different issues.

After this, we can then try to understand which factors are important for 
boosting and implement it in a better way, but for this we need:
1. support for power consumption sensors
2. better understanding on which power budget is the right one
3. in which situation we can boost how far

Because this series can mess up reclocking for a wide range of cards, I really 
want to have it tested on several systems, thanks

Karol Herbst (7):
  bios/volt: handle voltage table version 0x50 with 0ed header
  clk: drop cstates with too high voltage
  volt: parse the boost voltage entry
  clk: drop cstates with higher voltage than boost_max_voltage
  nvbios: add parsing of BASE CLOCK table
  subdev/clk: print the base clocks
  clk: allow boosting only when NvBoost is set

 drm/nouveau/include/nvkm/subdev/bios/baseclock.h | 23 +++
 drm/nouveau/include/nvkm/subdev/bios/vmap.h  |  1 +
 drm/nouveau/include/nvkm/subdev/clk.h| 10 ++-
 drm/nouveau/include/nvkm/subdev/volt.h   |  6 ++
 drm/nouveau/nvkm/subdev/bios/Kbuild  |  1 +
 drm/nouveau/nvkm/subdev/bios/baseclock.c | 79 
 drm/nouveau/nvkm/subdev/bios/vmap.c  |  5 +-
 drm/nouveau/nvkm/subdev/bios/volt.c  |  3 +
 drm/nouveau/nvkm/subdev/clk/base.c   | 41 +++-
 drm/nouveau/nvkm/subdev/clk/gf100.c  |  2 +-
 drm/nouveau/nvkm/subdev/clk/gk104.c  |  2 +-
 drm/nouveau/nvkm/subdev/volt/base.c  | 26 +++-
 12 files changed, 192 insertions(+), 7 deletions(-)
 create mode 100644 drm/nouveau/include/nvkm/subdev/bios/baseclock.h
 create mode 100644 drm/nouveau/nvkm/subdev/bios/baseclock.c

-- 
2.6.3

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


[Nouveau] [PATCH v2 5/7] nvbios: add parsing of BASE CLOCK table

2015-12-02 Thread Karol Herbst
---
 drm/nouveau/include/nvkm/subdev/bios/baseclock.h | 23 +++
 drm/nouveau/nvkm/subdev/bios/Kbuild  |  1 +
 drm/nouveau/nvkm/subdev/bios/baseclock.c | 79 
 3 files changed, 103 insertions(+)
 create mode 100644 drm/nouveau/include/nvkm/subdev/bios/baseclock.h
 create mode 100644 drm/nouveau/nvkm/subdev/bios/baseclock.c

diff --git a/drm/nouveau/include/nvkm/subdev/bios/baseclock.h 
b/drm/nouveau/include/nvkm/subdev/bios/baseclock.h
new file mode 100644
index 000..07ee355
--- /dev/null
+++ b/drm/nouveau/include/nvkm/subdev/bios/baseclock.h
@@ -0,0 +1,23 @@
+#ifndef __NVBIOS_BASECLOCK_H__
+#define __NVBIOS_BASECLOCK_H__
+struct nvbios_baseclock_header {
+   u16 offset;
+
+   u8 version;
+   u8 hlen;
+   u8 ecount;
+   u8 elen;
+   u8 scount;
+   u8 slen;
+
+   u8 base_entry;
+   u8 boost_entry;
+   u8 tdp_entry;
+};
+struct nvbios_baseclock_entry {
+   u8  pstate;
+   u16 clock_mhz;
+};
+int nvbios_baseclock_parse(struct nvkm_bios *, struct nvbios_baseclock_header 
*);
+int nvbios_baseclock_get_entry(struct nvkm_bios *, struct 
nvbios_baseclock_header *h, u8 idx, struct nvbios_baseclock_entry *);
+#endif
diff --git a/drm/nouveau/nvkm/subdev/bios/Kbuild 
b/drm/nouveau/nvkm/subdev/bios/Kbuild
index 64730d5..a402755 100644
--- a/drm/nouveau/nvkm/subdev/bios/Kbuild
+++ b/drm/nouveau/nvkm/subdev/bios/Kbuild
@@ -1,4 +1,5 @@
 nvkm-y += nvkm/subdev/bios/base.o
+nvkm-y += nvkm/subdev/bios/baseclock.o
 nvkm-y += nvkm/subdev/bios/bit.o
 nvkm-y += nvkm/subdev/bios/boost.o
 nvkm-y += nvkm/subdev/bios/conn.o
diff --git a/drm/nouveau/nvkm/subdev/bios/baseclock.c 
b/drm/nouveau/nvkm/subdev/bios/baseclock.c
new file mode 100644
index 000..31609e0
--- /dev/null
+++ b/drm/nouveau/nvkm/subdev/bios/baseclock.c
@@ -0,0 +1,79 @@
+/*
+ * Copyright 2015 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 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: Karol Herbst
+ */
+#include 
+#include 
+#include 
+
+static u16
+nvbios_baseclock_offset(struct nvkm_bios *b)
+{
+   struct bit_entry bit_P;
+
+   if (!bit_entry(b, 'P', _P)) {
+   if (bit_P.version == 2)
+   return nvbios_rd16(b, bit_P.offset + 0x38);
+   }
+
+   return 0x;
+}
+
+int nvbios_baseclock_parse(struct nvkm_bios *b, struct nvbios_baseclock_header 
*h)
+{
+   if (!h)
+   return -EINVAL;
+
+   h->offset = nvbios_baseclock_offset(b);
+   if (!h->offset)
+   return -ENODEV;
+
+   h->version = nvbios_rd08(b, h->offset);
+   switch (h->version) {
+   case 0x10:
+   h->hlen= nvbios_rd08(b, h->offset + 0x1);
+   h->elen= nvbios_rd08(b, h->offset + 0x2);
+   h->slen= nvbios_rd08(b, h->offset + 0x3);
+   h->scount  = nvbios_rd08(b, h->offset + 0x4);
+   h->ecount  = nvbios_rd08(b, h->offset + 0x5);
+
+   h->base_entry  = nvbios_rd08(b, h->offset + 0x0f);
+   h->boost_entry = nvbios_rd08(b, h->offset + 0x10);
+   h->tdp_entry   = nvbios_rd08(b, h->offset + 0x11);
+   return 0;
+   default:
+   return -EINVAL;
+   }
+}
+
+int nvbios_baseclock_get_entry(struct nvkm_bios *b, struct 
nvbios_baseclock_header *h, u8 idx, struct nvbios_baseclock_entry *e)
+{
+   u16 offset;
+
+   if (!e || !h)
+   return -EINVAL;
+
+   offset = h->offset + h->hlen + idx * (h->elen + (h->slen * h->scount));
+   e->pstate= nvbios_rd08(b, offset);
+   e->clock_mhz = nvbios_rd16(b, offset + 0x5);
+   return 0;
+}
-- 
2.6.3

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


[Nouveau] [PATCH v2 7/7] clk: allow boosting only when NvBoost is set

2015-12-02 Thread Karol Herbst
0: disable boosting (use fixed clocks from PM_Mode table)
1: boost only to base clock from the vbios (default)
2: boost only to boost clock from the vbios
3: boost to max clock available (still limited by gpu and boost voltage)
---
 drm/nouveau/include/nvkm/subdev/clk.h | 10 +-
 drm/nouveau/nvkm/subdev/clk/base.c| 18 --
 drm/nouveau/nvkm/subdev/clk/gf100.c   |  2 +-
 drm/nouveau/nvkm/subdev/clk/gk104.c   |  2 +-
 4 files changed, 27 insertions(+), 5 deletions(-)

diff --git a/drm/nouveau/include/nvkm/subdev/clk.h 
b/drm/nouveau/include/nvkm/subdev/clk.h
index 8708f0a..8085d81 100644
--- a/drm/nouveau/include/nvkm/subdev/clk.h
+++ b/drm/nouveau/include/nvkm/subdev/clk.h
@@ -64,7 +64,8 @@ struct nvkm_pstate {
 struct nvkm_domain {
enum nv_clk_src name;
u8 bios; /* 0xff for none */
-#define NVKM_CLK_DOM_FLAG_CORE 0x01
+#define NVKM_CLK_DOM_FLAG_CORE0x01
+#define NVKM_CLK_DOM_FLAG_BASE_CLOCK_CORE 0x02
u8 flags;
const char *mname;
int mdiv;
@@ -94,6 +95,13 @@ struct nvkm_clk {
int dstate; /* display adjustment (min+) */
 
bool allow_reclock;
+#define NVKM_CLK_BOOST_MODE_NONE 0x0
+#define NVKM_CLK_BOOST_MODE_AVG  0x1
+#define NVKM_CLK_BOOST_MODE_FULL 0x2
+   u8 boost_mode;
+
+   u32 base_clock;
+   u32 boost_clock;
 
/*XXX: die, these are here *only* to support the completely
 * bat-shit insane what-was-nouveau_hw.c code
diff --git a/drm/nouveau/nvkm/subdev/clk/base.c 
b/drm/nouveau/nvkm/subdev/clk/base.c
index 7cb9dd8..7da0ae3 100644
--- a/drm/nouveau/nvkm/subdev/clk/base.c
+++ b/drm/nouveau/nvkm/subdev/clk/base.c
@@ -169,6 +169,12 @@ nvkm_cstate_new(struct nvkm_clk *clk, int idx, struct 
nvkm_pstate *pstate)
if (domain->flags & NVKM_CLK_DOM_FLAG_CORE) {
u32 freq = nvkm_clk_adjust(clk, true, pstate->pstate,
   domain->bios, cstepX.freq);
+   if (domain->flags & NVKM_CLK_DOM_FLAG_BASE_CLOCK_CORE) {
+   if (clk->boost_mode == 1 && freq > 
clk->base_clock)
+   goto err;
+   if (clk->boost_mode == 2 && freq > 
clk->boost_clock)
+   goto err;
+   }
cstate->domain[domain->name] = freq;
}
domain++;
@@ -176,6 +182,9 @@ nvkm_cstate_new(struct nvkm_clk *clk, int idx, struct 
nvkm_pstate *pstate)
 
list_add(>head, >list);
return 0;
+err:
+   kfree(cstate);
+   return -EINVAL;
 }
 
 /**
@@ -366,7 +375,7 @@ nvkm_pstate_new(struct nvkm_clk *clk, int idx)
}
 
data = nvbios_cstepEm(bios, pstate->pstate, , , );
-   if (data) {
+   if (data && clk->boost_mode > 0) {
int idx = cstepE.index;
do {
nvkm_cstate_new(clk, idx, pstate);
@@ -574,15 +583,20 @@ nvkm_clk_ctor(const struct nvkm_clk_func *func, struct 
nvkm_device *device,
nvkm_subdev_ctor(_clk, device, index, 0, >subdev);
bios = device->bios;
 
+   clk->boost_mode = 0;
if (bios && !nvbios_baseclock_parse(bios, )) {
struct nvbios_baseclock_entry base_entry, boost_entry;
if (nvbios_baseclock_get_entry(bios, , 
header.base_entry, _entry))
nvkm_error(>subdev, "couldn't parse base clock\n");
else if (nvbios_baseclock_get_entry(bios, , 
header.boost_entry, _entry))
nvkm_error(>subdev, "couldn't parse boost 
clock\n");
-   else
+   else {
+   clk->boost_mode = nvkm_longopt(device->cfgopt, 
"NvBoost", 1);
+   clk->base_clock = base_entry.clock_mhz * 1000;
+   clk->boost_clock = boost_entry.clock_mhz * 1000;
nvkm_info(>subdev, "base: %i MHz, boost: %i MHz\n",
base_entry.clock_mhz / 2, boost_entry.clock_mhz 
/ 2);
+   }
}
 
clk->func = func;
diff --git a/drm/nouveau/nvkm/subdev/clk/gf100.c 
b/drm/nouveau/nvkm/subdev/clk/gf100.c
index a52b7e7..eaf4f83 100644
--- a/drm/nouveau/nvkm/subdev/clk/gf100.c
+++ b/drm/nouveau/nvkm/subdev/clk/gf100.c
@@ -443,7 +443,7 @@ gf100_clk = {
{ nv_clk_src_hubk06 , 0x00 },
{ nv_clk_src_hubk01 , 0x01 },
{ nv_clk_src_copy   , 0x02 },
-   { nv_clk_src_gpc, 0x03, 0, "core", 2000 },
+   { nv_clk_src_gpc, 0x03, NVKM_CLK_DOM_FLAG_BASE_CLOCK_CORE, 
"core", 2000 },
{ nv_clk_src_rop, 0x04 },
{ nv_clk_src_mem, 0x05, 0, "memory", 1000 },
{ nv_clk_src_vdec   , 0x06 },
diff --git a/drm/nouveau/nvkm/subdev/clk/gk104.c 

[Nouveau] [PATCH v2 3/7] volt: parse the boost voltage entry

2015-12-02 Thread Karol Herbst
---
 drm/nouveau/include/nvkm/subdev/bios/vmap.h | 1 +
 drm/nouveau/include/nvkm/subdev/volt.h  | 2 ++
 drm/nouveau/nvkm/subdev/bios/vmap.c | 5 -
 drm/nouveau/nvkm/subdev/volt/base.c | 8 
 4 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/drm/nouveau/include/nvkm/subdev/bios/vmap.h 
b/drm/nouveau/include/nvkm/subdev/bios/vmap.h
index 6633c6d..1e170c7 100644
--- a/drm/nouveau/include/nvkm/subdev/bios/vmap.h
+++ b/drm/nouveau/include/nvkm/subdev/bios/vmap.h
@@ -1,6 +1,7 @@
 #ifndef __NVBIOS_VMAP_H__
 #define __NVBIOS_VMAP_H__
 struct nvbios_vmap {
+   u8  boost;
 };
 
 u16 nvbios_vmap_table(struct nvkm_bios *, u8 *ver, u8 *hdr, u8 *cnt, u8 *len);
diff --git a/drm/nouveau/include/nvkm/subdev/volt.h 
b/drm/nouveau/include/nvkm/subdev/volt.h
index 32c1a22..085f65f 100644
--- a/drm/nouveau/include/nvkm/subdev/volt.h
+++ b/drm/nouveau/include/nvkm/subdev/volt.h
@@ -15,6 +15,8 @@ struct nvkm_volt {
 
u32 max_voltage;
u32 min_voltage;
+
+   u32 boost_max_voltage;
 };
 
 int nvkm_volt_map(struct nvkm_volt *volt, u8 id);
diff --git a/drm/nouveau/nvkm/subdev/bios/vmap.c 
b/drm/nouveau/nvkm/subdev/bios/vmap.c
index 2f13db7..9b0ab33 100644
--- a/drm/nouveau/nvkm/subdev/bios/vmap.c
+++ b/drm/nouveau/nvkm/subdev/bios/vmap.c
@@ -60,8 +60,11 @@ nvbios_vmap_parse(struct nvkm_bios *bios, u8 *ver, u8 *hdr, 
u8 *cnt, u8 *len,
u16 vmap = nvbios_vmap_table(bios, ver, hdr, cnt, len);
memset(info, 0x00, sizeof(*info));
switch (!!vmap * *ver) {
-   case 0x10:
case 0x20:
+   info->boost = nvbios_rd08(bios, vmap + 0x7);
+   break;
+   case 0x10:
+   info->boost = 0xff;
break;
}
return vmap;
diff --git a/drm/nouveau/nvkm/subdev/volt/base.c 
b/drm/nouveau/nvkm/subdev/volt/base.c
index 7104168..763ec0b 100644
--- a/drm/nouveau/nvkm/subdev/volt/base.c
+++ b/drm/nouveau/nvkm/subdev/volt/base.c
@@ -194,8 +194,16 @@ nvkm_volt_ctor(const struct nvkm_volt_func *func, struct 
nvkm_device *device,
 
/* Assuming the non-bios device should build the voltage table later */
if (bios) {
+   u8 ver, hdr, cnt, len;
+   struct nvbios_vmap vmap;
+
nvkm_volt_parse_bios(bios, volt);
nvkm_debug(>subdev, "min: %iuv max: %iuv\n", 
volt->min_voltage, volt->max_voltage);
+
+   if (nvbios_vmap_parse(bios, , , , , ) && 
vmap.boost != 0xff) {
+   volt->boost_max_voltage = nvkm_volt_map(volt, 
vmap.boost);
+   nvkm_debug(>subdev, "max boost voltage: %iuv\n", 
volt->boost_max_voltage);
+   }
}
 
if (volt->vid_nr) {
-- 
2.6.3

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


Re: [Nouveau] NV50 compute support questions

2015-12-02 Thread Hans de Goede

On 01-12-15, Samuel Pitoiset wrote:

>>> Ok, here is a MMT trace of vectorAdd:
>>>
>>> https://fedorapeople.org/~jwrdegoede/vectorAdd.log.gz
>>
>> Hi Hans,
>>
>> Thanks a lot.
>
> Well, I didn't know but Martin has a GK208...
> I just tested the compute support on his card and ... it works without
> any changes. :-)
>
> I'm sorry, I was sure the compute support didn't work on this chipset.

No need to be sorry because, ...

> Feel free to test on your GK208 and report back if you have problems.

I've done that, and for me it does not work, if I try to enable compute
support like this:

diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c 
b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
index 461fcaa..ab4ea85 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
@@ -187,7 +187,7 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum 
pipe_cap param)
case PIPE_CAP_SEAMLESS_CUBE_MAP_PER_TEXTURE:
   return (class_3d >= NVE4_3D_CLASS) ? 1 : 0;
case PIPE_CAP_COMPUTE:
-  return (class_3d <= NVE4_3D_CLASS) ? 1 : 0;
+  return 1;
case PIPE_CAP_PREFER_BLIT_BASED_TEXTURE_TRANSFER:
   return nouveau_screen(pscreen)->vram_domain & NOUVEAU_BO_VRAM ? 1 : 0;

@@ -246,8 +246,6 @@ nvc0_screen_get_shader_param(struct pipe_screen *pscreen, 
unsigned shader,
  return 0;
   break;
case PIPE_SHADER_COMPUTE:
-  if (class_3d > NVE4_3D_CLASS)
- return 0;
   break;
default:
   return 0;
@@ -574,11 +572,10 @@ nvc0_screen_init_compute(struct nvc0_screen *screen)
case 0xd0:
   return nvc0_screen_compute_setup(screen, screen->base.pushbuf);
case 0xe0:
-  return nve4_screen_compute_setup(screen, screen->base.pushbuf);
case 0xf0:
case 0x100:
case 0x110:
-  return 0;
+  return nve4_screen_compute_setup(screen, screen->base.pushbuf);
default:
   return -1;
}

Then as soon as I do startx (which starts gnome-shell) the machine
freezes. This is with mesa-master with the above changes on top.

X / gnome-shell will happily work of I do not call nve4_screen_compute_setup()
but then test/trivial/compute fails with a null-ptr exception.

Do you perhaps have some extra patches in your tree, or am I just unlucky ?

I've tested this on both a 4.2 and a 4.4-rc3 kernel.

Regards,

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


Re: [Nouveau] [PATCH] drm/nouveau: Fix pre-nv50 pageflip events

2015-12-02 Thread poma
On 02.12.2015 09:55, Daniel Vetter wrote:
> On Wed, Dec 02, 2015 at 06:40:32AM +0100, poma wrote:
>> On Tue, Dec 1, 2015 at 6:30 PM, Mario Kleiner
>>  wrote:
>>> When we are at it, the one with the title "[PATCH] drm/nouveau: Use
>>> drm_vblank_on/off consistently" from Daniel, which has a reviewed and tested
>>> by me also never made it into nouveau.
>>>
>>> Maybe pick that up as well?
>>>
>>> -mario
>>>
>>
>> If you refer to
>> "[1/3] drm/nouveau: Use drm_vblank_on/off consistently"
>> https://patchwork.freedesktop.org/patch/50771
>>
>> this is the result:
>> patched 4.4.0-0.rc3.git0.1.fc24.x86_64 with it,
>> i.e. 1-3-drm-nouveau-Use-drm_vblank_on-off-consistently.patch
>>
>> # cat /var/log/Xorg.0.log
>> [   126.360]
>> X.Org X Server 1.18.0
>> ...
>> [   126.909] (EE) [drm] Failed to open DRM device for pci::02:00.0: -19
>> [   126.909] (EE) No devices detected.
>> [   126.909] (EE)
>> Fatal server error:
>> [   126.909] (EE) no screens found(EE)
>> [   126.909] (EE)
>> Please consult 
> 
> Kernel log needed if the drm device isn't there. And this is pretty much
> impossible, worst case modesetting is functionally busted.
> -Daniel
> 


Pardon me,
I missed 0 in EXTRAVERSION, therefore version magic not so pretty.

$ sed -i 's/-rc3/\-0.rc3/' Makefile

[ 1771.699138] checking generic (f700 e0) vs hw (d000 1000)
[ 1771.699143] checking generic (f700 e0) vs hw (f600 200)
[ 1771.699144] fb: switching to nouveaufb from VESA VGA
[ 1771.699271] Console: switching to colour dummy device 80x25
[ 1771.699450] nouveau :02:00.0: NVIDIA G98 (098200a2)
[ 1771.813968] nouveau :02:00.0: bios: version 62.98.2c.00.00
[ 1771.834802] nouveau :02:00.0: bios: M0203T not found
[ 1771.834819] nouveau :02:00.0: bios: M0203E not matched!
[ 1771.834830] nouveau :02:00.0: fb: 512 MiB DDR2
[ 1774.593921] [TTM] Zone  kernel: Available graphics memory: 1891762 kiB
[ 1774.593926] [TTM] Initializing pool allocator
[ 1774.593932] [TTM] Initializing DMA pool allocator
[ 1774.593948] nouveau :02:00.0: DRM: VRAM: 512 MiB
[ 1774.593950] nouveau :02:00.0: DRM: GART: 1048576 MiB
[ 1774.593954] nouveau :02:00.0: DRM: TMDS table version 2.0
[ 1774.593956] nouveau :02:00.0: DRM: DCB version 4.0
[ 1774.593959] nouveau :02:00.0: DRM: DCB outp 00: 02000300 0028
[ 1774.593962] nouveau :02:00.0: DRM: DCB outp 01: 01000302 00020030
[ 1774.593964] nouveau :02:00.0: DRM: DCB outp 02: 04011310 0028
[ 1774.593966] nouveau :02:00.0: DRM: DCB outp 03: 010223f1 00c0c080
[ 1774.593969] nouveau :02:00.0: DRM: DCB conn 00: 1030
[ 1774.593971] nouveau :02:00.0: DRM: DCB conn 01: 0100
[ 1774.593973] nouveau :02:00.0: DRM: DCB conn 02: 0210
[ 1774.593975] nouveau :02:00.0: DRM: DCB conn 03: 0211
[ 1774.593977] nouveau :02:00.0: DRM: DCB conn 04: 0213
[ 1774.595827] nouveau :02:00.0: DRM: failed to create encoder 0/1/0: -19
[ 1774.595832] nouveau :02:00.0: DRM: TV-1 has no encoders, removing
[ 1774.595867] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[ 1774.595870] [drm] Driver supports precise vblank timestamp query.
[ 1774.600023] CE: hpet increased min_delta_ns to 11521 nsec
[ 1774.605699] nouveau :02:00.0: DRM: MM: using M2MF for buffer copies
[ 1774.690808] nouveau :02:00.0: DRM: allocated 1024x768 fb: 0x5, bo 
8800c9a46000
[ 1774.690960] fbcon: nouveaufb (fb0) is primary device
[ 1774.746581] Console: switching to colour frame buffer device 128x48
[ 1774.747411] nouveau :02:00.0: fb0: nouveaufb frame buffer device
[ 1774.750093] [drm] Initialized nouveau 1.3.1 20120801 for :02:00.0 on 
minor 0


Tested-by: poma 


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


[Nouveau] [PATCH v2 6/7] subdev/clk: print the base clocks

2015-12-02 Thread Karol Herbst
---
 drm/nouveau/nvkm/subdev/clk/base.c | 16 
 1 file changed, 16 insertions(+)

diff --git a/drm/nouveau/nvkm/subdev/clk/base.c 
b/drm/nouveau/nvkm/subdev/clk/base.c
index 43abca7..7cb9dd8 100644
--- a/drm/nouveau/nvkm/subdev/clk/base.c
+++ b/drm/nouveau/nvkm/subdev/clk/base.c
@@ -24,6 +24,7 @@
 #include "priv.h"
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -565,10 +566,25 @@ int
 nvkm_clk_ctor(const struct nvkm_clk_func *func, struct nvkm_device *device,
  int index, bool allow_reclock, struct nvkm_clk *clk)
 {
+   struct nvkm_bios *bios;
int ret, idx, arglen;
const char *mode;
+   struct nvbios_baseclock_header header;
 
nvkm_subdev_ctor(_clk, device, index, 0, >subdev);
+   bios = device->bios;
+
+   if (bios && !nvbios_baseclock_parse(bios, )) {
+   struct nvbios_baseclock_entry base_entry, boost_entry;
+   if (nvbios_baseclock_get_entry(bios, , 
header.base_entry, _entry))
+   nvkm_error(>subdev, "couldn't parse base clock\n");
+   else if (nvbios_baseclock_get_entry(bios, , 
header.boost_entry, _entry))
+   nvkm_error(>subdev, "couldn't parse boost 
clock\n");
+   else
+   nvkm_info(>subdev, "base: %i MHz, boost: %i MHz\n",
+   base_entry.clock_mhz / 2, boost_entry.clock_mhz 
/ 2);
+   }
+
clk->func = func;
INIT_LIST_HEAD(>states);
clk->domains = func->domains;
-- 
2.6.3

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


Re: [Nouveau] NV50 compute support questions

2015-12-02 Thread Ilia Mirkin
On Wed, Dec 2, 2015 at 1:33 PM, Samuel Pitoiset
 wrote:
>
>
> On 12/02/2015 04:34 PM, Hans de Goede wrote:
>>
>> On 01-12-15, Samuel Pitoiset wrote:
>>
>>  >>> Ok, here is a MMT trace of vectorAdd:
>>  >>>
>>  >>> https://fedorapeople.org/~jwrdegoede/vectorAdd.log.gz
>>  >>
>>  >> Hi Hans,
>>  >>
>>  >> Thanks a lot.
>>  >
>>  > Well, I didn't know but Martin has a GK208...
>>  > I just tested the compute support on his card and ... it works without
>>  > any changes. :-)
>>  >
>>  > I'm sorry, I was sure the compute support didn't work on this chipset.
>>
>> No need to be sorry because, ...
>>
>>  > Feel free to test on your GK208 and report back if you have problems.
>>
>> I've done that, and for me it does not work, if I try to enable compute
>> support like this:
>>
>> diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
>> b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
>> index 461fcaa..ab4ea85 100644
>> --- a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
>> +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
>> @@ -187,7 +187,7 @@ nvc0_screen_get_param(struct pipe_screen *pscreen,
>> enum pipe_cap param)
>>  case PIPE_CAP_SEAMLESS_CUBE_MAP_PER_TEXTURE:
>> return (class_3d >= NVE4_3D_CLASS) ? 1 : 0;
>>  case PIPE_CAP_COMPUTE:
>> -  return (class_3d <= NVE4_3D_CLASS) ? 1 : 0;
>> +  return 1;
>>  case PIPE_CAP_PREFER_BLIT_BASED_TEXTURE_TRANSFER:
>> return nouveau_screen(pscreen)->vram_domain & NOUVEAU_BO_VRAM ?
>> 1 : 0;
>>
>> @@ -246,8 +246,6 @@ nvc0_screen_get_shader_param(struct pipe_screen
>> *pscreen, unsigned shader,
>>return 0;
>> break;
>>  case PIPE_SHADER_COMPUTE:
>> -  if (class_3d > NVE4_3D_CLASS)
>> - return 0;
>> break;
>>  default:
>> return 0;
>> @@ -574,11 +572,10 @@ nvc0_screen_init_compute(struct nvc0_screen *screen)
>>  case 0xd0:
>> return nvc0_screen_compute_setup(screen, screen->base.pushbuf);
>>  case 0xe0:
>> -  return nve4_screen_compute_setup(screen, screen->base.pushbuf);
>>  case 0xf0:
>>  case 0x100:
>>  case 0x110:
>> -  return 0;
>> +  return nve4_screen_compute_setup(screen, screen->base.pushbuf);
>>  default:
>> return -1;
>>  }
>>
>> Then as soon as I do startx (which starts gnome-shell) the machine
>> freezes. This is with mesa-master with the above changes on top.
>>
>> X / gnome-shell will happily work of I do not call
>> nve4_screen_compute_setup()
>> but then test/trivial/compute fails with a null-ptr exception.
>>
>> Do you perhaps have some extra patches in your tree, or am I just unlucky
>> ?
>>
>> I've tested this on both a 4.2 and a 4.4-rc3 kernel.
>
>
> Hi,
>
> My bad... I used the wrong card on reator (which is the REing machine of
> Martin). The primary card is a GK106 and the second one is the GK208. That
> doesn't explain why I did something wrong but heh? :-)
>
> You are right. With those bits added locally, the compute support totally
> hangs the GPU on my GK208 (NV108), and a reboot is needed.
>
> Please give a shot at this branch :
> http://cgit.freedesktop.org/~hakzsam/mesa/log/?h=nvf0_compute
>
> It fixes the initialization of the compute state and allows me to
> launch 'test_input_global' (ie. ./compute 8) on my GK208 without
> any dmesg fails. That's a good start but more patches are coming. :-)

The firmware methods are implemented by the ctxsw fw, in the fuc. You
should try to see what the blob firmware used that one for and see if
we need to implement the same thing or not. I've generally ignored
them. There is another firmware method for the equivalent of a
context-aware nv_mask()... I think you write the reg/mask/new into the
SCRATCH methods, and then invoke the firmware command. Or something. I
looked into when I thought it was related to atomic fail.

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


[Nouveau] [Bug 93197] Warsow 2.0 crashes in nouveau_fence_trigger_work

2015-12-02 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=93197

--- Comment #2 from Marcin Slusarz  ---
Temporary workaround:

./warsow +set r_multithreading 0

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


[Nouveau] [Bug 92307] G98/GM206: WARNING: ... at include/drm/drm_crtc.h:1577 drm_helper_choose_encoder_dpms+0x8a/0x90 [drm_kms_helper]()

2015-12-02 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=92307

--- Comment #19 from Stefan Huehner  ---
No compositor just old fvwm2 as window manager. For this quick test i did
either just startx or via lightdm.

Note: was just quick test using blob for now and not nouveau mainly on that
box.

-- 
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 92307] G98/GM206: WARNING: ... at include/drm/drm_crtc.h:1577 drm_helper_choose_encoder_dpms+0x8a/0x90 [drm_kms_helper]()

2015-12-02 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=92307

--- Comment #18 from poma  ---

Stefan, what DE/compositor are you running?

-- 
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] NV50 compute support questions

2015-12-02 Thread Samuel Pitoiset



On 12/02/2015 04:34 PM, Hans de Goede wrote:

On 01-12-15, Samuel Pitoiset wrote:

 >>> Ok, here is a MMT trace of vectorAdd:
 >>>
 >>> https://fedorapeople.org/~jwrdegoede/vectorAdd.log.gz
 >>
 >> Hi Hans,
 >>
 >> Thanks a lot.
 >
 > Well, I didn't know but Martin has a GK208...
 > I just tested the compute support on his card and ... it works without
 > any changes. :-)
 >
 > I'm sorry, I was sure the compute support didn't work on this chipset.

No need to be sorry because, ...

 > Feel free to test on your GK208 and report back if you have problems.

I've done that, and for me it does not work, if I try to enable compute
support like this:

diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
index 461fcaa..ab4ea85 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
@@ -187,7 +187,7 @@ nvc0_screen_get_param(struct pipe_screen *pscreen,
enum pipe_cap param)
 case PIPE_CAP_SEAMLESS_CUBE_MAP_PER_TEXTURE:
return (class_3d >= NVE4_3D_CLASS) ? 1 : 0;
 case PIPE_CAP_COMPUTE:
-  return (class_3d <= NVE4_3D_CLASS) ? 1 : 0;
+  return 1;
 case PIPE_CAP_PREFER_BLIT_BASED_TEXTURE_TRANSFER:
return nouveau_screen(pscreen)->vram_domain & NOUVEAU_BO_VRAM ?
1 : 0;

@@ -246,8 +246,6 @@ nvc0_screen_get_shader_param(struct pipe_screen
*pscreen, unsigned shader,
   return 0;
break;
 case PIPE_SHADER_COMPUTE:
-  if (class_3d > NVE4_3D_CLASS)
- return 0;
break;
 default:
return 0;
@@ -574,11 +572,10 @@ nvc0_screen_init_compute(struct nvc0_screen *screen)
 case 0xd0:
return nvc0_screen_compute_setup(screen, screen->base.pushbuf);
 case 0xe0:
-  return nve4_screen_compute_setup(screen, screen->base.pushbuf);
 case 0xf0:
 case 0x100:
 case 0x110:
-  return 0;
+  return nve4_screen_compute_setup(screen, screen->base.pushbuf);
 default:
return -1;
 }

Then as soon as I do startx (which starts gnome-shell) the machine
freezes. This is with mesa-master with the above changes on top.

X / gnome-shell will happily work of I do not call
nve4_screen_compute_setup()
but then test/trivial/compute fails with a null-ptr exception.

Do you perhaps have some extra patches in your tree, or am I just unlucky ?

I've tested this on both a 4.2 and a 4.4-rc3 kernel.


Hi,

My bad... I used the wrong card on reator (which is the REing machine of 
Martin). The primary card is a GK106 and the second one is the GK208. 
That doesn't explain why I did something wrong but heh? :-)


You are right. With those bits added locally, the compute support 
totally hangs the GPU on my GK208 (NV108), and a reboot is needed.


Please give a shot at this branch :
http://cgit.freedesktop.org/~hakzsam/mesa/log/?h=nvf0_compute

It fixes the initialization of the compute state and allows me to
launch 'test_input_global' (ie. ./compute 8) on my GK208 without
any dmesg fails. That's a good start but more patches are coming. :-)

Btw, according to the trace you sent me, you have a GK208b (NV106).

Thanks!



Regards,

Hans

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


[Nouveau] [Bug 92307] G98/GM206: WARNING: ... at include/drm/drm_crtc.h:1577 drm_helper_choose_encoder_dpms+0x8a/0x90 [drm_kms_helper]()

2015-12-02 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=92307

--- Comment #20 from poma  ---

nouveau & fvwm-2.6.5-10.fc23.x86_64,
except ever-present warnings, no problemos for both - S3 RESUME and xrandr.

-- 
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] [PATCH] drm/nouveau: Fix pre-nv50 pageflip events

2015-12-02 Thread Daniel Vetter
On Wed, Dec 02, 2015 at 06:40:32AM +0100, poma wrote:
> On Tue, Dec 1, 2015 at 6:30 PM, Mario Kleiner
>  wrote:
> > When we are at it, the one with the title "[PATCH] drm/nouveau: Use
> > drm_vblank_on/off consistently" from Daniel, which has a reviewed and tested
> > by me also never made it into nouveau.
> >
> > Maybe pick that up as well?
> >
> > -mario
> >
> 
> If you refer to
> "[1/3] drm/nouveau: Use drm_vblank_on/off consistently"
> https://patchwork.freedesktop.org/patch/50771
> 
> this is the result:
> patched 4.4.0-0.rc3.git0.1.fc24.x86_64 with it,
> i.e. 1-3-drm-nouveau-Use-drm_vblank_on-off-consistently.patch
> 
> # cat /var/log/Xorg.0.log
> [   126.360]
> X.Org X Server 1.18.0
> ...
> [   126.909] (EE) [drm] Failed to open DRM device for pci::02:00.0: -19
> [   126.909] (EE) No devices detected.
> [   126.909] (EE)
> Fatal server error:
> [   126.909] (EE) no screens found(EE)
> [   126.909] (EE)
> Please consult 

Kernel log needed if the drm device isn't there. And this is pretty much
impossible, worst case modesetting is functionally busted.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
___
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau


[Nouveau] [Bug 71659] [NVD9] Hangs under load with ![ PFIFO][0000:01:00.0] unhandled status 0x00800000

2015-12-02 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=71659

--- Comment #31 from Viorel-Cătălin Răpițeanu  ---
Created attachment 120290
  --> https://bugs.freedesktop.org/attachment.cgi?id=120290=edit
dmesg log after the freeze occured.

-- 
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 93201] When running a basic OpenGL program with DRI_PRIME=1, Xorg crashes

2015-12-02 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=93201

--- Comment #6 from Marcos Souza  ---
(In reply to Chris Wilson from comment #5)
> I'm going to assume the DRICloseScreen in the middle of the stack is just
> the unwinder getting confused and so this looks like a nouveau bug and not a
> core DRI2 bug.

So, in this case, there is a start point to look at to solve this problem? I
would like ot help fixing this issue...

Thanks,

-- 
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 93201] When running a basic OpenGL program with DRI_PRIME=1, Xorg crashes

2015-12-02 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=93201

Chris Wilson  changed:

   What|Removed |Added

  Component|Driver/intel|Driver/nouveau
   Assignee|ch...@chris-wilson.co.uk|nouveau@lists.freedesktop.o
   ||rg
 QA Contact|intel-gfx-bugs@lists.freede |xorg-t...@lists.x.org
   |sktop.org   |

--- Comment #5 from Chris Wilson  ---
I'm going to assume the DRICloseScreen in the middle of the stack is just the
unwinder getting confused and so this looks like a nouveau bug and not a core
DRI2 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


Re: [Nouveau] [RFC PATCH 4/5] subdev/clk: print the base clocks

2015-12-02 Thread Emil Velikov
On 2 December 2015 at 12:21, Karol Herbst  wrote:
>> Pierre Moreau  hat am 2. Dezember 2015 um 02:34
>> geschrieben:
>>
>> Hi,
>>
>> On 05:42 PM - Dec 01 2015, Karol Herbst wrote:
>> > this is just a nice thing to know and there is no harm in printing them
>> > ---
>> > drm/nouveau/nvkm/subdev/clk/base.c | 16 
>> > 1 file changed, 16 insertions(+)
>> >
>> > diff --git a/drm/nouveau/nvkm/subdev/clk/base.c
>> > b/drm/nouveau/nvkm/subdev/clk/base.c
>> > index d731bc3..df9173e 100644
>> > --- a/drm/nouveau/nvkm/subdev/clk/base.c
>> > +++ b/drm/nouveau/nvkm/subdev/clk/base.c
>> > @@ -24,6 +24,7 @@
>> > #include "priv.h"
>> >
>> > #include 
>> > +#include 
>> > #include 
>> > #include 
>> > #include 
>> > @@ -562,10 +563,25 @@ int
>> > nvkm_clk_ctor(const struct nvkm_clk_func *func, struct nvkm_device *device,
>> > int index, bool allow_reclock, struct nvkm_clk *clk)
>> > {
>> > + struct nvkm_bios *bios;
>> > int ret, idx, arglen;
>> > const char *mode;
>> > + struct nvbios_baseclock_header header;
>> >
>> > nvkm_subdev_ctor(nvkm_clk, device, index, 0, clk->subdev);
>> > + bios = device->bios;
>> > +
>> > + if (bios  !nvbios_baseclock_parse(bios, header)) {
>> > + struct nvbios_baseclock_entry base_entry, boost_entry;
>> > + if (nvbios_baseclock_get_entry(bios, header, header.base_entry,
>> > base_entry))
>> > + nvkm_error(clk->subdev, "couldn't parse base clock\n");
>> > + else if (nvbios_baseclock_get_entry(bios, header, 
>> > header.boost_entry,
>> > boost_entry))
>> > + nvkm_error(clk->subdev, "couldn't parse boost clock\n");
>> > + else
>> > + nvkm_info(clk->subdev, "base: %i MHz, boost: %i MHz\n",
>> > + base_entry.clock_mhz / 2, boost_entry.clock_mhz / 2);
>>
>> This is probably just me missing some elementary electronic knowledge about
>> clocks, but why do you divide the clock frequency by two?
>>
> This is because if the card was sold with 800/850 MHz the table contains
> 1600/1700. And because I don't want that confusion I stick with the "halfed"
> clocks.
> I don't know why they are doubled though or the marketing ones halfed.
>
A short (and not 100% accurate) description comes from DDR - double
data rate. I.e. effective = 2x actual clock rate.

In some cases the vbios use(d) to store the actual, while in other
cases the effective rate.

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


[Nouveau] [Bug 92307] G98/GM206: WARNING: ... at include/drm/drm_crtc.h:1577 drm_helper_choose_encoder_dpms+0x8a/0x90 [drm_kms_helper]()

2015-12-02 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=92307

--- Comment #16 from poma  ---

Tested kernels:
4.4.0-0.rc3.git0.1.fc24.x86_64+debug
&
4.4.0-0.rc3.git0.1.fc24.x86_64+debug with updated nouveau from
http://cgit.freedesktop.org/~darktama/nouveau - up to commit 115ed46

- dmesg:
[  242.712518] WARNING: CPU: 2 PID: 2742 at include/drm/drm_crtc.h:1565
drm_helper_choose_encoder_dpms+0x8a/0x90 [drm_kms_helper]()
[  242.713194] WARNING: CPU: 2 PID: 2742 at include/drm/drm_crtc.h:1565
drm_helper_choose_crtc_dpms+0x93/0xa0 [drm_kms_helper]()
[  243.410428] WARNING: CPU: 2 PID: 2742 at include/drm/drm_crtc.h:1565
drm_helper_choose_encoder_dpms+0x8a/0x90 [drm_kms_helper]()
[  243.411084] WARNING: CPU: 2 PID: 2742 at include/drm/drm_crtc.h:1565
drm_helper_choose_crtc_dpms+0x93/0xa0 [drm_kms_helper]()
[  429.026360] WARNING: CPU: 2 PID: 2742 at include/drm/drm_crtc.h:1565
drm_helper_choose_encoder_dpms+0x8a/0x90 [drm_kms_helper]()
[  429.027127] WARNING: CPU: 2 PID: 2742 at include/drm/drm_crtc.h:1565
drm_helper_choose_crtc_dpms+0x93/0xa0 [drm_kms_helper]()
[  429.725127] WARNING: CPU: 2 PID: 308 at include/drm/drm_crtc.h:1565
drm_helper_choose_encoder_dpms+0x8a/0x90 [drm_kms_helper]()
[  429.725408] WARNING: CPU: 2 PID: 308 at include/drm/drm_crtc.h:1565
drm_helper_choose_crtc_dpms+0x93/0xa0 [drm_kms_helper]()
[  605.195250] WARNING: CPU: 2 PID: 50 at include/drm/drm_crtc.h:1565
drm_helper_choose_encoder_dpms+0x8a/0x90 [drm_kms_helper]()
[  605.195586] WARNING: CPU: 2 PID: 50 at include/drm/drm_crtc.h:1565
drm_helper_choose_crtc_dpms+0x93/0xa0 [drm_kms_helper]()
[  605.893962] WARNING: CPU: 2 PID: 50 at include/drm/drm_crtc.h:1565
drm_helper_choose_encoder_dpms+0x8a/0x90 [drm_kms_helper]()
[  605.894735] WARNING: CPU: 2 PID: 50 at include/drm/drm_crtc.h:1565
drm_helper_choose_crtc_dpms+0x93/0xa0 [drm_kms_helper]()
[  650.065838] WARNING: CPU: 2 PID: 50 at include/drm/drm_crtc.h:1565
drm_helper_choose_encoder_dpms+0x8a/0x90 [drm_kms_helper]()
[  650.066627] WARNING: CPU: 2 PID: 50 at include/drm/drm_crtc.h:1565
drm_helper_choose_crtc_dpms+0x93/0xa0 [drm_kms_helper]()
[  650.764764] WARNING: CPU: 2 PID: 50 at include/drm/drm_crtc.h:1565
drm_helper_choose_encoder_dpms+0x8a/0x90 [drm_kms_helper]()
[  650.765550] WARNING: CPU: 2 PID: 50 at include/drm/drm_crtc.h:1565
drm_helper_choose_crtc_dpms+0x93/0xa0 [drm_kms_helper]()
[ 1258.081495] WARNING: CPU: 2 PID: 1879 at include/drm/drm_crtc.h:1565
drm_helper_choose_encoder_dpms+0x8a/0x90 [drm_kms_helper]()
[ 1258.082210] WARNING: CPU: 2 PID: 1879 at include/drm/drm_crtc.h:1565
drm_helper_choose_crtc_dpms+0x93/0xa0 [drm_kms_helper]()
[ 1258.780213] WARNING: CPU: 2 PID: 1879 at include/drm/drm_crtc.h:1565
drm_helper_choose_encoder_dpms+0x8a/0x90 [drm_kms_helper]()
[ 1258.780934] WARNING: CPU: 2 PID: 1879 at include/drm/drm_crtc.h:1565
drm_helper_choose_crtc_dpms+0x93/0xa0 [drm_kms_helper]()
...

Although warnings are still here,
during S3 RESUME connected output/display -IS- enabled.

-- 
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] [RFC PATCH 4/5] subdev/clk: print the base clocks

2015-12-02 Thread Karol Herbst
> Pierre Moreau  hat am 2. Dezember 2015 um 02:34
> geschrieben:
> 
> Hi,
> 
> On 05:42 PM - Dec 01 2015, Karol Herbst wrote:
> > this is just a nice thing to know and there is no harm in printing them
> > ---
> > drm/nouveau/nvkm/subdev/clk/base.c | 16 
> > 1 file changed, 16 insertions(+)
> > 
> > diff --git a/drm/nouveau/nvkm/subdev/clk/base.c
> > b/drm/nouveau/nvkm/subdev/clk/base.c
> > index d731bc3..df9173e 100644
> > --- a/drm/nouveau/nvkm/subdev/clk/base.c
> > +++ b/drm/nouveau/nvkm/subdev/clk/base.c
> > @@ -24,6 +24,7 @@
> > #include "priv.h"
> > 
> > #include 
> > +#include 
> > #include 
> > #include 
> > #include 
> > @@ -562,10 +563,25 @@ int
> > nvkm_clk_ctor(const struct nvkm_clk_func *func, struct nvkm_device *device,
> > int index, bool allow_reclock, struct nvkm_clk *clk)
> > {
> > + struct nvkm_bios *bios;
> > int ret, idx, arglen;
> > const char *mode;
> > + struct nvbios_baseclock_header header;
> > 
> > nvkm_subdev_ctor(nvkm_clk, device, index, 0, clk->subdev);
> > + bios = device->bios;
> > +
> > + if (bios  !nvbios_baseclock_parse(bios, header)) {
> > + struct nvbios_baseclock_entry base_entry, boost_entry;
> > + if (nvbios_baseclock_get_entry(bios, header, header.base_entry,
> > base_entry))
> > + nvkm_error(clk->subdev, "couldn't parse base clock\n");
> > + else if (nvbios_baseclock_get_entry(bios, header, header.boost_entry,
> > boost_entry))
> > + nvkm_error(clk->subdev, "couldn't parse boost clock\n");
> > + else
> > + nvkm_info(clk->subdev, "base: %i MHz, boost: %i MHz\n",
> > + base_entry.clock_mhz / 2, boost_entry.clock_mhz / 2);
> 
> This is probably just me missing some elementary electronic knowledge about
> clocks, but why do you divide the clock frequency by two?
> 
This is because if the card was sold with 800/850 MHz the table contains
1600/1700. And because I don't want that confusion I stick with the "halfed"
clocks.
I don't know why they are doubled though or the marketing ones halfed.

> Regards,
> Pierre
> 
> > + }
> > +
> > clk->func = func;
> > INIT_LIST_HEAD(clk->states);
> > clk->domains = func->domains;
> > -- 
> > 2.6.3
> > 
> > ___
> > Nouveau mailing list
> > Nouveau@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/nouveau
___
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau


Re: [Nouveau] [RFC PATCH 5/5] clk: allow boosting only when NvBoost is set

2015-12-02 Thread Karol Herbst
> Pierre Moreau  hat am 2. Dezember 2015 um 02:26
> geschrieben:
> 
> Hi Karol,
> 
> I have some comments below.
> 
> On 05:42 PM - Dec 01 2015, Karol Herbst wrote:
> > 0: disable boosting (cap to base clock from the vbios)
> > 1: boost only to boost clock from the vbios
> > 2: boost to max clock available
> > ---
> > drm/nouveau/include/nvkm/subdev/clk.h | 10 +-
> > drm/nouveau/nvkm/subdev/clk/base.c | 17 -
> > drm/nouveau/nvkm/subdev/clk/gf100.c | 2 +-
> > drm/nouveau/nvkm/subdev/clk/gk104.c | 2 +-
> > 4 files changed, 27 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drm/nouveau/include/nvkm/subdev/clk.h
> > b/drm/nouveau/include/nvkm/subdev/clk.h
> > index 8708f0a..8085d81 100644
> > --- a/drm/nouveau/include/nvkm/subdev/clk.h
> > +++ b/drm/nouveau/include/nvkm/subdev/clk.h
> > @@ -64,7 +64,8 @@ struct nvkm_pstate {
> > struct nvkm_domain {
> > enum nv_clk_src name;
> > u8 bios; /* 0xff for none */
> > -#define NVKM_CLK_DOM_FLAG_CORE 0x01
> > +#define NVKM_CLK_DOM_FLAG_CORE 0x01
> > +#define NVKM_CLK_DOM_FLAG_BASE_CLOCK_CORE 0x02
> > u8 flags;
> > const char *mname;
> > int mdiv;
> > @@ -94,6 +95,13 @@ struct nvkm_clk {
> > int dstate; /* display adjustment (min+) */
> > 
> > bool allow_reclock;
> > +#define NVKM_CLK_BOOST_MODE_NONE 0x0
> > +#define NVKM_CLK_BOOST_MODE_AVG 0x1
> > +#define NVKM_CLK_BOOST_MODE_FULL 0x2
> > + u8 boost_mode;
> > +
> > + u32 base_clock;
> > + u32 boost_clock;
> > 
> > /*XXX: die, these are here *only* to support the completely
> > * bat-shit insane what-was-nouveau_hw.c code
> > diff --git a/drm/nouveau/nvkm/subdev/clk/base.c
> > b/drm/nouveau/nvkm/subdev/clk/base.c
> > index df9173e..ae76601 100644
> > --- a/drm/nouveau/nvkm/subdev/clk/base.c
> > +++ b/drm/nouveau/nvkm/subdev/clk/base.c
> > @@ -166,6 +166,12 @@ nvkm_cstate_new(struct nvkm_clk *clk, int idx, struct
> > nvkm_pstate *pstate)
> > if (domain->flags  NVKM_CLK_DOM_FLAG_CORE) {
> > u32 freq = nvkm_clk_adjust(clk, true, pstate->pstate,
> > domain->bios, cstepX.freq);
> > + if (domain->flags  NVKM_CLK_DOM_FLAG_BASE_CLOCK_CORE) {
> > + if (clk->boost_mode == 0  freq > clk->base_clock)
> > + goto err;
> > + if (clk->boost_mode == 1  freq > clk->boost_clock)
> > + goto err;
> > + }
> > cstate->domain[domain->name] = freq;
> > }
> > domain++;
> > @@ -173,6 +179,9 @@ nvkm_cstate_new(struct nvkm_clk *clk, int idx, struct
> > nvkm_pstate *pstate)
> > 
> > list_add(cstate->head, pstate->list);
> > return 0;
> > +err:
> > + kfree(cstate);
> > + return -EINVAL;
> > }
> > 
> > /**
> > @@ -573,13 +582,19 @@ nvkm_clk_ctor(const struct nvkm_clk_func *func, struct
> > nvkm_device *device,
> > 
> > if (bios  !nvbios_baseclock_parse(bios, header)) {
> > struct nvbios_baseclock_entry base_entry, boost_entry;
> > + clk->boost_mode = nvkm_longopt(device->cfgopt, "NvBoost", 0);
> > if (nvbios_baseclock_get_entry(bios, header, header.base_entry,
> > base_entry))
> 
> If `boost_mode == -1` is some "went wrong, don't use" value, shouldn't you set
> `clk->boost_mode = -1;` here too?
> 
> > nvkm_error(clk->subdev, "couldn't parse base clock\n");
> > else if (nvbios_baseclock_get_entry(bios, header, header.boost_entry,
> > boost_entry))
> 
> Same comment as above
> 
> > nvkm_error(clk->subdev, "couldn't parse boost clock\n");
> > - else
> > + else {
> > + clk->base_clock = base_entry.clock_mhz * 1000;
> > + clk->boost_clock = boost_entry.clock_mhz * 1000;
> > nvkm_info(clk->subdev, "base: %i MHz, boost: %i MHz\n",
> > base_entry.clock_mhz / 2, boost_entry.clock_mhz / 2);
> > + }
> > + } else {
> > + clk->boost_mode = -1;
> 
> You only listed values 0, 1, 2 in the commit message, so what is -1 for?
> Disabling nvboost is already taken care by 0, so it's something else. runpm
> uses it for auto mode, but here you set it if the bios wasn't found or
> couldn't
> be parsed, so not an auto mode. :-D
> 
yeah right, I think I stick with 0 then

> Regards,
> Pierre
> 
> > }
> > 
> > clk->func = func;
> > diff --git a/drm/nouveau/nvkm/subdev/clk/gf100.c
> > b/drm/nouveau/nvkm/subdev/clk/gf100.c
> > index a52b7e7..eaf4f83 100644
> > --- a/drm/nouveau/nvkm/subdev/clk/gf100.c
> > +++ b/drm/nouveau/nvkm/subdev/clk/gf100.c
> > @@ -443,7 +443,7 @@ gf100_clk = {
> > { nv_clk_src_hubk06 , 0x00 },
> > { nv_clk_src_hubk01 , 0x01 },
> > { nv_clk_src_copy , 0x02 },
> > - { nv_clk_src_gpc , 0x03, 0, "core", 2000 },
> > + { nv_clk_src_gpc , 0x03, NVKM_CLK_DOM_FLAG_BASE_CLOCK_CORE, "core", 2000
> > },
> > { nv_clk_src_rop , 0x04 },
> > { nv_clk_src_mem , 0x05, 0, "memory", 1000 },
> > { nv_clk_src_vdec , 0x06 },
> > diff --git a/drm/nouveau/nvkm/subdev/clk/gk104.c
> > b/drm/nouveau/nvkm/subdev/clk/gk104.c
> > index 396f7e4..f194112 100644
> > --- a/drm/nouveau/nvkm/subdev/clk/gk104.c
> > +++ b/drm/nouveau/nvkm/subdev/clk/gk104.c
> > @@ -485,7 +485,7 @@ gk104_clk = {
> > .domains = {
> > { nv_clk_src_crystal, 0xff },
> > { nv_clk_src_href , 

Re: [Nouveau] [RFC PATCH 5/5] clk: allow boosting only when NvBoost is set

2015-12-02 Thread Emil Velikov
On 2 December 2015 at 12:24, Karol Herbst  wrote:
>> Pierre Moreau  hat am 2. Dezember 2015 um 02:26
>> geschrieben:

>> You only listed values 0, 1, 2 in the commit message, so what is -1 for?
>> Disabling nvboost is already taken care by 0, so it's something else. runpm
>> uses it for auto mode, but here you set it if the bios wasn't found or
>> couldn't
>> be parsed, so not an auto mode. :-D
>>
> yeah right, I think I stick with 0 then
>
Speaking of which why don't you use the symbolic names ? It feels a
bit strange to define them and then check against 0,1...

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


[Nouveau] [Bug 92307] G98/GM206: WARNING: ... at include/drm/drm_crtc.h:1577 drm_helper_choose_encoder_dpms+0x8a/0x90 [drm_kms_helper]()

2015-12-02 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=92307

--- Comment #17 from poma  ---

However with the xrandr routine:
xrandr --output DVI-I-1 --off ; xrandr --auto

is still problematic,
the mouse cursor is visible and motile, but the rest of the screen is as
blanked.

Moreover, through the further testing I found a component that is causing the
problem.
Is it the only variable in equation, dunno.

Therefore,
Xfwm4 XPresent compositor -and- GLX compositor -are problematic-
in xrandr routine - of course when they are used.

What -is NOT- problematic:
- Xfwm4 XRender compositor
- DRI 3


Related to this problem, and not only
https://bugzilla.xfce.org/show_bug.cgi?id=12339

-- 
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