iris: Don't call SET_TILING for dmabuf imports
authorNanley Chery <nanley.g.chery@intel.com>
Wed, 12 Aug 2020 00:01:31 +0000 (17:01 -0700)
committerMarge Bot <eric+marge@anholt.net>
Thu, 13 Aug 2020 22:03:48 +0000 (22:03 +0000)
commitc111e9099ceada50a2437e6e2e2a0f7cc6597448
tree7013a7e8821d03e1edde9e22a36851184740e0c8
parent0c97e601a422532ea673e842683982b1b4012e6d
iris: Don't call SET_TILING for dmabuf imports

Calling SET_TILING on a DMA buffer with the gen12 CCS modifier can fail
unnecessarily. The main surface in the BO is Y-tiled, but the CCS portion is
linear and can have a stride that's not a multiple of 128B. Because SET_TILING
is called on the CCS plane with I915_TILING_Y, the ioctl will sometimes reject
the stride.

SET_TILING was originally used in b6d45e7f748e9ff7e198391f5ce5d1253101fedb to
fix an assertion failure in iris_resource_from_handle. Assigning the BO's
tiling_mode field is sufficient to avoid the failure.

Fixes: c19492bcdb9 ("iris: Handle importing aux-enabled surfaces on TGL")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6296>
src/gallium/drivers/iris/iris_bufmgr.c
src/gallium/drivers/iris/iris_bufmgr.h
src/gallium/drivers/iris/iris_resource.c