const drm = @import("../root.zig"); pub const CreateDumb = extern struct { height: u32, width: u32, bpp: u32, flags: u32, handle: u32, pitch: u32, size: u32, }; fn pixel_format_code(comptime a: u8, comptime b: u8, comptime c: u8, comptime d: u8) u32 { return @as(u32, @intCast(a)) | (@as(u32, @intCast(b)) << 8) | (@as(u32, @intCast(c)) << 16) | (@as(u32, @intCast(d)) << 24); } pub const PixelFormat = enum(u32) { xrgb8888 = pixel_format_code('X', 'R', '2', '4'), }; pub const FrameBufferCmd2 = extern struct { id: u32, width: u32, height: u32, pixel_format: PixelFormat, flags: u32, handles: [4]u32, pitches: [4]u32, offsets: [4]u32, modifier: [4]u32, }; pub const MapDumb = extern struct { handle: u32, __padding: u32, offset: i64, };