Received: by 10.192.165.148 with SMTP id m20csp2917770imm; Mon, 7 May 2018 03:33:31 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp6vSNmH1ho5txeICpx49piUImQEMRqEcONKzbKb4kAKRHyaHIamDtZA7UFoCouVIgDwOIL X-Received: by 2002:a17:902:2bc5:: with SMTP id l63-v6mr36628605plb.299.1525689211942; Mon, 07 May 2018 03:33:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525689211; cv=none; d=google.com; s=arc-20160816; b=LnK5dWGv9CyikFHyGQhSOB3H17EycFTA9lxkDz/+SyK2xVJFyW1z8HnhEujYfDhhlf xTDmj6zOvsvzIjz9qxzWhHDnGXNSdU+irhRKPiN7JrDa23cdCjdEd91A7prLTovkSFYs +7T8+X3smtAXCvEH/1d2qNMLIFNrONke0Aa3HwBgP9HwhaxKxnslICpt5gmWhCuBPYyV kgCF66WF1RXBG+IcU9ySMCTW9AFlHo6cHulo3BikguSdvM+wK++GWJ+nB/OLx4+9gzCY g6wSLuyjOx0js9+lNsVOagenk6+Tibhvi1OlNdyi8kxRqfzM1/SQybYK0sdA9UWWrhn3 B+0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=KQfMCLuzCPByPvmGj3g6L013qWcysVAnJ5jrwyrdAjQ=; b=TZkHdkY084XrHxJAwZramgMNj9e+g4ZqNrmehohe/fYvL1OIDL9hpuBDsyr2418XfG lS8Loxj6uzbmjp57XXal8dWSZcKoZBcT2orJGUGuY4KyoxzTm/0ED5r2N/RfjpvAPz3l sUXs6c2qd+2uwVeDGX55+h9glytEs+QbRoifZ6OpoaLWNANeavAp4ylqLm4YxIm4+q8i PbZTXWz15DIa0PfcQ42hm87/gQUWwYtvps+tDqJXLkx/XH0ruGOTbUytGVu5bLJWYDqB ucQflBtQB+Fc4L8LOPAJ8NvKBw2MEn9+rKQTGTKwZg6JBxuaK5yi+1n0lbOHs4KOKrCq AXcg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x8-v6si13942133plr.333.2018.05.07.03.33.18; Mon, 07 May 2018 03:33:31 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752015AbeEGKco (ORCPT + 99 others); Mon, 7 May 2018 06:32:44 -0400 Received: from lb2-smtp-cloud9.xs4all.net ([194.109.24.26]:49625 "EHLO lb2-smtp-cloud9.xs4all.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750795AbeEGKcm (ORCPT ); Mon, 7 May 2018 06:32:42 -0400 Received: from [IPv6:2001:983:e9a7:1:2913:d371:8c33:6f] ([IPv6:2001:983:e9a7:1:2913:d371:8c33:6f]) by smtp-cloud9.xs4all.net with ESMTPA id FdRffcYYdHgC9FdRgfFnN1; Mon, 07 May 2018 12:32:40 +0200 Subject: Re: [PATCH 15/28] venus: add a helper function to set dynamic buffer mode To: Stanimir Varbanov , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Vikash Garodia References: <20180424124436.26955-1-stanimir.varbanov@linaro.org> <20180424124436.26955-16-stanimir.varbanov@linaro.org> From: Hans Verkuil Message-ID: <38a80abe-ba2c-c85b-f8a5-bb74245df172@xs4all.nl> Date: Mon, 7 May 2018 12:32:38 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180424124436.26955-16-stanimir.varbanov@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4wfKJhuAlVg/771fetAD78b7q+L7MXSHejgFPPLoQeraj63rJRyCRPwSVFwZoJW4Ip0wD9yoILbxEZxwG/lpx943LHCecBVz/DuqqdWid6nCx+HfkC/Zz4 nsNOzdSBc+SZl2KupOklWd0MO1F6OLMwDbJmFrnuD592vDdb4AIocOFUFDZFH29IkkCcIJpgIIjl816SXV6TiXv9QaZsnZe6vOQAyTEeZoGwZd+jqUhhQXUh KdRDEBMuGTPMDk+rFJcnQ0TfT4z/gVA2mnfR7ApPbfNDX3EtpTstLBMdYGH/opwU2DEt1+ARQwBCZNl5IKNXIGI8RUckv0CtgeHXwbPUQQp33V2vUY/XH6GP aBB7lymth9t6BO9ivSbzx1cYe1JPJ5rloU/zfbPTOUftLRUnsvGWf5wVl0GC6MAuxtjZNZyYs4NClrIGDf1+zTNtaP37KCzuLxVQ3RhxOvC7ucOAwKDjbSTB BkCTisL397O5PrjX Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 24/04/18 14:44, Stanimir Varbanov wrote: > Adds a new helper function to set dymaic buffer mode if it is dymaic -> dynamic Regards, Hans > supported by current HFI version. > > 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 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); > +} > +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 0ddc2c4df934..1de9cc64cf2f 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; >