Commit 8726a2a4 authored by Tvrtko Ursulin's avatar Tvrtko Ursulin Committed by Chris Wilson

drm/i915: Split drop caches into GT and i915 parts

Just compartmentalizes code a bit more.
Signed-off-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20191022094726.3001-8-tvrtko.ursulin@linux.intel.com
parent 7f63aa23
...@@ -3648,17 +3648,11 @@ i915_drop_caches_get(void *data, u64 *val) ...@@ -3648,17 +3648,11 @@ i915_drop_caches_get(void *data, u64 *val)
return 0; return 0;
} }
static int static int
i915_drop_caches_set(void *data, u64 val) gt_drop_caches(struct intel_gt *gt, u64 val)
{ {
struct drm_i915_private *i915 = data;
struct intel_gt *gt = &i915->gt;
int ret; int ret;
DRM_DEBUG("Dropping caches: 0x%08llx [0x%08llx]\n",
val, val & DROP_ALL);
if (val & DROP_RESET_ACTIVE && if (val & DROP_RESET_ACTIVE &&
wait_for(intel_engines_are_idle(gt), I915_IDLE_ENGINES_TIMEOUT)) wait_for(intel_engines_are_idle(gt), I915_IDLE_ENGINES_TIMEOUT))
intel_gt_set_wedged(gt); intel_gt_set_wedged(gt);
...@@ -3681,6 +3675,22 @@ i915_drop_caches_set(void *data, u64 val) ...@@ -3681,6 +3675,22 @@ i915_drop_caches_set(void *data, u64 val)
if (val & DROP_RESET_ACTIVE && intel_gt_terminally_wedged(gt)) if (val & DROP_RESET_ACTIVE && intel_gt_terminally_wedged(gt))
intel_gt_handle_error(gt, ALL_ENGINES, 0, NULL); intel_gt_handle_error(gt, ALL_ENGINES, 0, NULL);
return 0;
}
static int
i915_drop_caches_set(void *data, u64 val)
{
struct drm_i915_private *i915 = data;
int ret;
DRM_DEBUG("Dropping caches: 0x%08llx [0x%08llx]\n",
val, val & DROP_ALL);
ret = gt_drop_caches(&i915->gt, val);
if (ret)
return ret;
fs_reclaim_acquire(GFP_KERNEL); fs_reclaim_acquire(GFP_KERNEL);
if (val & DROP_BOUND) if (val & DROP_BOUND)
i915_gem_shrink(i915, LONG_MAX, NULL, I915_SHRINK_BOUND); i915_gem_shrink(i915, LONG_MAX, NULL, I915_SHRINK_BOUND);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment