diff options
author | Ben Widawsky <[email protected]> | 2016-02-09 11:44:12 -0800 |
---|---|---|
committer | Daniel Vetter <[email protected]> | 2016-02-15 18:26:52 +0100 |
commit | 1db6e2e7dc2739181bd55c3c41263634803b3cc9 (patch) | |
tree | 6b9bb684fc37d028e1d29bda1e6c3f8c1f87b16e | |
parent | b31e51360e88f8f9831a153cf72d1aced952dffb (diff) |
drm/i915: Check for get_pages instead of shmem (filp)
This behavior of checking for a shmem backed GEM object was introduced here:
commit 4c914c0c7c787b8f730128a8cdcca9c50b0784ab
Author: Brad Volkin <[email protected]>
Date: Tue Feb 18 10:15:45 2014 -0800
drm/i915: Refactor shmem pread setup
It is possible for an object to not be a shmem backed GEM object (for example
userptr objects). An example of how we hit this failure can be found through
copy_batch() in the command parser because we allocate a userptr object for the
batch which contains privileged instructions. Userptr calls
drm_gem_private_object_init() which explicitly sets the filp to none.
NOTE: I manually retyped this from a test machine. So I haven't even compiled
this exact patch.
v2: Use same logic as from a2a4f916c2f (Kristian, Dave Gordon)
Cc: Chris Wilson <[email protected]>
Cc: Kristian Høgsberg <[email protected]>
Cc: Dave Gordon <[email protected]>
Signed-off-by: Ben Widawsky <[email protected]>
Tested-by: Jordan Justen <[email protected]> (v1)
Reviewed-by: Jordan Justen <[email protected]> (v1)
Signed-off-by: Daniel Vetter <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index fc84ee5b7f36..f68f34606f2f 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -489,7 +489,7 @@ int i915_gem_obj_prepare_shmem_read(struct drm_i915_gem_object *obj, *needs_clflush = 0; - if (!obj->base.filp) + if (WARN_ON((obj->ops->flags & I915_GEM_OBJECT_HAS_STRUCT_PAGE) == 0)) return -EINVAL; if (!(obj->base.read_domains & I915_GEM_DOMAIN_CPU)) { |