blob: 13ccfd3614324a56a1161d0321644cfb6b0c1021 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
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_encoder = 0xa6,
get_connector = 0xa7,
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));
}
};
|