Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp872610ybl; Wed, 8 Jan 2020 07:16:49 -0800 (PST) X-Google-Smtp-Source: APXvYqwdWiwTWhqVXvlFwoGOWGxGStvhwWAKSW4UdLcuWCRPGUIoLAKtTCNLYBXt2ApIh5ItR+It X-Received: by 2002:a9d:7999:: with SMTP id h25mr4459930otm.347.1578496609164; Wed, 08 Jan 2020 07:16:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578496609; cv=none; d=google.com; s=arc-20160816; b=zn+pq7e8pCXtx5b2zBvmsA62AmCP9mgqge09q64aB9+pGN5UtPv9C07cT+eW+xzkOv VppihnWaSWGfbixEO0ol/tUAqltLzNox5lIW9NApky+nDcoGpSgp0cI9Lnw4SWH9nwoR 3fmAH1ixUJ/dP9C0yTV2mgWb79/ozeWmgQfut2ohBU7RMcADG8n6NcZ31Emsn427v5Jm CVyOKUJM0OyqtMRUoeovRoSJcD125Vp9ytTDYN8CZJDzMvHp8w5FKge7WAaXqWxnjO+7 5yJTnNN1G34x+XK7XdmXeXhoPy18NTvRpDb1oVxfbnD5vEgMUbPh+WnrflZgM0kT1Q6M LQTg== 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:cc:to:in-reply-to:mime-version:user-agent:date :message-id:from:references:subject:dkim-signature; bh=FNzFi/EcyGrtsyvw5xdP4nm1o8qsGg4d42d45TMi1zc=; b=k4XQ6ckOezXcTQU5CAS9X1M7PlkJVNHFO3wIch/n4fg/T5sVlt3iqJUMV6NkvbBS8L UPSMtqC1fDHSjSX2mnKK5wrcn7zOKAD1ftBWQOUZr9xPNEdXPk1h3mteFg0PxaifGAnK fLgHYxVSd5pVT4L01Mo7BNbPk8YaY3dxAviwQeTlwdpTe3BKkA7ipBhPK2E+kIQjP6k0 hTziYkDQWtwsNPd1StsUhRLnbskVo37RFZihQmoi/jhIP4wlANJY0YH+q0NKM+gURHWa K9J0goxYzuM7Ek2Imk20B572JqJqQK7vDW0yhl+8nxOGGbaBFlCPTF6C7lBvpKZ+a/rI URxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kwiboo.se header.s=001 header.b=JoZuPIXf; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t2si1724211otq.196.2020.01.08.07.16.36; Wed, 08 Jan 2020 07:16:49 -0800 (PST) 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=@kwiboo.se header.s=001 header.b=JoZuPIXf; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728407AbgAHPPa (ORCPT + 99 others); Wed, 8 Jan 2020 10:15:30 -0500 Received: from o1.b.az.sendgrid.net ([208.117.55.133]:16993 "EHLO o1.b.az.sendgrid.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726651AbgAHPPa (ORCPT ); Wed, 8 Jan 2020 10:15:30 -0500 X-Greylist: delayed 301 seconds by postgrey-1.27 at vger.kernel.org; Wed, 08 Jan 2020 10:15:29 EST DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kwiboo.se; h=subject:references:from:mime-version:in-reply-to:to:cc:content-type: content-transfer-encoding; s=001; bh=FNzFi/EcyGrtsyvw5xdP4nm1o8qsGg4d42d45TMi1zc=; b=JoZuPIXfmVMHmYBpgmG/X6eYGTg2lx8vIVnAZw2dcJ9rEOyo0UFUwPQmmGTGSizcnqJD tupfhhweZHayNJAWCAcLHQBJTs5gIteDGEJdIH0Y4yzXG6l/Ili0cNOAn7EnZiHKYlR/Fh xQaOrYTt/jL0LnX4ynVcgPqFJnSGds1J4= Received: by filterdrecv-p3mdw1-56c97568b5-f2xng with SMTP id filterdrecv-p3mdw1-56c97568b5-f2xng-18-5E15F0E3-59 2020-01-08 15:10:27.466849442 +0000 UTC m=+1952840.551967702 Received: from [80.251.203.67] (unknown [80.251.203.67]) by ismtpd0005p1lon1.sendgrid.net (SG) with ESMTP id LdEapv0HQIiUSkUxFUDRww Wed, 08 Jan 2020 15:10:27.165 +0000 (UTC) Subject: Re: [PATCH v3 2/5] media: hantro: Reduce H264 extra space for motion vectors References: <20191106223408.2176-1-jonas@kwiboo.se> <7b92111b0c6443653de45f1eeec867645c127f32.camel@collabora.com> From: Jonas Karlman Message-ID: <9606106c-5c49-cbc1-cb8f-0389ff8281bd@kwiboo.se> Date: Wed, 08 Jan 2020 15:10:27 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.1 MIME-Version: 1.0 In-Reply-To: X-SG-EID: =?us-ascii?Q?TdbjyGynYnRZWhH+7lKUQJL+ZxmxpowvO2O9SQF5CwCVrYgcwUXgU5DKUU3QxA?= =?us-ascii?Q?fZekEeQsTe+RrMu3cja6a0hw4wwBUrflS0pBfMy?= =?us-ascii?Q?kCNRb7VG1Hvipht9ko5YRiRt2MGcELKDFGENYUR?= =?us-ascii?Q?mSBZLGqIZZIsFu0QQJoCC=2F5A8McuNFH6cUvl3l4?= =?us-ascii?Q?LNamw4KwZmnfVpxnGxUMBvQEDEQV5WLr19PI9Ff?= =?us-ascii?Q?tqijw2OKMts7bCgsqxUPWZEFf6wwGwE8EvO0QBk?= =?us-ascii?Q?op+fohN4RtdszkmzhmEUQ=3D=3D?= To: Tomasz Figa , Ezequiel Garcia Cc: Mauro Carvalho Chehab , Hans Verkuil , Boris Brezillon , Philipp Zabel , "linux-media@vger.kernel.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=us-ascii Content-Language: sv Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-01-08 13:59, Tomasz Figa wrote: > On Tue, Dec 10, 2019 at 3:11 AM Ezequiel Garcia wrote: >> >> On Wed, 2019-11-20 at 21:44 +0900, Tomasz Figa wrote: >>> Hi Jonas, >>> >>> On Thu, Nov 7, 2019 at 7:34 AM Jonas Karlman wrote: >>>> A decoded 8-bit 4:2:0 frame need memory for up to 448 bytes per >>>> macroblock with additional 32 bytes on multi-core variants. >>>> >>>> Memory layout is as follow: >>>> >>>> +---------------------------+ >>>>> Y-plane 256 bytes x MBs | >>>> +---------------------------+ >>>>> UV-plane 128 bytes x MBs | >>>> +---------------------------+ >>>>> MV buffer 64 bytes x MBs | >>>> +---------------------------+ >>>>> MC sync 32 bytes | >>>> +---------------------------+ >>>> >>>> Reduce the extra space allocated now that motion vector buffer offset no >>>> longer is based on the extra space. >>>> >>>> Only allocate extra space for 64 bytes x MBs of motion vector buffer >>>> and 32 bytes for multi-core sync. >>>> >>>> Fixes: a9471e25629b ("media: hantro: Add core bits to support H264 decoding") >>>> Signed-off-by: Jonas Karlman >>>> Reviewed-by: Boris Brezillon >>>> --- >>>> Changes in v3: >>>> - add memory layout to code comment (Boris) >>>> Changes in v2: >>>> - updated commit message >>>> --- >>>> drivers/staging/media/hantro/hantro_v4l2.c | 20 ++++++++++++++++++-- >>>> 1 file changed, 18 insertions(+), 2 deletions(-) >>>> >>> >>> Thanks for the patch! >>> >>> What platform did you test it on and how? Was it tested with IOMMU enabled? >> >> Hello Tomasz, >> >> Please note that this series has been picked-up and is merged >> in v5.5-rc1. >> >> IIRC, we tested these patches on RK3399 and RK3288 (that means >> with an IOMMU). I've just ran some more extensive tests on RK3288, >> on media/master; and I plan to test some more on RK3399 later this week. >> >> Do you have any specific concern in mind? > > I specifically want to know whether we're 100% sure that those sizes > are correct. The IOMMU still works on page granularity so it's > possible that the allocation could be just big enough by luck. One of my RK3288 TRM [1] contains the following: Direct mode motion vector write: Its base addr is right after decode output picture data Its length is mbwidth*mbheight*64 Also both the mpp library and imx-vpu-hantro code both use mbwidth*mbheight*64. So I feel confident that the buffer size is correct. [1] Rockchip RK3288TRM V1.1 Part3-Graphic and multi-media.pdf Regards, Jonas > > Best regards, > Tomasz >