mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-02 09:01:38 -05:00
output: add wlr_output_is_direct_scanout_allowed()
This lets compositors check whether direct scan-out is possible. Compositors will soon be responsible for manually calling this function.
This commit is contained in:
parent
835208db98
commit
079ff9e6fb
2 changed files with 27 additions and 0 deletions
|
|
@ -1025,3 +1025,23 @@ const struct wlr_drm_format_set *wlr_output_get_primary_formats(
|
|||
|
||||
return formats;
|
||||
}
|
||||
|
||||
bool wlr_output_is_direct_scanout_allowed(struct wlr_output *output) {
|
||||
if (output->attach_render_locks > 0) {
|
||||
wlr_log(WLR_DEBUG, "Direct scan-out disabled by lock");
|
||||
return false;
|
||||
}
|
||||
|
||||
// If the output has at least one software cursor, reject direct scan-out
|
||||
struct wlr_output_cursor *cursor;
|
||||
wl_list_for_each(cursor, &output->cursors, link) {
|
||||
if (cursor->enabled && cursor->visible &&
|
||||
cursor != output->hardware_cursor) {
|
||||
wlr_log(WLR_DEBUG,
|
||||
"Direct scan-out disabled by software cursor");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue