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
241dedbd3bSFrançois Tigeot #define DRM_IF_MAJOR 1
251dedbd3bSFrançois Tigeot #define DRM_IF_MINOR 4
261dedbd3bSFrançois Tigeot
27*3f2dd94aSFrançois Tigeot /* drm_file.c */
282c9916cdSFrançois Tigeot extern struct lock drm_global_mutex;
298621f407SFrançois Tigeot void drm_lastclose(struct drm_device *dev);
302c9916cdSFrançois Tigeot
312c9916cdSFrançois Tigeot /* drm_pci.c */
322c9916cdSFrançois Tigeot int drm_irq_by_busid(struct drm_device *dev, void *data,
332c9916cdSFrançois Tigeot struct drm_file *file_priv);
34*3f2dd94aSFrançois Tigeot void drm_pci_agp_destroy(struct drm_device *dev);
35*3f2dd94aSFrançois Tigeot int drm_pci_set_busid(struct drm_device *dev, struct drm_master *master);
368a697a22SFrançois Tigeot int drm_getpciinfo(struct drm_device *dev, void *data,
378a697a22SFrançois Tigeot struct drm_file *file_priv);
382c9916cdSFrançois Tigeot
392c9916cdSFrançois Tigeot /* drm_prime.c */
402c9916cdSFrançois Tigeot int drm_prime_handle_to_fd_ioctl(struct drm_device *dev, void *data,
412c9916cdSFrançois Tigeot struct drm_file *file_priv);
422c9916cdSFrançois Tigeot int drm_prime_fd_to_handle_ioctl(struct drm_device *dev, void *data,
432c9916cdSFrançois Tigeot struct drm_file *file_priv);
442c9916cdSFrançois Tigeot
452c9916cdSFrançois Tigeot void drm_prime_init_file_private(struct drm_prime_file_private *prime_fpriv);
462c9916cdSFrançois Tigeot void drm_prime_destroy_file_private(struct drm_prime_file_private *prime_fpriv);
472c9916cdSFrançois Tigeot void drm_prime_remove_buf_handle_locked(struct drm_prime_file_private *prime_fpriv,
482c9916cdSFrançois Tigeot struct dma_buf *dma_buf);
492c9916cdSFrançois Tigeot
504be47400SFrançois Tigeot /* drm_drv.c */
514be47400SFrançois Tigeot struct drm_minor *drm_minor_acquire(unsigned int minor_id);
524be47400SFrançois Tigeot void drm_minor_release(struct drm_minor *minor);
534be47400SFrançois Tigeot
542c9916cdSFrançois Tigeot /* drm_info.c */
552c9916cdSFrançois Tigeot int drm_name_info(struct seq_file *m, void *data);
562c9916cdSFrançois Tigeot int drm_clients_info(struct seq_file *m, void* data);
572c9916cdSFrançois Tigeot int drm_gem_name_info(struct seq_file *m, void *data);
582c9916cdSFrançois Tigeot
59*3f2dd94aSFrançois Tigeot /* drm_vblank.c */
60*3f2dd94aSFrançois Tigeot void drm_vblank_disable_and_save(struct drm_device *dev, unsigned int pipe);
61*3f2dd94aSFrançois Tigeot void drm_vblank_cleanup(struct drm_device *dev);
624be47400SFrançois Tigeot
634be47400SFrançois Tigeot /* IOCTLS */
64*3f2dd94aSFrançois Tigeot int drm_wait_vblank_ioctl(struct drm_device *dev, void *data,
654be47400SFrançois Tigeot struct drm_file *filp);
66*3f2dd94aSFrançois Tigeot int drm_legacy_modeset_ctl_ioctl(struct drm_device *dev, void *data,
67*3f2dd94aSFrançois Tigeot struct drm_file *file_priv);
68*3f2dd94aSFrançois Tigeot
69*3f2dd94aSFrançois Tigeot /* drm_irq.c */
70*3f2dd94aSFrançois Tigeot
71*3f2dd94aSFrançois Tigeot /* IOCTLS */
72a85cb24fSFrançois Tigeot int drm_legacy_irq_control(struct drm_device *dev, void *data,
732c9916cdSFrançois Tigeot struct drm_file *file_priv);
74*3f2dd94aSFrançois Tigeot
75*3f2dd94aSFrançois Tigeot int drm_crtc_get_sequence_ioctl(struct drm_device *dev, void *data,
76*3f2dd94aSFrançois Tigeot struct drm_file *filp);
77*3f2dd94aSFrançois Tigeot
78*3f2dd94aSFrançois Tigeot int drm_crtc_queue_sequence_ioctl(struct drm_device *dev, void *data,
79*3f2dd94aSFrançois Tigeot struct drm_file *filp);
802c9916cdSFrançois Tigeot
812c9916cdSFrançois Tigeot /* drm_auth.c */
822c9916cdSFrançois Tigeot int drm_getmagic(struct drm_device *dev, void *data,
832c9916cdSFrançois Tigeot struct drm_file *file_priv);
842c9916cdSFrançois Tigeot int drm_authmagic(struct drm_device *dev, void *data,
852c9916cdSFrançois Tigeot struct drm_file *file_priv);
861dedbd3bSFrançois Tigeot int drm_setmaster_ioctl(struct drm_device *dev, void *data,
871dedbd3bSFrançois Tigeot struct drm_file *file_priv);
881dedbd3bSFrançois Tigeot int drm_dropmaster_ioctl(struct drm_device *dev, void *data,
891dedbd3bSFrançois Tigeot struct drm_file *file_priv);
901dedbd3bSFrançois Tigeot int drm_master_open(struct drm_file *file_priv);
911dedbd3bSFrançois Tigeot void drm_master_release(struct drm_file *file_priv);
922c9916cdSFrançois Tigeot
932c9916cdSFrançois Tigeot /* drm_sysfs.c */
942c9916cdSFrançois Tigeot extern struct class *drm_class;
952c9916cdSFrançois Tigeot
96352ff8bdSFrançois Tigeot int drm_sysfs_init(void);
972c9916cdSFrançois Tigeot void drm_sysfs_destroy(void);
982c9916cdSFrançois Tigeot struct device *drm_sysfs_minor_alloc(struct drm_minor *minor);
992c9916cdSFrançois Tigeot int drm_sysfs_connector_add(struct drm_connector *connector);
1002c9916cdSFrançois Tigeot void drm_sysfs_connector_remove(struct drm_connector *connector);
1012c9916cdSFrançois Tigeot
1021b13d190SFrançois Tigeot /* drm_gem.c */
1031b13d190SFrançois Tigeot int drm_gem_init(struct drm_device *dev);
1041b13d190SFrançois Tigeot void drm_gem_destroy(struct drm_device *dev);
1051b13d190SFrançois Tigeot int drm_gem_handle_create_tail(struct drm_file *file_priv,
1061b13d190SFrançois Tigeot struct drm_gem_object *obj,
1071b13d190SFrançois Tigeot u32 *handlep);
1082c9916cdSFrançois Tigeot int drm_gem_close_ioctl(struct drm_device *dev, void *data,
1092c9916cdSFrançois Tigeot struct drm_file *file_priv);
1102c9916cdSFrançois Tigeot int drm_gem_flink_ioctl(struct drm_device *dev, void *data,
1112c9916cdSFrançois Tigeot struct drm_file *file_priv);
1122c9916cdSFrançois Tigeot int drm_gem_open_ioctl(struct drm_device *dev, void *data,
1132c9916cdSFrançois Tigeot struct drm_file *file_priv);
1142c9916cdSFrançois Tigeot void drm_gem_open(struct drm_device *dev, struct drm_file *file_private);
1152c9916cdSFrançois Tigeot void drm_gem_release(struct drm_device *dev, struct drm_file *file_private);
1162c9916cdSFrançois Tigeot
117a85cb24fSFrançois Tigeot /* drm_debugfs.c drm_debugfs_crc.c */
1182c9916cdSFrançois Tigeot #if defined(CONFIG_DEBUG_FS)
1192c9916cdSFrançois Tigeot int drm_debugfs_init(struct drm_minor *minor, int minor_id,
1202c9916cdSFrançois Tigeot struct dentry *root);
1212c9916cdSFrançois Tigeot int drm_debugfs_cleanup(struct drm_minor *minor);
1222c9916cdSFrançois Tigeot int drm_debugfs_connector_add(struct drm_connector *connector);
1232c9916cdSFrançois Tigeot void drm_debugfs_connector_remove(struct drm_connector *connector);
1244be47400SFrançois Tigeot int drm_debugfs_crtc_add(struct drm_crtc *crtc);
1254be47400SFrançois Tigeot void drm_debugfs_crtc_remove(struct drm_crtc *crtc);
1264be47400SFrançois Tigeot int drm_debugfs_crtc_crc_add(struct drm_crtc *crtc);
1272c9916cdSFrançois Tigeot #else
drm_debugfs_init(struct drm_minor * minor,int minor_id,struct dentry * root)1282c9916cdSFrançois Tigeot static inline int drm_debugfs_init(struct drm_minor *minor, int minor_id,
1292c9916cdSFrançois Tigeot struct dentry *root)
1302c9916cdSFrançois Tigeot {
1312c9916cdSFrançois Tigeot return 0;
1322c9916cdSFrançois Tigeot }
1332c9916cdSFrançois Tigeot
drm_debugfs_cleanup(struct drm_minor * minor)1342c9916cdSFrançois Tigeot static inline int drm_debugfs_cleanup(struct drm_minor *minor)
1352c9916cdSFrançois Tigeot {
1362c9916cdSFrançois Tigeot return 0;
1372c9916cdSFrançois Tigeot }
1382c9916cdSFrançois Tigeot
drm_debugfs_connector_add(struct drm_connector * connector)1392c9916cdSFrançois Tigeot static inline int drm_debugfs_connector_add(struct drm_connector *connector)
1402c9916cdSFrançois Tigeot {
1412c9916cdSFrançois Tigeot return 0;
1422c9916cdSFrançois Tigeot }
drm_debugfs_connector_remove(struct drm_connector * connector)1432c9916cdSFrançois Tigeot static inline void drm_debugfs_connector_remove(struct drm_connector *connector)
1442c9916cdSFrançois Tigeot {
1452c9916cdSFrançois Tigeot }
1464be47400SFrançois Tigeot
drm_debugfs_crtc_add(struct drm_crtc * crtc)1474be47400SFrançois Tigeot static inline int drm_debugfs_crtc_add(struct drm_crtc *crtc)
1484be47400SFrançois Tigeot {
1494be47400SFrançois Tigeot return 0;
1504be47400SFrançois Tigeot }
drm_debugfs_crtc_remove(struct drm_crtc * crtc)1514be47400SFrançois Tigeot static inline void drm_debugfs_crtc_remove(struct drm_crtc *crtc)
1524be47400SFrançois Tigeot {
1534be47400SFrançois Tigeot }
1544be47400SFrançois Tigeot
drm_debugfs_crtc_crc_add(struct drm_crtc * crtc)1554be47400SFrançois Tigeot static inline int drm_debugfs_crtc_crc_add(struct drm_crtc *crtc)
1564be47400SFrançois Tigeot {
1574be47400SFrançois Tigeot return 0;
1584be47400SFrançois Tigeot }
159*3f2dd94aSFrançois Tigeot
1602c9916cdSFrançois Tigeot #endif
161*3f2dd94aSFrançois Tigeot
162*3f2dd94aSFrançois Tigeot drm_ioctl_t drm_version;
163*3f2dd94aSFrançois Tigeot drm_ioctl_t drm_getunique;
164*3f2dd94aSFrançois Tigeot drm_ioctl_t drm_getclient;
165*3f2dd94aSFrançois Tigeot
166*3f2dd94aSFrançois Tigeot /* drm_syncobj.c */
167*3f2dd94aSFrançois Tigeot void drm_syncobj_open(struct drm_file *file_private);
168*3f2dd94aSFrançois Tigeot void drm_syncobj_release(struct drm_file *file_private);
169*3f2dd94aSFrançois Tigeot int drm_syncobj_create_ioctl(struct drm_device *dev, void *data,
170*3f2dd94aSFrançois Tigeot struct drm_file *file_private);
171*3f2dd94aSFrançois Tigeot int drm_syncobj_destroy_ioctl(struct drm_device *dev, void *data,
172*3f2dd94aSFrançois Tigeot struct drm_file *file_private);
173*3f2dd94aSFrançois Tigeot int drm_syncobj_handle_to_fd_ioctl(struct drm_device *dev, void *data,
174*3f2dd94aSFrançois Tigeot struct drm_file *file_private);
175*3f2dd94aSFrançois Tigeot int drm_syncobj_fd_to_handle_ioctl(struct drm_device *dev, void *data,
176*3f2dd94aSFrançois Tigeot struct drm_file *file_private);
177*3f2dd94aSFrançois Tigeot int drm_syncobj_wait_ioctl(struct drm_device *dev, void *data,
178*3f2dd94aSFrançois Tigeot struct drm_file *file_private);
179*3f2dd94aSFrançois Tigeot int drm_syncobj_reset_ioctl(struct drm_device *dev, void *data,
180*3f2dd94aSFrançois Tigeot struct drm_file *file_private);
181*3f2dd94aSFrançois Tigeot int drm_syncobj_signal_ioctl(struct drm_device *dev, void *data,
182*3f2dd94aSFrançois Tigeot struct drm_file *file_private);
183