forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-11 04dd17822334871b23ea2862f7798fb0e0007777
kernel/drivers/gpu/drm/nouveau/include/nvif/device.h
....@@ -1,4 +1,4 @@
1
-/* SPDX-License-Identifier: GPL-2.0 */
1
+/* SPDX-License-Identifier: MIT */
22 #ifndef __NVIF_DEVICE_H__
33 #define __NVIF_DEVICE_H__
44
....@@ -18,31 +18,10 @@
1818 struct nvif_user user;
1919 };
2020
21
-int nvif_device_init(struct nvif_object *, u32 handle, s32 oclass, void *, u32,
22
- struct nvif_device *);
23
-void nvif_device_fini(struct nvif_device *);
21
+int nvif_device_ctor(struct nvif_object *, const char *name, u32 handle,
22
+ s32 oclass, void *, u32, struct nvif_device *);
23
+void nvif_device_dtor(struct nvif_device *);
2424 u64 nvif_device_time(struct nvif_device *);
25
-
26
-/* Delay based on GPU time (ie. PTIMER).
27
- *
28
- * Will return -ETIMEDOUT unless the loop was terminated with 'break',
29
- * where it will return the number of nanoseconds taken instead.
30
- */
31
-#define nvif_nsec(d,n,cond...) ({ \
32
- struct nvif_device *_device = (d); \
33
- u64 _nsecs = (n), _time0 = nvif_device_time(_device); \
34
- s64 _taken = 0; \
35
- \
36
- do { \
37
- cond \
38
- } while (_taken = nvif_device_time(_device) - _time0, _taken < _nsecs);\
39
- \
40
- if (_taken >= _nsecs) \
41
- _taken = -ETIMEDOUT; \
42
- _taken; \
43
-})
44
-#define nvif_usec(d,u,cond...) nvif_nsec((d), (u) * 1000, ##cond)
45
-#define nvif_msec(d,m,cond...) nvif_usec((d), (m) * 1000, ##cond)
4625
4726 /*XXX*/
4827 #include <subdev/bios.h>