summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/nouveau
AgeCommit message (Collapse)AuthorFilesLines
2016-12-25ktime: Cleanup ktime_set() usageThomas Gleixner1-1/+1
ktime_set(S,N) was required for the timespec storage type and is still useful for situations where a Seconds and Nanoseconds part of a time value needs to be converted. For anything where the Seconds argument is 0, this is pointless and can be replaced with a simple assignment. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Peter Zijlstra <peterz@infradead.org>
2016-12-13Merge branch 'linux-4.10' of git://github.com/skeggsb/linux into drm-nextDave Airlie14-38/+171
- Regression fix from atomic conversion (rotation on the original G80). - Concurrency fix when clearing compression tags. - Fixes DP link training issues on GP102/4/6. - Fixes backlight handling in the presence of Apple GMUX. - Improvements to GPU error recovery in a number of scenarios. - GP106 support. * 'linux-4.10' of git://github.com/skeggsb/linux: drm/nouveau/kms/nv50: fix atomic regression on original G80 drm/nouveau/bl: Do not register interface if Apple GMUX detected drm/nouveau/bl: Assign different names to interfaces drm/nouveau/bios/dp: fix handling of LevelEntryTableIndex on DP table 4.2 drm/nouveau/ltc: protect clearing of comptags with mutex drm/nouveau/gr/gf100-: handle GPC/TPC/MPC trap drm/nouveau/core: recognise GP106 chipset drm/nouveau/ttm: wait for bo fence to signal before unmapping vmas drm/nouveau/gr/gf100-: FECS intr handling is not relevant on proprietary ucode drm/nouveau/gr/gf100-: properly ack all FECS error interrupts drm/nouveau/fifo/gf100-: recover from host mmu faults
2016-12-13drm/nouveau/kms/nv50: fix atomic regression on original G80Ben Skeggs1-0/+5
Reported-by: Pierre Moreau <pierre.morrow@free.fr> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-12-13drm/nouveau/bl: Do not register interface if Apple GMUX detectedPierre Moreau1-0/+6
The Apple GMUX is the one managing the backlight, so there is no need for Nouveau to register its own backlight interface. v2: Do not split information message on two lines as it prevents from grepping it, as pointed out by Lukas Wunner v3: Add a missing end-of-line character to the printed message Signed-off-by: Pierre Moreau <pierre.morrow@free.fr> Reviewed-by: Lukas Wunner <lukas@wunner.de> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-12-13drm/nouveau/bl: Assign different names to interfacesPierre Moreau4-4/+83
Currently, every backlight interface created by Nouveau uses the same name, nv_backlight. This leads to a sysfs warning as it tries to create an already existing folder. This patch adds a incremented number to the name, but keeps the initial name as nv_backlight, to avoid possibly breaking userspace; the second interface will be named nv_backlight1, and so on. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=86539 v2: * Switch to using ida for generating unique IDs, as suggested by Ilia Mirkin; * Allocate backlight name on the stack, as suggested by Ilia Mirkin; * Move `nouveau_get_backlight_name()` to avoid forward declaration, as suggested by Ilia Mirkin; * Fix reference to bug report formatting, as reported by Nick Tenney. v3: * Define a macro for the size of the backlight name, to avoid defining it multiple times; * Use snprintf in place of sprintf. v4: * Do not create similarly named interfaces when reaching the maximum amount of unique names, but fail instead, as pointed out by Lukas Wunner Signed-off-by: Pierre Moreau <pierre.morrow@free.fr> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-12-13drm/nouveau/bios/dp: fix handling of LevelEntryTableIndex on DP table 4.2Ben Skeggs1-1/+4
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-12-13drm/nouveau/ltc: protect clearing of comptags with mutexBen Skeggs1-0/+2
Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Cc: stable@vger.kernel.org
2016-12-13drm/nouveau/gr/gf100-: handle GPC/TPC/MPC trapBen Skeggs1-0/+7
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-12-13drm/nouveau/core: recognise GP106 chipsetBen Skeggs1-0/+30
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-12-13drm/nouveau/ttm: wait for bo fence to signal before unmapping vmasBen Skeggs1-0/+1
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-13drm/nouveau/gr/gf100-: FECS intr handling is not relevant on proprietary ucodeBen Skeggs1-2/+2
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-12-13drm/nouveau/gr/gf100-: properly ack all FECS error interruptsBen Skeggs1-3/+2
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-12-13drm/nouveau/fifo/gf100-: recover from host mmu faultsBen Skeggs4-28/+29
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-06Merge branch 'linux-4.10' of git://github.com/skeggsb/linux into drm-nextDave Airlie26-154/+167
- BIT_PERF_PTRS uses 32-bit pointers to its subtables, we were parsing them as 16-bit, causing various issues on newer boards. - Support for MXM on GM20x and up. - More display-related fixes. * 'linux-4.10' of git://github.com/skeggsb/linux: drm/nouveau/mxm: warn more loudly on unsupported DCB version drm/nouveau/mxm: handle DCB 4.1 modification drm/nouveau/bios/mxm: handle digital connector table 1.1 drm/nouveau: Queue hpd_work on (runtime) resume drm/nouveau: Rename acpi_work to hpd_work drm/nouveau/kms/nv50: Fix atomic pageflip events. drm/nouveau/fb/ram/gp100-: fix memory detection where FBP_NUM != FBPA_NUM drm/nouveau/bios/volt: pointers are 32-bit drm/nouveau/bios/vmap: pointers are 32-bit drm/nouveau/bios/timing: pointers are 32-bit drm/nouveau/bios/therm: pointers are 32-bit drm/nouveau/bios/perf: pointers are 32-bit drm/nouveau/bios/iccsense: pointers are 32-bit drm/nouveau/bios/fan: pointers are 32-bit drm/nouveau/bios/cstep: pointers are 32-bit drm/nouveau/bios/boost: pointers are 32-bit
2016-12-06drm/nouveau/mxm: warn more loudly on unsupported DCB versionBen Skeggs1-1/+1
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-12-06drm/nouveau/mxm: handle DCB 4.1 modificationBen Skeggs1-1/+1
Allows MXM DCB modification to be handled on GM20x and newer boards. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-12-06drm/nouveau/bios/mxm: handle digital connector table 1.1Ben Skeggs1-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-11-28drm/nouveau: Queue hpd_work on (runtime) resumeHans de Goede1-1/+10
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-28drm/nouveau: Rename acpi_work to hpd_workHans de Goede2-17/+17
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-28drm/nouveau/kms/nv50: Fix atomic pageflip events.Mario Kleiner1-0/+2
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-28drm/nouveau/fb/ram/gp100-: fix memory detection where FBP_NUM != FBPA_NUMBen Skeggs1-2/+2
In this situation, we'd have ended up detecting less VRAM than we have. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-28drm/nouveau/bios/volt: pointers are 32-bitBen Skeggs3-17/+17
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-28drm/nouveau/bios/vmap: pointers are 32-bitBen Skeggs3-17/+17
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-28drm/nouveau/bios/timing: pointers are 32-bitBen Skeggs2-13/+13
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-28drm/nouveau/bios/therm: pointers are 32-bitBen Skeggs1-10/+10
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-28drm/nouveau/bios/perf: pointers are 32-bitBen Skeggs3-14/+16
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-28drm/nouveau/bios/iccsense: pointers are 32-bitBen Skeggs1-4/+4
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-28drm/nouveau/bios/fan: pointers are 32-bitBen Skeggs2-10/+10
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-28drm/nouveau/bios/cstep: pointers are 32-bitBen Skeggs3-23/+23
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-28drm/nouveau/bios/boost: pointers are 32-bitBen Skeggs3-23/+23
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-17Merge branch 'linux-4.10' of git://github.com/skeggsb/linux into drm-nextDave Airlie55-377/+778
- GP102/GP104 devinit (suspend/resume, optimus) hang fix - GP102/GP104 hardware cursor fix - Fix for a regression on some non-MST monitors that was caused by the MST work - Workaround for certain laptops where ACPI sends display hotkey presses on a modeset, causing gnome-settings-daemon to go into a continuous loop * 'linux-4.10' of git://github.com/skeggsb/linux: drm/nouveau/disp/gp102: rename from gp104 drm/nouveau/ce/gp102: rename from gp104 drm/nouveau/fb/gp102: rename from gp104 drm/nouveau/disp/gp102: fix cursor/overlay immediate channel indices drm/nouveau/disp/nv50-: specify ctrl/user separately when constructing classes drm/nouveau/disp/nv50-: split chid into chid.ctrl and chid.user drm/nouveau: Intercept ACPI_VIDEO_NOTIFY_PROBE drm/nouveau/devinit/gm200: drop pmu reset sequence drm/nouveau/devinit/gm200: replace while loops with PTIMER-based timeout loops drm/nouveau/pmu/gp102: initial implementation drm/nouveau/pmu/gp100: initial implementation drm/nouveau/pmu: execute reset before running devinit drm/nouveau/pmu: move ucode handling into gt215 implementation drm/nouveau/core: initial support for GP102 drm/nouveau/device/pci: fix oops if no mmu subdev present drm/nouveau/kms/nv50: avoid touching DP_MSTM_CTRL if !DP_MST_CAP
2016-11-17drm/nouveau/disp/gp102: rename from gp104Ben Skeggs14-46/+46
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-17drm/nouveau/ce/gp102: rename from gp104Ben Skeggs4-13/+13
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-17drm/nouveau/fb/gp102: rename from gp104Ben Skeggs4-7/+7
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-17drm/nouveau/disp/gp102: fix cursor/overlay immediate channel indicesBen Skeggs5-2/+80
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-17drm/nouveau/disp/nv50-: specify ctrl/user separately when constructing classesBen Skeggs14-28/+32
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-17drm/nouveau/disp/nv50-: split chid into chid.ctrl and chid.userBen Skeggs7-92/+106
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-17drm/nouveau: Intercept ACPI_VIDEO_NOTIFY_PROBEHans de Goede2-0/+65
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-17drm/nouveau/devinit/gm200: drop pmu reset sequenceBen Skeggs1-12/+0
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-17drm/nouveau/devinit/gm200: replace while loops with PTIMER-based timeout loopsBen Skeggs1-4/+11
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-17drm/nouveau/pmu/gp102: initial implementationBen Skeggs4-0/+47
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-17drm/nouveau/pmu/gp100: initial implementationBen Skeggs4-0/+38
Just enough to hookup preinit reset(), which DEVINIT will depend on later. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-17drm/nouveau/pmu: execute reset before running devinitBen Skeggs1-0/+8
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-17drm/nouveau/pmu: move ucode handling into gt215 implementationBen Skeggs9-184/+304
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-17drm/nouveau/core: initial support for GP102Ben Skeggs1-0/+29
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-17drm/nouveau/device/pci: fix oops if no mmu subdev presentBen Skeggs1-1/+1
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-17drm/nouveau/kms/nv50: avoid touching DP_MSTM_CTRL if !DP_MST_CAPBen Skeggs1-2/+5
Fixes certain displays not being detected due to DPAUX errors. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-16drm/nouveau: Use drm_crtc_vblank_off/onDaniel Vetter2-10/+6
With atomic nv50+ is already converted over to them, but the old display code is still using it. Found in a 2 year old patch I have lying around to un-export these old helpers! v2: Drop the hand-rolled versions from resume/suspend code. Now that crtc callbacks do this, we don't need a special case for s/r anymore. v3: Remove unused variables. v4: Don't remove drm_crtc_vblank_off from suspend paths, non-atomic nouveau still needs that. But still switch to drm_crtc_vblank_off since drm_vblank_off will disappear. Cc: Mario Kleiner <mario.kleiner.de@gmail.com> Cc: Ben Skeggs <bskeggs@redhat.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/20161114114101.21731-1-daniel.vetter@ffwll.ch
2016-11-14drm/nouveau: use DRM_FB_HELPER_DEFAULT_OPS for fb_opsStefan Christ1-14/+2
Cc: Ben Skeggs <bskeggs@redhat.com> Signed-off-by: Stefan Christ <contact@stefanchrist.eu> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1479078208-25221-9-git-send-email-contact@stefanchrist.eu
2016-11-07drm/nouveau/fifo/gf100-: protect channel preempt with subdev mutexBen Skeggs2-6/+11
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