1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 05:48:12 +00:00

Kernel/Graphics: Apply DisplayConnector design on the VirtIO driver

This commit is contained in:
Liav A 2022-04-30 13:56:29 +03:00 committed by Andreas Kling
parent 4ff6150f1b
commit c27c414ed1
13 changed files with 729 additions and 886 deletions

View file

@ -306,8 +306,9 @@ ErrorOr<void> DisplayConnector::ioctl(OpenFileDescription&, unsigned request, Us
TRY(copy_from_user(&user_dirty_rect, &flush_rects.rects[i]));
{
SpinlockLocker control_locker(m_control_lock);
if (console_mode())
if (console_mode()) {
return {};
}
TRY(flush_rectangle(flush_rects.buffer_index, user_dirty_rect));
}
}
@ -319,10 +320,13 @@ ErrorOr<void> DisplayConnector::ioctl(OpenFileDescription&, unsigned request, Us
// WindowServer is not ready yet to handle errors such as EBUSY currently.
MutexLocker locker(m_flushing_lock);
SpinlockLocker control_locker(m_control_lock);
if (console_mode())
if (console_mode()) {
return {};
}
if (!flush_support())
return Error::from_errno(ENOTSUP);
TRY(flush_first_surface());
return {};
}