From fef523a8d7c87f272de18c8abd57e0cc53e2ef40 Mon Sep 17 00:00:00 2001 From: Nathan Reiner Date: Sun, 2 Feb 2025 22:24:00 +0100 Subject: screen: drm change raw buffer interface --- src/screen/drm/buffer/root.zig | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src/screen/drm/buffer/root.zig') diff --git a/src/screen/drm/buffer/root.zig b/src/screen/drm/buffer/root.zig index e967d51..d40fd8d 100644 --- a/src/screen/drm/buffer/root.zig +++ b/src/screen/drm/buffer/root.zig @@ -7,17 +7,21 @@ pub const Buffer = struct { current: Raw, crtc: Raw, - pub fn init(card: *drm.Card, width: u32, height: u32, bpp: u32) !Self { + pub fn init(card: *drm.Card, width: u32, height: u32) !Self { return .{ - .current = try Raw.init(card, width, height, bpp), - .crtc = try Raw.init(card, width, height, bpp), + .current = try Raw.init(card, width, height), + .crtc = try Raw.init(card, width, height), }; } pub fn swap(self: *Self) void { - const data = self.current.data; - self.current.data = self.crtc.data; - self.crtc.data = data; + const pixels = self.current.pixels; + self.current.pixels = self.crtc.pixels; + self.crtc.pixels = pixels; + + const bytes = self.current.bytes; + self.current.bytes = self.crtc.bytes; + self.crtc.bytes = bytes; const id = self.current.id; self.current.id = self.crtc.id; -- cgit v1.2.3-70-g09d2