Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1740745imu; Thu, 24 Jan 2019 00:45:16 -0800 (PST) X-Google-Smtp-Source: ALg8bN7LCfO35HE84yb9ZQS3bWOqC3D/XEG13h2W0ATXAeql57XL/4L2wnhTWzBLTEIyMJpPMU7u X-Received: by 2002:a63:7219:: with SMTP id n25mr5165020pgc.324.1548319516941; Thu, 24 Jan 2019 00:45:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548319516; cv=none; d=google.com; s=arc-20160816; b=NFwJQGkFTgFcL/0ftWTJEibS93U9jfwmH3vKhpOj1I+i/BVLDy9YcFBtvYHCH3CHaU /btZhA0WsiNvM/BZ/JMTOETSX5IuxnzOoO+3Huo0+bw+cNXZR7c3Ad7iLCwp2x/SdgQO 9dWwspxqtlD9agr+IP8ekhDC4h4iqWPn8ti3w+LWPWij2YREa6Ti3LY5SECIxaJOJS8V jdqZlqXLH44QAA4jZTJS1D3NguvGJC0aMX3K1EzpsTFf/bE4uDzoISO+AQlSUjhW1HI3 JTlDPdTjcm+xT3d70t+6Yx1CPjOLSS4wIUD6FhxUJEHbGRUBKomoQQoEzFL2mqTgBccR e+Yw== 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; bh=hVDl9dIUoiCG6PuhpYJsDmUi5clSLHBybMHGEZVmHMg=; b=qEhECFAEQsP7Ua4TX6d/HlqSSOK+zMdbx+Hz172JW2UEhf8BncxwFLJDzrAVPPFCSG LlhUo9//yzie0jizfOIagu6ob8ODz/RbG/dBegfrr4DrCTd88xr4aEBQMvnmamcHLS1b D3lPAABIHIUkvqiLLVrib7G3ThOCqRn9gsJT7dXWsdveQTLL4rBD5XQWxIqaJ/19wZRF HEKo89dkTBV4TgYZp7Wae+ypckTcTSaLH63+EH+/cOzWEExo7V0jqi06Bsz7+s9vAwTh UY9+XSpYkiZXSgoJFISXDuWJYMTP9+WJLHekIh/bxeovoGYLc2UDxUm8fGeexqmmjJ8v r8EQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=LxXc2tJ+; 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 73si2491011pfm.50.2019.01.24.00.45.02; Thu, 24 Jan 2019 00:45:16 -0800 (PST) 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=LxXc2tJ+; 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 S1727557AbfAXIne (ORCPT + 99 others); Thu, 24 Jan 2019 03:43:34 -0500 Received: from mail-oi1-f193.google.com ([209.85.167.193]:43915 "EHLO mail-oi1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727170AbfAXInd (ORCPT ); Thu, 24 Jan 2019 03:43:33 -0500 Received: by mail-oi1-f193.google.com with SMTP id u18so4183105oie.10 for ; Thu, 24 Jan 2019 00:43:32 -0800 (PST) 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=hVDl9dIUoiCG6PuhpYJsDmUi5clSLHBybMHGEZVmHMg=; b=LxXc2tJ+71bGWx9FuaNFu9pEswntN6fcNpmCDaP7n2vbjHQ3PVe+kVVjjDv+C5FKLK 8QNoOqQ5sM+MjS4Z95G2QxanUaZqHTwyk9AyoHCoRn2Z8zq5Vt8NUBeUs0XmgIUIyPnS xxqWNL6kgpwjTJ925LM3rf7zmpdnO+Ok5pb2M= 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=hVDl9dIUoiCG6PuhpYJsDmUi5clSLHBybMHGEZVmHMg=; b=LrpjN9xL7Dk3uy38rZaPTuT8bEZpnAS6q0fMmB9M2Bxele6C/zHxmgps5GHnuhmvso AtKVL2/22UOdahPRGEAFKEGmUPPeF1TonkUZ6H8Xk4ehKLnFTNNdkkT2xdsfgUj4wled DhTQKLhSnGy21m8auuA0hRD3JFTfXgraKpzbbx+tDuGS0G6jQkw/mPa78dzOk/6V/TF6 lzberl6VTSuISDFgBVRFz4ea5vqfzis7l8zazoARKqgiSdCsPCAM7kMGTr3B53adBChB hPeOmb/tqzu94geCnk99pxMqHMVpUr6oP8KTcL5HA8K99QYlucN4+rTlp49+Zb9V7cL2 AlSA== X-Gm-Message-State: AJcUukfjS3UZdXsUEc6msArgG6ldQPDQxoLS3/aJW4UZNkvdybwcE/bn JDrggzGutDixAaX0RO+GuwxQedQY+mo= X-Received: by 2002:aca:3856:: with SMTP id f83mr558546oia.147.1548319412096; Thu, 24 Jan 2019 00:43:32 -0800 (PST) Received: from mail-oi1-f171.google.com (mail-oi1-f171.google.com. [209.85.167.171]) by smtp.gmail.com with ESMTPSA id a1sm8552086oto.71.2019.01.24.00.43.31 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Jan 2019 00:43:31 -0800 (PST) Received: by mail-oi1-f171.google.com with SMTP id y1so4176880oie.12 for ; Thu, 24 Jan 2019 00:43:31 -0800 (PST) X-Received: by 2002:aca:f103:: with SMTP id p3mr535530oih.94.1548319410841; Thu, 24 Jan 2019 00:43:30 -0800 (PST) MIME-Version: 1.0 References: <20190117162008.25217-1-stanimir.varbanov@linaro.org> <20190117162008.25217-4-stanimir.varbanov@linaro.org> In-Reply-To: <20190117162008.25217-4-stanimir.varbanov@linaro.org> From: Alexandre Courbot Date: Thu, 24 Jan 2019 17:43:19 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 03/10] venus: helpers: export few helper functions To: Stanimir Varbanov Cc: Linux Media Mailing List , Mauro Carvalho Chehab , Hans Verkuil , LKML , linux-arm-msm@vger.kernel.org, Vikash Garodia , Tomasz Figa , Malathi Gottam 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 Fri, Jan 18, 2019 at 1:21 AM Stanimir Varbanov wrote: > > Here we export few helper function to use them from decoder to > implement more granular control needed for stateful Codec API > compliance. > > Signed-off-by: Stanimir Varbanov > --- > drivers/media/platform/qcom/venus/helpers.c | 29 ++++++++++++--------- > drivers/media/platform/qcom/venus/helpers.h | 7 +++++ > 2 files changed, 24 insertions(+), 12 deletions(-) > > diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c > index 86105de81af2..f33bbfea3576 100644 > --- a/drivers/media/platform/qcom/venus/helpers.c > +++ b/drivers/media/platform/qcom/venus/helpers.c > @@ -88,7 +88,7 @@ bool venus_helper_check_codec(struct venus_inst *inst, u32 v4l2_pixfmt) > } > EXPORT_SYMBOL_GPL(venus_helper_check_codec); > > -static int venus_helper_queue_dpb_bufs(struct venus_inst *inst) > +int venus_helper_queue_dpb_bufs(struct venus_inst *inst) > { > struct intbuf *buf; > int ret = 0; > @@ -109,6 +109,7 @@ static int venus_helper_queue_dpb_bufs(struct venus_inst *inst) > fail: > return ret; > } > +EXPORT_SYMBOL_GPL(venus_helper_queue_dpb_bufs); > > int venus_helper_free_dpb_bufs(struct venus_inst *inst) > { > @@ -287,7 +288,7 @@ static const unsigned int intbuf_types_4xx[] = { > HFI_BUFFER_INTERNAL_PERSIST_1, > }; > > -static int intbufs_alloc(struct venus_inst *inst) > +int venus_helper_intbufs_alloc(struct venus_inst *inst) > { > const unsigned int *intbuf; > size_t arr_sz, i; > @@ -313,11 +314,13 @@ static int intbufs_alloc(struct venus_inst *inst) > intbufs_unset_buffers(inst); > return ret; > } > +EXPORT_SYMBOL_GPL(venus_helper_intbufs_alloc); > > -static int intbufs_free(struct venus_inst *inst) > +int venus_helper_intbufs_free(struct venus_inst *inst) > { > return intbufs_unset_buffers(inst); > } > +EXPORT_SYMBOL_GPL(venus_helper_intbufs_free); > > static u32 load_per_instance(struct venus_inst *inst) > { > @@ -348,7 +351,7 @@ static u32 load_per_type(struct venus_core *core, u32 session_type) > return mbs_per_sec; > } > > -static int load_scale_clocks(struct venus_core *core) > +int venus_helper_load_scale_clocks(struct venus_core *core) > { > const struct freq_tbl *table = core->res->freq_tbl; > unsigned int num_rows = core->res->freq_tbl_size; > @@ -397,6 +400,7 @@ static int load_scale_clocks(struct venus_core *core) > dev_err(dev, "failed to set clock rate %lu (%d)\n", freq, ret); > return ret; > } > +EXPORT_SYMBOL_GPL(venus_helper_load_scale_clocks); > > static void fill_buffer_desc(const struct venus_buffer *buf, > struct hfi_buffer_desc *bd, bool response) > @@ -481,7 +485,7 @@ static bool is_dynamic_bufmode(struct venus_inst *inst) > return caps->cap_bufs_mode_dynamic; > } > > -static int session_unregister_bufs(struct venus_inst *inst) > +int venus_helper_unregister_bufs(struct venus_inst *inst) > { > struct venus_buffer *buf, *n; > struct hfi_buffer_desc bd; > @@ -498,6 +502,7 @@ static int session_unregister_bufs(struct venus_inst *inst) > > return ret; > } > +EXPORT_SYMBOL_GPL(venus_helper_unregister_bufs); > > static int session_register_bufs(struct venus_inst *inst) > { > @@ -1018,8 +1023,8 @@ void venus_helper_vb2_stop_streaming(struct vb2_queue *q) > if (inst->streamon_out & inst->streamon_cap) { > ret = hfi_session_stop(inst); > ret |= hfi_session_unload_res(inst); > - ret |= session_unregister_bufs(inst); > - ret |= intbufs_free(inst); > + ret |= venus_helper_unregister_bufs(inst); > + ret |= venus_helper_intbufs_free(inst); > ret |= hfi_session_deinit(inst); > > if (inst->session_error || core->sys_error) > @@ -1030,7 +1035,7 @@ void venus_helper_vb2_stop_streaming(struct vb2_queue *q) > > venus_helper_free_dpb_bufs(inst); > > - load_scale_clocks(core); > + venus_helper_load_scale_clocks(core); > INIT_LIST_HEAD(&inst->registeredbufs); > } > > @@ -1050,7 +1055,7 @@ int venus_helper_vb2_start_streaming(struct venus_inst *inst) > struct venus_core *core = inst->core; > int ret; > > - ret = intbufs_alloc(inst); > + ret = venus_helper_intbufs_alloc(inst); > if (ret) > return ret; > > @@ -1058,7 +1063,7 @@ int venus_helper_vb2_start_streaming(struct venus_inst *inst) > if (ret) > goto err_bufs_free; > > - load_scale_clocks(core); > + venus_helper_load_scale_clocks(core); > > ret = hfi_session_load_res(inst); > if (ret) > @@ -1079,9 +1084,9 @@ int venus_helper_vb2_start_streaming(struct venus_inst *inst) > err_unload_res: > hfi_session_unload_res(inst); > err_unreg_bufs: > - session_unregister_bufs(inst); > + venus_helper_unregister_bufs(inst); > err_bufs_free: > - intbufs_free(inst); > + venus_helper_intbufs_free(inst); > return ret; > } > EXPORT_SYMBOL_GPL(venus_helper_vb2_start_streaming); > diff --git a/drivers/media/platform/qcom/venus/helpers.h b/drivers/media/platform/qcom/venus/helpers.h > index 2475f284f396..24faae5abd93 100644 > --- a/drivers/media/platform/qcom/venus/helpers.h > +++ b/drivers/media/platform/qcom/venus/helpers.h > @@ -18,6 +18,7 @@ > #include > > struct venus_inst; > +struct venus_core; > > bool venus_helper_check_codec(struct venus_inst *inst, u32 v4l2_pixfmt); > struct vb2_v4l2_buffer *venus_helper_find_buf(struct venus_inst *inst, > @@ -62,4 +63,10 @@ int venus_helper_alloc_dpb_bufs(struct venus_inst *inst); > int venus_helper_free_dpb_bufs(struct venus_inst *inst); > int venus_helper_power_enable(struct venus_core *core, u32 session_type, > bool enable); > +int venus_helper_intbufs_alloc(struct venus_inst *inst); > +int venus_helper_intbufs_free(struct venus_inst *inst); > +int venus_helper_intbufs_realloc(struct venus_inst *inst); I think this function is only declared in patch 7? > +int venus_helper_queue_dpb_bufs(struct venus_inst *inst); > +int venus_helper_unregister_bufs(struct venus_inst *inst); > +int venus_helper_load_scale_clocks(struct venus_core *core); > #endif > -- > 2.17.1 >