outp.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #ifndef __NVKM_DISP_OUTP_H__
  2. #define __NVKM_DISP_OUTP_H__
  3. #include <engine/disp.h>
  4. #include <subdev/bios.h>
  5. #include <subdev/bios/dcb.h>
  6. struct nvkm_output {
  7. const struct nvkm_output_func *func;
  8. struct nvkm_disp *disp;
  9. int index;
  10. struct dcb_output info;
  11. // whatever (if anything) is pointed at by the dcb device entry
  12. struct nvkm_i2c_bus *i2c;
  13. int or;
  14. struct list_head head;
  15. struct nvkm_connector *conn;
  16. };
  17. struct nvkm_output_func {
  18. void *(*dtor)(struct nvkm_output *);
  19. void (*init)(struct nvkm_output *);
  20. void (*fini)(struct nvkm_output *);
  21. };
  22. void nvkm_output_ctor(const struct nvkm_output_func *, struct nvkm_disp *,
  23. int index, struct dcb_output *, struct nvkm_output *);
  24. int nvkm_output_new_(const struct nvkm_output_func *, struct nvkm_disp *,
  25. int index, struct dcb_output *, struct nvkm_output **);
  26. void nvkm_output_del(struct nvkm_output **);
  27. void nvkm_output_init(struct nvkm_output *);
  28. void nvkm_output_fini(struct nvkm_output *);
  29. int nv50_dac_output_new(struct nvkm_disp *, int, struct dcb_output *,
  30. struct nvkm_output **);
  31. int nv50_sor_output_new(struct nvkm_disp *, int, struct dcb_output *,
  32. struct nvkm_output **);
  33. int nv50_pior_output_new(struct nvkm_disp *, int, struct dcb_output *,
  34. struct nvkm_output **);
  35. u32 g94_sor_dp_lane_map(struct nvkm_device *, u8 lane);
  36. void gm200_sor_magic(struct nvkm_output *outp);
  37. #define OUTP_MSG(o,l,f,a...) do { \
  38. struct nvkm_output *_outp = (o); \
  39. nvkm_##l(&_outp->disp->engine.subdev, "outp %02x:%04x:%04x: "f"\n", \
  40. _outp->index, _outp->info.hasht, _outp->info.hashm, ##a); \
  41. } while(0)
  42. #define OUTP_ERR(o,f,a...) OUTP_MSG((o), error, f, ##a)
  43. #define OUTP_DBG(o,f,a...) OUTP_MSG((o), debug, f, ##a)
  44. #define OUTP_TRACE(o,f,a...) OUTP_MSG((o), trace, f, ##a)
  45. #endif