-
Notifications
You must be signed in to change notification settings - Fork 1.1k
wayland: add and implement EventLoopExtDrm #4300
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
base: master
Are you sure you want to change the base?
Conversation
e220333 to
ce36a9c
Compare
| pub fn main_drm_device(&self) -> Option<dev_t> { | ||
| match self { | ||
| EventLoop::Wayland(evlp) => evlp.main_drm_device(), | ||
| EventLoop::X(_) => None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't care enough about X to implement this. But it is possible by using the Dri3Open request to get a DRM fd and then calling stat on it.
ce36a9c to
1e002f5
Compare
This extension trait allows general-purpose applications to query the preferred GPU device so that they do not engage the dedicated GPU unnecessarily. Without such a hint, applications are likely to choose the first available device which will always be the dedicated GPU which is undesirable on mobile devices. Similarly, on desktop dual-GPU systems where the integrated GPU is otherwise unused, it is preferred for all applications to use the dedicated GPU.
1e002f5 to
5b1e433
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need it on EventLoop itself? In general though, we can just have it entirely in winit-wayland, I also don't care about X11 and not even sure if touching DRI on it is a good idea.
What would the API look like? |
|
I guess pretty much the same as of now, just entirely inside the |
|
I still don't see how that would work unless you're saying that winit should create a whole separate connection just to fetch this property. |
|
Do you need it on |
|
That would be possible but it is not in sync with the rest of the API as they are right now. Currently the extensions look like this: pub trait EventLoopExtWayland {
fn is_wayland(&self) -> bool;
}
pub trait WindowExtWayland {
fn xdg_toplevel(&self) -> Option<NonNull<c_void>>;
}If they were changed to pub trait EventLoopExtWayland {
fn as_wayland_event_loop(&self) -> Option<&WaylandEventLoop>;
}
pub trait WindowExtWayland {
fn as_wayland_window(&self) -> Option<&WaylandWindow>;
}then it would make sense to define this on |
|
Yeah, that's the end intent for those things, I'm just busy with other things to finish, though, I can just do it later on myself and we leave this PR as is pretty much. |
|
I agree that that design would ultimately be better because the individual functions ( This PR can wait until the new design is fleshed out. |
This extension trait allows general-purpose applications to query the preferred GPU device so that they do not engage the dedicated GPU unnecessarily.
Without such a hint, applications are likely to choose the first available device which will always be the dedicated GPU which is undesirable on mobile devices.
Similarly, on desktop dual-GPU systems where the integrated GPU is otherwise unused, it is preferred for all applications to use the dedicated GPU.
changelogmodule if knowledge of this change could be valuable to users