Commit graph

681 commits

Author SHA1 Message Date
Sergei Antonov 9a11843987 drm/nouveau/bios: fix a bit shift error introduced by 457e77b
Commit 457e77b264 added two checks applied to a
value received from nv_rd32(bios, 0x619f04). But after this new piece of code
is executed, the addr local variable does not hold the same value it used to
hold before the commit. Here is what is was assigned in the original code:
	(u64)(nv_rd32(bios, 0x619f04) & 0xffffff00) << 8
in the committed code it ends up with this value:
	(u64)(nv_rd32(bios, 0x619f04) >> 8) << 8
These expressions are obviously not equivalent.

My Nvidia video card does not show anything on the display when I boot a
kernel containing this commit.

The patch fixes the code so that the new checks are still done, but the
side effect of an incorrect addr value is gone.

Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sergei Antonov <saproj@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-04-18 13:15:18 +10:00
Martin Peres 18acc6d84e drm/nouveau/bios: fetch the vbios from PROM using only aligned 32-bit accesses
Other kind of accesses are unreliable on Kepler cards. As advised by NVIDIA,
let's only use 32-bit accesses to fetch the vbios from PROM.

This fixes vbios fetching on my nve7 which failed in certain specific
conditions.

I suggest we Cc stable, for all kernels they still maintain after the big
rewrite.

Suggested-by: Christian Zander <czander@nvidia.com>
Signed-off-by: Martin Peres <martin.peres@free.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-03-26 14:08:26 +10:00
Martin Peres 0e994d6456 drm/nouveau/therm: let the vbios decide on the automatic fan management mode
This should fix automatic fan management on fermi cards who do not have
0x46 entries in the thermal table.

On my nve6, the blob sets the default linear range from 40°C to 100°C
but my nvcf's default values are 40°C to 85°C. Let's keep 85 as a default
for everyone.

Signed-off-by: Martin Peres <martin.peres@labri.fr>
Tested-by: Timothée Ravier <tim@siosm.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-03-26 14:08:25 +10:00
Martin Peres 9c9191aaf8 drm/nvd7/therm: handle another kind of PWM fans
This should fix fan management on many nvd7+ chipsets.

Signed-off-by: Martin Peres <martin.peres@labri.fr>
Tested-by: Timothée Ravier <tim@siosm.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-03-26 14:08:24 +10:00
Martin Peres 61679fe153 drm/nouveau/pm/fan: drop the fan lock in fan_update() before rescheduling
This should fix a deadlock that has been reported to us where fan_update()
would hold the fan lock and try to grab the alarm_program_lock to reschedule
an update. On an other CPU, the alarm_program_lock would have been taken
before calling fan_update(), leading to a deadlock.

We should Cc: <stable@vger.kernel.org> # 3.9+

Reported-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Tested-by: Timothée Ravier <tim@siosm.fr>
Tested-by: Boris Fersing (IRC nick fersingb, no public email address)
Signed-off-by: Martin Peres <martin.peres@free.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-03-26 14:08:24 +10:00
Ben Skeggs dcd9262b3b drm/nouveau/therm: check for sensor presence with requested mode, not current
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-03-26 14:08:22 +10:00
Ilia Mirkin cbc53c1679 drm/nouveau/disp/dp: allow 540MHz data rate
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76319
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-03-26 14:08:22 +10:00
Ben Skeggs fc243d7f92 drm/nouveau/disp: limit dp capabilities as per dcb
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-03-26 14:08:20 +10:00
Ben Skeggs 5ca929b952 drm/nva3/fbram: restrict training pattern setup to GT218
It doesn't look like the others have the registers.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-03-26 14:08:20 +10:00
Ben Skeggs 8687c5d7b1 drm/nva3/devinit: restrict script access to some PFB regs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-03-26 14:08:19 +10:00
Ben Skeggs 3219adc29c drm/nouveau/devinit: add interface to check if a mmio access by scripts is ok
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-03-26 14:08:19 +10:00
Ben Skeggs 0a8649f1c6 drm/nouveau/bios: have strap reads show on devinit spam debug level
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-03-26 14:08:18 +10:00
Ben Skeggs 7730705126 drm/nv50/gpio: fixup reset for gpios >= 16
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-03-26 14:08:17 +10:00
Ben Skeggs 5cfd48b212 drm/nv50/gpio: exclude sense value from mask when changing registers
Shouldn't effect anything, was just momentarily confusing while looking
at traces.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-03-26 14:08:17 +10:00
Ben Skeggs 1f1ac3bf2a drm/gk104/gr: therm magic needed on some kepler boards
Not needed everywhere, and potentially not safe to do depending on how
the rest of PTHERM is configured...

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-03-26 14:08:16 +10:00
Ben Skeggs 6f1e9b99b3 drm/gm107/gr: initial support
Our ucode only partially works at this point, so requiring binary fw
image for now.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-03-26 14:08:15 +10:00
Ben Skeggs 295cb52be5 drm/gf100-/gf: fix a stupid typo, waiting on wrong signal for mmctx
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-03-26 14:08:15 +10:00
Ben Skeggs bd3cac7bb0 drm/nouveau/bios: parsing of some random table needed to bring up gr
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-03-26 14:08:14 +10:00
Ben Skeggs 085969e6fb drm/nv50/bar: fix plymouth issues on certain efi macbooks
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-03-26 14:08:14 +10:00
Ben Skeggs 88e98d49a1 drm/gf100-/gr: split ppc state into its subunits
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-03-26 14:08:12 +10:00
Ben Skeggs 7e19453349 drm/gf100-/gf: split tpc state into its subunits
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-03-26 14:08:12 +10:00
Ben Skeggs 97af71fa40 drm/gf100-/gr: split gpc state into its subunits
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-03-26 14:08:11 +10:00
Ben Skeggs c33b1e8c63 drm/gf100-/gr: tidy reg/ctx initval lists, mostly by giving them names
Unit names come from the Android GK20A driver.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-03-26 14:08:10 +10:00
Ben Skeggs 64e4886b6a drm/gk110/gr: minor adjustment to some random initval
Change from traces of a newer binary driver version.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-03-26 14:08:10 +10:00
Ben Skeggs 014ffe4799 drm/gk104/gr: minor adjustment to some random initval
Change from traces of a newer binary driver version.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-03-26 14:08:09 +10:00
Ben Skeggs 4ab31a0804 drm/gf119/gr: fix bug in some random initval
Bug noticed vs traces.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-03-26 14:08:08 +10:00
Ben Skeggs e21bfd171a drm/gf110/gr: fixup gpc/tpc initvals lists
Differences noted vs traces.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-03-26 14:08:08 +10:00
Ben Skeggs a6ca1a6546 drm/gk208/gr: minor adjustment to some random initval
Change from traces of a newer binary driver version.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-03-26 14:08:07 +10:00
Ben Skeggs 8060fad41b drm/gf108/gr: minor adjustment to some random initval
Bug noticed vs traces.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-03-26 14:08:06 +10:00
Ben Skeggs eeb0558e07 drm/gf104/gr: rename gf104 (nvc4), it came before gf106 (nvc3)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-03-26 14:08:06 +10:00
Ben Skeggs 6acc09b99d drm/nvc0-/graph: fix gpccs fuc stack setup
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-03-26 14:08:05 +10:00
Ben Skeggs 457e77b264 drm/nouveau/bios: add more checks to PRAMIN image fetching
Prevents an attempt to access VRAM on an un-posted board, which, on a
particular system with a GRID K1 installed, causes a MCE and chokes
the entire system.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-03-26 14:08:05 +10:00
Alexandre Courbot 420b946977 support for platform devices
Upcoming mobile Kepler GPUs (such as GK20A) use the platform bus instead
of PCI to which Nouveau is tightly dependent. This patch allows Nouveau
to handle platform devices by:

- abstracting PCI-dependent functions that were typically used for
  resource querying and page mapping,
- introducing a nv_device_is_pci() function that allows to make
  PCI-dependent code conditional,
- providing a nouveau_drm_platform_probe() function that takes a GPU
  platform device to be probed.

Core code as well as engine/subdev drivers are updated wherever possible
to make use of these functions. Some older drivers are too dependent on
PCI to be properly updated, but all newer code on which future chips may
depend should at least be runnable with platform devices.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-03-26 14:08:04 +10:00
Ben Skeggs 3f204647cd drm/gm100/device: recognise GM107
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-03-26 14:01:00 +10:00
Ben Skeggs c68c29c04c drm/gm107/disp: initial implementation
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-03-26 14:00:59 +10:00
Ben Skeggs f6bad8abc6 drm/gm107/ltcg: initial implementation
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-03-26 14:00:58 +10:00
Ben Skeggs 6bd9293ea8 drm/nouveau/bios: add HDMI-C (mini) connector type
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-03-26 14:00:58 +10:00
Ben Skeggs 267dcb6643 drm/gm107/fb: initial implementation
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-03-26 14:00:57 +10:00
Ben Skeggs 57f7422016 drm/gk20a/timer: initial implementation
A bit different from NVIDIA's RFC patch, but I want this now for GM107.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-03-26 14:00:56 +10:00
Ben Skeggs 13a49a10a0 drm/gm100/bios: hw disable register has moved
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-03-26 14:00:56 +10:00
Ben Skeggs 4bf23ead3a drm/gm107/devinit: initial implementation
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-03-26 14:00:55 +10:00
Ben Skeggs 56b2f68c17 drm/nve0/fifo: bind intr
Error code names from Android GK20A driver.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-03-26 14:00:54 +10:00
Ben Skeggs 129dcca79c drm/nve0/fifo: attempt to recover from engine ctxsw timeouts
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-03-26 14:00:54 +10:00
Ben Skeggs 98d1e317e5 drm/nve0/fifo: attempt to recover engines from mmu faults
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-03-26 14:00:53 +10:00
Ben Skeggs 448a4532a0 drm/nve0/fifo: allow copy engine channel to be looked up by instance
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-03-26 14:00:53 +10:00
Ben Skeggs 5c0633e6ee drm/nve0/fifo: use runlist event instead of polling
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-03-26 14:00:52 +10:00
Ben Skeggs 87032e11d9 drm/nve0/fifo: allow channels to be marked as unrunnable
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-03-26 14:00:51 +10:00
Ben Skeggs 0a7760e0b3 drm/nve0/fifo: single printk for sched error data
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-03-26 14:00:51 +10:00
Ben Skeggs 885f3ced1a drm/nve0/fifo: single printk for mmu fault data
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-03-26 14:00:50 +10:00
Ben Skeggs 3d61b967d2 drm/nve0/fifo: ack pb intr individually after handling each unit
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-03-26 14:00:49 +10:00