diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-10-27 07:18:21 -0400 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-10-27 07:18:21 -0400 |
commit | 78501eac34f372bfbeb4e1d9de688c13efa916f6 (patch) | |
tree | a490359ac69c394149362e6571a37189ee264739 /drivers/gpu/drm/i915/intel_ringbuffer.h | |
parent | dd2b379f071424f36f9f90ff83cb4ad058c7b6ed (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.h | 76 |
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 | ||
4 | struct intel_hw_status_page { | 4 | struct 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 | ||
103 | static inline u32 | 95 | static inline u32 |
104 | intel_read_status_page(struct intel_ring_buffer *ring, | 96 | intel_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 | ||
111 | int intel_init_ring_buffer(struct drm_device *dev, | 102 | void intel_cleanup_ring_buffer(struct intel_ring_buffer *ring); |
112 | struct intel_ring_buffer *ring); | 103 | int intel_wait_ring_buffer(struct intel_ring_buffer *ring, int n); |
113 | void intel_cleanup_ring_buffer(struct drm_device *dev, | 104 | void intel_ring_begin(struct intel_ring_buffer *ring, int n); |
114 | struct intel_ring_buffer *ring); | 105 | |
115 | int intel_wait_ring_buffer(struct drm_device *dev, | 106 | static inline void intel_ring_emit(struct intel_ring_buffer *ring, |
116 | struct intel_ring_buffer *ring, int n); | 107 | u32 data) |
117 | void intel_ring_begin(struct drm_device *dev, | ||
118 | struct intel_ring_buffer *ring, int n); | ||
119 | |||
120 | static 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 | ||
129 | void intel_ring_advance(struct drm_device *dev, | 113 | void intel_ring_advance(struct intel_ring_buffer *ring); |
130 | struct intel_ring_buffer *ring); | ||
131 | 114 | ||
132 | u32 intel_ring_get_seqno(struct drm_device *dev, | 115 | u32 intel_ring_get_seqno(struct intel_ring_buffer *ring); |
133 | struct intel_ring_buffer *ring); | ||
134 | 116 | ||
135 | int intel_init_render_ring_buffer(struct drm_device *dev); | 117 | int intel_init_render_ring_buffer(struct drm_device *dev); |
136 | int intel_init_bsd_ring_buffer(struct drm_device *dev); | 118 | int intel_init_bsd_ring_buffer(struct drm_device *dev); |
137 | int intel_init_blt_ring_buffer(struct drm_device *dev); | 119 | int intel_init_blt_ring_buffer(struct drm_device *dev); |
138 | 120 | ||
139 | u32 intel_ring_get_active_head(struct drm_device *dev, | 121 | u32 intel_ring_get_active_head(struct intel_ring_buffer *ring); |
140 | struct intel_ring_buffer *ring); | 122 | void intel_ring_setup_status_page(struct intel_ring_buffer *ring); |
141 | void 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_ */ |