Re: [PATCH v2 16/29] venus: add a helper function to set dynamic buffer mode

From: Tomasz Figa
Date: Thu May 31 2018 - 04:56:45 EST


On Tue, May 15, 2018 at 5:05 PM Stanimir Varbanov
<stanimir.varbanov@xxxxxxxxxx> wrote:
>
> Adds a new helper function to set dynamic buffer mode if it is
> supported by current HFI version.
>
> Signed-off-by: Stanimir Varbanov <stanimir.varbanov@xxxxxxxxxx>
> ---
> drivers/media/platform/qcom/venus/helpers.c | 22 ++++++++++++++++++++++
> drivers/media/platform/qcom/venus/helpers.h | 1 +
> drivers/media/platform/qcom/venus/vdec.c | 15 +++------------
> 3 files changed, 26 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c
> index 1eda19adbf28..824ad4d2d064 100644
> --- a/drivers/media/platform/qcom/venus/helpers.c
> +++ b/drivers/media/platform/qcom/venus/helpers.c
> @@ -522,6 +522,28 @@ int venus_helper_set_color_format(struct venus_inst *inst, u32 pixfmt)
> }
> EXPORT_SYMBOL_GPL(venus_helper_set_color_format);
>
> +int venus_helper_set_dyn_bufmode(struct venus_inst *inst)
> +{
> + u32 ptype = HFI_PROPERTY_PARAM_BUFFER_ALLOC_MODE;
> + struct hfi_buffer_alloc_mode mode;
> + int ret;
> +
> + if (!is_dynamic_bufmode(inst))
> + return 0;
> +
> + mode.type = HFI_BUFFER_OUTPUT;
> + mode.mode = HFI_BUFFER_MODE_DYNAMIC;
> +
> + ret = hfi_session_set_property(inst, ptype, &mode);
> + if (ret)
> + return ret;
> +
> + mode.type = HFI_BUFFER_OUTPUT2;
> +
> + return hfi_session_set_property(inst, ptype, &mode);

The function now sets HFI_BUFFER_OUTPUT2 in addition to
HFI_BUFFER_OUTPUT only, as set by orignal code. Is it intentional? I
guess we could have this mentioned in commit message.

Best regards,
Tomasz