]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/blame - drivers/gpu/drm/nouveau/nvif/client.h
drm/nouveau/nvif: import library functions for the ioctl/event interfaces
[mirror_ubuntu-focal-kernel.git] / drivers / gpu / drm / nouveau / nvif / client.h
CommitLineData
a04d0423
BS
1#ifndef __NVIF_CLIENT_H__
2#define __NVIF_CLIENT_H__
3
4#include "object.h"
5
6struct nvif_client {
7 struct nvif_object base;
8 struct nvif_object *object; /*XXX: hack for nvif_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/*XXX*/
33#include <core/client.h>
34#define nvkm_client(a) ({ \
35 struct nvif_client *_client = nvif_client(nvif_object(a)); \
36 nouveau_client(_client->base.priv); \
37})
38
39#endif