aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_ringbuffer.h
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-10-27 07:18:21 -0400
committerChris Wilson <chris@chris-wilson.co.uk>2010-10-27 07:18:21 -0400
commit78501eac34f372bfbeb4e1d9de688c13efa916f6 (patch)
treea490359ac69c394149362e6571a37189ee264739 /drivers/gpu/drm/i915/intel_ringbuffer.h
parentdd2b379f071424f36f9f90ff83cb4ad058c7b6ed (diff)
drm/i915/ringbuffer: Drop the redundant dev from the vfunc interface
The ringbuffer keeps a pointer to the parent device, so we can use that instead of passing around the pointer on the stack. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_ringbuffer.h')
-rw-r--r--drivers/gpu/drm/i915/intel_ringbuffer.h76
1 files changed, 28 insertions, 48 deletions
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.h b/drivers/gpu/drm/i915/intel_ringbuffer.h
index a05aff0e5764..ba4a393e6d16 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.h
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.h
@@ -2,7 +2,7 @@
2#define _INTEL_RINGBUFFER_H_ 2#define _INTEL_RINGBUFFER_H_
3 3
4struct intel_hw_status_page { 4struct intel_hw_status_page {
5 void *page_addr; 5 u32 __iomem *page_addr;
6 unsigned int gfx_addr; 6 unsigned int gfx_addr;
7 struct drm_gem_object *obj; 7 struct drm_gem_object *obj;
8}; 8};
@@ -38,31 +38,23 @@ struct intel_ring_buffer {
38 u32 irq_gem_seqno; /* last seq seem at irq time */ 38 u32 irq_gem_seqno; /* last seq seem at irq time */
39 u32 waiting_gem_seqno; 39 u32 waiting_gem_seqno;
40 int user_irq_refcount; 40 int user_irq_refcount;
41 void (*user_irq_get)(struct drm_device *dev, 41 void (*user_irq_get)(struct intel_ring_buffer *ring);
42 struct intel_ring_buffer *ring); 42 void (*user_irq_put)(struct intel_ring_buffer *ring);
43 void (*user_irq_put)(struct drm_device *dev,
44 struct intel_ring_buffer *ring);
45 43
46 int (*init)(struct drm_device *dev, 44 int (*init)(struct intel_ring_buffer *ring);
47 struct intel_ring_buffer *ring);
48 45
49 void (*write_tail)(struct drm_device *dev, 46 void (*write_tail)(struct intel_ring_buffer *ring,
50 struct intel_ring_buffer *ring,
51 u32 value); 47 u32 value);
52 void (*flush)(struct drm_device *dev, 48 void (*flush)(struct intel_ring_buffer *ring,
53 struct intel_ring_buffer *ring, 49 u32 invalidate_domains,
54 u32 invalidate_domains, 50 u32 flush_domains);
55 u32 flush_domains); 51 u32 (*add_request)(struct intel_ring_buffer *ring,
56 u32 (*add_request)(struct drm_device *dev, 52 u32 flush_domains);
57 struct intel_ring_buffer *ring, 53 u32 (*get_seqno)(struct intel_ring_buffer *ring);
58 u32 flush_domains); 54 int (*dispatch_execbuffer)(struct intel_ring_buffer *ring,
59 u32 (*get_seqno)(struct drm_device *dev, 55 struct drm_i915_gem_execbuffer2 *exec,
60 struct intel_ring_buffer *ring); 56 struct drm_clip_rect *cliprects,
61 int (*dispatch_gem_execbuffer)(struct drm_device *dev, 57 uint64_t exec_offset);
62 struct intel_ring_buffer *ring,
63 struct drm_i915_gem_execbuffer2 *exec,
64 struct drm_clip_rect *cliprects,
65 uint64_t exec_offset);
66 58
67 /** 59 /**
68 * List of objects currently involved in rendering from the 60 * List of objects currently involved in rendering from the
@@ -102,43 +94,31 @@ struct intel_ring_buffer {
102 94
103static inline u32 95static inline u32
104intel_read_status_page(struct intel_ring_buffer *ring, 96intel_read_status_page(struct intel_ring_buffer *ring,
105 int reg) 97 int reg)
106{ 98{
107 u32 *regs = ring->status_page.page_addr; 99 return ioread32(ring->status_page.page_addr + reg);
108 return regs[reg];
109} 100}
110 101
111int intel_init_ring_buffer(struct drm_device *dev, 102void intel_cleanup_ring_buffer(struct intel_ring_buffer *ring);
112 struct intel_ring_buffer *ring); 103int intel_wait_ring_buffer(struct intel_ring_buffer *ring, int n);
113void intel_cleanup_ring_buffer(struct drm_device *dev, 104void intel_ring_begin(struct intel_ring_buffer *ring, int n);
114 struct intel_ring_buffer *ring); 105
115int intel_wait_ring_buffer(struct drm_device *dev, 106static inline void intel_ring_emit(struct intel_ring_buffer *ring,
116 struct intel_ring_buffer *ring, int n); 107 u32 data)
117void intel_ring_begin(struct drm_device *dev,
118 struct intel_ring_buffer *ring, int n);
119
120static inline void intel_ring_emit(struct drm_device *dev,
121 struct intel_ring_buffer *ring,
122 unsigned int data)
123{ 108{
124 unsigned int *virt = ring->virtual_start + ring->tail; 109 iowrite32(data, ring->virtual_start + ring->tail);
125 *virt = data;
126 ring->tail += 4; 110 ring->tail += 4;
127} 111}
128 112
129void intel_ring_advance(struct drm_device *dev, 113void intel_ring_advance(struct intel_ring_buffer *ring);
130 struct intel_ring_buffer *ring);
131 114
132u32 intel_ring_get_seqno(struct drm_device *dev, 115u32 intel_ring_get_seqno(struct intel_ring_buffer *ring);
133 struct intel_ring_buffer *ring);
134 116
135int intel_init_render_ring_buffer(struct drm_device *dev); 117int intel_init_render_ring_buffer(struct drm_device *dev);
136int intel_init_bsd_ring_buffer(struct drm_device *dev); 118int intel_init_bsd_ring_buffer(struct drm_device *dev);
137int intel_init_blt_ring_buffer(struct drm_device *dev); 119int intel_init_blt_ring_buffer(struct drm_device *dev);
138 120
139u32 intel_ring_get_active_head(struct drm_device *dev, 121u32 intel_ring_get_active_head(struct intel_ring_buffer *ring);
140 struct intel_ring_buffer *ring); 122void intel_ring_setup_status_page(struct intel_ring_buffer *ring);
141void intel_ring_setup_status_page(struct drm_device *dev,
142 struct intel_ring_buffer *ring);
143 123
144#endif /* _INTEL_RINGBUFFER_H_ */ 124#endif /* _INTEL_RINGBUFFER_H_ */