Received: by 2002:a05:6520:4d:b0:139:a872:a4c9 with SMTP id i13csp2568398lkm; Mon, 20 Sep 2021 18:56:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzXVtkTD75jJM+2a0ORvuU139XLpxUxdNpmjhc9W8B+JHRSunIqjHyAG9xn84oVu1jDbPCG X-Received: by 2002:a05:6e02:20c7:: with SMTP id 7mr20062219ilq.118.1632188924499; Mon, 20 Sep 2021 18:48:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632188924; cv=none; d=google.com; s=arc-20160816; b=he2r1qZBAYz4p08u/hmsNLsUNyLthY8aRfW6GI6l9zzpjW0ela3CJsaFCXzx119nIr 9h5DsUghWt2ZsCdb8cM2Ot8qAE7GD8iblZ6DejomocFb4OidfzK8ssXvcdzNxZkFAZl4 Ic45kyFtZYZYGZ98gFinXt4yvEjZnj4sJdqtfC7z2y372mnWV3RBJL0IKMqIQhdQ5xF9 oO/Ggr0wtbIDaeEAXCwMBou9LIIYzeWuBSG/k4UkhcFOsM8ZVuz22FtqBtjfqZt0scZj nVj9aeQ5JTXHL9UFSAaiv8byr6OADS2G5jX+HpC1fyZ5SmTFGd2/goATkxPURLdGBSax rwyg== 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=Wg86yy5vN/ShRYJ0psus73m1aPaSWEEkKq7sMJQO8qE=; b=NAOUSIPqR+yLhBl/J8OyVxWpF3R8yNbLvtm5n6MoXna/mt+WXRR8Eu3iQ72fjHZGHK d+yTb5plMXhUoe01yr/urcKCuNp85iMRrll+K9BPcgS3qhyEanZdyjSdOVfP1w0xVWY9 CmJ5ULF22Ma9TfUCNpDgTO97CkAQROOGccc8CSXxZrmoWLOoeHoTUkSiLJFqpJFNZhm9 /PJuHqdb6oSIraf5b8+upXjTKqbpQtJkoM2/wh2IXrgk6EHtkmN2I2M0wET6asPhu8Jt pglvqtvflByyOwzvMVd+fZrQqTEzLrB44BflD7mY9fMt4coOG6hGSluwST/dNw9VBBRp /sSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SMaardzL; 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 y18si2143488iow.31.2021.09.20.18.48.33; Mon, 20 Sep 2021 18:48:44 -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=SMaardzL; 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 S1348098AbhITRfr (ORCPT + 99 others); Mon, 20 Sep 2021 13:35:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:35282 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347505AbhITRdx (ORCPT ); Mon, 20 Sep 2021 13:33:53 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 284C561B05; Mon, 20 Sep 2021 17:05:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632157524; bh=NHvRe30IWsSkWJ2mq2Ui9beXpYwZH+6BGO7/NGxGORw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SMaardzL+xdPpZtxMfvG1jqP7zZdyYS8cCj4El82AuX5swfQwmK8Gsi1EbqhLODWr b0p6c6BOA684uqhMKFoBXN+w4bNVfTX/tsSdOThRX9WamJhVIgzvggrSpSBtCFsmZM licKJFmUO7fEpk/QfVdLD7bLLY8X98nar/njvwHE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Krzysztof Halasa , Philipp Zabel , Sasha Levin Subject: [PATCH 4.19 003/293] gpu: ipu-v3: Fix i.MX IPU-v3 offset calculations for (semi)planar U/V formats Date: Mon, 20 Sep 2021 18:39:25 +0200 Message-Id: <20210920163933.375042292@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163933.258815435@linuxfoundation.org> References: <20210920163933.258815435@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: Krzysztof HaƂasa [ Upstream commit 7cca7c8096e2c8a4149405438329b5035d0744f0 ] Video captured in 1400x1050 resolution (bytesperline aka stride = 1408 bytes) is invalid. Fix it. Signed-off-by: Krzysztof Halasa Link: https://lore.kernel.org/r/m3y2bmq7a4.fsf@t19.piap.pl [p.zabel@pengutronix.de: added "gpu: ipu-v3:" prefix to commit description] Signed-off-by: Philipp Zabel Signed-off-by: Sasha Levin --- drivers/gpu/ipu-v3/ipu-cpmem.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/ipu-v3/ipu-cpmem.c b/drivers/gpu/ipu-v3/ipu-cpmem.c index a9d2501500a1..170371770dd4 100644 --- a/drivers/gpu/ipu-v3/ipu-cpmem.c +++ b/drivers/gpu/ipu-v3/ipu-cpmem.c @@ -545,21 +545,21 @@ static const struct ipu_rgb def_bgra_16 = { .bits_per_pixel = 16, }; -#define Y_OFFSET(pix, x, y) ((x) + pix->width * (y)) -#define U_OFFSET(pix, x, y) ((pix->width * pix->height) + \ - (pix->width * ((y) / 2) / 2) + (x) / 2) -#define V_OFFSET(pix, x, y) ((pix->width * pix->height) + \ - (pix->width * pix->height / 4) + \ - (pix->width * ((y) / 2) / 2) + (x) / 2) -#define U2_OFFSET(pix, x, y) ((pix->width * pix->height) + \ - (pix->width * (y) / 2) + (x) / 2) -#define V2_OFFSET(pix, x, y) ((pix->width * pix->height) + \ - (pix->width * pix->height / 2) + \ - (pix->width * (y) / 2) + (x) / 2) -#define UV_OFFSET(pix, x, y) ((pix->width * pix->height) + \ - (pix->width * ((y) / 2)) + (x)) -#define UV2_OFFSET(pix, x, y) ((pix->width * pix->height) + \ - (pix->width * y) + (x)) +#define Y_OFFSET(pix, x, y) ((x) + pix->bytesperline * (y)) +#define U_OFFSET(pix, x, y) ((pix->bytesperline * pix->height) + \ + (pix->bytesperline * ((y) / 2) / 2) + (x) / 2) +#define V_OFFSET(pix, x, y) ((pix->bytesperline * pix->height) + \ + (pix->bytesperline * pix->height / 4) + \ + (pix->bytesperline * ((y) / 2) / 2) + (x) / 2) +#define U2_OFFSET(pix, x, y) ((pix->bytesperline * pix->height) + \ + (pix->bytesperline * (y) / 2) + (x) / 2) +#define V2_OFFSET(pix, x, y) ((pix->bytesperline * pix->height) + \ + (pix->bytesperline * pix->height / 2) + \ + (pix->bytesperline * (y) / 2) + (x) / 2) +#define UV_OFFSET(pix, x, y) ((pix->bytesperline * pix->height) + \ + (pix->bytesperline * ((y) / 2)) + (x)) +#define UV2_OFFSET(pix, x, y) ((pix->bytesperline * pix->height) + \ + (pix->bytesperline * y) + (x)) #define NUM_ALPHA_CHANNELS 7 -- 2.30.2