kms: Fix unreachable code during forced queued redraws
This commit is contained in:
parent
707eace679
commit
449048bdc5
1 changed files with 23 additions and 8 deletions
|
|
@ -765,6 +765,14 @@ impl SurfaceThreadState {
|
|||
return;
|
||||
};
|
||||
|
||||
if let QueueState::WaitingForVBlank { .. } = &self.state {
|
||||
// We're waiting for VBlank, request a redraw afterwards.
|
||||
self.state = QueueState::WaitingForVBlank {
|
||||
redraw_needed: true,
|
||||
};
|
||||
return;
|
||||
}
|
||||
|
||||
if !force {
|
||||
match &self.state {
|
||||
QueueState::Idle | QueueState::WaitingForEstimatedVBlank(_) => {}
|
||||
|
|
@ -773,14 +781,7 @@ impl SurfaceThreadState {
|
|||
QueueState::Queued(_) | QueueState::WaitingForEstimatedVBlankAndQueued { .. } => {
|
||||
return;
|
||||
}
|
||||
|
||||
// We're waiting for VBlank, request a redraw afterwards.
|
||||
QueueState::WaitingForVBlank { .. } => {
|
||||
self.state = QueueState::WaitingForVBlank {
|
||||
redraw_needed: true,
|
||||
};
|
||||
return;
|
||||
}
|
||||
_ => unreachable!(),
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -817,6 +818,20 @@ impl SurfaceThreadState {
|
|||
queued_render: token,
|
||||
};
|
||||
}
|
||||
QueueState::Queued(old_token) if force => {
|
||||
self.loop_handle.remove(*old_token);
|
||||
self.state = QueueState::Queued(token);
|
||||
}
|
||||
QueueState::WaitingForEstimatedVBlankAndQueued {
|
||||
estimated_vblank,
|
||||
queued_render,
|
||||
} if force => {
|
||||
self.loop_handle.remove(*queued_render);
|
||||
self.state = QueueState::WaitingForEstimatedVBlankAndQueued {
|
||||
estimated_vblank: estimated_vblank.clone(),
|
||||
queued_render: token,
|
||||
};
|
||||
}
|
||||
_ => unreachable!(),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue