1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-25 21:55:07 +00:00

Kernel: Make a helper in the Intel graphics driver return StringView

This commit is contained in:
Andreas Kling 2021-08-05 20:58:44 +02:00
parent 066d3281b5
commit 07599b48de

View file

@ -217,57 +217,57 @@ void IntelNativeGraphicsAdapter::enable_vga_plane()
VERIFY(m_modeset_lock.is_locked());
}
[[maybe_unused]] static inline const char* convert_register_index_to_string(IntelGraphics::RegisterIndex index)
[[maybe_unused]] static StringView convert_register_index_to_string(IntelGraphics::RegisterIndex index)
{
switch (index) {
case IntelGraphics::RegisterIndex::PipeAConf:
return "PipeAConf";
return "PipeAConf"sv;
case IntelGraphics::RegisterIndex::PipeBConf:
return "PipeBConf";
return "PipeBConf"sv;
case IntelGraphics::RegisterIndex::GMBusData:
return "GMBusData";
return "GMBusData"sv;
case IntelGraphics::RegisterIndex::GMBusStatus:
return "GMBusStatus";
return "GMBusStatus"sv;
case IntelGraphics::RegisterIndex::GMBusCommand:
return "GMBusCommand";
return "GMBusCommand"sv;
case IntelGraphics::RegisterIndex::GMBusClock:
return "GMBusClock";
return "GMBusClock"sv;
case IntelGraphics::RegisterIndex::DisplayPlaneAControl:
return "DisplayPlaneAControl";
return "DisplayPlaneAControl"sv;
case IntelGraphics::RegisterIndex::DisplayPlaneALinearOffset:
return "DisplayPlaneALinearOffset";
return "DisplayPlaneALinearOffset"sv;
case IntelGraphics::RegisterIndex::DisplayPlaneAStride:
return "DisplayPlaneAStride";
return "DisplayPlaneAStride"sv;
case IntelGraphics::RegisterIndex::DisplayPlaneASurface:
return "DisplayPlaneASurface";
return "DisplayPlaneASurface"sv;
case IntelGraphics::RegisterIndex::DPLLDivisorA0:
return "DPLLDivisorA0";
return "DPLLDivisorA0"sv;
case IntelGraphics::RegisterIndex::DPLLDivisorA1:
return "DPLLDivisorA1";
return "DPLLDivisorA1"sv;
case IntelGraphics::RegisterIndex::DPLLControlA:
return "DPLLControlA";
return "DPLLControlA"sv;
case IntelGraphics::RegisterIndex::DPLLControlB:
return "DPLLControlB";
return "DPLLControlB"sv;
case IntelGraphics::RegisterIndex::DPLLMultiplierA:
return "DPLLMultiplierA";
return "DPLLMultiplierA"sv;
case IntelGraphics::RegisterIndex::HTotalA:
return "HTotalA";
return "HTotalA"sv;
case IntelGraphics::RegisterIndex::HBlankA:
return "HBlankA";
return "HBlankA"sv;
case IntelGraphics::RegisterIndex::HSyncA:
return "HSyncA";
return "HSyncA"sv;
case IntelGraphics::RegisterIndex::VTotalA:
return "VTotalA";
return "VTotalA"sv;
case IntelGraphics::RegisterIndex::VBlankA:
return "VBlankA";
return "VBlankA"sv;
case IntelGraphics::RegisterIndex::VSyncA:
return "VSyncA";
return "VSyncA"sv;
case IntelGraphics::RegisterIndex::PipeASource:
return "PipeASource";
return "PipeASource"sv;
case IntelGraphics::RegisterIndex::AnalogDisplayPort:
return "AnalogDisplayPort";
return "AnalogDisplayPort"sv;
case IntelGraphics::RegisterIndex::VGADisplayPlaneControl:
return "VGADisplayPlaneControl";
return "VGADisplayPlaneControl"sv;
default:
VERIFY_NOT_REACHED();
}