Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2100533imu; Thu, 17 Jan 2019 08:23:28 -0800 (PST) X-Google-Smtp-Source: ALg8bN47z7yuTspZJQcmg5U9reT527bQO8KmIwU8jrMna4MHxLzmaOSDbJoC71VBCO93/+NRySEQ X-Received: by 2002:a17:902:8641:: with SMTP id y1mr15546599plt.159.1547742208589; Thu, 17 Jan 2019 08:23:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547742208; cv=none; d=google.com; s=arc-20160816; b=L55vRTgeB+CM5fKmJdqm2wcLHtw0QpBUZVzyWDBZ8N2AEUDYdOsQm8VkbYdrsMNAPI l5Rx9W0cTEYopll5MmIP2nnj/PNE2R1j7d6NA2y1JiwY2R+62IeVmTWlHpDFDxdpKKpv cs2Q85CvpztWEV+KAF9kKQ8jRoPTIFet53NrmBMPEb52UT27YII7Rq7gfypDdePMnFtq KPdIGOXKSLstYE7Rd7cJoo0q7niZVStGfZk/c0DKlIPoeYDbdE3Zln1fqO3CCzEQz7yd Ung1tmLTk8jN/D3vqGADUcBRcPwWb9AWfBwEwNRWY0iOgYtx8UfIpstwM+R+JN1S59gT 9HAw== 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; bh=SNb+6XKLjhFXr1Fd19oZUt5CC0wXzn1Vgn9kxNRJIs0=; b=LdrGNAqN1Oagku02FMVzoU4ApyLbnkUPpCgNF8zc5mjYs/Q5j1woHbztLExZuN9prl IuFic6zNCzQDg673lKe4wWHwiwxO4RRtnc0LJ+X5/GlRwH0JnKF2x4nYKEOS52fSesA6 rAM1GjV//3ExP3j3F1h/FduRZ8fttUVvjxE7lUooj7h2wkH/lIiez8nM5plOR7T6LKvO Tx4EWiY1Im73hQzmsB/TxaWqS98iopg9JJk/3dv+gdf7A+V1L/YYTQEsD+Ln7W+ZoLo4 wc0WXJV/Kq1qfXEBVi87asPM+KtYdf1hVwERH34jMaIGGM5XlQ+r9TX4GUt3PD3FmaAu wp6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gSQu0bn7; 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 f95si2220976plb.60.2019.01.17.08.23.13; Thu, 17 Jan 2019 08:23:28 -0800 (PST) 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=gSQu0bn7; 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 S1729276AbfAQQVg (ORCPT + 99 others); Thu, 17 Jan 2019 11:21:36 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:39905 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729108AbfAQQVM (ORCPT ); Thu, 17 Jan 2019 11:21:12 -0500 Received: by mail-wr1-f66.google.com with SMTP id t27so11687559wra.6 for ; Thu, 17 Jan 2019 08:21:11 -0800 (PST) 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=SNb+6XKLjhFXr1Fd19oZUt5CC0wXzn1Vgn9kxNRJIs0=; b=gSQu0bn7+O02Yk6QIAPNDwgLFN9/1QiHD7Y7r9xiwfiK2A8k6xb2SBc3Ut5JWrx3Bl p/ZdugOLdtFScafh51vgS+65J/yoxM64/2HBwL6fmXbJBxCpWlYWKIW1V1zN8s0r/JbI XckqEWMvXNs6n7Zx5LE0LUDxztKeZWJ+SHmD4= 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=SNb+6XKLjhFXr1Fd19oZUt5CC0wXzn1Vgn9kxNRJIs0=; b=IhGIewVKNw/5tasm2yOhBbUGZbPvOq+abeyJ13QG8JlQ7XWdoIOhVakaJeffC7ekVd nMv93NmV+HNx2A5n/QYxgdYR44dfI18peWETopTNmSTR5EKgtZP0nrPv3kC0+rwoqjsi EIXbLhT4QVaXm0h8QN2ZnTaFiOs7I8TVkwUFydG9xV+UAq/sYZ+2DBiMSKXevq8T+Bub XFu07usibEfmxwPtHq4Dr8KrfXnGk3PPm+JLMi2jQ2bw/eoudz1dHv141XwQuWhdafHv ESdpcPmcwEywSQ2xIxpwrC+vMQ8gZiUUXZQbwhinc7oWT3r+XvgmCeQ6IKdgqi3GHgBl g98A== X-Gm-Message-State: AJcUukeCqt5261pNVFu9+QJrLv4Ystl8jngW4t3r8XhgcO9boAL53jdC d+8MdehqAbozXFR+8fvrTO8pa6/3muQ= X-Received: by 2002:adf:b6a1:: with SMTP id j33mr12641852wre.55.1547742071200; Thu, 17 Jan 2019 08:21:11 -0800 (PST) Received: from localhost.localdomain ([37.157.136.206]) by smtp.gmail.com with ESMTPSA id v133sm31124734wmf.19.2019.01.17.08.21.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Jan 2019 08:21:10 -0800 (PST) From: Stanimir Varbanov To: linux-media@vger.kernel.org Cc: Mauro Carvalho Chehab , Hans Verkuil , linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Vikash Garodia , Tomasz Figa , Alexandre Courbot , Malathi Gottam , Stanimir Varbanov Subject: [PATCH 08/10] venus: vdec_ctrls: get real minimum buffers for capture Date: Thu, 17 Jan 2019 18:20:06 +0200 Message-Id: <20190117162008.25217-9-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190117162008.25217-1-stanimir.varbanov@linaro.org> References: <20190117162008.25217-1-stanimir.varbanov@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Until now we returned num_output_bufs set during reqbuf but that could be wrong when we implement stateful Codec API. So get the minimum buffers for capture from HFI. This is supposed to be called after stream header parsing, i.e. after dequeue v4l2 event for change resolution. Signed-off-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/vdec_ctrls.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/vdec_ctrls.c b/drivers/media/platform/qcom/venus/vdec_ctrls.c index f4604b0cd57e..e1da87bf52bc 100644 --- a/drivers/media/platform/qcom/venus/vdec_ctrls.c +++ b/drivers/media/platform/qcom/venus/vdec_ctrls.c @@ -16,6 +16,7 @@ #include #include "core.h" +#include "helpers.h" #include "vdec.h" static int vdec_op_s_ctrl(struct v4l2_ctrl *ctrl) @@ -47,7 +48,9 @@ static int vdec_op_g_volatile_ctrl(struct v4l2_ctrl *ctrl) { struct venus_inst *inst = ctrl_to_inst(ctrl); struct vdec_controls *ctr = &inst->controls.dec; + struct hfi_buffer_requirements bufreq; union hfi_get_property hprop; + enum hfi_version ver = inst->core->res->hfi_version; u32 ptype = HFI_PROPERTY_PARAM_PROFILE_LEVEL_CURRENT; int ret; @@ -71,7 +74,9 @@ static int vdec_op_g_volatile_ctrl(struct v4l2_ctrl *ctrl) ctrl->val = ctr->post_loop_deb_mode; break; case V4L2_CID_MIN_BUFFERS_FOR_CAPTURE: - ctrl->val = inst->num_output_bufs; + ret = venus_helper_get_bufreq(inst, HFI_BUFFER_OUTPUT, &bufreq); + if (!ret) + ctrl->val = HFI_BUFREQ_COUNT_MIN(&bufreq, ver); break; default: return -EINVAL; -- 2.17.1