xref: /dflybsd-src/sys/dev/drm/drm_internal.h (revision 1dedbd3b06c68f627b7825694444529d5eb2b1bf)
11b13d190SFrançois Tigeot /*
21b13d190SFrançois Tigeot  * Copyright © 2014 Intel Corporation
31b13d190SFrançois Tigeot  *   Daniel Vetter <daniel.vetter@ffwll.ch>
41b13d190SFrançois Tigeot  *
51b13d190SFrançois Tigeot  * Permission is hereby granted, free of charge, to any person obtaining a
61b13d190SFrançois Tigeot  * copy of this software and associated documentation files (the "Software"),
71b13d190SFrançois Tigeot  * to deal in the Software without restriction, including without limitation
81b13d190SFrançois Tigeot  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
91b13d190SFrançois Tigeot  * and/or sell copies of the Software, and to permit persons to whom the
101b13d190SFrançois Tigeot  * Software is furnished to do so, subject to the following conditions:
111b13d190SFrançois Tigeot  *
121b13d190SFrançois Tigeot  * The above copyright notice and this permission notice shall be included in
131b13d190SFrançois Tigeot  * all copies or substantial portions of the Software.
141b13d190SFrançois Tigeot  *
151b13d190SFrançois Tigeot  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
161b13d190SFrançois Tigeot  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
171b13d190SFrançois Tigeot  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
181b13d190SFrançois Tigeot  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
191b13d190SFrançois Tigeot  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
201b13d190SFrançois Tigeot  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
211b13d190SFrançois Tigeot  * OTHER DEALINGS IN THE SOFTWARE.
221b13d190SFrançois Tigeot  */
231b13d190SFrançois Tigeot 
24*1dedbd3bSFrançois Tigeot #define DRM_IF_MAJOR 1
25*1dedbd3bSFrançois Tigeot #define DRM_IF_MINOR 4
26*1dedbd3bSFrançois Tigeot 
272c9916cdSFrançois Tigeot /* drm_irq.c */
282c9916cdSFrançois Tigeot extern unsigned int drm_timestamp_monotonic;
292c9916cdSFrançois Tigeot 
302c9916cdSFrançois Tigeot /* drm_fops.c */
312c9916cdSFrançois Tigeot extern struct lock drm_global_mutex;
328621f407SFrançois Tigeot void drm_lastclose(struct drm_device *dev);
332c9916cdSFrançois Tigeot 
342c9916cdSFrançois Tigeot /* drm_pci.c */
352c9916cdSFrançois Tigeot int drm_irq_by_busid(struct drm_device *dev, void *data,
362c9916cdSFrançois Tigeot 		     struct drm_file *file_priv);
378a697a22SFrançois Tigeot int drm_getpciinfo(struct drm_device *dev, void *data,
388a697a22SFrançois Tigeot 		   struct drm_file *file_priv);
392c9916cdSFrançois Tigeot 
402c9916cdSFrançois Tigeot /* drm_prime.c */
412c9916cdSFrançois Tigeot int drm_prime_handle_to_fd_ioctl(struct drm_device *dev, void *data,
422c9916cdSFrançois Tigeot 				 struct drm_file *file_priv);
432c9916cdSFrançois Tigeot int drm_prime_fd_to_handle_ioctl(struct drm_device *dev, void *data,
442c9916cdSFrançois Tigeot 				 struct drm_file *file_priv);
452c9916cdSFrançois Tigeot 
462c9916cdSFrançois Tigeot void drm_prime_init_file_private(struct drm_prime_file_private *prime_fpriv);
472c9916cdSFrançois Tigeot void drm_prime_destroy_file_private(struct drm_prime_file_private *prime_fpriv);
482c9916cdSFrançois Tigeot void drm_prime_remove_buf_handle_locked(struct drm_prime_file_private *prime_fpriv,
492c9916cdSFrançois Tigeot 					struct dma_buf *dma_buf);
502c9916cdSFrançois Tigeot 
512c9916cdSFrançois Tigeot /* drm_info.c */
522c9916cdSFrançois Tigeot int drm_name_info(struct seq_file *m, void *data);
532c9916cdSFrançois Tigeot int drm_clients_info(struct seq_file *m, void* data);
542c9916cdSFrançois Tigeot int drm_gem_name_info(struct seq_file *m, void *data);
552c9916cdSFrançois Tigeot 
562c9916cdSFrançois Tigeot /* drm_irq.c */
572c9916cdSFrançois Tigeot int drm_control(struct drm_device *dev, void *data,
582c9916cdSFrançois Tigeot 		struct drm_file *file_priv);
592c9916cdSFrançois Tigeot int drm_modeset_ctl(struct drm_device *dev, void *data,
602c9916cdSFrançois Tigeot 		    struct drm_file *file_priv);
612c9916cdSFrançois Tigeot 
622c9916cdSFrançois Tigeot /* drm_auth.c */
632c9916cdSFrançois Tigeot int drm_getmagic(struct drm_device *dev, void *data,
642c9916cdSFrançois Tigeot 		 struct drm_file *file_priv);
652c9916cdSFrançois Tigeot int drm_authmagic(struct drm_device *dev, void *data,
662c9916cdSFrançois Tigeot 		  struct drm_file *file_priv);
67*1dedbd3bSFrançois Tigeot int drm_setmaster_ioctl(struct drm_device *dev, void *data,
68*1dedbd3bSFrançois Tigeot 			struct drm_file *file_priv);
69*1dedbd3bSFrançois Tigeot int drm_dropmaster_ioctl(struct drm_device *dev, void *data,
70*1dedbd3bSFrançois Tigeot 			 struct drm_file *file_priv);
71*1dedbd3bSFrançois Tigeot int drm_master_open(struct drm_file *file_priv);
72*1dedbd3bSFrançois Tigeot void drm_master_release(struct drm_file *file_priv);
732c9916cdSFrançois Tigeot 
742c9916cdSFrançois Tigeot /* drm_sysfs.c */
752c9916cdSFrançois Tigeot extern struct class *drm_class;
762c9916cdSFrançois Tigeot 
77352ff8bdSFrançois Tigeot int drm_sysfs_init(void);
782c9916cdSFrançois Tigeot void drm_sysfs_destroy(void);
792c9916cdSFrançois Tigeot struct device *drm_sysfs_minor_alloc(struct drm_minor *minor);
802c9916cdSFrançois Tigeot int drm_sysfs_connector_add(struct drm_connector *connector);
812c9916cdSFrançois Tigeot void drm_sysfs_connector_remove(struct drm_connector *connector);
822c9916cdSFrançois Tigeot 
831b13d190SFrançois Tigeot /* drm_gem.c */
841b13d190SFrançois Tigeot int drm_gem_init(struct drm_device *dev);
851b13d190SFrançois Tigeot void drm_gem_destroy(struct drm_device *dev);
861b13d190SFrançois Tigeot int drm_gem_handle_create_tail(struct drm_file *file_priv,
871b13d190SFrançois Tigeot 			       struct drm_gem_object *obj,
881b13d190SFrançois Tigeot 			       u32 *handlep);
892c9916cdSFrançois Tigeot int drm_gem_close_ioctl(struct drm_device *dev, void *data,
902c9916cdSFrançois Tigeot 			struct drm_file *file_priv);
912c9916cdSFrançois Tigeot int drm_gem_flink_ioctl(struct drm_device *dev, void *data,
922c9916cdSFrançois Tigeot 			struct drm_file *file_priv);
932c9916cdSFrançois Tigeot int drm_gem_open_ioctl(struct drm_device *dev, void *data,
942c9916cdSFrançois Tigeot 		       struct drm_file *file_priv);
952c9916cdSFrançois Tigeot void drm_gem_open(struct drm_device *dev, struct drm_file *file_private);
962c9916cdSFrançois Tigeot void drm_gem_release(struct drm_device *dev, struct drm_file *file_private);
972c9916cdSFrançois Tigeot 
982c9916cdSFrançois Tigeot /* drm_debugfs.c */
992c9916cdSFrançois Tigeot #if defined(CONFIG_DEBUG_FS)
1002c9916cdSFrançois Tigeot int drm_debugfs_init(struct drm_minor *minor, int minor_id,
1012c9916cdSFrançois Tigeot 		     struct dentry *root);
1022c9916cdSFrançois Tigeot int drm_debugfs_cleanup(struct drm_minor *minor);
1032c9916cdSFrançois Tigeot int drm_debugfs_connector_add(struct drm_connector *connector);
1042c9916cdSFrançois Tigeot void drm_debugfs_connector_remove(struct drm_connector *connector);
1052c9916cdSFrançois Tigeot #else
1062c9916cdSFrançois Tigeot static inline int drm_debugfs_init(struct drm_minor *minor, int minor_id,
1072c9916cdSFrançois Tigeot 				   struct dentry *root)
1082c9916cdSFrançois Tigeot {
1092c9916cdSFrançois Tigeot 	return 0;
1102c9916cdSFrançois Tigeot }
1112c9916cdSFrançois Tigeot 
1122c9916cdSFrançois Tigeot static inline int drm_debugfs_cleanup(struct drm_minor *minor)
1132c9916cdSFrançois Tigeot {
1142c9916cdSFrançois Tigeot 	return 0;
1152c9916cdSFrançois Tigeot }
1162c9916cdSFrançois Tigeot 
1172c9916cdSFrançois Tigeot static inline int drm_debugfs_connector_add(struct drm_connector *connector)
1182c9916cdSFrançois Tigeot {
1192c9916cdSFrançois Tigeot 	return 0;
1202c9916cdSFrançois Tigeot }
1212c9916cdSFrançois Tigeot static inline void drm_debugfs_connector_remove(struct drm_connector *connector)
1222c9916cdSFrançois Tigeot {
1232c9916cdSFrançois Tigeot }
1242c9916cdSFrançois Tigeot #endif
125