[Nouveau] [PATCH v3] drm/nouveau/therm: initial implementation of new gp1xx temperature sensor

2017-09-04 Thread Rhys Kidd
v2:
 - add nv138 and drop nv13b chipsets (Ilia Mirkin)
 - refactor out status variable and instead mask tsensor (Ilia Mirkin)
 - switch SHADOWed state message away from nvkm_error() (Ilia Mirkin)
 - rename internal temperature variable (Karol Herbst)

v3:
 - use nvkm_trace() for SHADOWed state message (Ben Skeggs)

Signed-off-by: Rhys Kidd 
---
 .../gpu/drm/nouveau/include/nvkm/subdev/therm.h|  1 +
 drivers/gpu/drm/nouveau/nvkm/engine/device/base.c  |  6 +++
 drivers/gpu/drm/nouveau/nvkm/subdev/therm/Kbuild   |  1 +
 drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c   |  3 +-
 drivers/gpu/drm/nouveau/nvkm/subdev/therm/gp100.c  | 56 ++
 5 files changed, 66 insertions(+), 1 deletion(-)
 create mode 100644 drivers/gpu/drm/nouveau/nvkm/subdev/therm/gp100.c

diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/therm.h 
b/drivers/gpu/drm/nouveau/include/nvkm/subdev/therm.h
index 1bfd93b85575..9841f076da2e 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/therm.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/therm.h
@@ -97,4 +97,5 @@ int gt215_therm_new(struct nvkm_device *, int, struct 
nvkm_therm **);
 int gf119_therm_new(struct nvkm_device *, int, struct nvkm_therm **);
 int gm107_therm_new(struct nvkm_device *, int, struct nvkm_therm **);
 int gm200_therm_new(struct nvkm_device *, int, struct nvkm_therm **);
+int gp100_therm_new(struct nvkm_device *, int, struct nvkm_therm **);
 #endif
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c 
b/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c
index e096a5d9c292..28fd4fa98635 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c
@@ -2169,6 +2169,7 @@ nv130_chipset = {
.ltc = gp100_ltc_new,
.mc = gp100_mc_new,
.mmu = gf100_mmu_new,
+   .therm = gp100_therm_new,
.secboot = gm200_secboot_new,
.pci = gp100_pci_new,
.pmu = gp100_pmu_new,
@@ -2203,6 +2204,7 @@ nv132_chipset = {
.ltc = gp100_ltc_new,
.mc = gp100_mc_new,
.mmu = gf100_mmu_new,
+   .therm = gp100_therm_new,
.secboot = gp102_secboot_new,
.pci = gp100_pci_new,
.pmu = gp102_pmu_new,
@@ -2237,6 +2239,7 @@ nv134_chipset = {
.ltc = gp100_ltc_new,
.mc = gp100_mc_new,
.mmu = gf100_mmu_new,
+   .therm = gp100_therm_new,
.secboot = gp102_secboot_new,
.pci = gp100_pci_new,
.pmu = gp102_pmu_new,
@@ -2271,6 +2274,7 @@ nv136_chipset = {
.ltc = gp100_ltc_new,
.mc = gp100_mc_new,
.mmu = gf100_mmu_new,
+   .therm = gp100_therm_new,
.secboot = gp102_secboot_new,
.pci = gp100_pci_new,
.pmu = gp102_pmu_new,
@@ -2305,6 +2309,7 @@ nv137_chipset = {
.ltc = gp100_ltc_new,
.mc = gp100_mc_new,
.mmu = gf100_mmu_new,
+   .therm = gp100_therm_new,
.secboot = gp102_secboot_new,
.pci = gp100_pci_new,
.pmu = gp102_pmu_new,
@@ -2339,6 +2344,7 @@ nv138_chipset = {
.ltc = gp100_ltc_new,
.mc = gp100_mc_new,
.mmu = gf100_mmu_new,
+   .therm = gp100_therm_new,
.pci = gp100_pci_new,
.pmu = gp102_pmu_new,
.timer = gk20a_timer_new,
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/Kbuild 
b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/Kbuild
index 2bafcc1d1818..7ba56b12badd 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/Kbuild
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/Kbuild
@@ -12,3 +12,4 @@ nvkm-y += nvkm/subdev/therm/gt215.o
 nvkm-y += nvkm/subdev/therm/gf119.o
 nvkm-y += nvkm/subdev/therm/gm107.o
 nvkm-y += nvkm/subdev/therm/gm200.o
+nvkm-y += nvkm/subdev/therm/gp100.o
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c 
b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c
index 952a7cb0a59a..f27fc6d0d4c6 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c
@@ -341,7 +341,8 @@ nvkm_therm_init(struct nvkm_subdev *subdev)
 {
struct nvkm_therm *therm = nvkm_therm(subdev);
 
-   therm->func->init(therm);
+   if (therm->func->init)
+   therm->func->init(therm);
 
if (therm->suspend >= 0) {
/* restore the pwm value only when on manual or auto mode */
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/gp100.c 
b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/gp100.c
new file mode 100644
index ..9f0dea3f61dc
--- /dev/null
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/gp100.c
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2017 Rhys Kidd
+ *
+ * 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 permi

Re: [Nouveau] trouble connecting to Panduit VGA adapter

2017-09-04 Thread Ilia Mirkin
Does v4.13 fix your issues? v4.10 also included significant rework
related to DP-MST, and I wouldn't be surprised if it fixed a few DP
issues along the way. (Also, please don't drop the list from your
replies.)

On Mon, Sep 4, 2017 at 9:30 AM, Marko Schuetz-Schmuck
 wrote:
> I'm running 4.9.43-1-MANJARO
>
> Ilia Mirkin  writes:
>
>> Are you running a v4.12-based kernel? If so, update to v4.13-rcN or
>> integrate 
>> https://github.com/skeggsb/linux/commit/13a86519202c5d119d83640d6f781f3181205d2c
>> into your kernel build.
>>
>> On Fri, Sep 1, 2017 at 12:50 PM, Marko Schuetz-Schmuck
>>  wrote:
>>> I want to connect to an InFocus projector that sits behind a Panduit VGA
>>> adapter. I use a Thinkpad P51 with a mini display-port to VGA
>>> converter. The laptop runs Manjaro and has the
>>> video-hybrid-intel-nouveau-prime installed and it works with other
>>> monitors. For some reason it does not detect the projector that is
>>> connected through the Panduit. The keyboard shortcut to switch monitor
>>> configuration says "No External Display". xrandr reports only the
>>> built-in screen.
>>>
>>> I talked to the technician for the room installation and he told me that
>>> he had seen this before on a Ubuntu machine and that switching to the
>>> proprietary nvidia driver solved that problem. For various reasons I'd
>>> rather not switch to that driver.
>>>
>>> I also found some lines with "DRM: DDC responded, but no EDID for DP-1"
>>> in them from around the time I tried connecting to the projector. Could
>>> they be related?
>>>
>>> Is there some setting or configuration that can help in this case?
>>>
>>> Best regards,
>>>
>>> Marko
>>>
>>> ___
>>> Nouveau mailing list
>>> Nouveau@lists.freedesktop.org
>>> https://lists.freedesktop.org/mailman/listinfo/nouveau
>>>
>
> --
> Prof. Dr. Marko Schütz-Schmuck
> Department of Mathematical Sciences
> University of Puerto Rico at Mayagüez
> Mayagüez, PR 00681
___
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau


[Nouveau] linux-4.13/drivers/gpu/drm/nouveau/nvkm/subdev/therm/fan.c:86: possible faulty logic ?

2017-09-04 Thread David Binderman
Hello there,

[linux-4.13/drivers/gpu/drm/nouveau/nvkm/subdev/therm/fan.c:93]: (warning) 
Opposite inner 'if' condition leads to a dead code block.

Source code is

if (target != duty) {
u16 bump_period = fan->bios.bump_period;
u16 slow_down_period = fan->bios.slow_down_period;
u64 delay;

if (duty > target)
delay = slow_down_period;
else if (duty == target)
delay = min(bump_period, slow_down_period) ;

Last if can never be true, so call to min can never execute. Suggest code 
rework.

Regards

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


Re: [Nouveau] Power Management under Nouveau

2017-09-04 Thread Pierre Moreau
Hello Paulo,

Power management is made of different things:

* reclocking the memory and the engines: this is supported on some Tesla cards
  (>G92), all Kepler ones and on the first generation of Maxwell (GM10x). In
  that regard, the Arch Linux wiki is right, as Pascal cards do not support
  reclocking.

* power- and clock-gating: there’s some ongoing work for it, but none of the
  cards have upstream support for it.

* automatically suspending the card when it is not used (only for Optimus
  setups): this should work for most laptops (except for MacBooks). This is
  what the Fedora wiki is referring to.

There is also adjusting the voltage, changing the fan speed, and probably a few
others.

> there's no DONE stamp on the Power management row. Is this up-to-date?

I think so, as power- and clock gating are not supported yet, power management
support is not done yet. But the [power management feature matrix][1] seems to
be a bit out-of-date.

Cheers,
Pierre

[1]: https://nouveau.freedesktop.org/wiki/PowerManagement/


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


[Nouveau] Power Management under Nouveau

2017-09-04 Thread Paulo Matos
Hello,

I would like some clarity from the developers on the state of power
management for nouveau. I have recently acquired a Dell XPS 15 (2017)
9560 with:
00:02.0 VGA compatible controller [0300]: Intel Corporation Device
[8086:591b] (rev 04)
01:00.0 3D controller [0302]: NVIDIA Corporation Device [10de:1c8d] (rev a1)

There seems to be contradictory information online with Arch Wiki
mentioning:
"Note that the open source Nvidia driver Nouveau currently does not
support power management on Pascal GPUs such as the GTX 1050, so
performance is very poor with this driver."
https://wiki.archlinux.org/index.php/Dell_XPS_15_9560

and Fedora wiki saying:
"In fact, you can no longer use the bumblebee software with nouveau any
longer even if you want to. See issue 773 for further information about
this subject. You MUST USE PRIME. The nouveau driver already handles
power saving nowadays so bumblebee would just be superfluous… "
https://fedoraproject.org/wiki/Bumblebee

However when one looks at the nouveau power support matrix:
https://nouveau.freedesktop.org/wiki/FeatureMatrix/

there's no DONE stamp on the Power management row. Is this up-to-date?

Kind regards,

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


Re: [Nouveau] v4.12 backport request: 13a86519202 (drm/nouveau/i2c/gf119-: add support for address-only transactions)

2017-09-04 Thread Greg KH
On Sun, Sep 03, 2017 at 11:46:57AM -0400, Ilia Mirkin wrote:
> Commit df8dc97cd17 (drm/nouveau/kms/nv50: use drm core i2c-over-aux
> algorithm) switched things over to the drm algo. Unfortunately it
> generates address-only transactions. Prior to GF119, the hardware had
> no support for such things, and GF119+ the nouveau code did not handle
> these properly.
> 
> The result of this bug is that EDID doesn't make it over for DP (and
> eDP) screens, which in turn wreaks all sorts of havoc. There have been
> lots of reports on IRC, a few on mailing lists, and also:
> 
> https://bugs.freedesktop.org/show_bug.cgi?id=102528
> 
> Commit 13a86519202 (drm/nouveau/i2c/gf119-: add support for
> address-only transactions) fixes the nouveau support for such
> transactions on GF119+ and flips things back over to the custom algo
> for earlier chips. Please include into the next v4.12.x release:

Now queued up, thanks.

greg k-h
___
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau