Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3781903imm; Mon, 2 Jul 2018 05:35:44 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeCuY/fYoqXiCtOOdvIOfvx3oqIeNKtnQ25ShAShRoVQ00cl/D3Z1wwmx+ihAfOKxd70dAG X-Received: by 2002:a17:902:b590:: with SMTP id a16-v6mr1292229pls.225.1530534944406; Mon, 02 Jul 2018 05:35:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530534944; cv=none; d=google.com; s=arc-20160816; b=0Blnf05R3kMco/8eKHbgmrOzQ3u2tiATCeVDv82Dl+o2R4BuRtsTPuBYmaZVl4fGi3 t6kAfcXXi/0hff+8YgXxUQo6H6HtQi0Jez+93gt0CZ8G2dIryUFDAFok35v4tLaKLeh3 VatITLyFOnSFQM6mWjqYWauHFcLOXl1NRNIL6/exRO+f6o1WhwDLr9o9nCSebhOo20TE 9sTOheJnRJNa1WFkQDPr9Q8aviN73647XPLFw/JdWciNrTWBeaHVlgpCPtuydcjCAZ4i CJSAHJwsXEYYqZeaT//kFAot/X3/5xoKreKW5MR20tPi7oAnn/sveoUxCmxfoDrqVP6w cWeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=9HvIGZ8S5aIWQEVtm+htARymx1kzieSPEaosxbiN/9M=; b=HWJR4JugUB+ZppKcqm+IfUzkEtQEbjAQ/W5bq2eVy8ymceytF20kQW15MaGPntFlWA /gfIB9wovRHeETvCDPDOQSQVWJ0Qx3lya34i6auhdZxqJMqJdUkqTk2Zuv3ymrAaOc8K jw+LryjCys837JD+G+dTO25JvAFzcprHetCymIT/WdahK5MDh6sdW9MG0Vo/38I35w+9 fdXeiFrGc3o0mpp8Xrcv/AlNf/aTw8xF5osqN703cTkF3P1Mnn8qFJSAzo64pw+fkZSb KKBXPKDHBEYKDfvfOjygdd3v3NMiw2gz82Wb4EN2qZbF26/nvLjvmY0nv8q5pUqHI4Xm H9mA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=NC8GZpoV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y7-v6si16249562pfy.140.2018.07.02.05.35.29; Mon, 02 Jul 2018 05:35:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=NC8GZpoV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965003AbeGBIqT (ORCPT + 99 others); Mon, 2 Jul 2018 04:46:19 -0400 Received: from mail-it0-f67.google.com ([209.85.214.67]:53009 "EHLO mail-it0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964970AbeGBIqL (ORCPT ); Mon, 2 Jul 2018 04:46:11 -0400 Received: by mail-it0-f67.google.com with SMTP id p4-v6so11058787itf.2 for ; Mon, 02 Jul 2018 01:46:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9HvIGZ8S5aIWQEVtm+htARymx1kzieSPEaosxbiN/9M=; b=NC8GZpoVJZbGT2W64eD+MIX95h9b8y4VxqitGX6gYTpgvpPzdNdA64NPOl1lUoiPeH /AqPONG02N6Ci7f7ApKypMvcF0V/hvbe/cbnPFRTevWkJCpCLRshK6mSEvAvpKvVY6rR V9FQ1jC/YJRPbkqToUXk3liOkLDjZpXQhZk68= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9HvIGZ8S5aIWQEVtm+htARymx1kzieSPEaosxbiN/9M=; b=Od9lFT7A+9g9AQ+MgfCp10qHq0sc4RX3dlUEKqoYC/ZCLFxycOK+8q4xzkCQVwzq31 n2J+vOnnVGV/JLkpsb0eh+3Mq78L0RQfsU3k3OnH1d3IJkqde1A6YqQbZw9FXSIYssUG YjUXvcG8l41+hPfpWggxLVYdCv/adPb/5PBiXz3X+vqt7EmDuppXmhM37MaRdNPyoPCc s4OoZDI7RwEzmAOENstfftO8gDwGMCXvu+Iq3hCZZYvFQR7MlRTSnj2RcXp8XDcOiBrD vDJ7HPCUq1k3AFxF2ArxY3Ea87E38tyA8Wozwcq6vundbpcXXutgKhSZynaC5e5d1V0v lxXQ== X-Gm-Message-State: APt69E0VkK7HkjgggWqYdOfyI+/btTtQUKCWLf/DpIZ8UgdbmOOTotuK G2P/Nkpv+kBqfn9AJXyhpubNVHmQ9X0= X-Received: by 2002:a24:5a53:: with SMTP id v80-v6mr5299475ita.34.1530521170366; Mon, 02 Jul 2018 01:46:10 -0700 (PDT) Received: from mail-it0-f45.google.com (mail-it0-f45.google.com. [209.85.214.45]) by smtp.gmail.com with ESMTPSA id h62-v6sm6877536ioa.22.2018.07.02.01.46.09 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Jul 2018 01:46:10 -0700 (PDT) Received: by mail-it0-f45.google.com with SMTP id 16-v6so11028640itl.5 for ; Mon, 02 Jul 2018 01:46:09 -0700 (PDT) X-Received: by 2002:a24:d41:: with SMTP id 62-v6mr3168116itx.14.1530521169289; Mon, 02 Jul 2018 01:46:09 -0700 (PDT) MIME-Version: 1.0 References: <20180627152725.9783-1-stanimir.varbanov@linaro.org> <20180627152725.9783-16-stanimir.varbanov@linaro.org> In-Reply-To: <20180627152725.9783-16-stanimir.varbanov@linaro.org> From: Alexandre Courbot Date: Mon, 2 Jul 2018 17:45:58 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v4 15/27] venus: helpers: add helper function to set actual buffer size To: Stanimir Varbanov Cc: Mauro Carvalho Chehab , Hans Verkuil , Linux Media Mailing List , LKML , linux-arm-msm@vger.kernel.org, vgarodia@codeaurora.org, Tomasz Figa Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 28, 2018 at 12:30 AM Stanimir Varbanov 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 > Reviewed-by: Tomasz Figa > --- > 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 >