mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-12-23 18:39:48 +01:00
backend/wayland: check scan-out buffer is compatible in output_test
If the buffer doesn't have a supported format/modifier, make the test fail.
This commit is contained in:
parent
50ade3671f
commit
83c1ba7783
1 changed files with 9 additions and 0 deletions
|
@ -190,6 +190,9 @@ static struct wlr_wl_buffer *create_wl_buffer(struct wlr_wl_backend *wl,
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool output_test(struct wlr_output *wlr_output) {
|
static bool output_test(struct wlr_output *wlr_output) {
|
||||||
|
struct wlr_wl_output *output =
|
||||||
|
get_wl_output_from_output(wlr_output);
|
||||||
|
|
||||||
if (wlr_output->pending.committed & WLR_OUTPUT_STATE_ENABLED) {
|
if (wlr_output->pending.committed & WLR_OUTPUT_STATE_ENABLED) {
|
||||||
wlr_log(WLR_DEBUG, "Cannot disable a Wayland output");
|
wlr_log(WLR_DEBUG, "Cannot disable a Wayland output");
|
||||||
return false;
|
return false;
|
||||||
|
@ -199,6 +202,12 @@ static bool output_test(struct wlr_output *wlr_output) {
|
||||||
assert(wlr_output->pending.mode_type == WLR_OUTPUT_STATE_MODE_CUSTOM);
|
assert(wlr_output->pending.mode_type == WLR_OUTPUT_STATE_MODE_CUSTOM);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((wlr_output->pending.committed & WLR_OUTPUT_STATE_BUFFER) &&
|
||||||
|
wlr_output->pending.buffer_type == WLR_OUTPUT_STATE_BUFFER_SCANOUT &&
|
||||||
|
!test_buffer(output->backend, wlr_output->pending.buffer)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue