From: jsg Date: Wed, 27 Mar 2024 04:58:34 +0000 (+0000) Subject: drm: Fix drm_fixp2int_round() making it add 0.5 X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=ca1a1ccb1fe250c9ded1a6b5d1772dacd402decf;p=openbsd drm: Fix drm_fixp2int_round() making it add 0.5 From Arthur Grillo 296e6678a432aaff0b8c6a6a17b9b2b193556c71 in linux-6.6.y/6.6.23 807f96abdf14c80f534c78f2d854c2590963345c in mainline linux --- diff --git a/sys/dev/pci/drm/include/drm/drm_fixed.h b/sys/dev/pci/drm/include/drm/drm_fixed.h index 0c9f917a4d4..81572d32db0 100644 --- a/sys/dev/pci/drm/include/drm/drm_fixed.h +++ b/sys/dev/pci/drm/include/drm/drm_fixed.h @@ -71,7 +71,6 @@ static inline u32 dfixed_div(fixed20_12 A, fixed20_12 B) } #define DRM_FIXED_POINT 32 -#define DRM_FIXED_POINT_HALF 16 #define DRM_FIXED_ONE (1ULL << DRM_FIXED_POINT) #define DRM_FIXED_DECIMAL_MASK (DRM_FIXED_ONE - 1) #define DRM_FIXED_DIGITS_MASK (~DRM_FIXED_DECIMAL_MASK) @@ -90,7 +89,7 @@ static inline int drm_fixp2int(s64 a) static inline int drm_fixp2int_round(s64 a) { - return drm_fixp2int(a + (1 << (DRM_FIXED_POINT_HALF - 1))); + return drm_fixp2int(a + DRM_FIXED_ONE / 2); } static inline int drm_fixp2int_ceil(s64 a)