linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stanimir Varbanov <stanimir.varbanov@linaro.org>
To: Vikash Garodia <quic_vgarodia@quicinc.com>, linux-media@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	vboma@qti.qualcomm.com
Subject: Re: [PATCH] media: venus: hfi_platform: Correct supported codecs for sc7280
Date: Thu, 19 May 2022 18:00:58 +0300	[thread overview]
Message-ID: <270cf1d2-fd41-d206-06b6-78442641ba66@linaro.org> (raw)
In-Reply-To: <1652952678-14747-1-git-send-email-quic_vgarodia@quicinc.com>



On 5/19/22 12:31, Vikash Garodia wrote:
> VP8 codec is deprecated for sc7280 SOC. Fix in platform layer to
> update the supported codecs accordingly.
> 
> Signed-off-by: Vikash Garodia <quic_vgarodia@quicinc.com>
> ---
>  drivers/media/platform/qcom/venus/hfi_parser.c   |  6 ++++--
>  drivers/media/platform/qcom/venus/hfi_platform.c | 21 +++++++++++++++++++++
>  drivers/media/platform/qcom/venus/hfi_platform.h |  2 ++
>  3 files changed, 27 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/platform/qcom/venus/hfi_parser.c b/drivers/media/platform/qcom/venus/hfi_parser.c
> index 5b8389b..6cf74b2 100644
> --- a/drivers/media/platform/qcom/venus/hfi_parser.c
> +++ b/drivers/media/platform/qcom/venus/hfi_parser.c
> @@ -234,6 +234,7 @@ static int hfi_platform_parser(struct venus_core *core, struct venus_inst *inst)
>  	const struct hfi_plat_caps *caps = NULL;
>  	u32 enc_codecs, dec_codecs, count = 0;
>  	unsigned int entries;
> +	int ret;
>  
>  	plat = hfi_platform_get(core->res->hfi_version);
>  	if (!plat)
> @@ -242,8 +243,9 @@ static int hfi_platform_parser(struct venus_core *core, struct venus_inst *inst)
>  	if (inst)
>  		return 0;
>  
> -	if (plat->codecs)
> -		plat->codecs(&enc_codecs, &dec_codecs, &count);
> +	ret = hfi_platform_get_codecs(core, &enc_codecs, &dec_codecs, &count);
> +	if (ret)
> +		return ret;
>  
>  	if (plat->capabilities)
>  		caps = plat->capabilities(&entries);
> diff --git a/drivers/media/platform/qcom/venus/hfi_platform.c b/drivers/media/platform/qcom/venus/hfi_platform.c
> index f16f896..bc9b431 100644
> --- a/drivers/media/platform/qcom/venus/hfi_platform.c
> +++ b/drivers/media/platform/qcom/venus/hfi_platform.c
> @@ -2,7 +2,9 @@
>  /*
>   * Copyright (c) 2020, The Linux Foundation. All rights reserved.
>   */
> +#include <linux/of_device.h>
>  #include "hfi_platform.h"
> +#include "core.h"
>  
>  const struct hfi_platform *hfi_platform_get(enum hfi_version version)
>  {
> @@ -66,3 +68,22 @@ hfi_platform_get_codec_lp_freq(enum hfi_version version, u32 codec, u32 session_
>  	return freq;
>  }
>  
> +int
> +hfi_platform_get_codecs(struct venus_core *core, u32 *enc_codecs, u32 *dec_codecs, u32 *count)
> +{
> +	const struct hfi_platform *plat;
> +
> +	plat = hfi_platform_get(core->res->hfi_version);
> +	if (!plat)
> +		return -EINVAL;
> +
> +	plat->codecs(enc_codecs, dec_codecs, count);

I guess some of the static code analyzers could complain, so please
check plat->codecs for NULL:

	if (!plat->codecs)
		return -EINVAL;

Otherwise look good to me:

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

> +
> +	if (of_device_is_compatible(core->dev->of_node, "qcom,sc7280-venus")) {
> +		*enc_codecs &= ~HFI_VIDEO_CODEC_VP8;
> +		*dec_codecs &= ~HFI_VIDEO_CODEC_VP8;
> +	}
> +
> +	return 0;
> +}
> +
> diff --git a/drivers/media/platform/qcom/venus/hfi_platform.h b/drivers/media/platform/qcom/venus/hfi_platform.h
> index 1dcf408..ec89a90 100644
> --- a/drivers/media/platform/qcom/venus/hfi_platform.h
> +++ b/drivers/media/platform/qcom/venus/hfi_platform.h
> @@ -66,4 +66,6 @@ unsigned long hfi_platform_get_codec_vsp_freq(enum hfi_version version, u32 code
>  					      u32 session_type);
>  unsigned long hfi_platform_get_codec_lp_freq(enum hfi_version version, u32 codec,
>  					     u32 session_type);
> +int hfi_platform_get_codecs(struct venus_core *core, u32 *enc_codecs, u32 *dec_codecs,
> +			    u32 *count);
>  #endif

-- 
regards,
Stan

      reply	other threads:[~2022-05-19 15:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-19  9:31 [PATCH] media: venus: hfi_platform: Correct supported codecs for sc7280 Vikash Garodia
2022-05-19 15:00 ` 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=270cf1d2-fd41-d206-06b6-78442641ba66@linaro.org \
    --to=stanimir.varbanov@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=quic_vgarodia@quicinc.com \
    --cc=vboma@qti.qualcomm.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).