Module: Mesa Branch: staging/22.2 Commit: 0cc636799e750a9b1ba806881169439d4238e592 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=0cc636799e750a9b1ba806881169439d4238e592
Author: Kenneth Graunke <[email protected]> Date: Wed Aug 24 15:11:32 2022 -0700 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 <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18240> (cherry picked from commit 71ace23fa7ccb27eb4455e38f9254bac5c5b7f86) --- .pick_status.json | 2 +- src/gallium/drivers/iris/iris_resource.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 8828874238d..3f9587e99d7 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -3154,7 +3154,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" }, diff --git a/src/gallium/drivers/iris/iris_resource.c b/src/gallium/drivers/iris/iris_resource.c index d1adaa1722a..c432788421d 100644 --- a/src/gallium/drivers/iris/iris_resource.c +++ b/src/gallium/drivers/iris/iris_resource.c @@ -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; }
