forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/drivers/gpu/drm/nouveau/nvif/object.c
....@@ -242,7 +242,7 @@
242242 }
243243
244244 void
245
-nvif_object_fini(struct nvif_object *object)
245
+nvif_object_dtor(struct nvif_object *object)
246246 {
247247 struct {
248248 struct nvif_ioctl_v0 ioctl;
....@@ -260,8 +260,8 @@
260260 }
261261
262262 int
263
-nvif_object_init(struct nvif_object *parent, u32 handle, s32 oclass,
264
- void *data, u32 size, struct nvif_object *object)
263
+nvif_object_ctor(struct nvif_object *parent, const char *name, u32 handle,
264
+ s32 oclass, void *data, u32 size, struct nvif_object *object)
265265 {
266266 struct {
267267 struct nvif_ioctl_v0 ioctl;
....@@ -270,6 +270,7 @@
270270 int ret = 0;
271271
272272 object->client = NULL;
273
+ object->name = name ? name : "nvifObject";
273274 object->handle = handle;
274275 object->oclass = oclass;
275276 object->map.ptr = NULL;
....@@ -277,9 +278,11 @@
277278
278279 if (parent) {
279280 if (!(args = kmalloc(sizeof(*args) + size, GFP_KERNEL))) {
280
- nvif_object_fini(object);
281
+ nvif_object_dtor(object);
281282 return -ENOMEM;
282283 }
284
+
285
+ object->parent = parent->parent;
283286
284287 args->ioctl.version = 0;
285288 args->ioctl.type = NVIF_IOCTL_V0_NEW;
....@@ -300,6 +303,6 @@
300303 }
301304
302305 if (ret)
303
- nvif_object_fini(object);
306
+ nvif_object_dtor(object);
304307 return ret;
305308 }