[Intel-gfx] [PATCH] i915: Set object to gtt domain when faulting it back in
Vasily Khoruzhick
anarsoul at gmail.com
Wed May 27 21:23:41 CEST 2009
On Wednesday 27 May 2009 21:37:28 Kristian Høgsberg wrote:
> From: Kristian Høgsberg <krh at redhat.com>
>
> When a GEM object is evicted from the GTT we set it to the CPU domain,
> as it might get swapped in and out or ever mmapped regularly. If the
> object is mmapped through the GTT it can still get evicted in this way
> by other objects requiring GTT space. When the GTT mapping is touched
> again we fault it back into the GTT, but fail to set it back to the
> GTT domain. This means we fail to flush any cached CPU writes to the
> pages backing the object which will then happen "eventually", typically
> after we write to the page through the uncached GTT mapping.
>
> Signed-off-by: Kristian Høgsberg <krh at redhat.com>
> ---
> drivers/gpu/drm/i915/i915_gem.c | 7 +++++++
> 1 files changed, 7 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem.c
> b/drivers/gpu/drm/i915/i915_gem.c index 4a24c90..2500510 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -1145,6 +1145,13 @@ int i915_gem_fault(struct vm_area_struct *vma,
> struct vm_fault *vmf) mutex_unlock(&dev->struct_mutex);
> return VM_FAULT_SIGBUS;
> }
> +
> + ret = i915_gem_object_set_to_gtt_domain(obj, write);
> + if (ret) {
> + mutex_unlock(&dev->struct_mutex);
> + return VM_FAULT_SIGBUS;
> + }
> +
> list_add(&obj_priv->list, &dev_priv->mm.inactive_list);
> }
It seems that this patch fixes bug
http://bugs.freedesktop.org/show_bug.cgi?id=21415 for me.
Thanks!
Regards
Vasily
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20090527/e4c6bd8e/attachment.sig>
More information about the Intel-gfx
mailing list