From 26ce5cd6bee871fd84a152cad9b9deb28fc0531a Mon Sep 17 00:00:00 2001 From: Robert Mader Date: Sat, 10 Feb 2024 16:53:17 +0100 Subject: [PATCH] kms/update: Add meta_fixed_16_from_double helper It will be used in the next commit. Part-of: --- src/backends/native/meta-kms-update.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/backends/native/meta-kms-update.h b/src/backends/native/meta-kms-update.h index 096c19eaf..d50295d30 100644 --- a/src/backends/native/meta-kms-update.h +++ b/src/backends/native/meta-kms-update.h @@ -209,6 +209,12 @@ meta_fixed_16_to_int (MetaFixed16 fixed) return fixed / (1 << 16); } +static inline MetaFixed16 +meta_fixed_16_from_double (double d) +{ + return d * (1 << 16); +} + static inline double meta_fixed_16_to_double (MetaFixed16 fixed) {