]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drm/nouveau/nvkm: factor out current GSP RPC command policies
authorZhi Wang <zhiw@nvidia.com>
Thu, 27 Feb 2025 01:35:53 +0000 (01:35 +0000)
committerDanilo Krummrich <dakr@kernel.org>
Sun, 9 Mar 2025 12:41:59 +0000 (13:41 +0100)
commit4570355f8eaa476164cfb7ca959fdbf0cebbc9eb
treec8479d6505e41655e9aeba1eb460b1e6fbd9ac3a
parent2c7aafc05c8330be4c5f0092b79843507a5e1023
drm/nouveau/nvkm: factor out current GSP RPC command policies

There can be multiple cases of handling the GSP RPC messages, which are
the reply of GSP RPC commands according to the requirement of the
callers and the nature of the GSP RPC commands.

The current supported reply policies are "callers don't care" and "receive
the entire message" according to the requirement of the callers. To
introduce a new policy, factor out the current RPC command reply polices.
Also, centralize the handling of the reply in a single function.

Factor out NVKM_GSP_RPC_REPLY_NOWAIT as "callers don't care" and
NVKM_GSP_RPC_REPLY_RECV as "receive the entire message". Introduce a
kernel doc to document the policies. Factor out
r535_gsp_rpc_handle_reply().

No functional change is intended for small GSP RPC commands. For large GSP
commands, the caller decides the policy of how to handle the returned GSP
RPC message.

Cc: Ben Skeggs <bskeggs@nvidia.com>
Cc: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Zhi Wang <zhiw@nvidia.com>
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250227013554.8269-2-zhiw@nvidia.com
Documentation/gpu/nouveau.rst
drivers/gpu/drm/nouveau/include/nvkm/subdev/gsp.h
drivers/gpu/drm/nouveau/nvkm/subdev/bar/r535.c
drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c
drivers/gpu/drm/nouveau/nvkm/subdev/instmem/r535.c