summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVaxry <vaxry@vaxry.net>2024-06-09 21:10:46 +0200
committerVaxry <vaxry@vaxry.net>2024-06-09 21:10:46 +0200
commit722b846ac5205ec3e9a2940abfefa273fa4219d4 (patch)
treea2b0d4de6104133a47a49205e6311c2b0a92006e /src
parent4168b8c17b12b90873fab1ca73c2981b53f48bf5 (diff)
egl: assume implicit modifiers are available for old drivers
fixes #6367
Diffstat (limited to 'src')
-rw-r--r--src/Compositor.cpp6
-rw-r--r--src/managers/ProtocolManager.cpp9
-rw-r--r--src/render/OpenGL.cpp6
3 files changed, 15 insertions, 6 deletions
diff --git a/src/Compositor.cpp b/src/Compositor.cpp
index b0456358..5c0b8eaa 100644
--- a/src/Compositor.cpp
+++ b/src/Compositor.cpp
@@ -403,6 +403,9 @@ void CCompositor::initManagers(eManagersInitStage stage) {
g_pPointerManager = std::make_unique<CPointerManager>();
} break;
case STAGE_BASICINIT: {
+ Debug::log(LOG, "Creating the CHyprOpenGLImpl!");
+ g_pHyprOpenGL = std::make_unique<CHyprOpenGLImpl>();
+
Debug::log(LOG, "Creating the ProtocolManager!");
g_pProtocolManager = std::make_unique<CProtocolManager>();
@@ -419,9 +422,6 @@ void CCompositor::initManagers(eManagersInitStage stage) {
Debug::log(LOG, "Creating the InputManager!");
g_pInputManager = std::make_unique<CInputManager>();
- Debug::log(LOG, "Creating the CHyprOpenGLImpl!");
- g_pHyprOpenGL = std::make_unique<CHyprOpenGLImpl>();
-
Debug::log(LOG, "Creating the HyprRenderer!");
g_pHyprRenderer = std::make_unique<CHyprRenderer>();
diff --git a/src/managers/ProtocolManager.cpp b/src/managers/ProtocolManager.cpp
index bd435b27..7946a3f7 100644
--- a/src/managers/ProtocolManager.cpp
+++ b/src/managers/ProtocolManager.cpp
@@ -44,6 +44,7 @@
#include "../protocols/core/Shm.hpp"
#include "../helpers/Monitor.hpp"
+#include "../render/Renderer.hpp"
CProtocolManager::CProtocolManager() {
@@ -103,8 +104,12 @@ CProtocolManager::CProtocolManager() {
PROTO::dataWlr = std::make_unique<CDataDeviceWLRProtocol>(&zwlr_data_control_manager_v1_interface, 2, "DataDeviceWlr");
PROTO::primarySelection = std::make_unique<CPrimarySelectionProtocol>(&zwp_primary_selection_device_manager_v1_interface, 1, "PrimarySelection");
PROTO::xwaylandShell = std::make_unique<CXWaylandShellProtocol>(&xwayland_shell_v1_interface, 1, "XWaylandShell");
- PROTO::mesaDRM = std::make_unique<CMesaDRMProtocol>(&wl_drm_interface, 2, "MesaDRM");
- PROTO::linuxDma = std::make_unique<CLinuxDMABufV1Protocol>(&zwp_linux_dmabuf_v1_interface, 5, "LinuxDMABUF");
+
+ if (g_pHyprOpenGL->getDRMFormats().size() > 0) {
+ PROTO::mesaDRM = std::make_unique<CMesaDRMProtocol>(&wl_drm_interface, 2, "MesaDRM");
+ PROTO::linuxDma = std::make_unique<CLinuxDMABufV1Protocol>(&zwp_linux_dmabuf_v1_interface, 5, "LinuxDMABUF");
+ } else
+ Debug::log(WARN, "ProtocolManager: Not binding linux-dmabuf and MesaDRM: DMABUF not available");
// Old protocol implementations.
// TODO: rewrite them to use hyprwayland-scanner.
diff --git a/src/render/OpenGL.cpp b/src/render/OpenGL.cpp
index d4e8faa6..406ffdd0 100644
--- a/src/render/OpenGL.cpp
+++ b/src/render/OpenGL.cpp
@@ -92,7 +92,7 @@ std::vector<uint64_t> CHyprOpenGLImpl::getModsForFormat(EGLint format) {
}
if (len <= 0)
- return {};
+ return {DRM_FORMAT_MOD_LINEAR, DRM_FORMAT_MOD_INVALID}; // assume the driver can do linear and implicit.
std::vector<uint64_t> mods;
std::vector<EGLBoolean> external;
@@ -190,6 +190,10 @@ void CHyprOpenGLImpl::initDRMFormats() {
Debug::log(LOG, "EGL: {} formats found in total. Some modifiers may be omitted as they are external-only.", dmaFormats.size());
+ if (dmaFormats.size() == 0)
+ Debug::log(WARN,
+ "EGL: WARNING: No dmabuf formats were found, dmabuf will be disabled. This will degrade performance, but is most likely a driver issue or a very old GPU.");
+
drmFormats = dmaFormats;
}