Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp3949254pxb; Mon, 4 Oct 2021 13:25:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyE/NH1G8mZdAaLkfL93zLRUWfgxSJzDg8MjprU/f0qn+fCkvCNaxkkx7fzR8BVPCa96U93 X-Received: by 2002:a17:90a:514b:: with SMTP id k11mr31292369pjm.103.1633379115407; Mon, 04 Oct 2021 13:25:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633379115; cv=none; d=google.com; s=arc-20160816; b=evgy+UhTbENzBmHx9M4e4RxeuAJEoeXKLgcHiN4beZnZJ6GanfszSmNBYLHW23wPbN I/zrp/xT4aBhhdPIES64VOtCZgB3qZCPEP7s10fo52wLRuiMaf3UEAELGy2tAT5CDQ5+ hQ4ntvi2W2fhy1pAvctcupWhLrnc5HfjsbC4WrWv28lUEcaUiOZReuUJpRLPRgkM0olK 1xqIWrryceRIB2EIv6Xz6wwHn7IjeGRlmuixhdVCiwmZB1BSKJnLib8oRraliNcWs8lw eKZv/4tSjoAEy+8FvEhQUUMg4MNZTY+lwd7m1z3Bv94CJJkeod/Nv7/AtghRMZsoiX8Z eEEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=LV6wzeQGsFyoOhBPr8g2z37igHCW/ue6GL0NpYOZlw8=; b=G3pfbYr1FTFVerK9uyvOuBIvHRrI7e9fCGIOeY91QST+6kASumQFHHdMm0l7Zcuj1/ 67rWetqwJBPVbYvIXdc5XzIGFOxUYGTWS5axzuPmKgwRNZjvbyxHVEWcGTOzMga8qNEC ot7NJUyQO21vh/0iv0t39rDEg8CNiPMzGV8zY0FzLFRKcuPo1IeGUarXN08tQGkVaacj hFKUt9eHOdT6aGy0sQO6GsAmzLPLRLzdz1BfDSpdFbILQ52/31kSUOgJTmEXW2yFvwp9 RWg4mighLekBkTRuh+cmVkXcJeVQx+eIvlvc4M2agPvBXqHNsStsQQO7IpS01F/8TEgA LrHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wJWF3t6N; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i23si19943137pgl.408.2021.10.04.13.25.01; Mon, 04 Oct 2021 13:25:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wJWF3t6N; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237387AbhJDNaN (ORCPT + 99 others); Mon, 4 Oct 2021 09:30:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:43308 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237366AbhJDN2Z (ORCPT ); Mon, 4 Oct 2021 09:28:25 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1744761B2B; Mon, 4 Oct 2021 13:12:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1633353161; bh=XrX7Czu3Yi/FGL1dPnOOl4+W1NlA+UJMrEJpHqP1tQg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wJWF3t6NiCiMNg8nKFAcjxO5MEBpzzfgYFGyTUzzf3rk5ky4OhHF2JDBNIbVtzC2t d/WTzeFMw6JZOllIqt/ihDS8maedM5EfLUYhuNsQGEA5JDtkvo4Fvq9jaAwyzMjKvR +TKRlVb8KRRYgo1jkKN7ooN+24zQFf0RsAPVVZmM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nicolas Dufresne , Jernej Skrabec , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.14 002/172] media: cedrus: Fix SUNXI tile size calculation Date: Mon, 4 Oct 2021 14:50:52 +0200 Message-Id: <20211004125045.029869309@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211004125044.945314266@linuxfoundation.org> References: <20211004125044.945314266@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nicolas Dufresne [ Upstream commit 132c88614f2b3548cd3c8979a434609019db4151 ] Tiled formats requires full rows being allocated (even for Chroma planes). When the number of Luma tiles is odd, we need to round up to twice the tile width in order to roundup the number of Chroma tiles. This was notice with a crash running BA1_FT_C compliance test using sunxi tiles using GStreamer. Cedrus driver would allocate 9 rows for Luma, but only 4.5 rows for Chroma, causing userspace to crash. Signed-off-by: Nicolas Dufresne Fixes: 50e761516f2b8 ("media: platform: Add Cedrus VPU decoder driver") Reviewed-by: Jernej Skrabec Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/staging/media/sunxi/cedrus/cedrus_video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_video.c b/drivers/staging/media/sunxi/cedrus/cedrus_video.c index 32c13ecb22d8..a8168ac2fbd0 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus_video.c +++ b/drivers/staging/media/sunxi/cedrus/cedrus_video.c @@ -135,7 +135,7 @@ void cedrus_prepare_format(struct v4l2_pix_format *pix_fmt) sizeimage = bytesperline * height; /* Chroma plane size. */ - sizeimage += bytesperline * height / 2; + sizeimage += bytesperline * ALIGN(height, 64) / 2; break; -- 2.33.0