wndw.h 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. #ifndef __NV50_KMS_WNDW_H__
  2. #define __NV50_KMS_WNDW_H__
  3. #define nv50_wndw(p) container_of((p), struct nv50_wndw, plane)
  4. #include "disp.h"
  5. #include "atom.h"
  6. #include "lut.h"
  7. #include <nvif/notify.h>
  8. struct nv50_wndw_ctxdma {
  9. struct list_head head;
  10. struct nvif_object object;
  11. };
  12. struct nv50_wndw {
  13. const struct nv50_wndw_func *func;
  14. const struct nv50_wimm_func *immd;
  15. int id;
  16. struct nv50_disp_interlock interlock;
  17. struct {
  18. struct nvif_object *parent;
  19. struct list_head list;
  20. } ctxdma;
  21. struct drm_plane plane;
  22. struct nv50_lut ilut;
  23. struct nv50_dmac wndw;
  24. struct nv50_dmac wimm;
  25. struct nvif_notify notify;
  26. u16 ntfy;
  27. u16 sema;
  28. u32 data;
  29. };
  30. int nv50_wndw_new_(const struct nv50_wndw_func *, struct drm_device *,
  31. enum drm_plane_type, const char *name, int index,
  32. const u32 *format, enum nv50_disp_interlock_type,
  33. u32 interlock_data, u32 heads, struct nv50_wndw **);
  34. void nv50_wndw_init(struct nv50_wndw *);
  35. void nv50_wndw_fini(struct nv50_wndw *);
  36. void nv50_wndw_flush_set(struct nv50_wndw *, u32 *interlock,
  37. struct nv50_wndw_atom *);
  38. void nv50_wndw_flush_clr(struct nv50_wndw *, u32 *interlock, bool flush,
  39. struct nv50_wndw_atom *);
  40. void nv50_wndw_ntfy_enable(struct nv50_wndw *, struct nv50_wndw_atom *);
  41. int nv50_wndw_wait_armed(struct nv50_wndw *, struct nv50_wndw_atom *);
  42. struct nv50_wndw_func {
  43. int (*acquire)(struct nv50_wndw *, struct nv50_wndw_atom *asyw,
  44. struct nv50_head_atom *asyh);
  45. void (*release)(struct nv50_wndw *, struct nv50_wndw_atom *asyw,
  46. struct nv50_head_atom *asyh);
  47. void (*prepare)(struct nv50_wndw *, struct nv50_head_atom *asyh,
  48. struct nv50_wndw_atom *asyw);
  49. void (*sema_set)(struct nv50_wndw *, struct nv50_wndw_atom *);
  50. void (*sema_clr)(struct nv50_wndw *);
  51. void (*ntfy_reset)(struct nouveau_bo *, u32 offset);
  52. void (*ntfy_set)(struct nv50_wndw *, struct nv50_wndw_atom *);
  53. void (*ntfy_clr)(struct nv50_wndw *);
  54. int (*ntfy_wait_begun)(struct nouveau_bo *, u32 offset,
  55. struct nvif_device *);
  56. void (*ilut)(struct nv50_wndw *, struct nv50_wndw_atom *);
  57. bool olut_core;
  58. void (*xlut_set)(struct nv50_wndw *, struct nv50_wndw_atom *);
  59. void (*xlut_clr)(struct nv50_wndw *);
  60. void (*image_set)(struct nv50_wndw *, struct nv50_wndw_atom *);
  61. void (*image_clr)(struct nv50_wndw *);
  62. void (*scale_set)(struct nv50_wndw *, struct nv50_wndw_atom *);
  63. void (*update)(struct nv50_wndw *, u32 *interlock);
  64. };
  65. extern const struct drm_plane_funcs nv50_wndw;
  66. void base507c_ntfy_reset(struct nouveau_bo *, u32);
  67. int base507c_ntfy_wait_begun(struct nouveau_bo *, u32, struct nvif_device *);
  68. struct nv50_wimm_func {
  69. void (*point)(struct nv50_wndw *, struct nv50_wndw_atom *);
  70. void (*update)(struct nv50_wndw *, u32 *interlock);
  71. };
  72. extern const struct nv50_wimm_func curs507a;
  73. int wndwc37e_new(struct nouveau_drm *, enum drm_plane_type, int, s32,
  74. struct nv50_wndw **);
  75. int nv50_wndw_new(struct nouveau_drm *, enum drm_plane_type, int index,
  76. struct nv50_wndw **);
  77. #endif