device.h (0898782247ae533d1f4e47a06bc5d4870931b284) device.h (ed3d1489d2717a13f3b47b296bb2faa7ce4168da)
1/* SPDX-License-Identifier: MIT */
2#ifndef __NVIF_DEVICE_H__
3#define __NVIF_DEVICE_H__
4
5#include <nvif/object.h>
6#include <nvif/cl0080.h>
7#include <nvif/user.h>
8

--- 9 unchanged lines hidden (view full) ---

18 struct nvif_user user;
19};
20
21int nvif_device_init(struct nvif_object *, u32 handle, s32 oclass, void *, u32,
22 struct nvif_device *);
23void nvif_device_fini(struct nvif_device *);
24u64 nvif_device_time(struct nvif_device *);
25
1/* SPDX-License-Identifier: MIT */
2#ifndef __NVIF_DEVICE_H__
3#define __NVIF_DEVICE_H__
4
5#include <nvif/object.h>
6#include <nvif/cl0080.h>
7#include <nvif/user.h>
8

--- 9 unchanged lines hidden (view full) ---

18 struct nvif_user user;
19};
20
21int nvif_device_init(struct nvif_object *, u32 handle, s32 oclass, void *, u32,
22 struct nvif_device *);
23void nvif_device_fini(struct nvif_device *);
24u64 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)
46
47/*XXX*/
48#include <subdev/bios.h>
49#include <subdev/fb.h>
50#include <subdev/bar.h>
51#include <subdev/gpio.h>
52#include <subdev/clk.h>
53#include <subdev/i2c.h>
54#include <subdev/timer.h>

--- 25 unchanged lines hidden ---
26/*XXX*/
27#include <subdev/bios.h>
28#include <subdev/fb.h>
29#include <subdev/bar.h>
30#include <subdev/gpio.h>
31#include <subdev/clk.h>
32#include <subdev/i2c.h>
33#include <subdev/timer.h>

--- 25 unchanged lines hidden ---