nouveau_chan.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /* SPDX-License-Identifier: MIT */
  2. #ifndef __NOUVEAU_CHAN_H__
  3. #define __NOUVEAU_CHAN_H__
  4. #include <nvif/object.h>
  5. #include <nvif/notify.h>
  6. #include <nvif/push.h>
  7. struct nvif_device;
  8. struct nouveau_channel {
  9. struct {
  10. struct nvif_push _push;
  11. struct nvif_push *push;
  12. } chan;
  13. struct nvif_device *device;
  14. struct nouveau_drm *drm;
  15. struct nouveau_vmm *vmm;
  16. int chid;
  17. u64 inst;
  18. u32 token;
  19. struct nvif_object vram;
  20. struct nvif_object gart;
  21. struct nvif_object nvsw;
  22. struct {
  23. struct nouveau_bo *buffer;
  24. struct nouveau_vma *vma;
  25. struct nvif_object ctxdma;
  26. u64 addr;
  27. } push;
  28. /* TODO: this will be reworked in the near future */
  29. bool accel_done;
  30. void *fence;
  31. struct {
  32. int max;
  33. int free;
  34. int cur;
  35. int put;
  36. int ib_base;
  37. int ib_max;
  38. int ib_free;
  39. int ib_put;
  40. } dma;
  41. u32 user_get_hi;
  42. u32 user_get;
  43. u32 user_put;
  44. struct nvif_object user;
  45. struct nvif_notify kill;
  46. atomic_t killed;
  47. };
  48. int nouveau_channels_init(struct nouveau_drm *);
  49. int nouveau_channel_new(struct nouveau_drm *, struct nvif_device *,
  50. u32 arg0, u32 arg1, bool priv,
  51. struct nouveau_channel **);
  52. void nouveau_channel_del(struct nouveau_channel **);
  53. int nouveau_channel_idle(struct nouveau_channel *);
  54. extern int nouveau_vram_pushbuf;
  55. #endif