Commit Graph

634914 Commits

Author SHA1 Message Date
Ben Skeggs 79d48dadb0 drm/nouveau/bios/dp: fix handling of LevelEntryTableIndex on DP table 4.2
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-12-13 11:40:16 +10:00
Ben Skeggs f4e65efc88 drm/nouveau/ltc: protect clearing of comptags with mutex
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Cc: stable@vger.kernel.org
2016-12-13 11:40:09 +10:00
Ben Skeggs 64373e4bb6 drm/nouveau/gr/gf100-: handle GPC/TPC/MPC trap
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-12-13 11:40:08 +10:00
Ben Skeggs 1fe487d7d2 drm/nouveau/core: recognise GP106 chipset
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-12-13 11:40:08 +10:00
Ben Skeggs 10dcab3e7f drm/nouveau/ttm: wait for bo fence to signal before unmapping vmas
TTM was changed a while back to allow for pipelining of buffer moves, and
part of this was the removal of waiting for a BO to idle before calling
move(), placing the responsibility on the driver to do this if required.

That's all well and good, except, we make use of move_notify() to handle
mapping/unmapping from the GPU VMM as move() isn't called on all paths.

This commit adds a wait before unmapping from a VMM in move_notify(), to
prevent GPU page faults where a buffer is still being accessed.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Cc: stable@vger.kernel.org [v4.8+]
2016-12-13 11:39:55 +10:00
Ben Skeggs 732be80743 drm/nouveau/gr/gf100-: FECS intr handling is not relevant on proprietary ucode
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-12-13 11:38:52 +10:00
Ben Skeggs 48dac93506 drm/nouveau/gr/gf100-: properly ack all FECS error interrupts
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-12-13 11:38:51 +10:00
Ben Skeggs ec884f74f1 drm/nouveau/fifo/gf100-: recover from host mmu faults
This has been on the TODO list for a while now, recovering from things
such as attempting to execute a push buffer or touch a semaphore in an
unmapped memory area.

The only thing required on the HW side here is that the offending
channel is removed from the runlist, and *not* a full reset of PFIFO.

This used to be a bit messier to handle before the rework to make use
of engine topology info, but is apparently now trivial.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-12-13 11:38:51 +10:00
Ben Skeggs a8f6cb7bb3 drm/nouveau/mxm: warn more loudly on unsupported DCB version
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-12-06 09:08:23 +10:00
Ben Skeggs f6bf17391f drm/nouveau/mxm: handle DCB 4.1 modification
Allows MXM DCB modification to be handled on GM20x and newer boards.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-12-06 09:08:23 +10:00
Ben Skeggs 8ca99316fd drm/nouveau/bios/mxm: handle digital connector table 1.1
I suspect the version bump is just to signify that the table now specifies
pad macro/links instead of SOR/sublinks.

For our usage of the table, just recognising the new version is enough.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-12-06 09:08:23 +10:00
Hans de Goede 0b2fe6594f drm/nouveau: Queue hpd_work on (runtime) resume
We need to call drm_helper_hpd_irq_event() on resume to properly detect
monitor connection / disconnection on some laptops, use hpd_work for
this to avoid deadlocks.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-28 15:39:35 +10:00
Hans de Goede 81280d0e24 drm/nouveau: Rename acpi_work to hpd_work
We need to call drm_helper_hpd_irq_event() on resume to properly detect
monitor connection / disconnection on some laptops. For runtime-resume
(which gets called on resume from normal suspend too) we must call
drm_helper_hpd_irq_event() from a workqueue to avoid a deadlock.

Rename acpi_work to hpd_work, and move it out of the #ifdef CONFIG_ACPI
blocks to make it suitable for generic work.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-28 15:39:35 +10:00
Mario Kleiner bd9f6605a8 drm/nouveau/kms/nv50: Fix atomic pageflip events.
The new atomic modesetting/pageflip code for nv50+ for
Linux 4.10+ no longer uses pageflip irq's to signal
flip completion. Instead it polls for flip completion
from within a kthread/work queue.

This creates a race between the vblank irq handler
updating the vblank count and timestamp for the
vblank of flip completion, and the kthread's
polling code detecting flip completion and sending
out the flip completion event.

Depending on who executes a few microseconds earlier,
the flip completion event will either contain correct
count/timestamp or a stale count/timestamp from the
previous vblank. This error was observed for about
50% of all executed flips, e.g., observable under DRI2
by the Xorg.log filling with flip handler warning
messages.

Call drm_accurate_vblank_count() before sending
out flip completion events to enforce a vblank
count/ts update for the vblank of flip completion
and avoid stale counts/timestamps.

This fix leads to one redundant call to drm_update_vblank_count
for each completed flip, but no other side effects. On
a ~6 year old Core i7 M620@ 2.67GHz the redundant call
costs about 10 usecs per flip

Successfully tested on GeForce 9500/9600/330M so far.

Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Cc: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-28 15:39:35 +10:00
Ben Skeggs 02099bac65 drm/nouveau/fb/ram/gp100-: fix memory detection where FBP_NUM != FBPA_NUM
In this situation, we'd have ended up detecting less VRAM than we have.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-28 15:39:35 +10:00
Ben Skeggs ff5354120f drm/nouveau/bios/volt: pointers are 32-bit
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-28 15:39:35 +10:00
Ben Skeggs 60fb7064e4 drm/nouveau/bios/vmap: pointers are 32-bit
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-28 15:39:35 +10:00
Ben Skeggs 1957d3d568 drm/nouveau/bios/timing: pointers are 32-bit
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-28 15:39:35 +10:00
Ben Skeggs a215721fb6 drm/nouveau/bios/therm: pointers are 32-bit
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-28 15:39:35 +10:00
Ben Skeggs 8f6a5ab9b1 drm/nouveau/bios/perf: pointers are 32-bit
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-28 15:39:35 +10:00
Ben Skeggs 5764ff609d drm/nouveau/bios/iccsense: pointers are 32-bit
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-28 15:39:34 +10:00
Ben Skeggs 4a8daacf50 drm/nouveau/bios/fan: pointers are 32-bit
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-28 15:39:34 +10:00
Ben Skeggs 6496b4e5ab drm/nouveau/bios/cstep: pointers are 32-bit
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-28 15:39:34 +10:00
Ben Skeggs 5878601767 drm/nouveau/bios/boost: pointers are 32-bit
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-28 15:39:34 +10:00
Ben Skeggs ed828666a7 drm/nouveau/disp/gp102: rename from gp104
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-17 09:50:39 +10:00
Ben Skeggs a4fa851c64 drm/nouveau/ce/gp102: rename from gp104
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-17 09:50:39 +10:00
Ben Skeggs eeea423c48 drm/nouveau/fb/gp102: rename from gp104
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-17 09:50:39 +10:00
Ben Skeggs e50fcff15f drm/nouveau/disp/gp102: fix cursor/overlay immediate channel indices
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-17 09:50:38 +10:00
Ben Skeggs 2a32b9b186 drm/nouveau/disp/nv50-: specify ctrl/user separately when constructing classes
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-17 09:50:38 +10:00
Ben Skeggs 4391d7f5c7 drm/nouveau/disp/nv50-: split chid into chid.ctrl and chid.user
GP102/GP104 make life difficult by redefining the channel indices for
some registers, but not others.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-17 09:50:38 +10:00
Hans de Goede 3a6536c51d drm/nouveau: Intercept ACPI_VIDEO_NOTIFY_PROBE
Various notebooks with nvidia GPUs generate an ACPI_VIDEO_NOTIFY_PROBE
acpi-video event when an external device gets plugged in (and again on
modesets on that connector), the default behavior in the acpi-video
driver for this is to send a KEY_SWITCHVIDEOMODE evdev event, which
causes e.g. gnome-settings-daemon to ask us to rescan the connectors
(good), but also causes g-s-d to switch to mirror mode on a newly plugged
monitor rather then using the monitor to extend the desktop (bad)
as KEY_SWITCHVIDEOMODE is supposed to switch between extend the desktop
vs mirror mode.

More troublesome are the repeated ACPI_VIDEO_NOTIFY_PROBE events on
changing the mode on the connector, which cause g-s-d to switch
between mirror/extend mode, which causes a new ACPI_VIDEO_NOTIFY_PROBE
event and we end up with an endless loop.

This commit fixes this by adding an acpi notifier block handler to
nouveau_display.c to intercept ACPI_VIDEO_NOTIFY_PROBE and:

1) Wake-up runtime suspended GPUs and call drm_helper_hpd_irq_event()
   on them, this is necessary in some cases for the GPU to detect connector
   hotplug events while runtime suspended
2) Return NOTIFY_BAD to stop acpi-video from emitting a bogus
   KEY_SWITCHVIDEOMODE key-press event

There already is another acpi notifier block handler registered in
drivers/gpu/drm/nouveau/nvkm/engine/device/acpi.c, but that is not
suitable since that one gets unregistered on runtime suspend, and
we also want to intercept ACPI_VIDEO_NOTIFY_PROBE when runtime suspended.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2016-11-17 09:50:37 +10:00
Ben Skeggs dc2b655928 drm/nouveau/devinit/gm200: drop pmu reset sequence
This sequence is incorrect for GP102/GP104 boards.  This is now being
handled correctly by the PMU subdev during preinit();

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-17 09:50:37 +10:00
Ben Skeggs 920c58a711 drm/nouveau/devinit/gm200: replace while loops with PTIMER-based timeout loops
It appears to be safe to access PTIMER on an unposted board with newer
chipsets.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-17 09:50:37 +10:00
Ben Skeggs d91ccec631 drm/nouveau/pmu/gp102: initial implementation
GP102/GP104 require a harder reset of PMU prior to DEVINIT, or the IFR
image will hang.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-17 09:50:37 +10:00
Ben Skeggs 41c7be6913 drm/nouveau/pmu/gp100: initial implementation
Just enough to hookup preinit reset(), which DEVINIT will depend on later.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-17 09:50:36 +10:00
Ben Skeggs 2f524aa0b7 drm/nouveau/pmu: execute reset before running devinit
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-17 09:50:36 +10:00
Ben Skeggs da7d2062fc drm/nouveau/pmu: move ucode handling into gt215 implementation
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-17 09:50:36 +10:00
Ben Skeggs 17ff521d69 drm/nouveau/core: initial support for GP102
From visual inspection of traces, what we currently implement appears to
be identical to GP104.  Seems to work well enough too.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-17 09:50:35 +10:00
Ben Skeggs 9e38b13ea5 drm/nouveau/device/pci: fix oops if no mmu subdev present
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-17 09:50:35 +10:00
Ben Skeggs 3ca03cac39 drm/nouveau/kms/nv50: avoid touching DP_MSTM_CTRL if !DP_MST_CAP
Fixes certain displays not being detected due to DPAUX errors.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-17 09:50:35 +10:00
Ben Skeggs b27add13f5 drm/nouveau/fifo/gf100-: protect channel preempt with subdev mutex
This avoids an issue that occurs when we're attempting to preempt multiple
channels simultaneously.  HW seems to ignore preempt requests while it's
still processing a previous one, which, well, makes sense.

Fixes random "fifo: SCHED_ERROR 0d []" + GPCCS page faults during parallel
piglit runs on (at least) GM107.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Cc: stable@vger.kernel.org
2016-11-07 14:05:13 +10:00
Alexandre Courbot e137040e0d drm/nouveau/gr: fallback to legacy paths during firmware lookup
Look for firmware files using the legacy ("nouveau/nvxx_fucxxxx") path
if they cannot be found in the new, "official" path. User setups were
broken by the switch, which is bad.

There are only 4 firmware files we may want to look up that way, so
hardcode them into the lookup function. All new firmware files should
use the standard "nvidia/<chip>/gr/" path.

Fixes: 8539b37ace ("drm/nouveau/gr: use NVIDIA-provided external firmwares")
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Cc: stable@vger.kernel.org
2016-11-07 14:05:04 +10:00
Ben Skeggs f479c0ba4a drm/nouveau/kms/nv50: initial support for DP 1.2 multi-stream
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-07 14:05:03 +10:00
Ben Skeggs d665c7e914 drm/nouveau/kms/nv50: allow encoder update to be called from other modules
MST encoders will make use of this to share code with SOR>

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-07 14:05:03 +10:00
Ben Skeggs 9bfdee9a08 drm/nouveau/kms/nv50: rename remaining nv50_crtc to nv50_head
No code changes, just renames + shuffles.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-07 14:05:02 +10:00
Ben Skeggs f00f0e218b drm/nouveau/kms/nv50: remove code to create ctxdma for every framebuffer
This is now handled by prepare_fb().  Legacy flips were the last user.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-07 14:05:02 +10:00
Ben Skeggs e1ef6b42d9 drm/nouveau/kms/nv50: remove code to support non-atomic page flips
Made completely unreachable (and broken) by atomic commits.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-07 14:05:01 +10:00
Ben Skeggs c2d926aacc drm/nouveau/kms/nv50: remove code to support non-atomic connector properties
Made completely unreachable by atomic commits.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-07 14:05:01 +10:00
Ben Skeggs 8896ceef78 drm/nouveau/kms/nv50: remove code to support non-atomic dpms
Made completely unreachable (and broken) by atomic commits.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-07 14:05:00 +10:00
Ben Skeggs f7aa20e833 drm/nouveau/kms/nv50: remove code to support non-atomic modesets
Make completely unreachable (and broken) by atomic commits.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-07 14:05:00 +10:00