linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] drm: Add drm_fixed_16_16 helper
@ 2021-09-01 17:54 Alyssa Rosenzweig
  2021-09-01 17:54 ` [PATCH 2/5] drm/meson: Use common " Alyssa Rosenzweig
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Alyssa Rosenzweig @ 2021-09-01 17:54 UTC (permalink / raw)
  To: dri-devel
  Cc: Neil Armstrong, David Airlie, Daniel Vetter, Kevin Hilman,
	Jerome Brunet, Martin Blumenstingl, Rob Clark, Sean Paul,
	Sandy Huang, Heiko Stübner, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, Abhinav Kumar,
	Dmitry Baryshkov, Lee Jones, Stephen Boyd, Kalyan Thota,
	Laurent Pinchart, Ville Syrjälä,
	linux-arm-kernel, linux-kernel, Alyssa Rosenzweig

This constructs a fixed 16.16 rational, useful to specify the minimum
and maximum scaling in drm_atomic_helper_check_plane_state. It is
open-coded as a macro in multiple drivers, so let's share the helper.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
---
 include/drm/drm_fixed.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/drm/drm_fixed.h b/include/drm/drm_fixed.h
index 553210c02ee0..df1f369b4918 100644
--- a/include/drm/drm_fixed.h
+++ b/include/drm/drm_fixed.h
@@ -208,4 +208,9 @@ static inline s64 drm_fixp_exp(s64 x)
 	return sum;
 }
 
+static inline int drm_fixed_16_16(s32 mult, s32 div)
+{
+	return (mult << 16) / div;
+}
+
 #endif
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-09-02  9:16 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-01 17:54 [PATCH 1/5] drm: Add drm_fixed_16_16 helper Alyssa Rosenzweig
2021-09-01 17:54 ` [PATCH 2/5] drm/meson: Use common " Alyssa Rosenzweig
2021-09-02  9:15   ` Neil Armstrong
2021-09-01 17:54 ` [PATCH 3/5] drm/msm: " Alyssa Rosenzweig
2021-09-01 17:54 ` [PATCH 4/5] drm/rockchip: " Alyssa Rosenzweig
2021-09-01 17:54 ` [PATCH 5/5] drm/zte: " Alyssa Rosenzweig
2021-09-01 18:13 ` [PATCH 1/5] drm: Add " Laurent Pinchart
2021-09-02  1:35   ` Alyssa Rosenzweig
2021-09-02  3:22     ` Laurent Pinchart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).