mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 05:44:11 +00:00
drm/i915: Double check activity before relocations
If the object is active and we need to perform a relocation upon it, we need to take the slow relocation path. Before we do, double check the active requests to see if they have completed. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1470293567-10811-22-git-send-email-chris@chris-wilson.co.uk
This commit is contained in:
parent
776f32364d
commit
909d074c31
1 changed files with 15 additions and 1 deletions
|
@ -441,6 +441,20 @@ relocate_entry_clflush(struct drm_i915_gem_object *obj,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool object_is_idle(struct drm_i915_gem_object *obj)
|
||||||
|
{
|
||||||
|
unsigned long active = obj->active;
|
||||||
|
int idx;
|
||||||
|
|
||||||
|
for_each_active(active, idx) {
|
||||||
|
if (!i915_gem_active_is_idle(&obj->last_read[idx],
|
||||||
|
&obj->base.dev->struct_mutex))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
i915_gem_execbuffer_relocate_entry(struct drm_i915_gem_object *obj,
|
i915_gem_execbuffer_relocate_entry(struct drm_i915_gem_object *obj,
|
||||||
struct eb_vmas *eb,
|
struct eb_vmas *eb,
|
||||||
|
@ -524,7 +538,7 @@ i915_gem_execbuffer_relocate_entry(struct drm_i915_gem_object *obj,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We can't wait for rendering with pagefaults disabled */
|
/* We can't wait for rendering with pagefaults disabled */
|
||||||
if (obj->active && pagefault_disabled())
|
if (pagefault_disabled() && !object_is_idle(obj))
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
|
|
||||||
if (use_cpu_reloc(obj))
|
if (use_cpu_reloc(obj))
|
||||||
|
|
Loading…
Reference in a new issue