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>
This commit is contained in:
Alyssa Rosenzweig 2022-12-17 17:06:24 -05:00 committed by Marge Bot
parent e7b97899ac
commit 0a5c3764c7

View file

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