mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 07:37:46 +00:00
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.
This commit is contained in:
parent
3219ce3d61
commit
410183a7b0
2 changed files with 8 additions and 1 deletions
|
@ -4,9 +4,12 @@
|
||||||
* SPDX-License-Identifier: BSD-2-Clause
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <AK/String.h>
|
|
||||||
#include <LibEDID/DMT.h>
|
#include <LibEDID/DMT.h>
|
||||||
|
|
||||||
|
#ifndef KERNEL
|
||||||
|
# include <AK/String.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace EDID {
|
namespace EDID {
|
||||||
|
|
||||||
// Monitor timings as per Display Monitor Timing Standard (DMT) 1.0 rev 13
|
// 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();
|
return vertical_frequency_hz().ltrunk();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef KERNEL
|
||||||
String DMT::MonitorTiming::name() const
|
String DMT::MonitorTiming::name() const
|
||||||
{
|
{
|
||||||
if (scan_type == ScanType::Interlaced)
|
if (scan_type == ScanType::Interlaced)
|
||||||
return String::formatted("{} x {} @ {}Hz (Interlaced)", horizontal_pixels, vertical_lines, refresh_rate_hz());
|
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());
|
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*
|
auto DMT::find_timing_by_dmt_id(u8 dmt_id) -> MonitorTiming const*
|
||||||
{
|
{
|
||||||
|
|
|
@ -53,7 +53,9 @@ public:
|
||||||
FixedPoint<16, u32> horizontal_frequency_khz() const;
|
FixedPoint<16, u32> horizontal_frequency_khz() const;
|
||||||
FixedPoint<16, u32> vertical_frequency_hz() const;
|
FixedPoint<16, u32> vertical_frequency_hz() const;
|
||||||
u32 refresh_rate_hz() const;
|
u32 refresh_rate_hz() const;
|
||||||
|
#ifndef KERNEL
|
||||||
String name() const;
|
String name() const;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
static MonitorTiming const* find_timing_by_dmt_id(u8);
|
static MonitorTiming const* find_timing_by_dmt_id(u8);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue