From 3116f9801b66eee1b24720121e995a94d2feadbb Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 15 Feb 2021 07:50:58 +1000 Subject: [PATCH] u_surface: use optimised memset64 Use the newly added optimised memset64 path Reviewed-by: Eric Anholt Part-of: --- src/gallium/auxiliary/util/u_surface.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/gallium/auxiliary/util/u_surface.c b/src/gallium/auxiliary/util/u_surface.c index e45dea268ba..1a8acb3587c 100644 --- a/src/gallium/auxiliary/util/u_surface.c +++ b/src/gallium/auxiliary/util/u_surface.c @@ -145,6 +145,12 @@ util_fill_rect(ubyte * dst, dst += dst_stride; } break; + case 8: + for (i = 0; i < height; i++) { + util_memset64(dst, ((uint64_t *)uc)[0], width); + dst += dst_stride; + } + break; default: for (i = 0; i < height; i++) { ubyte *row = dst; @@ -489,9 +495,7 @@ util_fill_zs_rect(ubyte *dst_map, case 8: if (!need_rmw) { for (i = 0; i < height; i++) { - uint64_t *row = (uint64_t *)dst_map; - for (j = 0; j < width; j++) - *row++ = zstencil; + util_memset64(dst_map, zstencil, width); dst_map += dst_stride; } }