Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp770681imd; Thu, 1 Nov 2018 05:27:18 -0700 (PDT) X-Google-Smtp-Source: AJdET5dgAC3HA1mxDyIvQlB+ifkevwDFiqpt0OHERulovSAqKadnh0+ID/nfH2YnY0rVQ7Rea674 X-Received: by 2002:a63:eb42:: with SMTP id b2-v6mr6958228pgk.348.1541075238875; Thu, 01 Nov 2018 05:27:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541075238; cv=none; d=google.com; s=arc-20160816; b=oHrYBzv12M/SB+BUmAGgr3G8Pg68bKx4AXCUzGTdu3Svot7yStjqaeAmnYNCTGvq13 MqEMwIo/3J2+mnK56Dp+M0CDf0fHRHktloBsiL4JwLoPxDPFVN6CgUP90dWpwCnfxbuO 90qEGYrGUMyGhTVcIoVZhON2e08+01XJjInpz+08EBz1Ipt9jqYZecG74rs6WfFwSiWD NjISPiHsCnZyX4Gh4IZodwvwzEEEENP86P/qVPSqYZtW49XhY3hQiiN9sDCiz43G6tTP s6N0RFVnG+he2J6PgsJodgZtJqVuOlKcPV44RzK1hHmGFV+YFA3hND/8PziCpp0AqXEr Bdeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=CTnJxPL0PmaKBKcPNalFpcZuplKKdFOISJjI++bsBjk=; b=o5GxmSsW5z1b8BmrQ2AWLWkDUmQNwcEdUwCyLs02CV+VIY0KqKHfmQd8933ZfAuRl8 t6sPDi75oGjlbNJl+NLv7Wzs1vuSIKJrKvgYCgBjwSRmzGPg8cAq+a0eQNYLFDGiM6Gd WXGD4kVE0k6mq4rgvnK9f/CqVqpy53ag44bF5rTKKFdMo0PSRAMO+GJPB1ICubIwAwF9 4bg6U8dBPWY6QXbxwadtgkQ/cfSAlEgleu6rAghIaYQIWUnaOG9I4si0oY/XgYSiXnzc QKXh0lNfOqXgS8UmmmRRFqP1V06F4DDz3PE+DU4AhJUEn0fnwFjU0wRA4SIXg3x0zuXz MPWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=guncIxh8; 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 e93-v6si31379881plk.208.2018.11.01.05.27.00; Thu, 01 Nov 2018 05:27:18 -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=@linaro.org header.s=google header.b=guncIxh8; 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 S1728553AbeKAV2v (ORCPT + 99 others); Thu, 1 Nov 2018 17:28:51 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:56006 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728506AbeKAV2u (ORCPT ); Thu, 1 Nov 2018 17:28:50 -0400 Received: by mail-wm1-f68.google.com with SMTP id s10-v6so1229046wmc.5 for ; Thu, 01 Nov 2018 05:26:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=CTnJxPL0PmaKBKcPNalFpcZuplKKdFOISJjI++bsBjk=; b=guncIxh8y4z9gPZXvax0M0oqcIuISyM/sQ2cHN5JJ90qpycimIOw6bZSnmnjZHGURo V2HGJBJJsnNTVTwzjzXxUgv7h1MJGrSNTqrvdmMcoO35kVlFmSeTqSuKeISO4jcqXbMH ILn/aMs/5FfxY/6EfdRKcQIlnxpVdqeuyj7lE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=CTnJxPL0PmaKBKcPNalFpcZuplKKdFOISJjI++bsBjk=; b=feAGKyMGHnBT0FsQwIOryhQU9PNBgl3t4yk1qAHdRf4Ms72AJg1tFvuJZ1ZuLXtCUm nTADAJaOx93qVGqCJtjt8fE2kAtVJTsa3075xzLrnNfW9dOJzvQlfwTbDCBvs+thCp+w JWMGTidnot1YySO3PL2EQCl/KCTAt8FBmNRmZ3ocCRzfUre6P9OSRYb35DcfEgcVIbYn PRDW0KQhKEpT0Qe6O8cLAJsjX6X5KiYVvpk+vQnSBK9wYZv9vWyWkACOJwPMt8zH+16q VYB4+k5kYYY1KL0qPLynd8LkmrIc71vITVRS9x2a8klvBgD2w/MgdAC+gOaMh0eeKg6d Fp0Q== X-Gm-Message-State: AGRZ1gIRISSw14gCcTknPaLyR059B85ziJMKp25sGfq27DTwAkvspjjo Uof25aqJtThq82kgBn35pHYqyg== X-Received: by 2002:a1c:1f4c:: with SMTP id f73-v6mr2279362wmf.56.1541075163570; Thu, 01 Nov 2018 05:26:03 -0700 (PDT) Received: from [192.168.27.209] ([37.157.136.206]) by smtp.googlemail.com with ESMTPSA id v8-v6sm5593912wrr.41.2018.11.01.05.26.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Nov 2018 05:26:02 -0700 (PDT) Subject: Re: [PATCH] media: venus: queue initial buffers To: mgottam@codeaurora.org, 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 References: <1539071426-1282-1-git-send-email-mgottam@codeaurora.org> <7960b369-3bb3-529b-c06c-26ea4de821c8@linaro.org> <7ab8c5ef795b774ad684e5b941e0d346@codeaurora.org> From: Stanimir Varbanov Message-ID: <6e3189ad-4dfa-0694-1dd3-3d81f396b664@linaro.org> Date: Thu, 1 Nov 2018 14:26:01 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <7ab8c5ef795b774ad684e5b941e0d346@codeaurora.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 10/20/18 10:50 AM, mgottam@codeaurora.org wrote: > 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. Sorry, I didn't look deeply into playback sequence patches yet, but looks like we have to fix them first. So please drop this patch. -- regards, Stan