aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2014-09-10 06:43:49 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-09-12 05:08:55 -0400
commit4f03b1fc1eb286b73d453c03cdb45a3827726a44 (patch)
treedc90ed4f6a5b7028285024737f707e861505a7cf
parenta677f4cc88b2b7491c0c400e07b6630852971e32 (diff)
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>
-rw-r--r--drivers/gpu/drm/drm_legacy.h1
-rw-r--r--drivers/gpu/drm/i810/i810_drv.h2
-rw-r--r--drivers/gpu/drm/i915/i915_dma.c1
-rw-r--r--drivers/gpu/drm/mga/mga_drv.h2
-rw-r--r--drivers/gpu/drm/r128/r128_drv.h2
-rw-r--r--drivers/gpu/drm/radeon/radeon_drv.h1
-rw-r--r--drivers/gpu/drm/savage/savage_drv.h2
-rw-r--r--drivers/gpu/drm/sis/sis_drv.h2
-rw-r--r--drivers/gpu/drm/via/via_drv.h2
-rw-r--r--include/drm/drmP.h15
-rw-r--r--include/drm/drm_legacy.h58
11 files changed, 73 insertions, 15 deletions
diff --git a/drivers/gpu/drm/drm_legacy.h b/drivers/gpu/drm/drm_legacy.h
index 011dc6f1ad94..c1dc61473db5 100644
--- a/drivers/gpu/drm/drm_legacy.h
+++ b/drivers/gpu/drm/drm_legacy.h
@@ -29,6 +29,7 @@
29 * drivers use them, and removing them are API breaks. 29 * drivers use them, and removing them are API breaks.
30 */ 30 */
31#include <linux/list.h> 31#include <linux/list.h>
32#include <drm/drm_legacy.h>
32 33
33struct agp_memory; 34struct agp_memory;
34struct drm_device; 35struct drm_device;
diff --git a/drivers/gpu/drm/i810/i810_drv.h b/drivers/gpu/drm/i810/i810_drv.h
index d4d16eddd651..93ec5dc4e7d3 100644
--- a/drivers/gpu/drm/i810/i810_drv.h
+++ b/drivers/gpu/drm/i810/i810_drv.h
@@ -32,6 +32,8 @@
32#ifndef _I810_DRV_H_ 32#ifndef _I810_DRV_H_
33#define _I810_DRV_H_ 33#define _I810_DRV_H_
34 34
35#include <drm/drm_legacy.h>
36
35/* General customization: 37/* General customization:
36 */ 38 */
37 39
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index 689c3326636f..8535f96f2c59 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -31,6 +31,7 @@
31#include <drm/drmP.h> 31#include <drm/drmP.h>
32#include <drm/drm_crtc_helper.h> 32#include <drm/drm_crtc_helper.h>
33#include <drm/drm_fb_helper.h> 33#include <drm/drm_fb_helper.h>
34#include <drm/drm_legacy.h>
34#include "intel_drv.h" 35#include "intel_drv.h"
35#include <drm/i915_drm.h> 36#include <drm/i915_drm.h>
36#include "i915_drv.h" 37#include "i915_drv.h"
diff --git a/drivers/gpu/drm/mga/mga_drv.h b/drivers/gpu/drm/mga/mga_drv.h
index fe453213600a..b4a2014917e5 100644
--- a/drivers/gpu/drm/mga/mga_drv.h
+++ b/drivers/gpu/drm/mga/mga_drv.h
@@ -31,6 +31,8 @@
31#ifndef __MGA_DRV_H__ 31#ifndef __MGA_DRV_H__
32#define __MGA_DRV_H__ 32#define __MGA_DRV_H__
33 33
34#include <drm/drm_legacy.h>
35
34/* General customization: 36/* General customization:
35 */ 37 */
36 38
diff --git a/drivers/gpu/drm/r128/r128_drv.h b/drivers/gpu/drm/r128/r128_drv.h
index 49fe02670c2e..723e5d6f10a4 100644
--- a/drivers/gpu/drm/r128/r128_drv.h
+++ b/drivers/gpu/drm/r128/r128_drv.h
@@ -36,6 +36,8 @@
36#define __R128_DRV_H__ 36#define __R128_DRV_H__
37 37
38#include <drm/ati_pcigart.h> 38#include <drm/ati_pcigart.h>
39#include <drm/drm_legacy.h>
40
39/* General customization: 41/* General customization:
40 */ 42 */
41#define DRIVER_AUTHOR "Gareth Hughes, VA Linux Systems Inc." 43#define DRIVER_AUTHOR "Gareth Hughes, VA Linux Systems Inc."
diff --git a/drivers/gpu/drm/radeon/radeon_drv.h b/drivers/gpu/drm/radeon/radeon_drv.h
index 3590cb47a22e..46bd3938282c 100644
--- a/drivers/gpu/drm/radeon/radeon_drv.h
+++ b/drivers/gpu/drm/radeon/radeon_drv.h
@@ -33,6 +33,7 @@
33 33
34#include <linux/firmware.h> 34#include <linux/firmware.h>
35#include <linux/platform_device.h> 35#include <linux/platform_device.h>
36#include <drm/drm_legacy.h>
36 37
37#include <drm/ati_pcigart.h> 38#include <drm/ati_pcigart.h>
38#include "radeon_family.h" 39#include "radeon_family.h"
diff --git a/drivers/gpu/drm/savage/savage_drv.h b/drivers/gpu/drm/savage/savage_drv.h
index 335f8fcf1041..37b699571ad0 100644
--- a/drivers/gpu/drm/savage/savage_drv.h
+++ b/drivers/gpu/drm/savage/savage_drv.h
@@ -26,6 +26,8 @@
26#ifndef __SAVAGE_DRV_H__ 26#ifndef __SAVAGE_DRV_H__
27#define __SAVAGE_DRV_H__ 27#define __SAVAGE_DRV_H__
28 28
29#include <drm/drm_legacy.h>
30
29#define DRIVER_AUTHOR "Felix Kuehling" 31#define DRIVER_AUTHOR "Felix Kuehling"
30 32
31#define DRIVER_NAME "savage" 33#define DRIVER_NAME "savage"
diff --git a/drivers/gpu/drm/sis/sis_drv.h b/drivers/gpu/drm/sis/sis_drv.h
index c31c0253054d..16f972b2a76a 100644
--- a/drivers/gpu/drm/sis/sis_drv.h
+++ b/drivers/gpu/drm/sis/sis_drv.h
@@ -28,6 +28,8 @@
28#ifndef _SIS_DRV_H_ 28#ifndef _SIS_DRV_H_
29#define _SIS_DRV_H_ 29#define _SIS_DRV_H_
30 30
31#include <drm/drm_legacy.h>
32
31/* General customization: 33/* General customization:
32 */ 34 */
33 35
diff --git a/drivers/gpu/drm/via/via_drv.h b/drivers/gpu/drm/via/via_drv.h
index ad0273256beb..ef8c500b4a00 100644
--- a/drivers/gpu/drm/via/via_drv.h
+++ b/drivers/gpu/drm/via/via_drv.h
@@ -25,6 +25,8 @@
25#define _VIA_DRV_H_ 25#define _VIA_DRV_H_
26 26
27#include <drm/drm_mm.h> 27#include <drm/drm_mm.h>
28#include <drm/drm_legacy.h>
29
28#define DRIVER_AUTHOR "Various" 30#define DRIVER_AUTHOR "Various"
29 31
30#define DRIVER_NAME "via" 32#define DRIVER_NAME "via"
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 2b6d5241fe59..fe6db4cc0db2 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -1309,21 +1309,6 @@ extern int drm_pci_set_unique(struct drm_device *dev,
1309 struct drm_master *master, 1309 struct drm_master *master,
1310 struct drm_unique *u); 1310 struct drm_unique *u);
1311 1311
1312 /* Legacy Support */
1313
1314int 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);
1317int drm_legacy_rmmap(struct drm_device *d, struct drm_local_map *map);
1318int drm_legacy_rmmap_locked(struct drm_device *d, struct drm_local_map *map);
1319struct drm_local_map *drm_legacy_getsarea(struct drm_device *dev);
1320
1321int drm_legacy_addbufs_agp(struct drm_device *d, struct drm_buf_desc *req);
1322int drm_legacy_addbufs_pci(struct drm_device *d, struct drm_buf_desc *req);
1323
1324void drm_legacy_idlelock_take(struct drm_lock_data *lock);
1325void drm_legacy_idlelock_release(struct drm_lock_data *lock);
1326
1327 /* sysfs support (drm_sysfs.c) */ 1312 /* sysfs support (drm_sysfs.c) */
1328struct drm_sysfs_class; 1313struct drm_sysfs_class;
1329extern struct class *drm_sysfs_create(struct module *owner, char *name); 1314extern struct class *drm_sysfs_create(struct module *owner, char *name);
diff --git a/include/drm/drm_legacy.h b/include/drm/drm_legacy.h
new file mode 100644
index 000000000000..605d66081e3f
--- /dev/null
+++ b/include/drm/drm_legacy.h
@@ -0,0 +1,58 @@
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
45int 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);
48int drm_legacy_rmmap(struct drm_device *d, struct drm_local_map *map);
49int drm_legacy_rmmap_locked(struct drm_device *d, struct drm_local_map *map);
50struct drm_local_map *drm_legacy_getsarea(struct drm_device *dev);
51
52int drm_legacy_addbufs_agp(struct drm_device *d, struct drm_buf_desc *req);
53int drm_legacy_addbufs_pci(struct drm_device *d, struct drm_buf_desc *req);
54
55void drm_legacy_idlelock_take(struct drm_lock_data *lock);
56void drm_legacy_idlelock_release(struct drm_lock_data *lock);
57
58#endif /* __DRM_DRM_LEGACY_H__ */