outpdp.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #ifndef __NVKM_DISP_OUTP_DP_H__
  2. #define __NVKM_DISP_OUTP_DP_H__
  3. #define nvkm_output_dp(p) container_of((p), struct nvkm_output_dp, base)
  4. #ifndef MSG
  5. #define MSG(l,f,a...) \
  6. nvkm_##l(&outp->base.disp->engine.subdev, "%02x:%04x:%04x: "f, \
  7. outp->base.index, outp->base.info.hasht, \
  8. outp->base.info.hashm, ##a)
  9. #define DBG(f,a...) MSG(debug, f, ##a)
  10. #define ERR(f,a...) MSG(error, f, ##a)
  11. #endif
  12. #include "outp.h"
  13. #include <core/notify.h>
  14. #include <subdev/bios.h>
  15. #include <subdev/bios/dp.h>
  16. struct nvkm_output_dp {
  17. const struct nvkm_output_dp_func *func;
  18. struct nvkm_output base;
  19. struct nvbios_dpout info;
  20. u8 version;
  21. struct nvkm_i2c_aux *aux;
  22. struct nvkm_notify irq;
  23. struct nvkm_notify hpd;
  24. bool present;
  25. u8 dpcd[16];
  26. struct mutex mutex;
  27. struct {
  28. atomic_t done;
  29. bool mst;
  30. } lt;
  31. };
  32. struct nvkm_output_dp_func {
  33. int (*pattern)(struct nvkm_output_dp *, int);
  34. int (*lnk_pwr)(struct nvkm_output_dp *, int nr);
  35. int (*lnk_ctl)(struct nvkm_output_dp *, int nr, int bw, bool ef);
  36. int (*drv_ctl)(struct nvkm_output_dp *, int ln, int vs, int pe, int pc);
  37. void (*vcpi)(struct nvkm_output_dp *, int head, u8 start_slot,
  38. u8 num_slots, u16 pbn, u16 aligned_pbn);
  39. };
  40. int nvkm_output_dp_train(struct nvkm_output *, u32 rate);
  41. int nvkm_output_dp_ctor(const struct nvkm_output_dp_func *, struct nvkm_disp *,
  42. int index, struct dcb_output *, struct nvkm_i2c_aux *,
  43. struct nvkm_output_dp *);
  44. int nvkm_output_dp_new_(const struct nvkm_output_dp_func *, struct nvkm_disp *,
  45. int index, struct dcb_output *,
  46. struct nvkm_output **);
  47. int nv50_pior_dp_new(struct nvkm_disp *, int, struct dcb_output *,
  48. struct nvkm_output **);
  49. int g94_sor_dp_new(struct nvkm_disp *, int, struct dcb_output *,
  50. struct nvkm_output **);
  51. int g94_sor_dp_lnk_pwr(struct nvkm_output_dp *, int);
  52. int gf119_sor_dp_new(struct nvkm_disp *, int, struct dcb_output *,
  53. struct nvkm_output **);
  54. int gf119_sor_dp_lnk_ctl(struct nvkm_output_dp *, int, int, bool);
  55. int gf119_sor_dp_drv_ctl(struct nvkm_output_dp *, int, int, int, int);
  56. void gf119_sor_dp_vcpi(struct nvkm_output_dp *, int, u8, u8, u16, u16);
  57. int gm107_sor_dp_new(struct nvkm_disp *, int, struct dcb_output *,
  58. struct nvkm_output **);
  59. int gm107_sor_dp_pattern(struct nvkm_output_dp *, int);
  60. int gm200_sor_dp_new(struct nvkm_disp *, int, struct dcb_output *,
  61. struct nvkm_output **);
  62. #endif