summaryrefslogtreecommitdiff
path: root/Kernel/Graphics/Definitions.h
diff options
context:
space:
mode:
authorLiav A <liavalb@gmail.com>2021-04-12 22:07:30 +0300
committerAndreas Kling <kling@serenityos.org>2021-05-16 19:58:33 +0200
commitcc92538d49a629ed91fb8cadfdc4c65225248e63 (patch)
treeb9f30ae774c6b7644d3df5bc4269dbad4bf4fc0d /Kernel/Graphics/Definitions.h
parent6a728e2d761601a9d21f2269e2febbfde55b3646 (diff)
downloadserenity-cc92538d49a629ed91fb8cadfdc4c65225248e63.zip
Kernel/Graphics: Add basic support for Intel native accelerator
We simply modeset the resolution after determining the preferred resolution after getting the EDID from the attached display.
Diffstat (limited to 'Kernel/Graphics/Definitions.h')
-rw-r--r--Kernel/Graphics/Definitions.h85
1 files changed, 85 insertions, 0 deletions
diff --git a/Kernel/Graphics/Definitions.h b/Kernel/Graphics/Definitions.h
new file mode 100644
index 0000000000..a96e051b13
--- /dev/null
+++ b/Kernel/Graphics/Definitions.h
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2021, Liav A. <liavalb@hotmail.co.il>
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+
+#pragma once
+
+#include <AK/Types.h>
+
+namespace Kernel::Graphics {
+
+struct Timings {
+ size_t blanking_start() const
+ {
+ return active;
+ }
+ size_t blanking_end() const
+ {
+ return total;
+ }
+
+ size_t active;
+ size_t sync_start;
+ size_t sync_end;
+ size_t total;
+};
+
+struct Modesetting {
+ size_t pixel_clock_in_khz;
+ Timings horizontal;
+ Timings vertical;
+};
+
+struct [[gnu::packed]] StandardTimings {
+ u8 resolution;
+ u8 frequency;
+};
+
+struct [[gnu::packed]] DetailTimings {
+ u16 pixel_clock;
+ u8 horizontal_active;
+ u8 horizontal_blank;
+ u8 horizontal_active_blank_msb;
+ u8 vertical_active;
+ u8 vertical_blank;
+ u8 vertical_active_blank_msb;
+ u8 horizontal_sync_offset;
+ u8 horizontal_sync_pulse;
+ u8 vertical_sync;
+ u8 sync_msb;
+ u8 dimension_width;
+ u8 dimension_height;
+ u8 dimension_msb;
+ u8 horizontal_border;
+ u8 vertical_border;
+ u8 features;
+};
+
+struct [[gnu::packed]] VideoInfoBlock {
+ u64 padding;
+ u16 manufacture_id;
+ u16 product_id;
+ u32 serial_number;
+ u8 manufacture_week;
+ u8 manufacture_year;
+ u8 edid_version;
+ u8 edid_revision;
+ u8 video_input_type;
+ u8 max_horizontal_size;
+ u8 max_vertical_size;
+ u8 gama_factor;
+ u8 dpms_flags;
+ u8 chroma_info[10];
+ u8 established_timing[2];
+ u8 manufacture_reserved_timings;
+ StandardTimings timings[8];
+ DetailTimings details[4];
+ u8 unused;
+ u8 checksum;
+};
+
+static_assert(sizeof(VideoInfoBlock) == 128);
+
+}