summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r570/ofa.c
blob: 6fb3083edde3d3f0c3ef96651884fdde27173019 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* SPDX-License-Identifier: MIT
 *
 * Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.
 */
#include <rm/engine.h>

#include "nvrm/ofa.h"

static int
r570_ofa_alloc(struct nvkm_gsp_object *parent, u32 handle, u32 oclass, int inst,
	       struct nvkm_gsp_object *ofa)
{
	NV_OFA_ALLOCATION_PARAMETERS *args;

	args = nvkm_gsp_rm_alloc_get(parent, handle, oclass, sizeof(*args), ofa);
	if (WARN_ON(IS_ERR(args)))
		return PTR_ERR(args);

	args->size = sizeof(*args);
	args->engineInstance = inst;

	return nvkm_gsp_rm_alloc_wr(ofa, args);
}

const struct nvkm_rm_api_engine
r570_ofa = {
	.alloc = r570_ofa_alloc,
};