2014-01-23 14:35:24 +00:00
|
|
|
/*
|
|
|
|
* Copyright © 2006 Keith Packard
|
|
|
|
* Copyright © 2007-2008 Dave Airlie
|
|
|
|
* Copyright © 2007-2008 Intel Corporation
|
|
|
|
* Jesse Barnes <jesse.barnes@intel.com>
|
|
|
|
* Copyright © 2014 Intel Corporation
|
|
|
|
* Daniel Vetter <daniel.vetter@ffwll.ch>
|
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
* copy of this software and associated documentation files (the "Software"),
|
|
|
|
* to deal in the Software without restriction, including without limitation
|
|
|
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
|
|
* and/or sell copies of the Software, and to permit persons to whom the
|
|
|
|
* Software is furnished to do so, subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice shall be included in
|
|
|
|
* all copies or substantial portions of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
|
|
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
|
|
|
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
|
|
|
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
|
|
* OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This header file contains mode setting related functions and definitions
|
|
|
|
* which are only used within the drm module as internal implementation details
|
|
|
|
* and are not exported to drivers.
|
|
|
|
*/
|
|
|
|
|
2019-05-26 17:35:31 +00:00
|
|
|
#include <linux/types.h>
|
|
|
|
|
|
|
|
enum drm_color_encoding;
|
|
|
|
enum drm_color_range;
|
2018-09-05 13:57:07 +00:00
|
|
|
enum drm_connector_force;
|
2019-05-26 17:35:31 +00:00
|
|
|
enum drm_mode_status;
|
2018-09-05 13:57:07 +00:00
|
|
|
|
2019-05-26 17:35:31 +00:00
|
|
|
struct drm_atomic_state;
|
2018-09-05 13:57:07 +00:00
|
|
|
struct drm_bridge;
|
2019-05-26 17:35:31 +00:00
|
|
|
struct drm_connector;
|
|
|
|
struct drm_crtc;
|
|
|
|
struct drm_device;
|
|
|
|
struct drm_display_mode;
|
|
|
|
struct drm_file;
|
|
|
|
struct drm_framebuffer;
|
|
|
|
struct drm_mode_create_dumb;
|
|
|
|
struct drm_mode_fb_cmd2;
|
|
|
|
struct drm_mode_fb_cmd;
|
|
|
|
struct drm_mode_object;
|
2019-05-31 14:01:10 +00:00
|
|
|
struct drm_mode_set;
|
2019-05-26 17:35:31 +00:00
|
|
|
struct drm_plane;
|
2019-05-31 14:01:10 +00:00
|
|
|
struct drm_plane_state;
|
2019-05-26 17:35:31 +00:00
|
|
|
struct drm_property;
|
2018-09-05 13:57:07 +00:00
|
|
|
struct edid;
|
2019-05-26 17:35:31 +00:00
|
|
|
struct kref;
|
|
|
|
struct work_struct;
|
2016-06-21 08:54:13 +00:00
|
|
|
|
|
|
|
/* drm_crtc.c */
|
2016-08-29 08:27:51 +00:00
|
|
|
int drm_mode_crtc_set_obj_prop(struct drm_mode_object *obj,
|
|
|
|
struct drm_property *property,
|
|
|
|
uint64_t value);
|
2016-06-21 08:54:13 +00:00
|
|
|
int drm_crtc_check_viewport(const struct drm_crtc *crtc,
|
|
|
|
int x, int y,
|
|
|
|
const struct drm_display_mode *mode,
|
|
|
|
const struct drm_framebuffer *fb);
|
2016-11-14 11:58:23 +00:00
|
|
|
int drm_crtc_register_all(struct drm_device *dev);
|
|
|
|
void drm_crtc_unregister_all(struct drm_device *dev);
|
2018-12-17 19:42:59 +00:00
|
|
|
int drm_crtc_force_disable(struct drm_crtc *crtc);
|
2016-06-21 08:54:13 +00:00
|
|
|
|
2016-12-06 17:47:17 +00:00
|
|
|
struct dma_fence *drm_crtc_create_fence(struct drm_crtc *crtc);
|
2016-11-15 14:37:08 +00:00
|
|
|
|
2016-06-21 08:54:13 +00:00
|
|
|
/* IOCTLs */
|
|
|
|
int drm_mode_getcrtc(struct drm_device *dev,
|
|
|
|
void *data, struct drm_file *file_priv);
|
|
|
|
int drm_mode_setcrtc(struct drm_device *dev,
|
|
|
|
void *data, struct drm_file *file_priv);
|
2016-09-21 08:59:28 +00:00
|
|
|
|
2016-11-14 11:58:23 +00:00
|
|
|
|
|
|
|
/* drm_mode_config.c */
|
|
|
|
int drm_modeset_register_all(struct drm_device *dev);
|
|
|
|
void drm_modeset_unregister_all(struct drm_device *dev);
|
2020-02-11 16:22:02 +00:00
|
|
|
void drm_mode_config_validate(struct drm_device *dev);
|
2016-11-14 11:58:16 +00:00
|
|
|
|
2018-06-11 19:34:02 +00:00
|
|
|
/* drm_modes.c */
|
|
|
|
const char *drm_get_mode_status_name(enum drm_mode_status status);
|
|
|
|
|
2016-11-14 11:58:23 +00:00
|
|
|
/* IOCTLs */
|
|
|
|
int drm_mode_getresources(struct drm_device *dev,
|
|
|
|
void *data, struct drm_file *file_priv);
|
|
|
|
|
|
|
|
|
|
|
|
/* drm_dumb_buffers.c */
|
2018-06-18 14:17:30 +00:00
|
|
|
int drm_mode_create_dumb(struct drm_device *dev,
|
|
|
|
struct drm_mode_create_dumb *args,
|
|
|
|
struct drm_file *file_priv);
|
|
|
|
int drm_mode_destroy_dumb(struct drm_device *dev, u32 handle,
|
|
|
|
struct drm_file *file_priv);
|
|
|
|
|
2016-11-14 11:58:16 +00:00
|
|
|
/* IOCTLs */
|
|
|
|
int drm_mode_create_dumb_ioctl(struct drm_device *dev,
|
|
|
|
void *data, struct drm_file *file_priv);
|
|
|
|
int drm_mode_mmap_dumb_ioctl(struct drm_device *dev,
|
|
|
|
void *data, struct drm_file *file_priv);
|
|
|
|
int drm_mode_destroy_dumb_ioctl(struct drm_device *dev,
|
|
|
|
void *data, struct drm_file *file_priv);
|
|
|
|
|
2016-09-21 08:59:28 +00:00
|
|
|
/* drm_color_mgmt.c */
|
2018-02-19 20:28:46 +00:00
|
|
|
const char *drm_get_color_encoding_name(enum drm_color_encoding encoding);
|
|
|
|
const char *drm_get_color_range_name(enum drm_color_range range);
|
2016-09-21 08:59:28 +00:00
|
|
|
|
|
|
|
/* IOCTLs */
|
2016-08-29 08:27:55 +00:00
|
|
|
int drm_mode_gamma_get_ioctl(struct drm_device *dev,
|
|
|
|
void *data, struct drm_file *file_priv);
|
|
|
|
int drm_mode_gamma_set_ioctl(struct drm_device *dev,
|
|
|
|
void *data, struct drm_file *file_priv);
|
|
|
|
|
|
|
|
/* drm_property.c */
|
|
|
|
void drm_property_destroy_user_blobs(struct drm_device *dev,
|
|
|
|
struct drm_file *file_priv);
|
|
|
|
bool drm_property_change_valid_get(struct drm_property *property,
|
|
|
|
uint64_t value,
|
|
|
|
struct drm_mode_object **ref);
|
|
|
|
void drm_property_change_valid_put(struct drm_property *property,
|
|
|
|
struct drm_mode_object *ref);
|
|
|
|
|
|
|
|
/* IOCTL */
|
2016-06-21 08:54:13 +00:00
|
|
|
int drm_mode_getproperty_ioctl(struct drm_device *dev,
|
|
|
|
void *data, struct drm_file *file_priv);
|
|
|
|
int drm_mode_getblob_ioctl(struct drm_device *dev,
|
|
|
|
void *data, struct drm_file *file_priv);
|
|
|
|
int drm_mode_createblob_ioctl(struct drm_device *dev,
|
|
|
|
void *data, struct drm_file *file_priv);
|
|
|
|
int drm_mode_destroyblob_ioctl(struct drm_device *dev,
|
|
|
|
void *data, struct drm_file *file_priv);
|
2014-01-23 14:35:24 +00:00
|
|
|
|
2016-08-29 08:27:51 +00:00
|
|
|
/* drm_mode_object.c */
|
2017-02-28 14:46:37 +00:00
|
|
|
int __drm_mode_object_add(struct drm_device *dev, struct drm_mode_object *obj,
|
|
|
|
uint32_t obj_type, bool register_obj,
|
|
|
|
void (*obj_free_cb)(struct kref *kref));
|
|
|
|
int drm_mode_object_add(struct drm_device *dev, struct drm_mode_object *obj,
|
|
|
|
uint32_t obj_type);
|
2016-08-29 08:27:51 +00:00
|
|
|
void drm_mode_object_register(struct drm_device *dev,
|
|
|
|
struct drm_mode_object *obj);
|
|
|
|
struct drm_mode_object *__drm_mode_object_find(struct drm_device *dev,
|
2017-03-15 06:25:07 +00:00
|
|
|
struct drm_file *file_priv,
|
2016-08-29 08:27:51 +00:00
|
|
|
uint32_t id, uint32_t type);
|
|
|
|
void drm_mode_object_unregister(struct drm_device *dev,
|
|
|
|
struct drm_mode_object *object);
|
|
|
|
int drm_mode_object_get_properties(struct drm_mode_object *obj, bool atomic,
|
|
|
|
uint32_t __user *prop_ptr,
|
|
|
|
uint64_t __user *prop_values,
|
|
|
|
uint32_t *arg_count_props);
|
2016-09-08 10:30:01 +00:00
|
|
|
struct drm_property *drm_mode_obj_find_prop_id(struct drm_mode_object *obj,
|
|
|
|
uint32_t prop_id);
|
2016-08-29 08:27:51 +00:00
|
|
|
|
|
|
|
/* IOCTL */
|
|
|
|
|
|
|
|
int drm_mode_obj_get_properties_ioctl(struct drm_device *dev, void *data,
|
|
|
|
struct drm_file *file_priv);
|
|
|
|
int drm_mode_obj_set_property_ioctl(struct drm_device *dev, void *data,
|
|
|
|
struct drm_file *file_priv);
|
|
|
|
|
2016-08-29 08:27:49 +00:00
|
|
|
/* drm_encoder.c */
|
|
|
|
int drm_encoder_register_all(struct drm_device *dev);
|
|
|
|
void drm_encoder_unregister_all(struct drm_device *dev);
|
|
|
|
|
|
|
|
/* IOCTL */
|
|
|
|
int drm_mode_getencoder(struct drm_device *dev,
|
|
|
|
void *data, struct drm_file *file_priv);
|
|
|
|
|
2016-08-12 20:48:50 +00:00
|
|
|
/* drm_connector.c */
|
|
|
|
void drm_connector_ida_init(void);
|
|
|
|
void drm_connector_ida_destroy(void);
|
|
|
|
void drm_connector_unregister_all(struct drm_device *dev);
|
|
|
|
int drm_connector_register_all(struct drm_device *dev);
|
2018-07-09 08:40:08 +00:00
|
|
|
int drm_connector_set_obj_prop(struct drm_mode_object *obj,
|
2016-08-12 20:48:50 +00:00
|
|
|
struct drm_property *property,
|
|
|
|
uint64_t value);
|
|
|
|
int drm_connector_create_standard_properties(struct drm_device *dev);
|
2017-02-20 08:51:48 +00:00
|
|
|
const char *drm_get_connector_force_name(enum drm_connector_force force);
|
2017-12-13 12:49:36 +00:00
|
|
|
void drm_connector_free_work_fn(struct work_struct *work);
|
2016-08-12 20:48:50 +00:00
|
|
|
|
|
|
|
/* IOCTL */
|
2018-07-09 08:40:08 +00:00
|
|
|
int drm_connector_property_set_ioctl(struct drm_device *dev,
|
|
|
|
void *data, struct drm_file *file_priv);
|
2016-08-12 20:48:50 +00:00
|
|
|
int drm_mode_getconnector(struct drm_device *dev,
|
|
|
|
void *data, struct drm_file *file_priv);
|
|
|
|
|
2016-08-15 14:07:02 +00:00
|
|
|
/* drm_framebuffer.c */
|
|
|
|
struct drm_framebuffer *
|
|
|
|
drm_internal_framebuffer_create(struct drm_device *dev,
|
|
|
|
const struct drm_mode_fb_cmd2 *r,
|
|
|
|
struct drm_file *file_priv);
|
|
|
|
void drm_framebuffer_free(struct kref *kref);
|
2016-09-21 08:59:24 +00:00
|
|
|
int drm_framebuffer_check_src_coords(uint32_t src_x, uint32_t src_y,
|
|
|
|
uint32_t src_w, uint32_t src_h,
|
|
|
|
const struct drm_framebuffer *fb);
|
2016-11-14 11:58:23 +00:00
|
|
|
void drm_fb_release(struct drm_file *file_priv);
|
|
|
|
|
2018-06-18 14:17:30 +00:00
|
|
|
int drm_mode_addfb(struct drm_device *dev, struct drm_mode_fb_cmd *or,
|
|
|
|
struct drm_file *file_priv);
|
2018-09-07 07:32:13 +00:00
|
|
|
int drm_mode_addfb2(struct drm_device *dev,
|
|
|
|
void *data, struct drm_file *file_priv);
|
2018-06-18 14:17:30 +00:00
|
|
|
int drm_mode_rmfb(struct drm_device *dev, u32 fb_id,
|
|
|
|
struct drm_file *file_priv);
|
|
|
|
|
2016-08-15 14:07:02 +00:00
|
|
|
|
|
|
|
/* IOCTL */
|
2018-06-18 14:17:30 +00:00
|
|
|
int drm_mode_addfb_ioctl(struct drm_device *dev,
|
|
|
|
void *data, struct drm_file *file_priv);
|
2018-09-07 07:32:13 +00:00
|
|
|
int drm_mode_addfb2_ioctl(struct drm_device *dev,
|
|
|
|
void *data, struct drm_file *file_priv);
|
2018-06-18 14:17:30 +00:00
|
|
|
int drm_mode_rmfb_ioctl(struct drm_device *dev,
|
|
|
|
void *data, struct drm_file *file_priv);
|
2016-08-15 14:07:02 +00:00
|
|
|
int drm_mode_getfb(struct drm_device *dev,
|
|
|
|
void *data, struct drm_file *file_priv);
|
2019-12-17 03:46:43 +00:00
|
|
|
int drm_mode_getfb2_ioctl(struct drm_device *dev,
|
|
|
|
void *data, struct drm_file *file_priv);
|
2016-08-15 14:07:02 +00:00
|
|
|
int drm_mode_dirtyfb_ioctl(struct drm_device *dev,
|
|
|
|
void *data, struct drm_file *file_priv);
|
|
|
|
|
2014-12-18 21:49:02 +00:00
|
|
|
/* drm_atomic.c */
|
2016-12-13 23:08:03 +00:00
|
|
|
#ifdef CONFIG_DEBUG_FS
|
|
|
|
struct drm_minor;
|
2020-03-10 13:31:21 +00:00
|
|
|
void drm_atomic_debugfs_init(struct drm_minor *minor);
|
2016-12-13 23:08:03 +00:00
|
|
|
#endif
|
|
|
|
|
2019-05-31 14:01:10 +00:00
|
|
|
int __drm_atomic_helper_disable_plane(struct drm_plane *plane,
|
|
|
|
struct drm_plane_state *plane_state);
|
|
|
|
int __drm_atomic_helper_set_config(struct drm_mode_set *set,
|
|
|
|
struct drm_atomic_state *state);
|
|
|
|
|
2018-09-05 13:57:11 +00:00
|
|
|
void drm_atomic_print_state(const struct drm_atomic_state *state);
|
|
|
|
|
|
|
|
/* drm_atomic_uapi.c */
|
2017-07-25 12:02:04 +00:00
|
|
|
int drm_atomic_connector_commit_dpms(struct drm_atomic_state *state,
|
|
|
|
struct drm_connector *connector,
|
|
|
|
int mode);
|
|
|
|
int drm_atomic_set_property(struct drm_atomic_state *state,
|
2019-02-28 14:49:09 +00:00
|
|
|
struct drm_file *file_priv,
|
2017-07-25 12:02:04 +00:00
|
|
|
struct drm_mode_object *obj,
|
|
|
|
struct drm_property *prop,
|
|
|
|
uint64_t prop_value);
|
2014-12-18 21:49:02 +00:00
|
|
|
int drm_atomic_get_property(struct drm_mode_object *obj,
|
2016-06-21 08:54:13 +00:00
|
|
|
struct drm_property *property, uint64_t *val);
|
2018-09-05 13:57:11 +00:00
|
|
|
|
|
|
|
/* IOCTL */
|
2014-12-18 21:49:02 +00:00
|
|
|
int drm_mode_atomic_ioctl(struct drm_device *dev,
|
|
|
|
void *data, struct drm_file *file_priv);
|
|
|
|
|
2016-09-21 08:59:24 +00:00
|
|
|
|
|
|
|
/* drm_plane.c */
|
|
|
|
int drm_plane_register_all(struct drm_device *dev);
|
|
|
|
void drm_plane_unregister_all(struct drm_device *dev);
|
2017-12-22 19:22:30 +00:00
|
|
|
int drm_plane_check_pixel_format(struct drm_plane *plane,
|
|
|
|
u32 format, u64 modifier);
|
2016-09-21 08:59:24 +00:00
|
|
|
|
2016-11-28 16:32:05 +00:00
|
|
|
/* drm_bridge.c */
|
|
|
|
void drm_bridge_detach(struct drm_bridge *bridge);
|
|
|
|
|
2016-09-21 08:59:24 +00:00
|
|
|
/* IOCTL */
|
|
|
|
int drm_mode_getplane_res(struct drm_device *dev, void *data,
|
|
|
|
struct drm_file *file_priv);
|
|
|
|
int drm_mode_getplane(struct drm_device *dev,
|
|
|
|
void *data, struct drm_file *file_priv);
|
|
|
|
int drm_mode_setplane(struct drm_device *dev,
|
|
|
|
void *data, struct drm_file *file_priv);
|
|
|
|
int drm_mode_cursor_ioctl(struct drm_device *dev,
|
|
|
|
void *data, struct drm_file *file_priv);
|
|
|
|
int drm_mode_cursor2_ioctl(struct drm_device *dev,
|
|
|
|
void *data, struct drm_file *file_priv);
|
|
|
|
int drm_mode_page_flip_ioctl(struct drm_device *dev,
|
|
|
|
void *data, struct drm_file *file_priv);
|
2017-01-17 16:43:29 +00:00
|
|
|
|
|
|
|
/* drm_edid.c */
|
|
|
|
void drm_mode_fixup_1366x768(struct drm_display_mode *mode);
|
2018-04-24 14:22:42 +00:00
|
|
|
void drm_reset_display_info(struct drm_connector *connector);
|
|
|
|
u32 drm_add_display_info(struct drm_connector *connector, const struct edid *edid);
|
2020-03-13 16:20:54 +00:00
|
|
|
void drm_update_tile_info(struct drm_connector *connector, const struct edid *edid);
|