outpdp.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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 {
  27. struct work_struct work;
  28. wait_queue_head_t wait;
  29. atomic_t done;
  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. };
  38. int nvkm_output_dp_train(struct nvkm_output *, u32 rate, bool wait);
  39. int nvkm_output_dp_ctor(const struct nvkm_output_dp_func *, struct nvkm_disp *,
  40. int index, struct dcb_output *, struct nvkm_i2c_aux *,
  41. struct nvkm_output_dp *);
  42. int nvkm_output_dp_new_(const struct nvkm_output_dp_func *, struct nvkm_disp *,
  43. int index, struct dcb_output *,
  44. struct nvkm_output **);
  45. int nv50_pior_dp_new(struct nvkm_disp *, int, struct dcb_output *,
  46. struct nvkm_output **);
  47. int g94_sor_dp_new(struct nvkm_disp *, int, struct dcb_output *,
  48. struct nvkm_output **);
  49. int g94_sor_dp_lnk_pwr(struct nvkm_output_dp *, int);
  50. int gf119_sor_dp_new(struct nvkm_disp *, int, struct dcb_output *,
  51. struct nvkm_output **);
  52. int gf119_sor_dp_lnk_ctl(struct nvkm_output_dp *, int, int, bool);
  53. int gm204_sor_dp_new(struct nvkm_disp *, int, struct dcb_output *,
  54. struct nvkm_output **);
  55. #endif