From patchwork Tue Apr 24 12:44:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 134090 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp2193917lji; Tue, 24 Apr 2018 05:48:58 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+Mnd8uBMS5FCckr31PchGtK6jkp86UH/4oTq8ROBkOeOwkWyY5KePPhPG79PHZ1jIBZLkX X-Received: by 10.99.125.86 with SMTP id m22mr20865947pgn.257.1524574138347; Tue, 24 Apr 2018 05:48:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524574138; cv=none; d=google.com; s=arc-20160816; b=rgxvwAEGHAT+aimZsKJ4AltMftZPOFHdGm6Wa8YOZrmx3Wuw+FakUtJg4EhTJAv5Io BD3GYvMRt/SaKnftjSp1sucBbcTDsNXOX3qp/0LGoq2hw4bqHNr88wanvS9BHjDnTnqs whFONDse7TPA1kMZeRXTpmX0HgD7tRNV9qSrzM8Dm2/tceyxLlsCa+SEU7fhkiLwenhF CZwgixflZMl5FL9eig88zFMV7/aEQIHGSWzX1Bbve/MtCe6bE1fjdemliCP5zi1ogwUE 6nEgScBqnou0n1FUGbQ9mucpep73+BEi+HAMW6L8psB31Z8t/uDipsUX45BuuWJF67iF dvLg== 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=ORTZztKofskC7v1ejEqolTCt3cDKmedOQOV1icLLFzM=; b=k+V0O1xrPMchj3QrJhNV8qJhddMo4g+bfL6j3mqVMk4evev5+CisKVSshbnwa9L1Jo WMNNMgh6xpKDdqeea6ahhfgx82cXehC94ubSCfMYbZH1KKJx40w0b7Q/a04CbkiFinxp /nZAGNU0ZOAZA98NiSsp0ePVSUa83ksnw86nbU8DGPGpfStA/zx3LfFqVk0QESpXPvLH bFfKwlRiqZOVg3f7Og5R2PIJFIG5nAv4BCbDIB35j691X9RVOi4B+TIPplPl/LOJDx9k 2Y3wxzQ338zrezCdNIGq5S5MJD5ep7vZNilVNRxAqOANMzJOLUoYoCAq6YI/cayT1ysR GciQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=bQP+h/TG; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (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 202si7540324pgg.546.2018.04.24.05.48.55; Tue, 24 Apr 2018 05:48:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=bQP+h/TG; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757706AbeDXMsx (ORCPT + 12 others); Tue, 24 Apr 2018 08:48:53 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:43977 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757863AbeDXMpb (ORCPT ); Tue, 24 Apr 2018 08:45:31 -0400 Received: by mail-wr0-f193.google.com with SMTP id v15-v6so31694187wrm.10 for ; Tue, 24 Apr 2018 05:45:30 -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=f/4AdQywwbP394uiEj1sSEy1sx0RwvTHezORi/HpjQ4=; b=bQP+h/TGW9vG0mKDwp1V1oNGyK7eiXl4B7CKqjBq9VE+VECjT0X4nvTiycCAOo9SZ+ z4+Euotw/FMp9Ry6g6AjrfHNlmE2k+gacHdFOfilYW6tkN9/1D/o5MM3kRNjK+EywRzl cQqv5kvnbCdyHASeNdvqYb5txiySCMuLS2GcA= 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=f/4AdQywwbP394uiEj1sSEy1sx0RwvTHezORi/HpjQ4=; b=hnjVqXfwzHBto04fbWiuDCb1uKsKjC2wa56PE8X/tOyMA+Mu6OY0UysY2iGMB5xCmf eehNSgxtdADlrqXJDh3ZbtSn0oakcKx0XlD0CLnRPc44Tt90DMGva/f8Lsl+iEMV/zG/ tlKXLLQGmvB2bSxO9NxZRhkS/FJOf0t7hWHsX2TrNda0Z1cDxtrJ4Z/dyzExN1yxecRT g3vfp+l1Mmwh3saoJQCmAAGnD6Y0QpFe5/SF3aqUr2y+qv+ZnB3ADh4QSu8inX4NXeul Vr3EDo7iDwXu3epLqRjSB1uVqdjENkM0juZdMmbcBb4IkSwJTxmpwsXsiE8NhpJddoCp 93/g== X-Gm-Message-State: ALQs6tA8s2GanQouc+WCCeXr6W156vl3sOHT1hhCZZX58hp8gQFTCCkF dyIEGVvETdi1gqwp2NHy04SXBw== X-Received: by 2002:adf:b8cf:: with SMTP id c15-v6mr21172072wrg.122.1524573929796; Tue, 24 Apr 2018 05:45:29 -0700 (PDT) Received: from localhost.localdomain ([37.157.136.206]) by smtp.gmail.com with ESMTPSA id n49-v6sm22666013wrn.50.2018.04.24.05.45.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Apr 2018 05:45:29 -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 21/28] venus: helpers: extend set_num_bufs helper with one more argument Date: Tue, 24 Apr 2018 15:44:29 +0300 Message-Id: <20180424124436.26955-22-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180424124436.26955-1-stanimir.varbanov@linaro.org> References: <20180424124436.26955-1-stanimir.varbanov@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@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(-) -- 2.14.1 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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 ceaf1a338eb3..8d188b11b85a 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;