egl: assume implicit modifiers are available for old drivers

fixes #6367
This commit is contained in:
Vaxry 2024-06-09 21:10:46 +02:00
parent 4168b8c17b
commit 722b846ac5
3 changed files with 15 additions and 6 deletions

View file

@ -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>();

View file

@ -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");
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.

View file

@ -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;
}