Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp837192ybi; Fri, 12 Jul 2019 05:28:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqwuQTGQsq2eWkpJ5jd4E7HDhc+aCM0RLWijeQxkhI2r+hhwLZDVIY8vLC4DlRmr6+DyQNI1 X-Received: by 2002:a17:902:54f:: with SMTP id 73mr11011192plf.246.1562934527705; Fri, 12 Jul 2019 05:28:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562934527; cv=none; d=google.com; s=arc-20160816; b=0ta4GJG7XeYB5QY35t6c6w4ax2PnBhtw/WcxpTrCoVLfaHP5CO6rpXyEMcidhxW8MY z5SdL72nStSpcyW/OAWP0FvfPkEiMxcK5PEWQ0R9Bl+Ol334biYc7meTYOB0eWT4kQSg /Kjbg5WErD1LaDDFvMhzBfa6T+A69DhVuf3D24dsS1RwjTHOOvvw08NfCrY3Ww+yHhQO 4O2vooc81HfOnTb7kOBL7gK5vC6j2KgnthczjXOw5MfqIBXBVsh2ix8joOs8DzsetU8T 1dg9Y5VrcmsvXJihegyyCDifIiRdAiop4BE79TI3K9I45b3QqP12W1TY3anH2j9D/p4+ mWvA== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=sVSmWBsarQV5YTJS0CI6zSTdydn3XipXug95Y+qUKrs=; b=AiwajP/LFE4+YIVAdiJ7BSeVTESWezK9NsNUR67UZMYF1am50IK0D4UrtsAarqoEwY GQuRfSWtqCsU8zo5oV1RFMp69eU7mzXD/pccRE7qY6qK4fPYCnw9wzg4EPy5s8UxVTNl xqgbPDq+xhOC54cSYVPP0XTDbHW3oF1c+iciKdrgKSVNr0Hq5aU/5Xsdkrcv/nOMi/Pw 3jZdNqSurPzBoX+azgqPZeePBWsLUAVQU1V2FkSB/wTd1aytZbqDWlUiS9rPbdVKS2BM UuQ1bOU3oPpZGArrDR+HSjF/NJuxk/NfrMVbdvXQqdrYrMOMJgk2RXGN4PYe5W2KesKV ytgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=onx5iBmu; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t14si7962560pgh.51.2019.07.12.05.28.32; Fri, 12 Jul 2019 05:28:47 -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; dkim=pass header.i=@kernel.org header.s=default header.b=onx5iBmu; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728646AbfGLM1e (ORCPT + 99 others); Fri, 12 Jul 2019 08:27:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:40092 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728629AbfGLM1b (ORCPT ); Fri, 12 Jul 2019 08:27:31 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 523E12166E; Fri, 12 Jul 2019 12:27:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562934450; bh=up/VqfVdtX7dNfyQg0SVx7gE5FZPPYce5pUzktaZStA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=onx5iBmuGJERniVNsJbQcZKC6mXdOfvwm0TC421D426kyo6WKm06rN3GJ2dzKGL11 SZIQTRGlHIdMptSx3TbDXQc5/jwEJVlnThETg6W6nbkIH4YmKDaW3pqCgGMBz43/G/ Z+dIORk72Fna4G7FItbg4D6y2PqLAU8OmwM7N7V4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Harsha Manjula Mallikarjun , Steve Longerbeam , Philipp Zabel , Sasha Levin Subject: [PATCH 5.1 058/138] gpu: ipu-v3: image-convert: Fix input bytesperline for packed formats Date: Fri, 12 Jul 2019 14:18:42 +0200 Message-Id: <20190712121630.897056625@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190712121628.731888964@linuxfoundation.org> References: <20190712121628.731888964@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit bca4d70cf1b8f6478a711c448a3a1e47b794b162 ] The input bytesperline calculation for packed pixel formats was incorrect. The min/max clamping values must be multiplied by the packed bits-per-pixel. This was causing corrupted converted images when the input format was RGB4 (probably also other input packed formats). Fixes: d966e23d61a2c ("gpu: ipu-v3: image-convert: fix bytesperline adjustment") Reported-by: Harsha Manjula Mallikarjun Suggested-by: Harsha Manjula Mallikarjun Signed-off-by: Steve Longerbeam Signed-off-by: Philipp Zabel Signed-off-by: Sasha Levin --- drivers/gpu/ipu-v3/ipu-image-convert.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/ipu-v3/ipu-image-convert.c b/drivers/gpu/ipu-v3/ipu-image-convert.c index 0d971985f8c9..19d3b85e0e98 100644 --- a/drivers/gpu/ipu-v3/ipu-image-convert.c +++ b/drivers/gpu/ipu-v3/ipu-image-convert.c @@ -1942,7 +1942,9 @@ void ipu_image_convert_adjust(struct ipu_image *in, struct ipu_image *out, clamp_align(in->pix.width, 2 << w_align_in, MAX_W, w_align_in) : clamp_align((in->pix.width * infmt->bpp) >> 3, - 2 << w_align_in, MAX_W, w_align_in); + ((2 << w_align_in) * infmt->bpp) >> 3, + (MAX_W * infmt->bpp) >> 3, + w_align_in); in->pix.sizeimage = infmt->planar ? (in->pix.height * in->pix.bytesperline * infmt->bpp) >> 3 : in->pix.height * in->pix.bytesperline; -- 2.20.1