summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/i915_gem_internal.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-10-28 13:58:35 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2016-10-28 20:53:46 +0100
commita4f5ea64f0a818586b9de71803824b43dd01e517 (patch)
tree9a786a5df5fc622a5a3824580e489f0e9ee601d6 /drivers/gpu/drm/i915/i915_gem_internal.c
parentd2a84a76a3b970fa32e6eda3d85e7782f831379e (diff)
drm/i915: Refactor object page API
The plan is to make obtaining the backing storage for the object avoid struct_mutex (i.e. use its own locking). The first step is to update the API so that normal users only call pin/unpin whilst working on the backing storage. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/20161028125858.23563-12-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem_internal.c')
-rw-r--r--drivers/gpu/drm/i915/i915_gem_internal.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_internal.c b/drivers/gpu/drm/i915/i915_gem_internal.c
index 02e66fa170b0..08a2576ff7d2 100644
--- a/drivers/gpu/drm/i915/i915_gem_internal.c
+++ b/drivers/gpu/drm/i915/i915_gem_internal.c
@@ -102,10 +102,10 @@ static int i915_gem_object_get_pages_internal(struct drm_i915_gem_object *obj)
sg = __sg_next(sg);
} while (1);
- obj->pages = st;
+ obj->mm.pages = st;
if (i915_gem_gtt_prepare_object(obj)) {
- obj->pages = NULL;
+ obj->mm.pages = NULL;
goto err;
}
@@ -114,7 +114,7 @@ static int i915_gem_object_get_pages_internal(struct drm_i915_gem_object *obj)
* and the caller is expected to repopulate - the contents of this
* object are only valid whilst active and pinned.
*/
- obj->madv = I915_MADV_DONTNEED;
+ obj->mm.madv = I915_MADV_DONTNEED;
return 0;
err:
@@ -126,10 +126,10 @@ err:
static void i915_gem_object_put_pages_internal(struct drm_i915_gem_object *obj)
{
i915_gem_gtt_finish_object(obj);
- internal_free_pages(obj->pages);
+ internal_free_pages(obj->mm.pages);
- obj->dirty = 0;
- obj->madv = I915_MADV_WILLNEED;
+ obj->mm.dirty = false;
+ obj->mm.madv = I915_MADV_WILLNEED;
}
static const struct drm_i915_gem_object_ops i915_gem_object_internal_ops = {