Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * Copyright © 2006 Keith Packard
0003  * Copyright © 2007-2008 Dave Airlie
0004  * Copyright © 2007-2008 Intel Corporation
0005  *   Jesse Barnes <jesse.barnes@intel.com>
0006  * Copyright © 2014 Intel Corporation
0007  *   Daniel Vetter <daniel.vetter@ffwll.ch>
0008  * Copyright (c) 2020, The Linux Foundation. All rights reserved.
0009  *
0010  * Permission is hereby granted, free of charge, to any person obtaining a
0011  * copy of this software and associated documentation files (the "Software"),
0012  * to deal in the Software without restriction, including without limitation
0013  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
0014  * and/or sell copies of the Software, and to permit persons to whom the
0015  * Software is furnished to do so, subject to the following conditions:
0016  *
0017  * The above copyright notice and this permission notice shall be included in
0018  * all copies or substantial portions of the Software.
0019  *
0020  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
0021  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
0022  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
0023  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
0024  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
0025  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
0026  * OTHER DEALINGS IN THE SOFTWARE.
0027  */
0028 
0029 /*
0030  * This header file contains mode setting related functions and definitions
0031  * which are only used within the drm module as internal implementation details
0032  * and are not exported to drivers.
0033  */
0034 
0035 #include <linux/types.h>
0036 
0037 enum drm_color_encoding;
0038 enum drm_color_range;
0039 enum drm_connector_force;
0040 enum drm_mode_status;
0041 
0042 struct drm_atomic_state;
0043 struct drm_bridge;
0044 struct drm_connector;
0045 struct drm_crtc;
0046 struct drm_device;
0047 struct drm_display_mode;
0048 struct drm_file;
0049 struct drm_framebuffer;
0050 struct drm_mode_create_dumb;
0051 struct drm_mode_fb_cmd2;
0052 struct drm_mode_fb_cmd;
0053 struct drm_mode_object;
0054 struct drm_mode_set;
0055 struct drm_plane;
0056 struct drm_plane_state;
0057 struct drm_property;
0058 struct edid;
0059 struct kref;
0060 struct work_struct;
0061 struct fwnode_handle;
0062 
0063 /* drm_crtc.c */
0064 int drm_mode_crtc_set_obj_prop(struct drm_mode_object *obj,
0065                    struct drm_property *property,
0066                    uint64_t value);
0067 int drm_crtc_check_viewport(const struct drm_crtc *crtc,
0068                 int x, int y,
0069                 const struct drm_display_mode *mode,
0070                 const struct drm_framebuffer *fb);
0071 int drm_crtc_register_all(struct drm_device *dev);
0072 void drm_crtc_unregister_all(struct drm_device *dev);
0073 int drm_crtc_force_disable(struct drm_crtc *crtc);
0074 
0075 struct dma_fence *drm_crtc_create_fence(struct drm_crtc *crtc);
0076 
0077 struct drm_property *
0078 drm_create_scaling_filter_prop(struct drm_device *dev,
0079                    unsigned int supported_filters);
0080 /* IOCTLs */
0081 int drm_mode_getcrtc(struct drm_device *dev,
0082              void *data, struct drm_file *file_priv);
0083 int drm_mode_setcrtc(struct drm_device *dev,
0084              void *data, struct drm_file *file_priv);
0085 
0086 
0087 /* drm_mode_config.c */
0088 int drm_modeset_register_all(struct drm_device *dev);
0089 void drm_modeset_unregister_all(struct drm_device *dev);
0090 void drm_mode_config_validate(struct drm_device *dev);
0091 
0092 /* drm_modes.c */
0093 const char *drm_get_mode_status_name(enum drm_mode_status status);
0094 
0095 /* IOCTLs */
0096 int drm_mode_getresources(struct drm_device *dev,
0097               void *data, struct drm_file *file_priv);
0098 
0099 
0100 /* drm_dumb_buffers.c */
0101 int drm_mode_create_dumb(struct drm_device *dev,
0102              struct drm_mode_create_dumb *args,
0103              struct drm_file *file_priv);
0104 int drm_mode_destroy_dumb(struct drm_device *dev, u32 handle,
0105               struct drm_file *file_priv);
0106 
0107 /* IOCTLs */
0108 int drm_mode_create_dumb_ioctl(struct drm_device *dev,
0109                    void *data, struct drm_file *file_priv);
0110 int drm_mode_mmap_dumb_ioctl(struct drm_device *dev,
0111                  void *data, struct drm_file *file_priv);
0112 int drm_mode_destroy_dumb_ioctl(struct drm_device *dev,
0113                 void *data, struct drm_file *file_priv);
0114 
0115 /* drm_color_mgmt.c */
0116 const char *drm_get_color_encoding_name(enum drm_color_encoding encoding);
0117 const char *drm_get_color_range_name(enum drm_color_range range);
0118 
0119 /* IOCTLs */
0120 int drm_mode_gamma_get_ioctl(struct drm_device *dev,
0121                  void *data, struct drm_file *file_priv);
0122 int drm_mode_gamma_set_ioctl(struct drm_device *dev,
0123                  void *data, struct drm_file *file_priv);
0124 
0125 /* drm_property.c */
0126 void drm_property_destroy_user_blobs(struct drm_device *dev,
0127                      struct drm_file *file_priv);
0128 bool drm_property_change_valid_get(struct drm_property *property,
0129                    uint64_t value,
0130                    struct drm_mode_object **ref);
0131 void drm_property_change_valid_put(struct drm_property *property,
0132                    struct drm_mode_object *ref);
0133 
0134 /* IOCTL */
0135 int drm_mode_getproperty_ioctl(struct drm_device *dev,
0136                    void *data, struct drm_file *file_priv);
0137 int drm_mode_getblob_ioctl(struct drm_device *dev,
0138                void *data, struct drm_file *file_priv);
0139 int drm_mode_createblob_ioctl(struct drm_device *dev,
0140                   void *data, struct drm_file *file_priv);
0141 int drm_mode_destroyblob_ioctl(struct drm_device *dev,
0142                    void *data, struct drm_file *file_priv);
0143 
0144 /* drm_mode_object.c */
0145 int __drm_mode_object_add(struct drm_device *dev, struct drm_mode_object *obj,
0146               uint32_t obj_type, bool register_obj,
0147               void (*obj_free_cb)(struct kref *kref));
0148 int drm_mode_object_add(struct drm_device *dev, struct drm_mode_object *obj,
0149             uint32_t obj_type);
0150 void drm_mode_object_register(struct drm_device *dev,
0151                   struct drm_mode_object *obj);
0152 struct drm_mode_object *__drm_mode_object_find(struct drm_device *dev,
0153                            struct drm_file *file_priv,
0154                            uint32_t id, uint32_t type);
0155 void drm_mode_object_unregister(struct drm_device *dev,
0156                 struct drm_mode_object *object);
0157 int drm_mode_object_get_properties(struct drm_mode_object *obj, bool atomic,
0158                    uint32_t __user *prop_ptr,
0159                    uint64_t __user *prop_values,
0160                    uint32_t *arg_count_props);
0161 struct drm_property *drm_mode_obj_find_prop_id(struct drm_mode_object *obj,
0162                            uint32_t prop_id);
0163 
0164 /* IOCTL */
0165 
0166 int drm_mode_obj_get_properties_ioctl(struct drm_device *dev, void *data,
0167                       struct drm_file *file_priv);
0168 int drm_mode_obj_set_property_ioctl(struct drm_device *dev, void *data,
0169                     struct drm_file *file_priv);
0170 
0171 /* drm_encoder.c */
0172 int drm_encoder_register_all(struct drm_device *dev);
0173 void drm_encoder_unregister_all(struct drm_device *dev);
0174 
0175 /* IOCTL */
0176 int drm_mode_getencoder(struct drm_device *dev,
0177             void *data, struct drm_file *file_priv);
0178 
0179 /* drm_connector.c */
0180 void drm_connector_ida_init(void);
0181 void drm_connector_ida_destroy(void);
0182 void drm_connector_unregister_all(struct drm_device *dev);
0183 int drm_connector_register_all(struct drm_device *dev);
0184 int drm_connector_set_obj_prop(struct drm_mode_object *obj,
0185                     struct drm_property *property,
0186                     uint64_t value);
0187 int drm_connector_create_standard_properties(struct drm_device *dev);
0188 const char *drm_get_connector_force_name(enum drm_connector_force force);
0189 void drm_connector_free_work_fn(struct work_struct *work);
0190 struct drm_connector *drm_connector_find_by_fwnode(struct fwnode_handle *fwnode);
0191 
0192 /* IOCTL */
0193 int drm_connector_property_set_ioctl(struct drm_device *dev,
0194                      void *data, struct drm_file *file_priv);
0195 int drm_mode_getconnector(struct drm_device *dev,
0196               void *data, struct drm_file *file_priv);
0197 
0198 /* drm_framebuffer.c */
0199 struct drm_framebuffer *
0200 drm_internal_framebuffer_create(struct drm_device *dev,
0201                 const struct drm_mode_fb_cmd2 *r,
0202                 struct drm_file *file_priv);
0203 void drm_framebuffer_free(struct kref *kref);
0204 int drm_framebuffer_check_src_coords(uint32_t src_x, uint32_t src_y,
0205                      uint32_t src_w, uint32_t src_h,
0206                      const struct drm_framebuffer *fb);
0207 void drm_fb_release(struct drm_file *file_priv);
0208 
0209 int drm_mode_addfb(struct drm_device *dev, struct drm_mode_fb_cmd *or,
0210            struct drm_file *file_priv);
0211 int drm_mode_addfb2(struct drm_device *dev,
0212             void *data, struct drm_file *file_priv);
0213 int drm_mode_rmfb(struct drm_device *dev, u32 fb_id,
0214           struct drm_file *file_priv);
0215 
0216 
0217 /* IOCTL */
0218 int drm_mode_addfb_ioctl(struct drm_device *dev,
0219              void *data, struct drm_file *file_priv);
0220 int drm_mode_addfb2_ioctl(struct drm_device *dev,
0221               void *data, struct drm_file *file_priv);
0222 int drm_mode_rmfb_ioctl(struct drm_device *dev,
0223             void *data, struct drm_file *file_priv);
0224 int drm_mode_getfb(struct drm_device *dev,
0225            void *data, struct drm_file *file_priv);
0226 int drm_mode_getfb2_ioctl(struct drm_device *dev,
0227               void *data, struct drm_file *file_priv);
0228 int drm_mode_dirtyfb_ioctl(struct drm_device *dev,
0229                void *data, struct drm_file *file_priv);
0230 
0231 /* drm_atomic.c */
0232 #ifdef CONFIG_DEBUG_FS
0233 struct drm_minor;
0234 void drm_atomic_debugfs_init(struct drm_minor *minor);
0235 #endif
0236 
0237 int __drm_atomic_helper_disable_plane(struct drm_plane *plane,
0238                       struct drm_plane_state *plane_state);
0239 int __drm_atomic_helper_set_config(struct drm_mode_set *set,
0240                    struct drm_atomic_state *state);
0241 
0242 void drm_atomic_print_new_state(const struct drm_atomic_state *state,
0243         struct drm_printer *p);
0244 
0245 /* drm_atomic_uapi.c */
0246 int drm_atomic_connector_commit_dpms(struct drm_atomic_state *state,
0247                      struct drm_connector *connector,
0248                      int mode);
0249 int drm_atomic_set_property(struct drm_atomic_state *state,
0250                 struct drm_file *file_priv,
0251                 struct drm_mode_object *obj,
0252                 struct drm_property *prop,
0253                 uint64_t prop_value);
0254 int drm_atomic_get_property(struct drm_mode_object *obj,
0255                 struct drm_property *property, uint64_t *val);
0256 
0257 /* IOCTL */
0258 int drm_mode_atomic_ioctl(struct drm_device *dev,
0259               void *data, struct drm_file *file_priv);
0260 
0261 
0262 /* drm_plane.c */
0263 int drm_plane_register_all(struct drm_device *dev);
0264 void drm_plane_unregister_all(struct drm_device *dev);
0265 int drm_plane_check_pixel_format(struct drm_plane *plane,
0266                  u32 format, u64 modifier);
0267 struct drm_mode_rect *
0268 __drm_plane_get_damage_clips(const struct drm_plane_state *state);
0269 
0270 /* drm_bridge.c */
0271 void drm_bridge_detach(struct drm_bridge *bridge);
0272 
0273 /* IOCTL */
0274 int drm_mode_getplane_res(struct drm_device *dev, void *data,
0275               struct drm_file *file_priv);
0276 int drm_mode_getplane(struct drm_device *dev,
0277               void *data, struct drm_file *file_priv);
0278 int drm_mode_setplane(struct drm_device *dev,
0279               void *data, struct drm_file *file_priv);
0280 int drm_mode_cursor_ioctl(struct drm_device *dev,
0281               void *data, struct drm_file *file_priv);
0282 int drm_mode_cursor2_ioctl(struct drm_device *dev,
0283                void *data, struct drm_file *file_priv);
0284 int drm_mode_page_flip_ioctl(struct drm_device *dev,
0285                  void *data, struct drm_file *file_priv);
0286 
0287 /* drm_edid.c */
0288 void drm_mode_fixup_1366x768(struct drm_display_mode *mode);
0289 int drm_edid_override_set(struct drm_connector *connector, const void *edid, size_t size);
0290 int drm_edid_override_reset(struct drm_connector *connector);