From patchwork Tue May 15 07:58:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 135840 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp670985lji; Tue, 15 May 2018 01:02:31 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq5as0EzJ3N1vQNgRXOCA03HMk0QLBZG5r6/3mv9AknUjLqmdht+QihWeDOFP781mWL72ol X-Received: by 2002:a63:3706:: with SMTP id e6-v6mr11247172pga.281.1526371350936; Tue, 15 May 2018 01:02:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526371350; cv=none; d=google.com; s=arc-20160816; b=tuiwbk8x5SLmELl/IPbnVIlHpVmw2/qCm70dbu5Gzc8OGGvZHuCMjES5fFvYdp/Ezz 6lAC5Fau0n+LLIBbpK3qd9ta32uOGBJpYOcSGZYVIbMsbhXnuDdYOUHisDy/9H+FtJwx WMIbAxsfkqRyW13b10Xjj/uUl1ftWCpWQ6wd7dXndop/P/AaXvRhupnFUJb75TtQOCIw qW4FIBXxaqyN6DIwG3tN/GQfoVr5dUyVGzytoQ+DTYzo8YIU7XYMyf6q8FsQscghCnRB RVXbsFxaPArYF6IZeeEnkZhhgDrL6Y5hHM38Ei4ufkkpch3C4oTypp5BhtZPJqfwTMaI SB/Q== 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=OcZuRaXmoSYNJtMeTx37SYSi6mTTY4bgOH3iUTdF6x0=; b=Im9nvrfFPcNn+ZoUCpfCSaKFmo6rJqNrixgX3H5d26aHLIaLXMmNsfAu5GMwcLOgOS 7QGEIDXcvnxZrG6tPxp4yKDdFOQUti5BSx3Abh+0b3F0kwWMg9+sbjrzTUNJBTunr+8y LG2STwncP1tUGOZjWit26WZWmEZbf3VyNH4bzmTBJo50YTc9ucmCPUUCkcu83MqmJ4xP 4XCWBSFMw4rLxDNVLFjS+lCxOOKe1rq5jd5JPhNIW1pbK2MJyjUBIkEWpLpizMLyobdk zpovDak7Ria/8w5ZaaJi9tSepme4FSb+3l6ynhU75DIHEQdqKH61UHPDtE6hO9wau5d5 qtHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=ZAJ7XiVR; 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 l4-v6si9528859pgn.54.2018.05.15.01.02.30; Tue, 15 May 2018 01:02:30 -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=ZAJ7XiVR; 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 S1752618AbeEOH7y (ORCPT + 13 others); Tue, 15 May 2018 03:59:54 -0400 Received: from mail-wr0-f195.google.com ([209.85.128.195]:33880 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752560AbeEOH7r (ORCPT ); Tue, 15 May 2018 03:59:47 -0400 Received: by mail-wr0-f195.google.com with SMTP id p18-v6so14910414wrm.1 for ; Tue, 15 May 2018 00:59:46 -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=zJxnpqaIIqZtdOKFlNGYC5gg+khf/QPmLkujQMd3QTs=; b=ZAJ7XiVRqN+rP8ZWjFxT4DnjjxuecrOcRi0HG83jhBVYNMvHjMao0yL8E2AtKi6XjC gTKU0MQ0+5ZTntU+vbFYGJ2AOOn6u8l42e8W+w3Jyaznz1BhCRBxXA4Lu9bwAbhRGDUl LEn3j0/UQi/9ECKwg7LeZ5DR/fHKUZCIdWTew= 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=zJxnpqaIIqZtdOKFlNGYC5gg+khf/QPmLkujQMd3QTs=; b=pUMTqNrfESyQdzLqaNq2qybViNJ2JVOyKIeVfMXmpvxGJnHGeYBftC1v8/S7ekLa7R Qe8JN3bKhh3rV77ztFkKmEqMAIcUKJ/n2cQetpfDMmwzxgIV7YTY/6h0F8e/hxh+6HXG 6H34CrKMdj+RA5LWpH8IqfaBpX+B2O8Q2OXYYbPY/T4+DL6xh9Fc1z/E+eeuJk2ft3bk jRXELGth3RbKEsQSYCppPcqfWVSyeF5Li6SwnaZiqIdenjmYWLpjjZRWh9j+rWgn+lQl RgOKMU3WXmtGWtO6ojtZ+tIOFrytX4+bUAtda83LGpwk2mtlz8uMblnwdG0eXLgBZ1JO OKug== X-Gm-Message-State: ALKqPwf51i11QyD0aja0/Am9mQUcaHpZeqe8UAJkh0+W99WAkvGQHi2K JvKF+Z8jjeRsJZIb87/J/CAD7g== X-Received: by 2002:adf:e78b:: with SMTP id n11-v6mr9049314wrm.192.1526371185922; Tue, 15 May 2018 00:59:45 -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.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 May 2018 00:59:45 -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 17/29] venus: add helper function to set actual buffer size Date: Tue, 15 May 2018 10:58:47 +0300 Message-Id: <20180515075859.17217-18-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-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 271192273953..e8e00d0650e9 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; }