Skip to content

Commit 8a8b1ec

Browse files
Ben Skeggsairlied
authored andcommitted
drm/nouveau/gsp: split rpc handling out on its own
Later patches in the series add HALs around various RM APIs in order to support a newer version of GSP-RM firmware. In order to do this, begin by splitting the code up into "modules" that roughly represent RM's API boundaries so they can be more easily managed. Aside from moving the RPC function pointers, no code change is indended. Signed-off-by: Ben Skeggs <bskeggs@nvidia.com> Reviewed-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Timur Tabi <ttabi@nvidia.com> Tested-by: Timur Tabi <ttabi@nvidia.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
1 parent 4848de6 commit 8a8b1ec

File tree

10 files changed

+762
-670
lines changed

10 files changed

+762
-670
lines changed

drivers/gpu/drm/nouveau/Kbuild

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
ccflags-y += -I $(src)/include
33
ccflags-y += -I $(src)/include/nvkm
44
ccflags-y += -I $(src)/nvkm
5+
ccflags-y += -I $(src)/nvkm/subdev/gsp
56
ccflags-y += -I $(src)
67

78
# NVKM - HW resource manager

drivers/gpu/drm/nouveau/include/nvkm/subdev/gsp.h

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -210,10 +210,7 @@ struct nvkm_gsp {
210210
} gr;
211211

212212
const struct nvkm_gsp_rm {
213-
void *(*rpc_get)(struct nvkm_gsp *, u32 fn, u32 argc);
214-
void *(*rpc_push)(struct nvkm_gsp *gsp, void *argv,
215-
enum nvkm_gsp_rpc_reply_policy policy, u32 repc);
216-
void (*rpc_done)(struct nvkm_gsp *gsp, void *repv);
213+
const struct nvkm_rm_api *api;
217214

218215
void *(*rm_ctrl_get)(struct nvkm_gsp_object *, u32 cmd, u32 argc);
219216
int (*rm_ctrl_push)(struct nvkm_gsp_object *, void **argv, u32 repc);
@@ -272,17 +269,19 @@ nvkm_gsp_rm(struct nvkm_gsp *gsp)
272269
return gsp && (gsp->fws.rm || gsp->fw.img);
273270
}
274271

272+
#include <rm/rm.h>
273+
275274
static inline void *
276275
nvkm_gsp_rpc_get(struct nvkm_gsp *gsp, u32 fn, u32 argc)
277276
{
278-
return gsp->rm->rpc_get(gsp, fn, argc);
277+
return gsp->rm->api->rpc->get(gsp, fn, argc);
279278
}
280279

281280
static inline void *
282281
nvkm_gsp_rpc_push(struct nvkm_gsp *gsp, void *argv,
283282
enum nvkm_gsp_rpc_reply_policy policy, u32 repc)
284283
{
285-
return gsp->rm->rpc_push(gsp, argv, policy, repc);
284+
return gsp->rm->api->rpc->push(gsp, argv, policy, repc);
286285
}
287286

288287
static inline void *
@@ -311,7 +310,7 @@ nvkm_gsp_rpc_wr(struct nvkm_gsp *gsp, void *argv,
311310
static inline void
312311
nvkm_gsp_rpc_done(struct nvkm_gsp *gsp, void *repv)
313312
{
314-
gsp->rm->rpc_done(gsp, repv);
313+
gsp->rm->api->rpc->done(gsp, repv);
315314
}
316315

317316
static inline void *

drivers/gpu/drm/nouveau/nvkm/subdev/gsp/Kbuild

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@ nvkm-y += nvkm/subdev/gsp/ga102.o
1010
nvkm-y += nvkm/subdev/gsp/ad102.o
1111

1212
nvkm-y += nvkm/subdev/gsp/r535.o
13+
14+
include $(src)/nvkm/subdev/gsp/rm/Kbuild

0 commit comments

Comments
 (0)