diff options
| author | Nathan Reiner <nathan@nathanreiner.xyz> | 2025-02-02 22:24:00 +0100 |
|---|---|---|
| committer | Nathan Reiner <nathan@nathanreiner.xyz> | 2025-02-02 22:24:00 +0100 |
| commit | fef523a8d7c87f272de18c8abd57e0cc53e2ef40 (patch) | |
| tree | 7a8472dbdace2d511197da6b5184ec92509ef973 /src/screen/drm/buffer/root.zig | |
| parent | 811a6bd572f4c6b26e99b4e746f5d710947ee934 (diff) | |
screen: drm change raw buffer interface
Diffstat (limited to 'src/screen/drm/buffer/root.zig')
| -rw-r--r-- | src/screen/drm/buffer/root.zig | 16 |
1 files changed, 10 insertions, 6 deletions
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; |