kms/surface: Call cleanup_texture_cache for each device at end of draw
Fixes an issue where a dual GPU system would keep allocating dGPU PBOs in `cpu_copy()` every frame, but `cleanup()` was not being called, since the surface thread for the builtin output was rendered on the primary/integrated GPU, targeting the same GPU. Even if a different monitor was compositing on the dGPU, That wouldn't help since that thread has it's own `GpuManager` with it's own renderer and cache. Running cleanup at the end (or start) of each frame seems like a good idea. Not sure if it would be best to avoid additional calls, or if that's desirable/fine.
This commit is contained in:
parent
619e994955
commit
f86cd933d4
1 changed files with 5 additions and 1 deletions
|
|
@ -45,7 +45,7 @@ use smithay::{
|
||||||
element::TextureShaderElement, GlesRenderbuffer, GlesRenderer, GlesTexture, Uniform,
|
element::TextureShaderElement, GlesRenderbuffer, GlesRenderer, GlesTexture, Uniform,
|
||||||
},
|
},
|
||||||
glow::GlowRenderer,
|
glow::GlowRenderer,
|
||||||
multigpu::{Error as MultiError, GpuManager},
|
multigpu::{ApiDevice, Error as MultiError, GpuManager},
|
||||||
sync::SyncPoint,
|
sync::SyncPoint,
|
||||||
utils::with_renderer_surface_state,
|
utils::with_renderer_surface_state,
|
||||||
Bind, Blit, Frame, ImportDma, Offscreen, Renderer, RendererSuper, Texture,
|
Bind, Blit, Frame, ImportDma, Offscreen, Renderer, RendererSuper, Texture,
|
||||||
|
|
@ -1751,6 +1751,10 @@ impl SurfaceThreadState {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for device in self.api.devices_mut()? {
|
||||||
|
device.renderer_mut().cleanup_texture_cache()?;
|
||||||
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue