aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2014-08-29 06:12:32 -0400
committerDave Airlie <airlied@redhat.com>2014-09-10 03:40:11 -0400
commitcc5ea5947a52b98cd9a03d4011a5a12b4e5a99c4 (patch)
tree11a83a3663b99b96437e11d4bffd1ce240cfceb5
parentcc33db0a6108d41b94eba0d84b0627cc52585109 (diff)
drm: move AGP definitions harder
Move drm_agp_head to drm_agpsupport.h and drm_agp_mem into drm_legacy.h. Unfortunately, drivers still heavily access drm_agp_head so we cannot move it to drm_legacy.h. However, at least it's no longer visible in drmP.h now (it's directly included from it, though). Signed-off-by: David Herrmann <dh.herrmann@gmail.com> Reviewed-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--drivers/gpu/drm/drm_agpsupport.c1
-rw-r--r--drivers/gpu/drm/drm_legacy.h15
-rw-r--r--drivers/gpu/drm/drm_memory.c1
-rw-r--r--drivers/gpu/drm/drm_vm.c1
-rw-r--r--include/drm/drmP.h30
-rw-r--r--include/drm/drm_agpsupport.h13
6 files changed, 32 insertions, 29 deletions
diff --git a/drivers/gpu/drm/drm_agpsupport.c b/drivers/gpu/drm/drm_agpsupport.c
index dde205cef384..4b2b4aa5033b 100644
--- a/drivers/gpu/drm/drm_agpsupport.c
+++ b/drivers/gpu/drm/drm_agpsupport.c
@@ -34,6 +34,7 @@
34#include <drm/drmP.h> 34#include <drm/drmP.h>
35#include <linux/module.h> 35#include <linux/module.h>
36#include <linux/slab.h> 36#include <linux/slab.h>
37#include "drm_legacy.h"
37 38
38#if __OS_HAS_AGP 39#if __OS_HAS_AGP
39 40
diff --git a/drivers/gpu/drm/drm_legacy.h b/drivers/gpu/drm/drm_legacy.h
index 47cb9de98fb9..f2d076823b2d 100644
--- a/drivers/gpu/drm/drm_legacy.h
+++ b/drivers/gpu/drm/drm_legacy.h
@@ -28,6 +28,9 @@
28 * should no longer be using. They cannot be removed as legacy 28 * should no longer be using. They cannot be removed as legacy
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>
32
33struct agp_memory;
31struct drm_device; 34struct drm_device;
32struct drm_file; 35struct drm_file;
33 36
@@ -68,4 +71,16 @@ int drm_legacy_freebufs(struct drm_device *d, void *v, struct drm_file *f);
68int drm_legacy_mapbufs(struct drm_device *d, void *v, struct drm_file *f); 71int drm_legacy_mapbufs(struct drm_device *d, void *v, struct drm_file *f);
69int drm_legacy_dma_ioctl(struct drm_device *d, void *v, struct drm_file *f); 72int drm_legacy_dma_ioctl(struct drm_device *d, void *v, struct drm_file *f);
70 73
74/*
75 * AGP Support
76 */
77
78struct drm_agp_mem {
79 unsigned long handle;
80 struct agp_memory *memory;
81 unsigned long bound;
82 int pages;
83 struct list_head head;
84};
85
71#endif /* __DRM_LEGACY_H__ */ 86#endif /* __DRM_LEGACY_H__ */
diff --git a/drivers/gpu/drm/drm_memory.c b/drivers/gpu/drm/drm_memory.c
index 00c67c0f2381..7888dad5ab74 100644
--- a/drivers/gpu/drm/drm_memory.c
+++ b/drivers/gpu/drm/drm_memory.c
@@ -36,6 +36,7 @@
36#include <linux/highmem.h> 36#include <linux/highmem.h>
37#include <linux/export.h> 37#include <linux/export.h>
38#include <drm/drmP.h> 38#include <drm/drmP.h>
39#include "drm_legacy.h"
39 40
40#if __OS_HAS_AGP 41#if __OS_HAS_AGP
41static void *agp_remap(unsigned long offset, unsigned long size, 42static void *agp_remap(unsigned long offset, unsigned long size,
diff --git a/drivers/gpu/drm/drm_vm.c b/drivers/gpu/drm/drm_vm.c
index 352e3399d18f..be25174f10e4 100644
--- a/drivers/gpu/drm/drm_vm.c
+++ b/drivers/gpu/drm/drm_vm.c
@@ -40,6 +40,7 @@
40#include <linux/efi.h> 40#include <linux/efi.h>
41#include <linux/slab.h> 41#include <linux/slab.h>
42#endif 42#endif
43#include "drm_legacy.h"
43 44
44struct drm_vma_entry { 45struct drm_vma_entry {
45 struct list_head head; 46 struct list_head head;
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 0bf66f907f25..7a3c73c5375d 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -80,6 +80,7 @@ struct module;
80 80
81struct drm_file; 81struct drm_file;
82struct drm_device; 82struct drm_device;
83struct drm_agp_head;
83 84
84struct device_node; 85struct device_node;
85struct videomode; 86struct videomode;
@@ -440,35 +441,6 @@ struct drm_device_dma {
440}; 441};
441 442
442/** 443/**
443 * AGP memory entry. Stored as a doubly linked list.
444 */
445struct drm_agp_mem {
446 unsigned long handle; /**< handle */
447 struct agp_memory *memory;
448 unsigned long bound; /**< address */
449 int pages;
450 struct list_head head;
451};
452
453/**
454 * AGP data.
455 *
456 * \sa drm_agp_init() and drm_device::agp.
457 */
458struct drm_agp_head {
459 struct agp_kern_info agp_info; /**< AGP device information */
460 struct list_head memory;
461 unsigned long mode; /**< AGP mode */
462 struct agp_bridge_data *bridge;
463 int enabled; /**< whether the AGP bus as been enabled */
464 int acquired; /**< whether the AGP device has been acquired */
465 unsigned long base;
466 int agp_mtrr;
467 int cant_use_aperture;
468 unsigned long page_mask;
469};
470
471/**
472 * Scatter-gather memory. 444 * Scatter-gather memory.
473 */ 445 */
474struct drm_sg_mem { 446struct drm_sg_mem {
diff --git a/include/drm/drm_agpsupport.h b/include/drm/drm_agpsupport.h
index 86a02188074b..3bebeb4af864 100644
--- a/include/drm/drm_agpsupport.h
+++ b/include/drm/drm_agpsupport.h
@@ -8,6 +8,19 @@
8#include <linux/agp_backend.h> 8#include <linux/agp_backend.h>
9#include <drm/drmP.h> 9#include <drm/drmP.h>
10 10
11struct drm_agp_head {
12 struct agp_kern_info agp_info;
13 struct list_head memory;
14 unsigned long mode;
15 struct agp_bridge_data *bridge;
16 int enabled;
17 int acquired;
18 unsigned long base;
19 int agp_mtrr;
20 int cant_use_aperture;
21 unsigned long page_mask;
22};
23
11#if __OS_HAS_AGP 24#if __OS_HAS_AGP
12 25
13void drm_free_agp(struct agp_memory * handle, int pages); 26void drm_free_agp(struct agp_memory * handle, int pages);