-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes: #43
- Loading branch information
Showing
66 changed files
with
9,803 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# SPDX-FileCopyrightText: 2024 Pier Luigi Fiorini <[email protected]> | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
|
||
if(NOT TARGET PkgConfig::LibDisplayInfo) | ||
find_package(PkgConfig QUIET) | ||
pkg_check_modules(LibDisplayInfo libdisplay-info IMPORTED_TARGET) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# SPDX-FileCopyrightText: 2024 Pier Luigi Fiorini <[email protected]> | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
|
||
if(NOT TARGET PkgConfig::Libxcvt) | ||
find_package(PkgConfig QUIET) | ||
pkg_check_modules(Libxcvt libxcvt IMPORTED_TARGET) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
include(ECMQtDeclareLoggingCategory) | ||
ecm_qt_declare_logging_category( | ||
AuroraDeviceIntegrationDrm_SOURCES | ||
HEADER "drmloggingcategories.h" | ||
IDENTIFIER "Aurora::Platform::gLcDrm" | ||
CATEGORY_NAME "aurora.platform.drm" | ||
DEFAULT_SEVERITY "Info" | ||
DESCRIPTION "Aurora device integration for DRM/KMS" | ||
) | ||
|
||
qt6_add_plugin(AuroraDeviceIntegrationDrm | ||
SHARED | ||
CLASS_NAME DrmIntegrationPlugin | ||
MANUAL_FINALIZATION | ||
drmabstractoutput.cpp drmabstractoutput.h | ||
drmbackend.cpp drmbackend.h | ||
drmblob.cpp drmblob.h | ||
drmbuffer.cpp drmbuffer.h | ||
drmcommit.cpp drmcommit.h | ||
drmcommitthread.cpp drmcommitthread.h | ||
drmconnector.cpp drmconnector.h | ||
drmcrtc.cpp drmcrtc.h | ||
drmgpu.cpp drmgpu.h | ||
drmintegration.cpp drmintegration.h | ||
drmintegrationplugin.cpp drmintegrationplugin.h | ||
drmlayer.cpp drmlayer.h | ||
drmobject.cpp drmobject.h | ||
drmoutput.cpp drmoutput.h | ||
drmpipeline.cpp drmpipeline.h drmpipelinelegacy.cpp | ||
drmplane.cpp drmplane.h | ||
drmpointer.h | ||
drmproperty.cpp drmproperty.h | ||
drmrenderbackend.h | ||
filedescriptor.cpp filedescriptor.h | ||
${AuroraDeviceIntegrationDrm_SOURCES} | ||
) | ||
|
||
set_target_properties(AuroraDeviceIntegrationDrm | ||
PROPERTIES OUTPUT_NAME drm | ||
) | ||
|
||
target_link_libraries(AuroraDeviceIntegrationDrm | ||
PUBLIC | ||
Qt6::Core | ||
Qt6::Gui | ||
Liri::AuroraCore | ||
Liri::AuroraPlatform | ||
EGL::EGL | ||
PRIVATE | ||
PkgConfig::Libdrm | ||
PkgConfig::Gbm | ||
PkgConfig::Libxcvt | ||
PkgConfig::LibDisplayInfo | ||
Liri::AuroraPlatformPrivate | ||
) | ||
|
||
qt6_finalize_target(AuroraDeviceIntegrationDrm) | ||
|
||
install( | ||
TARGETS AuroraDeviceIntegrationDrm | ||
DESTINATION ${KDE_INSTALL_PLUGINDIR}/aurora/deviceintegration | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"Keys": [ "drm" ] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// SPDX-FileCopyrightText: 2024 Pier Luigi Fiorini <[email protected]> | ||
// SPDX-FileCopyrightText: 2021 Xaver Hugl <[email protected]> | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
|
||
#include "drmabstractoutput.h" | ||
#include "core/renderbackend.h" | ||
#include "drmbackend.h" | ||
#include "drmgpu.h" | ||
#include "drmlayer.h" | ||
|
||
namespace Aurora { | ||
|
||
namespace Platform { | ||
|
||
DrmAbstractOutput::DrmAbstractOutput(DrmGpu *gpu) | ||
: Output(gpu->platform()) | ||
, m_renderLoop(std::make_unique<RenderLoop>()) | ||
, m_gpu(gpu) | ||
{ | ||
} | ||
|
||
RenderLoop *DrmAbstractOutput::renderLoop() const | ||
{ | ||
return m_renderLoop.get(); | ||
} | ||
|
||
void DrmAbstractOutput::frameFailed() const | ||
{ | ||
m_frame->failed(); | ||
} | ||
|
||
void DrmAbstractOutput::pageFlipped(std::chrono::nanoseconds timestamp, PresentationMode mode) | ||
{ | ||
const auto gpuTime = | ||
primaryLayer() ? primaryLayer()->queryRenderTime() : std::chrono::nanoseconds::zero(); | ||
m_frame->presented(std::chrono::nanoseconds(1'000'000'000'000 / refreshRate()), timestamp, | ||
gpuTime, mode); | ||
m_frame.reset(); | ||
} | ||
|
||
DrmGpu *DrmAbstractOutput::gpu() const | ||
{ | ||
return m_gpu; | ||
} | ||
|
||
void DrmAbstractOutput::updateEnabled(bool enabled) | ||
{ | ||
State next = m_state; | ||
next.enabled = enabled; | ||
setState(next); | ||
} | ||
|
||
} // namespace Platform | ||
|
||
} // namespace Aurora |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// SPDX-FileCopyrightText: 2024 Pier Luigi Fiorini <[email protected]> | ||
// SPDX-FileCopyrightText: 2021 Xaver Hugl <[email protected]> | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
|
||
#pragma once | ||
|
||
#include <LiriAuroraPlatform/Output> | ||
|
||
namespace Aurora { | ||
|
||
namespace Platform { | ||
|
||
class DrmBackend; | ||
class DrmGpu; | ||
class DrmOutputLayer; | ||
class OutputFrame; | ||
|
||
class DrmAbstractOutput : public Output | ||
{ | ||
Q_OBJECT | ||
public: | ||
DrmAbstractOutput(DrmGpu *gpu); | ||
|
||
RenderLoop *renderLoop() const override; | ||
void frameFailed() const; | ||
void pageFlipped(std::chrono::nanoseconds timestamp, PresentationMode mode); | ||
DrmGpu *gpu() const; | ||
|
||
virtual bool present(const std::shared_ptr<OutputFrame> &frame) = 0; | ||
virtual DrmOutputLayer *primaryLayer() const = 0; | ||
virtual DrmOutputLayer *cursorLayer() const = 0; | ||
|
||
void updateEnabled(bool enabled); | ||
|
||
protected: | ||
friend class DrmGpu; | ||
|
||
std::unique_ptr<RenderLoop> m_renderLoop; | ||
std::shared_ptr<OutputFrame> m_frame; | ||
DrmGpu *const m_gpu; | ||
}; | ||
|
||
} // namespace Platform | ||
|
||
} // namespace Aurora |
Oops, something went wrong.