renderer/native: Absorb free_next_secondary_bo

The function is trivial and only used once, so fold it into the caller.

Makes the code more readable by removing a little bit of boilerplate.

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

View File

@ -264,10 +264,6 @@ static void
free_current_secondary_bo (MetaGpuKms *gpu_kms, free_current_secondary_bo (MetaGpuKms *gpu_kms,
MetaOnscreenNativeSecondaryGpuState *secondary_gpu_state); MetaOnscreenNativeSecondaryGpuState *secondary_gpu_state);
static void
free_next_secondary_bo (MetaGpuKms *gpu_kms,
MetaOnscreenNativeSecondaryGpuState *secondary_gpu_state);
static gboolean static gboolean
cogl_pixel_format_from_drm_format (uint32_t drm_format, cogl_pixel_format_from_drm_format (uint32_t drm_format,
CoglPixelFormat *out_format, CoglPixelFormat *out_format,
@ -738,7 +734,7 @@ secondary_gpu_state_free (MetaOnscreenNativeSecondaryGpuState *secondary_gpu_sta
} }
free_current_secondary_bo (gpu_kms, secondary_gpu_state); free_current_secondary_bo (gpu_kms, secondary_gpu_state);
free_next_secondary_bo (gpu_kms, secondary_gpu_state); g_clear_object (&secondary_gpu_state->gbm.next_fb);
g_clear_pointer (&secondary_gpu_state->gbm.surface, gbm_surface_destroy); g_clear_pointer (&secondary_gpu_state->gbm.surface, gbm_surface_destroy);
for (i = 0; i < G_N_ELEMENTS (secondary_gpu_state->cpu.dumb_fbs); i++) for (i = 0; i < G_N_ELEMENTS (secondary_gpu_state->cpu.dumb_fbs); i++)
@ -1451,13 +1447,6 @@ static const MetaKmsPageFlipFeedback page_flip_feedback = {
.discarded = page_flip_feedback_discarded, .discarded = page_flip_feedback_discarded,
}; };
static void
free_next_secondary_bo (MetaGpuKms *gpu_kms,
MetaOnscreenNativeSecondaryGpuState *secondary_gpu_state)
{
g_clear_object (&secondary_gpu_state->gbm.next_fb);
}
#ifdef HAVE_EGL_DEVICE #ifdef HAVE_EGL_DEVICE
static int static int
custom_egl_stream_page_flip (gpointer custom_page_flip_data, custom_egl_stream_page_flip (gpointer custom_page_flip_data,