/* The login-session display backend for the wasm host: the same C file the native compositor uses * (libseat + DRM/KMS dumb buffers + libinput + xkbcommon), compiled here against a stand-in * moonbit.h, so the two backends can't drift. The mp_kms_* functions are called from Rust. */ #include int32_t kms_bytes_len; #include "../../compositor/kms/kms_stub.c" /* The two shim functions that take a MoonBit byte array need its length. */ int32_t hw_kms_present(uint8_t *pixels, int32_t w, int32_t h) { kms_bytes_len = w * h * 4; return mp_kms_present(pixels, w, h); } int32_t hw_kms_keymap_copy(uint8_t *out, int32_t cap) { kms_bytes_len = cap; return mp_kms_keymap_copy(out); }