Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp329585imm; Sat, 20 Oct 2018 00:51:22 -0700 (PDT) X-Google-Smtp-Source: ACcGV62eGU3KD3TgsDaPuo19h3va2u9pJjApUIPSp5Vt6pJxtzU2Rxa8W4VhAOURgozoJcM4D6Op X-Received: by 2002:a17:902:2808:: with SMTP id e8-v6mr36102280plb.327.1540021882477; Sat, 20 Oct 2018 00:51:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540021882; cv=none; d=google.com; s=arc-20160816; b=yq7kM89EM7dYW6ZVvRrHeWVDQt2SZkJsG15b2ACauXOdQCKSOKa/NhaRzPBg/joAKw 8+5yQefokU9LIyfuuQ+CNhr+lhoYGvwicWecaowIednio12z/d2xh6PUTdgVGcbFM8NT 1Nyo+AF0iyoXapjzEaUuSQUE06ZrCMNfJpgg8ngqAgE7Be7izX/nzWOat1xv6vNn0D4O Xl8VhqqlYC0/a8JZv27vXvQgzfmuvku6ntYFP0AQ8IrflMudJkb2WET8iVJU3yqB0x7m N5dPKVUSJo+tYhDS2XCLhBb5LbliALcENcBoMQMMv+npgGu4elAWAzRpgPcqzHbrHes/ cRUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature:dkim-signature; bh=cOSVJz6RizbORKMuCvAQcpJ+NEsz2i1gzQG6Hs2eAP0=; b=OV6xnUw8SMZ4nsyyOK6akOEB1mMvmmUcwQT++zEoNBLpuVzmUbcAjGVssfS/ToQbID UxJJtdKhjgK7DE8d1erroaXqvDo+Nwu6MGWB6d+S0bXCapgGNUH0IURPhnGANsUn9iKW G9v/teJiDY9OVYjyqifQ6Yb1yLIdgFjPBtls17LRyT1ViXXlsbt1D8RV1RnaDWsj2rze M/VCtQlPoStiSK/LfFjrJSVdSNoImdDCRbFQnv4N8zDZHey3g8bUYIQPHc56667ht2va CSrtzdlCEcvK4erNHouXrCvF3ckC9tNMX+lhJQaabXK4u6cwqliDm4/sSIMvPrJ4ajxJ AeRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=PFsUVkJg; dkim=pass header.i=@codeaurora.org header.s=default header.b=N17ZaNvz; 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 w20-v6si26059853plp.260.2018.10.20.00.51.03; Sat, 20 Oct 2018 00:51:22 -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; dkim=pass header.i=@codeaurora.org header.s=default header.b=PFsUVkJg; dkim=pass header.i=@codeaurora.org header.s=default header.b=N17ZaNvz; 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 S1727129AbeJTQAN (ORCPT + 99 others); Sat, 20 Oct 2018 12:00:13 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:59074 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726642AbeJTQAM (ORCPT ); Sat, 20 Oct 2018 12:00:12 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 074E76086B; Sat, 20 Oct 2018 07:50:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1540021841; bh=y/xi5mbJcIbx5q3iSyfa6FLfxbWRfOscOFbMXeMp0Wc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=PFsUVkJgr5vbXZIVAoOi8pemnZJvwHBGFuZvuDghoIk2jj7jnwXJHKZ31sLJY+jTf W6meNFzQntuyTsdkX0rVd0ITplcvMdX2w9+jfr5p5LmxrXbZDBlJlwsrVR77MMO5Jo rK7ayYy5zxI/NackFyIzM+tlBgR4l96BMVkIIrHw= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_INVALID,DKIM_SIGNED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id 184DF60227; Sat, 20 Oct 2018 07:50:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1540021840; bh=y/xi5mbJcIbx5q3iSyfa6FLfxbWRfOscOFbMXeMp0Wc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=N17ZaNvzUWuoJaLJHEjb/7dMCBd6gu2Qajh07Hgk1RPiTCapuxXmvxrLFdMTNGIIH hmncL+c9SJFscX5TisAuGvoohpmJ55Y9fO7zEFKdGjfJnxWxsSx6m4QJu3PBmmRaLZ F4w7teDtk76M1Wz0oqH0kNGJ3CYaw7vBzJ3FgBeQ= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Sat, 20 Oct 2018 13:20:40 +0530 From: mgottam@codeaurora.org To: Stanimir Varbanov Cc: hverkuil@xs4all.nl, mchehab@kernel.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, acourbot@chromium.org, vgarodia@codeaurora.org Subject: Re: [PATCH] media: venus: queue initial buffers In-Reply-To: <7960b369-3bb3-529b-c06c-26ea4de821c8@linaro.org> References: <1539071426-1282-1-git-send-email-mgottam@codeaurora.org> <7960b369-3bb3-529b-c06c-26ea4de821c8@linaro.org> Message-ID: <7ab8c5ef795b774ad684e5b941e0d346@codeaurora.org> X-Sender: mgottam@codeaurora.org User-Agent: Roundcube Webmail/1.2.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-10-09 20:47, Stanimir Varbanov wrote: > Hi Malathi, > > On 10/09/2018 10:50 AM, Malathi Gottam wrote: >> 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. > > yes and this is done in venus_helper_m2m_device_run mem2mem operation > when streamon on both queues is called, thus below function just > duplicates .device_run. > > Do you fix an issue with that patch? > >> >> 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; >> Hi Stan, As I considered playback sequence as well, this function "venus_helper_m2m_device_run" was muted as a part of it. So I had to explicitly implement this function for encoder. For now, we can omit this patch. Once the playback sequence gets merged into upstream, we can re-look into this.