linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stanimir Varbanov <stanimir.varbanov@linaro.org>
To: Bryan O'Donoghue <bryan.odonoghue@linaro.org>,
	stanimir.varbanov@linaro.org, agross@kernel.org,
	bjorn.andersson@linaro.org, mchehab@kernel.org,
	linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org
Cc: dikshita@codeaurora.org, jonathan@marek.ca, vgarodia@codeaurora.org
Subject: Re: [PATCH 22/25] media: venus: helpers, hfi, vdec: Set actual plane constraints to FW
Date: Thu, 25 Feb 2021 10:00:28 +0200	[thread overview]
Message-ID: <ce6b3821-7121-e894-ebaf-e718a551ac6d@linaro.org> (raw)
In-Reply-To: <20210222160300.1811121-23-bryan.odonoghue@linaro.org>



On 2/22/21 6:02 PM, Bryan O'Donoghue wrote:
> From: Dikshita Agarwal <dikshita@codeaurora.org>
> 
> Set actual plane alignments to FW with
> HFI_PROPERTY_PARAM_UNCOMPRESSED_PLANE_ACTUAL_CONSTRAINTS_INFO to calculate
> correct buffer size.
> 
> bod: Fixed fall-through error in pkt_session_set_property_6xx() switch
> 
> Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
> ---
>  drivers/media/platform/qcom/venus/helpers.c  | 21 ++++++++++++++++++++
>  drivers/media/platform/qcom/venus/helpers.h  |  1 +
>  drivers/media/platform/qcom/venus/hfi_cmds.c | 13 ++++++++++++
>  drivers/media/platform/qcom/venus/vdec.c     |  4 ++++
>  4 files changed, 39 insertions(+)
> 
> diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c
> index f0413236a56f..49c52ef1084a 100644
> --- a/drivers/media/platform/qcom/venus/helpers.c
> +++ b/drivers/media/platform/qcom/venus/helpers.c
> @@ -1113,6 +1113,27 @@ int venus_helper_set_work_mode(struct venus_inst *inst, u32 mode)
>  }
>  EXPORT_SYMBOL_GPL(venus_helper_set_work_mode);
>  
> +int venus_helper_set_format_constraints(struct venus_inst *inst)
> +{
> +	const u32 ptype = HFI_PROPERTY_PARAM_UNCOMPRESSED_PLANE_ACTUAL_CONSTRAINTS_INFO;
> +	struct hfi_uncompressed_plane_actual_constraints_info pconstraint;
> +
> +	pconstraint.buffer_type = HFI_BUFFER_OUTPUT2;
> +	pconstraint.num_planes = 2;
> +	pconstraint.plane_format[0].stride_multiples = 128;
> +	pconstraint.plane_format[0].max_stride = 8192;
> +	pconstraint.plane_format[0].min_plane_buffer_height_multiple = 32;
> +	pconstraint.plane_format[0].buffer_alignment = 256;
> +
> +	pconstraint.plane_format[1].stride_multiples = 128;
> +	pconstraint.plane_format[1].max_stride = 8192;
> +	pconstraint.plane_format[1].min_plane_buffer_height_multiple = 16;
> +	pconstraint.plane_format[1].buffer_alignment = 256;
> +
> +	return hfi_session_set_property(inst, ptype, &pconstraint);

I wonder shouldn't we set this property for v6 only? Or mark this
property as not supported for v1 up to v4.  Otherwise, I would expect
regressions on the older v1 - v4.

> +}
> +EXPORT_SYMBOL_GPL(venus_helper_set_format_constraints);
> +
>  int venus_helper_set_num_bufs(struct venus_inst *inst, unsigned int input_bufs,
>  			      unsigned int output_bufs,
>  			      unsigned int output2_bufs)
> diff --git a/drivers/media/platform/qcom/venus/helpers.h b/drivers/media/platform/qcom/venus/helpers.h
> index 351093845499..98106e6eee85 100644
> --- a/drivers/media/platform/qcom/venus/helpers.h
> +++ b/drivers/media/platform/qcom/venus/helpers.h
> @@ -33,6 +33,7 @@ int venus_helper_set_output_resolution(struct venus_inst *inst,
>  				       unsigned int width, unsigned int height,
>  				       u32 buftype);
>  int venus_helper_set_work_mode(struct venus_inst *inst, u32 mode);
> +int venus_helper_set_format_constraints(struct venus_inst *inst);
>  int venus_helper_set_num_bufs(struct venus_inst *inst, unsigned int input_bufs,
>  			      unsigned int output_bufs,
>  			      unsigned int output2_bufs);
> diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.c b/drivers/media/platform/qcom/venus/hfi_cmds.c
> index 4f7565834469..cc282b0df8c3 100644
> --- a/drivers/media/platform/qcom/venus/hfi_cmds.c
> +++ b/drivers/media/platform/qcom/venus/hfi_cmds.c
> @@ -1249,6 +1249,19 @@ pkt_session_set_property_6xx(struct hfi_session_set_property_pkt *pkt,
>  	pkt->data[0] = ptype;
>  
>  	switch (ptype) {
> +	case HFI_PROPERTY_PARAM_UNCOMPRESSED_PLANE_ACTUAL_CONSTRAINTS_INFO: {
> +		struct hfi_uncompressed_plane_actual_constraints_info *in = pdata;
> +		struct hfi_uncompressed_plane_actual_constraints_info *info = prop_data;
> +
> +		info->buffer_type = in->buffer_type;
> +		info->num_planes = in->num_planes;
> +		info->plane_format[0] = in->plane_format[0];
> +		if (in->num_planes > 1)
> +			info->plane_format[1] = in->plane_format[1];
> +
> +		pkt->shdr.hdr.size += sizeof(u32) + sizeof(*info);
> +		break;
> +	}
>  	case HFI_PROPERTY_CONFIG_HEIC_FRAME_QUALITY: {
>  		struct hfi_heic_frame_quality *in = pdata, *cq = prop_data;
>  
> diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c
> index 84c16f33e01b..88ac40ce12e6 100644
> --- a/drivers/media/platform/qcom/venus/vdec.c
> +++ b/drivers/media/platform/qcom/venus/vdec.c
> @@ -698,6 +698,10 @@ static int vdec_output_conf(struct venus_inst *inst)
>  	if (ret)
>  		return ret;
>  
> +	ret = venus_helper_set_format_constraints(inst);
> +	if (ret)
> +		return ret;
> +
>  	if (inst->dpb_fmt) {
>  		ret = venus_helper_set_multistream(inst, false, true);
>  		if (ret)
> 

-- 
regards,
Stan

  reply	other threads:[~2021-02-25  8:01 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-22 16:02 [PATCH 00/25] media: venus: Enable 6xx support Bryan O'Donoghue
2021-02-22 16:02 ` [PATCH 01/25] media: venus: Update v6 buffer descriptors Bryan O'Donoghue
2021-02-23 13:11   ` Stanimir Varbanov
2021-02-22 16:02 ` [PATCH 02/25] media: venus: core,pm: Add handling for resets Bryan O'Donoghue
2021-02-22 16:02 ` [PATCH 03/25] media: venus: core: add sm8250 DT compatible and resource data Bryan O'Donoghue
2021-02-23 13:48   ` Stanimir Varbanov
2021-02-22 16:02 ` [PATCH 04/25] media: venus: core,pm: Vote for min clk freq during venus boot Bryan O'Donoghue
2021-02-23 13:25   ` Stanimir Varbanov
2021-03-06 15:01     ` Stanimir Varbanov
2021-03-06 16:48       ` Bryan O'Donoghue
2021-03-07 10:44         ` Stanimir Varbanov
2021-03-10 17:33       ` Bryan O'Donoghue
2021-03-10 22:02         ` Stanimir Varbanov
2021-02-22 16:02 ` [PATCH 05/25] media: venus: core: Add io base variables for each block Bryan O'Donoghue
2021-02-23 13:28   ` Stanimir Varbanov
2021-02-22 16:02 ` [PATCH 06/25] media: venus: hfi,pm,firmware: Convert to block relative addressing Bryan O'Donoghue
2021-02-23 13:31   ` Stanimir Varbanov
2021-02-22 16:02 ` [PATCH 07/25] media: venus: hfi: Define block offsets for V6 hardware Bryan O'Donoghue
2021-02-23 13:32   ` Stanimir Varbanov
2021-02-22 16:02 ` [PATCH 08/25] media: venus: hfi: Define additional 6xx registers Bryan O'Donoghue
2021-02-22 16:02 ` [PATCH 09/25] media: venus: core: Add differentiator IS_V6(core) Bryan O'Donoghue
2021-02-22 16:02 ` [PATCH 10/25] media: venus: core: Add an io base for TZ wrapper regs Bryan O'Donoghue
2021-02-22 16:02 ` [PATCH 11/25] media: venus: core: Add an io base for AON regs Bryan O'Donoghue
2021-02-22 16:02 ` [PATCH 12/25] media: venus: core: Hook to V6 base registers when appropriate Bryan O'Donoghue
2021-02-22 16:02 ` [PATCH 13/25] media: venus: hfi: Add a 6xx boot logic Bryan O'Donoghue
2021-02-22 16:02 ` [PATCH 14/25] media: venus: hfi: Add 6xx interrupt support Bryan O'Donoghue
2021-02-22 16:02 ` [PATCH 15/25] media: venus: hfi: Read WRAPPER_TZ_CPU_STATUS_V6 on 6xx Bryan O'Donoghue
2021-02-22 16:02 ` [PATCH 16/25] media: venus: hfi, vdec: v6 Add IS_V6() to existing IS_V4() if locations Bryan O'Donoghue
2021-02-22 16:02 ` [PATCH 17/25] media: venus: pm: Hook 6xx pm ops into 4xx pm ops Bryan O'Donoghue
2021-02-22 16:02 ` [PATCH 18/25] media: venus: hfi: Add 6xx AXI halt logic Bryan O'Donoghue
2021-02-25  7:29   ` Stanimir Varbanov
2021-02-22 16:02 ` [PATCH 19/25] media: venus: pm: Toggle 6xx wrapper power in vcodec_control Bryan O'Donoghue
2021-02-22 16:02 ` [PATCH 20/25] media: venus: firmware: Do not toggle WRAPPER_A9SS_SW_RESET on 6xx Bryan O'Donoghue
2021-02-22 16:02 ` [PATCH 21/25] media: venus: helpers: Add internal buffer list for v6 Bryan O'Donoghue
2021-02-25  7:57   ` Stanimir Varbanov
2021-02-22 16:02 ` [PATCH 22/25] media: venus: helpers, hfi, vdec: Set actual plane constraints to FW Bryan O'Donoghue
2021-02-25  8:00   ` Stanimir Varbanov [this message]
2021-03-12  2:58     ` Bryan O'Donoghue
2021-02-22 16:02 ` [PATCH 23/25] media: venus: hfi: Increase plat_buf_v6 o/p buffer count Bryan O'Donoghue
2021-02-22 16:02 ` [PATCH 24/25] media: venus: helper: Decide work mode Bryan O'Donoghue
2021-02-22 16:03 ` [PATCH 25/25] media: venus: vdec: Fix decoder cmd STOP issue Bryan O'Donoghue
2021-02-26 10:25   ` Stanimir Varbanov

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=ce6b3821-7121-e894-ebaf-e718a551ac6d@linaro.org \
    --to=stanimir.varbanov@linaro.org \
    --cc=agross@kernel.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=bryan.odonoghue@linaro.org \
    --cc=dikshita@codeaurora.org \
    --cc=jonathan@marek.ca \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=vgarodia@codeaurora.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 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).