mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:18:13 +00:00
Kernel/IntelGraphics: Move DisplayPlane enable code to derived classes
Instead of doing that on the IntelDisplayPlane class, let's have this in derived classes so these classes can decide how to use the settings that were provided before calling the enable method.
This commit is contained in:
parent
e393071a9b
commit
016fedbd20
5 changed files with 60 additions and 18 deletions
|
@ -20,13 +20,34 @@ IntelDisplayPlane::ShadowRegisters IntelDisplayPlane::shadow_registers() const
|
|||
return m_shadow_registers;
|
||||
}
|
||||
|
||||
ErrorOr<void> IntelDisplayPlane::enable(Badge<IntelDisplayConnectorGroup>)
|
||||
ErrorOr<void> IntelDisplayPlane::set_horizontal_active_pixels_count(Badge<IntelDisplayConnectorGroup>, size_t horizontal_active_pixels_count)
|
||||
{
|
||||
SpinlockLocker locker(m_access_lock);
|
||||
// Note: We use the shadow register so we don't have the already set
|
||||
// settings being lost.
|
||||
m_plane_registers->control = m_shadow_registers.control | (1 << 31);
|
||||
m_shadow_registers.control |= (1 << 31);
|
||||
m_horizontal_active_pixels_count = horizontal_active_pixels_count;
|
||||
return {};
|
||||
}
|
||||
ErrorOr<void> IntelDisplayPlane::set_vertical_active_pixels_count(Badge<IntelDisplayConnectorGroup>, size_t vertical_active_pixels_count)
|
||||
{
|
||||
SpinlockLocker locker(m_access_lock);
|
||||
m_vertical_active_pixels_count = vertical_active_pixels_count;
|
||||
return {};
|
||||
}
|
||||
ErrorOr<void> IntelDisplayPlane::set_horizontal_stride(Badge<IntelDisplayConnectorGroup>, size_t horizontal_stride)
|
||||
{
|
||||
SpinlockLocker locker(m_access_lock);
|
||||
m_horizontal_stride = horizontal_stride;
|
||||
return {};
|
||||
}
|
||||
ErrorOr<void> IntelDisplayPlane::set_aperture_base(Badge<IntelDisplayConnectorGroup>, PhysicalAddress aperture_start)
|
||||
{
|
||||
SpinlockLocker locker(m_access_lock);
|
||||
m_aperture_start.set(aperture_start.get());
|
||||
return {};
|
||||
}
|
||||
ErrorOr<void> IntelDisplayPlane::set_pipe(Badge<IntelDisplayConnectorGroup>, PipeSelect pipe_select)
|
||||
{
|
||||
SpinlockLocker locker(m_access_lock);
|
||||
m_pipe_select = pipe_select;
|
||||
return {};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue