Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp6495882imm; Wed, 27 Jun 2018 08:32:34 -0700 (PDT) X-Google-Smtp-Source: ADUXVKK5Z1AgvzOAIZHz+2kwL69iQ/bmdVvSqQoy21YT+N+bup56fz8NIJ/kTisC+V8YKVCN/k2F X-Received: by 2002:a17:902:6686:: with SMTP id e6-v6mr6647980plk.35.1530113554781; Wed, 27 Jun 2018 08:32:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530113554; cv=none; d=google.com; s=arc-20160816; b=F/SxhD9KN5WHUHjafWAKy9s90S5RghP50JudtP8TwHK4cPARzrrRxrCoXYsXsg76rm get6pwIUpr+ErV8e6VsvAFjlktgiGqu674KmyyWGR/1tCX9jCVUvXaUmj5pZr1gGqBsM kOdCtPO7lfU1LXAwE7Air6I7Y9j/pMU9zGXM1cfu55o7bjPAzFL0zVE38xdvuOQSIhD8 gDiA2RX9XD1Ssz6jf0p5z/fbqe9r5OXb1Q+Ixyme2s0J8lUv25SzJRny9Zh7pM38HTHC Z8t9VeDFazEYN1Y74qtLUjxJ2AX0GCsbYgDV3KtXh7f6wtgVoUZphdfDHZFwiCAiByRy VtYg== 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=+ssufRupM9PR8pPvQwm/oq0OgQo86xh959S5/coLDU0=; b=D7kv/3mb24ibUUK+VSftxx8Uf8xmhXI3vSTt281Whnc4Aj2TIsMGBRjQi3QaPNrVNw Lgrji7VZqfGZciA/gSUIp5NY/FVIaSirM9NykJdrpf9T+EZp2U6hHCA6XwsamivbE1oN frp5gkT/X4J0Z3enoJTVfl03t+ev5dKQiOS6ApvahCPPYnhvaOmQ+l1sIqyPukd2HbY8 Y+VZGja3okF1GS0B0P3VTtH6JQIDM4PtHveL4HmwGLTyIkWnUQkXAFlQQM/gfauKYbet h4/pOrnHF+qdJIxXbG9mFch2JDvckvywXcJjfoL90mmUgVe41J+y+xjfhCnYmnOfBlLL X7hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FRDJndGe; 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 b1-v6si3746573pgb.465.2018.06.27.08.32.20; Wed, 27 Jun 2018 08:32: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=FRDJndGe; 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 S965185AbeF0P2Y (ORCPT + 99 others); Wed, 27 Jun 2018 11:28:24 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:34144 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934849AbeF0P2R (ORCPT ); Wed, 27 Jun 2018 11:28:17 -0400 Received: by mail-wm0-f68.google.com with SMTP id l15-v6so18349494wmc.1 for ; Wed, 27 Jun 2018 08:28:16 -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=+ssufRupM9PR8pPvQwm/oq0OgQo86xh959S5/coLDU0=; b=FRDJndGeLO6T30aFBXt+ka12bRhUi4mBx3XxdjQDypdkW8l3fgdngkKvKySig+4QrS y9TwB6jrKDV2AOjjTbDMBO7ieTFQfuNpjgf4b36OI5zmwDpzEHQo9yHUVYF61ALC6r79 ylYEP/wB/WjqFfVxxbsejhp/+8U1WkCAU6EQk= 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=+ssufRupM9PR8pPvQwm/oq0OgQo86xh959S5/coLDU0=; b=TxYcwQtnQbytOJ1rgc64b8GoV52KoggDGmHLOC/MBZc1F17WVi8d8ynXgWRZi7PbZE zzAuZHsj1y0EHgeV4DBs2BzZxnIxFh3W69DUazpGwodatdOUKrcp2vHaUqBAgfcdY3Mg 6sdAsHi/5K9Kd8OM8ambf8XWuQjQZYb25ADmOnIRBiNz32yIDbQ+GkXW0gLsyzS5sEs8 RjKtXTIygUo9WXQfVMoBlEkETtDY58vZPwK6RC/OVaM3S0OwfawaHQCgUy4jOwfXelWY AoqjGfAmGbSJLZSCGWlo2sr9DAommmbBlhI3drniGNLzA+3Q3+KEdyUO4g60FLAdDnwO d6JA== X-Gm-Message-State: APt69E2gt/ZCwVsZirUMY6TrLbiPYN0X7KKShkTA957B2n+V7EpAb4/N uXu/4SUCEOmoJyRUBcmVhB4Q+g== X-Received: by 2002:a1c:b590:: with SMTP id e138-v6mr2406569wmf.154.1530113296331; Wed, 27 Jun 2018 08:28:16 -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.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Jun 2018 08:28:15 -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 15/27] venus: helpers: add helper function to set actual buffer size Date: Wed, 27 Jun 2018 18:27:13 +0300 Message-Id: <20180627152725.9783-16-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 Add and use a helper function to set actual buffer size for particular buffer type. This is also preparation to use the second decoder output. Signed-off-by: Stanimir Varbanov Reviewed-by: Tomasz Figa --- drivers/media/platform/qcom/venus/helpers.c | 12 ++++++++++++ drivers/media/platform/qcom/venus/helpers.h | 1 + drivers/media/platform/qcom/venus/vdec.c | 10 ++-------- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c index e3dc2772946f..0cce664f093d 100644 --- a/drivers/media/platform/qcom/venus/helpers.c +++ b/drivers/media/platform/qcom/venus/helpers.c @@ -541,6 +541,18 @@ int venus_helper_set_dyn_bufmode(struct venus_inst *inst) } EXPORT_SYMBOL_GPL(venus_helper_set_dyn_bufmode); +int venus_helper_set_bufsize(struct venus_inst *inst, u32 bufsize, u32 buftype) +{ + u32 ptype = HFI_PROPERTY_PARAM_BUFFER_SIZE_ACTUAL; + struct hfi_buffer_size_actual bufsz; + + bufsz.type = buftype; + bufsz.size = bufsize; + + return hfi_session_set_property(inst, ptype, &bufsz); +} +EXPORT_SYMBOL_GPL(venus_helper_set_bufsize); + static void delayed_process_buf_func(struct work_struct *work) { struct venus_buffer *buf, *n; diff --git a/drivers/media/platform/qcom/venus/helpers.h b/drivers/media/platform/qcom/venus/helpers.h index 52b961ed491e..cd306bd8978f 100644 --- a/drivers/media/platform/qcom/venus/helpers.h +++ b/drivers/media/platform/qcom/venus/helpers.h @@ -41,6 +41,7 @@ int venus_helper_set_num_bufs(struct venus_inst *inst, unsigned int input_bufs, unsigned int output_bufs); int venus_helper_set_color_format(struct venus_inst *inst, u32 fmt); int venus_helper_set_dyn_bufmode(struct venus_inst *inst); +int venus_helper_set_bufsize(struct venus_inst *inst, u32 bufsize, u32 buftype); void venus_helper_acquire_buf_ref(struct vb2_v4l2_buffer *vbuf); void venus_helper_release_buf_ref(struct venus_inst *inst, unsigned int idx); void venus_helper_init_instance(struct venus_inst *inst); diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index 92669a358a90..eae9c651ac91 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -710,7 +710,6 @@ static int vdec_start_streaming(struct vb2_queue *q, unsigned int count) { struct venus_inst *inst = vb2_get_drv_priv(q); struct venus_core *core = inst->core; - u32 ptype; int ret; mutex_lock(&inst->lock); @@ -740,13 +739,8 @@ static int vdec_start_streaming(struct vb2_queue *q, unsigned int count) goto deinit_sess; if (core->res->hfi_version == HFI_VERSION_3XX) { - struct hfi_buffer_size_actual buf_sz; - - ptype = HFI_PROPERTY_PARAM_BUFFER_SIZE_ACTUAL; - buf_sz.type = HFI_BUFFER_OUTPUT; - buf_sz.size = inst->output_buf_size; - - ret = hfi_session_set_property(inst, ptype, &buf_sz); + ret = venus_helper_set_bufsize(inst, inst->output_buf_size, + HFI_BUFFER_OUTPUT); if (ret) goto deinit_sess; } -- 2.14.1