Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/backend/drm/impl/Atomic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ bool Aquamarine::CDRMAtomicRequest::restateConnectors(SP<SDRMConnector> self) {

// A head that has not scanned out yet has no buffer to restate; its
// existing plane state carries over untouched, which is what we want.
if (c->crtc->primary && c->crtc->primary->front) {
// After suspend/resume (seen on NVIDIA) the retained front FB can be dead,
// i.e. its buffer is gone; touching it would crash (hyprwm/aquamarine#466).
if (c->crtc->primary && c->crtc->primary->front && !c->crtc->primary->front->dead && c->crtc->primary->front->buffer) {
// planeProps reads per-connector state off `conn`, so point it at the
// head we are restating rather than ours.
const auto saved = conn;
Expand Down Expand Up @@ -146,6 +148,13 @@ void Aquamarine::CDRMAtomicRequest::planeProps(Hyprutils::Memory::CSharedPointer
return;
}

if (fb->dead || !fb->buffer) {
// a dead FB has no backing buffer anymore - fail the request instead of crashing (hyprwm/aquamarine#466)
backend->log(AQ_LOG_ERROR, std::format("atomic planeProps: refusing dead framebuffer on plane {}", plane->id));
failed = true;
return;
}

TRACE(backend->log(AQ_LOG_TRACE,
std::format("atomic planeProps: prop blobs: src_x {}, src_y {}, src_w {}, src_h {}, crtc_w {}, crtc_h {}, fb_id {}, crtc_id {}", plane->props.values.src_x,
plane->props.values.src_y, plane->props.values.src_w, plane->props.values.src_h, plane->props.values.crtc_w, plane->props.values.crtc_h,
Expand Down
Loading