lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Tue, 21 May 2024 17:54:56 +0800
From: Fei Shao <fshao@...omium.org>
To: AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
	Hans Verkuil <hverkuil-cisco@...all.nl>
Cc: Fei Shao <fshao@...omium.org>,
	Yunfei Dong <yunfei.dong@...iatek.com>,
	Andrew-CT Chen <andrew-ct.chen@...iatek.com>,
	Dan Carpenter <dan.carpenter@...aro.org>,
	Matthias Brugger <matthias.bgg@...il.com>,
	Mauro Carvalho Chehab <mchehab@...nel.org>,
	Nicolas Dufresne <nicolas.dufresne@...labora.com>,
	Tiffany Lin <tiffany.lin@...iatek.com>,
	Xiaoyong Lu <xiaoyong.lu@...iatek.com>,
	linux-arm-kernel@...ts.infradead.org,
	linux-kernel@...r.kernel.org,
	linux-media@...r.kernel.org,
	linux-mediatek@...ts.infradead.org
Subject: [PATCH] media: mediatek: vcodec: Reduce msg queue trans buffer size

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 out
that's more than enough in practice and there's room for improvement.

The buffer sizes were reduced to 5MB / 8MB respectively and the decoders
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.

Signed-off-by: Fei Shao <fshao@...omium.org>

CC: Yunfei Dong <yunfei.dong@...iatek.com>

---
I consulted Yunfei and he confirmed that these are the sizes they are
using today.

 .../media/platform/mediatek/vcodec/decoder/vdec_msg_queue.c   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/mediatek/vcodec/decoder/vdec_msg_queue.c b/drivers/media/platform/mediatek/vcodec/decoder/vdec_msg_queue.c
index f283c4703dc6..e36741179a97 100644
--- a/drivers/media/platform/mediatek/vcodec/decoder/vdec_msg_queue.c
+++ b/drivers/media/platform/mediatek/vcodec/decoder/vdec_msg_queue.c
@@ -29,9 +29,9 @@
 static int vde_msg_queue_get_trans_size(int width, int height)
 {
 	if (width > 1920 || height > 1088)
-		return 30 * SZ_1M;
+		return 8 * SZ_1M;
 	else
-		return 6 * SZ_1M;
+		return 5 * SZ_1M;
 }
 
 void vdec_msg_queue_init_ctx(struct vdec_msg_queue_ctx *ctx, int hardware_index)
-- 
2.45.0.rc1.225.g2a3ae87e7f-goog


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ