renderer/native: Copy mode irrelevant for bo freeing

Simplify the bo freeing functions by not checking what the copy mode is. This
matches what swap_secondary_drm_fb () already does. g_clear_object () is safe
to call even if the value is already NULL.

The copy mode does not change mid-operation. If it did, this change would
ensure we still clean up everything. So this is more future-proof too.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/810
This commit is contained in:
Pekka Paalanen 2019-09-16 16:39:02 +03:00 committed by Jonas Ådahl
parent 94992ffff6
commit fea6abb4f0

View File

@ -974,17 +974,7 @@ static void
free_current_secondary_bo (MetaGpuKms *gpu_kms,
MetaOnscreenNativeSecondaryGpuState *secondary_gpu_state)
{
MetaRendererNativeGpuData *renderer_gpu_data;
renderer_gpu_data = secondary_gpu_state->renderer_gpu_data;
switch (renderer_gpu_data->secondary.copy_mode)
{
case META_SHARED_FRAMEBUFFER_COPY_MODE_SECONDARY_GPU:
g_clear_object (&secondary_gpu_state->gbm.current_fb);
break;
case META_SHARED_FRAMEBUFFER_COPY_MODE_PRIMARY:
break;
}
}
static void
@ -1465,17 +1455,7 @@ static void
free_next_secondary_bo (MetaGpuKms *gpu_kms,
MetaOnscreenNativeSecondaryGpuState *secondary_gpu_state)
{
MetaRendererNativeGpuData *renderer_gpu_data;
renderer_gpu_data = secondary_gpu_state->renderer_gpu_data;
switch (renderer_gpu_data->secondary.copy_mode)
{
case META_SHARED_FRAMEBUFFER_COPY_MODE_SECONDARY_GPU:
g_clear_object (&secondary_gpu_state->gbm.next_fb);
break;
case META_SHARED_FRAMEBUFFER_COPY_MODE_PRIMARY:
break;
}
}
#ifdef HAVE_EGL_DEVICE