forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-04 1543e317f1da31b75942316931e8f491a8920811
kernel/drivers/gpu/drm/nouveau/nvkm/core/subdev.c
....@@ -30,6 +30,7 @@
3030
3131 const char *
3232 nvkm_subdev_name[NVKM_SUBDEV_NR] = {
33
+ [NVKM_SUBDEV_ACR ] = "acr",
3334 [NVKM_SUBDEV_BAR ] = "bar",
3435 [NVKM_SUBDEV_VBIOS ] = "bios",
3536 [NVKM_SUBDEV_BUS ] = "bus",
....@@ -39,6 +40,7 @@
3940 [NVKM_SUBDEV_FB ] = "fb",
4041 [NVKM_SUBDEV_FUSE ] = "fuse",
4142 [NVKM_SUBDEV_GPIO ] = "gpio",
43
+ [NVKM_SUBDEV_GSP ] = "gsp",
4244 [NVKM_SUBDEV_I2C ] = "i2c",
4345 [NVKM_SUBDEV_IBUS ] = "priv",
4446 [NVKM_SUBDEV_ICCSENSE] = "iccsense",
....@@ -49,7 +51,6 @@
4951 [NVKM_SUBDEV_MXM ] = "mxm",
5052 [NVKM_SUBDEV_PCI ] = "pci",
5153 [NVKM_SUBDEV_PMU ] = "pmu",
52
- [NVKM_SUBDEV_SECBOOT ] = "secboot",
5354 [NVKM_SUBDEV_THERM ] = "therm",
5455 [NVKM_SUBDEV_TIMER ] = "tmr",
5556 [NVKM_SUBDEV_TOP ] = "top",
....@@ -79,7 +80,9 @@
7980 [NVKM_ENGINE_NVENC0 ] = "nvenc0",
8081 [NVKM_ENGINE_NVENC1 ] = "nvenc1",
8182 [NVKM_ENGINE_NVENC2 ] = "nvenc2",
82
- [NVKM_ENGINE_NVDEC ] = "nvdec",
83
+ [NVKM_ENGINE_NVDEC0 ] = "nvdec0",
84
+ [NVKM_ENGINE_NVDEC1 ] = "nvdec1",
85
+ [NVKM_ENGINE_NVDEC2 ] = "nvdec2",
8386 [NVKM_ENGINE_PM ] = "pm",
8487 [NVKM_ENGINE_SEC ] = "sec",
8588 [NVKM_ENGINE_SEC2 ] = "sec2",
....@@ -218,3 +221,14 @@
218221 __mutex_init(&subdev->mutex, name, &nvkm_subdev_lock_class[index]);
219222 subdev->debug = nvkm_dbgopt(device->dbgopt, name);
220223 }
224
+
225
+int
226
+nvkm_subdev_new_(const struct nvkm_subdev_func *func,
227
+ struct nvkm_device *device, int index,
228
+ struct nvkm_subdev **psubdev)
229
+{
230
+ if (!(*psubdev = kzalloc(sizeof(**psubdev), GFP_KERNEL)))
231
+ return -ENOMEM;
232
+ nvkm_subdev_ctor(func, device, index, *psubdev);
233
+ return 0;
234
+}