1ba55f2f5SFrançois Tigeot /* 2ba55f2f5SFrançois Tigeot * Copyright © 2006 Keith Packard 3ba55f2f5SFrançois Tigeot * Copyright © 2007-2008 Dave Airlie 4ba55f2f5SFrançois Tigeot * Copyright © 2007-2008 Intel Corporation 5ba55f2f5SFrançois Tigeot * Jesse Barnes <jesse.barnes@intel.com> 6ba55f2f5SFrançois Tigeot * Copyright © 2014 Intel Corporation 7ba55f2f5SFrançois Tigeot * Daniel Vetter <daniel.vetter@ffwll.ch> 8ba55f2f5SFrançois Tigeot * 9ba55f2f5SFrançois Tigeot * Permission is hereby granted, free of charge, to any person obtaining a 10ba55f2f5SFrançois Tigeot * copy of this software and associated documentation files (the "Software"), 11ba55f2f5SFrançois Tigeot * to deal in the Software without restriction, including without limitation 12ba55f2f5SFrançois Tigeot * the rights to use, copy, modify, merge, publish, distribute, sublicense, 13ba55f2f5SFrançois Tigeot * and/or sell copies of the Software, and to permit persons to whom the 14ba55f2f5SFrançois Tigeot * Software is furnished to do so, subject to the following conditions: 15ba55f2f5SFrançois Tigeot * 16ba55f2f5SFrançois Tigeot * The above copyright notice and this permission notice shall be included in 17ba55f2f5SFrançois Tigeot * all copies or substantial portions of the Software. 18ba55f2f5SFrançois Tigeot * 19ba55f2f5SFrançois Tigeot * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20ba55f2f5SFrançois Tigeot * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21ba55f2f5SFrançois Tigeot * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 22ba55f2f5SFrançois Tigeot * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR 23ba55f2f5SFrançois Tigeot * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 24ba55f2f5SFrançois Tigeot * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 25ba55f2f5SFrançois Tigeot * OTHER DEALINGS IN THE SOFTWARE. 26ba55f2f5SFrançois Tigeot */ 27ba55f2f5SFrançois Tigeot 28ba55f2f5SFrançois Tigeot /* 29ba55f2f5SFrançois Tigeot * This header file contains mode setting related functions and definitions 30ba55f2f5SFrançois Tigeot * which are only used within the drm module as internal implementation details 31ba55f2f5SFrançois Tigeot * and are not exported to drivers. 32ba55f2f5SFrançois Tigeot */ 33ba55f2f5SFrançois Tigeot 341dedbd3bSFrançois Tigeot 351dedbd3bSFrançois Tigeot /* drm_crtc.c */ 361dedbd3bSFrançois Tigeot int drm_mode_crtc_set_obj_prop(struct drm_mode_object *obj, 371dedbd3bSFrançois Tigeot struct drm_property *property, 381dedbd3bSFrançois Tigeot uint64_t value); 391dedbd3bSFrançois Tigeot int drm_crtc_check_viewport(const struct drm_crtc *crtc, 401dedbd3bSFrançois Tigeot int x, int y, 411dedbd3bSFrançois Tigeot const struct drm_display_mode *mode, 421dedbd3bSFrançois Tigeot const struct drm_framebuffer *fb); 43*4be47400SFrançois Tigeot int drm_crtc_register_all(struct drm_device *dev); 44*4be47400SFrançois Tigeot void drm_crtc_unregister_all(struct drm_device *dev); 451dedbd3bSFrançois Tigeot 46*4be47400SFrançois Tigeot struct dma_fence *drm_crtc_create_fence(struct drm_crtc *crtc); 471dedbd3bSFrançois Tigeot 48*4be47400SFrançois Tigeot /* IOCTLs */ 49*4be47400SFrançois Tigeot int drm_mode_getcrtc(struct drm_device *dev, 50*4be47400SFrançois Tigeot void *data, struct drm_file *file_priv); 51*4be47400SFrançois Tigeot int drm_mode_setcrtc(struct drm_device *dev, 52*4be47400SFrançois Tigeot void *data, struct drm_file *file_priv); 53*4be47400SFrançois Tigeot 54*4be47400SFrançois Tigeot 55*4be47400SFrançois Tigeot /* drm_mode_config.c */ 56*4be47400SFrançois Tigeot int drm_modeset_register_all(struct drm_device *dev); 57*4be47400SFrançois Tigeot void drm_modeset_unregister_all(struct drm_device *dev); 58*4be47400SFrançois Tigeot 59*4be47400SFrançois Tigeot /* IOCTLs */ 60*4be47400SFrançois Tigeot int drm_mode_getresources(struct drm_device *dev, 61*4be47400SFrançois Tigeot void *data, struct drm_file *file_priv); 62*4be47400SFrançois Tigeot 63*4be47400SFrançois Tigeot 64*4be47400SFrançois Tigeot /* drm_dumb_buffers.c */ 65*4be47400SFrançois Tigeot /* IOCTLs */ 661dedbd3bSFrançois Tigeot int drm_mode_create_dumb_ioctl(struct drm_device *dev, 671dedbd3bSFrançois Tigeot void *data, struct drm_file *file_priv); 681dedbd3bSFrançois Tigeot int drm_mode_mmap_dumb_ioctl(struct drm_device *dev, 691dedbd3bSFrançois Tigeot void *data, struct drm_file *file_priv); 701dedbd3bSFrançois Tigeot int drm_mode_destroy_dumb_ioctl(struct drm_device *dev, 711dedbd3bSFrançois Tigeot void *data, struct drm_file *file_priv); 721dedbd3bSFrançois Tigeot 731dedbd3bSFrançois Tigeot /* drm_color_mgmt.c */ 741dedbd3bSFrançois Tigeot 751dedbd3bSFrançois Tigeot /* IOCTLs */ 761dedbd3bSFrançois Tigeot int drm_mode_gamma_get_ioctl(struct drm_device *dev, 771dedbd3bSFrançois Tigeot void *data, struct drm_file *file_priv); 781dedbd3bSFrançois Tigeot int drm_mode_gamma_set_ioctl(struct drm_device *dev, 791dedbd3bSFrançois Tigeot void *data, struct drm_file *file_priv); 801dedbd3bSFrançois Tigeot 811dedbd3bSFrançois Tigeot /* drm_property.c */ 821dedbd3bSFrançois Tigeot void drm_property_destroy_user_blobs(struct drm_device *dev, 831dedbd3bSFrançois Tigeot struct drm_file *file_priv); 841dedbd3bSFrançois Tigeot bool drm_property_change_valid_get(struct drm_property *property, 851dedbd3bSFrançois Tigeot uint64_t value, 861dedbd3bSFrançois Tigeot struct drm_mode_object **ref); 871dedbd3bSFrançois Tigeot void drm_property_change_valid_put(struct drm_property *property, 881dedbd3bSFrançois Tigeot struct drm_mode_object *ref); 891dedbd3bSFrançois Tigeot 901dedbd3bSFrançois Tigeot /* IOCTL */ 911dedbd3bSFrançois Tigeot int drm_mode_getproperty_ioctl(struct drm_device *dev, 921dedbd3bSFrançois Tigeot void *data, struct drm_file *file_priv); 931dedbd3bSFrançois Tigeot int drm_mode_getblob_ioctl(struct drm_device *dev, 941dedbd3bSFrançois Tigeot void *data, struct drm_file *file_priv); 951dedbd3bSFrançois Tigeot int drm_mode_createblob_ioctl(struct drm_device *dev, 961dedbd3bSFrançois Tigeot void *data, struct drm_file *file_priv); 971dedbd3bSFrançois Tigeot int drm_mode_destroyblob_ioctl(struct drm_device *dev, 981dedbd3bSFrançois Tigeot void *data, struct drm_file *file_priv); 991dedbd3bSFrançois Tigeot 1001dedbd3bSFrançois Tigeot /* drm_mode_object.c */ 1011dedbd3bSFrançois Tigeot int drm_mode_object_get_reg(struct drm_device *dev, 1021dedbd3bSFrançois Tigeot struct drm_mode_object *obj, 1031dedbd3bSFrançois Tigeot uint32_t obj_type, 1041dedbd3bSFrançois Tigeot bool register_obj, 1051dedbd3bSFrançois Tigeot void (*obj_free_cb)(struct kref *kref)); 1061dedbd3bSFrançois Tigeot void drm_mode_object_register(struct drm_device *dev, 1071dedbd3bSFrançois Tigeot struct drm_mode_object *obj); 108ba55f2f5SFrançois Tigeot int drm_mode_object_get(struct drm_device *dev, 109ba55f2f5SFrançois Tigeot struct drm_mode_object *obj, uint32_t obj_type); 1101dedbd3bSFrançois Tigeot struct drm_mode_object *__drm_mode_object_find(struct drm_device *dev, 1111dedbd3bSFrançois Tigeot uint32_t id, uint32_t type); 1128621f407SFrançois Tigeot void drm_mode_object_unregister(struct drm_device *dev, 113ba55f2f5SFrançois Tigeot struct drm_mode_object *object); 1141dedbd3bSFrançois Tigeot int drm_mode_object_get_properties(struct drm_mode_object *obj, bool atomic, 1151dedbd3bSFrançois Tigeot uint32_t __user *prop_ptr, 1161dedbd3bSFrançois Tigeot uint64_t __user *prop_values, 1171dedbd3bSFrançois Tigeot uint32_t *arg_count_props); 1181dedbd3bSFrançois Tigeot struct drm_property *drm_mode_obj_find_prop_id(struct drm_mode_object *obj, 1191dedbd3bSFrançois Tigeot uint32_t prop_id); 1201dedbd3bSFrançois Tigeot 1211dedbd3bSFrançois Tigeot /* IOCTL */ 1221dedbd3bSFrançois Tigeot 1231dedbd3bSFrançois Tigeot int drm_mode_obj_get_properties_ioctl(struct drm_device *dev, void *data, 1241dedbd3bSFrançois Tigeot struct drm_file *file_priv); 1251dedbd3bSFrançois Tigeot int drm_mode_obj_set_property_ioctl(struct drm_device *dev, void *data, 1261dedbd3bSFrançois Tigeot struct drm_file *file_priv); 1271dedbd3bSFrançois Tigeot 1281dedbd3bSFrançois Tigeot /* drm_encoder.c */ 1291dedbd3bSFrançois Tigeot int drm_encoder_register_all(struct drm_device *dev); 1301dedbd3bSFrançois Tigeot void drm_encoder_unregister_all(struct drm_device *dev); 1311dedbd3bSFrançois Tigeot 1321dedbd3bSFrançois Tigeot /* IOCTL */ 1331dedbd3bSFrançois Tigeot int drm_mode_getencoder(struct drm_device *dev, 1341dedbd3bSFrançois Tigeot void *data, struct drm_file *file_priv); 1351dedbd3bSFrançois Tigeot 1361dedbd3bSFrançois Tigeot /* drm_connector.c */ 1371dedbd3bSFrançois Tigeot void drm_connector_ida_init(void); 1381dedbd3bSFrançois Tigeot void drm_connector_ida_destroy(void); 1391dedbd3bSFrançois Tigeot void drm_connector_unregister_all(struct drm_device *dev); 1401dedbd3bSFrançois Tigeot int drm_connector_register_all(struct drm_device *dev); 1411dedbd3bSFrançois Tigeot int drm_mode_connector_set_obj_prop(struct drm_mode_object *obj, 1421dedbd3bSFrançois Tigeot struct drm_property *property, 1431dedbd3bSFrançois Tigeot uint64_t value); 1441dedbd3bSFrançois Tigeot int drm_connector_create_standard_properties(struct drm_device *dev); 1451dedbd3bSFrançois Tigeot 1461dedbd3bSFrançois Tigeot /* IOCTL */ 1471dedbd3bSFrançois Tigeot int drm_mode_connector_property_set_ioctl(struct drm_device *dev, 1481dedbd3bSFrançois Tigeot void *data, struct drm_file *file_priv); 1491dedbd3bSFrançois Tigeot int drm_mode_getconnector(struct drm_device *dev, 1501dedbd3bSFrançois Tigeot void *data, struct drm_file *file_priv); 1511dedbd3bSFrançois Tigeot 1521dedbd3bSFrançois Tigeot /* drm_framebuffer.c */ 1531dedbd3bSFrançois Tigeot struct drm_framebuffer * 1541dedbd3bSFrançois Tigeot drm_internal_framebuffer_create(struct drm_device *dev, 1551dedbd3bSFrançois Tigeot const struct drm_mode_fb_cmd2 *r, 1561dedbd3bSFrançois Tigeot struct drm_file *file_priv); 1571dedbd3bSFrançois Tigeot void drm_framebuffer_free(struct kref *kref); 1581dedbd3bSFrançois Tigeot int drm_framebuffer_check_src_coords(uint32_t src_x, uint32_t src_y, 1591dedbd3bSFrançois Tigeot uint32_t src_w, uint32_t src_h, 1601dedbd3bSFrançois Tigeot const struct drm_framebuffer *fb); 161*4be47400SFrançois Tigeot void drm_fb_release(struct drm_file *file_priv); 162*4be47400SFrançois Tigeot 1631dedbd3bSFrançois Tigeot 1641dedbd3bSFrançois Tigeot /* IOCTL */ 1651dedbd3bSFrançois Tigeot int drm_mode_addfb(struct drm_device *dev, 1661dedbd3bSFrançois Tigeot void *data, struct drm_file *file_priv); 1671dedbd3bSFrançois Tigeot int drm_mode_addfb2(struct drm_device *dev, 1681dedbd3bSFrançois Tigeot void *data, struct drm_file *file_priv); 1691dedbd3bSFrançois Tigeot int drm_mode_rmfb(struct drm_device *dev, 1701dedbd3bSFrançois Tigeot void *data, struct drm_file *file_priv); 1711dedbd3bSFrançois Tigeot int drm_mode_getfb(struct drm_device *dev, 1721dedbd3bSFrançois Tigeot void *data, struct drm_file *file_priv); 1731dedbd3bSFrançois Tigeot int drm_mode_dirtyfb_ioctl(struct drm_device *dev, 1741dedbd3bSFrançois Tigeot void *data, struct drm_file *file_priv); 175ba55f2f5SFrançois Tigeot 1762c9916cdSFrançois Tigeot /* drm_atomic.c */ 1772c9916cdSFrançois Tigeot int drm_atomic_get_property(struct drm_mode_object *obj, 1782c9916cdSFrançois Tigeot struct drm_property *property, uint64_t *val); 1792c9916cdSFrançois Tigeot int drm_mode_atomic_ioctl(struct drm_device *dev, 1802c9916cdSFrançois Tigeot void *data, struct drm_file *file_priv); 1812c9916cdSFrançois Tigeot 1821dedbd3bSFrançois Tigeot 1831dedbd3bSFrançois Tigeot /* drm_plane.c */ 1841dedbd3bSFrançois Tigeot int drm_plane_register_all(struct drm_device *dev); 1851dedbd3bSFrançois Tigeot void drm_plane_unregister_all(struct drm_device *dev); 1861dedbd3bSFrançois Tigeot int drm_plane_check_pixel_format(const struct drm_plane *plane, 1871dedbd3bSFrançois Tigeot u32 format); 1881dedbd3bSFrançois Tigeot 1891dedbd3bSFrançois Tigeot /* IOCTL */ 1901dedbd3bSFrançois Tigeot int drm_mode_getplane_res(struct drm_device *dev, void *data, 1911dedbd3bSFrançois Tigeot struct drm_file *file_priv); 1921dedbd3bSFrançois Tigeot int drm_mode_getplane(struct drm_device *dev, 1931dedbd3bSFrançois Tigeot void *data, struct drm_file *file_priv); 1941dedbd3bSFrançois Tigeot int drm_mode_setplane(struct drm_device *dev, 1951dedbd3bSFrançois Tigeot void *data, struct drm_file *file_priv); 1961dedbd3bSFrançois Tigeot int drm_mode_cursor_ioctl(struct drm_device *dev, 1971dedbd3bSFrançois Tigeot void *data, struct drm_file *file_priv); 1981dedbd3bSFrançois Tigeot int drm_mode_cursor2_ioctl(struct drm_device *dev, 1991dedbd3bSFrançois Tigeot void *data, struct drm_file *file_priv); 2001dedbd3bSFrançois Tigeot int drm_mode_page_flip_ioctl(struct drm_device *dev, 2011dedbd3bSFrançois Tigeot void *data, struct drm_file *file_priv); 202