Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp966026lqt; Fri, 7 Jun 2024 04:23:19 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWV40wr49Hd6FQA5JhE8NmpPDOAXfnb2ZLSaE2mK0oeb6/2YqcVM4DzwC5s6+1Ev8xtH0ilSTom5KROGOyta3jUNAz4AsjqHSWg3LYtZA== X-Google-Smtp-Source: AGHT+IG8Na1td8jIuttJfaKndF5sHjXUk34PpO1AhvGmmYmQNx1vZb2G0Dgnq888d4q7EHFXYzyd X-Received: by 2002:a05:6214:4598:b0:6b0:6512:94e3 with SMTP id 6a1803df08f44-6b065129607mr2156296d6.62.1717759399061; Fri, 07 Jun 2024 04:23:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717759399; cv=pass; d=google.com; s=arc-20160816; b=vylvszO3WDhbTuq5mVQU2z6Hv8HPD+iKdOad852GvYEQ/fXFuyYlklbueWGdNehaEg Wr7cvHXJNF+pJH25xkcqAl0fMGlAQUJaz5+f3f4UPV2Gca3iW6RivhUgox7jYB9RUsVB p/3duXe9NTXe3WcSVVDfKrOTWeys+YqYfz89fr6Nug78WyWu9MLpHhIYAi8Xy0nNbI7n cnbDiBDpMjrSDV+FQZvQHa8DlbY7vHLC9/eY96OLvvstIvyqXT+02MIOOfQsyATC8Tdp LubcikXaA3wXY0SMxHf2bsVZSJsW8OLLqL8HbvaDvjoVa4Vke1tkCsuP9k8zlGRgqltE kmUg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=UXrg4sVxCUukDDGsNqD6ghGWEjqWMXR9QLDCnb60Xb8=; fh=m28MiyuR4oV52NUWF7lEQDkSvd6duO4fsPSZcrsUJo4=; b=FeUxKbu64T50SVPvhemi2v68NIek+JElLQE1xDBhzRyQyuywPpuQf7rzqKQ+gjzapY 9XBJtaPt4RvCiYkAVnIe9AgQMQ0NpqKXRKYfwr40gqovxre8cCRWnTQPK8MpMZSF4GBC 1O87S/+ZLdSITw4D9lDIYPPLcbbsPWQZ3YjwMhh3olEoh3EDmAZGI1sEqrShFw1oGdRD +6Lk7q+ltcl9UKhmTjhdE/4sgjeOjlcPYUs9+ewbfND2tm4d5y1psog9SLKUFXj/xDcY nEznc08flm2jacUfyJNtWHsbMP6nFPO0nVAfox6Rm9yen/rFnBkmXO7/OeGmRgSwkdlC CVoA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ikJXzkVU; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-205904-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205904-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6b04f632d9dsi37121146d6.83.2024.06.07.04.23.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 04:23:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-205904-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ikJXzkVU; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-205904-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205904-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id B887D1C20EFC for ; Fri, 7 Jun 2024 11:23:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9C6121922EF; Fri, 7 Jun 2024 11:20:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="ikJXzkVU" Received: from mail-vs1-f50.google.com (mail-vs1-f50.google.com [209.85.217.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 419CA188CBB for ; Fri, 7 Jun 2024 11:20:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.217.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717759248; cv=none; b=O0QOHsTw45CDTFRyEfTfFwBaQ13VqqgNrBNSyu3c5CodGG56iqR93KfOKxlHWaad89H2cXE1CcUXIbAxOG0/UIU1093Oc7g/+wOIsM3HyxTSo3YdLc0SRtRFGaU96NnTWzv4+4Gci9ds0hCysYDjUXPvwbvcN4iihx2iIK+mx1g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717759248; c=relaxed/simple; bh=UXrg4sVxCUukDDGsNqD6ghGWEjqWMXR9QLDCnb60Xb8=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=WDc0ZMlEc92EUjffgqnNPwW9iiZYxI92/OUg39lyDVL7L2fSooALQbfUdxM6ary7nZ8of62/MgFHcJ0ln5qRvMzOpn/k/Hyupb/gcrmIqWtBSqZ02qw4IcnCB3zErSLf3eSo5uaffHDsxS5bfV1FM8JyEN/XztQlt2PmaArGXTc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=ikJXzkVU; arc=none smtp.client-ip=209.85.217.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-vs1-f50.google.com with SMTP id ada2fe7eead31-48bbcaf093bso541041137.2 for ; Fri, 07 Jun 2024 04:20:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1717759245; x=1718364045; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=UXrg4sVxCUukDDGsNqD6ghGWEjqWMXR9QLDCnb60Xb8=; b=ikJXzkVUoJlaP7m4ktiYZp0f6x9iliC62cHgHjwyPCBDpljsGCHWbrvIuDvTvJF5c4 L7n+ME+4DKCX1moxPGwTOvcTVTuIcoJM070ahFZCZt41pxdTpARMcdcxHq2TyGp+Wlfi JJq5mievJL9wOkW6fBApYucEO5cKTLACmGU1Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717759245; x=1718364045; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UXrg4sVxCUukDDGsNqD6ghGWEjqWMXR9QLDCnb60Xb8=; b=Eo6OrE1V+JU8x9EJUPQ6KpSVOUHqSykocuKVYa9sYfTQbUwVByKW4HfK5aKWjz8Ra8 U+CnsYCjhYRZaQmDi06tvUD/JHfuKZKnUo8GNLMYGz2Rx2DfHdp1FHjcH6/UYJeW4m+i RIdwiwaJqlaOs32tQjItCpLe06BkEp4LkgvW7XH/q/cvTC6PoNo5Fk3FIDtH9+DeHYLT Xci7oM2ylzhLJ9hrBHWuC12iHA75YKdbpoWKl5Oe8oquiFj+FYv1jCpU067HWXOarfxz O5uQySKq/5PXeREAYnyaBp8bTlFdEcuUUlsSO++U6mzE6huSYXBI2hJDdBEGk+xhqX4+ oBGQ== X-Forwarded-Encrypted: i=1; AJvYcCUvJ/jrzznpG+ob36ncWxxtJ+XMSaMRkyzU2bcBhYoTSj8NO2ln3odFcX2tvUEbNqDOstzQr8l+P0iZW+R0qbAAWY2MZ2pKx96zJTbV X-Gm-Message-State: AOJu0YzhjeRkwim9fywm2v3idIfyU5rAxpBMYIR+s8pc/jyzLVW7sYZe /hPDp8bRMJw4miBmgAmZzOHSYIzOMnWHHMnia+J8qwO1oYV9cQcGDSpCxzKV2fZPMHeUFaiAYaA = X-Received: by 2002:a05:6102:1285:b0:48c:3475:da33 with SMTP id ada2fe7eead31-48c3475dc3amr494708137.7.1717759243612; Fri, 07 Jun 2024 04:20:43 -0700 (PDT) Received: from mail-vs1-f42.google.com (mail-vs1-f42.google.com. [209.85.217.42]) by smtp.gmail.com with ESMTPSA id a1e0cc1a2514c-80b788b5963sm92771241.18.2024.06.07.04.20.42 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 07 Jun 2024 04:20:42 -0700 (PDT) Received: by mail-vs1-f42.google.com with SMTP id ada2fe7eead31-48bc3314cddso731783137.1 for ; Fri, 07 Jun 2024 04:20:42 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCU4th+FkUIRL8XxTVts8BbmOYzd3B2M1QFmVxo8BFvJ5he846sFvZpguSMyg/CI90LYRkVsj8HeWrE+ByD8p1X5NohjLJdqAMOlBhTM X-Received: by 2002:a05:6102:34e2:b0:48c:379a:b362 with SMTP id ada2fe7eead31-48c379ab51dmr77117137.15.1717759241750; Fri, 07 Jun 2024 04:20:41 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240521095536.3869399-1-fshao@chromium.org> <9f73dffc48394e6304263ac2293a2b18864ae3dd.camel@collabora.com> In-Reply-To: <9f73dffc48394e6304263ac2293a2b18864ae3dd.camel@collabora.com> From: Fei Shao Date: Fri, 7 Jun 2024 19:20:04 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] media: mediatek: vcodec: Reduce msg queue trans buffer size To: Nicolas Dufresne Cc: AngeloGioacchino Del Regno , Hans Verkuil , Yunfei Dong , Andrew-CT Chen , Dan Carpenter , Matthias Brugger , Mauro Carvalho Chehab , Tiffany Lin , Xiaoyong Lu , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-mediatek@lists.infradead.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, May 31, 2024 at 8:47=E2=80=AFPM Nicolas Dufresne wrote: > > Le mardi 21 mai 2024 =C3=A0 17:54 +0800, Fei Shao a =C3=A9crit : > > In the MediaTek HW vcodec pipeline, the `trans` buffer is used to > > transfer the data decoded by the lat decoder to the core decoder. > > > > In the beginning, 6MB and 30MB were allocated for the trans buffer to > > handle FHD and higher-resolution contents respectively, but it turns ou= t > > that's more than enough in practice and there's room for improvement. > > > > The buffer sizes were reduced to 5MB / 8MB respectively and the decoder= s > > have been validated to work normally on the MediaTek Android products. > > It's time to adopt that change in the upstream MediaTek vcodec driver. > > > > Reduce the msg queue trans buffer size to 5MB / 8MB respectively to > > optimize the memory usage per decoder instance and improve the overall > > system performance. > > I don't disagree with the change, but it feels like this is has hack over= a > hack. We have an entropy decoder (LAT) metadata buffer, which of course i= s > resolution dependent, for which we hardcore two sizes. > > Any chance Mediatek can document this blob, or at least document the prop= er > relation between the size and the resolution ? This way we could dynamica= lly > size the buffer for the chosen resolution and trust it to remain big enou= gh for > a long time. Removing the non scientific claim of "have been validated", = which > is producible for anyone hitting issue with that change in the future. > > Nicolas > Sorry for the delayed reply. I totally agree with your point, but last time I was told these are what they are using internally so I guess it's not there... or it could be me that didn't ask the right question (we want to do this with finer granularity or dynamically). If we don't get an answer here, I can also bring this up to MediaTek next time and see if they can provide more details. Regards, Fei