mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-29 05:40:12 -04:00
backend/drm: Fix segfault in libliftoff startup
With labwc and WLR_DRM_FORCE_LIBLIFTOFF=1, a segfault is seen on startup because we call output_state_get_buffer_src_box() when there is no buffer set in the output state. Fix this by getting the src/dst box from state->primary_viewport instead.
This commit is contained in:
parent
70add22e74
commit
2420bfef0b
1 changed files with 9 additions and 10 deletions
|
|
@ -331,17 +331,16 @@ static bool add_connector(drmModeAtomicReq *req,
|
|||
if (crtc->props.vrr_enabled != 0) {
|
||||
ok = ok && add_prop(req, crtc->id, crtc->props.vrr_enabled, state->vrr_enabled);
|
||||
}
|
||||
struct wlr_fbox src_box;
|
||||
struct wlr_box dst_box;
|
||||
output_state_get_buffer_src_box(state->base, &src_box);
|
||||
output_state_get_buffer_dst_box(state->base, &dst_box);
|
||||
|
||||
ok = ok &&
|
||||
set_plane_props(crtc->primary, crtc->primary->liftoff_layer,
|
||||
state->primary_fb, 0, &dst_box, &src_box);
|
||||
ok = ok &&
|
||||
set_plane_props(crtc->primary, crtc->liftoff_composition_layer,
|
||||
state->primary_fb, 0, &dst_box, &src_box);
|
||||
ok = ok && set_plane_props(crtc->primary,
|
||||
crtc->primary->liftoff_layer, state->primary_fb, 0,
|
||||
&state->primary_viewport.dst_box,
|
||||
&state->primary_viewport.src_box);
|
||||
ok = ok && set_plane_props(crtc->primary,
|
||||
crtc->liftoff_composition_layer, state->primary_fb, 0,
|
||||
&state->primary_viewport.dst_box,
|
||||
&state->primary_viewport.src_box);
|
||||
|
||||
liftoff_layer_set_property(crtc->primary->liftoff_layer,
|
||||
"FB_DAMAGE_CLIPS", state->fb_damage_clips);
|
||||
liftoff_layer_set_property(crtc->liftoff_composition_layer,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue