diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-09-19 10:05:13 -0400 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-09-21 06:19:59 -0400 |
commit | c7f9f9a8b89bb4d53edc030f5b61ae11d6859721 (patch) | |
tree | 1cc879aa1b228a0fd5569f56776ad12f811cfd68 /drivers/gpu/drm | |
parent | e070868ef2101ce548d4fbb25edfd301e59fb719 (diff) |
drm/i915: Use ring->flush() instead of MI_FLUSH
Use the ring abstraction to hide the details of having choose the
appropriate flushing method.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/i915/i915_drv.h | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 31 |
3 files changed, 20 insertions, 17 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 4b6812015056..790ffec135df 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h | |||
@@ -1001,6 +1001,10 @@ void i915_gem_retire_requests(struct drm_device *dev); | |||
1001 | void i915_gem_reset_flushing_list(struct drm_device *dev); | 1001 | void i915_gem_reset_flushing_list(struct drm_device *dev); |
1002 | void i915_gem_reset_inactive_gpu_domains(struct drm_device *dev); | 1002 | void i915_gem_reset_inactive_gpu_domains(struct drm_device *dev); |
1003 | void i915_gem_clflush_object(struct drm_gem_object *obj); | 1003 | void i915_gem_clflush_object(struct drm_gem_object *obj); |
1004 | void i915_gem_flush_ring(struct drm_device *dev, | ||
1005 | struct intel_ring_buffer *ring, | ||
1006 | uint32_t invalidate_domains, | ||
1007 | uint32_t flush_domains); | ||
1004 | int i915_gem_object_set_domain(struct drm_gem_object *obj, | 1008 | int i915_gem_object_set_domain(struct drm_gem_object *obj, |
1005 | uint32_t read_domains, | 1009 | uint32_t read_domains, |
1006 | uint32_t write_domain); | 1010 | uint32_t write_domain); |
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 7b33b4d5ebff..b242530ffcbd 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
@@ -1908,7 +1908,7 @@ i915_wait_request(struct drm_device *dev, uint32_t seqno, | |||
1908 | return i915_do_wait_request(dev, seqno, 1, ring); | 1908 | return i915_do_wait_request(dev, seqno, 1, ring); |
1909 | } | 1909 | } |
1910 | 1910 | ||
1911 | static void | 1911 | void |
1912 | i915_gem_flush_ring(struct drm_device *dev, | 1912 | i915_gem_flush_ring(struct drm_device *dev, |
1913 | struct intel_ring_buffer *ring, | 1913 | struct intel_ring_buffer *ring, |
1914 | uint32_t invalidate_domains, | 1914 | uint32_t invalidate_domains, |
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index c3f0400963de..0505ddb76a10 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -5056,24 +5056,23 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc, | |||
5056 | atomic_inc(&obj_priv->pending_flip); | 5056 | atomic_inc(&obj_priv->pending_flip); |
5057 | work->pending_flip_obj = obj; | 5057 | work->pending_flip_obj = obj; |
5058 | 5058 | ||
5059 | if (was_dirty || IS_GEN3(dev) || IS_GEN2(dev)) { | 5059 | /* Schedule the pipelined flush */ |
5060 | BEGIN_LP_RING(2); | 5060 | if (was_dirty) |
5061 | if (IS_GEN3(dev) || IS_GEN2(dev)) { | 5061 | i915_gem_flush_ring(dev, obj_priv->ring, 0, was_dirty); |
5062 | u32 flip_mask; | ||
5063 | 5062 | ||
5064 | /* Can't queue multiple flips, so wait for the previous | 5063 | if (IS_GEN3(dev) || IS_GEN2(dev)) { |
5065 | * one to finish before executing the next. | 5064 | u32 flip_mask; |
5066 | */ | ||
5067 | 5065 | ||
5068 | if (intel_crtc->plane) | 5066 | /* Can't queue multiple flips, so wait for the previous |
5069 | flip_mask = MI_WAIT_FOR_PLANE_B_FLIP; | 5067 | * one to finish before executing the next. |
5070 | else | 5068 | */ |
5071 | flip_mask = MI_WAIT_FOR_PLANE_A_FLIP; | 5069 | BEGIN_LP_RING(2); |
5072 | 5070 | if (intel_crtc->plane) | |
5073 | OUT_RING(MI_WAIT_FOR_EVENT | flip_mask); | 5071 | flip_mask = MI_WAIT_FOR_PLANE_B_FLIP; |
5074 | } else | 5072 | else |
5075 | OUT_RING(MI_NOOP); | 5073 | flip_mask = MI_WAIT_FOR_PLANE_A_FLIP; |
5076 | OUT_RING(MI_FLUSH); | 5074 | OUT_RING(MI_WAIT_FOR_EVENT | flip_mask); |
5075 | OUT_RING(MI_NOOP); | ||
5077 | ADVANCE_LP_RING(); | 5076 | ADVANCE_LP_RING(); |
5078 | } | 5077 | } |
5079 | 5078 | ||