feat: open Card from Device

This commit is contained in:
Jackson Netherwood-Imig
2026-03-05 16:50:40 -08:00
parent d5db200d07
commit 411ec740e9
2 changed files with 13 additions and 6 deletions
+4 -3
View File
@@ -5,12 +5,13 @@ pub fn main(init: std.process.Init) !void {
const io = init.io;
const gpa = init.gpa;
const devid = drm.makeDev(226, 128);
const device = try drm.Device.getFromDevId(io, gpa, devid, .{});
const device = drm.Device.getFromDevId(io, gpa, drm.makeDev(226, 0), .{}) catch
try drm.Device.getFromDevId(io, gpa, drm.makeDev(226, 1), .{});
std.log.info("Device node path: {s}.", .{device.nodePath()});
const card = try drm.Card.openAuto(io);
// const card = try drm.Card.openAuto(io);
const card = try device.openNode(io);
defer card.close(io);
const res = try card.getModesettingResources(gpa);
defer res.deinit(gpa);