aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/drm/drm_mm.h40
-rw-r--r--include/drm/intel-gtt.h2
2 files changed, 40 insertions, 2 deletions
diff --git a/include/drm/drm_mm.h b/include/drm/drm_mm.h
index 0f4a366f6fa6..9b991f91d81b 100644
--- a/include/drm/drm_mm.h
+++ b/include/drm/drm_mm.h
@@ -89,6 +89,29 @@ static inline bool drm_mm_initialized(struct drm_mm *mm)
89{ 89{
90 return mm->hole_stack.next; 90 return mm->hole_stack.next;
91} 91}
92
93static inline unsigned long __drm_mm_hole_node_start(struct drm_mm_node *hole_node)
94{
95 return hole_node->start + hole_node->size;
96}
97
98static inline unsigned long drm_mm_hole_node_start(struct drm_mm_node *hole_node)
99{
100 BUG_ON(!hole_node->hole_follows);
101 return __drm_mm_hole_node_start(hole_node);
102}
103
104static inline unsigned long __drm_mm_hole_node_end(struct drm_mm_node *hole_node)
105{
106 return list_entry(hole_node->node_list.next,
107 struct drm_mm_node, node_list)->start;
108}
109
110static inline unsigned long drm_mm_hole_node_end(struct drm_mm_node *hole_node)
111{
112 return __drm_mm_hole_node_end(hole_node);
113}
114
92#define drm_mm_for_each_node(entry, mm) list_for_each_entry(entry, \ 115#define drm_mm_for_each_node(entry, mm) list_for_each_entry(entry, \
93 &(mm)->head_node.node_list, \ 116 &(mm)->head_node.node_list, \
94 node_list) 117 node_list)
@@ -99,9 +122,26 @@ static inline bool drm_mm_initialized(struct drm_mm *mm)
99 entry != NULL; entry = next, \ 122 entry != NULL; entry = next, \
100 next = entry ? list_entry(entry->node_list.next, \ 123 next = entry ? list_entry(entry->node_list.next, \
101 struct drm_mm_node, node_list) : NULL) \ 124 struct drm_mm_node, node_list) : NULL) \
125
126/* Note that we need to unroll list_for_each_entry in order to inline
127 * setting hole_start and hole_end on each iteration and keep the
128 * macro sane.
129 */
130#define drm_mm_for_each_hole(entry, mm, hole_start, hole_end) \
131 for (entry = list_entry((mm)->hole_stack.next, struct drm_mm_node, hole_stack); \
132 &entry->hole_stack != &(mm)->hole_stack ? \
133 hole_start = drm_mm_hole_node_start(entry), \
134 hole_end = drm_mm_hole_node_end(entry), \
135 1 : 0; \
136 entry = list_entry(entry->hole_stack.next, struct drm_mm_node, hole_stack))
137
102/* 138/*
103 * Basic range manager support (drm_mm.c) 139 * Basic range manager support (drm_mm.c)
104 */ 140 */
141extern struct drm_mm_node *drm_mm_create_block(struct drm_mm *mm,
142 unsigned long start,
143 unsigned long size,
144 bool atomic);
105extern struct drm_mm_node *drm_mm_get_block_generic(struct drm_mm_node *node, 145extern struct drm_mm_node *drm_mm_get_block_generic(struct drm_mm_node *node,
106 unsigned long size, 146 unsigned long size,
107 unsigned alignment, 147 unsigned alignment,
diff --git a/include/drm/intel-gtt.h b/include/drm/intel-gtt.h
index 6eb76a1f11ab..3e3a166a2690 100644
--- a/include/drm/intel-gtt.h
+++ b/include/drm/intel-gtt.h
@@ -18,8 +18,6 @@ struct intel_gtt {
18 /* Share the scratch page dma with ppgtts. */ 18 /* Share the scratch page dma with ppgtts. */
19 dma_addr_t scratch_page_dma; 19 dma_addr_t scratch_page_dma;
20 struct page *scratch_page; 20 struct page *scratch_page;
21 /* for ppgtt PDE access */
22 u32 __iomem *gtt;
23 /* needed for ioremap in drm/i915 */ 21 /* needed for ioremap in drm/i915 */
24 phys_addr_t gma_bus_addr; 22 phys_addr_t gma_bus_addr;
25} *intel_gtt_get(void); 23} *intel_gtt_get(void);