drm/rockchip: rk618: Fix compile error on arm32 platform

Fix follow build error on arm32:

In file included from ./arch/arm/include/asm/div64.h:127:0,
                 from ./include/linux/kernel.h:208,
                 from ./include/linux/clk.h:16,
                 from drivers/gpu/drm/rockchip/rk618/rk618_scaler.c:8:
drivers/gpu/drm/rockchip/rk618/rk618_scaler.c: In function
'calc_dsp_frm_hst_vst':
./include/asm-generic/div64.h:222:28: warning: comparison of distinct
pointer types lacks a cast
error, forbidden warning:div64.h:222
  (void)(((typeof((n)) *)0) == ((uint64_t *)0)); \
                            ^
drivers/gpu/drm/rockchip/rk618/rk618_scaler.c:123:2: note: in expansion
of macro 'do_div'
  do_div(t_frm_st, src_pixclock);
  ^~~~~~
./include/asm-generic/div64.h:222:28: warning: comparison of distinct
pointer types lacks a cast
error, forbidden warning:div64.h:222
  (void)(((typeof((n)) *)0) == ((uint64_t *)0)); \
                            ^
drivers/gpu/drm/rockchip/rk618/rk618_scaler.c:124:19: note: in expansion
of macro 'do_div'
  *dsp_frame_hst = do_div(t_frm_st, src_htotal);

drivers/gpu/drm/rockchip/rk618/rk618_scaler.c:303:
undefined reference to `__aeabi_uldivmod'
drivers/gpu/drm/rockchip/rk618/rk618_scaler.c:304:
undefined reference to `__aeabi_uldivmod'
drivers/gpu/drm/rockchip/rk618/rk618_dsi.o: In function
`rk618_dsi_set_hs_clk':
drivers/gpu/drm/rockchip/rk618/rk618_dsi.c:297:
undefined reference to `__aeabi_uldivmod'

Change-Id: I7a63cf63217e75ca5b2115581d39492642225e81
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
This commit is contained in:
Andy Yan
2020-04-24 17:05:19 +08:00
parent fdd815e602
commit 0cceb75ca5
2 changed files with 7 additions and 5 deletions

View File

@@ -293,8 +293,9 @@ static void rk618_dsi_set_hs_clk(struct rk618_dsi *dsi)
bandwidth = (u64)mode->clock * 1000 * bpp;
do_div(bandwidth, lanes);
bandwidth = bandwidth * 10 / 9;
bandwidth = bandwidth / USEC_PER_SEC * USEC_PER_SEC;
bandwidth = div_u64(bandwidth * 10, 9);
bandwidth = div_u64(bandwidth, USEC_PER_SEC);
bandwidth = bandwidth * USEC_PER_SEC;
fout = bandwidth;
}

View File

@@ -85,7 +85,7 @@ static void calc_dsp_frm_hst_vst(const struct videomode *src,
{
u32 bp_in, bp_out;
u32 v_scale_ratio;
long long t_frm_st;
u64 t_frm_st;
u64 t_bp_in, t_bp_out, t_delta, tin;
u32 src_pixclock, dst_pixclock;
u32 dsp_htotal, src_htotal, src_vtotal;
@@ -300,8 +300,9 @@ static void rk618_scaler_bridge_mode_set(struct drm_bridge *bridge,
dclk_rate = src->clock * 1000;
sclk_rate = (u64)dclk_rate * dst->vdisplay * dst->htotal;
do_div(sclk_rate, src->vdisplay * src->htotal);
sclk_rate = sclk_rate / 1000 * 1000;
dst->clock = sclk_rate / 1000;
sclk_rate = div_u64(sclk_rate, 1000);
sclk_rate = sclk_rate * 1000;
dst->clock = div_u64(sclk_rate, 1000);
scl->bridge->driver_private = dst;
DRM_DEV_INFO(scl->dev, "src=%s, dst=%s\n", src->name, dst->name);