nouveau_compat.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. #ifndef __NOUVEAU_COMPAT_H__
  2. #define __NOUVEAU_COMPAT_H__
  3. int nvdrm_gart_init(struct drm_device *, u64 *, u64 *);
  4. u8 _nv_rd08(struct drm_device *, u32);
  5. void _nv_wr08(struct drm_device *, u32, u8);
  6. u32 _nv_rd32(struct drm_device *, u32);
  7. void _nv_wr32(struct drm_device *, u32, u32);
  8. u32 _nv_mask(struct drm_device *, u32, u32, u32);
  9. bool _nv_bios(struct drm_device *, u8 **, u32 *);
  10. struct dcb_gpio_func;
  11. void nouveau_gpio_reset(struct drm_device *);
  12. int nouveau_gpio_find(struct drm_device *, int, u8, u8, struct dcb_gpio_func *);
  13. bool nouveau_gpio_func_valid(struct drm_device *, u8 tag);
  14. int nouveau_gpio_func_set(struct drm_device *, u8 tag, int state);
  15. int nouveau_gpio_func_get(struct drm_device *, u8 tag);
  16. int nouveau_gpio_irq(struct drm_device *, int idx, u8 tag, u8 line, bool on);
  17. int nouveau_gpio_isr_add(struct drm_device *, int idx, u8 tag, u8 line,
  18. void (*)(void *, int state), void *data);
  19. void nouveau_gpio_isr_del(struct drm_device *, int idx, u8 tag, u8 line,
  20. void (*)(void *, int state), void *data);
  21. struct nouveau_i2c_port *nouveau_i2c_find(struct drm_device *, u8);
  22. bool nouveau_probe_i2c_addr(struct nouveau_i2c_port *, int addr);
  23. struct i2c_adapter *nouveau_i2c_adapter(struct nouveau_i2c_port *);
  24. int nouveau_i2c_identify(struct drm_device *dev, const char *what,
  25. struct i2c_board_info *info,
  26. bool (*match)(struct nouveau_i2c_port *,
  27. struct i2c_board_info *), int index);
  28. int auxch_rd(struct drm_device *, struct nouveau_i2c_port *, u32, u8 *, u8);
  29. int auxch_wr(struct drm_device *, struct nouveau_i2c_port *, u32, u8 *, u8);
  30. struct nvbios_pll;
  31. struct nouveau_pll_vals;
  32. u32 get_pll_register(struct drm_device *dev, u32 type);
  33. int get_pll_limits(struct drm_device *, u32, struct nvbios_pll *);
  34. int setPLL(struct drm_device *, u32 reg, u32 clk);
  35. int nouveau_calc_pll_mnp(struct drm_device *, struct nvbios_pll *,
  36. int, struct nouveau_pll_vals *);
  37. int nva3_calc_pll(struct drm_device *dev, struct nvbios_pll *info, u32 freq,
  38. int *N, int *fN, int *M, int *P);
  39. int nouveau_hw_setpll(struct drm_device *, u32, struct nouveau_pll_vals *);
  40. struct dcb_output;
  41. void nouveau_bios_run_init_table(struct drm_device *, u16, struct dcb_output *, int);
  42. void nouveau_bios_init_exec(struct drm_device *, u16);
  43. void nv_intr(struct drm_device *);
  44. bool nouveau_wait_eq(struct drm_device *, uint64_t timeout,
  45. uint32_t reg, uint32_t mask, uint32_t val);
  46. bool nouveau_wait_ne(struct drm_device *, uint64_t timeout,
  47. uint32_t reg, uint32_t mask, uint32_t val);
  48. bool nouveau_wait_cb(struct drm_device *, u64 timeout,
  49. bool (*cond)(void *), void *);
  50. u64 nv_timer_read(struct drm_device *);
  51. int nvfb_tile_nr(struct drm_device *);
  52. void nvfb_tile_init(struct drm_device *, int, u32, u32, u32, u32);
  53. void nvfb_tile_fini(struct drm_device *, int);
  54. void nvfb_tile_prog(struct drm_device *, int);
  55. struct nouveau_fb_tile *nvfb_tile(struct drm_device *, int);
  56. struct nouveau_mem;
  57. int nvfb_vram_get(struct drm_device *dev, u64 size, u32 align, u32 ncmin,
  58. u32 memtype, struct nouveau_mem **pmem);
  59. void nvfb_vram_put(struct drm_device *dev, struct nouveau_mem **pmem);
  60. bool nvfb_flags_valid(struct drm_device *dev, u32);
  61. u64 nvfb_vram_sys_base(struct drm_device *);
  62. u64 nvfb_vram_size(struct drm_device *);
  63. int nvfb_vram_type(struct drm_device *);
  64. int nvfb_vram_rank_B(struct drm_device *);
  65. void nv50_fb_vm_trap(struct drm_device *, int);
  66. struct nouveau_gpuobj *nvimem_ramro(struct drm_device *);
  67. struct nouveau_gpuobj *nvimem_ramfc(struct drm_device *);
  68. int _nouveau_gpuobj_new(struct drm_device *dev, struct nouveau_gpuobj *par,
  69. int size, int align, u32 flags,
  70. struct nouveau_gpuobj **pboj);
  71. u32 nv_ri32(struct drm_device *, u32);
  72. void nv_wi32(struct drm_device *, u32, u32);
  73. u32 nvimem_reserved(struct drm_device *);
  74. void nvimem_flush(struct drm_device *);
  75. void _nv50_vm_flush_engine(struct drm_device *dev, int engine);
  76. int _nouveau_vm_new(struct drm_device *, u64 offset, u64 length,
  77. u64 mm_offset, struct nouveau_vm **);
  78. struct nouveau_vma;
  79. int nouveau_gpuobj_map_bar(struct nouveau_gpuobj *, u32, struct nouveau_vma *);
  80. int
  81. nvbar_map(struct drm_device *dev, struct nouveau_mem *mem, u32 flags,
  82. struct nouveau_vma *vma);
  83. void
  84. nvbar_unmap(struct drm_device *dev, struct nouveau_vma *vma);
  85. struct nouveau_vm *
  86. nv04vm_ref(struct drm_device *dev);
  87. struct nouveau_gpuobj *
  88. nv04vm_refdma(struct drm_device *dev);
  89. void
  90. nvvm_engref(struct nouveau_vm *, int, int);
  91. int
  92. nvvm_spg_shift(struct nouveau_vm *);
  93. int
  94. nvvm_lpg_shift(struct nouveau_vm *);
  95. #endif