summaryrefslogtreecommitdiff
path: root/src/screen/drm/request
diff options
context:
space:
mode:
Diffstat (limited to 'src/screen/drm/request')
-rw-r--r--src/screen/drm/request/frame-buffer.zig13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/screen/drm/request/frame-buffer.zig b/src/screen/drm/request/frame-buffer.zig
index 8f93862..c9077e8 100644
--- a/src/screen/drm/request/frame-buffer.zig
+++ b/src/screen/drm/request/frame-buffer.zig
@@ -10,11 +10,22 @@ pub const CreateDumb = extern struct {
size: u32,
};
+fn pixel_format_code(comptime a: u8, comptime b: u8, comptime c: u8, comptime d: u8) u32 {
+ return @as(u32, @intCast(a)) |
+ (@as(u32, @intCast(b)) << 8) |
+ (@as(u32, @intCast(c)) << 16) |
+ (@as(u32, @intCast(d)) << 24);
+}
+
+pub const PixelFormat = enum(u32) {
+ xrgb8888 = pixel_format_code('X', 'R', '2', '4'),
+};
+
pub const FrameBufferCmd2 = extern struct {
id: u32,
width: u32,
height: u32,
- pixel_format: drm.Pixel.Format,
+ pixel_format: PixelFormat,
flags: u32,
handles: [4]u32,
pitches: [4]u32,