Skip to content

Commit aae7c06

Browse files
committed
drm/i915: Flag any possible writes for a GTT fault
We do not explicitly mark the PTE for the user's GTT mmap as being wrprotect, so we don't get a refault when we would need to change a read-only mmapping into read-write. As such, we must presume that if the vma has PROT_WRITE it may be written to, although this is supposed to be indicated by set-domain there are cases (e.g. after swap) where userspace may not be aware of the implicit domain change. Signed-off-by: Chris Wilson <[email protected]> Reviewed-by: Joonas Lahtinen <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 2bfbf6f commit aae7c06

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/i915/i915_gem.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2018,7 +2018,7 @@ vm_fault_t i915_gem_fault(struct vm_fault *vmf)
20182018
struct drm_device *dev = obj->base.dev;
20192019
struct drm_i915_private *dev_priv = to_i915(dev);
20202020
struct i915_ggtt *ggtt = &dev_priv->ggtt;
2021-
bool write = !!(vmf->flags & FAULT_FLAG_WRITE);
2021+
bool write = area->vm_flags & VM_WRITE;
20222022
struct i915_vma *vma;
20232023
pgoff_t page_offset;
20242024
int ret;

0 commit comments

Comments
 (0)