Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp415096imm; Thu, 31 May 2018 02:52:41 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJ4nb85Qhw74yKTNG9F7HX++ZnJOT/Dzx9RfPuPL9HL+QrSzm5hPFnvtKGWW3IQgukoHvIA X-Received: by 2002:a63:3759:: with SMTP id g25-v6mr5100381pgn.59.1527760361781; Thu, 31 May 2018 02:52:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527760361; cv=none; d=google.com; s=arc-20160816; b=D8Bevp7WLOGVYS/0HHOcVNpJNzznpDCpgLQ7FS8RPYIXw0wvb7cGR+wxO1QuQ0AbPd wNXfsEodEse/sNjtk35FYyAkfNMjQqlye41ng+cw61ffBEpGSpagc5tk7aDm8k0ak6D1 xIkF0Fg5dhFVeTpq0UGLj+Ob4H0/haffLQ3fjF5d+9WvYeH4QeCbHYOv44nUuoixe74p R+PGU9xoQ2OACGPxE+dPNvuBh6J8IBSbT1Ih3BI1tFxww0UECYU7XP+LbSforl0kB4nt 6JxwTEgRF3YzK4vv00qXoyoXtGDRGlJFZA/Raht0bdDGqD0oxldqr8n9PRh+PWKXtDsp JjeA== 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=AS64TdfAS13jRbvIETx+TrHaG+hDKbyYSvciUkI1aIU=; b=GlqNjqTGVZyxFQD7W99uns5qbURw1+jQnBiWzvklx0v+/8D6bvsql4LiS93cUOwnBK qvZZ1KYtutQHiuVSK/k65YTDXqpym0ie/KVE8akO3RZ0JxxQLlwGQ/Nh6OAkotQqExJX 2XFp8jtIgCWuFXxlnAaxJDGgkI/ohXJ6vkvKMf3bkLv9q7X9BdLJPR76+7HRb1Uk7Oqk f9XEaja2COc0/NNCHIYgdmkLjlfPTxg4xj2u2igdbGvmBlb7C3F7VWO+5YYZIhESEjWF nU1Ae2kVPApXEv6f6e6FX6qBgaEOvMtQqp//X5FQh8APsUX1iIQ/knq7rXn6sgA9u5gt cv4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=b16inaaB; 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 x70-v6si10275958pgx.576.2018.05.31.02.52.27; Thu, 31 May 2018 02:52:41 -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=b16inaaB; 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 S1754339AbeEaJwB (ORCPT + 99 others); Thu, 31 May 2018 05:52:01 -0400 Received: from mail-vk0-f66.google.com ([209.85.213.66]:43627 "EHLO mail-vk0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754188AbeEaJv4 (ORCPT ); Thu, 31 May 2018 05:51:56 -0400 Received: by mail-vk0-f66.google.com with SMTP id x191-v6so12955955vke.10 for ; Thu, 31 May 2018 02:51:56 -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=AS64TdfAS13jRbvIETx+TrHaG+hDKbyYSvciUkI1aIU=; b=b16inaaBzf6CLu/AjVRChQuPRD+elCIPgXQFnlC3QfOEcD13XQogMcI8Jeue6ertCq drz+C5eiM0g7KmTADHo8t5FVkuTJO0SbZ2LwrR3lu5oi7MFT2xxj/gou876D7PGh7Lhc QX44X3JVZTKlQ8f394dtPMqhf+3aEk5jsF/j4= 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=AS64TdfAS13jRbvIETx+TrHaG+hDKbyYSvciUkI1aIU=; b=t9hhhA7Hgx9oHyYebgTi3ZEeyD8SCGKPmi097xv/gz8T3UYYHtw2t7T+/eoewkJb5e GnzMfjIYA82g/CNgTxaRFYqcSeXD0i79kpdyQvfpvQIPhQkh4r14nn0TeE/Q5dXKwXRu 5NM3pCpOMU5/nnm3YTTyVqwqXbCRFbpEmvQpAzNJ3hkCdm66GNCnhEUi2+sque2/hsuC 7w44AA9kDTGBHgObUwI8VULwC88TgnlGTc7bjH0pwYX+GHXMUM3D1x5M9YhqUbb1crUC b7JN83qxJqFBG7qe8oqlLHIjKSonAGZ8+Uq2LvYLlgPv9D8XaSTQ3RBuLfNLPHCQO/gr DqKg== X-Gm-Message-State: ALKqPwd6YRsvkoJ0ds4cNQdJtJPl7QXr3Sh2L34b02xg2nlLumEahPfd NGQVf9HHhXlXQZJoIr1nAcPWh0ESLJQ= X-Received: by 2002:a1f:2046:: with SMTP id g67-v6mr3954587vkg.43.1527760315286; Thu, 31 May 2018 02:51:55 -0700 (PDT) Received: from mail-vk0-f45.google.com (mail-vk0-f45.google.com. [209.85.213.45]) by smtp.gmail.com with ESMTPSA id 190-v6sm10192803vki.51.2018.05.31.02.51.54 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 31 May 2018 02:51:54 -0700 (PDT) Received: by mail-vk0-f45.google.com with SMTP id n134-v6so12946051vke.12 for ; Thu, 31 May 2018 02:51:54 -0700 (PDT) X-Received: by 2002:a1f:7c43:: with SMTP id x64-v6mr3633863vkc.179.1527760313684; Thu, 31 May 2018 02:51:53 -0700 (PDT) MIME-Version: 1.0 References: <20180515075859.17217-1-stanimir.varbanov@linaro.org> <20180515075859.17217-28-stanimir.varbanov@linaro.org> In-Reply-To: <20180515075859.17217-28-stanimir.varbanov@linaro.org> From: Tomasz Figa Date: Thu, 31 May 2018 18:51:41 +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 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? > + > + 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. Best regards, Tomasz