Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm: Move piles of functions from drmP.h to drm_internal.h

This way drivers can't grow crazy ideas any more, and it also
helps a bit in reviewing EXPORT_SYMBOLS.

v2: Even more stuff. Unfortunately we can't move drm_vm_open_locked
because exynos does some horrible stuff with it.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

+76 -55
+1
drivers/gpu/drm/drm_auth.c
··· 34 34 */ 35 35 36 36 #include <drm/drmP.h> 37 + #include "drm_internal.h" 37 38 38 39 struct drm_magic_entry { 39 40 struct list_head head;
+1
drivers/gpu/drm/drm_crtc.c
··· 40 40 #include <drm/drm_modeset_lock.h> 41 41 42 42 #include "drm_crtc_internal.h" 43 + #include "drm_internal.h" 43 44 44 45 static struct drm_framebuffer *add_framebuffer_internal(struct drm_device *dev, 45 46 struct drm_mode_fb_cmd2 *r,
+1
drivers/gpu/drm/drm_debugfs.c
··· 36 36 #include <linux/export.h> 37 37 #include <drm/drmP.h> 38 38 #include <drm/drm_edid.h> 39 + #include "drm_internal.h" 39 40 40 41 #if defined(CONFIG_DEBUG_FS) 41 42
+1
drivers/gpu/drm/drm_drv.c
··· 35 35 #include <drm/drmP.h> 36 36 #include <drm/drm_core.h> 37 37 #include "drm_legacy.h" 38 + #include "drm_internal.h" 38 39 39 40 unsigned int drm_debug = 0; /* 1 to enable debug output */ 40 41 EXPORT_SYMBOL(drm_debug);
+1
drivers/gpu/drm/drm_fops.c
··· 39 39 #include <linux/slab.h> 40 40 #include <linux/module.h> 41 41 #include "drm_legacy.h" 42 + #include "drm_internal.h" 42 43 43 44 /* from BKL pushdown */ 44 45 DEFINE_MUTEX(drm_global_mutex);
+1
drivers/gpu/drm/drm_gem.c
··· 38 38 #include <linux/dma-buf.h> 39 39 #include <drm/drmP.h> 40 40 #include <drm/drm_vma_manager.h> 41 + #include "drm_internal.h" 41 42 42 43 /** @file drm_gem.c 43 44 *
+68
drivers/gpu/drm/drm_internal.h
··· 21 21 * OTHER DEALINGS IN THE SOFTWARE. 22 22 */ 23 23 24 + /* drm_irq.c */ 24 25 extern unsigned int drm_timestamp_monotonic; 26 + 27 + /* drm_fops.c */ 28 + int drm_lastclose(struct drm_device *dev); 29 + 30 + /* drm_pci.c */ 31 + int drm_pci_set_unique(struct drm_device *dev, 32 + struct drm_master *master, 33 + struct drm_unique *u); 34 + int drm_irq_by_busid(struct drm_device *dev, void *data, 35 + struct drm_file *file_priv); 36 + 37 + /* drm_vm.c */ 38 + int drm_vma_info(struct seq_file *m, void *data); 39 + int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma); 40 + void drm_vm_close_locked(struct drm_device *dev, struct vm_area_struct *vma); 41 + 42 + /* drm_prime.c */ 43 + int drm_prime_handle_to_fd_ioctl(struct drm_device *dev, void *data, 44 + struct drm_file *file_priv); 45 + int drm_prime_fd_to_handle_ioctl(struct drm_device *dev, void *data, 46 + struct drm_file *file_priv); 47 + 48 + void drm_prime_init_file_private(struct drm_prime_file_private *prime_fpriv); 49 + void drm_prime_destroy_file_private(struct drm_prime_file_private *prime_fpriv); 50 + void drm_prime_remove_buf_handle_locked(struct drm_prime_file_private *prime_fpriv, 51 + struct dma_buf *dma_buf); 52 + 53 + /* drm_info.c */ 54 + int drm_name_info(struct seq_file *m, void *data); 55 + int drm_vm_info(struct seq_file *m, void *data); 56 + int drm_bufs_info(struct seq_file *m, void *data); 57 + int drm_vblank_info(struct seq_file *m, void *data); 58 + int drm_clients_info(struct seq_file *m, void* data); 59 + int drm_gem_name_info(struct seq_file *m, void *data); 60 + 61 + /* drm_irq.c */ 62 + int drm_control(struct drm_device *dev, void *data, 63 + struct drm_file *file_priv); 64 + 65 + /* drm_auth.c */ 66 + int drm_getmagic(struct drm_device *dev, void *data, 67 + struct drm_file *file_priv); 68 + int drm_authmagic(struct drm_device *dev, void *data, 69 + struct drm_file *file_priv); 70 + int drm_remove_magic(struct drm_master *master, drm_magic_t magic); 71 + 72 + /* drm_sysfs.c */ 73 + struct class *drm_sysfs_create(struct module *owner, char *name); 74 + void drm_sysfs_destroy(void); 75 + struct device *drm_sysfs_minor_alloc(struct drm_minor *minor); 76 + int drm_sysfs_connector_add(struct drm_connector *connector); 77 + void drm_sysfs_connector_remove(struct drm_connector *connector); 78 + 79 + /* drm_gem.c */ 80 + int drm_gem_init(struct drm_device *dev); 81 + void drm_gem_destroy(struct drm_device *dev); 82 + int drm_gem_handle_create_tail(struct drm_file *file_priv, 83 + struct drm_gem_object *obj, 84 + u32 *handlep); 85 + int drm_gem_close_ioctl(struct drm_device *dev, void *data, 86 + struct drm_file *file_priv); 87 + int drm_gem_flink_ioctl(struct drm_device *dev, void *data, 88 + struct drm_file *file_priv); 89 + int drm_gem_open_ioctl(struct drm_device *dev, void *data, 90 + struct drm_file *file_priv); 91 + void drm_gem_open(struct drm_device *dev, struct drm_file *file_private); 92 + void drm_gem_release(struct drm_device *dev, struct drm_file *file_private);
+1
drivers/gpu/drm/drm_prime.c
··· 29 29 #include <linux/export.h> 30 30 #include <linux/dma-buf.h> 31 31 #include <drm/drmP.h> 32 + #include "drm_internal.h" 32 33 33 34 /* 34 35 * DMA-BUF/GEM Object references and lifetime overview:
+1
drivers/gpu/drm/drm_sysfs.c
··· 21 21 #include <drm/drm_sysfs.h> 22 22 #include <drm/drm_core.h> 23 23 #include <drm/drmP.h> 24 + #include "drm_internal.h" 24 25 25 26 #define to_drm_minor(d) dev_get_drvdata(d) 26 27 #define to_drm_connector(d) dev_get_drvdata(d)
-55
include/drm/drmP.h
··· 1084 1084 unsigned int cmd, unsigned long arg); 1085 1085 extern long drm_compat_ioctl(struct file *filp, 1086 1086 unsigned int cmd, unsigned long arg); 1087 - extern int drm_lastclose(struct drm_device *dev); 1088 1087 extern bool drm_ioctl_flags(unsigned int nr, unsigned int *flags); 1089 1088 1090 1089 /* Device support (drm_fops.h) */ ··· 1095 1096 1096 1097 /* Mapping support (drm_vm.h) */ 1097 1098 extern int drm_mmap(struct file *filp, struct vm_area_struct *vma); 1098 - extern int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma); 1099 1099 extern void drm_vm_open_locked(struct drm_device *dev, struct vm_area_struct *vma); 1100 - extern void drm_vm_close_locked(struct drm_device *dev, struct vm_area_struct *vma); 1101 1100 extern unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait); 1102 1101 1103 1102 /* Misc. IOCTL support (drm_ioctl.h) */ 1104 - extern int drm_irq_by_busid(struct drm_device *dev, void *data, 1105 - struct drm_file *file_priv); 1106 1103 extern int drm_getunique(struct drm_device *dev, void *data, 1107 1104 struct drm_file *file_priv); 1108 1105 extern int drm_setunique(struct drm_device *dev, void *data, ··· 1118 1123 extern int drm_noop(struct drm_device *dev, void *data, 1119 1124 struct drm_file *file_priv); 1120 1125 1121 - /* Authentication IOCTL support (drm_auth.h) */ 1122 - extern int drm_getmagic(struct drm_device *dev, void *data, 1123 - struct drm_file *file_priv); 1124 - extern int drm_authmagic(struct drm_device *dev, void *data, 1125 - struct drm_file *file_priv); 1126 - extern int drm_remove_magic(struct drm_master *master, drm_magic_t magic); 1127 - 1128 1126 /* Cache management (drm_cache.c) */ 1129 1127 void drm_clflush_pages(struct page *pages[], unsigned long num_pages); 1130 1128 void drm_clflush_sg(struct sg_table *st); ··· 1129 1141 */ 1130 1142 1131 1143 /* IRQ support (drm_irq.h) */ 1132 - extern int drm_control(struct drm_device *dev, void *data, 1133 - struct drm_file *file_priv); 1134 1144 extern int drm_irq_install(struct drm_device *dev, int irq); 1135 1145 extern int drm_irq_uninstall(struct drm_device *dev); 1136 1146 ··· 1242 1256 1243 1257 #endif 1244 1258 1245 - /* Info file support */ 1246 - extern int drm_name_info(struct seq_file *m, void *data); 1247 - extern int drm_vm_info(struct seq_file *m, void *data); 1248 - extern int drm_bufs_info(struct seq_file *m, void *data); 1249 - extern int drm_vblank_info(struct seq_file *m, void *data); 1250 - extern int drm_clients_info(struct seq_file *m, void* data); 1251 - extern int drm_gem_name_info(struct seq_file *m, void *data); 1252 - 1253 - 1254 1259 extern struct dma_buf *drm_gem_prime_export(struct drm_device *dev, 1255 1260 struct drm_gem_object *obj, int flags); 1256 1261 extern int drm_gem_prime_handle_to_fd(struct drm_device *dev, ··· 1253 1276 struct drm_file *file_priv, int prime_fd, uint32_t *handle); 1254 1277 extern void drm_gem_dmabuf_release(struct dma_buf *dma_buf); 1255 1278 1256 - extern int drm_prime_handle_to_fd_ioctl(struct drm_device *dev, void *data, 1257 - struct drm_file *file_priv); 1258 - extern int drm_prime_fd_to_handle_ioctl(struct drm_device *dev, void *data, 1259 - struct drm_file *file_priv); 1260 - 1261 1279 extern int drm_prime_sg_to_page_addr_arrays(struct sg_table *sgt, struct page **pages, 1262 1280 dma_addr_t *addrs, int max_pages); 1263 1281 extern struct sg_table *drm_prime_pages_to_sg(struct page **pages, int nr_pages); ··· 1262 1290 struct drm_device *dev, 1263 1291 uint32_t handle); 1264 1292 1265 - void drm_prime_init_file_private(struct drm_prime_file_private *prime_fpriv); 1266 - void drm_prime_destroy_file_private(struct drm_prime_file_private *prime_fpriv); 1267 - void drm_prime_remove_buf_handle_locked(struct drm_prime_file_private *prime_fpriv, struct dma_buf *dma_buf); 1268 - 1269 - extern int drm_vma_info(struct seq_file *m, void *data); 1270 - 1271 1293 1272 1294 extern drm_dma_handle_t *drm_pci_alloc(struct drm_device *dev, size_t size, 1273 1295 size_t align); 1274 1296 extern void drm_pci_free(struct drm_device *dev, drm_dma_handle_t * dmah); 1275 - extern int drm_pci_set_unique(struct drm_device *dev, 1276 - struct drm_master *master, 1277 - struct drm_unique *u); 1278 1297 1279 1298 /* sysfs support (drm_sysfs.c) */ 1280 - extern struct class *drm_sysfs_create(struct module *owner, char *name); 1281 - extern void drm_sysfs_destroy(void); 1282 - extern struct device *drm_sysfs_minor_alloc(struct drm_minor *minor); 1283 1299 extern void drm_sysfs_hotplug_event(struct drm_device *dev); 1284 - extern int drm_sysfs_connector_add(struct drm_connector *connector); 1285 - extern void drm_sysfs_connector_remove(struct drm_connector *connector); 1286 1300 1287 1301 /* Graphics Execution Manager library functions (drm_gem.c) */ 1288 - int drm_gem_init(struct drm_device *dev); 1289 - void drm_gem_destroy(struct drm_device *dev); 1290 1302 void drm_gem_object_release(struct drm_gem_object *obj); 1291 1303 void drm_gem_object_free(struct kref *kref); 1292 1304 int drm_gem_object_init(struct drm_device *dev, ··· 1309 1353 } 1310 1354 } 1311 1355 1312 - int drm_gem_handle_create_tail(struct drm_file *file_priv, 1313 - struct drm_gem_object *obj, 1314 - u32 *handlep); 1315 1356 int drm_gem_handle_create(struct drm_file *file_priv, 1316 1357 struct drm_gem_object *obj, 1317 1358 u32 *handlep); ··· 1326 1373 struct drm_gem_object *drm_gem_object_lookup(struct drm_device *dev, 1327 1374 struct drm_file *filp, 1328 1375 u32 handle); 1329 - int drm_gem_close_ioctl(struct drm_device *dev, void *data, 1330 - struct drm_file *file_priv); 1331 - int drm_gem_flink_ioctl(struct drm_device *dev, void *data, 1332 - struct drm_file *file_priv); 1333 - int drm_gem_open_ioctl(struct drm_device *dev, void *data, 1334 - struct drm_file *file_priv); 1335 - void drm_gem_open(struct drm_device *dev, struct drm_file *file_private); 1336 - void drm_gem_release(struct drm_device *dev, struct drm_file *file_private); 1337 1376 1338 1377 extern void drm_core_ioremap(struct drm_local_map *map, struct drm_device *dev); 1339 1378 extern void drm_core_ioremap_wc(struct drm_local_map *map, struct drm_device *dev);