dc-kms.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Copyright 2024 NXP
  4. */
  5. #ifndef __DC_KMS_H__
  6. #define __DC_KMS_H__
  7. #include <linux/completion.h>
  8. #include <drm/drm_crtc.h>
  9. #include <drm/drm_plane.h>
  10. #include <drm/drm_vblank.h>
  11. #include "dc-de.h"
  12. #include "dc-fu.h"
  13. #include "dc-pe.h"
  14. #define DC_CRTC_IRQS 5
  15. struct dc_crtc_irq {
  16. struct dc_crtc *dc_crtc;
  17. unsigned int irq;
  18. };
  19. /**
  20. * struct dc_crtc - DC specific drm_crtc
  21. *
  22. * Each display controller contains one content stream and one safety stream.
  23. * In general, the two streams have the same functionality. One stream is
  24. * overlaid on the other by @fg. This driver chooses to generate black constant
  25. * color from the content stream as background color, build plane(s) on the
  26. * content stream by using layerblend(s) and always generate a constant color
  27. * from the safety stream. Note that due to the decoupled timing, the safety
  28. * stream still works to show the constant color properly even when the content
  29. * stream has completely hung up due to mal-function of this driver.
  30. */
  31. struct dc_crtc {
  32. /** @base: base drm_crtc structure */
  33. struct drm_crtc base;
  34. /** @de: display engine */
  35. struct dc_de *de;
  36. /** @cf_cont: content stream constframe */
  37. struct dc_cf *cf_cont;
  38. /** @cf_safe: safety stream constframe */
  39. struct dc_cf *cf_safe;
  40. /** @ed_cont: content stream extdst */
  41. struct dc_ed *ed_cont;
  42. /** @ed_safe: safety stream extdst */
  43. struct dc_ed *ed_safe;
  44. /** @fg: framegen */
  45. struct dc_fg *fg;
  46. /**
  47. * @irq_dec_framecomplete:
  48. *
  49. * display engine configuration frame complete interrupt
  50. */
  51. unsigned int irq_dec_framecomplete;
  52. /**
  53. * @irq_dec_seqcomplete:
  54. *
  55. * display engine configuration sequence complete interrupt
  56. */
  57. unsigned int irq_dec_seqcomplete;
  58. /**
  59. * @irq_dec_shdload:
  60. *
  61. * display engine configuration shadow load interrupt
  62. */
  63. unsigned int irq_dec_shdload;
  64. /**
  65. * @irq_ed_cont_shdload:
  66. *
  67. * content stream extdst shadow load interrupt
  68. */
  69. unsigned int irq_ed_cont_shdload;
  70. /**
  71. * @irq_ed_safe_shdload:
  72. *
  73. * safety stream extdst shadow load interrupt
  74. */
  75. unsigned int irq_ed_safe_shdload;
  76. /**
  77. * @dec_seqcomplete_done:
  78. *
  79. * display engine configuration sequence completion
  80. */
  81. struct completion dec_seqcomplete_done;
  82. /**
  83. * @dec_shdload_done:
  84. *
  85. * display engine configuration shadow load completion
  86. */
  87. struct completion dec_shdload_done;
  88. /**
  89. * @ed_cont_shdload_done:
  90. *
  91. * content stream extdst shadow load completion
  92. */
  93. struct completion ed_cont_shdload_done;
  94. /**
  95. * @ed_safe_shdload_done:
  96. *
  97. * safety stream extdst shadow load completion
  98. */
  99. struct completion ed_safe_shdload_done;
  100. /** @event: cached pending vblank event */
  101. struct drm_pending_vblank_event *event;
  102. /** @irqs: interrupt list */
  103. struct dc_crtc_irq irqs[DC_CRTC_IRQS];
  104. };
  105. /**
  106. * struct dc_plane - DC specific drm_plane
  107. *
  108. * Build a plane on content stream with a fetchunit and a layerblend.
  109. */
  110. struct dc_plane {
  111. /** @base: base drm_plane structure */
  112. struct drm_plane base;
  113. /** @fu: fetchunit */
  114. struct dc_fu *fu;
  115. /** @cf: content stream constframe */
  116. struct dc_cf *cf;
  117. /** @lb: layerblend */
  118. struct dc_lb *lb;
  119. /** @ed: content stream extdst */
  120. struct dc_ed *ed;
  121. };
  122. #endif /* __DC_KMS_H__ */