All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stanimir Varbanov <stanimir.varbanov@linaro.org>
To: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>,
	Linux Media Mailing List <linux-media@vger.kernel.org>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>,
	Andy Gross <agross@kernel.org>,
	linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH] media: venus: fix build on 32bit environments
Date: Mon, 7 Oct 2019 17:38:53 +0300	[thread overview]
Message-ID: <2f22ff7f-0e47-b03f-75bf-a9822afb0507@linaro.org> (raw)
In-Reply-To: <f8b266dea8594c046bd545ca1f497bfc1658835d.1570455418.git.mchehab+samsung@kernel.org>

Hi Mauro,

Thanks for the fix!

On 10/7/19 4:37 PM, Mauro Carvalho Chehab wrote:
> 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.

General question, shouldn't such errors been catch from builder on the
pull request?

> 
> Fix it by explicitly callind do_div.
> 
> That's said, why fps is a 64 bits integer?

I don't have other explanation than - just to avoid casting after the
math in vdec/venc_s_parm() functions.

> 
> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
> ---
>  drivers/media/platform/qcom/venus/helpers.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c
> index 5ea5d90f8e5f..09fa87e3c0a0 100644
> --- a/drivers/media/platform/qcom/venus/helpers.c
> +++ b/drivers/media/platform/qcom/venus/helpers.c
> @@ -522,8 +522,14 @@ static unsigned long calculate_inst_freq(struct venus_inst *inst,
>  	unsigned long vpp_freq = 0, vsp_freq = 0;
>  	u64 fps = inst->fps;
>  	u32 mbs_per_sec;
> +	u64 tmp;
> +

you have extra blank line here.

> +
> +	tmp = load_per_instance(inst);
> +	do_div(tmp, inst->fps);
> +
> +	mbs_per_sec = (u32)tmp;
>  
> -	mbs_per_sec = load_per_instance(inst) / 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;
> 

I guess this fix should be squashed with the commit which introduce it :(

Note taken, always build patches on i386 :/

-- 
regards,
Stan

  reply	other threads:[~2019-10-07 14:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-07 13:37 [PATCH] media: venus: fix build on 32bit environments Mauro Carvalho Chehab
2019-10-07 14:38 ` Stanimir Varbanov [this message]
2019-10-07 14:55   ` Mauro Carvalho Chehab
2019-10-07 17:28     ` Mauro Carvalho Chehab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2f22ff7f-0e47-b03f-75bf-a9822afb0507@linaro.org \
    --to=stanimir.varbanov@linaro.org \
    --cc=agross@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab+samsung@kernel.org \
    --cc=mchehab@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.