Commit 8763955b authored by Ben Skeggs's avatar Ben Skeggs
Browse files

drm/nouveau/flcn/qmgr: explicitly create queue manager from subdevs



Code to interface with LS firmwares is being moved to the subdevs where it
belongs, rather than living in the common falcon code.

This is an incremental step towards that goal.

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 7e1659cc
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -29,4 +29,8 @@ int gp102_sec2_flcn_enable(struct nvkm_falcon *);
} while(0)
#define FLCN_DBG(f,fmt,a...) FLCN_PRINTK(debug, (f), fmt, ##a)
#define FLCN_ERR(f,fmt,a...) FLCN_PRINTK(error, (f), fmt, ##a)

struct nvkm_falcon_qmgr;
int nvkm_falcon_qmgr_new(struct nvkm_falcon *, struct nvkm_falcon_qmgr **);
void nvkm_falcon_qmgr_del(struct nvkm_falcon_qmgr **);
#endif
+1 −0
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@ struct nvkm_sec2 {
	struct nvkm_engine engine;
	struct nvkm_falcon falcon;

	struct nvkm_falcon_qmgr *qmgr;
	struct nvkm_msgqueue *queue;
	struct work_struct work;
};
+2 −0
Original line number Diff line number Diff line
@@ -8,6 +8,8 @@ struct nvkm_pmu {
	const struct nvkm_pmu_func *func;
	struct nvkm_subdev subdev;
	struct nvkm_falcon falcon;

	struct nvkm_falcon_qmgr *qmgr;
	struct nvkm_msgqueue *queue;

	struct {
+4 −0
Original line number Diff line number Diff line
@@ -59,6 +59,7 @@ nvkm_sec2_dtor(struct nvkm_engine *engine)
{
	struct nvkm_sec2 *sec2 = nvkm_sec2(engine);
	nvkm_msgqueue_del(&sec2->queue);
	nvkm_falcon_qmgr_del(&sec2->qmgr);
	nvkm_falcon_dtor(&sec2->falcon);
	return sec2;
}
@@ -95,6 +96,9 @@ nvkm_sec2_new_(const struct nvkm_sec2_fwif *fwif, struct nvkm_device *device,
	if (ret)
		return ret;

	if ((ret = nvkm_falcon_qmgr_new(&sec2->falcon, &sec2->qmgr)))
		return ret;

	INIT_WORK(&sec2->work, nvkm_sec2_recv);
	return 0;
};
+1 −0
Original line number Diff line number Diff line
@@ -132,6 +132,7 @@ struct nvkm_msgqueue_func {
 * @tail_reg:	address of the TAIL register for this queue
 */
struct nvkm_msgqueue_queue {
	struct nvkm_falcon_qmgr *qmgr;
	struct mutex mutex;
	u32 index;
	u32 offset;
Loading