Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check if running in NVIDIA graphics mode #42

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

crawfxrd
Copy link
Member

Just checking for the proprietary drivers is no longer sufficient, as they will be loaded in hybrid graphics mode but not be used for rendering the desktop.

Rely on the /etc/prime-discrete file written by system76-power and gpu-manager to check which rendering mode is being used, falling back to checking the modules if it doesn't exist.

@crawfxrd crawfxrd requested review from a team August 30, 2022 21:19
@crawfxrd crawfxrd changed the title Check if running in hybrid graphics mode Check if running in NVIDIA graphics mode Aug 30, 2022
@jacobgkau
Copy link
Member

This is meant to fix #34, right?

@crawfxrd
Copy link
Member Author

Yeah, I guess. I did it to stop the spam on oryp10.

@crawfxrd
Copy link
Member Author

I can't dismiss the HiDPI notification, which is the same behavior I see while in NVIDIA graphics mode.

@jacobgkau jacobgkau linked an issue Aug 30, 2022 that may be closed by this pull request
@jacobgkau jacobgkau self-assigned this Aug 30, 2022
@jacobgkau
Copy link
Member

Confirmed this gets the HiDPI Daemon running again on addw2 in Hybrid mode. Still runs in NVIDIA and Integrated modes too.

I am seeing an issue in Hybrid mode that is not appearing in NVIDIA mode. An external LoDPI display (27" 1440p ViewSonic VP2771LED) always appears with 200% scaling, regardless of the mode that the daemon is in. In NVIDIA mode, the external display always shows at 100% scale.

Correct behavior in NVIDIA mode (external display on the right):

Screenshot from 2022-08-30 16-15-59

Same config in Hybrid mode (external display still on the right, although it defaulted to above multiple times):

Screenshot from 2022-08-30 16-19-27

I can't compare the behavior to Integrated mode since addw2 requires NVIDIA for any of the external display ports.

isantop
isantop previously approved these changes Aug 31, 2022
Copy link

@isantop isantop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good on my end here, as long as QA passes 👍

else:
with open(lid_file_path, 'r') as lid_file:
if 'open' in lid_file.read():
return True
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greatly appreciate the use of a ContextManager here, that file was never getting closed it looks like.

@crawfxrd
Copy link
Member Author

crawfxrd commented Aug 31, 2022

I have a Dell U2515H plugged in via HDMI. I see HiDPI overriding scaling to 200% on the eDP. And if I reboot with it plugged it, it thinks the external display is the default device.

How does it behave if hidpi-daemon is uninstalled?

Just checking for the proprietary drivers is no longer sufficient, as
they will be loaded in hybrid graphics mode but not be used for
rendering the desktop.

Rely on the `/etc/prime-discrete` file written by system76-power and
gpu-manager to check which rendering mode is being used, falling back to
checking the modules if it doesn't exist.

Signed-off-by: Tim Crawford <[email protected]>
@@ -1,3 +1,10 @@
hidpi-daemon (18.04.7~~alpha) bionic; urgency=low
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I change this to focal?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updating the version and codename might be a good idea depending on how much longer we believe we need to include this software.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Doesn't work in Hybrid graphics mode
4 participants