lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPBb6MVitXuqka=OjjMCcJ0QQQFtehdz=B-TKHDBORabuVGitw@mail.gmail.com>
Date:   Mon, 2 Jul 2018 17:45:58 +0900
From:   Alexandre Courbot <acourbot@...omium.org>
To:     Stanimir Varbanov <stanimir.varbanov@...aro.org>
Cc:     Mauro Carvalho Chehab <mchehab@...nel.org>,
        Hans Verkuil <hverkuil@...all.nl>,
        Linux Media Mailing List <linux-media@...r.kernel.org>,
        LKML <linux-kernel@...r.kernel.org>,
        linux-arm-msm@...r.kernel.org, vgarodia@...eaurora.org,
        Tomasz Figa <tfiga@...omium.org>
Subject: Re: [PATCH v4 15/27] venus: helpers: add helper function to set
 actual buffer size

On Thu, Jun 28, 2018 at 12:30 AM Stanimir Varbanov
<stanimir.varbanov@...aro.org> wrote:
>
> Add and use a helper function to set actual buffer size for
> particular buffer type. This is also preparation to use
> the second decoder output.
>
> Signed-off-by: Stanimir Varbanov <stanimir.varbanov@...aro.org>
> Reviewed-by: Tomasz Figa <tfiga@...omium.org>
> ---
>  drivers/media/platform/qcom/venus/helpers.c | 12 ++++++++++++
>  drivers/media/platform/qcom/venus/helpers.h |  1 +
>  drivers/media/platform/qcom/venus/vdec.c    | 10 ++--------
>  3 files changed, 15 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c
> index e3dc2772946f..0cce664f093d 100644
> --- a/drivers/media/platform/qcom/venus/helpers.c
> +++ b/drivers/media/platform/qcom/venus/helpers.c
> @@ -541,6 +541,18 @@ int venus_helper_set_dyn_bufmode(struct venus_inst *inst)
>  }
>  EXPORT_SYMBOL_GPL(venus_helper_set_dyn_bufmode);
>
> +int venus_helper_set_bufsize(struct venus_inst *inst, u32 bufsize, u32 buftype)
> +{
> +       u32 ptype = HFI_PROPERTY_PARAM_BUFFER_SIZE_ACTUAL;

const u32? Also valid for similar declarations in later patches.

> +       struct hfi_buffer_size_actual bufsz;
> +
> +       bufsz.type = buftype;
> +       bufsz.size = bufsize;
> +
> +       return hfi_session_set_property(inst, ptype, &bufsz);
> +}
> +EXPORT_SYMBOL_GPL(venus_helper_set_bufsize);
> +
>  static void delayed_process_buf_func(struct work_struct *work)
>  {
>         struct venus_buffer *buf, *n;
> diff --git a/drivers/media/platform/qcom/venus/helpers.h b/drivers/media/platform/qcom/venus/helpers.h
> index 52b961ed491e..cd306bd8978f 100644
> --- a/drivers/media/platform/qcom/venus/helpers.h
> +++ b/drivers/media/platform/qcom/venus/helpers.h
> @@ -41,6 +41,7 @@ int venus_helper_set_num_bufs(struct venus_inst *inst, unsigned int input_bufs,
>                               unsigned int output_bufs);
>  int venus_helper_set_color_format(struct venus_inst *inst, u32 fmt);
>  int venus_helper_set_dyn_bufmode(struct venus_inst *inst);
> +int venus_helper_set_bufsize(struct venus_inst *inst, u32 bufsize, u32 buftype);
>  void venus_helper_acquire_buf_ref(struct vb2_v4l2_buffer *vbuf);
>  void venus_helper_release_buf_ref(struct venus_inst *inst, unsigned int idx);
>  void venus_helper_init_instance(struct venus_inst *inst);
> diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c
> index 92669a358a90..eae9c651ac91 100644
> --- a/drivers/media/platform/qcom/venus/vdec.c
> +++ b/drivers/media/platform/qcom/venus/vdec.c
> @@ -710,7 +710,6 @@ static int vdec_start_streaming(struct vb2_queue *q, unsigned int count)
>  {
>         struct venus_inst *inst = vb2_get_drv_priv(q);
>         struct venus_core *core = inst->core;
> -       u32 ptype;
>         int ret;
>
>         mutex_lock(&inst->lock);
> @@ -740,13 +739,8 @@ static int vdec_start_streaming(struct vb2_queue *q, unsigned int count)
>                 goto deinit_sess;
>
>         if (core->res->hfi_version == HFI_VERSION_3XX) {
> -               struct hfi_buffer_size_actual buf_sz;
> -
> -               ptype = HFI_PROPERTY_PARAM_BUFFER_SIZE_ACTUAL;
> -               buf_sz.type = HFI_BUFFER_OUTPUT;
> -               buf_sz.size = inst->output_buf_size;
> -
> -               ret = hfi_session_set_property(inst, ptype, &buf_sz);
> +               ret = venus_helper_set_bufsize(inst, inst->output_buf_size,
> +                                              HFI_BUFFER_OUTPUT);
>                 if (ret)
>                         goto deinit_sess;
>         }
> --
> 2.14.1
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ