• Bob Paauwe's avatar
    drm/i915: Only fence tiled region of object. · 0f1de5af
    Bob Paauwe authored
    commit af1a7301 upstream.
    
    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: default avatarDan Hettena <danh@ghs.com>
    Signed-off-by: default avatarBob Paauwe <bob.j.paauwe@intel.com>
    Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
    Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
    [lizf: Backported to 3.4:
     - adjust context
     - adjust indentation
     - make the same change to both sandybridge_write_fence_reg()
       and i965_write_fence_reg()]
    Signed-off-by: default avatarZefan Li <lizefan@huawei.com>
    0f1de5af
i915_gem.c 109 KB