drm_crtc_internal.h 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. /*
  2. * Copyright © 2006 Keith Packard
  3. * Copyright © 2007-2008 Dave Airlie
  4. * Copyright © 2007-2008 Intel Corporation
  5. * Jesse Barnes <jesse.barnes@intel.com>
  6. * Copyright © 2014 Intel Corporation
  7. * Daniel Vetter <daniel.vetter@ffwll.ch>
  8. *
  9. * Permission is hereby granted, free of charge, to any person obtaining a
  10. * copy of this software and associated documentation files (the "Software"),
  11. * to deal in the Software without restriction, including without limitation
  12. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  13. * and/or sell copies of the Software, and to permit persons to whom the
  14. * Software is furnished to do so, subject to the following conditions:
  15. *
  16. * The above copyright notice and this permission notice shall be included in
  17. * all copies or substantial portions of the Software.
  18. *
  19. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  20. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  21. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  22. * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
  23. * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  24. * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  25. * OTHER DEALINGS IN THE SOFTWARE.
  26. */
  27. /*
  28. * This header file contains mode setting related functions and definitions
  29. * which are only used within the drm module as internal implementation details
  30. * and are not exported to drivers.
  31. */
  32. /* drm_crtc.c */
  33. int drm_mode_object_get_reg(struct drm_device *dev,
  34. struct drm_mode_object *obj,
  35. uint32_t obj_type,
  36. bool register_obj,
  37. void (*obj_free_cb)(struct kref *kref));
  38. void drm_mode_object_register(struct drm_device *dev,
  39. struct drm_mode_object *obj);
  40. int drm_mode_object_get(struct drm_device *dev,
  41. struct drm_mode_object *obj, uint32_t obj_type);
  42. struct drm_mode_object *__drm_mode_object_find(struct drm_device *dev,
  43. uint32_t id, uint32_t type);
  44. void drm_mode_object_unregister(struct drm_device *dev,
  45. struct drm_mode_object *object);
  46. int drm_mode_object_get_properties(struct drm_mode_object *obj, bool atomic,
  47. uint32_t __user *prop_ptr,
  48. uint64_t __user *prop_values,
  49. uint32_t *arg_count_props);
  50. bool drm_property_change_valid_get(struct drm_property *property,
  51. uint64_t value,
  52. struct drm_mode_object **ref);
  53. void drm_property_change_valid_put(struct drm_property *property,
  54. struct drm_mode_object *ref);
  55. int drm_plane_check_pixel_format(const struct drm_plane *plane,
  56. u32 format);
  57. int drm_crtc_check_viewport(const struct drm_crtc *crtc,
  58. int x, int y,
  59. const struct drm_display_mode *mode,
  60. const struct drm_framebuffer *fb);
  61. void drm_fb_release(struct drm_file *file_priv);
  62. void drm_property_destroy_user_blobs(struct drm_device *dev,
  63. struct drm_file *file_priv);
  64. /* dumb buffer support IOCTLs */
  65. int drm_mode_create_dumb_ioctl(struct drm_device *dev,
  66. void *data, struct drm_file *file_priv);
  67. int drm_mode_mmap_dumb_ioctl(struct drm_device *dev,
  68. void *data, struct drm_file *file_priv);
  69. int drm_mode_destroy_dumb_ioctl(struct drm_device *dev,
  70. void *data, struct drm_file *file_priv);
  71. /* IOCTLs */
  72. int drm_mode_obj_get_properties_ioctl(struct drm_device *dev, void *data,
  73. struct drm_file *file_priv);
  74. int drm_mode_obj_set_property_ioctl(struct drm_device *dev, void *data,
  75. struct drm_file *file_priv);
  76. int drm_mode_getresources(struct drm_device *dev,
  77. void *data, struct drm_file *file_priv);
  78. int drm_mode_getplane_res(struct drm_device *dev, void *data,
  79. struct drm_file *file_priv);
  80. int drm_mode_getcrtc(struct drm_device *dev,
  81. void *data, struct drm_file *file_priv);
  82. int drm_mode_setcrtc(struct drm_device *dev,
  83. void *data, struct drm_file *file_priv);
  84. int drm_mode_getplane(struct drm_device *dev,
  85. void *data, struct drm_file *file_priv);
  86. int drm_mode_setplane(struct drm_device *dev,
  87. void *data, struct drm_file *file_priv);
  88. int drm_mode_cursor_ioctl(struct drm_device *dev,
  89. void *data, struct drm_file *file_priv);
  90. int drm_mode_cursor2_ioctl(struct drm_device *dev,
  91. void *data, struct drm_file *file_priv);
  92. int drm_mode_getproperty_ioctl(struct drm_device *dev,
  93. void *data, struct drm_file *file_priv);
  94. int drm_mode_getblob_ioctl(struct drm_device *dev,
  95. void *data, struct drm_file *file_priv);
  96. int drm_mode_createblob_ioctl(struct drm_device *dev,
  97. void *data, struct drm_file *file_priv);
  98. int drm_mode_destroyblob_ioctl(struct drm_device *dev,
  99. void *data, struct drm_file *file_priv);
  100. int drm_mode_gamma_get_ioctl(struct drm_device *dev,
  101. void *data, struct drm_file *file_priv);
  102. int drm_mode_gamma_set_ioctl(struct drm_device *dev,
  103. void *data, struct drm_file *file_priv);
  104. int drm_mode_page_flip_ioctl(struct drm_device *dev,
  105. void *data, struct drm_file *file_priv);
  106. /* drm_encoder.c */
  107. int drm_encoder_register_all(struct drm_device *dev);
  108. void drm_encoder_unregister_all(struct drm_device *dev);
  109. /* IOCTL */
  110. int drm_mode_getencoder(struct drm_device *dev,
  111. void *data, struct drm_file *file_priv);
  112. /* drm_connector.c */
  113. void drm_connector_ida_init(void);
  114. void drm_connector_ida_destroy(void);
  115. void drm_connector_unregister_all(struct drm_device *dev);
  116. int drm_connector_register_all(struct drm_device *dev);
  117. int drm_mode_connector_set_obj_prop(struct drm_mode_object *obj,
  118. struct drm_property *property,
  119. uint64_t value);
  120. int drm_connector_create_standard_properties(struct drm_device *dev);
  121. /* IOCTL */
  122. int drm_mode_connector_property_set_ioctl(struct drm_device *dev,
  123. void *data, struct drm_file *file_priv);
  124. int drm_mode_getconnector(struct drm_device *dev,
  125. void *data, struct drm_file *file_priv);
  126. /* drm_framebuffer.c */
  127. struct drm_framebuffer *
  128. drm_internal_framebuffer_create(struct drm_device *dev,
  129. const struct drm_mode_fb_cmd2 *r,
  130. struct drm_file *file_priv);
  131. void drm_framebuffer_free(struct kref *kref);
  132. /* IOCTL */
  133. int drm_mode_addfb(struct drm_device *dev,
  134. void *data, struct drm_file *file_priv);
  135. int drm_mode_addfb2(struct drm_device *dev,
  136. void *data, struct drm_file *file_priv);
  137. int drm_mode_rmfb(struct drm_device *dev,
  138. void *data, struct drm_file *file_priv);
  139. int drm_mode_getfb(struct drm_device *dev,
  140. void *data, struct drm_file *file_priv);
  141. int drm_mode_dirtyfb_ioctl(struct drm_device *dev,
  142. void *data, struct drm_file *file_priv);
  143. /* drm_atomic.c */
  144. int drm_atomic_get_property(struct drm_mode_object *obj,
  145. struct drm_property *property, uint64_t *val);
  146. int drm_mode_atomic_ioctl(struct drm_device *dev,
  147. void *data, struct drm_file *file_priv);
  148. int drm_modeset_register_all(struct drm_device *dev);
  149. void drm_modeset_unregister_all(struct drm_device *dev);
  150. /* drm_blend.c */
  151. int drm_atomic_normalize_zpos(struct drm_device *dev,
  152. struct drm_atomic_state *state);