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

refresh rate? #77

Open
chimps-ahoy opened this issue May 28, 2024 · 1 comment
Open

refresh rate? #77

chimps-ahoy opened this issue May 28, 2024 · 1 comment

Comments

@chimps-ahoy
Copy link

I am wondering how the compositor detects/configures the refresh rate of the display.

I am writing my own window manager with swc and I noticed when testing it that my display was only running at 60hz when on X11 it runs at the full 170hz. I checked with the example wm and it is still the case.

I wasn't able to find a function call or anything to check/set the refresh rate, so I figured I'd ask :)

@chimps-ahoy
Copy link
Author

i have come to update this after doing some more research, but this can also be closed and i will open another issue if that is better.

the obvious solution is to wlr-output-management-unstable-v1 which would allow the use of tools like wlr-randr (and i will look into this on my own and submit a pr if i manage to do anything, but i have not done something like that before and it seems like a big task so i do not know if i will be successfull), but i think a solution that could get good results with much less work would be to have the compositor select the output with the highest refresh rate on creation.

taking a look at libswc/output.c @ lines:92-100, we can see that the preferred output mode is set to the last preferred mode found (lines 95 and 96), and if none are preferred we use the first one found.

this could be changed to select the mode with the highest refresh that still has preferred == true, and if no preferred modes are found, we take the one with the highest refresh. this could all be implemented by simply sorting the array (perhaps with the std qsort function to keep the code short and simple?)

i did try this solution on my local machine, but the compositor (i just used example/wm to test) wasn't even able to find/load my drivers, and never started (definitely a mistake on my part), so i figured i would suggest it here, as i am still unfamiliar with the codebase and someone else may take a look and have an idea.

thanks :)

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

No branches or pull requests

1 participant