From patchwork Tue Oct 8 10:47:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 11179365 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9267A17D4 for ; Tue, 8 Oct 2019 10:47:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6AD2D2173B for ; Tue, 8 Oct 2019 10:47:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570531641; bh=PQ0gimRvdYEM9Xt1WWgSj0mUdUkKmpbH4wzbTTPbGio=; h=From:To:Cc:Subject:Date:List-ID:From; b=skP4b/eyfSzLoo2sw4O5rQQLkWnHwS4KyDfibpWtx8SJm3dc7jRbcZ42X42mQm9Fr TcM8wET1QMsxZUA8Sp96RbyVTZeivERIMXOR49rt0V4xzjiMKgR8S/OaWUpGD8+S/3 SDLruSCUzbc9e4JbcIXDMy7LJ4/WBbpEo3wRxW/w= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730317AbfJHKrU (ORCPT ); Tue, 8 Oct 2019 06:47:20 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:44734 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730026AbfJHKrU (ORCPT ); Tue, 8 Oct 2019 06:47:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Sender:Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Rb6Rd4h4jcCyK5/exmA3E1tM/0mlAcZYCYGv9TxKgsQ=; b=TJDbGx983pekipOac7pyQbqUE zuFJCzmpmhhh+d+8X0AemJyXIDoiRVBlsmzMsrWH2FP9lmZ3atLifgiMIFqabWoDuzSHfVK80qG+B dLiuUA6RVIyuPdFWwZm0+KMEU5vk0fVOBr+NQAc5UeLkQObutk26qaqYFt9NtgHc2u4ujkc8unck5 43dA6ZWYZ4PMkwJqAxWDocjkX+Hg3fiZqFeUnqg++adorzBSRMGIUzi0m2Q0K0nlDlrR9g9hX4amE HdUgxAuWBxsGMAfzr8t6SplGXKD5MbE6RU6nQx3MOHqe/FOBLBFa8jOR0M2WhMGsD2mUayR7Ab1Ot P7EZ/GVIQ==; Received: from [179.95.33.153] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.92.2 #3 (Red Hat Linux)) id 1iHn1T-0006Qy-SW; Tue, 08 Oct 2019 10:47:19 +0000 Received: from mchehab by bombadil.infradead.org with local (Exim 4.92.3) (envelope-from ) id 1iHn1H-0003sZ-DP; Tue, 08 Oct 2019 07:47:07 -0300 From: Mauro Carvalho Chehab To: Linux Media Mailing List Cc: Mauro Carvalho Chehab , Mauro Carvalho Chehab , Stanimir Varbanov , Andy Gross , linux-arm-msm@vger.kernel.org Subject: [PATCH v2] media: venus: fix build on 32bit environments Date: Tue, 8 Oct 2019 07:47:06 -0300 Message-Id: X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org As reported by jenkins@linuxtv.org, 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. Fix it by explicitly callind do_div. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/helpers.c | 5 +++-- 1 file 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;