[PATCH 16/17] drm/i915: Remove superfluous i915_add_request_no_flush() helper

Chris Wilson
2016-08-22T08:04:16Z

The only time we need to emit a flush inside request emission is after
an execbuffer, for which we can use the full __i915_add_request(). All
other instances want the simpler i915_add_request() without flushing, so
remove the useless helper.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
drivers/gpu/drm/i915/i915_gem_context.c | 2 +-
drivers/gpu/drm/i915/i915_gem_request.h | 2 --
drivers/gpu/drm/i915/intel_display.c | 4 ++--
drivers/gpu/drm/i915/intel_overlay.c | 8 ++++----
drivers/gpu/drm/i915/intel_pm.c | 2 +-
5 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
index 3b4eec676d66..e71cf17bba61 100644
--- a/drivers/gpu/drm/i915/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/i915_gem_context.c
@@ -1034,7 +1034,7 @@ int i915_gem_switch_to_kernel_context(struct drm_i915_private *dev_priv)
return PTR_ERR(req);

ret = i915_switch_context(req);
- i915_add_request_no_flush(req);
+ i915_add_request(req);
if (ret)
return ret;
}
diff --git a/drivers/gpu/drm/i915/i915_gem_request.h b/drivers/gpu/drm/i915/i915_gem_request.h
index 9d5a66bfc509..b556c1082a34 100644
--- a/drivers/gpu/drm/i915/i915_gem_request.h
+++ b/drivers/gpu/drm/i915/i915_gem_request.h
@@ -222,8 +222,6 @@ static inline void i915_gem_request_assign(struct drm_i915_gem_request **pdst,

void __i915_add_request(struct drm_i915_gem_request *req, bool flush_caches);
#define i915_add_request(req) \
- __i915_add_request(req, true)
-#define i915_add_request_no_flush(req) \
__i915_add_request(req, false)

struct intel_rps_client;
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 4c6cb64ec220..a44c2313c4f2 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -12149,7 +12149,7 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
intel_mark_page_flip_active(intel_crtc, work);

work->flip_queued_req = i915_gem_request_get(request);
- i915_add_request_no_flush(request);
+ i915_add_request(request);
}

i915_gem_track_fb(intel_fb_obj(old_fb), obj,
@@ -12164,7 +12164,7 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
return 0;

cleanup_request:
- i915_add_request_no_flush(request);
+ i915_add_request(request);
cleanup_unpin:
to_intel_plane_state(primary->state)->vma = work->old_vma;
intel_unpin_fb_vma(vma);
diff --git a/drivers/gpu/drm/i915/intel_overlay.c b/drivers/gpu/drm/i915/intel_overlay.c
index 7c392547711f..dde486cd2cd8 100644
--- a/drivers/gpu/drm/i915/intel_overlay.c
+++ b/drivers/gpu/drm/i915/intel_overlay.c
@@ -255,7 +255,7 @@ static int intel_overlay_on(struct intel_overlay *overlay)

ret = intel_ring_begin(req, 4);
if (ret) {
- i915_add_request_no_flush(req);
+ i915_add_request(req);
return ret;
}

@@ -298,7 +298,7 @@ static int intel_overlay_continue(struct intel_overlay *overlay,

ret = intel_ring_begin(req, 2);
if (ret) {
- i915_add_request_no_flush(req);
+ i915_add_request(req);
return ret;
}

@@ -373,7 +373,7 @@ static int intel_overlay_off(struct intel_overlay *overlay)

ret = intel_ring_begin(req, 6);
if (ret) {
- i915_add_request_no_flush(req);
+ i915_add_request(req);
return ret;
}

@@ -437,7 +437,7 @@ static int intel_overlay_release_old_vid(struct intel_overlay *overlay)

ret = intel_ring_begin(req, 2);
if (ret) {
- i915_add_request_no_flush(req);
+ i915_add_request(req);
return ret;
}

diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 8a6751e14ab9..5633aa66f64b 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -6676,7 +6676,7 @@ static void __intel_autoenable_gt_powersave(struct work_struct *work)
rcs->init_context(req);

/* Mark the device busy, calling intel_enable_gt_powersave() */
- i915_add_request_no_flush(req);
+ i915_add_request(req);

unlock:
mutex_unlock(&dev_priv->drm.struct_mutex);
--
2.9.3