client.h 1.1 KB

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