intel/display: improve sleep/wakeup handling

Check for capture updates ever in the linux update task when it got
woken, otherwise we may miss screen updates.

Issue #5356
This commit is contained in:
Alexander Boettcher 2024-10-16 16:40:10 +02:00 committed by Christian Helmuth
parent 6a5473b478
commit 6c2c830f66
2 changed files with 12 additions and 21 deletions

View File

@ -878,22 +878,22 @@ static int update_content(void *)
if (connector->status != connector_status_connected)
continue;
if (valid_id) {
if (valid_id)
unchanged[connector->index] ++;
if (unchanged[connector->index] > ATTEMPTS_BEFORE_STOP)
continue;
}
else
printk("%s: connector id invalid %d\n", __func__, connector->index);
block_task = false;
if (valid_id)
may_sleep = unchanged[connector->index] >= ATTEMPTS_BEFORE_STOP;
if (!lx_emul_i915_blit(connector->index, may_sleep))
if (!lx_emul_i915_blit(connector->index, may_sleep)) {
if (!may_sleep)
block_task = false;
continue;
}
block_task = false;
if (valid_id)
unchanged[connector->index] = 0;

View File

@ -105,21 +105,12 @@ struct Framebuffer::Driver
!connector.screen.constructed())
return;
connector.screen->with_texture([&] (Texture<Pixel> const &texture) {
Surface<Pixel> surface((Pixel*)connector.base, connector.size_phys);
auto const affected = connector.capture->capture_at({ 0, 0});
auto box = connector.screen->apply_to_surface(surface);
affected.for_each_rect([&] (Capture::Rect const rect) {
Surface<Pixel> surface((Pixel*)connector.base,
connector.size_phys);
surface.clip(rect);
Blit_painter::paint(surface, texture, Capture::Point(0, 0));
dirty = true;
});
});
if (box.valid())
dirty = true;
if (!dirty && may_stop)
connector.capture->capture_stopped();