]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - drivers/gpu/drm/nouveau/include/nvkm/core/client.h
drm/nouveau/core/client: lookup client objects with nvkm_object_search()
[mirror_ubuntu-bionic-kernel.git] / drivers / gpu / drm / nouveau / include / nvkm / core / client.h
CommitLineData
5025407b
BS
1#ifndef __NVKM_CLIENT_H__
2#define __NVKM_CLIENT_H__
24bd0930 3#include <core/object.h>
9274f4a9 4
5025407b 5struct nvkm_client {
24bd0930 6 struct nvkm_object object;
a2896ced 7 char name[32];
24bd0930 8 u64 device;
9274f4a9 9 u32 debug;
24bd0930
BS
10
11 struct nvkm_client_notify *notify[16];
12 struct rb_root objroot;
0710cc31 13 struct rb_root dmaroot;
24bd0930 14
8ec2a6ec
BS
15 bool super;
16 void *data;
8ec2a6ec 17 int (*ntfy)(const void *, u32, const void *, u32);
bf81df9b 18
24bd0930 19 struct nvkm_vm *vm;
9274f4a9
BS
20};
21
76ecea5b
BS
22int nvkm_client_new(const char *name, u64 device, const char *cfg,
23 const char *dbg, struct nvkm_client **);
24void nvkm_client_del(struct nvkm_client **);
5025407b
BS
25int nvkm_client_init(struct nvkm_client *);
26int nvkm_client_fini(struct nvkm_client *, bool suspend);
9274f4a9 27
5025407b 28int nvkm_client_notify_new(struct nvkm_object *, struct nvkm_event *,
8ec2a6ec 29 void *data, u32 size);
5025407b
BS
30int nvkm_client_notify_del(struct nvkm_client *, int index);
31int nvkm_client_notify_get(struct nvkm_client *, int index);
32int nvkm_client_notify_put(struct nvkm_client *, int index);
6594363b
BS
33
34/* logging for client-facing objects */
35#define nvif_printk(o,l,p,f,a...) do { \
c1fcb148
AC
36 const struct nvkm_object *_object = (o); \
37 const struct nvkm_client *_client = _object->client; \
6594363b 38 if (_client->debug >= NV_DBG_##l) \
fbd58ebd
BS
39 printk(KERN_##p "nouveau: %s:%08x:%08x: "f, _client->name, \
40 _object->handle, _object->oclass, ##a); \
6594363b 41} while(0)
fbd58ebd 42#define nvif_fatal(o,f,a...) nvif_printk((o), FATAL, CRIT, f, ##a)
6594363b
BS
43#define nvif_error(o,f,a...) nvif_printk((o), ERROR, ERR, f, ##a)
44#define nvif_debug(o,f,a...) nvif_printk((o), DEBUG, INFO, f, ##a)
45#define nvif_trace(o,f,a...) nvif_printk((o), TRACE, INFO, f, ##a)
fbd58ebd 46#define nvif_info(o,f,a...) nvif_printk((o), INFO, INFO, f, ##a)
6594363b 47#define nvif_ioctl(o,f,a...) nvif_trace((o), "ioctl: "f, ##a)
9274f4a9 48#endif