Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3899271rwa; Tue, 23 Aug 2022 12:07:43 -0700 (PDT) X-Google-Smtp-Source: AA6agR4BtlG2HDc3/I49XGDHZ7ge6aIMtmvpSxXDKoccvpk1pdYwfA/BampVLcTYQa+GaN9mpzq3 X-Received: by 2002:a17:902:ce8e:b0:16f:8f2b:b16f with SMTP id f14-20020a170902ce8e00b0016f8f2bb16fmr25495268plg.167.1661281663582; Tue, 23 Aug 2022 12:07:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661281663; cv=none; d=google.com; s=arc-20160816; b=eq+LK1uGps2xVfHwEecSMZ+wp9uWJ/GsaCJGx2TRHJSozddMqhQX4nFaIzs2mD2H9V 2wAf7PPZMzPiVKz7OzThhroa2RqLTZooSNSat+44SyPcxhDaLohS6Epje3iomDVSsTZW GXedFlHM6sMWCzvKcGLA52Xs04PP0qlaADCvpS1WNRPuQWWzEmql7wBI9c02hFSThTec QEwtAM0+g2X9C5ggdlA+NrK2xNYl72BIyxLQPqZL9Hk4p/MOrYGFfLAPt07HBUK2nPZB zD7H2gUpTW2yIsrZUo/G0/g1uLOebDnRUTia+66fls7a1rjgEwuw5gLtkIqmhFtLVKJV wk2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=HYUWsAYXjW2i318BjbGbbKb+gkXQpUmwzmEIHMqDu5I=; b=j1MTmeBy58dengaFEh9LpxJvhtAvOORhnaWN9oqTw9z8wkYYjhAaR5EMDTyyeHcuIf vPPyzetySbm+6irgn7CMt4z0y1TidiOKeK7SdP1zbCdnvVtcyv8bl4YvVfNY//uh9Vb2 +0JSAUUlUc3zcLmCI/H7uitotOlTt8S3/ySJgEb4FTxwnpW3yA/GGb9rxoLGILN0LX/F rZVYQgc/vlNP0HBYfJX+aWN/8WoZjmX2X3qXbX/2KmlGkBzs9luwSidnIGMTowDJzZxC CcakCHJ1jH8WvYp9F1Rf+z2T4zEd5F9ivqbSiqsRZZTRCnKaR16cizZHA2WGLDHInTjq Z62w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ndufresne-ca.20210112.gappssmtp.com header.s=20210112 header.b=e4JErC0o; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f189-20020a636ac6000000b0042b15a68270si211110pgc.213.2022.08.23.12.07.31; Tue, 23 Aug 2022 12:07:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ndufresne-ca.20210112.gappssmtp.com header.s=20210112 header.b=e4JErC0o; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232575AbiHWRWk (ORCPT + 99 others); Tue, 23 Aug 2022 13:22:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237471AbiHWRUm (ORCPT ); Tue, 23 Aug 2022 13:20:42 -0400 Received: from mail-qt1-x829.google.com (mail-qt1-x829.google.com [IPv6:2607:f8b0:4864:20::829]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBB79AE86E for ; Tue, 23 Aug 2022 06:44:25 -0700 (PDT) Received: by mail-qt1-x829.google.com with SMTP id cr9so10322536qtb.13 for ; Tue, 23 Aug 2022 06:44:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ndufresne-ca.20210112.gappssmtp.com; s=20210112; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc; bh=HYUWsAYXjW2i318BjbGbbKb+gkXQpUmwzmEIHMqDu5I=; b=e4JErC0om1kvlDhOah9NQNcK+mXjibntNm23OS49JJRMoTF5yVIe6jgHxK1+mhwkan CO91j95hoO+ZUqzvsHtB+vnZLWg5cZJTdAZd/KyriCrgfWZdH7J4b2bD2+oxHYpW5Ynh bkfus5PrWDnnJai7yYslwwf0RJuvDjfZaW+T0ptWq1/uK1BfD0hq28qJyA5EosXuFBwl LkroYPa5I6Jo56BQ5J86APmQj3fL+ojhLy+K7MEeJcpl/hMMdk9E+NQb6kTG1BmUr1Im sChiFOU8KqdQH94ddHL7Teh5gp6YtpdjEWwaUUOb6/Dvss/yiCnPdZp8HNkmZgcmZZ5n Xyhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc; bh=HYUWsAYXjW2i318BjbGbbKb+gkXQpUmwzmEIHMqDu5I=; b=Nz6RAAc3P6f7PS25j+ECR96TWcYSMPSKMxW3uVP6iYejU3lLzyQBjLYShpwLzyAvsR CECTUVdD4mAmpeiQcz3ca/kkgIYhnsuF1w+/sGN2h24EbRg0p0BSt73JPISTkgxnFT6z IImFjTKONIiC6IedKcyVVF8yLdc/MiovpUaxfRLHI566m7j5X1wSf1tJZsB6DvIZvwbD zOLuVmZKP4Do0B5Uc4h8vDSjHKSVQLmh6vSV99Qf+VCRgsPYTdBd1/xQoqIGNfml2N6g 6UUlztXYijaDCDJrSC+AMOxoD6p9KFvdwxKhDchZN/eveD+PGtx7gkkhJGRqv4BUGFLE 6WEQ== X-Gm-Message-State: ACgBeo1Xpnm3CthF5OLM7N78av+D4RPoefkkBrYYqhU3MqihlhY99pnn UJ/ZDZ47W/rdKOMd11YSPsW6yA== X-Received: by 2002:ac8:7e83:0:b0:344:7ee0:1241 with SMTP id w3-20020ac87e83000000b003447ee01241mr19324435qtj.587.1661262264917; Tue, 23 Aug 2022 06:44:24 -0700 (PDT) Received: from nicolas-tpx395.localdomain (192-222-136-102.qc.cable.ebox.net. [192.222.136.102]) by smtp.gmail.com with ESMTPSA id v16-20020a05620a0f1000b006b97151d2b3sm13198030qkl.67.2022.08.23.06.44.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Aug 2022 06:44:24 -0700 (PDT) Message-ID: Subject: Re: [PATCH 2/2] [WIP]: media: Add Synaptics compressed tiled format From: Nicolas Dufresne To: Hsia-Jun Li Cc: Tomasz Figa , dri-devel@lists.freedesktop.org, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@linux.ie, daniel@ffwll.ch, mchehab@kernel.org, hverkuil-cisco@xs4all.nl, ezequiel@vanguardiasur.com.ar, sakari.ailus@linux.intel.com, ribalda@chromium.org, Laurent Pinchart , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, sebastian.hesselbarth@gmail.com, jszhang@kernel.org, linux-arm-kernel@lists.infradead.org Date: Tue, 23 Aug 2022 09:44:22 -0400 In-Reply-To: <2f3c8f6d-fc01-353e-fb74-b7f9af1ed2c4@synaptics.com> References: <20220808162750.828001-1-randy.li@synaptics.com> <20220808162750.828001-3-randy.li@synaptics.com> <13d37c15-79f3-4e16-8cf4-fc37846f4a04@synaptics.com> <6da7faf329128312f0862f555d1a855437ae99f3.camel@ndufresne.ca> <50dd9b7a-8f48-0799-57f6-048d20de8dcc@synaptics.com> <2662ac698898f71f60b9b7e0ad4703854de1d012.camel@ndufresne.ca> <1f926989-eb13-14ee-e30d-ac6d01b86c52@synaptics.com> <2f3c8f6d-fc01-353e-fb74-b7f9af1ed2c4@synaptics.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.4 (3.44.4-1.fc36) MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le mardi 23 ao=C3=BBt 2022 =C3=A0 15:40 +0800, Hsia-Jun Li a =C3=A9crit=C2= =A0: > > In current state, If your driver can support it, userland does not stri= ctly > > need > > to re-allocate if the resolution is changed to smaller. In most SVC > > scenarios, > > the largest resolution is known in advance, so pre-allocation can happe= n to > > the > When you play a video from Youtube, you may notice that starting=20 > resolution is low, then after it received more data knowning the=20 > bandwidth is enough, it would switch to a higher resolution. I don't=20 > think it would inform the codecs2 or OMX there is a higher target=20 > resolution. >=20 > Besides, for the case of SVC in a conference system, the remote(gatway)= =20 > would not tell you there is a higer resolution or frame rate because you= =20 > can't receive it in negotiate stage, it could be permanently(device=20 > capability) or just bandwidth problem. Whether we know there is a higher= =20 > requirement video depends on the transport protocols used here. >=20 > The basic idea of SVC is that the low layer didn't depends on the upper= =20 > layer, we can't tell how the bitstream usually. I'm not saying against the fact the for drivers without IOMMU (hitting dire= ctly into the CMA allocator), allocation latency is massive challenge, and a mechanism to smoothly reallocate (rather then mass-reallocation) is needed = in the long run. This is what I'm referring to when saying that folks have considered extending CREATE_BUFS() with a DELETE_BUFS() ioctl. Note that there is tones of software trickery you can use to mitigate this.= The most simple one is to use CREATE_BUFS() instead of REQBUFS(). Instead of reallocating all the buffers you need in one go, you would allocate them on= e by one. This will distribute allocation latency. For stateful CODEC, most OMX focused firmware needs to be modified for that, since they stick with the o= ld OMX spec which did not allow run-time allocation. Another trick is to use a second codec session. Both stateful/stateless COD= EC have support for concurrent decoding. On the MSE requirement, is that the s= tream transition happens only on keyframe boundary. Meaning, there is no need to = reuse the same session, you can create a new decoder in parallel, and that before= the drain is complete (after the event, before the last buffer). This will comp= ress the "setup" latency, to the cost of some extra memory usage. Specially in t= he MSE case, this is nearly always possible since browsers do require support = for more then 1 concurrent decode. This method also works with OMX style CODEC without any modification. regards, Nicolas