mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-14 11:35:46 -07:00
config: disable hw on mgpu nvidia by default (#11018)
This commit is contained in:
@@ -1495,7 +1495,7 @@ inline static const std::vector<SConfigOptionDescription> CONFIG_OPTIONS = {
|
|||||||
|
|
||||||
SConfigOptionDescription{
|
SConfigOptionDescription{
|
||||||
.value = "cursor:no_hardware_cursors",
|
.value = "cursor:no_hardware_cursors",
|
||||||
.description = "disables hardware cursors. Auto = disable when tearing",
|
.description = "disables hardware cursors. Auto = disable when multi-gpu on nvidia",
|
||||||
.type = CONFIG_OPTION_CHOICE,
|
.type = CONFIG_OPTION_CHOICE,
|
||||||
.data = SConfigOptionDescription::SChoiceData{0, "Disabled,Enabled,Auto"},
|
.data = SConfigOptionDescription::SChoiceData{0, "Disabled,Enabled,Auto"},
|
||||||
},
|
},
|
||||||
|
@@ -3134,7 +3134,7 @@ bool CConfigManager::shouldUseSoftwareCursors(PHLMONITOR pMonitor) {
|
|||||||
switch (*PNOHW) {
|
switch (*PNOHW) {
|
||||||
case 0: return false;
|
case 0: return false;
|
||||||
case 1: return true;
|
case 1: return true;
|
||||||
case 2: return pMonitor->m_tearingState.activelyTearing;
|
case 2: return g_pHyprRenderer->isNvidia() && g_pHyprRenderer->isMgpu();
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -56,10 +56,12 @@ static int cursorTicker(void* data) {
|
|||||||
|
|
||||||
CHyprRenderer::CHyprRenderer() {
|
CHyprRenderer::CHyprRenderer() {
|
||||||
if (g_pCompositor->m_aqBackend->hasSession()) {
|
if (g_pCompositor->m_aqBackend->hasSession()) {
|
||||||
|
size_t drmDevices = 0;
|
||||||
for (auto const& dev : g_pCompositor->m_aqBackend->session->sessionDevices) {
|
for (auto const& dev : g_pCompositor->m_aqBackend->session->sessionDevices) {
|
||||||
const auto DRMV = drmGetVersion(dev->fd);
|
const auto DRMV = drmGetVersion(dev->fd);
|
||||||
if (!DRMV)
|
if (!DRMV)
|
||||||
continue;
|
continue;
|
||||||
|
drmDevices++;
|
||||||
std::string name = std::string{DRMV->name, DRMV->name_len};
|
std::string name = std::string{DRMV->name, DRMV->name_len};
|
||||||
std::ranges::transform(name, name.begin(), tolower);
|
std::ranges::transform(name, name.begin(), tolower);
|
||||||
|
|
||||||
@@ -71,6 +73,7 @@ CHyprRenderer::CHyprRenderer() {
|
|||||||
|
|
||||||
drmFreeVersion(DRMV);
|
drmFreeVersion(DRMV);
|
||||||
}
|
}
|
||||||
|
m_mgpu = drmDevices > 1;
|
||||||
} else {
|
} else {
|
||||||
Debug::log(LOG, "Aq backend has no session, omitting full DRM node checks");
|
Debug::log(LOG, "Aq backend has no session, omitting full DRM node checks");
|
||||||
|
|
||||||
@@ -2371,6 +2374,10 @@ bool CHyprRenderer::isNvidia() {
|
|||||||
return m_nvidia;
|
return m_nvidia;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CHyprRenderer::isMgpu() {
|
||||||
|
return m_mgpu;
|
||||||
|
}
|
||||||
|
|
||||||
void CHyprRenderer::addWindowToRenderUnfocused(PHLWINDOW window) {
|
void CHyprRenderer::addWindowToRenderUnfocused(PHLWINDOW window) {
|
||||||
static auto PFPS = CConfigValue<Hyprlang::INT>("misc:render_unfocused_fps");
|
static auto PFPS = CConfigValue<Hyprlang::INT>("misc:render_unfocused_fps");
|
||||||
|
|
||||||
|
@@ -75,6 +75,7 @@ class CHyprRenderer {
|
|||||||
void onRenderbufferDestroy(CRenderbuffer* rb);
|
void onRenderbufferDestroy(CRenderbuffer* rb);
|
||||||
SP<CRenderbuffer> getCurrentRBO();
|
SP<CRenderbuffer> getCurrentRBO();
|
||||||
bool isNvidia();
|
bool isNvidia();
|
||||||
|
bool isMgpu();
|
||||||
void makeEGLCurrent();
|
void makeEGLCurrent();
|
||||||
void unsetEGL();
|
void unsetEGL();
|
||||||
void addWindowToRenderUnfocused(PHLWINDOW window);
|
void addWindowToRenderUnfocused(PHLWINDOW window);
|
||||||
@@ -140,6 +141,7 @@ class CHyprRenderer {
|
|||||||
SP<Aquamarine::IBuffer> m_currentBuffer = nullptr;
|
SP<Aquamarine::IBuffer> m_currentBuffer = nullptr;
|
||||||
eRenderMode m_renderMode = RENDER_MODE_NORMAL;
|
eRenderMode m_renderMode = RENDER_MODE_NORMAL;
|
||||||
bool m_nvidia = false;
|
bool m_nvidia = false;
|
||||||
|
bool m_mgpu = false;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
bool hiddenOnTouch = false;
|
bool hiddenOnTouch = false;
|
||||||
|
Reference in New Issue
Block a user