mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 05:37:34 +00:00
Kernel: Improve debug prints for VirtIOGPU device config events
This commit is contained in:
parent
4dddc56ad9
commit
04226f0c0a
2 changed files with 14 additions and 2 deletions
|
@ -61,8 +61,18 @@ void GPU::create_framebuffer_devices()
|
||||||
|
|
||||||
bool GPU::handle_device_config_change()
|
bool GPU::handle_device_config_change()
|
||||||
{
|
{
|
||||||
|
auto events = get_pending_events();
|
||||||
|
if (events & VIRTIO_GPU_EVENT_DISPLAY) {
|
||||||
|
// The host window was resized, in SerenityOS we completely ignore this event
|
||||||
|
dbgln_if(VIRTIO_DEBUG, "{}: Ignoring virtio gpu display resize event", m_class_name);
|
||||||
|
clear_pending_events(VIRTIO_GPU_EVENT_DISPLAY);
|
||||||
|
}
|
||||||
|
if (events & ~VIRTIO_GPU_EVENT_DISPLAY) {
|
||||||
|
dbgln("GPU: Got unknown device config change event: 0x{:x}", events);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
void GPU::handle_queue_update(u16 queue_index)
|
void GPU::handle_queue_update(u16 queue_index)
|
||||||
{
|
{
|
||||||
|
@ -98,7 +108,7 @@ void GPU::query_display_information()
|
||||||
for (size_t i = 0; i < VIRTIO_GPU_MAX_SCANOUTS; ++i) {
|
for (size_t i = 0; i < VIRTIO_GPU_MAX_SCANOUTS; ++i) {
|
||||||
auto& scanout = m_scanouts[i].display_info;
|
auto& scanout = m_scanouts[i].display_info;
|
||||||
scanout = response.scanout_modes[i];
|
scanout = response.scanout_modes[i];
|
||||||
dbgln_if(VIRTIO_DEBUG, "Scanout {}: enabled: {} x: {}, y: {}, width: {}, height: {}", i, !!scanout.enabled, scanout.rect.x, scanout.rect.y, scanout.rect.width, scanout.rect.height);
|
dbgln_if(VIRTIO_DEBUG, "GPU: Scanout {}: enabled: {} x: {}, y: {}, width: {}, height: {}", i, !!scanout.enabled, scanout.rect.x, scanout.rect.y, scanout.rect.width, scanout.rect.height);
|
||||||
if (scanout.enabled && !m_default_scanout.has_value())
|
if (scanout.enabled && !m_default_scanout.has_value())
|
||||||
m_default_scanout = i;
|
m_default_scanout = i;
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,8 @@
|
||||||
#define MAX_VIRTIOGPU_RESOLUTION_WIDTH 3840
|
#define MAX_VIRTIOGPU_RESOLUTION_WIDTH 3840
|
||||||
#define MAX_VIRTIOGPU_RESOLUTION_HEIGHT 2160
|
#define MAX_VIRTIOGPU_RESOLUTION_HEIGHT 2160
|
||||||
|
|
||||||
|
#define VIRTIO_GPU_EVENT_DISPLAY (1 << 0)
|
||||||
|
|
||||||
namespace Kernel::Graphics::VirtIOGPU {
|
namespace Kernel::Graphics::VirtIOGPU {
|
||||||
|
|
||||||
class Console;
|
class Console;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue