From patchwork Tue Apr 24 12:44:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 134088 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp2191642lji; Tue, 24 Apr 2018 05:46:43 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+jPma5Vxw45r3m2+FcH8z1avsWxrVn2ObaqEyhm313ynCxKz+ZCd5hzLliWTjzWfZ7fdfF X-Received: by 10.99.61.202 with SMTP id k193mr20036611pga.435.1524574003745; Tue, 24 Apr 2018 05:46:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524574003; cv=none; d=google.com; s=arc-20160816; b=KFEqCvP3kRIG8o+8WhJh4/NAnsJxGfWfuwXBkQQIFU+MOw0OvFUJb2OZtDObmG719+ Z2Oem/Thmdv7O+ebb5zQDTggYY/Ds50s2am9vrsyL5wtj2l6N887mC0Vz0jOC5zpx/f2 YvDbzclxqdycW2CA4bRcQetXKFW66dG9eE9wSHBH03mAYcLO3rxilG58id7qAFrRzfFc riFbOfXeBtls3hw2bakZ55mKVR5JH+8N14xPMeRjb/kGAFTOXgSE35/9JO4ITtY4qqTu O8GjH4a8TqSaZEMsNc7poo3Ojs0c/a/mQUWlXhlkiGly/bJfQ1nzomb4MfuR0LJ9N5/z MUjw== 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=9Pr8WBhrEA3dnaaguJR719cM0+aVZOGHzMYtHN4i9fs=; b=q86xNW9pDcXrXsRQBqI5G6SabNl+akr2k0K7WmctOE6RDlYpMr2g3OZeCZ46EvoQOT Hu2ORaJ2ElBmbiTFa4S/KNAOMmspvoXZbZwFzXYE4kFHDVWlZQQltzN0Lex1ZsMT1R9V +C+gS5kPyt+3ewS2ZX4uYr4X0KOsB6smWWPmsbjLBGVURuNTVB/ITuOo3fVmecdbpWYz a4jO6yNAd28b0cdrKuB6XzeyFKHDP5z8EcNW+IFd0jaWP0B3F8djTdrtEtHa9QEGuTva ERYN88Hs7YBiYxjGtiXuTAxl9m0ri2KTlV5AxVQL8kxpqVQsw6bCKzpjBWwogo4XLW6r WXmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=EtN1Z8TK; 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 c11-v6si13560927pls.97.2018.04.24.05.46.43; Tue, 24 Apr 2018 05:46:43 -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=EtN1Z8TK; 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 S933097AbeDXMqk (ORCPT + 12 others); Tue, 24 Apr 2018 08:46:40 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:51012 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757866AbeDXMpc (ORCPT ); Tue, 24 Apr 2018 08:45:32 -0400 Received: by mail-wm0-f68.google.com with SMTP id t67so691440wmt.0 for ; Tue, 24 Apr 2018 05:45:31 -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=hWZfGvfu/2NalLUr9US+fWfp5Cl3dsxLRK8jVW0R1to=; b=EtN1Z8TKyt8sakREnupB4xNELFwZtCs0JpwbkA+inaY5sBT0p1TL2C1+64rK4+ijDm jZiQV0B3MEaeV9rEg+SiL4DSyVk3DaU8cAe2h48921tutCsYZBGhb2HHLFLKIyHoBDHt lVP2zcLg2aAxXMy2/pEM/mhxXUv421zolW7vA= 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=hWZfGvfu/2NalLUr9US+fWfp5Cl3dsxLRK8jVW0R1to=; b=Z86T7rgKfCneqRVd7V/stE22jMB1h9loiEkOtO+zJ3tbEedr8c3oedQ/hW782qwnXC CIWNPyx/VrJD3cLVFiKtel3niLfIqlenHFgvx8JRUuwXqTL2sqmwsNoOgnazIEBOc7++ lZs9JgRKTwpA4FGNLWgvrTYZvyzQFJoKVeY2BqBytBDUeX5In+eWLGWHrC9TvaNUicBa Zo2gEVc6IpPc1lJ2UBom0/hDE6EpXiiMYdQFeFCB5LVBMtwE9jCxdAmVqOCxlx7F6rSh VYK7v0jL8nIt7dtM9M4Y4e2+Zr5+c9JQzmJnfW8jvEMTgvwahWrAmecRnTDq9B2pcVVd Kh9Q== X-Gm-Message-State: ALQs6tBKyPF5qXTvdmJG5WcpUBLneW8Jmhz1DAcxmvA9UICf5yfV9+8O go/4CViLLIBuvV57IAEDVKCdrA== X-Received: by 10.28.111.7 with SMTP id k7mr12038928wmc.148.1524573930767; Tue, 24 Apr 2018 05:45:30 -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.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Apr 2018 05:45:30 -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 22/28] venus: helpers: add a helper to return opb buffer sizes Date: Tue, 24 Apr 2018 15:44:30 +0300 Message-Id: <20180424124436.26955-23-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 a helper function to return current output picture buffer size. OPB sizes can vary depending on the selected decoder output(s). Signed-off-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/core.h | 10 ++++++++++ drivers/media/platform/qcom/venus/helpers.c | 15 +++++++++++++++ drivers/media/platform/qcom/venus/helpers.h | 1 + 3 files changed, 26 insertions(+) -- 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/core.h b/drivers/media/platform/qcom/venus/core.h index 255292899204..4d6c05f156c4 100644 --- a/drivers/media/platform/qcom/venus/core.h +++ b/drivers/media/platform/qcom/venus/core.h @@ -234,6 +234,11 @@ struct venus_buffer { * @num_output_bufs: holds number of output buffers * @input_buf_size holds input buffer size * @output_buf_size: holds output buffer size + * @output2_buf_size: holds secondary decoder output buffer size + * @dpb_buftype: decoded picture buffer type + * @dpb_fmt: decodec picture buffre raw format + * @opb_buftype: output picture buffer type + * @opb_fmt: output picture buffer raw format * @reconfig: a flag raised by decoder when the stream resolution changed * @reconfig_width: holds the new width * @reconfig_height: holds the new height @@ -282,6 +287,11 @@ struct venus_inst { unsigned int num_output_bufs; unsigned int input_buf_size; unsigned int output_buf_size; + unsigned int output2_buf_size; + u32 dpb_buftype; + u32 dpb_fmt; + u32 opb_buftype; + u32 opb_fmt; bool reconfig; u32 reconfig_width; u32 reconfig_height; diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c index f04d16953b3a..f0a0fca60c76 100644 --- a/drivers/media/platform/qcom/venus/helpers.c +++ b/drivers/media/platform/qcom/venus/helpers.c @@ -611,6 +611,21 @@ int venus_helper_set_bufsize(struct venus_inst *inst, u32 bufsize, u32 buftype) } EXPORT_SYMBOL_GPL(venus_helper_set_bufsize); +unsigned int venus_helper_get_opb_size(struct venus_inst *inst) +{ + /* the encoder has only one output */ + if (inst->session_type == VIDC_SESSION_TYPE_ENC) + return inst->output_buf_size; + + if (inst->opb_buftype == HFI_BUFFER_OUTPUT) + return inst->output_buf_size; + else if (inst->opb_buftype == HFI_BUFFER_OUTPUT2) + return inst->output2_buf_size; + + return 0; +} +EXPORT_SYMBOL_GPL(venus_helper_get_opb_size); + 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 8ff4bd3ef958..92be45894a69 100644 --- a/drivers/media/platform/qcom/venus/helpers.h +++ b/drivers/media/platform/qcom/venus/helpers.h @@ -48,6 +48,7 @@ int venus_helper_set_raw_format(struct venus_inst *inst, u32 hfi_format, 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); +unsigned int venus_helper_get_opb_size(struct venus_inst *inst); 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);