OSDN Git Service

drm/i915: Store a permanent error in obj->mm.pages
authorChris Wilson <chris@chris-wilson.co.uk>
Tue, 7 Mar 2017 13:20:31 +0000 (13:20 +0000)
committerJani Nikula <jani.nikula@intel.com>
Thu, 9 Mar 2017 08:45:58 +0000 (10:45 +0200)
commit0d9dc306e15b59bf50db87ebcb1e2248586d4733
tree13c1f1e3caa5840f275108b0028471ab04954835
parent38230243ef316ac696956d75dc78a22e3aa789b9
drm/i915: Store a permanent error in obj->mm.pages

Once the object has been truncated, it is unrecoverable. To facilitate
detection of this state store the error in obj->mm.pages.

This is required for the next patch which should be applied to v4.10
(via stable), so we also need to mark this patch for backporting. In
that regard, let's consider this to be a fix/improvement too.

v2: Avoid dereferencing the ERR_PTR when freeing the object.

Fixes: 1233e2db199d ("drm/i915: Move object backing storage manipulation to its own locking")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: <stable@vger.kernel.org> # v4.10+
Link: http://patchwork.freedesktop.org/patch/msgid/20170307132031.32461-1-chris@chris-wilson.co.uk
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
(cherry picked from commit 4e5462ee843c883790e9609cf560d88960ea4227)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/i915_gem.c