Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp264164imm; Tue, 15 May 2018 01:05:42 -0700 (PDT) X-Google-Smtp-Source: AB8JxZplE4hGHBeFtd194fW9RVe1hR9WFiTTtuLDafLK3TmINOspldP0pshoK4To7885Gcrhdv0c X-Received: by 2002:a17:902:8e8b:: with SMTP id bg11-v6mr13076686plb.95.1526371542367; Tue, 15 May 2018 01:05:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526371542; cv=none; d=google.com; s=arc-20160816; b=es4DtmyClYfc4ktvJMFF+ALEpmgir2IbHPS4VeyZe9ICkThH83sODKFdWXv3/1ckn6 3PDNwMGnTDEG/k6MogF/QFHyXRVhdsE3psXilIHjkS483uHpoBhW3pOeLF8wWDi26Enj MzvJXXEjIo8xkmhdcpv3Km2dzyaAqOmCUINh6uRUsplnQqivWIB3l0kFZvEseklGz166 w1p1dZZxBbcjJmphiHV7NB0VLgLMbYzDBloKBN7LsBV16J6HixoDh6SiaaomgVL6M85+ Z/zxtt6DASFoLRO3N3Y0sTwZ/RDNtbxuO5paMvd9ZqkzIeQwgnrHc0pDdF5grXTaYESm wfZw== 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=o3kwc509SWtxtHy8ZRhQbfMYwCPzJ2epVMtoq9RNABU=; b=sdNPZeX2lSYXqyT+iQktdmmth5FdL/6Nrlvma4kJTsJ+EF5hUWcmG/F9Vg3qaFI8l/ P96CT6538TgBel3ajufnN42e0ZNsiEe74g3TYkby8efsQ9jDM8NjjDu4h5u56dRcTrL+ MJ980og/T3Ozl19AJR2qBgp4OEhDOqosld3UEyMnxAioPDd3JS75y385+N71FiAwjc/C qCaMh7AAJcTC6AyoGq00kVXm4Iy7PdNUTNz3sMHkGoNFZjJH8mlvwTkkI6gfru2ACvK4 XYOu+S5Y1JwwiS/7IGQgpJZRsLVQExZYrMVaZ76btd7BweKmVX0j/seIe8aeMVL/PV2S EECw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TBU2fWez; 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 q15-v6si8725609pgt.266.2018.05.15.01.05.27; Tue, 15 May 2018 01:05:42 -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=TBU2fWez; 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 S1752551AbeEOIEj (ORCPT + 99 others); Tue, 15 May 2018 04:04:39 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:42171 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752599AbeEOH7w (ORCPT ); Tue, 15 May 2018 03:59:52 -0400 Received: by mail-wr0-f196.google.com with SMTP id v5-v6so14902957wrf.9 for ; Tue, 15 May 2018 00:59:51 -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=o3kwc509SWtxtHy8ZRhQbfMYwCPzJ2epVMtoq9RNABU=; b=TBU2fWezRYovGDlfctUWmqgC7mb694zA5THOAk480bG/yaRyQn9BSAu4AHkuw6q96q 4w6C17wuVlgoFfLPv5XUSFVBc67iwdSGs23a3J36Z3ov2hNp97/T7EKkSmMBrAxC0GWq XjsBec1742WqKSXknmn1Wewat8ORmvqecT4kw= 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=o3kwc509SWtxtHy8ZRhQbfMYwCPzJ2epVMtoq9RNABU=; b=TWeK977SnTdMw+ccgCe4QI1h3SBSf0Zu8ipNxTcGKQ0cL+dJBuVlaik807BMD265Am f/B04tU1S6+7VFLaQjdrgyxJl6AjpKyQvspjL1EUZp8eRvfSWIn7IEMXO01+ol3ShzSh DAg2OL7YN0UKkAZ+N/xbGXHZ6WsCuaeSG99cGHyG6S3Et4fNXGPlJVNk9z/WSKkppg3/ JtMQbhCOvBjHkf0bDy+GPUJMyocMhrgUmEqOyhVV594E5Uvw9MVab4CIcmSmvbErcFVb lpyDyIldseluqJleH8Nt8mxxDMKiazUqqnduocF9uQqPbjJzXyGELf/Y2VLf0VyVizRn qIxw== X-Gm-Message-State: ALKqPwe9C5Q21JZqrRafKq+kU8HL0qO1QJXcb0NKJzOAnKMaGRFlPk/2 8I9aiOlc9RbDj7uxkMdcNRhsaw== X-Received: by 2002:adf:9ed0:: with SMTP id b16-v6mr8619696wrf.170.1526371190889; Tue, 15 May 2018 00:59:50 -0700 (PDT) Received: from mms-0440.qualcomm.mm-sol.com ([37.157.136.206]) by smtp.gmail.com with ESMTPSA id 4-v6sm10918510wmg.40.2018.05.15.00.59.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 May 2018 00:59:50 -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 , Stanimir Varbanov Subject: [PATCH v2 22/29] venus: helpers: extend set_num_bufs helper with one more argument Date: Tue, 15 May 2018 10:58:52 +0300 Message-Id: <20180515075859.17217-23-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180515075859.17217-1-stanimir.varbanov@linaro.org> References: <20180515075859.17217-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 --- 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 adf8701a64bb..f04d16953b3a 100644 --- a/drivers/media/platform/qcom/venus/helpers.c +++ b/drivers/media/platform/qcom/venus/helpers.c @@ -513,7 +513,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; @@ -529,7 +530,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 3c7ffebe4bad..898c5edb91f5 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 3b3299bff1cd..c9c40d1ce7c6 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