[mutter] renderer/native: Extract secondary_gpu_release_dumb
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] renderer/native: Extract secondary_gpu_release_dumb
- Date: Thu, 16 Jan 2020 20:32:51 +0000 (UTC)
commit f409dddb54fab5f150f83d6c47ebf09eb071181d
Author: Pekka Paalanen <pekka paalanen collabora com>
Date: Tue Sep 17 13:23:22 2019 +0300
renderer/native: Extract secondary_gpu_release_dumb
There will be another place where I need to release the dumb buffers but not
destroy the whole secondary_gpu_state, so extract this bit of code into a
helper.
The checks of fb_id are dropped as redundant with the check already in in
release_dumb_fb ().
https://gitlab.gnome.org/GNOME/mutter/merge_requests/810
src/backends/native/meta-renderer-native.c | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
---
diff --git a/src/backends/native/meta-renderer-native.c b/src/backends/native/meta-renderer-native.c
index d7b98d397..33fd5f841 100644
--- a/src/backends/native/meta-renderer-native.c
+++ b/src/backends/native/meta-renderer-native.c
@@ -714,13 +714,22 @@ init_secondary_gpu_state_gpu_copy_mode (MetaRendererNative *renderer_nat
return TRUE;
}
+static void
+secondary_gpu_release_dumb (MetaOnscreenNativeSecondaryGpuState *secondary_gpu_state)
+{
+ MetaGpuKms *gpu_kms = secondary_gpu_state->gpu_kms;
+ unsigned i;
+
+ for (i = 0; i < G_N_ELEMENTS (secondary_gpu_state->cpu.dumb_fbs); i++)
+ release_dumb_fb (&secondary_gpu_state->cpu.dumb_fbs[i], gpu_kms);
+}
+
static void
secondary_gpu_state_free (MetaOnscreenNativeSecondaryGpuState *secondary_gpu_state)
{
MetaBackend *backend = meta_get_backend ();
MetaEgl *egl = meta_backend_get_egl (backend);
MetaGpuKms *gpu_kms = secondary_gpu_state->gpu_kms;
- unsigned int i;
if (secondary_gpu_state->egl_surface != EGL_NO_SURFACE)
{
@@ -737,13 +746,7 @@ secondary_gpu_state_free (MetaOnscreenNativeSecondaryGpuState *secondary_gpu_sta
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++)
- {
- MetaDumbBuffer *dumb_fb = &secondary_gpu_state->cpu.dumb_fbs[i];
-
- if (dumb_fb->fb_id)
- release_dumb_fb (dumb_fb, gpu_kms);
- }
+ secondary_gpu_release_dumb (secondary_gpu_state);
g_free (secondary_gpu_state);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]