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: e6588354360 ("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>
(cherry picked from commit 71ace23fa7ccb27eb4455e38f9254bac5c5b7f86)
This commit is contained in:
Kenneth Graunke 2022-08-24 15:11:32 -07:00 committed by Dylan Baker
parent c8ba293450
commit f5ae4c35fe
2 changed files with 5 additions and 3 deletions

View File

@ -10561,7 +10561,7 @@
"description": "iris: Use linear for exported resources if we can't convey tiling",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "e6588354360d102f3bfbfdfd484490a6ae296142"
},

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;
}