]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Only fence tiled region of object.
authorBob Paauwe <bob.j.paauwe@intel.com>
Thu, 18 Dec 2014 17:51:26 +0000 (09:51 -0800)
committerJani Nikula <jani.nikula@intel.com>
Mon, 26 Jan 2015 09:00:33 +0000 (11:00 +0200)
commit55ebb9a24994f22388c58cb30cc8bc6699d55e04
tree0b11d6c7a0a9b15ac8ad2a46352e250f1d5e395d
parent061258cb9a3d633456954127e2a5c19d18ea45a5
drm/i915: Only fence tiled region of object.

When creating a fence for a tiled object, only fence the area that
makes up the actual tiles.  The object may be larger than the tiled
area and if we allow those extra addresses to be fenced, they'll
get converted to addresses beyond where the object is mapped. This
opens up the possiblity of writes beyond the end of object.

To prevent this, we adjust the size of the fence to only encompass
the area that makes up the actual tiles.  The extra space is considered
un-tiled and now behaves as if it was a linear object.

Testcase: igt/gem_tiled_fence_overflow
Reported-by: Dan Hettena <danh@ghs.com>
Signed-off-by: Bob Paauwe <bob.j.paauwe@intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: stable@vger.kernel.org
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/i915_gem.c