From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ABFBEC19759 for ; Thu, 1 Aug 2019 05:42:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8C58F206B8 for ; Thu, 1 Aug 2019 05:42:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728297AbfHAFmJ (ORCPT ); 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-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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.