Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp6937487ybi; Thu, 1 Aug 2019 00:38:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqwAMLFea0y8Hr/lYoAurLjcQAYBv7eE8e1siMjsnWofLL9LvP/3R8dn2MxWFMLq395P8X6X X-Received: by 2002:a17:902:2aa8:: with SMTP id j37mr118571577plb.316.1564645139809; Thu, 01 Aug 2019 00:38:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564645139; cv=none; d=google.com; s=arc-20160816; b=qhN8JOIuzrvHIrMgexkiB+3AbkQgUP1rHujm6q060dBWYnRI9IwL8dSLWPfU4YZbuz 0jLTzf4UvBzA60rM3Mq5ERJI/00wZHvPNcFHwfEDCw4308sR0x6qrA0WRu4RLALIbjbS QMDOLek8BkpEyL4wzcoNxlrHtfPJase1zYiTpgDfGIXZTkbaHTwrJm1lSj/dA8TA/rdD oya16ORMpokJz5hNc//VNmlUpa3Fg/vfC+n4Thz1Fak7PP/YRFwqrKmMD4ibBRCNWZKx I98DdmRbc5Qr4O7M/LsVQGH6Cwj02wFiToLZFIZl48zEy9aSUQbF+3qop3WUYf7KZ5s5 7Kgw== 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=k3HgBG8dgms5aeg3KKVbilyEzZjF4gJI3+pzI6ZqB7c=; b=vRxzaq/vzpoMI7bDBX1C8oGIx1h1VgaMV+9/rO6Hnsfr8vVwdlxzi/AFUGVrzVF4am ZZKJ13MwG7y/rb9q9DHYDfTVpLp+b55QJpDZtHE+OLox0mNjHQc+rbS59H94BqNFbQ43 Nybk6JOEQR44tyDLSla4GwYUcQK/q1vqvfKvKgEb+r1Tk52OIMPQwKqYJN5T2Saj8tFX 8IANUFWateHpJZNZWErar7AsPtk8UmQJrPCxGS3WvLkyhUPVPcRcvm6iDahr2wUyjBB4 oLHBLfapZAwYxZo1ev9GZ2PAtyJIkyusrwyuX+FX6uqyapCQofQC1C44tAwsDewhCk6P HUfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="DgDNW/rw"; 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 b9si33655564pgb.478.2019.08.01.00.38.39; Thu, 01 Aug 2019 00:38:59 -0700 (PDT) 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="DgDNW/rw"; 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 S1730490AbfHAHM6 (ORCPT + 99 others); Thu, 1 Aug 2019 03:12:58 -0400 Received: from mail-ed1-f66.google.com ([209.85.208.66]:36878 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729116AbfHAHM6 (ORCPT ); Thu, 1 Aug 2019 03:12:58 -0400 Received: by mail-ed1-f66.google.com with SMTP id w13so68183096eds.4 for ; Thu, 01 Aug 2019 00:12:57 -0700 (PDT) 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=k3HgBG8dgms5aeg3KKVbilyEzZjF4gJI3+pzI6ZqB7c=; b=DgDNW/rwQ9RQMEgFi3r3eO0bKXwgH3+xgNXhRN9nikI0MID4Y8Q+aITx64bwslu/R6 CUVtBW5HMK2/yH4JfolC0xoP4qpayTQPDitAKqzlki4L5sdd+3Id9L9a0ytS0LUbJNbf c64BC68THi/AmMpHoomg8lsILIyEMdueFVxVw= 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=k3HgBG8dgms5aeg3KKVbilyEzZjF4gJI3+pzI6ZqB7c=; b=eGiTAbpaxkm6VfOzRDzMgNbEMtkxIG61jqn1RmE8dgsItU5SS0VaSzd0qFsiFfN71i OOUs/7nHpGByXPVrdYY07WgM7qaZGrkyqhc7hReYs/pdEPPfNql17y/FK+H8JOU4M6i8 yRd8DQbfudcwmjNgxNO2b+qHQBQYg5ZzN2Fde4UTMCPg0YrCH3OjggF2vgbB22am2aPd q6UEroHVno4mz+u+OCL7J3akepcX7eiffEykFofdopYyeWgHt/5h9GwOW5BipBHNy6Xq dWj8j37KKsw4tV1v4d5KzRxyFLyIzZcVDEMh+/FUX4nVEZQw4U0kIzpswD3iU+f05OnL kCmQ== X-Gm-Message-State: APjAAAW8fTTH2UipJs3RR2DNvGQ9ja+iWvXoAoYQho2oH3LYbRnT0L+q Ky5NpiilIeO+c+YLwOuUD6ij9K/3NAUQvw== X-Received: by 2002:aa7:ca41:: with SMTP id j1mr113706408edt.149.1564643576714; Thu, 01 Aug 2019 00:12:56 -0700 (PDT) Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com. [209.85.221.45]) by smtp.gmail.com with ESMTPSA id h10sm17908355edh.64.2019.08.01.00.12.56 for (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Thu, 01 Aug 2019 00:12:56 -0700 (PDT) Received: by mail-wr1-f45.google.com with SMTP id x4so19192540wrt.6 for ; Thu, 01 Aug 2019 00:12:56 -0700 (PDT) X-Received: by 2002:a5d:5012:: with SMTP id e18mr18039721wrt.166.1564643575835; Thu, 01 Aug 2019 00:12:55 -0700 (PDT) MIME-Version: 1.0 References: <20190619121540.29320-1-boris.brezillon@collabora.com> <20190619121540.29320-8-boris.brezillon@collabora.com> <20190801070410.GA22382@aptenodytes> In-Reply-To: <20190801070410.GA22382@aptenodytes> From: Tomasz Figa Date: Thu, 1 Aug 2019 16:12:43 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 7/9] media: hantro: Add core bits to support H264 decoding To: Paul Kocialkowski Cc: Boris Brezillon , Mauro Carvalho Chehab , Hans Verkuil , Laurent Pinchart , Sakari Ailus , Linux Media Mailing List , Linux Kernel Mailing List , Nicolas Dufresne , kernel@collabora.com, Ezequiel Garcia , Jonas Karlman , "open list:ARM/Rockchip SoC..." , Heiko Stuebner , Andrew Morton , Rasmus Villemoes , Philipp Zabel , Hertz Wong 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 Thu, Aug 1, 2019 at 4:04 PM Paul Kocialkowski wrote: > > Hi, > > On Thu 01 Aug 19, 13:06, Tomasz Figa wrote: > > Hi Boris, > > > > On Wed, Jun 19, 2019 at 9:15 PM Boris Brezillon > > wrote: > > [snip] > > > @@ -533,10 +535,21 @@ hantro_queue_setup(struct vb2_queue *vq, unsigned int *num_buffers, > > > return -EINVAL; > > > } > > > > > > + /* The H264 decoder needs extra size on the output buffer. */ > > > + if (ctx->vpu_src_fmt->fourcc == V4L2_PIX_FMT_H264_SLICE_RAW) > > > + extra_size0 = 128 * DIV_ROUND_UP(pixfmt->width, 16) * > > > + DIV_ROUND_UP(pixfmt->height, 16); > > > + > > > > I wonder if this shouldn't be accounted for already in the sizeimage > > returned by TRY_/S_FMT, so that the application can know the required > > buffer size if it uses some external allocator and DMABUF memory type. > > I know we had it like this in our downstream code, but it wasn't the > > problem because we use minigbm, where we explicitly add the same > > padding in the rockchip backend. Any thoughts? > > Does the extra size have to be allocated along with the buffer? > > On cedrus, we have a need for a similar side-buffer but give it a dedicated CMA > allocation, which should allow dma-buf-imported buffers. Yes, the decoder stores motion vectors (IIRC) after the image data. Best regards, Tomasz