Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3782786imm; Mon, 2 Jul 2018 05:36:41 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf3A/Tfx8zk6KtpNzb504oYdIeE1QBjUNnuj8XwzMmN5BiVrH+uVe5/sQAqD1BA558Sd6ZV X-Received: by 2002:a62:6659:: with SMTP id a86-v6mr8415085pfc.31.1530535001197; Mon, 02 Jul 2018 05:36:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530535001; cv=none; d=google.com; s=arc-20160816; b=Jid33zZeag0bXB+rjHMV6P2IcjPDbY+pRS0acqr644EsVIXQdbUbfYBsxgQ1HcxsSe QYJn7LD+3iNHLZpFIqS8MPWKyjp2oqS5PwQrHvdFJl0WFqtOrKeU87UrqMwsrbypsJ5n bor9bk6j9vubGsldzGtsTe/b/HVQ6pI6IjTWF2FLcX/JHyBkmOj90Zos0G2kEcsoMOcs MMDakXSyAComKyZuk/RZ+JbiuNXjJYPCYRSbntBH0Uc9jgC4Ax+ovzVulf8Tx6AJtkY0 kKEYUqvLinFEX8YLpxJuxzGq1/2hKDTZOjW47+Ui1Un5zIbmc+UIXsRadE7XOerN9MgS 9eUA== 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=IuLV5DB13L6aLqWiOwSpfBC/YgWJABmU9rsUs1091zo=; b=HLOx3TTG8b93PKo12JDPJd6DvIwzcOBQJrir33XrXWGrr7fODweUNRsIuz4u4LUzco e+62HJGj9puDhcYkmVyQKqKovhCATuKyan4LeyKDjWbqgAhhF6OEmtnLCMurKG6kgoVu lpTuunTXJinuG0JBxg5uKaBEk6I9AY2YJkqJ5aDLM+2jnLYSSGEP0Q4teC1bQDzA+Ewt LDT0R0lz0VK4gJqoQjxu6Xwl0vfeH7edSLhau9SExsvfVPUz4sud+i66i+u1H+fZ8Ynr x6eUlOFdZGi6Eo48ieOkeZWl4prdv8VUQqwUWWIRFjN/Dt5Z168XTZgkDQh83raxGdOi Mgiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="K/iAEDA6"; 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 u9-v6si2447273pfg.62.2018.07.02.05.36.27; Mon, 02 Jul 2018 05:36:41 -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="K/iAEDA6"; 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 S933688AbeGBIrZ (ORCPT + 99 others); Mon, 2 Jul 2018 04:47:25 -0400 Received: from mail-io0-f195.google.com ([209.85.223.195]:42548 "EHLO mail-io0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754327AbeGBIqG (ORCPT ); Mon, 2 Jul 2018 04:46:06 -0400 Received: by mail-io0-f195.google.com with SMTP id r24-v6so14034384ioh.9 for ; Mon, 02 Jul 2018 01:46:06 -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=IuLV5DB13L6aLqWiOwSpfBC/YgWJABmU9rsUs1091zo=; b=K/iAEDA6lhhGRNIbGCzArR+7j/svN5dbJOiXxuVTtio3RPHedwUIorulmJBqfVDK2W eUwFOIQKzy5uB3EPUN986f4sVb0AltMYBoyleAzNp5cPWTtZ8J4Qo00EZVfesDpOl8Dz vvg/8e2ecevuftst74znOJvx8grrTMdddfzeA= 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=IuLV5DB13L6aLqWiOwSpfBC/YgWJABmU9rsUs1091zo=; b=IsdfmX40pVz74k96z8pG8Kf+Opox5OU0Opz1mSwcikBKoInerC4y98NvaX73dozRG3 OGJDSsgFpzXzOgiW7Gv0uV+2Mxsw27p4653DawJaB/2VhackTF8gmNeFqLW8vuCn2HVg RTuVqJOFPk/41KfGbbmC5mRe5duszi6eLlhiwIWDEY+9vZWk1vLAUr52iGVhp3hYsCC2 /De2qZ9KvjdUKZAcw8RsgU9BJEKULGNlNgCszu4Y5ugXevkGiekmtoJnyH7EzVa1TrqZ 2Gt0sm1b9btB1eh6QbihmktRG6mCs+7HMzXekQ35PWWmr+/+AVGRZpw1NJ0Y87I0DX55 xViw== X-Gm-Message-State: APt69E0N1Q01DgVX4tsmO+SY5/2bwTZbJ/gDxf8WbjXiqjKg5BOQov7J ofxowmxYm6NsRNOvZ5O4OHJ0pofXuko= X-Received: by 2002:a6b:f00a:: with SMTP id w10-v6mr6364620ioc.65.1530521165746; Mon, 02 Jul 2018 01:46:05 -0700 (PDT) Received: from mail-it0-f48.google.com (mail-it0-f48.google.com. [209.85.214.48]) by smtp.gmail.com with ESMTPSA id o71-v6sm1767475ita.37.2018.07.02.01.46.04 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Jul 2018 01:46:04 -0700 (PDT) Received: by mail-it0-f48.google.com with SMTP id p17-v6so10988595itc.2 for ; Mon, 02 Jul 2018 01:46:04 -0700 (PDT) X-Received: by 2002:a02:9281:: with SMTP id b1-v6mr20393608jah.33.1530521164026; Mon, 02 Jul 2018 01:46:04 -0700 (PDT) MIME-Version: 1.0 References: <20180627152725.9783-1-stanimir.varbanov@linaro.org> <20180627152725.9783-15-stanimir.varbanov@linaro.org> In-Reply-To: <20180627152725.9783-15-stanimir.varbanov@linaro.org> From: Alexandre Courbot Date: Mon, 2 Jul 2018 17:45:52 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v4 14/27] venus: helpers: add a helper function to set dynamic buffer mode 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:31 AM Stanimir Varbanov wrote: > > Adds a new helper function to set dynamic buffer mode if it is > supported by current HFI version. The dynamic buffer mode is > set unconditionally for both decoder outputs. > > Signed-off-by: Stanimir Varbanov > --- > 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 03121dbb4175..e3dc2772946f 100644 > --- a/drivers/media/platform/qcom/venus/helpers.c > +++ b/drivers/media/platform/qcom/venus/helpers.c > @@ -519,6 +519,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; This could be const u32. > + 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); > +} > +EXPORT_SYMBOL_GPL(venus_helper_set_dyn_bufmode); > + > 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 0e64aa95624a..52b961ed491e 100644 > --- a/drivers/media/platform/qcom/venus/helpers.h > +++ b/drivers/media/platform/qcom/venus/helpers.h > @@ -40,6 +40,7 @@ int venus_helper_set_output_resolution(struct venus_inst *inst, > 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); > 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 31a240ab142b..92669a358a90 100644 > --- a/drivers/media/platform/qcom/venus/vdec.c > +++ b/drivers/media/platform/qcom/venus/vdec.c > @@ -557,18 +557,9 @@ static int vdec_set_properties(struct venus_inst *inst) > return ret; > } > > - if (core->res->hfi_version == HFI_VERSION_3XX || > - inst->cap_bufs_mode_dynamic) { > - struct hfi_buffer_alloc_mode mode; > - > - ptype = HFI_PROPERTY_PARAM_BUFFER_ALLOC_MODE; > - mode.type = HFI_BUFFER_OUTPUT; > - mode.mode = HFI_BUFFER_MODE_DYNAMIC; > - > - ret = hfi_session_set_property(inst, ptype, &mode); > - if (ret) > - return ret; > - } > + ret = venus_helper_set_dyn_bufmode(inst); > + if (ret) > + return ret; > > if (ctr->post_loop_deb_mode) { > ptype = HFI_PROPERTY_CONFIG_VDEC_POST_LOOP_DEBLOCKER; > -- > 2.14.1 >