[Nouveau] [Bug 98266] Geforce GTX 960: display corruption under KDE Plasma

2016-10-25 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=98266

peter.eszl...@gmail.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #6 from peter.eszl...@gmail.com ---
(In reply to Ilia Mirkin from comment #5)
> I just published some patches that allow you to use xf86-video-nouveau
> instead of modesetting for GM20x GPUs. Can you see if using it improves the
> situation at all? You can build it from
> 
> https://github.com/imirkin/xf86-video-nouveau

This fixes the bug. But from Xorg.log it looks like I was already running
nouveau before.

-- 
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
https://lists.freedesktop.org/mailman/listinfo/nouveau


[Nouveau] [PATCH] drm/nouveau: fix nv84 fence context leak

2016-10-25 Thread Lucas Stach
uevent based fences hold a reference to the fence context,
just like the legacy ones. So they need to drop this reference
in the same way.

Signed-off-by: Lucas Stach 
---
 drivers/gpu/drm/nouveau/nouveau_fence.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_fence.c 
b/drivers/gpu/drm/nouveau/nouveau_fence.c
index 4bb9ab8..098044c 100644
--- a/drivers/gpu/drm/nouveau/nouveau_fence.c
+++ b/drivers/gpu/drm/nouveau/nouveau_fence.c
@@ -586,5 +586,5 @@ static const struct fence_ops nouveau_fence_ops_uevent = {
.enable_signaling = nouveau_fence_enable_signaling,
.signaled = nouveau_fence_is_signaled,
.wait = fence_default_wait,
-   .release = NULL
+   .release = nouveau_fence_release
 };
-- 
2.7.4

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


Re: [Nouveau] noveau: emergency shutdown handling is overcomplex and broken

2016-10-25 Thread Pavel Machek
On Tue 2016-10-25 13:09:25, Karol Herbst wrote:
> Thanks for the pointer.
> 
> But I don't like this patch. If you find a bug, make a bug report or
> just fix it if you know the fix already. Or write something in
> IRC. Or

I found a bug, and this is my bug report. Can you take care and fix
it?

Pavel



> write on the Mailing list as a general question or something else
> 
> But I really don't agree on doing it this way. You would have needed
> like the same amount of time to actual fix the problem.
> 
> Anyway, for adding a printk:
> 
> struct nvkm_subdev *subdev = >subdev;
> nvkm_error(subdev, "message");
> 
> 2016-10-25 12:50 GMT+02:00 Pavel Machek :
> >
> > diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/temp.c 
> > b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/temp.c
> > index b9703c0..adb1deb 100644
> > --- a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/temp.c
> > +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/temp.c
> > @@ -120,6 +120,11 @@ nvkm_therm_sensor_event(struct nvkm_therm *therm, enum 
> > nvkm_therm_thrs thrs,
> > struct work_struct *work;
> >
> > work = kmalloc(sizeof(*work), GFP_ATOMIC);
> > +   /* FIXME:
> > +  1) this is total overkill, orderly_poweroff() 
> > already
> > +  uses schedule_work internally
> > +  2) it would  be good to at least printk what is 
> > going on
> > +   */
> > if (work) {
> > INIT_WORK(work, nv_poweroff_work);
> > schedule_work(work);
> >
> > GFP_ATOMIC is not reliable. Plus, see the fixme.
> >
> > Best regards,
> > 
> > Pavel
> >
> > --
> > (english) http://www.livejournal.com/~pavelmachek
> > (cesky, pictures) 
> > http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
> >
> > ___
> > Nouveau mailing list
> > Nouveau@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/nouveau
> >

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


signature.asc
Description: Digital signature
___
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau


Re: [Nouveau] noveau: emergency shutdown handling is overcomplex and broken

2016-10-25 Thread Karol Herbst
Thanks for the pointer.

But I don't like this patch. If you find a bug, make a bug report or
just fix it if you know the fix already. Or write something in IRC. Or
write on the Mailing list as a general question or something else

But I really don't agree on doing it this way. You would have needed
like the same amount of time to actual fix the problem.

Anyway, for adding a printk:

struct nvkm_subdev *subdev = >subdev;
nvkm_error(subdev, "message");

2016-10-25 12:50 GMT+02:00 Pavel Machek :
>
> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/temp.c 
> b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/temp.c
> index b9703c0..adb1deb 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/temp.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/temp.c
> @@ -120,6 +120,11 @@ nvkm_therm_sensor_event(struct nvkm_therm *therm, enum 
> nvkm_therm_thrs thrs,
> struct work_struct *work;
>
> work = kmalloc(sizeof(*work), GFP_ATOMIC);
> +   /* FIXME:
> +  1) this is total overkill, orderly_poweroff() 
> already
> +  uses schedule_work internally
> +  2) it would  be good to at least printk what is 
> going on
> +   */
> if (work) {
> INIT_WORK(work, nv_poweroff_work);
> schedule_work(work);
>
> GFP_ATOMIC is not reliable. Plus, see the fixme.
>
> Best regards,
> Pavel
>
> --
> (english) http://www.livejournal.com/~pavelmachek
> (cesky, pictures) 
> http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
>
> ___
> Nouveau mailing list
> Nouveau@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/nouveau
>
___
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau


[Nouveau] noveau: emergency shutdown handling is overcomplex and broken

2016-10-25 Thread Pavel Machek

diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/temp.c 
b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/temp.c
index b9703c0..adb1deb 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/temp.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/temp.c
@@ -120,6 +120,11 @@ nvkm_therm_sensor_event(struct nvkm_therm *therm, enum 
nvkm_therm_thrs thrs,
struct work_struct *work;
 
work = kmalloc(sizeof(*work), GFP_ATOMIC);
+   /* FIXME:
+  1) this is total overkill, orderly_poweroff() already
+  uses schedule_work internally
+  2) it would  be good to at least printk what is 
going on
+   */
if (work) {
INIT_WORK(work, nv_poweroff_work);
schedule_work(work);

GFP_ATOMIC is not reliable. Plus, see the fixme.

Best regards,
Pavel

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


signature.asc
Description: Digital signature
___
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau


[Nouveau] [Bug 94990] [GM204] GTX 970 + 4GB VRAM fails at secboot (v4.6+)

2016-10-25 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=94990

--- Comment #80 from Yann Golanski  ---
(In reply to Zach Wolfe from comment #76)
> Worked on Fedora with later
> kernel versions however so I take it its not strictly a nouveau issue but
> its beyond my capabilities to even find the problem?

Which Fedora and kernel versions did it work on?

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


Re: [Nouveau] [PATCH 3/3] hwmon: expose power_max and power_crit

2016-10-25 Thread Karol Herbst


On 25 October 2016 7:33:08 a.m. GMT+02:00, Martin Peres  
wrote:
>On 25/10/16 00:11, Karol Herbst wrote:
>> Signed-off-by: Karol Herbst 
>> ---
>>  drm/nouveau/nouveau_hwmon.c | 44
>
>>  1 file changed, 44 insertions(+)
>>
>> diff --git a/drm/nouveau/nouveau_hwmon.c
>b/drm/nouveau/nouveau_hwmon.c
>> index 71f764b..3d4672a 100644
>> --- a/drm/nouveau/nouveau_hwmon.c
>> +++ b/drm/nouveau/nouveau_hwmon.c
>> @@ -596,6 +596,32 @@ nouveau_hwmon_get_power1_input(struct device *d,
>struct device_attribute *a,
>>  static SENSOR_DEVICE_ATTR(power1_input, S_IRUGO,
>>nouveau_hwmon_get_power1_input, NULL, 0);
>>
>> +static ssize_t
>> +nouveau_hwmon_get_power1_max(struct device *d, struct
>device_attribute *a,
>> + char *buf)
>> +{
>> +struct drm_device *dev = dev_get_drvdata(d);
>> +struct nouveau_drm *drm = nouveau_drm(dev);
>> +struct nvkm_iccsense *iccsense = nvxx_iccsense(>device);
>> +return sprintf(buf, "%i\n", iccsense->power_w_max);
>> +}
>> +
>> +static SENSOR_DEVICE_ATTR(power1_max, S_IRUGO,
>> +  nouveau_hwmon_get_power1_max, NULL, 0);
>> +
>> +static ssize_t
>> +nouveau_hwmon_get_power1_crit(struct device *d, struct
>device_attribute *a,
>> +  char *buf)
>> +{
>> +struct drm_device *dev = dev_get_drvdata(d);
>> +struct nouveau_drm *drm = nouveau_drm(dev);
>> +struct nvkm_iccsense *iccsense = nvxx_iccsense(>device);
>> +return sprintf(buf, "%i\n", iccsense->power_w_crit);
>> +}
>> +
>> +static SENSOR_DEVICE_ATTR(power1_crit, S_IRUGO,
>> +  nouveau_hwmon_get_power1_crit, NULL, 0);
>> +
>>  static struct attribute *hwmon_default_attributes[] = {
>>  _dev_attr_name.dev_attr.attr,
>>  _dev_attr_update_rate.dev_attr.attr,
>> @@ -639,6 +665,12 @@ static struct attribute
>*hwmon_power_attributes[] = {
>>  NULL
>>  };
>>
>> +static struct attribute *hwmon_power_caps_attributes[] = {
>> +_dev_attr_power1_max.dev_attr.attr,
>> +_dev_attr_power1_crit.dev_attr.attr,
>> +NULL
>> +};
>> +
>>  static const struct attribute_group hwmon_default_attrgroup = {
>>  .attrs = hwmon_default_attributes,
>>  };
>> @@ -657,6 +689,9 @@ static const struct attribute_group
>hwmon_in0_attrgroup = {
>>  static const struct attribute_group hwmon_power_attrgroup = {
>>  .attrs = hwmon_power_attributes,
>>  };
>> +static const struct attribute_group hwmon_power_caps_attrgroup = {
>> +.attrs = hwmon_power_caps_attributes,
>> +};
>>  #endif
>>
>>  int
>> @@ -728,8 +763,16 @@ nouveau_hwmon_init(struct drm_device *dev)
>>  if (iccsense && iccsense->data_valid &&
>!list_empty(>rails)) {
>>  ret = sysfs_create_group(_dev->kobj,
>>   _power_attrgroup);
>> +
>>  if (ret)
>>  goto error;
>> +
>> +if (iccsense->power_w_max && iccsense->power_w_crit) {
>> +ret = sysfs_create_group(_dev->kobj,
>> + _power_caps_attrgroup);
>> +if (ret)
>> +goto error;
>> +}
>>  }
>>
>>  hwmon->hwmon = hwmon_dev;
>> @@ -759,6 +802,7 @@ nouveau_hwmon_fini(struct drm_device *dev)
>>  sysfs_remove_group(>hwmon->kobj, 
>> _fan_rpm_attrgroup);
>>  sysfs_remove_group(>hwmon->kobj, _in0_attrgroup);
>>  sysfs_remove_group(>hwmon->kobj, _power_attrgroup);
>> +sysfs_remove_group(>hwmon->kobj,
>_power_caps_attrgroup);
>>
>>  hwmon_device_unregister(hwmon->hwmon);
>>  }
>>
>
>So, you wanted to make a cache because you felt you may want to let the
>
>user edit the values?
>
>Not sure we should ever allow this :s At least, a RO file is a very
>good 
>idea to help debugging and just letting the user know about such 
>limitations.
>
>So, in my opinion, I think we should just kill patch 2 and use directly
>
>the output of the bios table here. Maybe you can write a helper
>function 
>in patch 1 to get the min, avg and max values and return -1 if it is
>not 
>valid? This way, you can access this info very easily in multiple
>places 
>without duplicating this 0xff check.
>
>

no, my intention was to parse the vbios once and be done with it, otherwise we 
would spread the logic how to read the values. But maybe the entries are indeed 
always min/max/crit and there is no avg value. But the min of the cap entry 
means something like min max consumption.

Aditinally the other ebtries have really weird affects, so I would rather not 
want to parse the table every time.

There are some flags in the entries which affect what is the max allowed 
consumption and I alrwady see it will get a little complicated.

>___
>Nouveau mailing list
>Nouveau@lists.freedesktop.org

Re: [Nouveau] [PATCH 2/3] subdev/iccsense: Parse max and crit power level

2016-10-25 Thread Karol Herbst


On 25 October 2016 7:28:10 a.m. GMT+02:00, Martin Peres  
wrote:
>On 25/10/16 00:11, Karol Herbst wrote:
>> Signed-off-by: Karol Herbst 
>> ---
>>  drm/nouveau/include/nvkm/subdev/iccsense.h |  3 +++
>>  drm/nouveau/nvkm/subdev/iccsense/base.c| 13 -
>>  2 files changed, 15 insertions(+), 1 deletion(-)
>
>What is the point of duplicating values here? Just store the parsed
>bios 
>table, like we do for fan management.

will have a look. I was just thinking that thise fields may mean something else 
depending on the context. There are already some weird things, like we only get 
one value for very short entries.

But I guess it makes sense to keep it simple for now.

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


Re: [Nouveau] [PATCH 1/3] nvbios/power_budget: Add basic power budget parsing

2016-10-25 Thread Karol Herbst


On 25 October 2016 7:25:46 a.m. GMT+02:00, Martin Peres  
wrote:
>On 25/10/16 00:11, Karol Herbst wrote:
>> Signed-off-by: Karol Herbst 
>> ---
>>  .../include/nvkm/subdev/bios/power_budget.h|  20 
>>  drm/nouveau/nvkm/subdev/bios/Kbuild|   1 +
>>  drm/nouveau/nvkm/subdev/bios/power_budget.c| 108
>+
>>  3 files changed, 129 insertions(+)
>>  create mode 100644
>drm/nouveau/include/nvkm/subdev/bios/power_budget.h
>>  create mode 100644 drm/nouveau/nvkm/subdev/bios/power_budget.c
>>
>> diff --git a/drm/nouveau/include/nvkm/subdev/bios/power_budget.h
>b/drm/nouveau/include/nvkm/subdev/bios/power_budget.h
>> new file mode 100644
>> index 000..dd65c08
>> --- /dev/null
>> +++ b/drm/nouveau/include/nvkm/subdev/bios/power_budget.h
>> @@ -0,0 +1,20 @@
>> +#ifndef __NVBIOS_POWER_BUDGET_H__
>> +#define __NVBIOS_POWER_BUDGET_H__
>> +
>> +#include 
>> +
>> +struct nvbios_power_budget_entry {
>> +u32 min_w;
>> +u32 avg_w;
>> +u32 max_w;
>> +};
>> +
>> +struct nvbios_power_budget {
>> +u8  nr_entry;
>> +u8  cap_entry;
>> +struct nvbios_power_budget_entry *entries;
>> +};
>> +
>> +int nvbios_power_budget_parse(struct nvkm_bios *, struct
>nvbios_power_budget *);
>> +
>> +#endif
>> diff --git a/drm/nouveau/nvkm/subdev/bios/Kbuild
>b/drm/nouveau/nvkm/subdev/bios/Kbuild
>> index be57220..6b4f1e0 100644
>> --- a/drm/nouveau/nvkm/subdev/bios/Kbuild
>> +++ b/drm/nouveau/nvkm/subdev/bios/Kbuild
>> @@ -19,6 +19,7 @@ nvkm-y += nvkm/subdev/bios/pcir.o
>>  nvkm-y += nvkm/subdev/bios/perf.o
>>  nvkm-y += nvkm/subdev/bios/pll.o
>>  nvkm-y += nvkm/subdev/bios/pmu.o
>> +nvkm-y += nvkm/subdev/bios/power_budget.o
>>  nvkm-y += nvkm/subdev/bios/ramcfg.o
>>  nvkm-y += nvkm/subdev/bios/rammap.o
>>  nvkm-y += nvkm/subdev/bios/shadow.o
>> diff --git a/drm/nouveau/nvkm/subdev/bios/power_budget.c
>b/drm/nouveau/nvkm/subdev/bios/power_budget.c
>> new file mode 100644
>> index 000..538497b
>> --- /dev/null
>> +++ b/drm/nouveau/nvkm/subdev/bios/power_budget.c
>> @@ -0,0 +1,108 @@
>> +/*
>> + * Copyright 2015 Karol Herbst
>> + *
>> + * 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 u32
>> +nvbios_power_budget_table(struct nvkm_bios *bios, u8 *ver, u8 *hdr,
>u8 *cnt,
>> +  u8 *len)
>> +{
>> +struct bit_entry bit_P;
>> +u32 power_budget;
>> +
>> +if (bit_entry(bios, 'P', _P) || bit_P.version != 2 ||
>> +bit_P.length < 0x2c)
>> +return 0;
>> +
>> +power_budget = nvbios_rd32(bios, bit_P.offset + 0x2c);
>> +if (!power_budget)
>> +return 0;
>> +
>> +*ver = nvbios_rd08(bios, power_budget);
>> +switch (*ver) {
>> +case 0x10:
>> +case 0x20:
>> +case 0x30:
>> +*hdr = nvbios_rd08(bios, power_budget + 0x1);
>> +*len = nvbios_rd08(bios, power_budget + 0x2);
>> +*cnt = nvbios_rd08(bios, power_budget + 0x3);
>> +return power_budget;
>> +default:
>> +break;
>> +}
>> +
>> +return 0;
>> +}
>> +
>> +int
>> +nvbios_power_budget_parse(struct nvkm_bios *bios, struct
>nvbios_power_budget *budget)
>> +{
>> +struct nvkm_subdev *subdev = >subdev;
>> +u8 ver, hdr, cnt, len, i, cap_entry;
>> +u32 header;
>> +
>> +header = nvbios_power_budget_table(bios, , , , );
>> +if (!header || !cnt)
>> +return -ENODEV;
>> +
>> +budget->entries = kmalloc_array(cnt, sizeof(*budget->entries),
>GFP_KERNEL);
>> +if (!budget->entries)
>> +return -ENOMEM;
>> +
>> +budget->nr_entry = cnt;
>> +switch (ver) {
>> +case 0x20:
>> +cap_entry = nvbios_rd08(bios, header + 0x9);
>> +break;
>> +default:
>> +cap_entry = 0;
>
>Are