summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibEDID
diff options
context:
space:
mode:
authorIdan Horowitz <idan.horowitz@gmail.com>2022-02-15 23:30:00 +0200
committerAndreas Kling <kling@serenityos.org>2022-02-16 22:21:37 +0100
commit410183a7b034fb35be231fb882316def933935bc (patch)
tree4742883d0e4a0db942a05772c3a9903a7d5d5ff7 /Userland/Libraries/LibEDID
parent3219ce3d61f42dfcbeb0483a24539cd7b8f4723b (diff)
downloadserenity-410183a7b034fb35be231fb882316def933935bc.zip
LibEDID: Exclude DMT::MonitorTiming::name() from the Kernel
This API is only used by userland and it uses infallible Strings, so let's just ifdef it out of the Kernel.
Diffstat (limited to 'Userland/Libraries/LibEDID')
-rw-r--r--Userland/Libraries/LibEDID/DMT.cpp7
-rw-r--r--Userland/Libraries/LibEDID/DMT.h2
2 files changed, 8 insertions, 1 deletions
diff --git a/Userland/Libraries/LibEDID/DMT.cpp b/Userland/Libraries/LibEDID/DMT.cpp
index 6884420ef7..99d10945ef 100644
--- a/Userland/Libraries/LibEDID/DMT.cpp
+++ b/Userland/Libraries/LibEDID/DMT.cpp
@@ -4,9 +4,12 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
-#include <AK/String.h>
#include <LibEDID/DMT.h>
+#ifndef KERNEL
+# include <AK/String.h>
+#endif
+
namespace EDID {
// Monitor timings as per Display Monitor Timing Standard (DMT) 1.0 rev 13
@@ -116,12 +119,14 @@ u32 DMT::MonitorTiming::refresh_rate_hz() const
return vertical_frequency_hz().ltrunk();
}
+#ifndef KERNEL
String DMT::MonitorTiming::name() const
{
if (scan_type == ScanType::Interlaced)
return String::formatted("{} x {} @ {}Hz (Interlaced)", horizontal_pixels, vertical_lines, refresh_rate_hz());
return String::formatted("{} x {} @ {}Hz", horizontal_pixels, vertical_lines, refresh_rate_hz());
}
+#endif
auto DMT::find_timing_by_dmt_id(u8 dmt_id) -> MonitorTiming const*
{
diff --git a/Userland/Libraries/LibEDID/DMT.h b/Userland/Libraries/LibEDID/DMT.h
index 2774b09315..2181399dbf 100644
--- a/Userland/Libraries/LibEDID/DMT.h
+++ b/Userland/Libraries/LibEDID/DMT.h
@@ -53,7 +53,9 @@ public:
FixedPoint<16, u32> horizontal_frequency_khz() const;
FixedPoint<16, u32> vertical_frequency_hz() const;
u32 refresh_rate_hz() const;
+#ifndef KERNEL
String name() const;
+#endif
};
static MonitorTiming const* find_timing_by_dmt_id(u8);