ARM: at91: fix board-rm9200-dt after sys_timer conversion
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / drivers / gpu / drm / nouveau / core / include / core / client.h
1 #ifndef __NOUVEAU_CLIENT_H__
2 #define __NOUVEAU_CLIENT_H__
3
4 #include <core/namedb.h>
5
6 struct nouveau_client {
7 struct nouveau_namedb base;
8 struct nouveau_handle *root;
9 struct nouveau_object *device;
10 char name[16];
11 u32 debug;
12 struct nouveau_vm *vm;
13 };
14
15 static inline struct nouveau_client *
16 nv_client(void *obj)
17 {
18 #if CONFIG_NOUVEAU_DEBUG >= NV_DBG_PARANOIA
19 if (unlikely(!nv_iclass(obj, NV_CLIENT_CLASS)))
20 nv_assert("BAD CAST -> NvClient, %08x", nv_hclass(obj));
21 #endif
22 return obj;
23 }
24
25 static inline struct nouveau_client *
26 nouveau_client(void *obj)
27 {
28 struct nouveau_object *client = nv_object(obj);
29 while (client && !(nv_iclass(client, NV_CLIENT_CLASS)))
30 client = client->parent;
31 return (void *)client;
32 }
33
34 #define nouveau_client_create(n,c,oc,od,d) \
35 nouveau_client_create_((n), (c), (oc), (od), sizeof(**d), (void **)d)
36
37 int nouveau_client_create_(const char *name, u64 device, const char *cfg,
38 const char *dbg, int, void **);
39 int nouveau_client_init(struct nouveau_client *);
40 int nouveau_client_fini(struct nouveau_client *, bool suspend);
41
42 #endif