summaryrefslogtreecommitdiff
path: root/src/screen/drm/encoder.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/screen/drm/encoder.zig')
-rw-r--r--src/screen/drm/encoder.zig42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/screen/drm/encoder.zig b/src/screen/drm/encoder.zig
new file mode 100644
index 0000000..19630ab
--- /dev/null
+++ b/src/screen/drm/encoder.zig
@@ -0,0 +1,42 @@
+const std = @import("std");
+const drm = @import("root.zig");
+const Card = drm.Card;
+
+pub const Encoder = struct {
+ const Self = @This();
+
+ pub const Kind = enum(u32) {
+ none = 0,
+ dac = 1,
+ tmds = 2,
+ lvds = 3,
+ tvdac = 4,
+ virtual = 5,
+ dsi = 6,
+ dpmst = 7,
+ dpi = 8,
+ };
+
+ id: u32,
+ type: Kind,
+ possible_crtcs: u32,
+ possible_clones: u32,
+ card: *Card,
+
+ pub fn init(card: *Card, id: u32) !Self {
+ var raw = std.mem.zeroInit(drm.request.Encoder, .{ .id = id });
+ try card.request(.get_encoder, &raw);
+
+ return .{
+ .id = raw.id,
+ .type = raw.type,
+ .possible_crtcs = raw.possible_crtcs,
+ .possible_clones = raw.possible_clones,
+ .card = card
+ };
+ }
+
+ pub fn deinit(self: *Self) void {
+ _ = self;
+ }
+};