mirror of
https://github.com/SerenityOS/serenity
synced 2026-05-15 11:26:36 +02:00
Do this by: - Removing more instances of `LockRefPtr` and `NonnullLockRefPtr`. - Using better names of construction methods (i.e. `create` instead of `try_create`). - Only returning `NonnullRefPtr` on the `Device::try_create_device` method. - Removing a version of the `Device::try_create_device` method that called `DeviceType::try_create(forward<Args>(args)...)`, which was only used in a construction point in a VirtIO driver which now doesn't need this anymore.
33 lines
893 B
C++
33 lines
893 B
C++
/*
|
|
* Copyright (c) 2023, Edwin Rijkee <edwin@virtualparadise.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/Types.h>
|
|
#include <Kernel/Bus/PCI/Device.h>
|
|
#include <Kernel/Devices/GPU/Console/GenericFramebufferConsole.h>
|
|
#include <Kernel/Devices/GPU/GPUDevice.h>
|
|
|
|
namespace Kernel {
|
|
|
|
class VoodooGraphicsAdapter final : public GPUDevice
|
|
, public PCI::Device {
|
|
|
|
public:
|
|
static ErrorOr<bool> probe(PCI::DeviceIdentifier const&);
|
|
static ErrorOr<NonnullLockRefPtr<GPUDevice>> create(PCI::DeviceIdentifier const&);
|
|
virtual ~VoodooGraphicsAdapter() = default;
|
|
virtual StringView device_name() const override { return "VoodooGraphicsAdapter"sv; }
|
|
|
|
private:
|
|
ErrorOr<void> initialize_adapter(PCI::DeviceIdentifier const&);
|
|
|
|
explicit VoodooGraphicsAdapter(PCI::DeviceIdentifier const&);
|
|
|
|
RefPtr<DisplayConnector> m_display_connector;
|
|
};
|
|
}
|