Skip to content

Commit da2b48a

Browse files
feat(node): add fb2
1 parent fe189d2 commit da2b48a

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

example.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ pub fn main() !void {
5959
for (crtcIds) |crtcId| {
6060
const crtc = try node.getCrtc(crtcId);
6161

62-
const fb = node.getFb(crtc.fbId) catch null;
62+
const fb = node.getFb2(crtc.fbId) catch null;
6363
std.debug.print("{} {?}\n", .{ crtc, fb });
6464
}
6565
}

libdrm/node.zig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,14 @@ pub fn getFb(self: *const Self, id: u32) !types.ModeFbCmd {
190190
return fb;
191191
}
192192

193+
pub fn getFb2(self: *const Self, id: u32) !types.ModeFbCmd2 {
194+
var fb: types.ModeFbCmd2 = .{
195+
.fbId = id,
196+
};
197+
try fb.get(self.fd);
198+
return fb;
199+
}
200+
193201
pub fn getEvent(self: *const Self) !types.Event {
194202
var ev: types.Event = undefined;
195203
try ev.read(self.fd);

0 commit comments

Comments
 (0)