Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp6847127ybi; Wed, 31 Jul 2019 22:59:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqy3WlO8VOF01/E/eQWGKddNQy4hCx/R+ZdmSUpVQp3RVVYSRgxmieS1ZIjZzPjOewiSBtNL X-Received: by 2002:a63:c008:: with SMTP id h8mr116074735pgg.427.1564639145719; Wed, 31 Jul 2019 22:59:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564639145; cv=none; d=google.com; s=arc-20160816; b=j3YvK5DCmJcEHML1TzTzuX7zMEJaenSzVkYJTl2TYB+rZW8VnRunMpI1m5Zdt4lMS8 UTrYseSIM0DCOH2rjP5Q96zkYhArk978IS6W+R6ONU7i/sBDqAScYa+6GQfna+f1Mkf1 5wQ9L4KAxG5GxD2aWAZLkCjJmxJH1gjKQmc9xRn43dkp/5oppazz2B2ZWCDsSHJcaNXg zwapY1m3NfmZ/u3XbIK8qthWoEIGkl5wxhOjCIrT2kH2hTpRVQObo8JVot2dKqAl+va2 R9x25bU7wJHurjTT6VkHJ7PEvw8Qu8k8RKbarnSIBwYtccqqztJEu+3EBxAEoeYPtfcG jrdw== 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:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=bebpq70/m5pdIeVdqj8OqPibsw+7yG3RE78rrRW2rew=; b=svX8nAJOpzkTr1VIGYWTYqQmTPpBF0jZHQHwr8Zj2Ob1jb/U6qGgQbYUNnTBWkFpJw elmX0EtgueP+eiHZowRCs0a0NM6PuUJGfNUdOCFzou1XUWYpJVwOkh2U10cVG5Tx68Zc MV5CJf+eodx692c6aVN+rrN9ePmtxhv8jXoU9sQEEWvy9Joq+pCGfEWk+TeWuZ2F4vqA ieYeX0dfS7G0NnT4fBaP7c8Lvqp5wGxG6ii0YK3cDyg0VHy7NnoxtfWk0v93Q2YT08EL qcTFNNOLHk3B3b5Ix9z9izu+pKe9ecDiz9t3/JGHCOYVsw8jsnbMGF5bEAzhxS7nJBHa 0sKQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q191si32534337pfq.63.2019.07.31.22.58.49; Wed, 31 Jul 2019 22:59:05 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728741AbfHAFmJ (ORCPT + 99 others); Thu, 1 Aug 2019 01:42:09 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:33354 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726783AbfHAFmI (ORCPT ); Thu, 1 Aug 2019 01:42:08 -0400 Received: from localhost (unknown [IPv6:2a01:e0a:2c:6930:5cf4:84a1:2763:fe0d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: bbrezillon) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 4824A28BF70; Thu, 1 Aug 2019 06:42:06 +0100 (BST) Date: Thu, 1 Aug 2019 07:42:03 +0200 From: Boris Brezillon To: Tomasz Figa Cc: Mauro Carvalho Chehab , Hans Verkuil , Laurent Pinchart , Sakari Ailus , Linux Media Mailing List , Linux Kernel Mailing List , Nicolas Dufresne , kernel@collabora.com, Paul Kocialkowski , Ezequiel Garcia , Jonas Karlman , "open list:ARM/Rockchip SoC..." , Heiko Stuebner , Andrew Morton , Rasmus Villemoes , Philipp Zabel , Hertz Wong Subject: Re: [PATCH 7/9] media: hantro: Add core bits to support H264 decoding Message-ID: <20190801074203.76b439bd@collabora.com> In-Reply-To: References: <20190619121540.29320-1-boris.brezillon@collabora.com> <20190619121540.29320-8-boris.brezillon@collabora.com> Organization: Collabora X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 1 Aug 2019 13:06:10 +0900 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? Actually, I was wondering why it was not counted in ->sizeimage. I thought you had a good reason to not expose the extra size to userspace so I kept it like that.