mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 06:07:44 +00:00
Everywhere: Run clang-format
This commit is contained in:
parent
0376c127f6
commit
086969277e
1665 changed files with 8479 additions and 8479 deletions
|
@ -19,7 +19,7 @@
|
|||
|
||||
namespace Kernel {
|
||||
|
||||
NonnullRefPtr<FramebufferDevice> FramebufferDevice::create(const GenericGraphicsAdapter& adapter, PhysicalAddress paddr, size_t width, size_t height, size_t pitch)
|
||||
NonnullRefPtr<FramebufferDevice> FramebufferDevice::create(GenericGraphicsAdapter const& adapter, PhysicalAddress paddr, size_t width, size_t height, size_t pitch)
|
||||
{
|
||||
auto framebuffer_device_or_error = DeviceManagement::try_create_device<FramebufferDevice>(adapter, paddr, width, height, pitch);
|
||||
// FIXME: Find a way to propagate errors
|
||||
|
@ -112,7 +112,7 @@ UNMAP_AFTER_INIT ErrorOr<void> FramebufferDevice::try_to_initialize()
|
|||
return {};
|
||||
}
|
||||
|
||||
UNMAP_AFTER_INIT FramebufferDevice::FramebufferDevice(const GenericGraphicsAdapter& adapter, PhysicalAddress addr, size_t width, size_t height, size_t pitch)
|
||||
UNMAP_AFTER_INIT FramebufferDevice::FramebufferDevice(GenericGraphicsAdapter const& adapter, PhysicalAddress addr, size_t width, size_t height, size_t pitch)
|
||||
: GenericFramebufferDevice(adapter)
|
||||
, m_framebuffer_address(addr)
|
||||
, m_framebuffer_pitch(pitch)
|
||||
|
|
|
@ -20,7 +20,7 @@ class FramebufferDevice final : public GenericFramebufferDevice {
|
|||
friend class DeviceManagement;
|
||||
|
||||
public:
|
||||
static NonnullRefPtr<FramebufferDevice> create(const GenericGraphicsAdapter&, PhysicalAddress, size_t, size_t, size_t);
|
||||
static NonnullRefPtr<FramebufferDevice> create(GenericGraphicsAdapter const&, PhysicalAddress, size_t, size_t, size_t);
|
||||
|
||||
virtual ErrorOr<Memory::Region*> mmap(Process&, OpenFileDescription&, Memory::VirtualRange const&, u64 offset, int prot, bool shared) override;
|
||||
|
||||
|
@ -50,7 +50,7 @@ private:
|
|||
virtual ErrorOr<void> flush_head_buffer(size_t head) override;
|
||||
virtual ErrorOr<void> flush_rectangle(size_t head, FBRect const&) override;
|
||||
|
||||
FramebufferDevice(const GenericGraphicsAdapter&, PhysicalAddress, size_t, size_t, size_t);
|
||||
FramebufferDevice(GenericGraphicsAdapter const&, PhysicalAddress, size_t, size_t, size_t);
|
||||
|
||||
PhysicalAddress m_framebuffer_address;
|
||||
size_t m_framebuffer_pitch { 0 };
|
||||
|
|
|
@ -149,7 +149,7 @@ ErrorOr<void> GenericFramebufferDevice::ioctl(OpenFileDescription&, unsigned req
|
|||
};
|
||||
}
|
||||
|
||||
GenericFramebufferDevice::GenericFramebufferDevice(const GenericGraphicsAdapter& adapter)
|
||||
GenericFramebufferDevice::GenericFramebufferDevice(GenericGraphicsAdapter const& adapter)
|
||||
: BlockDevice(29, GraphicsManagement::the().allocate_minor_device_number())
|
||||
, m_graphics_adapter(adapter)
|
||||
{
|
||||
|
|
|
@ -33,11 +33,11 @@ public:
|
|||
|
||||
private:
|
||||
// ^File
|
||||
virtual bool can_read(const OpenFileDescription&, u64) const override final { return true; }
|
||||
virtual bool can_write(const OpenFileDescription&, u64) const override final { return true; }
|
||||
virtual bool can_read(OpenFileDescription const&, u64) const override final { return true; }
|
||||
virtual bool can_write(OpenFileDescription const&, u64) const override final { return true; }
|
||||
virtual void start_request(AsyncBlockDeviceRequest& request) override final { request.complete(AsyncDeviceRequest::Failure); }
|
||||
virtual ErrorOr<size_t> read(OpenFileDescription&, u64, UserOrKernelBuffer&, size_t) override { return EINVAL; }
|
||||
virtual ErrorOr<size_t> write(OpenFileDescription&, u64, const UserOrKernelBuffer&, size_t) override { return EINVAL; }
|
||||
virtual ErrorOr<size_t> write(OpenFileDescription&, u64, UserOrKernelBuffer const&, size_t) override { return EINVAL; }
|
||||
|
||||
protected:
|
||||
virtual bool multihead_support() const = 0;
|
||||
|
@ -61,7 +61,7 @@ protected:
|
|||
|
||||
ErrorOr<void> verify_head_index(int head_index) const;
|
||||
|
||||
GenericFramebufferDevice(const GenericGraphicsAdapter&);
|
||||
GenericFramebufferDevice(GenericGraphicsAdapter const&);
|
||||
mutable WeakPtr<GenericGraphicsAdapter> m_graphics_adapter;
|
||||
mutable Spinlock m_flushing_lock;
|
||||
mutable Spinlock m_resolution_lock;
|
||||
|
|
|
@ -88,7 +88,7 @@ static Graphics::Modesetting calculate_modesetting_from_edid(EDID::Parser& edid,
|
|||
return mode;
|
||||
}
|
||||
|
||||
static bool check_pll_settings(const IntelNativeGraphicsAdapter::PLLSettings& settings, size_t reference_clock, const IntelNativeGraphicsAdapter::PLLMaxSettings& limits)
|
||||
static bool check_pll_settings(IntelNativeGraphicsAdapter::PLLSettings const& settings, size_t reference_clock, IntelNativeGraphicsAdapter::PLLMaxSettings const& limits)
|
||||
{
|
||||
if (settings.n < limits.n.min || settings.n > limits.n.max) {
|
||||
dbgln_if(INTEL_GRAPHICS_DEBUG, "N is invalid {}", settings.n);
|
||||
|
@ -145,7 +145,7 @@ static size_t find_absolute_difference(u64 target_frequency, u64 checked_frequen
|
|||
return checked_frequency - target_frequency;
|
||||
}
|
||||
|
||||
Optional<IntelNativeGraphicsAdapter::PLLSettings> IntelNativeGraphicsAdapter::create_pll_settings(u64 target_frequency, u64 reference_clock, const PLLMaxSettings& limits)
|
||||
Optional<IntelNativeGraphicsAdapter::PLLSettings> IntelNativeGraphicsAdapter::create_pll_settings(u64 target_frequency, u64 reference_clock, PLLMaxSettings const& limits)
|
||||
{
|
||||
IntelNativeGraphicsAdapter::PLLSettings settings;
|
||||
IntelNativeGraphicsAdapter::PLLSettings best_settings;
|
||||
|
@ -280,7 +280,7 @@ void IntelNativeGraphicsAdapter::write_to_register(IntelGraphics::RegisterIndex
|
|||
VERIFY(m_registers_region);
|
||||
SpinlockLocker lock(m_registers_lock);
|
||||
dbgln_if(INTEL_GRAPHICS_DEBUG, "Intel Graphics {}: Write to {} value of {:x}", pci_address(), convert_register_index_to_string(index), value);
|
||||
auto* reg = (volatile u32*)m_registers_region->vaddr().offset(index).as_ptr();
|
||||
auto* reg = (u32 volatile*)m_registers_region->vaddr().offset(index).as_ptr();
|
||||
*reg = value;
|
||||
}
|
||||
u32 IntelNativeGraphicsAdapter::read_from_register(IntelGraphics::RegisterIndex index) const
|
||||
|
@ -288,7 +288,7 @@ u32 IntelNativeGraphicsAdapter::read_from_register(IntelGraphics::RegisterIndex
|
|||
VERIFY(m_control_lock.is_locked());
|
||||
VERIFY(m_registers_region);
|
||||
SpinlockLocker lock(m_registers_lock);
|
||||
auto* reg = (volatile u32*)m_registers_region->vaddr().offset(index).as_ptr();
|
||||
auto* reg = (u32 volatile*)m_registers_region->vaddr().offset(index).as_ptr();
|
||||
u32 value = *reg;
|
||||
dbgln_if(INTEL_GRAPHICS_DEBUG, "Intel Graphics {}: Read from {} value of {:x}", pci_address(), convert_register_index_to_string(index), value);
|
||||
return value;
|
||||
|
@ -460,7 +460,7 @@ bool IntelNativeGraphicsAdapter::set_crt_resolution(size_t width, size_t height)
|
|||
return true;
|
||||
}
|
||||
|
||||
void IntelNativeGraphicsAdapter::set_display_timings(const Graphics::Modesetting& modesetting)
|
||||
void IntelNativeGraphicsAdapter::set_display_timings(Graphics::Modesetting const& modesetting)
|
||||
{
|
||||
VERIFY(m_control_lock.is_locked());
|
||||
VERIFY(m_modeset_lock.is_locked());
|
||||
|
@ -589,7 +589,7 @@ void IntelNativeGraphicsAdapter::enable_primary_plane(PhysicalAddress fb_address
|
|||
write_to_register(IntelGraphics::RegisterIndex::DisplayPlaneAControl, (read_from_register(IntelGraphics::RegisterIndex::DisplayPlaneAControl) & (~(0b1111 << 26))) | (0b0110 << 26) | (1 << 31));
|
||||
}
|
||||
|
||||
void IntelNativeGraphicsAdapter::set_dpll_registers(const PLLSettings& settings)
|
||||
void IntelNativeGraphicsAdapter::set_dpll_registers(PLLSettings const& settings)
|
||||
{
|
||||
VERIFY(m_control_lock.is_locked());
|
||||
VERIFY(m_modeset_lock.is_locked());
|
||||
|
@ -599,7 +599,7 @@ void IntelNativeGraphicsAdapter::set_dpll_registers(const PLLSettings& settings)
|
|||
write_to_register(IntelGraphics::RegisterIndex::DPLLControlA, read_from_register(IntelGraphics::RegisterIndex::DPLLControlA) & ~0x80000000);
|
||||
}
|
||||
|
||||
void IntelNativeGraphicsAdapter::enable_dpll_without_vga(const PLLSettings& settings, size_t dac_multiplier)
|
||||
void IntelNativeGraphicsAdapter::enable_dpll_without_vga(PLLSettings const& settings, size_t dac_multiplier)
|
||||
{
|
||||
VERIFY(m_control_lock.is_locked());
|
||||
VERIFY(m_modeset_lock.is_locked());
|
||||
|
|
|
@ -137,10 +137,10 @@ private:
|
|||
void disable_pipe_b();
|
||||
void disable_dpll();
|
||||
|
||||
void set_dpll_registers(const PLLSettings&);
|
||||
void set_dpll_registers(PLLSettings const&);
|
||||
|
||||
void enable_dpll_without_vga(const PLLSettings&, size_t dac_multiplier);
|
||||
void set_display_timings(const Graphics::Modesetting&);
|
||||
void enable_dpll_without_vga(PLLSettings const&, size_t dac_multiplier);
|
||||
void set_display_timings(Graphics::Modesetting const&);
|
||||
void enable_pipe_a();
|
||||
void set_framebuffer_parameters(size_t, size_t);
|
||||
void enable_primary_plane(PhysicalAddress fb_address, size_t stride);
|
||||
|
@ -158,7 +158,7 @@ private:
|
|||
void gmbus_read(unsigned address, u8* buf, size_t length);
|
||||
bool gmbus_wait_for(GMBusStatus desired_status, Optional<size_t> milliseconds_timeout);
|
||||
|
||||
Optional<PLLSettings> create_pll_settings(u64 target_frequency, u64 reference_clock, const PLLMaxSettings&);
|
||||
Optional<PLLSettings> create_pll_settings(u64 target_frequency, u64 reference_clock, PLLMaxSettings const&);
|
||||
|
||||
Spinlock m_control_lock;
|
||||
Spinlock m_modeset_lock;
|
||||
|
|
|
@ -112,10 +112,10 @@ public:
|
|||
OwnPtr<Memory::Region> m_transfer_buffer_region;
|
||||
};
|
||||
|
||||
virtual bool can_read(const OpenFileDescription&, u64) const override { return true; }
|
||||
virtual bool can_write(const OpenFileDescription&, u64) const override { return true; }
|
||||
virtual bool can_read(OpenFileDescription const&, u64) const override { return true; }
|
||||
virtual bool can_write(OpenFileDescription const&, u64) const override { return true; }
|
||||
virtual ErrorOr<size_t> read(OpenFileDescription&, u64, UserOrKernelBuffer&, size_t) override { return ENOTSUP; }
|
||||
virtual ErrorOr<size_t> write(OpenFileDescription&, u64, const UserOrKernelBuffer&, size_t) override { return ENOTSUP; }
|
||||
virtual ErrorOr<size_t> write(OpenFileDescription&, u64, UserOrKernelBuffer const&, size_t) override { return ENOTSUP; }
|
||||
virtual StringView class_name() const override { return "virgl3d"; }
|
||||
|
||||
virtual ErrorOr<void> ioctl(OpenFileDescription&, unsigned request, Userspace<void*> arg) override;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue