PCIAdapter.cpp 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * Copyright (c) 2022, Liav A. <liavalb@hotmail.co.il>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <Kernel/Graphics/Console/ContiguousFramebufferConsole.h>
  7. #include <Kernel/Graphics/Console/TextModeConsole.h>
  8. #include <Kernel/Graphics/GraphicsManagement.h>
  9. #include <Kernel/Graphics/VGA/PCIAdapter.h>
  10. #include <Kernel/Sections.h>
  11. namespace Kernel {
  12. UNMAP_AFTER_INIT NonnullRefPtr<PCIVGACompatibleAdapter> PCIVGACompatibleAdapter::initialize_with_preset_resolution(PCI::DeviceIdentifier const& pci_device_identifier, PhysicalAddress framebuffer_address, size_t framebuffer_width, size_t framebuffer_height, size_t framebuffer_pitch)
  13. {
  14. auto adapter = adopt_ref(*new PCIVGACompatibleAdapter(pci_device_identifier.address()));
  15. adapter->initialize_display_connector_with_preset_resolution(framebuffer_address, framebuffer_width, framebuffer_height, framebuffer_pitch);
  16. return adapter;
  17. }
  18. UNMAP_AFTER_INIT NonnullRefPtr<PCIVGACompatibleAdapter> PCIVGACompatibleAdapter::initialize(PCI::DeviceIdentifier const& pci_device_identifier)
  19. {
  20. auto adapter = adopt_ref(*new PCIVGACompatibleAdapter(pci_device_identifier.address()));
  21. return adapter;
  22. }
  23. UNMAP_AFTER_INIT PCIVGACompatibleAdapter::PCIVGACompatibleAdapter(PCI::Address address)
  24. : PCI::Device(address)
  25. {
  26. }
  27. }