diff options
author | Alyssa Rosenzweig <alyssa@rosenzweig.io> | 2022-12-17 17:06:24 -0500 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2023-02-04 07:45:12 +0000 |
commit | 0a5c3764c7c976ede0849493742699ef76e9d40c (patch) | |
tree | 5798b43bd60dd700a9cf51eca0008984f294d219 /src | |
parent | e7b97899ac92e9dc1390db017bad8e3ee492e047 (diff) |
asahi: Make STAGING resources linear
As intended by the flag.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21063>
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/drivers/asahi/agx_pipe.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gallium/drivers/asahi/agx_pipe.c b/src/gallium/drivers/asahi/agx_pipe.c index 3607ad3e4e2..1129b6e6b77 100644 --- a/src/gallium/drivers/asahi/agx_pipe.c +++ b/src/gallium/drivers/asahi/agx_pipe.c @@ -395,6 +395,12 @@ agx_select_modifier_from_list(const struct agx_resource *pres, static uint64_t agx_select_best_modifier(const struct agx_resource *pres) { + /* Prefer linear for staging resources, which should be as fast as possible + * to write from the CPU. + */ + if (agx_linear_allowed(pres) && pres->base.usage == PIPE_USAGE_STAGING) + return DRM_FORMAT_MOD_LINEAR; + if (agx_twiddled_allowed(pres)) { if (agx_compression_allowed(pres)) return DRM_FORMAT_MOD_APPLE_TWIDDLED_COMPRESSED; |