From 0a5c3764c7c976ede0849493742699ef76e9d40c Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Sat, 17 Dec 2022 17:06:24 -0500 Subject: [PATCH] asahi: Make STAGING resources linear As intended by the flag. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/gallium/drivers/asahi/agx_pipe.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gallium/drivers/asahi/agx_pipe.c b/src/gallium/drivers/asahi/agx_pipe.c index 3607ad3..1129b6e 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; -- 2.7.4