xref: /linux/drivers/gpu/drm/nouveau/nvkm/engine/ofa/ga102.c (revision 0ea5c948cb64bab5bc7a5516774eb8536f05aa0d)
1*015185ccSBen Skeggs /*
2*015185ccSBen Skeggs  * Copyright 2023 Red Hat Inc.
3*015185ccSBen Skeggs  *
4*015185ccSBen Skeggs  * Permission is hereby granted, free of charge, to any person obtaining a
5*015185ccSBen Skeggs  * copy of this software and associated documentation files (the "Software"),
6*015185ccSBen Skeggs  * to deal in the Software without restriction, including without limitation
7*015185ccSBen Skeggs  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8*015185ccSBen Skeggs  * and/or sell copies of the Software, and to permit persons to whom the
9*015185ccSBen Skeggs  * Software is furnished to do so, subject to the following conditions:
10*015185ccSBen Skeggs  *
11*015185ccSBen Skeggs  * The above copyright notice and this permission notice shall be included in
12*015185ccSBen Skeggs  * all copies or substantial portions of the Software.
13*015185ccSBen Skeggs  *
14*015185ccSBen Skeggs  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15*015185ccSBen Skeggs  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16*015185ccSBen Skeggs  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
17*015185ccSBen Skeggs  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18*015185ccSBen Skeggs  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19*015185ccSBen Skeggs  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20*015185ccSBen Skeggs  * OTHER DEALINGS IN THE SOFTWARE.
21*015185ccSBen Skeggs  */
22*015185ccSBen Skeggs #include "priv.h"
23*015185ccSBen Skeggs 
24*015185ccSBen Skeggs #include <subdev/gsp.h>
25*015185ccSBen Skeggs 
26*015185ccSBen Skeggs #include <nvif/class.h>
27*015185ccSBen Skeggs 
28*015185ccSBen Skeggs static const struct nvkm_engine_func
29*015185ccSBen Skeggs ga102_ofa = {
30*015185ccSBen Skeggs 	.sclass = {
31*015185ccSBen Skeggs 		{ -1, -1, NVC7FA_VIDEO_OFA },
32*015185ccSBen Skeggs 		{}
33*015185ccSBen Skeggs 	}
34*015185ccSBen Skeggs };
35*015185ccSBen Skeggs 
36*015185ccSBen Skeggs int
ga102_ofa_new(struct nvkm_device * device,enum nvkm_subdev_type type,int inst,struct nvkm_engine ** pengine)37*015185ccSBen Skeggs ga102_ofa_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
38*015185ccSBen Skeggs 	      struct nvkm_engine **pengine)
39*015185ccSBen Skeggs {
40*015185ccSBen Skeggs 	if (nvkm_gsp_rm(device->gsp))
41*015185ccSBen Skeggs 		return r535_ofa_new(&ga102_ofa, device, type, inst, pengine);
42*015185ccSBen Skeggs 
43*015185ccSBen Skeggs 	return -ENODEV;
44*015185ccSBen Skeggs }
45