mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Konrad Dybcio <konrad.dybcio@linaro.org>
To: Dikshita Agarwal <quic_dikshita@quicinc.com>,
	linux-media@vger.kernel.org, stanimir.k.varbanov@gmail.com,
	quic_vgarodia@quicinc.com, agross@kernel.org,
	andersson@kernel.org, mchehab@kernel.org
Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH 3/4] venus: add handling of bit depth change from firmwar
Date: Thu, 4 May 2023 19:32:48 +0200	[thread overview]
Message-ID: <9dab4e48-6deb-76b1-4eb9-f0831bdcf7bb@linaro.org> (raw)
In-Reply-To: <1683196599-3730-4-git-send-email-quic_dikshita@quicinc.com>



On 4.05.2023 12:36, Dikshita Agarwal wrote:
> Set opb format to TP10_UWC and dpb to client set format
> when bit depth change to 10 bit is detecting by firmware.
> 
> Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
> ---
>  drivers/media/platform/qcom/venus/helpers.c | 18 ++++++++++++++++++
>  drivers/media/platform/qcom/venus/vdec.c    |  5 ++++-
>  2 files changed, 22 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c
> index 4ad6232..4f48ebd 100644
> --- a/drivers/media/platform/qcom/venus/helpers.c
> +++ b/drivers/media/platform/qcom/venus/helpers.c
> @@ -1770,6 +1770,24 @@ int venus_helper_get_out_fmts(struct venus_inst *inst, u32 v4l2_fmt,
>  	if (!caps)
>  		return -EINVAL;
>  
> +	if (inst->bit_depth == VIDC_BITDEPTH_10 &&
> +	    inst->session_type == VIDC_SESSION_TYPE_DEC) {
This could be unbroken

> +		found_ubwc = find_fmt_from_caps(caps, HFI_BUFFER_OUTPUT,
> +						HFI_COLOR_FORMAT_YUV420_TP10_UBWC);
> +		found = find_fmt_from_caps(caps, HFI_BUFFER_OUTPUT2,
> +					   fmt);
This could be unbroken

Otherwise I think this lgtm

Acked-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad
> +		if (found_ubwc && found) {
> +			/*
> +			 * Hard-code DPB buffers to be 10bit UBWC
> +			 * until V4L2 is able to expose compressed/tiled
> +			 * formats to applications.
> +			 */
> +			*out_fmt = HFI_COLOR_FORMAT_YUV420_TP10_UBWC;
> +			*out2_fmt = fmt;
> +			return 0;
> +		}
> +	}
> +
>  	if (ubwc) {
>  		ubwc_fmt = fmt | HFI_COLOR_FORMAT_UBWC_BASE;
>  		found_ubwc = find_fmt_from_caps(caps, HFI_BUFFER_OUTPUT,
> diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c
> index 687d62e..69f7f6e 100644
> --- a/drivers/media/platform/qcom/venus/vdec.c
> +++ b/drivers/media/platform/qcom/venus/vdec.c
> @@ -701,6 +701,9 @@ static int vdec_set_work_route(struct venus_inst *inst)
>  }
>  
>  #define is_ubwc_fmt(fmt) (!!((fmt) & HFI_COLOR_FORMAT_UBWC_BASE))
> +#define is_10bit_ubwc_fmt(fmt) (!!((fmt) & HFI_COLOR_FORMAT_10_BIT_BASE & \
> +				 HFI_COLOR_FORMAT_UBWC_BASE))
> +
>  
>  static int vdec_output_conf(struct venus_inst *inst)
>  {
> @@ -748,7 +751,7 @@ static int vdec_output_conf(struct venus_inst *inst)
>  		inst->opb_fmt = out2_fmt;
>  		inst->dpb_buftype = HFI_BUFFER_OUTPUT;
>  		inst->dpb_fmt = out_fmt;
> -	} else if (is_ubwc_fmt(out2_fmt)) {
> +	} else if (is_ubwc_fmt(out2_fmt) || is_10bit_ubwc_fmt(out_fmt)) {
>  		inst->opb_buftype = HFI_BUFFER_OUTPUT;
>  		inst->opb_fmt = out_fmt;
>  		inst->dpb_buftype = HFI_BUFFER_OUTPUT2;

  reply	other threads:[~2023-05-04 17:32 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-04 10:36 [PATCH 0/4] venus: add support for 10 bit decoding Dikshita Agarwal
2023-05-04 10:36 ` [PATCH 1/4] venus: add support for V4L2_PIX_FMT_P010 color format Dikshita Agarwal
2023-05-04 17:18   ` Konrad Dybcio
2023-05-04 10:36 ` [PATCH 2/4] venus: update calculation for dpb buffers Dikshita Agarwal
2023-05-04 17:29   ` Konrad Dybcio
2023-05-04 17:30     ` Konrad Dybcio
2023-05-04 10:36 ` [PATCH 3/4] venus: add handling of bit depth change from firmwar Dikshita Agarwal
2023-05-04 17:32   ` Konrad Dybcio [this message]
2023-05-04 10:36 ` [PATCH 4/4] venus: return P010 as preferred format for 10 bit decode Dikshita Agarwal
2023-05-04 17:20   ` Konrad Dybcio
2023-05-05  9:03     ` Dikshita Agarwal
2023-05-05 10:42       ` Konrad Dybcio
2023-05-05 11:03       ` Dmitry Baryshkov
2023-05-04 13:49 ` [PATCH 0/4] venus: add support for 10 bit decoding Bryan O'Donoghue
2023-05-04 13:51   ` Bryan O'Donoghue
2023-05-04 14:04     ` Vikash Garodia
2023-05-04 14:28       ` Bryan O'Donoghue

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=9dab4e48-6deb-76b1-4eb9-f0831bdcf7bb@linaro.org \
    --to=konrad.dybcio@linaro.org \
    --cc=agross@kernel.org \
    --cc=andersson@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=quic_dikshita@quicinc.com \
    --cc=quic_vgarodia@quicinc.com \
    --cc=stanimir.k.varbanov@gmail.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

all inboxes | Powered by JetHome®