summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nvkm/engine/fifo/base.c
Commit message (Collapse)AuthorAgeFilesLines
* drm/nouveau/ofa/r535: initial supportBen Skeggs2023-10-311-0/+1
| | | | | | | | Adds support for allocating OFA classes from RM. Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230918202149.4343-45-skeggsb@gmail.com
* drm/nouveau/nvjpg/r535: initial supportBen Skeggs2023-10-311-0/+1
| | | | | | | | Adds support for allocating NVJPG classes from RM. Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230918202149.4343-44-skeggsb@gmail.com
* drm/nouveau/fifo/tu102-: prepare for GSP-RMBen Skeggs2023-10-311-0/+9
| | | | | | | | | | | - (temporarily) disable if GSP-RM detected, will be added later - add dtor() so GSP-RM paths can cleanup properly - add alternate engine context mapping interface for RM engines - add alternate chid interfaces to handle RM USERD oddities Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230918202149.4343-26-skeggsb@gmail.com
* drm/nouveau/fifo/ga100-: add per-runlist nonstall intr handlingBen Skeggs2023-07-061-17/+15
| | | | | | | | | | GSP-RM will enforce this, so implement on HW too so we can share code. Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Reviewed-by: Karol Herbst <kherbst@redhat.com> Reviewed-by: Lyude Paul <lyude@redhat.com> Signed-off-by: Karol Herbst <kherbst@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230525003106.3853741-8-skeggsb@gmail.com
* drm/nouveau/fifo: expose function to read engine ctxsw statusBen Skeggs2022-11-091-0/+16
| | | | | | | Needed to support Ampere differences in gr/gf100-: Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
* drm/nouveau/fifo/ga100-: initial supportBen Skeggs2022-11-091-2/+17
| | | | | | | | - replaces the hacked-up version that existed solely to support TTM v2. remove earlier hack preventing use of non-stall intr for fences Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/fifo: add new channel classesBen Skeggs2022-11-091-9/+21
| | | | | | | | | | | | | | | | | | | | | Exposes a bunch of the new features that became possible as a result of the earlier commits. DRM will build on this in the future to add support for features such as SCG ("async compute") and multi-device rendering, as part of the work necessary to be able to write a half- decent vulkan driver - finally. For the moment, this just crudely ports DRM to the API changes. - channel class interfaces now the same for all HW classes - channel group class exposed (SCG) - channel runqueue selector exposed (SCG) - channel sub-device id control exposed (multi-device rendering) - channel names in logging will reflect creating process, not fd owner - explicit USERD allocation required by VOLTA_CHANNEL_GPFIFO_A and newer - drm is smarter about determining the appropriate channel class to use Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
* drm/nouveau/fifo: add new engine context handlingBen Skeggs2022-11-091-4/+1
| | | | | | | | | Builds on the context tracking that was added earlier. - marks engine context PTEs as 'priv' where possible Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
* drm/nouveau/fifo: add USERD info to nvkm_chan_funcBen Skeggs2022-11-091-0/+25
| | | | | | | | | | And use it to cleanup multiple implementations of almost the same thing. - prepares for non-polled / client-provided USERD - only zeroes relevant "registers", rather than entire USERD Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
* drm/nouveau/fifo: add common runlist controlBen Skeggs2022-11-091-2/+0
| | | | | | | | | - less dependence on waiting for runlist updates, on GPUs that allow it - supports runqueue selector in RAMRL entries - completes switch to common runl/cgrp/chan topology info Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
* drm/nouveau/fifo: add common channel recoveryBen Skeggs2022-11-091-2/+3
| | | | | | | | | | | | | | | That sure was fun to untangle. - handled per-runlist, rather than globally - more straight-forward process in general - various potential SW/HW races have been fixed - fixes lockdep issues that were present in >=gk104's prior implementation - volta recovery now actually stands a chance of working - volta/turing waiting for PBDMA idle before engine reset - turing using hw-provided TSG info for CTXSW_TIMEOUT Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
* drm/nouveau/fifo: add chan/cgrp preempt()Ben Skeggs2022-11-091-11/+0
| | | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
* drm/nouveau/fifo: add chan start()/stop()Ben Skeggs2022-11-091-12/+1
| | | | | | | | | - nvkm_chan_error() built on top, stops channel and sends 'killed' event - removes an odd double-bashing of channel enable regs on kepler and up - pokes doorbell on turing and up, after enabling channel Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
* drm/nouveau/fifo: add runlist wait()Ben Skeggs2022-11-091-0/+5
| | | | | | | | - adds g8x/turing registers, which were missing before - switches fermi to polled wait, like later hw (see: 4f2fc25c0f8bc...) Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
* drm/nouveau/fifo: add new channel lookup interfacesBen Skeggs2022-11-091-57/+0
| | | | | | | | | | | - supports per-runlist CHIDs - channel group lock held across reference, rather than global lock v2: - remove unnecessary parenthesis Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
* drm/nouveau/fifo: move PBDMA init to runqBen Skeggs2022-11-091-0/+3
| | | | | | | | | - bumps pbdma timeout to value RM uses on newer HW - bumps fb timeout to max from boot default - one/both of these greatly improves stability on // piglit runs Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
* drm/nouveau/fifo: tidy global PBDMA initBen Skeggs2022-11-091-0/+9
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/fifo: tidy up non-stall intr handlingBen Skeggs2022-11-091-30/+4
| | | | | | | | - removes a layer of indirection in the intr handling - prevents non-stall ctrl racing with unknown intrs Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
* drm/nouveau/fifo: use explicit intr interfacesBen Skeggs2022-11-091-8/+19
| | | | | | | More control, and shallower call-chain to get to the point. Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
* drm/nouveau/fifo: add cgrp, have all channels be part of oneBen Skeggs2022-11-091-4/+1
| | | | | | | | | | Engine context tracking will move to nvkm_cgrp in later commits, so we create SW-only channel groups on HW without support for them. - switches to nvkm_chid for TSG/channel ID allocation Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
* drm/nouveau/fifo: expose per-runlist CHID informationBen Skeggs2022-11-091-0/+9
| | | | | | | | | | DRM uses this to setup fence-related items. - nouveau_chan.runlist will always be "0" for the moment, not an issue as GPUs prior to ampere have system-wide channel IDs, Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
* drm/nouveau/fifo: expose runlist topology info on all chipsetsBen Skeggs2022-11-091-2/+47
| | | | | | | | | Previously only available from Kepler onwards. - also fixes the info() queries causing fifo init()/fini() unnecessarily Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
* drm/nouveau/fifo: add common runlist/engine topologyBen Skeggs2022-11-091-0/+19
| | | | | | | | | | | | Creates an nvkm_runl for each runlist on the GPU, and an nvkm_engn for each engine that is reachable from a runlist. - basically what gk104- already does, but extended to all chips - adds per-runlist CHID allocators (Ampere) - splits g98/gt2xx out from g84 (different target engines) Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
* drm/nouveau/fifo: add runqBen Skeggs2022-11-091-1/+15
| | | | | | | | Creates an nvkm_runq for each PBDMA, these will be associated with the relevant runlist(s) later. Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
* drm/nouveau/fifo: add chid allocatorBen Skeggs2022-11-091-2/+18
| | | | | | | | | | | | | We need to be able to allocate TSG IDs as well as channel IDs, also, Ampere has per-runlist channel IDs. - holds per-ID private data, which will be used for/to protect lookup - holds an nvkm_event which will be used for events tied to IDs - not used yet beyond setup, and switching use of "fifo->nr - 1" for channel ID mask to "chid->mask" Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
* drm/nouveau/fifo: merge gk104_fifo_func into nvkm_host_funcBen Skeggs2022-11-091-7/+2
| | | | | | | | | This makes it easier to transition everything. - a couple of function renames for collisions Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
* drm/nouveau/fifo: pre-move some blocks of code aroundBen Skeggs2022-11-091-8/+8
| | | | | | | | - will make subsequent patches more obvious - no code changes Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
* drm/nouveau/fifo: unify handling of channel classesBen Skeggs2022-11-091-29/+14
| | | | | | | | | | | Adds the basic skeleton for common channel (group) interfaces. - common behaviour between <gk104 and >=gk104 impl's - separates priv/user channel objects - passthrough to existing object for now, kludges removed later Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
* drm/nouveau/fifo: add chid_nr()Ben Skeggs2022-11-091-9/+11
| | | | | | | | - reads channel count from GPU from gm200 onwards - removes gm20b/gp10b (they become identical to gm200/gp100) Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
* drm/nouveau/nvkm: rip out old notifyBen Skeggs2022-11-091-2/+2
| | | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
* drm/nouveau/fifo: expose channel killed in host channel event classBen Skeggs2022-11-091-17/+1
| | | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
* drm/nouveau/fifo: expose non-stall intr in host channel event classBen Skeggs2022-11-091-22/+1
| | | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
* drm/nouveau/nvkm: add a replacement for nvkm_notifyBen Skeggs2022-11-091-2/+2
| | | | | | | | | | | | | | | | This replaces the twisty, confusing, relationship between nvkm_event and nvkm_notify with something much simpler, and less racey. It also places events in the object tree hierarchy, which will allow a heap of the code tracking events across allocation/teardown/suspend to be removed. This commit just adds the new interfaces, and passes the owning subdev to the event constructor to enable debug-tracing in the new code. v2: - use ?: (lyude) Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
* drm/nouveau/fifo: rip out cevent, never usedBen Skeggs2022-07-131-29/+0
| | | | | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Reviewed-by: Lyude Paul <lyude@redhat.com> Reviewed-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/nouveau/fifo/gk104-: remove use of subdev index in runlist topology infoBen Skeggs2021-02-111-1/+1
| | | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
* drm/nouveau/fifo: switch to instanced constructorBen Skeggs2021-02-111-2/+2
| | | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
* drm/nouveau/mc: use split type+inst in device reset APIsBen Skeggs2021-02-111-1/+1
| | | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
* drm/nouveau/fifo: private mutexBen Skeggs2021-02-111-0/+2
| | | | | | | nvkm_subdev.mutex is going away. Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
* drm/nouveau/fifo/gk104-: simplify definition of channel classesBen Skeggs2018-05-181-7/+17
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/fifo/gk104-: support querying engines available on each runlistBen Skeggs2018-05-181-0/+2
| | | | | | Will be used to improve channel runlist selection. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/fifo/gk104-: allow fault recovery code to be called by other subdevsBen Skeggs2018-05-181-0/+6
| | | | | | This will be required to support Volta. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/fifo: support channel count queryBen Skeggs2018-05-181-0/+14
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/fifo: perform reset from preinitBen Skeggs2017-11-021-0/+8
| | | | | | | | 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 <bskeggs@redhat.com>
* drm/nouveau/fifo/gk104-: directly use new recovery code for mmu faultsBen Skeggs2017-02-171-4/+14
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/fifo: add an api for initiating channel recoveryBen Skeggs2017-02-171-0/+11
| | | | | | This will be used by callers outside of fifo interrupt handlers. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/fifo/gf100-: provide notification to user if channel is killedBen Skeggs2017-02-171-1/+31
| | | | | | | | | | | | There are instances (such as non-recoverable GPU page faults) where NVKM decides that a channel's context is no longer viable, and will be removed from the runlist. This commit notifies the owner of the channel when this happens, so it has the opportunity to take some kind of recovery action instead of hanging. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/fifo: tidy up channel creation event codeBen Skeggs2017-02-171-5/+11
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/fifo/gk104-: subclass funcBen Skeggs2016-05-201-0/+11
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/core: remove pmc_enable argument from subdev ctorBen Skeggs2016-05-201-2/+1
| | | | | | These are now specified directly in the MC subdev. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/nvif: modify nvif_unvers/nvif_unpack macros to be more obviousBen Skeggs2016-01-111-2/+2
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>