summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime Ripard <mripard@kernel.org>2024-03-04 10:12:25 +0100
committerTreehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com>2024-05-17 11:50:38 +0000
commitb65d389fad287a6c8b2dfd23e6a2c293e6c2543d (patch)
tree673fccf22963e9dbcd54a3604d599cdf651ec353
parent9f81255173e97d0108b5eb930c1dc635eb734e7c (diff)
downloadcommon-android-mainline.tar.gz
UPSTREAM: drm/sun4i: hdmi: Fix u64 div on 32bit archandroid-mainline
Commit 358e76fd613a ("drm/sun4i: hdmi: Consolidate atomic_check and mode_valid") changed the clock rate from an unsigned long to an unsigned long long resulting in a a 64-bit division that might not be supported on all platforms. The resulted in compilation being broken at least for m68k, xtensa and some arm configurations, at least. Fixes: 358e76fd613a ("drm/sun4i: hdmi: Consolidate atomic_check and mode_valid") Reported-by: Geert Uytterhoeven <geert@linux-m68k.org> Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org> Closes: https://lore.kernel.org/r/CA+G9fYvG9KE15PGNoLu+SBVyShe+u5HBLQ81+kK9Zop6u=ywmw@mail.gmail.com/ Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202403011839.KLiXh4wC-lkp@intel.com/ Acked-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://lore.kernel.org/r/20240304091225.366325-1-mripard@kernel.org Signed-off-by: Maxime Ripard <mripard@kernel.org> (cherry picked from commit 5d515eb1295151aa3e50af69fc726823aba7bac3) [Lee: Fixes: patch breaks pre-submit during upstream merges] Signed-off-by: Lee Jones <joneslee@google.com> Change-Id: Ia201e7b5d6005f1eff86f924c992ba15ec45d6e7
-rw-r--r--drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
index 69001a3dc0df..2d1880c61b50 100644
--- a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
+++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
@@ -166,7 +166,7 @@ sun4i_hdmi_connector_clock_valid(const struct drm_connector *connector,
unsigned long long clock)
{
const struct sun4i_hdmi *hdmi = drm_connector_to_sun4i_hdmi(connector);
- unsigned long diff = clock / 200; /* +-0.5% allowed by HDMI spec */
+ unsigned long diff = div_u64(clock, 200); /* +-0.5% allowed by HDMI spec */
long rounded_rate;
if (mode->flags & DRM_MODE_FLAG_DBLCLK)