1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:17:44 +00:00

Everywhere: Replace a bundle of dbg with dbgln.

These changes are arbitrarily divided into multiple commits to make it
easier to find potentially introduced bugs with git bisect.
This commit is contained in:
asynts 2021-01-13 23:59:42 +01:00 committed by Andreas Kling
parent 9d588cc9cc
commit 78b2be5a2a
4 changed files with 60 additions and 33 deletions

View file

@ -25,6 +25,7 @@
*/
#include <AK/Checked.h>
#include <AK/Debug.h>
#include <AK/Singleton.h>
#include <Kernel/Devices/BXVGADevice.h>
#include <Kernel/IO.h>
@ -105,9 +106,7 @@ void BXVGADevice::revert_resolution()
void BXVGADevice::set_resolution_registers(size_t width, size_t height)
{
#ifdef BXVGA_DEBUG
dbg() << "BXVGADevice resolution registers set to - " << width << "x" << height;
#endif
dbgln<debug_bxvga>("BXVGADevice resolution registers set to - {}x{}", width, height);
set_register(VBE_DISPI_INDEX_ENABLE, VBE_DISPI_DISABLED);
set_register(VBE_DISPI_INDEX_XRES, (u16)width);
set_register(VBE_DISPI_INDEX_YRES, (u16)height);
@ -120,9 +119,7 @@ void BXVGADevice::set_resolution_registers(size_t width, size_t height)
bool BXVGADevice::test_resolution(size_t width, size_t height)
{
#ifdef BXVGA_DEBUG
dbg() << "BXVGADevice resolution test - " << width << "x" << height;
#endif
dbgln<debug_bxvga>("BXVGADevice resolution test - {}x{}", width, height);
set_resolution_registers(width, height);
bool resolution_changed = validate_setup_resolution(width, height);
revert_resolution();
@ -237,9 +234,7 @@ int BXVGADevice::ioctl(FileDescription&, unsigned request, FlatPtr arg)
if (resolution.width > MAX_RESOLUTION_WIDTH || resolution.height > MAX_RESOLUTION_HEIGHT)
return -EINVAL;
if (!set_resolution(resolution.width, resolution.height)) {
#ifdef BXVGA_DEBUG
dbg() << "Reverting Resolution: [" << m_framebuffer_width << "x" << m_framebuffer_height << "]";
#endif
dbgln<debug_bxvga>("Reverting resolution: [{}x{}]", m_framebuffer_width, m_framebuffer_height);
resolution.pitch = m_framebuffer_pitch;
resolution.width = m_framebuffer_width;
resolution.height = m_framebuffer_height;
@ -247,9 +242,7 @@ int BXVGADevice::ioctl(FileDescription&, unsigned request, FlatPtr arg)
return -EFAULT;
return -EINVAL;
}
#ifdef BXVGA_DEBUG
dbg() << "New resolution: [" << m_framebuffer_width << "x" << m_framebuffer_height << "]";
#endif
dbgln<debug_bxvga>("New resolution: [{}x{}]", m_framebuffer_width, m_framebuffer_height);
resolution.pitch = m_framebuffer_pitch;
resolution.width = m_framebuffer_width;
resolution.height = m_framebuffer_height;