const std = @import("std"); const os = std.os.linux; const cerror = @import("../cerror.zig"); fn ioctl(fd: os.fd_t, request: u32, arg: usize) !void { try cerror.from_usize(os.ioctl(fd, request, arg)); } pub const Drm = enum(u8) { const Self = @This(); get_resources = 0xa0, get_crtc = 0xa1, set_crtc = 0xa2, get_encoder = 0xa6, get_connector = 0xa7, remove_frame_buffer = 0xaf, page_flip = 0xb0, dirty_frame_buffer = 0xb1, create_dumb = 0xb2, map_dumb = 0xb3, destroy_dumb = 0xb4, add_frame_buffer2 = 0xb8, pub fn request(self: Self, fd: os.fd_t, T: type, arg: *T) !void { const id = os.IOCTL.IOWR('d', @intFromEnum(self), T); try ioctl(fd, id, @intFromPtr(arg)); } };