Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp814117ybl; Wed, 8 Jan 2020 06:21:12 -0800 (PST) X-Google-Smtp-Source: APXvYqy2tsIy5/6jBJMal4xHO4jfIdFJf1+Jvo/QxEfnT9ONsXIXDd6EKoEBIq7PhiepP/kyAWk8 X-Received: by 2002:a9d:6e82:: with SMTP id a2mr4205310otr.336.1578493272168; Wed, 08 Jan 2020 06:21:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578493272; cv=none; d=google.com; s=arc-20160816; b=JV9pC4um6flN+RSy+5ow3L3R805nQcZXd7Wax/+AvHWlHZzy8xEgYbytMy0to9HwO7 u8on45MvO+SLdvVJQSvNHmXAT4+3KkTSbmLdIKcuE7jeFhF/cPo1cWMdQPuiTKOufIWL g9P2/13dLrhkzxZAA4nh+2L1EitQRmItrEfW5+K5xyQr+zB8epAVIJXJHfx1oaA4NwNS c2rc1PI5F44zjCMR1YCtNicS6c+ErvNiMPoKFwn3o3q5WF+SER1xa6skVj5pj7CUDpxU sexfVWN5rJmXPP1lxCggSbyo0AwV06osvzB9iye9SHjf0YukeeHBUc8Xw1hH8/SHRher eK0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=ZaemZRWcMq37fip2p7cOsBNJ6/qsTNjchTCq1eUTMrE=; b=FWNhE7D9vhIhuVkBK+r2whfKuxvyaKVgLe5vv5SvAbITufL9b1izZnSv1myY46geUf +sEMfN/Yz6l5xCTn1TCU1c6UQ7YS6T/iibc9fkZnbgfx4f/Zir5qT+Mt0v0qZMuWpOkB yfS62313fkLX9YKgRif+WU6GGgDOYQX5qbcySE84IAYSh2ckskaxwsS+fTCdgWcVNbz3 PrgENu2veBguBCEm0DyOLSwmFWfoKIREooZ8w9CrkRiGtITIKTVIEbmTgC6Y1ibKfU85 +YlTyINWfdN1pbNXJHBygUviPUwx5y7AfoRvChe+8EGPQzDFWj94T+mhBnKk8Q9UNXtB tDHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=OLeVYVei; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q126si1803589oia.8.2020.01.08.06.20.52; Wed, 08 Jan 2020 06:21:12 -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=@chromium.org header.s=google header.b=OLeVYVei; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727205AbgAHM7t (ORCPT + 99 others); Wed, 8 Jan 2020 07:59:49 -0500 Received: from mail-ed1-f65.google.com ([209.85.208.65]:41462 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726683AbgAHM7s (ORCPT ); Wed, 8 Jan 2020 07:59:48 -0500 Received: by mail-ed1-f65.google.com with SMTP id c26so2460704eds.8 for ; Wed, 08 Jan 2020 04:59:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ZaemZRWcMq37fip2p7cOsBNJ6/qsTNjchTCq1eUTMrE=; b=OLeVYVeiMpzCyt95hwX/CBNv7CSsvpQa+k8fhgTtUUZhaDS6qc5EcVCP0vVsd3+T/f WQvlgCX5DfHKkRq7zrUfZc4+IRK5s/DgLIvp9k8k7m2L2DsOr8PKhIF2rLsAQt3NmpCQ c1uaK2C/84QmvjPW7tIdEusjIEjt0zpd82h8U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ZaemZRWcMq37fip2p7cOsBNJ6/qsTNjchTCq1eUTMrE=; b=QcstSkK3oclZ5css3qFfFYymaKxJRn3GKXNVj8HRtpZBH7ZZwNl9svuGpBSilerbYD D8KVTPRfqZeHhksAUa9KqO/5HEDX36lDVWO0L5bl342U0IavQBe3MlBmINC9c7Vb8QZy 5uAsEHwAUF3Pe3eEkhnDHTbTWV1QJ6WGnfdtLs+knvItWB1WUdRb111Sh6kZkzBVHNNY 87Tst2apwVGeuBhia9u2azeT4bbGr4SlD/frKMmX/urtWrRbtL6tjrG7PISniR+2Hyhh GXF6I5S9xS6rCw2XTe3wJxhyO0mdatCNSN6jhR6w+tl6xlfbz1Rgn0Wx26L+d01jYONK 2QhA== X-Gm-Message-State: APjAAAX0tYEoos1v8DdxBCCKGQcSSqw1Apsy2JSLQquH7T83hPCiVzTk TD7EGnL62Zmw07v0zLWnpSa6xWPTSE8pWw== X-Received: by 2002:a17:906:2e41:: with SMTP id r1mr4747651eji.127.1578488386243; Wed, 08 Jan 2020 04:59:46 -0800 (PST) Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com. [209.85.128.46]) by smtp.gmail.com with ESMTPSA id b27sm47243ejg.40.2020.01.08.04.59.45 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 08 Jan 2020 04:59:45 -0800 (PST) Received: by mail-wm1-f46.google.com with SMTP id p9so2384984wmc.2 for ; Wed, 08 Jan 2020 04:59:45 -0800 (PST) X-Received: by 2002:a1c:2355:: with SMTP id j82mr3863056wmj.135.1578488384818; Wed, 08 Jan 2020 04:59:44 -0800 (PST) MIME-Version: 1.0 References: <20191106223408.2176-1-jonas@kwiboo.se> <7b92111b0c6443653de45f1eeec867645c127f32.camel@collabora.com> In-Reply-To: <7b92111b0c6443653de45f1eeec867645c127f32.camel@collabora.com> From: Tomasz Figa Date: Wed, 8 Jan 2020 21:59:32 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 2/5] media: hantro: Reduce H264 extra space for motion vectors To: Ezequiel Garcia Cc: Jonas Karlman , Mauro Carvalho Chehab , Hans Verkuil , Boris Brezillon , Philipp Zabel , "linux-media@vger.kernel.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Best regards, Tomasz