From patchwork Wed Jun 27 15:27:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 140343 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1027547ljj; Wed, 27 Jun 2018 08:30:53 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKjxQtEjAs28BjvGvPPWXK3+3TOVh/mdGC1CR92FT8E3eyXtxIBdqzEsKNgkCIp3772YGtX X-Received: by 2002:a17:902:b81:: with SMTP id 1-v6mr6717492plr.164.1530113453120; Wed, 27 Jun 2018 08:30:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530113453; cv=none; d=google.com; s=arc-20160816; b=Wd1qjYH4nEunDgpyj28sw67d68UBnPcy/OxU6zJ+9tyZm5RMVVxk7BgOrnRYSqPJAC mFDZC3G1TCyFtIypmeaTXkg8KYn6RYyUiW5dEI4jEk4mHrec2JiPIZguTkXSQjtqYkDM /+f0xfQzGiAWrfzEvsE+2Z72fcDqlN1gKYirHFPBZnBzaw72uy0VM/9vDAfKZrK8/yoD Z/EJVLegvy85P83997r4b7XYOi/o4abdqMmkq+tkASX6dZ8y3ZGvBXDdZ3cFMXS4OMGs aM9kzYxGoKhLX+x41Lj6qsxW40lI9vNPwoqDl3NJntxrWP0k4aZSz9e8BAG7ipY/ohS3 Leyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=ohBxby42Vxzlh/dYlM+pRHCgvQbfNHDMttBaQvAQZWk=; b=mRLjobz0RHXiE5tiSDdH7V6mjp/tsTeUxGOiuL2/ubK/FPEolUJReMoALWtQ22JZz+ 0ZOqxjlLGxOouW2N5MBuoRN6fahh6u3T0A9xNYj3BEA3rCz7SgiEwWt8ISCYaXAbdscU K5jj9F+5AQBXnZDkbm5TfWAtJw8FDZiIa8GCNEMHaViSMGe/sxjB+qRepb3dwg4NFzwV AZ5ghHpDiBM/jHO88m+SH9KsK+a42hxTcGVHz0sA76UYQv8mNYR5RzEfZEfUj3N1UQLe 2LaXJ0P/UQUxbU00ZOpDKqXm6tmcoVYx04NCpYku+VRw0OdeiyjvskpWM8kvVQD2OAuX DXyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YSVc3ths; 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 v71-v6si1152087pfj.354.2018.06.27.08.30.51; Wed, 27 Jun 2018 08:30:53 -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=@linaro.org header.s=google header.b=YSVc3ths; 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 S965391AbeF0Pau (ORCPT + 31 others); Wed, 27 Jun 2018 11:30:50 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:46853 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964826AbeF0P2X (ORCPT ); Wed, 27 Jun 2018 11:28:23 -0400 Received: by mail-wr0-f194.google.com with SMTP id t6-v6so2461627wrq.13 for ; Wed, 27 Jun 2018 08:28:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ohBxby42Vxzlh/dYlM+pRHCgvQbfNHDMttBaQvAQZWk=; b=YSVc3thsHvUSfV2fZ1HtSgZ8mp7jp1CQy3di0/h27v40fs2PNOG/CcCf7UXUm14Aat 1n4lKe4Mvnoa4Go56+hiHKFN2ib2ucG26WQCPbA8s5gmcrLsjvehAgfSaH792WpcDGQC ss93o8ZkfphX2v5umfnmYWPa0v/bWo4GwVDW8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ohBxby42Vxzlh/dYlM+pRHCgvQbfNHDMttBaQvAQZWk=; b=Hx6sPTcJOtg3CKA2pLVMbv3V3XuuecnxVZwWdhJVhEHMHOAKHmiZKj721mWCuMvGD7 9zO9x2htsOKkbDHM/aoE78cebwG3+OPCTwCTvoFiVqkbFWKyMHCSaTR3YS2RPd/jG6JX lbAuymS4HvQffUDRcESfG1eDCBzR6dXiUtBBwwLO6I+Yu7TIL154DDZ304MlncOb0Y/U z6Q5ryTvFKPo6xWN2eL5k7MNUOtp/Q+ZFw7gLkNkKvxmA+mN7eeGKiATAbJGwLB3ezTY YrDdEvC932KpSLKwPttDq7VeaBaev6h8lt9Nv69XIO6W1c7ItEetX8nZN72R4LjpiRZv HpaA== X-Gm-Message-State: APt69E2OqL+WDBEozRwTe1guMsUAkTD5bRj3tKLjRP6cgR5EHRZawgBX t7AX7tV+hhFJ+10h6I1UfcF7FA== X-Received: by 2002:adf:b69c:: with SMTP id j28-v6mr5558264wre.200.1530113302022; Wed, 27 Jun 2018 08:28:22 -0700 (PDT) Received: from mms-0440.qualcomm.mm-sol.com ([37.157.136.206]) by smtp.gmail.com with ESMTPSA id o203-v6sm2916075wmd.30.2018.06.27.08.28.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Jun 2018 08:28:21 -0700 (PDT) From: Stanimir Varbanov To: Mauro Carvalho Chehab , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Vikash Garodia , Tomasz Figa , Stanimir Varbanov Subject: [PATCH v4 20/27] venus: helpers: extend set_num_bufs helper with one more argument Date: Wed, 27 Jun 2018 18:27:18 +0300 Message-Id: <20180627152725.9783-21-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180627152725.9783-1-stanimir.varbanov@linaro.org> References: <20180627152725.9783-1-stanimir.varbanov@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Extend venus_helper_set_num_bufs() helper function with one more argument to set number of output buffers for the secondary decoder output. Signed-off-by: Stanimir Varbanov Reviewed-by: Tomasz Figa --- drivers/media/platform/qcom/venus/helpers.c | 16 ++++++++++++++-- drivers/media/platform/qcom/venus/helpers.h | 3 ++- drivers/media/platform/qcom/venus/vdec.c | 2 +- drivers/media/platform/qcom/venus/venc.c | 2 +- 4 files changed, 18 insertions(+), 5 deletions(-) -- 2.14.1 diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c index 2295cca3c22a..e332c9682b9c 100644 --- a/drivers/media/platform/qcom/venus/helpers.c +++ b/drivers/media/platform/qcom/venus/helpers.c @@ -510,7 +510,8 @@ int venus_helper_set_core_usage(struct venus_inst *inst, u32 usage) EXPORT_SYMBOL_GPL(venus_helper_set_core_usage); int venus_helper_set_num_bufs(struct venus_inst *inst, unsigned int input_bufs, - unsigned int output_bufs) + unsigned int output_bufs, + unsigned int output2_bufs) { u32 ptype = HFI_PROPERTY_PARAM_BUFFER_COUNT_ACTUAL; struct hfi_buffer_count_actual buf_count; @@ -526,7 +527,18 @@ int venus_helper_set_num_bufs(struct venus_inst *inst, unsigned int input_bufs, buf_count.type = HFI_BUFFER_OUTPUT; buf_count.count_actual = output_bufs; - return hfi_session_set_property(inst, ptype, &buf_count); + ret = hfi_session_set_property(inst, ptype, &buf_count); + if (ret) + return ret; + + if (output2_bufs) { + buf_count.type = HFI_BUFFER_OUTPUT2; + buf_count.count_actual = output2_bufs; + + ret = hfi_session_set_property(inst, ptype, &buf_count); + } + + return ret; } EXPORT_SYMBOL_GPL(venus_helper_set_num_bufs); diff --git a/drivers/media/platform/qcom/venus/helpers.h b/drivers/media/platform/qcom/venus/helpers.h index d5e727e1ecab..8ff4bd3ef958 100644 --- a/drivers/media/platform/qcom/venus/helpers.h +++ b/drivers/media/platform/qcom/venus/helpers.h @@ -41,7 +41,8 @@ int venus_helper_set_output_resolution(struct venus_inst *inst, int venus_helper_set_work_mode(struct venus_inst *inst, u32 mode); int venus_helper_set_core_usage(struct venus_inst *inst, u32 usage); int venus_helper_set_num_bufs(struct venus_inst *inst, unsigned int input_bufs, - unsigned int output_bufs); + unsigned int output_bufs, + unsigned int output2_bufs); int venus_helper_set_raw_format(struct venus_inst *inst, u32 hfi_format, u32 buftype); int venus_helper_set_color_format(struct venus_inst *inst, u32 fmt); diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index f1cf4678d013..5d8bf288bd2a 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -758,7 +758,7 @@ static int vdec_start_streaming(struct vb2_queue *q, unsigned int count) goto deinit_sess; ret = venus_helper_set_num_bufs(inst, inst->num_input_bufs, - VB2_MAX_FRAME); + VB2_MAX_FRAME, VB2_MAX_FRAME); if (ret) goto deinit_sess; diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c index 4f0a5daa97e2..abde7d6d123f 100644 --- a/drivers/media/platform/qcom/venus/venc.c +++ b/drivers/media/platform/qcom/venus/venc.c @@ -963,7 +963,7 @@ static int venc_start_streaming(struct vb2_queue *q, unsigned int count) goto deinit_sess; ret = venus_helper_set_num_bufs(inst, inst->num_input_bufs, - inst->num_output_bufs); + inst->num_output_bufs, 0); if (ret) goto deinit_sess;