From c462bad08c5075ac0fec56b3c86534fd42aa7282 Mon Sep 17 00:00:00 2001 From: Julian Orth Date: Fri, 3 Oct 2025 16:51:08 +0200 Subject: [PATCH] shm: align the stride to 256 bytes This is required for the compositor to import the buffer directly into AMD hardware for zero-copy sampling. --- shm.c | 2 +- stride.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/shm.c b/shm.c index 4680c12c..a222175a 100644 --- a/shm.c +++ b/shm.c @@ -13,7 +13,6 @@ #include -#include #include #define LOG_MODULE "shm" @@ -22,6 +21,7 @@ #include "debug.h" #include "macros.h" #include "xmalloc.h" +#include "stride.h" #if !defined(MAP_UNINITIALIZED) #define MAP_UNINITIALIZED 0 diff --git a/stride.h b/stride.h index b2c71a71..a15871a2 100644 --- a/stride.h +++ b/stride.h @@ -5,5 +5,5 @@ static inline int stride_for_format_and_width(pixman_format_code_t format, int width) { - return (((PIXMAN_FORMAT_BPP(format) * width + 7) / 8 + 4 - 1) & -4); + return (((PIXMAN_FORMAT_BPP(format) * width + 7) / 8 + 256 - 1) & -256); }