Dan Carpenter
42bd415bd8
nouveau/gsp/r535: Fix a NULL vs error pointer bug
...
The r535_gsp_cmdq_get() function returns error pointers but this code
checks for NULL. Also we need to propagate the error pointer back to
the callers in r535_gsp_rpc_get(). Returning NULL will lead to a NULL
pointer dereference.
Fixes: 176fdcbddf ("drm/nouveau/gsp/r535: add support for booting GSP-RM")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org >
Reviewed-by: Danilo Krummrich <dakr@redhat.com >
Signed-off-by: Danilo Krummrich <dakr@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/f71996d9-d1cb-45ea-a4b2-2dfc21312d8c@kili.mountain
2023-11-14 22:40:25 +01:00
Dan Carpenter
09f12bf9f7
nouveau/gsp/r535: uninitialized variable in r535_gsp_acpi_mux_id()
...
The if we hit the "continue" statement on the first iteration through
the loop then "handle_mux" needs to be set to NULL so we continue
looping.
Fixes: 176fdcbddf ("drm/nouveau/gsp/r535: add support for booting GSP-RM")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org >
Reviewed-by: Danilo Krummrich <dakr@redhat.com >
Signed-off-by: Danilo Krummrich <dakr@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/1d864f6e-43e9-43d8-9d90-30e76c9c843b@moroto.mountain
2023-11-14 22:40:18 +01:00
Dave Airlie
8d55b0a940
nouveau/gsp: add some basic registry entries.
...
The nvidia driver sets these two basic registry entries always,
so copy it.
Reviewed-by: Danilo Krummrich <dakr@redhat.com >
Signed-off-by: Dave Airlie <airlied@redhat.com >
2023-11-03 12:57:23 +10:00
Dave Airlie
5177e5fa6e
nouveau/gsp: fix message signature.
...
This original one was backwards, compared to traces from nvidia driver.
Reviewed-by: Danilo Krummrich <dakr@redhat.com >
Signed-off-by: Dave Airlie <airlied@redhat.com >
2023-11-03 12:57:19 +10:00
Dave Airlie
b5bad8c16b
nouveau/gsp: move to 535.113.01
...
This moves the initial effort to the latest 535 firmware.
The gsp msg structs have changed, and the message passing also.
The wpr also seems to have some struct changes.
This version of the firmware will be what we are stuck on for a while,
until we can refactor the driver and work out a better path forward.
Reviewed-by: Danilo Krummrich <dakr@redhat.com >
Signed-off-by: Dave Airlie <airlied@redhat.com >
2023-11-03 12:57:14 +10:00
Ben Skeggs
015185cc67
drm/nouveau/ofa/r535: initial support
...
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
2023-10-31 15:08:19 +10:00
Ben Skeggs
ca9686340a
drm/nouveau/nvjpg/r535: initial support
...
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
2023-10-31 15:08:19 +10:00
Ben Skeggs
08ab88f5a0
drm/nouveau/nvenc/r535: initial support
...
Adds support for allocating VIDEO_ENCODER 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-43-skeggsb@gmail.com
2023-10-31 15:08:18 +10:00
Ben Skeggs
142cd60243
drm/nouveau/nvdec/r535: initial support
...
Adds support for allocating VIDEO_DECODER 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-42-skeggsb@gmail.com
2023-10-31 15:08:17 +10:00
Ben Skeggs
361c3cd8ae
drm/nouveau/gr/r535: initial support
...
Adds support for allocating GR 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-41-skeggsb@gmail.com
2023-10-31 15:08:17 +10:00
Ben Skeggs
b5ce219ab3
drm/nouveau/ce/r535: initial support
...
Adds support for allocating DMA_COPY 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-40-skeggsb@gmail.com
2023-10-31 15:08:17 +10:00
Ben Skeggs
2a77d015b5
drm/nouveau/fifo/r535: initial support
...
- Adds support for allocating CHANNEL_GPFIFO 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-39-skeggsb@gmail.com
2023-10-31 15:08:16 +10:00
Ben Skeggs
9e99444490
drm/nouveau/disp/r535: initial support
...
Adds support for modesetting on 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-38-skeggsb@gmail.com
2023-10-31 15:08:16 +10:00
Ben Skeggs
5bf0257136
drm/nouveau/mmu/r535: initial support
...
- Valid VRAM regions are read from GSP-RM, and used to construct our MM
- BAR1/BAR2 VMMs modified to be shared with RM
- Client VMMs have RM VASPACE objects created for them
- Adds FBSR to backup system objects in VRAM across suspend
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-37-skeggsb@gmail.com
2023-10-31 15:08:16 +10:00
Ben Skeggs
830531e947
drm/nouveau/gsp/r535: add interrupt handling
...
Fetches the interrupt table from RM, and hooks up the GSP interrupt
handler to message queue processing to catch async messages.
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-36-skeggsb@gmail.com
2023-10-31 15:08:16 +10:00
Ben Skeggs
37e328a17c
drm/nouveau/gsp/r535: add support for rm alloc
...
Adds the plumbing to be able to allocate and free RM objects, and
implements RM client/device/subdevice allocation with it.
These will be used by subsequent patches.
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-35-skeggsb@gmail.com
2023-10-31 15:08:16 +10:00
Ben Skeggs
4cf2c83eb3
drm/nouveau/gsp/r535: add support for rm control
...
Adds the plumbing to start making RM control calls, and initialises
objects to represent internal RM objects provided to us during init.
These will be used by subsequent patches.
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-34-skeggsb@gmail.com
2023-10-31 15:08:15 +10:00
Ben Skeggs
176fdcbddf
drm/nouveau/gsp/r535: add support for booting GSP-RM
...
This commit adds the initial code needed to boot the GSP-RM firmware
provided by NVIDIA, bringing with it the beginnings of Ada support.
Until it's had more testing and time to bake, support is disabled by
default (except on Ada). GSP-RM usage can be enabled by passing the
"config=NvGspRm=1" module option.
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-33-skeggsb@gmail.com
2023-10-31 15:08:15 +10:00
Ben Skeggs
015ef6187f
drm/nouveau/gsp: prepare for GSP-RM
...
- move TOP after GSP, so we can disable TOP if GSP is in use
- provide plumbing to support falcon-only and GSP-RM paths
- provide a method for subdevs to detect GSP-RM paths
- split tu102/tu116/ga100 paths from gv100, which can't support GSP-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-5-skeggsb@gmail.com
2023-10-31 15:08:10 +10:00
Tom Rix
cf0c4bc9e4
drm/nouveau/acr/ga102: set variable ga102_gsps storage-class-specifier to static
...
smatch reports
drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ga102.c:49:1: warning: symbol
'ga102_gsps' was not declared. Should it be static?
This variable is only used in its defining file, so it should be static
Signed-off-by: Tom Rix <trix@redhat.com >
Reviewed-by: Karol Herbst <kherbst@redhat.com >
Signed-off-by: Karol Herbst <kherbst@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230517133112.873856-1-trix@redhat.com
2023-05-22 16:39:04 +02:00
Ben Skeggs
4b569ded09
drm/nouveau/acr/ga102: initial support
...
v2. fixup for ga103 early merge
Signed-off-by: Ben Skeggs <bskeggs@redhat.com >
Signed-off-by: Gourav Samaiya <gsamaiya@nvidia.com >
2022-11-09 10:45:21 +10:00
Ben Skeggs
2541626cfb
drm/nouveau/acr: use common falcon HS FW code for ACR FWs
...
Adds context binding and support for FWs with a bootloader to the code
that was added to load VPR scrubber HS binaries, and ports ACR over to
using all of it.
- gv100 split from gp108 to handle FW exit status differences
Signed-off-by: Ben Skeggs <bskeggs@redhat.com >
Reviewed-by: Lyude Paul <lyude@redhat.com >
2022-11-09 10:44:58 +10:00
Ben Skeggs
f15cde64b6
drm/nouveau/flcn: rework falcon reset
...
Mostly preparation to fit in Ampere changes, but should result in reset
sequences a lot closer to RM's, and perhaps help out with the issues we
sometimes see reported in this area.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com >
Reviewed-by: Lyude Paul <lyude@redhat.com >
2022-11-09 10:44:58 +10:00
Ben Skeggs
74f9dcb0df
drm/nouveau/gsp: add funcs
...
Ampere.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com >
Reviewed-by: Lyude Paul <lyude@redhat.com >
2022-11-09 10:44:57 +10:00
Tom Rix
1584f0a1b1
drm/nouveau/gsp: change gv100_gsp from global to static
...
Smatch reports this issue
gv100.c:46:1: warning: symbol 'gv100_gsp' was not declared. Should it be static?
gv100_gsp is only used in gv100.c so change its
storage-class specifier to static.
Signed-off-by: Tom Rix <trix@redhat.com >
Reviewed-by: Lyude Paul <lyude@redhat.com >
Signed-off-by: Lyude Paul <lyude@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220421133028.724954-1-trix@redhat.com
2022-04-22 13:08:43 -04:00
Ben Skeggs
b240b21261
drm/nouveau/gsp: switch to instanced constructor
...
Signed-off-by: Ben Skeggs <bskeggs@redhat.com >
Reviewed-by: Lyude Paul <lyude@redhat.com >
2021-02-11 11:49:53 +10:00
Ben Skeggs
9c28abb7db
drm/nouveau/subdev: store full subdev name in struct
...
Much easier to store this to avoid having to reconstruct a string for a
specific subdev, taking into account whether it's instanced or not.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com >
Reviewed-by: Lyude Paul <lyude@redhat.com >
2021-02-11 10:14:26 +10:00
Ben Skeggs
af696a61a2
drm/nouveau/flcn: reset sec2/gsp falcons harder
...
Signed-off-by: Ben Skeggs <bskeggs@redhat.com >
2020-01-15 10:50:28 +10:00
Ben Skeggs
ca3190e3c7
drm/nouveau/flcn: move bind_context WAR out of common code
...
Signed-off-by: Ben Skeggs <bskeggs@redhat.com >
2020-01-15 10:50:27 +10:00
Ben Skeggs
fb0a5bbe31
drm/nouveau/flcn: specify FBIF offset from subdev
...
Signed-off-by: Ben Skeggs <bskeggs@redhat.com >
2020-01-15 10:50:27 +10:00
Ben Skeggs
334815ef31
drm/nouveau/gsp: initialise SW state for falcon from constructor
...
This will allow us to register the falcon with ACR, and further customise
its behaviour by providing the nvkm_falcon_func structure directly.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com >
2020-01-15 10:50:26 +10:00
Ben Skeggs
78b10b7403
drm/nouveau/gsp: select implementation based on available firmware
...
This will allow for further customisation of the subdev depending on what
firmware is available.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com >
2020-01-15 10:50:26 +10:00
Ben Skeggs
b0f84a84ff
drm/nouveau: fix bogus GPL-2 license header
...
The bulk SPDX addition made all these files into GPL-2.0 licensed files.
However the remainder of the project is MIT-licensed, these files
were simply missing the boiler plate and got caught up in the global update.
Fixes: 96ac6d4351 (treewide: Add SPDX license identifier - Kbuild)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com >
2019-07-19 16:26:51 +10:00
Greg Kroah-Hartman
96ac6d4351
treewide: Add SPDX license identifier - Kbuild
...
Add SPDX license identifiers to all Make/Kconfig files which:
- Have no license information of any form
These files fall under the project license, GPL v2 only. The resulting SPDX
license identifier is:
GPL-2.0
Reported-by: Masahiro Yamada <yamada.masahiro@socionext.com >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2019-05-30 11:32:33 -07:00
Ben Skeggs
2944b19b5c
drm/nouveau/gsp/gv100-: instantiate GSP falcon
...
We need this for Turing ACR, but it's present from Volta onwards.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com >
2019-02-20 08:59:58 +10:00
Ben Skeggs
78cdadb840
drm/nouveau/core: define GSP subdev
...
Exact meaning of the acronym is unknown, but we need this for Turing ACR.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com >
2019-02-20 08:59:58 +10:00