iris: Use linear for exported resources if we can't convey tiling

If we have modifiers, we can use those to convey the tiling of exported
resources.  If we have the deprecated i915 GET/SET_TILING uAPI, we can
use that to convey the tiling.

If we have neither, then we have to fall back to linear.

Fixes: e658835436 ("iris/bufmgr: Do not use map_gtt or use set/get_tiling on DG1")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6938
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18240>
This commit is contained in:
Kenneth Graunke 2022-08-24 15:11:32 -07:00
parent d66e840ab4
commit 71ace23fa7

View file

@ -671,9 +671,11 @@ iris_resource_configure_main(const struct iris_screen *screen,
} else if (templ->usage == PIPE_USAGE_STAGING ||
templ->bind & (PIPE_BIND_LINEAR | PIPE_BIND_CURSOR)) {
tiling_flags = ISL_TILING_LINEAR_BIT;
} else if (!screen->devinfo.has_tiling_uapi &&
(templ->bind & (PIPE_BIND_SCANOUT | PIPE_BIND_SHARED))) {
tiling_flags = ISL_TILING_LINEAR_BIT;
} else if (templ->bind & PIPE_BIND_SCANOUT) {
tiling_flags = screen->devinfo.has_tiling_uapi ?
ISL_TILING_X_BIT : ISL_TILING_LINEAR_BIT;
tiling_flags = ISL_TILING_X_BIT;
} else {
tiling_flags = ISL_TILING_ANY_MASK;
}