From 8ca94f4d3faf5ea402d8045d550e6b277be75235 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Thu, 30 Mar 2023 12:05:13 +0200 Subject: [PATCH] backends: Use meta_gamma_lut_new_sized() in a few more places Part-of: --- src/backends/meta-crtc.c | 6 +----- src/backends/native/meta-kms-crtc.c | 7 +------ 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/src/backends/meta-crtc.c b/src/backends/meta-crtc.c index 33d03ac39..33c31d098 100644 --- a/src/backends/meta-crtc.c +++ b/src/backends/meta-crtc.c @@ -229,11 +229,7 @@ meta_gamma_lut_copy_to_size (const MetaGammaLut *gamma, if (gamma->size == target_size) return meta_gamma_lut_copy (gamma); - out = meta_gamma_lut_new (target_size, NULL, NULL, NULL); - - out->red = g_new0 (uint16_t, target_size); - out->green = g_new0 (uint16_t, target_size); - out->blue = g_new0 (uint16_t, target_size); + out = meta_gamma_lut_new_sized (target_size); if (target_size >= gamma->size) { diff --git a/src/backends/native/meta-kms-crtc.c b/src/backends/native/meta-kms-crtc.c index 556f85355..e5405428c 100644 --- a/src/backends/native/meta-kms-crtc.c +++ b/src/backends/native/meta-kms-crtc.c @@ -170,12 +170,7 @@ read_crtc_legacy_gamma (MetaKmsCrtc *crtc, { crtc_state->gamma.size = drm_crtc->gamma_size; crtc_state->gamma.supported = drm_crtc->gamma_size != 0; - crtc_state->gamma.value = meta_gamma_lut_new (drm_crtc->gamma_size, - NULL, NULL, NULL); - - crtc_state->gamma.value->red = g_new0 (uint16_t, drm_crtc->gamma_size); - crtc_state->gamma.value->green = g_new0 (uint16_t, drm_crtc->gamma_size); - crtc_state->gamma.value->blue = g_new0 (uint16_t, drm_crtc->gamma_size); + crtc_state->gamma.value = meta_gamma_lut_new_sized (drm_crtc->gamma_size); drmModeCrtcGetGamma (meta_kms_impl_device_get_fd (impl_device), crtc->id,