forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-04 1543e317f1da31b75942316931e8f491a8920811
kernel/drivers/gpu/drm/nouveau/nvkm/engine/device/user.c
....@@ -91,7 +91,7 @@
9191 case ENGINE_A(MSENC ); break;
9292 case ENGINE_A(VIC ); break;
9393 case ENGINE_A(SEC2 ); break;
94
- case ENGINE_A(NVDEC ); break;
94
+ case ENGINE_B(NVDEC ); break;
9595 case ENGINE_B(NVENC ); break;
9696 default:
9797 args->mthd = NV_DEVICE_INFO_INVALID;
....@@ -175,6 +175,7 @@
175175 case GM100: args->v0.family = NV_DEVICE_INFO_V0_MAXWELL; break;
176176 case GP100: args->v0.family = NV_DEVICE_INFO_V0_PASCAL; break;
177177 case GV100: args->v0.family = NV_DEVICE_INFO_V0_VOLTA; break;
178
+ case TU100: args->v0.family = NV_DEVICE_INFO_V0_TURING; break;
178179 default:
179180 args->v0.family = 0;
180181 break;
....@@ -364,16 +365,15 @@
364365 }
365366
366367 if (!sclass) {
367
- switch (index) {
368
- case 0: sclass = &nvkm_control_oclass; break;
369
- case 1:
370
- if (!device->mmu)
371
- return -EINVAL;
368
+ if (index-- == 0)
369
+ sclass = &nvkm_control_oclass;
370
+ else if (device->mmu && index-- == 0)
372371 sclass = &device->mmu->user;
373
- break;
374
- default:
372
+ else if (device->fault && index-- == 0)
373
+ sclass = &device->fault->user;
374
+ else
375375 return -EINVAL;
376
- }
376
+
377377 oclass->base = sclass->base;
378378 }
379379