Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1744795imu; Thu, 24 Jan 2019 00:50:29 -0800 (PST) X-Google-Smtp-Source: ALg8bN7unmi0RgfPY+btGBgTfC21QkUk1OV577flyc8rSJxwihemAPa/J2RKoNBrPMrESAKldOiB X-Received: by 2002:a62:7504:: with SMTP id q4mr5506688pfc.180.1548319829042; Thu, 24 Jan 2019 00:50:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548319829; cv=none; d=google.com; s=arc-20160816; b=ZNYrsaDgKozqHnXkXpkWBqd2JeA/hvEx0ZoJYsIam+y4Hp0sSXBoWv2PW1tkMuIGnp f8sNpvwiKs54ZqLKh8kJWyKG+RQSXEj7ZN+s1QXeZQvTHwL2tjPu9ozMebxeSkrxIJX1 2JKzeMNVz+tUjKVgIAIQ39wbT4T+a5OBahidY/FY4lVXnt5wAqk26zXcsCz5CXjSYTXp lKxPAdLYIQxZxHhMlPomFCXKjWoRA9v8VcHPuFoKYCZeOYMPUKl5usoKfePkACAl8KQo Be4tc5Kvpw2XLksUJlQJtBQlVO0IrhQCvE27LcIuQ0g/Sja7/vBgS/GRF/ec1DJJoaqb yHdg== 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:dkim-signature; bh=ZyFAaOpUXZV4XS/JJhp8QSWsuIHGaG5DSI+WGR7Hqpw=; b=uz/WDuNgbkYVmtty9Itk591QxQuM7e9T4JV7KlV2/xVMiuJXlKrrbK48p7w3+2/Eq6 VJrMbIt5mmfbcg8bfsbOhf9mwGNiV630OZ7N27UA3CUwxBTwHRgmNrauWOaByJ/PEaxd cpo6xViRitFdt8yTU9/gTuo/KGCOVEq2Laxo/a8w8WhjuE77h570WRwonvoe808CFnz3 HKGAodVp3ipThWu5W1W4ooivdB9BKPO61gFuvUgsAgc+x03AJCdbtj6IUroujJBT55aV hHSJbKVusDOVcGaDhCylajfcXXgxV9infgsIfmWg3ij4xo8I9zpSwXpQDV2g0yA6k/eJ /x5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UOK4exFj; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j20si22149242pgh.224.2019.01.24.00.50.13; Thu, 24 Jan 2019 00:50:29 -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=@linaro.org header.s=google header.b=UOK4exFj; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727451AbfAXIsP (ORCPT + 99 others); Thu, 24 Jan 2019 03:48:15 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:38869 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727386AbfAXIsP (ORCPT ); Thu, 24 Jan 2019 03:48:15 -0500 Received: by mail-wm1-f67.google.com with SMTP id m22so2086099wml.3 for ; Thu, 24 Jan 2019 00:48:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=ZyFAaOpUXZV4XS/JJhp8QSWsuIHGaG5DSI+WGR7Hqpw=; b=UOK4exFjh2jch3jVtCbKSlFgEi3JVtdnLBXV3lalCrxa3Z3E1VgYAwgaLFwhs6bi37 iooz5XQzgWUxSZ1YP0Kzv8eMi4ZFzzTqE6v+ZhQ43F5DLhbF9slbl7hEQDnZCyRkp1gZ 8imAFsPvyjrA5lM92azZ5lYxoyTJqbivDhQNA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=ZyFAaOpUXZV4XS/JJhp8QSWsuIHGaG5DSI+WGR7Hqpw=; b=OEZpMyppzs93sUAZvNlnaA6G1469LAVkUX8yrBKxGCKOmHKMFumpB0yMrZkUkYPU4g vTk1DarH05UBmL5Bmu+ub1fQUHHy1Z7lrxB/FyXkAPT0BOcBOFtPTRJM8qnUbsmcyP+K DtchtAeqd7jfoIy1ruxpjSo09MaQcaeB1lWLb3O6TGaVmaTlPvV6ULoD23g7oejNlKm7 08xEboITKP6dJOY9xEF+kn35QsoC5UGFmNhxgCYuDtDTSiM1+9tkxHFgLEnzz+c8cHOD xnYxd3mmnAQ6uYrpCdICOriEg5VEvdk2hENSnCswJ2FQqw5B5bB4Qaee6ZTrRTRl6ETJ P3wA== X-Gm-Message-State: AJcUukdhBna8cKO74lH7c2PJFv8XvsKkijuywLrYonw7X+pDSWXYHvCC 6BKp7Bh84czLkuX5YB6Z2Y3SqQ== X-Received: by 2002:a1c:990c:: with SMTP id b12mr1733863wme.106.1548319692192; Thu, 24 Jan 2019 00:48:12 -0800 (PST) Received: from [192.168.27.209] ([37.157.136.206]) by smtp.googlemail.com with ESMTPSA id t70sm92112756wmd.36.2019.01.24.00.48.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Jan 2019 00:48:11 -0800 (PST) Subject: Re: [PATCH 03/10] venus: helpers: export few helper functions To: Alexandre Courbot Cc: Linux Media Mailing List , Mauro Carvalho Chehab , Hans Verkuil , LKML , linux-arm-msm@vger.kernel.org, Vikash Garodia , Tomasz Figa , Malathi Gottam References: <20190117162008.25217-1-stanimir.varbanov@linaro.org> <20190117162008.25217-4-stanimir.varbanov@linaro.org> From: Stanimir Varbanov Message-ID: <14c09ca5-0f45-87f5-9bdc-d28f56438dfc@linaro.org> Date: Thu, 24 Jan 2019 10:48:10 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Alex, Thanks for the review! On 1/24/19 10:43 AM, Alexandre Courbot wrote: > 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? > yes that is typo which I saw after sending the patches. Fixed already. -- regards, Stan