From patchwork Tue Apr 24 12:44:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 134081 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp2190707lji; Tue, 24 Apr 2018 05:45:46 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+vLt/7swE39BDIDO29/ws2WZZgLdzTeVGBnIaQsM1pAiP9ehX01lUyA25imWQxxVySd9t9 X-Received: by 2002:a17:902:6181:: with SMTP id u1-v6mr24591077plj.272.1524573946193; Tue, 24 Apr 2018 05:45:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524573946; cv=none; d=google.com; s=arc-20160816; b=Dhg+c/utbeLdN0JqoFMmXw4ntOJ3UDdqpsphrMRmekVNLOBGbb87Q0F/oOJoGdIk+F air5Sfvgb3ThGSmOJ8ZyfQtW3r+xbXVUU81JjHdo/fzuIUzopLxssqncV71/HWF5Lg0W qQzBAet0+Cps00YgMTc1X3rSxPK/MuLbUPI+ZhwFA+eGMHsEAc2I/NxrZC1gwqTGsAQN WeN6o2O2ZswPcUUCeQ9vyZOvs9WAnQPgjXSwzcIcs732TqcTJsBKU+TLfLsOUhty6be/ 2+FTNJDr/vazfglgYxi/Ly5Pkoh3hlHDkwa2UcLFk7HiCpUU/UkUn3Kl2O53hXG2NsE6 dLzg== 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=U2xi0dn6gyZZ1hHDNjEw863LI0vBovx/8ohHjYwNdKM=; b=Cx5cOrbj5Itlp8oMssFc8qBZ1h/XWNAmrIul/jUBHQJJItg9YGRS0FVhzfeozFKm9V zmQPQjpBrbwepk7xn4xqmyCkibi2wvimHHxF04m2xLv+APbExi54ChE8BvsO07q5A3+h WTtGOWL7Q0N09VkUG1grXitEAxW2JLpuyTpnEt70BK685QBLknzZ6SDzL4HYwtj+tX6M d+/OC1rD4js94B6ZB4RatxO07TkvQPWpB4Eqlyh14bWfLAhphpW/YRi41YYeQHEPLh9z fVNaHIZ/Ls6dhQwIIbdqnM0KlJO0XUGuHTXhK+y+uPxzq9U5bDqqTRBmOHZ7E0nmnxlO EoDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=cxxR2Mae; 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 h185si9600654pgc.34.2018.04.24.05.45.45; Tue, 24 Apr 2018 05:45:46 -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=cxxR2Mae; 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 S932864AbeDXMpn (ORCPT + 12 others); Tue, 24 Apr 2018 08:45:43 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:52222 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932895AbeDXMpZ (ORCPT ); Tue, 24 Apr 2018 08:45:25 -0400 Received: by mail-wm0-f66.google.com with SMTP id j4so693325wme.1 for ; Tue, 24 Apr 2018 05:45:25 -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=E1+ejdpR+y9FFa9IqPOnHFP+NneMBNW0D/LV7Xa2NWI=; b=cxxR2Maek1lraGTEXZDsWBggO5SnVXjvXN6RiN4msQAjoqHM+yr3qcWRqNpOyeYMcq F1cPZ/akFtj5sMrC33OcbaMsf3+ShUWTWim4ELQS2rdoeeHMDYqT9RZ8wCbgqOd40bN0 07PkKrxB1jJRewSL30m2NHikR7VJQ5ktfmfos= 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=E1+ejdpR+y9FFa9IqPOnHFP+NneMBNW0D/LV7Xa2NWI=; b=CsNAn6nrdwMzd8S/f+RAICk+PKF1fJCm0dJbeDOdoH/ahU/q+j6BH4Nd4HhIwuONP/ 4fG235PJ0buv7fEyZTN+l/Ioc5H+cwm5Qi8BElkIXUpvSEg2i1q96K7yqBs59FB9pKhw pwsEG0sHtXo6p8hFRCvoOEFx7ySYJbp/KSplkVxdPzqN9cKFUOcZxJ9PcFSM3qpmNehZ 2oPimC9l6SZCTVEjlN24R8gIxxsCRj1uYYo9xgLRG3V/uViTTefbdKhHllKrJfTD7Juk Tqc6k12YzH1f83KhkQ80X5SfNZ8tB+bEHbqcxVBuyWfSfyhQ2V0dRqqIY1MYx7+6OFux tZKA== X-Gm-Message-State: ALQs6tBzpIpJoHVTLagmXx/18lCsaWtyItW6ohQE4N8EzJZQEqUfFHJE VaCGny1e2wZ2VADKdwBvFt8zTRkEio4= X-Received: by 10.28.91.209 with SMTP id p200mr11519310wmb.11.1524573924309; Tue, 24 Apr 2018 05:45:24 -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.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Apr 2018 05:45:23 -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 16/28] venus: add helper function to set actual buffer size Date: Tue, 24 Apr 2018 15:44:24 +0300 Message-Id: <20180424124436.26955-17-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 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 --- 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(-) -- 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 824ad4d2d064..94664a3ce3e2 100644 --- a/drivers/media/platform/qcom/venus/helpers.c +++ b/drivers/media/platform/qcom/venus/helpers.c @@ -544,6 +544,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 1de9cc64cf2f..b43607dee4fe 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; }