aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm
AgeCommit message (Collapse)AuthorFilesLines
2017-11-02drm/nouveau/imem/nv50: support eviction of BAR2 mappingsBen Skeggs1-5/+67
A good deal of the structures we map into here aren't accessed very often at all, and Fedora 26 has exposed an issue where after creating a heap of channels, BAR2 space would run out, and we'd need to make use of the slow path while accessing important structures like page tables. This implements an LRU on BAR2 space, which allows eviction of mappings that aren't currently needed, to make space for other objects. Signed-off-by: Ben Skeggs <[email protected]>
2017-11-02drm/nouveau/imem/nv50: prevent fast-path for mapped objects when BAR isn't readyBen Skeggs1-3/+5
Another piece of solving the "GP100 BAR2 VMM bootstrap" puzzle. Without doing this, we'd attempt to write PDEs for the lower page table levels through BAR2 before BAR2 access has been fully initialised. Signed-off-by: Ben Skeggs <[email protected]>
2017-11-02drm/nouveau/imem/nv50: map bar2 write-combinedBen Skeggs1-2/+3
Signed-off-by: Ben Skeggs <[email protected]>
2017-11-02drm/nouveau/imem/nv50: embed nvkm_instobj directly into nv04_instobjBen Skeggs1-32/+102
This is not as simple as it was for earlier GPUs, due to the need to swap accessor functions depending on whether BAR2 is usable or not. We were previously protected by nvkm_instobj's accessor functions keeping an object mapped permanently, with some unclear magic that managed to hit the slow-path where needed even if an object was marked as mapped. That's been replaced here by reference counting maps (some objects, like page tables can be accessed concurrently), and swapping the functions as necessary. Signed-off-by: Ben Skeggs <[email protected]>
2017-11-02drm/nouveau/imem/nv50: move slow-path locking into rd/wr functionsBen Skeggs1-8/+6
This is to simplify upcoming changes. The slow-path is something that currently occurs during bootstrap of the BAR2 VMM, while backing up an object during suspend/resume, or when BAR2 address space runs out. The latter is a real problem that can happen at runtime, and occurs in Fedora 26 already (due to some change that causes a lot of channels to be created at login), so ideally we'd prefer not to make it any slower. We'd also like suspend/resume speed to not suffer. Upcoming commits will solve those problems in a better way, making the extra overhead of moving the locking here a non-issue. Signed-off-by: Ben Skeggs <[email protected]>
2017-11-02drm/nouveau/imem/nv50: split object map out from api functionsBen Skeggs1-25/+32
acquire()/boot() will need different logic in addition to performing the actual mapping. Signed-off-by: Ben Skeggs <[email protected]>
2017-11-02drm/nouveau/imem/nv40: map bar2 write-combinedBen Skeggs1-2/+3
Signed-off-by: Ben Skeggs <[email protected]>
2017-11-02drm/nouveau/imem/nv40: embed nvkm_instobj directly into nv04_instobjBen Skeggs1-7/+7
Signed-off-by: Ben Skeggs <[email protected]>
2017-11-02drm/nouveau/imem/nv04: directly embed nvkm_instobj into nv04_instobjBen Skeggs1-7/+7
Signed-off-by: Ben Skeggs <[email protected]>
2017-11-02drm/nouveau/imem: allow nvkm_instobj to be directly embedded in backend objectBen Skeggs2-13/+38
This will eliminate a step through the call chain, and give backends more flexibility. Signed-off-by: Ben Skeggs <[email protected]>
2017-11-02drm/nouveau/core/memory: split info pointers from accessor pointersBen Skeggs7-118/+155
The accessor functions can change as a result of acquire()/release() calls, and are protected by any refcounting done there. Other functions must remain constant, as they can be called any time. Signed-off-by: Ben Skeggs <[email protected]>
2017-11-02drm/nouveau/imem: add some useful debug outputBen Skeggs1-1/+7
Signed-off-by: Ben Skeggs <[email protected]>
2017-11-02drm/nouveau/bar/gm107-: wait for instance block binding to completeBen Skeggs6-13/+126
Discovered by accident while working to use BAR2 access to instmem objects on more paths. We've apparently been relying on luck up until now! Signed-off-by: Ben Skeggs <[email protected]>
2017-11-02drm/nouveau/bar: initialise bar2 during oneinitBen Skeggs2-0/+6
If we initialise BAR2 earlier, we're able to complete BAR1 setup using the instmem fast-path. Signed-off-by: Ben Skeggs <[email protected]>
2017-11-02drm/nouveau/bar: prevent BAR2 mapping of objects during destructorBen Skeggs1-1/+1
GP100's page table nests a lot more deeply than the GF100-compatible layout we're currently using, which means our hackish-but-simple way of dealing with BAR2 VMM teardown won't work anymore. In order to sanely handle the chicken-and-egg (BAR2's PTs get mapped into themselves) problem, we need prevent page tables getting mapped back into BAR2 during the destruction of its VMM. To do this, we simply key off the state that's now maintained by the BAR2 init/fini functions. Signed-off-by: Ben Skeggs <[email protected]>
2017-11-02drm/nouveau/bar: modify interface to bar2 vmm mappingBen Skeggs9-30/+31
Match API with the BAR1 version. Signed-off-by: Ben Skeggs <[email protected]>
2017-11-02drm/nouveau/bar: modify interface to bar1 vmm mappingBen Skeggs13-28/+32
Upcoming changes will remove the nvkm_vmm pointer from nvkm_vma, instead requiring it to be explicitly specified on each operation. It's not currently possible to get this information for BAR1 mappings, so let's fix that ahead of time. Signed-off-by: Ben Skeggs <[email protected]>
2017-11-02drm/nouveau/bar: expose interface to bar2 teardownBen Skeggs6-1/+29
Will prevent spurious MMU fault interrupts if something decides to touch BAR1 after we've unloaded the driver. Exposed external to BAR so that INSTMEM can use it to better control the suspend/resume fast-path access. Signed-off-by: Ben Skeggs <[email protected]>
2017-11-02drm/nouveau/bar: expose interface to bar2 initialisationBen Skeggs8-17/+42
If we want to be able to hit the instmem fast-path in a few trickier cases, we need to be more flexible with when we can initialise BAR2 access. There's probably a decent case to be made for merging BAR/INSTMEM into BUS, but that's something to ponder another day. Flushes have been added after the write to bind the instance block, as later commits will reveal the need for them. Signed-off-by: Ben Skeggs <[email protected]>
2017-11-02drm/nouveau/bar: implement bar1 teardownBen Skeggs6-0/+30
Will prevent spurious MMU fault interrupts if something decides to touch BAR1 after we've unloaded the driver. Signed-off-by: Ben Skeggs <[email protected]>
2017-11-02drm/nouveau/bar: move bar1 initialisation into its own functionBen Skeggs8-5/+51
BAR2 being done for practical reasons, this is just for consistency. Flushes have been added after the write to bind the instance block, as later commits will reveal the need for them. Signed-off-by: Ben Skeggs <[email protected]>
2017-11-02drm/nouveau/bar: swap oneinit/init ordering, and rename bar3 to bar2Ben Skeggs5-66/+66
NVIDIA call it BAR2, Linux APIs treat it as BAR3 due to BAR1 being a 64-bit BAR, which I presume take two slots or something. No actual code changes here, just to make future commits less messy. Signed-off-by: Ben Skeggs <[email protected]>
2017-11-02drm/nouveau/bar: remove NV_PMC_ENABLE_PFIFO twiddlingBen Skeggs2-6/+0
It's handled by FIFO preinit() now. Signed-off-by: Ben Skeggs <[email protected]>
2017-11-02drm/nouveau/bar/nv50,g84: drop mmu invalidateBen Skeggs6-15/+7
Will already be done by MMU as a result of the PT writes that occur during BAR2 bootstrapping. This is likely just a left-over from the days when it was hardcoded. Signed-off-by: Ben Skeggs <[email protected]>
2017-11-02drm/nouveau/fifo: perform reset from preinitBen Skeggs3-0/+19
RM appears to do this really early in its initialisation, before DEVINIT. We currently do this before BAR2 initialisation for some reason. Signed-off-by: Ben Skeggs <[email protected]>
2017-11-02drm/nouveau/disp: add missing newline in ior debug messagesBen Skeggs1-1/+1
Signed-off-by: Ben Skeggs <[email protected]>
2017-11-02drm/nouveau/secboot: add missing newline in debug messageBen Skeggs1-1/+1
Signed-off-by: Ben Skeggs <[email protected]>
2017-11-02drm/nouveau/core/device: remove object include to prevent unnecessary rebuildsBen Skeggs17-5/+19
nvkm_device hasn't subclassed nvkm_object in a long time. Signed-off-by: Ben Skeggs <[email protected]>
2017-11-02drm/nouveau/core/subdev: compile out messages for unwanted debug levelsBen Skeggs1-1/+1
Signed-off-by: Ben Skeggs <[email protected]>
2017-11-02drm/nouveau/core/gpuobj: remove embedded struct nvkm_objectBen Skeggs2-2/+1
nvkm_gpuobj hasn't subclassed nvkm_object in a long time. Signed-off-by: Ben Skeggs <[email protected]>
2017-11-02drm/nouveau/core/object: plumb the unmap ioctl throughBen Skeggs4-0/+19
MMU will be using this for BAR mappings. Signed-off-by: Ben Skeggs <[email protected]>
2017-11-02drm/nouveau/core/object: allow arguments to be passed to map functionBen Skeggs13-48/+108
MMU will be needing this to specify kind info on BAR mappings. We have no userspace currently using these interfaces, so break the ABI instead of supporting both. NVIF version bump so any future use can be guarded. Signed-off-by: Ben Skeggs <[email protected]>
2017-11-02drm/nouveau/core/object: separate oclass data out into its own headerBen Skeggs2-27/+32
Want to be able to include this from core/device.h without pulling in core/object.h. Signed-off-by: Ben Skeggs <[email protected]>
2017-11-02drm/nouveau: fix handling of GART OOM on pre-NV50 chipsetsBen Skeggs1-0/+4
The correct thing to do on OOM is to return 0 and set mm_node to NULL, otherwise TTM will assume some other kind of error, and not attempt to evict other buffers to make space. Signed-off-by: Ben Skeggs <[email protected]>
2017-11-02drm/nouveau/kms/nv50: prevent oops in failure pathsBen Skeggs1-1/+1
Signed-off-by: Ben Skeggs <[email protected]>
2017-11-02drm/nouveau/kms: add 8.1Gbps DP link rateIlia Mirkin1-1/+5
This was already done in dcb.c inside nvkm, but the other parser did not get the update. Signed-off-by: Ilia Mirkin <[email protected]> Signed-off-by: Ben Skeggs <[email protected]>
2017-11-02drm/nouveau/bios/init: use ARRAY_SIZEJérémy Lefaure1-3/+4
Using the ARRAY_SIZE macro improves the readability of the code. Also, it is useless to re-invent it. Found with Coccinelle with the following semantic patch: @r depends on (org || report)@ type T; T[] E; position p; @@ ( (sizeof(E)@p /sizeof(*E)) | (sizeof(E)@p /sizeof(E[...])) | (sizeof(E)@p /sizeof(T)) ) Reviewed-by: Thierry Reding <[email protected]> Signed-off-by: Jérémy Lefaure <[email protected]> Signed-off-by: Ben Skeggs <[email protected]>
2017-11-02remove some useless semicolonsBen Skeggs4-5/+5
Reported-by: Dave Airlie <[email protected]> Signed-off-by: Ben Skeggs <[email protected]>
2017-11-02drm/nouveau: Document nouveau support for Tegra in DRIVER_DESCRhys Kidd1-1/+1
nouveau supports the Tegra K1 and higher after the SoC-based GPUs converged with the main GeForce GPU families. v2: - Qualify that support is Tegra K1+ (Martin Peres) Signed-off-by: Rhys Kidd <[email protected]> Reviewed-by: Martin Peres <[email protected]> Acked-by: Pierre Moreau <[email protected]> Acked-by: Thierry Reding <[email protected]> Signed-off-by: Ben Skeggs <[email protected]>
2017-11-02drm/nouveau/therm/gp100: initial implementation of new gp1xx temperature sensorRhys Kidd5-1/+66
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 <[email protected]> Signed-off-by: Ben Skeggs <[email protected]>
2017-11-01drm/amd/powerplay: wrong control mode cause the fan spins faster unnecessarilyEvan Quan1-1/+1
The fan control mode can either be FDO_PWM_MODE_STATIC or FDO_PWM_MODE_STATIC_RPM. Setting it as AMD_FAN_CTRL_AUTO will cause the fan spin faster wrongly. This can be reproduced by: '# cat /sys/class/hwmon/hwmon0/pwm1 38 '# cat /sys/class/hwmon/hwmon0/pwm1_enable 2 '# echo "2" > /sys/class/hwmon/hwmon0/pwm1_enable '# cat /sys/class/hwmon/hwmon0/pwm1 122 The fan speed get faster wrongly even with its original mode echo back. Signed-off-by: Evan Quan <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Cc: [email protected]
2017-11-01drm/amd/powerplay: fix memory leak of hardcoded pptableEric Huang1-0/+3
Signed-off-by: Eric Huang <[email protected]> Reviewed-by: Rex Zhu <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2017-11-01drm/amdgpu:add fw-vram-usage for atomfirmwareMonk Liu1-4/+18
otherwise PF & VF exchange is broken Signed-off-by: Monk Liu <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2017-11-02Backmerge tag 'v4.14-rc7' into drm-nextDave Airlie27-140/+135
Linux 4.14-rc7 Requested by Ben Skeggs for nouveau to avoid major conflicts, and things were getting a bit conflicty already, esp around amdgpu reverts.
2017-11-02Merge tag 'drm-hisilicon-next-2017-11-01' of github.com:xin3liang/linux into ↵Dave Airlie1-0/+3
drm-next For 4.15 * tag 'drm-hisilicon-next-2017-11-01' of github.com:xin3liang/linux: drm/hisilicon: Ensure LDI regs are properly configured.
2017-11-02Merge tag 'drm-intel-fixes-2017-11-01' of ↵Dave Airlie7-35/+57
git://anongit.freedesktop.org/drm/drm-intel into drm-fixes Fixes for Stable: - Fix KBL Blank Screen (Jani) - Fix FIFO Underrun on SNB (Maarten) Other fixes: - Fix GPU Hang on i915gm (Chris) - Fix gem_tiled_pread_pwrite IGT case (Chris) - Cancel modeset retry work during modeset clean-up (Manasi) * tag 'drm-intel-fixes-2017-11-01' of git://anongit.freedesktop.org/drm/drm-intel: drm/i915: Check incoming alignment for unfenced buffers (on i915gm) drm/i915: Hold rcu_read_lock when iterating over the radixtree (vma idr) drm/i915: Hold rcu_read_lock when iterating over the radixtree (objects) drm/i915/edp: read edp display control registers unconditionally drm/i915: Do not rely on wm preservation for ILK watermarks drm/i915: Cancel the modeset retry work during modeset cleanup
2017-11-02Merge tag 'drm-msm-next-2017-11-01' of ↵Dave Airlie42-702/+1945
git://people.freedesktop.org/~robclark/linux into drm-next + preemption support for a5xx[1][2] + display fixes for 8x96 (snapdragon 820) including fixes for 4k scanout (hwpipe assignment re-work to handle multiple hwpipe assigned to plane for wide scanout) + async cursor plane updates and fixes + refactor adreno_bind/hwinit.. still defer fw loading until device open, but move clk/irq/etc to probe/bind time to fix issues when fw isn't present in filesys + clk/dt bindings cleanups w/ backward compat via msm_clk_get() (dt docs part ack'ed by Rob Herring) + fw loading re-work with helper to handle either /lib/firmware/qcom/$fw or /lib/firmware/$fw.. background, we've started landing fw for some of generations in linux-firmware, but there is a preference to put fw files under 'qcom' subdirectory, which is not what was done on android or for people who copied fw from android. So now we first look in qcom subdir and then fallback to the original location. + bunch of GPU debugging enhancements, to dump full cmdline of processes that trigger faults, and to add a new debugfs to capture cmdstream of just submits that triggered faults.. both quite useful for piglit ;-) * tag 'drm-msm-next-2017-11-01' of git://people.freedesktop.org/~robclark/linux: (38 commits) drm/msm: use %z format modifier for printing size_t drm/msm/mdp5: Don't use async plane update path if plane visibility changes drm/msm/mdp5: mdp5_crtc: Restore cursor state only if LM cursors are enabled drm/msm/mdp5: Update mdp5_pipe_assign to spit out both planes drm/msm/mdp5: Prepare mdp5_pipe_assign for some rework drm/msm: remove mdp5_cursor_plane_funcs drm/msm: update cursors asynchronously through atomic drm/msm/atomic: switch to drm_atomic_helper_check drm/msm/mdp5: restore cursor state when enabling crtc drm/msm/mdp5: don't use autosuspend drm/msm/mdp5: ignore planes that are not visible drm/msm: dump submits which triggered gpu hang drm/msm: preserve IOVAs in submit's bo table drm/msm/rd: allow adding addition msg to top of dump drm/msm: split rd debugfs file drm/msm: add special _get_vaddr_active() for cmdstream dumps drm/msm: show task cmdline in gpu recovery messages drm/msm: dump a rd GPUADDR header for all buffers in the command drm/msm: Removed unused struct_mutex_task drm/msm: Implement preemption for A5XX targets ...
2017-11-01drm/amdkfd: Minor cleanupsFelix Kuehling3-7/+7
These were missed previously when rebasing changes for upstreaming. v2: Remove redundant sched_policy conditions Signed-off-by: Felix Kuehling <[email protected]> Reviewed-by: Oded Gabbay <[email protected]> Signed-off-by: Oded Gabbay <[email protected]>
2017-11-01drm/amdkfd: Update queue_count before mapping queuesFelix Kuehling1-9/+11
map_queues_cpsch uses the queue_count to decide whether to upload a new runlist. So update the counter before calling it. Signed-off-by: Felix Kuehling <[email protected]> Reviewed-by: Oded Gabbay <[email protected]> Signed-off-by: Oded Gabbay <[email protected]>
2017-11-01drm/amdkfd: Cleanup DQM ASIC-specific opsYong Zhao4-43/+27
Remove empty initialize function. Rename register_process to update_qpd to avoid confusion with the non-ASIC-specific register_process. Shorten ops_asic_specific to asic_ops. Signed-off-by: Yong Zhao <[email protected]> Signed-off-by: Felix Kuehling <[email protected]> Reviewed-by: Oded Gabbay <[email protected]> Signed-off-by: Oded Gabbay <[email protected]>