Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp614280imm; Thu, 5 Jul 2018 06:09:34 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfeI1GsZl5DCJdhZxOEqWqVFTqEwJXlzHMNWVVSxskOBq6V4dyOxIuXsoErdAp06VNSZt2y X-Received: by 2002:a63:4002:: with SMTP id n2-v6mr920774pga.285.1530796174554; Thu, 05 Jul 2018 06:09:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530796174; cv=none; d=google.com; s=arc-20160816; b=nZfgyLhaHFfvJyU4K7bpelZKcy/J/Q99QGyIVyy59Qht+RcsajmCXFsZrciPlGlhiP 36jmgLOSKuN6QgZsZIJVX8Kce5zxcVuQ0TVQ3W6n8We5zrb73hy7WEplaIt+mjn0fGN6 NJ4100Fxs79kIO7G2ALLCKiyG0TfWJDsF051Y0TqPtQoUfd2odsM1MKqAMQpYKJY+RnE kF69c91l4AqfQ4cykfDmv2Qd3elxOY446K+Vg88WL9KmDcnbmhyUmXM/gAp21n2wwNGf 9prCo3bCJ+SgNkTOp6JJu9ozmHZ3Cq/5p1OES3iTXTjJaFysHm+NsWJAIWcagAYv5oKg tiYA== 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=olV8QCV6OTgGL+a7O+uasLtsP5Ovu74pzCpIsDTiQaA=; b=RDcO39vZYGOcg4/PCWySgeHaEXk4KTBnOxBgtHFiRH1yPhLIp87gfPZDKXmNL4/FcU cBWNE64MvbUHSdTXBm6rLBx/+GqQTjm4h4/z5kjAJNkTRLitnccbB4jUXAUtOdIscd6e QygbFV8Vpgwsc6yVQRmL3N3es6SRzTaF0R3VoWYh1M1FzO/j50gEd4Zc1oJbSomSHayO XZXmXnsOSb/BBttOZX+GIiP7D1DPPN+08Il2d/UDRX6khmAKINBzJmAYjRIJWzZDWnYj Gg+Q075P4yFGZWJVoEr0RU1FoJgI6HF1oeWC7HDZN4Ej1MotMl+0T+5obJPSrecAc2Eh GtTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NXjY1ls9; 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 e39-v6si5925921plg.168.2018.07.05.06.09.20; Thu, 05 Jul 2018 06:09:34 -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=NXjY1ls9; 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 S1754579AbeGENIH (ORCPT + 99 others); Thu, 5 Jul 2018 09:08:07 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:55415 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754478AbeGENFa (ORCPT ); Thu, 5 Jul 2018 09:05:30 -0400 Received: by mail-wm0-f67.google.com with SMTP id v16-v6so11020098wmv.5 for ; Thu, 05 Jul 2018 06:05:29 -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=olV8QCV6OTgGL+a7O+uasLtsP5Ovu74pzCpIsDTiQaA=; b=NXjY1ls9miz/xtVcYPTlpHp55RGPE0LUjpLPfjNGLr0URgaDZg1RlvExour0XmF+lE W2JLYMF6HbpWFtVcBaHURAPSsfp8E16amouYSBYeOfqG41U/ehOuvi/nQ8sNWfilS3ph YoS2GzRw1FjcpSQzP/tJ3rSZygBEOx0RB+xZc= 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=olV8QCV6OTgGL+a7O+uasLtsP5Ovu74pzCpIsDTiQaA=; b=m1XjV8wIOciDMvj7NBvagktMGglmb7BUiEU3e4RX3yATVNu9wv5drEJ2cnQG8hClSa 0me+rs9fx8KfKZf1OQwPGULTbu1NSKNQMufCMx2H19irwJ3lRwI0qEgt6KaloaAPd4pw k9Znm/evd6kBuA3D7tBKaoiXrcIK2nZVwn/If3UP0le89tk0EboPryeI4k0w2iEZ+U7a swcyy+Zu2uIgjcnpHf5vJ4H6PFn2xPbL4kAchRfCExmrzAkNDUxKzZNXOC8CsaK4sVbQ ApODZr9Z3GB0ac/6SxjKTTlUaC9kXAQI3G54Q905TD1qORH/L/yoJEPRNGcPTDHpXZ5C qe7g== X-Gm-Message-State: APt69E1ltH2oFGuylvXqaMEK7o0EAQzVyfCafwFIKMvCHYoi0yDMxm+M j+BFsnjLRaosUpmA7tslInwgRkNVxrE= X-Received: by 2002:a1c:ca0f:: with SMTP id a15-v6mr3966291wmg.102.1530795929111; Thu, 05 Jul 2018 06:05:29 -0700 (PDT) Received: from mms-0440.qualcomm.mm-sol.com ([37.157.136.206]) by smtp.gmail.com with ESMTPSA id 11-v6sm2109102wrw.67.2018.07.05.06.05.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Jul 2018 06:05:28 -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 , Alexandre Courbot , Stanimir Varbanov Subject: [PATCH v5 20/27] venus: helpers: extend set_num_bufs helper with one more argument Date: Thu, 5 Jul 2018 16:03:54 +0300 Message-Id: <20180705130401.24315-21-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180705130401.24315-1-stanimir.varbanov@linaro.org> References: <20180705130401.24315-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(-) diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c index 3cd25e25aa70..13f0bc4e5ffa 100644 --- a/drivers/media/platform/qcom/venus/helpers.c +++ b/drivers/media/platform/qcom/venus/helpers.c @@ -515,7 +515,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; @@ -531,7 +532,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 75f622c73222..3af1fb81cc32 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 6dc153f16d88..cc8049fd8811 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; -- 2.14.1