drm/nouveau: factor out r535_gsp_msgq_peek()
authorZhi Wang <zhiw@nvidia.com>
Fri, 24 Jan 2025 18:29:55 +0000 (10:29 -0800)
committerDanilo Krummrich <dakr@kernel.org>
Fri, 24 Jan 2025 23:55:10 +0000 (00:55 +0100)
commitc965e3598b4ee7863d64dd13a54258753f7b447f
tree3689450c7f53d7857be7d4ebe8e5221e3f7c5619
parent1829ee0b05177e4274cb169358f8bfea606334ea
drm/nouveau: factor out r535_gsp_msgq_peek()

To receive a GSP message queue element from the GSP status queue, the
driver needs to make sure there are available elements in the queue.

The previous r535_gsp_msgq_wait() consists of three functions, which is
a little too complicated for a single function:
- wait for an available element.
- peek the message element header in the queue.
- recevice the element from the queue.

Factor out r535_gsp_msgq_peek() and divide the functions in
r535_gsp_msgq_wait() into three functions.

No functional change is intended.

Cc: Danilo Krummrich <dakr@kernel.org>
Signed-off-by: Zhi Wang <zhiw@nvidia.com>
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250124182958.2040494-13-zhiw@nvidia.com
drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c