Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp3080323ybh; Mon, 5 Aug 2019 11:41:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqz82Ni5BmfXpoIjqwPzu2ZCi1zEUOm0A0/7jtaKh5fDgm8Q/dwob4lan/pbkNjSyzu9Dlyz X-Received: by 2002:a17:902:b20c:: with SMTP id t12mr146777522plr.285.1565030473664; Mon, 05 Aug 2019 11:41:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565030473; cv=none; d=google.com; s=arc-20160816; b=iHpTMcHdTGlWgWahqQRUt6QKgP0IQc9k34ePt4CLvq71FKg8ErMNpYyOHM4BugXM7j sDY96zMwF56EF/VGorJo+BSvhE8UyJugbS7mAWSKy4ATN+FKBP4FNsJTxnw9S/D7RRqP B+1z/eWGjRpNiZFrrF4Rq978H9ihT7HeIHh08toixKlQWm2B4xw1En+/uwZQaLw+FbkQ nFgEsNEkqhRwlzVMAl+FqCFUkaOF3e9XtS72ItviDTDSVc99+w99cCIRuBK/An9sG2UG GqL6yTkBrSB3L9YyJGxpyyWAsjD4X3+SiO6jhdX7yFciscEu2+x/7B0Nq3YkD/d4r0mI zCGg== 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 :user-agent:organization:references:in-reply-to:date:cc:to:from :subject:message-id; bh=GKRqql41l/a/JO7YvPI5vcdtEhiMzxNjVyJfee804i4=; b=RYoEHYvWG6EBK4R1T7UrHlGUZLPJWQffCMa6fKkSE6/R0Xshcxp8tv8d5R2EtLx5Xv X9Y2fnf2hMdEdDy6TBKBN3u8IwnO1FVEdFaJspbq46GNyrBEbRZyMr8/DcjSkVRvrNF7 czujiXBJFkeYsp5lnCIKZWPMDn9FSI3/wXuqFbfqFMVOMatnP9X1HzHIsVZUd1axQI8d 35sOPjL6yiBmfGpte5dDAafW4TBP20tq+1YM8UTZpmyHxNiJfmzNnSo9sUtsfL3q6CDZ d57yYPReqFtG6z4PXm1/vFJS0hJ2JbVhzVsQo+Nzzhqyc5ZdcEmBE9VqQm2+sBoTp6YZ 3bgw== 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 b21si43344026plz.21.2019.08.05.11.40.58; Mon, 05 Aug 2019 11:41:13 -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 S1730174AbfHESjH (ORCPT + 99 others); Mon, 5 Aug 2019 14:39:07 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:56342 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727460AbfHESjH (ORCPT ); Mon, 5 Aug 2019 14:39:07 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: ezequiel) with ESMTPSA id E2FA8289EEF Message-ID: Subject: Re: [PATCH 7/9] media: hantro: Add core bits to support H264 decoding From: Ezequiel Garcia To: Tomasz Figa , Boris Brezillon 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 , Jonas Karlman , "open list:ARM/Rockchip SoC..." , Heiko Stuebner , Andrew Morton , Rasmus Villemoes , Philipp Zabel , Hertz Wong Date: Mon, 05 Aug 2019 15:38:39 -0300 In-Reply-To: References: <20190619121540.29320-1-boris.brezillon@collabora.com> <20190619121540.29320-8-boris.brezillon@collabora.com> Organization: Collabora Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.5-1.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hey Tomasz, On Thu, 2019-08-01 at 13:06 +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? > Nice catch. This should be fixed and accounted in TRY_FMT as you suggest. Thanks, Eze