Add fourcc_mod_is_vendor() definition for older headers

This commit is contained in:
Cameron Gutman 2026-01-05 23:00:31 -06:00
commit 4a547eb05e

View file

@ -53,6 +53,15 @@ extern "C" {
#define DRM_FORMAT_XYUV8888 fourcc_code('X', 'Y', 'U', 'V') #define DRM_FORMAT_XYUV8888 fourcc_code('X', 'Y', 'U', 'V')
#endif #endif
// Upstreamed modifier macros (5.16+)
#ifndef fourcc_mod_get_vendor
#define fourcc_mod_get_vendor(modifier) (((modifier) >> 56) & 0xff)
#endif
#ifndef fourcc_mod_is_vendor
#define fourcc_mod_is_vendor(modifier, vendor) \
(fourcc_mod_get_vendor(modifier) == DRM_FORMAT_MOD_VENDOR_## vendor)
#endif
#include <unistd.h> #include <unistd.h>
#include <fcntl.h> #include <fcntl.h>
#include <string.h> #include <string.h>