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

drm: Create drm legacy driver header

And move a few legayc functions to start things over there.

It compiles ...

Inspired by a patch from Dave Airlie, but with a split between drm.ko
private legacy functions and stuff used by drivers.

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

+73 -15
+1
drivers/gpu/drm/drm_legacy.h
··· 29 29 * drivers use them, and removing them are API breaks. 30 30 */ 31 31 #include <linux/list.h> 32 + #include <drm/drm_legacy.h> 32 33 33 34 struct agp_memory; 34 35 struct drm_device;
+2
drivers/gpu/drm/i810/i810_drv.h
··· 32 32 #ifndef _I810_DRV_H_ 33 33 #define _I810_DRV_H_ 34 34 35 + #include <drm/drm_legacy.h> 36 + 35 37 /* General customization: 36 38 */ 37 39
+1
drivers/gpu/drm/i915/i915_dma.c
··· 31 31 #include <drm/drmP.h> 32 32 #include <drm/drm_crtc_helper.h> 33 33 #include <drm/drm_fb_helper.h> 34 + #include <drm/drm_legacy.h> 34 35 #include "intel_drv.h" 35 36 #include <drm/i915_drm.h> 36 37 #include "i915_drv.h"
+2
drivers/gpu/drm/mga/mga_drv.h
··· 31 31 #ifndef __MGA_DRV_H__ 32 32 #define __MGA_DRV_H__ 33 33 34 + #include <drm/drm_legacy.h> 35 + 34 36 /* General customization: 35 37 */ 36 38
+2
drivers/gpu/drm/r128/r128_drv.h
··· 36 36 #define __R128_DRV_H__ 37 37 38 38 #include <drm/ati_pcigart.h> 39 + #include <drm/drm_legacy.h> 40 + 39 41 /* General customization: 40 42 */ 41 43 #define DRIVER_AUTHOR "Gareth Hughes, VA Linux Systems Inc."
+1
drivers/gpu/drm/radeon/radeon_drv.h
··· 33 33 34 34 #include <linux/firmware.h> 35 35 #include <linux/platform_device.h> 36 + #include <drm/drm_legacy.h> 36 37 37 38 #include <drm/ati_pcigart.h> 38 39 #include "radeon_family.h"
+2
drivers/gpu/drm/savage/savage_drv.h
··· 26 26 #ifndef __SAVAGE_DRV_H__ 27 27 #define __SAVAGE_DRV_H__ 28 28 29 + #include <drm/drm_legacy.h> 30 + 29 31 #define DRIVER_AUTHOR "Felix Kuehling" 30 32 31 33 #define DRIVER_NAME "savage"
+2
drivers/gpu/drm/sis/sis_drv.h
··· 28 28 #ifndef _SIS_DRV_H_ 29 29 #define _SIS_DRV_H_ 30 30 31 + #include <drm/drm_legacy.h> 32 + 31 33 /* General customization: 32 34 */ 33 35
+2
drivers/gpu/drm/via/via_drv.h
··· 25 25 #define _VIA_DRV_H_ 26 26 27 27 #include <drm/drm_mm.h> 28 + #include <drm/drm_legacy.h> 29 + 28 30 #define DRIVER_AUTHOR "Various" 29 31 30 32 #define DRIVER_NAME "via"
-15
include/drm/drmP.h
··· 1309 1309 struct drm_master *master, 1310 1310 struct drm_unique *u); 1311 1311 1312 - /* Legacy Support */ 1313 - 1314 - int drm_legacy_addmap(struct drm_device *d, resource_size_t offset, 1315 - unsigned int size, enum drm_map_type type, 1316 - enum drm_map_flags flags, struct drm_local_map **map_p); 1317 - int drm_legacy_rmmap(struct drm_device *d, struct drm_local_map *map); 1318 - int drm_legacy_rmmap_locked(struct drm_device *d, struct drm_local_map *map); 1319 - struct drm_local_map *drm_legacy_getsarea(struct drm_device *dev); 1320 - 1321 - int drm_legacy_addbufs_agp(struct drm_device *d, struct drm_buf_desc *req); 1322 - int drm_legacy_addbufs_pci(struct drm_device *d, struct drm_buf_desc *req); 1323 - 1324 - void drm_legacy_idlelock_take(struct drm_lock_data *lock); 1325 - void drm_legacy_idlelock_release(struct drm_lock_data *lock); 1326 - 1327 1312 /* sysfs support (drm_sysfs.c) */ 1328 1313 struct drm_sysfs_class; 1329 1314 extern struct class *drm_sysfs_create(struct module *owner, char *name);
+58
include/drm/drm_legacy.h
··· 1 + #ifndef __DRM_DRM_LEGACY_H__ 2 + #define __DRM_DRM_LEGACY_H__ 3 + 4 + /* 5 + * Legacy driver interfaces for the Direct Rendering Manager 6 + * 7 + * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas. 8 + * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. 9 + * Copyright (c) 2009-2010, Code Aurora Forum. 10 + * All rights reserved. 11 + * Copyright © 2014 Intel Corporation 12 + * Daniel Vetter <daniel.vetter@ffwll.ch> 13 + * 14 + * Author: Rickard E. (Rik) Faith <faith@valinux.com> 15 + * Author: Gareth Hughes <gareth@valinux.com> 16 + * 17 + * Permission is hereby granted, free of charge, to any person obtaining a 18 + * copy of this software and associated documentation files (the "Software"), 19 + * to deal in the Software without restriction, including without limitation 20 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, 21 + * and/or sell copies of the Software, and to permit persons to whom the 22 + * Software is furnished to do so, subject to the following conditions: 23 + * 24 + * The above copyright notice and this permission notice (including the next 25 + * paragraph) shall be included in all copies or substantial portions of the 26 + * Software. 27 + * 28 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 31 + * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 32 + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 33 + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 34 + * OTHER DEALINGS IN THE SOFTWARE. 35 + */ 36 + 37 + 38 + /* 39 + * Legacy Support for palateontologic DRM drivers 40 + * 41 + * If you add a new driver and it uses any of these functions or structures, 42 + * you're doing it terribly wrong. 43 + */ 44 + 45 + int drm_legacy_addmap(struct drm_device *d, resource_size_t offset, 46 + unsigned int size, enum drm_map_type type, 47 + enum drm_map_flags flags, struct drm_local_map **map_p); 48 + int drm_legacy_rmmap(struct drm_device *d, struct drm_local_map *map); 49 + int drm_legacy_rmmap_locked(struct drm_device *d, struct drm_local_map *map); 50 + struct drm_local_map *drm_legacy_getsarea(struct drm_device *dev); 51 + 52 + int drm_legacy_addbufs_agp(struct drm_device *d, struct drm_buf_desc *req); 53 + int drm_legacy_addbufs_pci(struct drm_device *d, struct drm_buf_desc *req); 54 + 55 + void drm_legacy_idlelock_take(struct drm_lock_data *lock); 56 + void drm_legacy_idlelock_release(struct drm_lock_data *lock); 57 + 58 + #endif /* __DRM_DRM_LEGACY_H__ */