Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp4545125imm; Tue, 9 Oct 2018 01:00:49 -0700 (PDT) X-Google-Smtp-Source: ACcGV61FfJIe4PzSQktc1eyu4lJPWQTHyGF2UspOg3dgcb2T9C7lTV9AyJa8oax7s3QkUhf7H5L3 X-Received: by 2002:a62:1ccb:: with SMTP id c194-v6mr28576772pfc.203.1539072049681; Tue, 09 Oct 2018 01:00:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539072049; cv=none; d=google.com; s=arc-20160816; b=RlQVuL431k23uB6MaatNBGJwQfBMlpNg6B18Wtu4UMi5sZf3m7gMk8K1r5+Di7kmcU lnoG7/dMEvviS7Ux5Eqsufk+FzczXsrm8j6IN0HRWlv790TmIJbk7XyW8R7ivsDU89Nd MriexkYU4WCYeN9hExHS2BXISlaoFTlYFbiN7/jvF18kQZqjko9PkOj7xVNrV41H654j i3//5/ib1BB0m3qXmAfAw1wtR+TQKTy819d0egfR5WROo6Wxo2z9ERQPagX7chMhM/6z C/1J3YkAh55tLy/R2Ad7SgH2kJh2ZcA91o7gXhdXovJGsHp46YPTmcGCD+AiA1LOU9ep Qaiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=GTqrRyYBmIrROxT1IwcE3A2STXmIeY22nu0EoukNBIo=; b=RA5a+EYTDoJ9F9riYvXUkHriQ5UdyoNZsWC8UTJRPAb4qcJu7wW7uSx4TUrZmJWtsr faC82tJTJjVQCZYkERZQvzE9frbx+N3pjk8a/t6L2j1Xfm1lX+Jfnor94lwd12zOqLTQ epMmh5M9qjT6hFvVJQOjjaPdsB+6lJj1v5rr6R1uBStdJvOQDaWRdTkHVFZiDSywDoEZ r/rH3rGBblhoq2P3PXxK8b4Tvl9RUstW4Q0+zDqj6TMs0qjF/kkjrSICazoHNNtybZ1u Lphi3Q1H1sknoOTJqBN8P9N4gd4Jc+YtN3w0xAUDLWB90IOC3Lg7c99RdqLop81yI4Ze k3EA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v4-v6si20783517plb.400.2018.10.09.01.00.34; Tue, 09 Oct 2018 01:00:49 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726892AbeJIPPZ (ORCPT + 99 others); Tue, 9 Oct 2018 11:15:25 -0400 Received: from alexa-out-blr-01.qualcomm.com ([103.229.18.197]:33323 "EHLO alexa-out-blr-01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725855AbeJIPPZ (ORCPT ); Tue, 9 Oct 2018 11:15:25 -0400 X-IronPort-AV: E=Sophos;i="5.54,359,1534789800"; d="scan'208";a="240318" Received: from ironmsg03-blr.qualcomm.com ([10.86.208.132]) by alexa-out-blr-01.qualcomm.com with ESMTP/TLS/AES256-SHA; 09 Oct 2018 13:20:32 +0530 X-IronPort-AV: E=McAfee;i="5900,7806,9040"; a="1605164" Received: from mgottam-linux.qualcomm.com ([10.204.66.66]) by ironmsg03-blr.qualcomm.com with ESMTP; 09 Oct 2018 13:20:30 +0530 Received: by mgottam-linux.qualcomm.com (Postfix, from userid 2305155) id 5800B2E3B; Tue, 9 Oct 2018 13:20:29 +0530 (IST) From: Malathi Gottam To: stanimir.varbanov@linaro.org, hverkuil@xs4all.nl, mchehab@kernel.org Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, acourbot@chromium.org, vgarodia@codeaurora.org, mgottam@codeaurora.org Subject: [PATCH] media: venus: queue initial buffers Date: Tue, 9 Oct 2018 13:20:26 +0530 Message-Id: <1539071426-1282-1-git-send-email-mgottam@codeaurora.org> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Buffers can be queued to driver before the planes are set to start streaming. Queue those buffers to firmware once start streaming is called on both the planes. Signed-off-by: Malathi Gottam --- drivers/media/platform/qcom/venus/helpers.c | 22 ++++++++++++++++++++++ drivers/media/platform/qcom/venus/helpers.h | 1 + drivers/media/platform/qcom/venus/venc.c | 5 +++++ 3 files changed, 28 insertions(+) diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c index e436385..2679adb 100644 --- a/drivers/media/platform/qcom/venus/helpers.c +++ b/drivers/media/platform/qcom/venus/helpers.c @@ -1041,6 +1041,28 @@ void venus_helper_vb2_stop_streaming(struct vb2_queue *q) } EXPORT_SYMBOL_GPL(venus_helper_vb2_stop_streaming); +int venus_helper_queue_initial_bufs(struct venus_inst *inst) +{ + struct v4l2_m2m_ctx *m2m_ctx = inst->m2m_ctx; + struct v4l2_m2m_buffer *buf, *n; + int ret; + + v4l2_m2m_for_each_dst_buf_safe(m2m_ctx, buf, n) { + ret = session_process_buf(inst, &buf->vb); + if (ret) + return_buf_error(inst, &buf->vb); + } + + v4l2_m2m_for_each_src_buf_safe(m2m_ctx, buf, n) { + ret = session_process_buf(inst, &buf->vb); + if (ret) + return_buf_error(inst, &buf->vb); + } + + return 0; +} +EXPORT_SYMBOL(venus_helper_queue_initial_bufs); + int venus_helper_vb2_start_streaming(struct venus_inst *inst) { struct venus_core *core = inst->core; diff --git a/drivers/media/platform/qcom/venus/helpers.h b/drivers/media/platform/qcom/venus/helpers.h index 2475f284..f4d76ab 100644 --- a/drivers/media/platform/qcom/venus/helpers.h +++ b/drivers/media/platform/qcom/venus/helpers.h @@ -31,6 +31,7 @@ void venus_helper_buffers_done(struct venus_inst *inst, int venus_helper_vb2_start_streaming(struct venus_inst *inst); void venus_helper_m2m_device_run(void *priv); void venus_helper_m2m_job_abort(void *priv); +int venus_helper_queue_initial_bufs(struct venus_inst *inst); int venus_helper_get_bufreq(struct venus_inst *inst, u32 type, struct hfi_buffer_requirements *req); u32 venus_helper_get_framesz_raw(u32 hfi_fmt, u32 width, u32 height); diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c index ce85962..ef11495 100644 --- a/drivers/media/platform/qcom/venus/venc.c +++ b/drivers/media/platform/qcom/venus/venc.c @@ -989,6 +989,11 @@ static int venc_start_streaming(struct vb2_queue *q, unsigned int count) if (ret) goto deinit_sess; + ret = venus_helper_queue_initial_bufs(inst); + if (ret) + goto deinit_sess; + } + mutex_unlock(&inst->lock); return 0; -- 1.9.1