Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3792677imm; Mon, 2 Jul 2018 05:47:45 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdPopp0z/O6+iuJ22LJsgBSu6+b5wXL9zqeAOA1r1csGHFlVEcdgGATPGdan2s3jxdXXQ2h X-Received: by 2002:a17:902:42a3:: with SMTP id h32-v6mr5959181pld.72.1530535665578; Mon, 02 Jul 2018 05:47:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530535665; cv=none; d=google.com; s=arc-20160816; b=rQwcH/tF+cggkyTQZTOmUNCmPtk+UCVCKDBclxMA4eweLuNGsPrO9XeiB2Eq7sosnY ltpaAjpaUI9yaF7tP82z5vgZaqwhOS9pqmypdd33XRIWo9Ev9cP+KXC4TqpGrKr/jzNn xuQbQOnlBiHmCwIzweYUt0briTGb3BEIVNYpx+bmxVLdPfgTifT9i/kUotRtoZfW4jy2 LVDEY6NgDzGhgvdYFx1F3Hoib4vjFz+zcWb9XmOUh444pG8fuWVYsE9xUxuyeUzxhcIm BqbNhbId0pjr3os9a36VXajbzR8GpuwN/cRSSH4c1G+zFGIFauwZQduhtGRPdmVP2b9E 3HQQ== 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 :arc-authentication-results; bh=3C9Hbozwd2iD5W5EGq4fiHKrokDeKbXtaZ2aA2LJYWU=; b=oQae70G68Cfq6Rb4PiRcobVlziOOokFgglNx/gU26nFvObXtCiB8oyIwGMDxOLQ200 nOMLLwU+yWufhpmK/dU9lTd3uNru0qmqLdOZqgksIKAp9QFmSdySODOZuS350KkhGeq3 ToVRZr5R+d3+grEUIZ43oSkkfpugGQDoQSUER1gvGirvZ92PSJ5u418hk/97bvFGtr+E afTGNe4kHc9yTLT2yuEReJfT9dWYmYhDJFRaZpmToaORSTgiZ523fCkC4Biksm5/ediu 0z//szW89ryuj5IQXdwoG/iVCn57BY6YMWpur53Yp+aWkJ5hLSe4HCvtBgim1dqt0BGL Wg1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RTfP4tqQ; 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 s3-v6si16401455plb.394.2018.07.02.05.47.30; Mon, 02 Jul 2018 05:47:45 -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=RTfP4tqQ; 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 S1752847AbeGBMnx (ORCPT + 99 others); Mon, 2 Jul 2018 08:43:53 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:53498 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752821AbeGBMnu (ORCPT ); Mon, 2 Jul 2018 08:43:50 -0400 Received: by mail-wm0-f68.google.com with SMTP id b188-v6so8937696wme.3 for ; Mon, 02 Jul 2018 05:43:49 -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=3C9Hbozwd2iD5W5EGq4fiHKrokDeKbXtaZ2aA2LJYWU=; b=RTfP4tqQb+Cg7e23mF1T01C3Iy3tx2TendDCFz4maIPDCewGoVQ8tf/a+Agw3AOqQ+ 4JISPLyXCtdaJdMKOsV+Tro0QUrJHRjPglQiGcb5hPFgmNqtiF5ZU8SOAXSoSbcS51GI g+4wT6F4xhC8nDk+EqXUtHeaAeUWbseNtl0rE= 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=3C9Hbozwd2iD5W5EGq4fiHKrokDeKbXtaZ2aA2LJYWU=; b=gsAI5iVXT1ia3KImJGBWVz2AshFI6hkCdLKFTW2fT4nhYl4ebwd52/VRSmhkbXTynW 5dl+Rdw1Fcx46zZjTOnPhHlMje9O7JUTeBH2Pekmuw/hb51oz1YZhi5p9uS6vqOyWrpV QCvxXQr1KZYS4aVByXyjbKyDOELvhdKTipJkljuWz/7Wfgudnj0QHxe1e+jH4I5l/TtH djIH+WGi/E3aTNVz9Jr4rcElaW8DRpTl2LmvaSjmQIAV6koibNEhHYdeMkbNEVLnD/Xx QGN15Udalnbqi7O7ThhXjDgjM9pH5VTfScsrY8Fq1IJjG8NAS6ulofAhkGeCf9JnLIpz OnOA== X-Gm-Message-State: APt69E0hDw8Gu7nNtJNGx5FdRyaj+DWLMBjvAIODNyDUTIWBBtATEYEn EDFjFVWV6FYNKBnaIHUko3reNg== X-Received: by 2002:a1c:108b:: with SMTP id 133-v6mr8962039wmq.136.1530535429200; Mon, 02 Jul 2018 05:43:49 -0700 (PDT) Received: from [192.168.27.209] ([37.157.136.206]) by smtp.googlemail.com with ESMTPSA id u13-v6sm7909770wri.72.2018.07.02.05.43.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Jul 2018 05:43:48 -0700 (PDT) Subject: Re: [PATCH v2 27/29] venus: implementing multi-stream support To: Tomasz Figa Cc: Mauro Carvalho Chehab , Hans Verkuil , Linux Media Mailing List , Linux Kernel Mailing List , linux-arm-msm , vgarodia@codeaurora.org References: <20180515075859.17217-1-stanimir.varbanov@linaro.org> <20180515075859.17217-28-stanimir.varbanov@linaro.org> From: Stanimir Varbanov Message-ID: <394e5547-9b85-604f-ee9e-fdb5ea2f4237@linaro.org> Date: Mon, 2 Jul 2018 15:43:46 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. -- regards, Stan