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