diff options
author | Mauro Carvalho Chehab <[email protected]> | 2019-10-07 10:35:05 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <[email protected]> | 2019-10-08 13:46:36 -0300 |
commit | 219031a6e7dff52a066e8b074adc0697f501e3d3 (patch) | |
tree | d521e93d7ab024244f8ad177c028c52ebb62ab79 | |
parent | d7ca5afdced3d167058328f9fa7332350a910b05 (diff) |
media: venus: fix build on 32bit environments
As reported by [email protected], the build with i386 fails
with:
ld: drivers/media/platform/qcom/venus/helpers.o: in function `venus_helper_load_scale_clocks':
(.text+0x1d77): undefined reference to `__udivdi3'
ld: (.text+0x1dce): undefined reference to `__udivdi3'
make: *** [Makefile:1094: vmlinux] Error 1
That's because it divides an u32 bit integer by a u64 one.
Reviewed-by: Stanimir Varbanov <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
-rw-r--r-- | drivers/media/platform/qcom/venus/helpers.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c index 5ea5d90f8e5f..a172f1ac0b35 100644 --- a/drivers/media/platform/qcom/venus/helpers.c +++ b/drivers/media/platform/qcom/venus/helpers.c @@ -520,10 +520,11 @@ static unsigned long calculate_inst_freq(struct venus_inst *inst, unsigned long filled_len) { unsigned long vpp_freq = 0, vsp_freq = 0; - u64 fps = inst->fps; + u32 fps = (u32)inst->fps; u32 mbs_per_sec; - mbs_per_sec = load_per_instance(inst) / inst->fps; + mbs_per_sec = load_per_instance(inst) / fps; + vpp_freq = mbs_per_sec * inst->clk_data.codec_freq_data->vpp_freq; /* 21 / 20 is overhead factor */ vpp_freq += vpp_freq / 20; |