drm_crtc_internal.h 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  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. #include <linux/types.h>
  33. enum drm_color_encoding;
  34. enum drm_color_range;
  35. enum drm_connector_force;
  36. enum drm_mode_status;
  37. struct drm_atomic_state;
  38. struct drm_bridge;
  39. struct drm_connector;
  40. struct drm_crtc;
  41. struct drm_device;
  42. struct drm_display_mode;
  43. struct drm_file;
  44. struct drm_framebuffer;
  45. struct drm_mode_create_dumb;
  46. struct drm_mode_fb_cmd2;
  47. struct drm_mode_fb_cmd;
  48. struct drm_mode_object;
  49. struct drm_mode_set;
  50. struct drm_plane;
  51. struct drm_plane_state;
  52. struct drm_property;
  53. struct edid;
  54. struct kref;
  55. struct work_struct;
  56. /* drm_crtc.c */
  57. int drm_mode_crtc_set_obj_prop(struct drm_mode_object *obj,
  58. struct drm_property *property,
  59. uint64_t value);
  60. int drm_crtc_check_viewport(const struct drm_crtc *crtc,
  61. int x, int y,
  62. const struct drm_display_mode *mode,
  63. const struct drm_framebuffer *fb);
  64. int drm_crtc_register_all(struct drm_device *dev);
  65. void drm_crtc_unregister_all(struct drm_device *dev);
  66. int drm_crtc_force_disable(struct drm_crtc *crtc);
  67. struct dma_fence *drm_crtc_create_fence(struct drm_crtc *crtc);
  68. /* IOCTLs */
  69. int drm_mode_getcrtc(struct drm_device *dev,
  70. void *data, struct drm_file *file_priv);
  71. int drm_mode_setcrtc(struct drm_device *dev,
  72. void *data, struct drm_file *file_priv);
  73. /* drm_mode_config.c */
  74. int drm_modeset_register_all(struct drm_device *dev);
  75. void drm_modeset_unregister_all(struct drm_device *dev);
  76. void drm_mode_config_validate(struct drm_device *dev);
  77. /* drm_modes.c */
  78. const char *drm_get_mode_status_name(enum drm_mode_status status);
  79. /* IOCTLs */
  80. int drm_mode_getresources(struct drm_device *dev,
  81. void *data, struct drm_file *file_priv);
  82. /* drm_dumb_buffers.c */
  83. int drm_mode_create_dumb(struct drm_device *dev,
  84. struct drm_mode_create_dumb *args,
  85. struct drm_file *file_priv);
  86. int drm_mode_destroy_dumb(struct drm_device *dev, u32 handle,
  87. struct drm_file *file_priv);
  88. /* IOCTLs */
  89. int drm_mode_create_dumb_ioctl(struct drm_device *dev,
  90. void *data, struct drm_file *file_priv);
  91. int drm_mode_mmap_dumb_ioctl(struct drm_device *dev,
  92. void *data, struct drm_file *file_priv);
  93. int drm_mode_destroy_dumb_ioctl(struct drm_device *dev,
  94. void *data, struct drm_file *file_priv);
  95. /* drm_color_mgmt.c */
  96. const char *drm_get_color_encoding_name(enum drm_color_encoding encoding);
  97. const char *drm_get_color_range_name(enum drm_color_range range);
  98. /* IOCTLs */
  99. int drm_mode_gamma_get_ioctl(struct drm_device *dev,
  100. void *data, struct drm_file *file_priv);
  101. int drm_mode_gamma_set_ioctl(struct drm_device *dev,
  102. void *data, struct drm_file *file_priv);
  103. /* drm_property.c */
  104. void drm_property_destroy_user_blobs(struct drm_device *dev,
  105. struct drm_file *file_priv);
  106. bool drm_property_change_valid_get(struct drm_property *property,
  107. uint64_t value,
  108. struct drm_mode_object **ref);
  109. void drm_property_change_valid_put(struct drm_property *property,
  110. struct drm_mode_object *ref);
  111. /* IOCTL */
  112. int drm_mode_getproperty_ioctl(struct drm_device *dev,
  113. void *data, struct drm_file *file_priv);
  114. int drm_mode_getblob_ioctl(struct drm_device *dev,
  115. void *data, struct drm_file *file_priv);
  116. int drm_mode_createblob_ioctl(struct drm_device *dev,
  117. void *data, struct drm_file *file_priv);
  118. int drm_mode_destroyblob_ioctl(struct drm_device *dev,
  119. void *data, struct drm_file *file_priv);
  120. /* drm_mode_object.c */
  121. int __drm_mode_object_add(struct drm_device *dev, struct drm_mode_object *obj,
  122. uint32_t obj_type, bool register_obj,
  123. void (*obj_free_cb)(struct kref *kref));
  124. int drm_mode_object_add(struct drm_device *dev, struct drm_mode_object *obj,
  125. uint32_t obj_type);
  126. void drm_mode_object_register(struct drm_device *dev,
  127. struct drm_mode_object *obj);
  128. struct drm_mode_object *__drm_mode_object_find(struct drm_device *dev,
  129. struct drm_file *file_priv,
  130. uint32_t id, uint32_t type);
  131. void drm_mode_object_unregister(struct drm_device *dev,
  132. struct drm_mode_object *object);
  133. int drm_mode_object_get_properties(struct drm_mode_object *obj, bool atomic,
  134. uint32_t __user *prop_ptr,
  135. uint64_t __user *prop_values,
  136. uint32_t *arg_count_props);
  137. struct drm_property *drm_mode_obj_find_prop_id(struct drm_mode_object *obj,
  138. uint32_t prop_id);
  139. /* IOCTL */
  140. int drm_mode_obj_get_properties_ioctl(struct drm_device *dev, void *data,
  141. struct drm_file *file_priv);
  142. int drm_mode_obj_set_property_ioctl(struct drm_device *dev, void *data,
  143. struct drm_file *file_priv);
  144. /* drm_encoder.c */
  145. int drm_encoder_register_all(struct drm_device *dev);
  146. void drm_encoder_unregister_all(struct drm_device *dev);
  147. /* IOCTL */
  148. int drm_mode_getencoder(struct drm_device *dev,
  149. void *data, struct drm_file *file_priv);
  150. /* drm_connector.c */
  151. void drm_connector_ida_init(void);
  152. void drm_connector_ida_destroy(void);
  153. void drm_connector_unregister_all(struct drm_device *dev);
  154. int drm_connector_register_all(struct drm_device *dev);
  155. int drm_connector_set_obj_prop(struct drm_mode_object *obj,
  156. struct drm_property *property,
  157. uint64_t value);
  158. int drm_connector_create_standard_properties(struct drm_device *dev);
  159. const char *drm_get_connector_force_name(enum drm_connector_force force);
  160. void drm_connector_free_work_fn(struct work_struct *work);
  161. /* IOCTL */
  162. int drm_connector_property_set_ioctl(struct drm_device *dev,
  163. void *data, struct drm_file *file_priv);
  164. int drm_mode_getconnector(struct drm_device *dev,
  165. void *data, struct drm_file *file_priv);
  166. /* drm_framebuffer.c */
  167. struct drm_framebuffer *
  168. drm_internal_framebuffer_create(struct drm_device *dev,
  169. const struct drm_mode_fb_cmd2 *r,
  170. struct drm_file *file_priv);
  171. void drm_framebuffer_free(struct kref *kref);
  172. int drm_framebuffer_check_src_coords(uint32_t src_x, uint32_t src_y,
  173. uint32_t src_w, uint32_t src_h,
  174. const struct drm_framebuffer *fb);
  175. void drm_fb_release(struct drm_file *file_priv);
  176. int drm_mode_addfb(struct drm_device *dev, struct drm_mode_fb_cmd *or,
  177. struct drm_file *file_priv);
  178. int drm_mode_addfb2(struct drm_device *dev,
  179. void *data, struct drm_file *file_priv);
  180. int drm_mode_rmfb(struct drm_device *dev, u32 fb_id,
  181. struct drm_file *file_priv);
  182. /* IOCTL */
  183. int drm_mode_addfb_ioctl(struct drm_device *dev,
  184. void *data, struct drm_file *file_priv);
  185. int drm_mode_addfb2_ioctl(struct drm_device *dev,
  186. void *data, struct drm_file *file_priv);
  187. int drm_mode_rmfb_ioctl(struct drm_device *dev,
  188. void *data, struct drm_file *file_priv);
  189. int drm_mode_getfb(struct drm_device *dev,
  190. void *data, struct drm_file *file_priv);
  191. int drm_mode_getfb2_ioctl(struct drm_device *dev,
  192. void *data, struct drm_file *file_priv);
  193. int drm_mode_dirtyfb_ioctl(struct drm_device *dev,
  194. void *data, struct drm_file *file_priv);
  195. /* drm_atomic.c */
  196. #ifdef CONFIG_DEBUG_FS
  197. struct drm_minor;
  198. void drm_atomic_debugfs_init(struct drm_minor *minor);
  199. #endif
  200. int __drm_atomic_helper_disable_plane(struct drm_plane *plane,
  201. struct drm_plane_state *plane_state);
  202. int __drm_atomic_helper_set_config(struct drm_mode_set *set,
  203. struct drm_atomic_state *state);
  204. void drm_atomic_print_state(const struct drm_atomic_state *state);
  205. /* drm_atomic_uapi.c */
  206. int drm_atomic_connector_commit_dpms(struct drm_atomic_state *state,
  207. struct drm_connector *connector,
  208. int mode);
  209. int drm_atomic_set_property(struct drm_atomic_state *state,
  210. struct drm_file *file_priv,
  211. struct drm_mode_object *obj,
  212. struct drm_property *prop,
  213. uint64_t prop_value);
  214. int drm_atomic_get_property(struct drm_mode_object *obj,
  215. struct drm_property *property, uint64_t *val);
  216. /* IOCTL */
  217. int drm_mode_atomic_ioctl(struct drm_device *dev,
  218. void *data, struct drm_file *file_priv);
  219. /* drm_plane.c */
  220. int drm_plane_register_all(struct drm_device *dev);
  221. void drm_plane_unregister_all(struct drm_device *dev);
  222. int drm_plane_check_pixel_format(struct drm_plane *plane,
  223. u32 format, u64 modifier);
  224. /* drm_bridge.c */
  225. void drm_bridge_detach(struct drm_bridge *bridge);
  226. /* IOCTL */
  227. int drm_mode_getplane_res(struct drm_device *dev, void *data,
  228. struct drm_file *file_priv);
  229. int drm_mode_getplane(struct drm_device *dev,
  230. void *data, struct drm_file *file_priv);
  231. int drm_mode_setplane(struct drm_device *dev,
  232. void *data, struct drm_file *file_priv);
  233. int drm_mode_cursor_ioctl(struct drm_device *dev,
  234. void *data, struct drm_file *file_priv);
  235. int drm_mode_cursor2_ioctl(struct drm_device *dev,
  236. void *data, struct drm_file *file_priv);
  237. int drm_mode_page_flip_ioctl(struct drm_device *dev,
  238. void *data, struct drm_file *file_priv);
  239. /* drm_edid.c */
  240. void drm_mode_fixup_1366x768(struct drm_display_mode *mode);
  241. void drm_reset_display_info(struct drm_connector *connector);
  242. u32 drm_add_display_info(struct drm_connector *connector, const struct edid *edid);
  243. void drm_update_tile_info(struct drm_connector *connector, const struct edid *edid);