mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-06-09 23:08:18 +02:00
egl/gbm: Eliminate max_age local variable
Use oldest_buffer->age instead. Cleanup, no functional change intended. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41845>
This commit is contained in:
parent
485919779d
commit
2b2dbcc13a
1 changed files with 1 additions and 4 deletions
|
|
@ -219,7 +219,6 @@ dri2_drm_destroy_surface(_EGLDisplay *disp, _EGLSurface *surf)
|
|||
static void
|
||||
destroy_oldest_unused_bo(struct dri2_egl_surface *dri2_surf)
|
||||
{
|
||||
int max_age = 0;
|
||||
struct dri2_egl_buffer *oldest_buffer = NULL;
|
||||
|
||||
for (unsigned i = 0; i < ARRAY_SIZE(dri2_surf->color_buffers); i++) {
|
||||
|
|
@ -230,10 +229,8 @@ destroy_oldest_unused_bo(struct dri2_egl_surface *dri2_surf)
|
|||
buffer == dri2_surf->current)
|
||||
continue;
|
||||
|
||||
if (!max_age || buffer->age > max_age) {
|
||||
if (!oldest_buffer || buffer->age > oldest_buffer->age)
|
||||
oldest_buffer = buffer;
|
||||
max_age = buffer->age;
|
||||
}
|
||||
}
|
||||
|
||||
gbm_bo_destroy(oldest_buffer->bo);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue