feat: get Device from Card.
This commit is contained in:
+6
-4
@@ -5,13 +5,15 @@ pub fn main(init: std.process.Init) !void {
|
||||
const io = init.io;
|
||||
const gpa = init.gpa;
|
||||
|
||||
const device = drm.Device.getFromDevId(io, gpa, drm.makeDev(226, 0), .{}) catch
|
||||
try drm.Device.getFromDevId(io, gpa, drm.makeDev(226, 1), .{});
|
||||
// const device = drm.Device.getFromDevId(io, gpa, drm.makeDev(226, 0), .{}) catch
|
||||
// try drm.Device.getFromDevId(io, gpa, drm.makeDev(226, 1), .{});
|
||||
|
||||
// const card = try device.openNode(io);
|
||||
|
||||
const card = try drm.Card.openAuto(io, .primary);
|
||||
const device = try card.getDevice(io, gpa, .{});
|
||||
std.log.info("Device node path: {s}.", .{device.nodePath()});
|
||||
|
||||
// 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);
|
||||
|
||||
Reference in New Issue
Block a user