All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stanimir Varbanov <stanimir.varbanov@linaro.org>
To: Loic Poulain <loic.poulain@linaro.org>, stanimir.varbanov@linaro.org
Cc: linux-arm-msm@vger.kernel.org, linux-media@vger.kernel.org,
	anibal.limon@linaro.org
Subject: Re: [PATCH v2] media: venus: Fix reported frame intervals
Date: Wed, 12 Aug 2020 13:54:06 +0300	[thread overview]
Message-ID: <503a3674-0697-8955-f0c2-109e5f700e41@linaro.org> (raw)
In-Reply-To: <1596543717-9106-1-git-send-email-loic.poulain@linaro.org>

Hi Loic,

Thanks for the patch!

On 8/4/20 3:21 PM, Loic Poulain wrote:
> On dragonboard-410c (apq8016) with HFI_VERSION_1XX, the reported
> framerate is in unit of 1/65535 fps (for fine grained control).
> So the current reported supported frame intervals is wrong (max
> is 1/65535 fps), leading to encoding issues or format negotiation
> failures with gstreamer.
> 
> Fix that by setting the framerate denominator to coherent value
> based on the the framerate factor.
> 
> The factor is not always the same, e.g. with db820c (apq8096) HFI
> reports framerate in fps unit. So only apply that for HFI_VERSION_1XX.
> 
> Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
> ---
>  v2: Use IS_V1 helper for retrieveing venus core version
>      Adjust denominator instead of numerator
> 
>  drivers/media/platform/qcom/venus/venc.c | 12 +++++++++---
>  1 file changed, 9 insertions(+), 3 deletions(-)

Acked-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>

> 
> diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c
> index 9981a2a..5b3df09 100644
> --- a/drivers/media/platform/qcom/venus/venc.c
> +++ b/drivers/media/platform/qcom/venus/venc.c
> @@ -576,6 +576,7 @@ static int venc_enum_frameintervals(struct file *file, void *fh,
>  {
>  	struct venus_inst *inst = to_inst(file);
>  	const struct venus_format *fmt;
> +	unsigned int framerate_factor = 1;
>  
>  	fival->type = V4L2_FRMIVAL_TYPE_STEPWISE;
>  
> @@ -600,12 +601,17 @@ static int venc_enum_frameintervals(struct file *file, void *fh,
>  	    fival->height < frame_height_min(inst))
>  		return -EINVAL;
>  
> +	if (IS_V1(inst->core)) {
> +		/* framerate is reported in 1/65535 fps unit */
> +		framerate_factor = (1 << 16);
> +	}
> +
>  	fival->stepwise.min.numerator = 1;
> -	fival->stepwise.min.denominator = frate_max(inst);
> +	fival->stepwise.min.denominator = frate_max(inst) / framerate_factor;
>  	fival->stepwise.max.numerator = 1;
> -	fival->stepwise.max.denominator = frate_min(inst);
> +	fival->stepwise.max.denominator = frate_min(inst) / framerate_factor;
>  	fival->stepwise.step.numerator = 1;
> -	fival->stepwise.step.denominator = frate_max(inst);
> +	fival->stepwise.step.denominator = frate_max(inst) / framerate_factor;
>  
>  	return 0;
>  }
> 

-- 
regards,
Stan

      reply	other threads:[~2020-08-12 10:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-04 12:21 [PATCH v2] media: venus: Fix reported frame intervals Loic Poulain
2020-08-12 10:54 ` Stanimir Varbanov [this message]

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=503a3674-0697-8955-f0c2-109e5f700e41@linaro.org \
    --to=stanimir.varbanov@linaro.org \
    --cc=anibal.limon@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=loic.poulain@linaro.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.