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.
This commit is contained in:
Julian Orth 2025-10-03 16:51:08 +02:00
parent 44a674edb8
commit c462bad08c
2 changed files with 2 additions and 2 deletions

2
shm.c
View file

@ -13,7 +13,6 @@
#include <pixman.h>
#include <fcft/stride.h>
#include <tllist.h>
#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

View file

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