aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_gem.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-07-20 07:41:08 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-07-25 12:23:55 -0400
commita7b9761d0a2ded58170ffb4d423ff3d7228103f4 (patch)
tree46e5869a943be88f3068573d273f38f5a0372bcd /drivers/gpu/drm/i915/i915_gem.c
parent016fd0c1aee31902d82c1ac32312f1cc32298b66 (diff)
drm/i915: Split i915_gem_flush_ring() into seperate invalidate/flush funcs
By moving the function to intel_ringbuffer and currying the appropriate parameter, hopefully we make the callsites easier to read and understand. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem.c')
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c29
1 files changed, 3 insertions, 26 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 3659d47a9f6e..f26e2b201bad 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1549,13 +1549,9 @@ i915_add_request(struct intel_ring_buffer *ring,
1549 * is that the flush _must_ happen before the next request, no matter 1549 * is that the flush _must_ happen before the next request, no matter
1550 * what. 1550 * what.
1551 */ 1551 */
1552 if (ring->gpu_caches_dirty) { 1552 ret = intel_ring_flush_all_caches(ring);
1553 ret = i915_gem_flush_ring(ring, 0, I915_GEM_GPU_DOMAINS); 1553 if (ret)
1554 if (ret) 1554 return ret;
1555 return ret;
1556
1557 ring->gpu_caches_dirty = false;
1558 }
1559 1555
1560 if (request == NULL) { 1556 if (request == NULL) {
1561 request = kmalloc(sizeof(*request), GFP_KERNEL); 1557 request = kmalloc(sizeof(*request), GFP_KERNEL);
@@ -2254,25 +2250,6 @@ i915_gem_object_unbind(struct drm_i915_gem_object *obj)
2254 return ret; 2250 return ret;
2255} 2251}
2256 2252
2257int
2258i915_gem_flush_ring(struct intel_ring_buffer *ring,
2259 uint32_t invalidate_domains,
2260 uint32_t flush_domains)
2261{
2262 int ret;
2263
2264 if (((invalidate_domains | flush_domains) & I915_GEM_GPU_DOMAINS) == 0)
2265 return 0;
2266
2267 trace_i915_gem_ring_flush(ring, invalidate_domains, flush_domains);
2268
2269 ret = ring->flush(ring, invalidate_domains, flush_domains);
2270 if (ret)
2271 return ret;
2272
2273 return 0;
2274}
2275
2276static int i915_ring_idle(struct intel_ring_buffer *ring) 2253static int i915_ring_idle(struct intel_ring_buffer *ring)
2277{ 2254{
2278 if (list_empty(&ring->active_list)) 2255 if (list_empty(&ring->active_list))