Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3798315imm; Mon, 2 Jul 2018 05:54:26 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLJqHcg81Vb0BUiGYkmAlnCXpQO/ad/B7YwziYVhIYgaQ6A9sumksPJmDVQqXPviPN8RQnr X-Received: by 2002:a17:902:8497:: with SMTP id c23-v6mr26405787plo.124.1530536066833; Mon, 02 Jul 2018 05:54:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530536066; cv=none; d=google.com; s=arc-20160816; b=Uq45DYhh/bezPq6l/pQBgZrNrWz7Ra51x9hWyOc1IBOa0cr5ML1wBPw70NqjXwvIRs FLjPb1kMfPCSzRhaX98dDrWVYdBST37HtxcpZetsiC8t1q7O/6IHw2aWf4Aifo9nWb3m sgIYMgwznLusAnzp5F7bYQ73YCI8SH6rAACZg8PzC5KipAs3Qp6Us9NN6LO8Jc4AnQ4y fYhlJNa6qtBQC8G+tALChDX6X2XBP2KtlrArMHcTz8WbCyc3aT2aNgwcw971aGWsuZYD zEwyiKKF7LYREFNhec2i0bMvOlNYX0PgAGhnDXvuuv3rcqK2cvr3LNSoHdK3X6a9y8f2 F6lA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=MVsneobB1lxMJvVArWZrZDl8K1tFgDtXE39PLGNJqfo=; b=sfD969UKLgToq/np5C3nI8kRsNBuxivNml6bdJdSV4hSZcYfTmZBwpsT793fNSYIgM qdJphvqJDU8LRgaML96nVYxcIJxFCBKnJrjn+pVLQeiiZLLOxJaH7BWUIrCKBJmLgsmX k6wy4UghMydOgVInBSPNXoBX+RY+elBWsEEEphurs1Gr3cSl467vKY/am4hQhCwbL88s ryxDtuhTCwXjwfQkPHvzXVjNc/jpOhrWv9+uVeB+syfR/ewTve1GaDm8ogi/wPP4x88Q Q1E6rnhQdLsIiDmgggqGQNk/jzuvRCgHhuzxR52UGqnntCqNGg/RwPhZC+CdcmrqYMcc W4cQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=V2mgs3Mf; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 4-v6si4217517pgn.90.2018.07.02.05.54.12; Mon, 02 Jul 2018 05:54:26 -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=@chromium.org header.s=google header.b=V2mgs3Mf; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752451AbeGBMwt (ORCPT + 99 others); Mon, 2 Jul 2018 08:52:49 -0400 Received: from mail-yb0-f195.google.com ([209.85.213.195]:36041 "EHLO mail-yb0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752055AbeGBMwr (ORCPT ); Mon, 2 Jul 2018 08:52:47 -0400 Received: by mail-yb0-f195.google.com with SMTP id s1-v6so5054256ybk.3 for ; Mon, 02 Jul 2018 05:52:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=MVsneobB1lxMJvVArWZrZDl8K1tFgDtXE39PLGNJqfo=; b=V2mgs3Mf/SKRfvUNgHDNE6yFqw4YigWKTu8h0eJsiQPf56LcGyYQoBqFZ97TIB0Zx+ IDZt+/33dQGjEWmbIir0K1dS1tuQ1DbzWEZY3ZufhKgVIbvIAztgajb6mOxrDvcplf/I 1EMoJH7br79PHMENfhD1Dd/h5okWo6kfsy33M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=MVsneobB1lxMJvVArWZrZDl8K1tFgDtXE39PLGNJqfo=; b=uIIsYqoib9IeP+gsENmr0rhEkSKhw9lhSzX26dlIF8zS1KL2APrMpzglW1tbZjyVl3 oGHpTHXJLdK/XpGAuZ8pvSmT5rZFkkfKCH1Enm2BfLCn5FPI7UkoC1pK3moe9o257yxH BCX0IBq2jX2uXFb0bA/O/ucOPjJOhIAINteX5NxGItOcFKS9mNm2pzssSaZCNa6v6UNZ MrTyuvPMVDtfOrP9XxBQGQuZRPubPN0QAFxvT/CeLrjwUUMNjHedtn93mG0RIpjfMvtQ jATFM+8EYU4LBqitUglbIcnaIhaiuke5TP7Q7l2zPyP+Uj36EnIGnBY2FjipbUj1yz9c GAHA== X-Gm-Message-State: APt69E3AaTV6zbjkKk4HAMB6J+szKf8ZPRZYolJoo6rpoRijTT7MikFm PjbemfF2o12e3xsxvhc32joFDJmWEuw= X-Received: by 2002:a25:9d92:: with SMTP id v18-v6mr13448029ybp.363.1530535966993; Mon, 02 Jul 2018 05:52:46 -0700 (PDT) Received: from mail-yw0-f170.google.com (mail-yw0-f170.google.com. [209.85.161.170]) by smtp.gmail.com with ESMTPSA id p134-v6sm618811ywe.30.2018.07.02.05.52.45 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Jul 2018 05:52:46 -0700 (PDT) Received: by mail-yw0-f170.google.com with SMTP id 81-v6so6620834ywb.6 for ; Mon, 02 Jul 2018 05:52:45 -0700 (PDT) X-Received: by 2002:a0d:ddc8:: with SMTP id g191-v6mr6103477ywe.145.1530535965420; Mon, 02 Jul 2018 05:52:45 -0700 (PDT) MIME-Version: 1.0 References: <20180515075859.17217-1-stanimir.varbanov@linaro.org> <20180515075859.17217-28-stanimir.varbanov@linaro.org> <394e5547-9b85-604f-ee9e-fdb5ea2f4237@linaro.org> In-Reply-To: <394e5547-9b85-604f-ee9e-fdb5ea2f4237@linaro.org> From: Tomasz Figa Date: Mon, 2 Jul 2018 21:52:33 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 27/29] venus: implementing multi-stream support To: Stanimir Varbanov Cc: Mauro Carvalho Chehab , Hans Verkuil , Linux Media Mailing List , Linux Kernel Mailing List , linux-arm-msm , vgarodia@codeaurora.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 2, 2018 at 9:43 PM Stanimir Varbanov wrote: > > Hi Tomasz, > > On 05/31/2018 12:51 PM, Tomasz Figa wrote: > > On Tue, May 15, 2018 at 5:00 PM Stanimir Varbanov > > wrote: > >> > >> This is implementing a multi-stream decoder support. The multi > >> stream gives an option to use the secondary decoder output > >> with different raw format (or the same in case of crop). > >> > >> Signed-off-by: Stanimir Varbanov > >> --- > >> drivers/media/platform/qcom/venus/core.h | 1 + > >> drivers/media/platform/qcom/venus/helpers.c | 204 +++++++++++++++++++++++++++- > >> drivers/media/platform/qcom/venus/helpers.h | 6 + > >> drivers/media/platform/qcom/venus/vdec.c | 91 ++++++++++++- > >> drivers/media/platform/qcom/venus/venc.c | 1 + > >> 5 files changed, 299 insertions(+), 4 deletions(-) > >> > >> diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h > >> index 4d6c05f156c4..85e66e2dd672 100644 > >> --- a/drivers/media/platform/qcom/venus/core.h > >> +++ b/drivers/media/platform/qcom/venus/core.h > >> @@ -259,6 +259,7 @@ struct venus_inst { > >> struct list_head list; > >> struct mutex lock; > >> struct venus_core *core; > >> + struct list_head dpbbufs; > >> struct list_head internalbufs; > >> struct list_head registeredbufs; > >> struct list_head delayed_process; > >> diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c > >> index ed569705ecac..87dcf9973e6f 100644 > >> --- a/drivers/media/platform/qcom/venus/helpers.c > >> +++ b/drivers/media/platform/qcom/venus/helpers.c > >> @@ -85,6 +85,112 @@ bool venus_helper_check_codec(struct venus_inst *inst, u32 v4l2_pixfmt) > >> } > >> EXPORT_SYMBOL_GPL(venus_helper_check_codec); > >> > >> +static int venus_helper_queue_dpb_bufs(struct venus_inst *inst) > >> +{ > >> + struct intbuf *buf; > >> + int ret = 0; > >> + > >> + if (list_empty(&inst->dpbbufs)) > >> + return 0; > > > > Does this special case give us anything other than few more source lines? > > yes, thanks for spotting, will drop above lines here and below. > > > > >> + > >> + list_for_each_entry(buf, &inst->dpbbufs, list) { > >> + struct hfi_frame_data fdata; > >> + > >> + memset(&fdata, 0, sizeof(fdata)); > >> + fdata.alloc_len = buf->size; > >> + fdata.device_addr = buf->da; > >> + fdata.buffer_type = buf->type; > >> + > >> + ret = hfi_session_process_buf(inst, &fdata); > >> + if (ret) > >> + goto fail; > >> + } > >> + > >> +fail: > >> + return ret; > >> +} > >> + > >> +int venus_helper_free_dpb_bufs(struct venus_inst *inst) > >> +{ > >> + struct intbuf *buf, *n; > >> + > >> + if (list_empty(&inst->dpbbufs)) > >> + return 0; > > > > Ditto. > > > >> + > >> + list_for_each_entry_safe(buf, n, &inst->dpbbufs, list) { > >> + list_del_init(&buf->list); > >> + dma_free_attrs(inst->core->dev, buf->size, buf->va, buf->da, > >> + buf->attrs); > >> + kfree(buf); > >> + } > >> + > >> + INIT_LIST_HEAD(&inst->dpbbufs); > >> + > >> + return 0; > >> +} > >> +EXPORT_SYMBOL_GPL(venus_helper_free_dpb_bufs); > > [snip] > >> +int venus_helper_get_out_fmts(struct venus_inst *inst, u32 v4l2_fmt, > >> + u32 *out_fmt, u32 *out2_fmt, bool ubwc) > >> +{ > >> + struct venus_core *core = inst->core; > >> + struct venus_caps *caps; > >> + u32 ubwc_fmt, fmt = to_hfi_raw_fmt(v4l2_fmt); > >> + bool found, found_ubwc; > >> + > >> + *out_fmt = *out2_fmt = 0; > >> + > >> + if (!fmt) > >> + return -EINVAL; > >> + > >> + caps = venus_caps_by_codec(core, inst->hfi_codec, inst->session_type); > >> + if (!caps) > >> + return -EINVAL; > >> + > >> + if (ubwc) { > >> + ubwc_fmt = fmt | HFI_COLOR_FORMAT_UBWC_BASE; > > > > Does the UBWC base format have to be the same as fmt? Looking at > > HFI_COLOR_FORMAT_* macros, UBWC variants seem to exist only for few > > selected raw formats, for example there is none for NV21. > > I think any raw format can have its UBWC variant. And yes we have only > one macro but we are checking against parsed capabilities from firmware > where the supported formats are stored. Okay, thanks. Best regards, Tomasz