From 40408150f0d1d962e7510c370de49475b067f761 Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Mon, 16 Sep 2019 16:47:49 +0300 Subject: [PATCH] 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 --- src/backends/native/meta-renderer-native.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/backends/native/meta-renderer-native.c b/src/backends/native/meta-renderer-native.c index 8ecb5f0c3..9bdcbd937 100644 --- a/src/backends/native/meta-renderer-native.c +++ b/src/backends/native/meta-renderer-native.c @@ -264,10 +264,6 @@ static void free_current_secondary_bo (MetaGpuKms *gpu_kms, MetaOnscreenNativeSecondaryGpuState *secondary_gpu_state); -static void -free_next_secondary_bo (MetaGpuKms *gpu_kms, - MetaOnscreenNativeSecondaryGpuState *secondary_gpu_state); - static gboolean cogl_pixel_format_from_drm_format (uint32_t drm_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_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); 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, }; -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 static int custom_egl_stream_page_flip (gpointer custom_page_flip_data,