1#ifndef __NVIF_CLIENT_H__
2#define __NVIF_CLIENT_H__
3
4#include <nvif/object.h>
5
6struct nvif_client {
7 struct nvif_object base;
8 struct nvif_object *object;
9 const struct nvif_driver *driver;
10 bool super;
11};
12
13static inline struct nvif_client *
14nvif_client(struct nvif_object *object)
15{
16 while (object && object->parent != object)
17 object = object->parent;
18 return (void *)object;
19}
20
21int nvif_client_init(void (*dtor)(struct nvif_client *), const char *,
22 const char *, u64, const char *, const char *,
23 struct nvif_client *);
24void nvif_client_fini(struct nvif_client *);
25int nvif_client_new(const char *, const char *, u64, const char *,
26 const char *, struct nvif_client **);
27void nvif_client_ref(struct nvif_client *, struct nvif_client **);
28int nvif_client_ioctl(struct nvif_client *, void *, u32);
29int nvif_client_suspend(struct nvif_client *);
30int nvif_client_resume(struct nvif_client *);
31
32
33#include <core/client.h>
34#define nvxx_client(a) ({ \
35 struct nvif_client *_client = nvif_client(nvif_object(a)); \
36 nvkm_client(_client->base.priv); \
37})
38
39#endif
40