From patchwork Thu Nov 8 09:54:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Rosin X-Patchwork-Id: 10673869 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A24711057 for ; Thu, 8 Nov 2018 09:54:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 90D412BC55 for ; Thu, 8 Nov 2018 09:54:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 81F0B2BC80; Thu, 8 Nov 2018 09:54:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 904BB2BC0E for ; Thu, 8 Nov 2018 09:54:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726814AbeKHT3O (ORCPT ); Thu, 8 Nov 2018 14:29:14 -0500 Received: from mail-eopbgr30108.outbound.protection.outlook.com ([40.107.3.108]:6426 "EHLO EUR03-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726517AbeKHT3N (ORCPT ); Thu, 8 Nov 2018 14:29:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axentia.se; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=r4B32P8crnXVkmTx7UrGf0olpER2uul+79u8Mp0iqkM=; b=kK+fI7t4vyb8g6rJouEsPVSIX11Quve3UMbBN13b1AZOVUA+nirJdqEMzAEPodsuD3H3FGMKIDQE4rDzcyFKELyYklQuDYI8U/hoTSOfcHoapNhPIbGEF9gxGU4CQ15Px8ArFEdECM1Dic6sKP8bgEsLojV790VWv5wsX6JYXzM= Received: from AM5PR0201MB2451.eurprd02.prod.outlook.com (10.169.244.8) by AM5PR0201MB2322.eurprd02.prod.outlook.com (10.169.243.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.21; Thu, 8 Nov 2018 09:54:28 +0000 Received: from AM5PR0201MB2451.eurprd02.prod.outlook.com ([fe80::7d9b:e9c1:14e6:b72a]) by AM5PR0201MB2451.eurprd02.prod.outlook.com ([fe80::7d9b:e9c1:14e6:b72a%3]) with mapi id 15.20.1294.034; Thu, 8 Nov 2018 09:54:28 +0000 From: Peter Rosin To: "linux-kernel@vger.kernel.org" CC: Peter Rosin , Bartlomiej Zolnierkiewicz , Tomi Valkeinen , Fabian Frederick , Geert Uytterhoeven , Geoff Levand , James Simmons , "dri-devel@lists.freedesktop.org" , "linux-fbdev@vger.kernel.org" Subject: [REGRESSION PATCH] fbdev: fbmem: behave better with small rotated displays and many CPUs Thread-Topic: [REGRESSION PATCH] fbdev: fbmem: behave better with small rotated displays and many CPUs Thread-Index: AQHUd0kJeMKk7GNIpUCu5UKgc0OKYA== Date: Thu, 8 Nov 2018 09:54:28 +0000 Message-ID: <20181108095347.19326-1-peda@axentia.se> Accept-Language: en-US, sv-SE Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.11.0 x-originating-ip: [85.226.244.23] x-clientproxiedby: HE1PR07CA0042.eurprd07.prod.outlook.com (2603:10a6:7:66::28) To AM5PR0201MB2451.eurprd02.prod.outlook.com (2603:10a6:203:35::8) authentication-results: spf=none (sender IP is ) smtp.mailfrom=peda@axentia.se; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;AM5PR0201MB2322;6:aO5mj1juLd/J8r/+vHM/HSz1RqNspLA8aeGlvSkj+0jIF2ua6zSdXiWOZZ8Sam0eHOCp/Q0CI6u5qYPVTpoF/343gbLPyWqgCsyDyeROuhK79HarJMkqgGqxLIUga33/JUEqznBthOWs968WMfmHsaAOwjBrXQvaJVMth1lquwEs0Yx0ac24ROpHCJilWhx+p/jQPXZxKnsrDOFb5+IyFO7zrQowcFR+ocl8m/MJD/JGDU+10qGCV9LXmxhtRRRRXQfEjHHebL4mCYZNuurXqF6i3BEJZIa33bC0HDYb4RwITw+gTzP6GutelrMzCHkYvr9Z3/NS1gGm2aCW0PxkN3PkJ0WavIA+mdI5nD1u/k41KL2MWmjZ4lm6xATwxAk2nXpsbtn6Ms4CkkuMsiosmuVJJ7ESPGq99uyBViyHzNSD4w9YIslgpINcSuUSxStlzmU1cKsw032EX6W8l7ndwA==;5:/o9PLRFKsGqV49yz9fcptabIkZsb9v1wZO7dB8Ql+2tyOmob0L/zi6CW9qpp0QAJX+YsJYL06EBKIJ8rClDuoVKe02MCZCb/6wXtEfRp6XdfA5nymIAztiX0hyPGyuF1j6FUvg1Prp3P88v7JWYGz/14ZajZgaYpycQ1uJ+RQyo=;7:A36KEY9huqBstKSaQBWx3XIlmtpUgMezefRSqW5pvMod8FsmE3iuUikynakGl07IDcce4SsaeBAhna/LQTAp7aJtqSB/XKM2WZRSOOaQHhYHTAwVL2SMBeWIIg8Wwzl9ke7ds7rcKzwMSbyX+mX2Kw== x-ms-office365-filtering-correlation-id: de42e3d0-65a0-44c5-b222-08d645602c2c x-microsoft-antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(7021145)(8989299)(4534185)(7022145)(4603075)(4627221)(201702281549075)(8990200)(7048125)(7024125)(7027125)(7023125)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:AM5PR0201MB2322; x-ms-traffictypediagnostic: AM5PR0201MB2322: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231382)(944501410)(52105095)(148016)(149066)(150057)(6041310)(20161123564045)(20161123562045)(20161123558120)(20161123560045)(2016111802025)(6043046)(201708071742011)(7699051)(76991095);SRVR:AM5PR0201MB2322;BCL:0;PCL:0;RULEID:;SRVR:AM5PR0201MB2322; x-forefront-prvs: 0850800A29 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(396003)(136003)(366004)(39830400003)(376002)(346002)(189003)(199004)(186003)(508600001)(2900100001)(486006)(6486002)(66066001)(105586002)(8936002)(52116002)(36756003)(99286004)(50226002)(2501003)(5660300001)(97736004)(68736007)(25786009)(14444005)(386003)(6506007)(256004)(3846002)(6116002)(7736002)(1076002)(8676002)(81166006)(86362001)(575784001)(81156014)(316002)(4326008)(6916009)(305945005)(6512007)(74482002)(6436002)(2616005)(2906002)(54906003)(71190400001)(14454004)(53936002)(26005)(102836004)(106356001)(71200400001)(5640700003)(476003)(2351001)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:AM5PR0201MB2322;H:AM5PR0201MB2451.eurprd02.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: axentia.se does not designate permitted sender hosts) x-microsoft-antispam-message-info: laFrL/WcLXxBGHRYNKUhF+1vewvQvr3+cYtekPfjZ5c8QWCx55SE/VO6aVMIAlNQkTMjqAoTWJKaczixKZdj3BezHB2JXZNwPtpro/08/Pv3VKOqHZ/tswqqNerdoTH8Pp+xRJE2t+TpfdNreAvQBra0SRPLR75wBu5siaL7LApbF5wzPhP8Ey2Py1lK235aEkmK1MF+xzRx152NCyPNqhwq8lYDQr9RTY8vaI2vQ0i4tX5l1FhBN0HXIA/WNTO7vVe5wZrHJ6Et0HbAUEhnD1NMLPC4pPeVspzql6HwYrJYoRLrCC5jAsNx2aNqyPwAWVZLZ3in7ggXa4hM0CNPUol+OPzStYkcFMb0Ly6wTFM= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: axentia.se X-MS-Exchange-CrossTenant-Network-Message-Id: de42e3d0-65a0-44c5-b222-08d645602c2c X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Nov 2018 09:54:28.3390 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4ee68585-03e1-4785-942a-df9c1871a234 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0201MB2322 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Blitting an image with "negative" offsets is not working since there is no clipping. It hopefully just crashes. For the bootup logo, there is protection so that blitting does not happen as the image is drawn further and further to the right (ROTATE_UR) or further and further down (ROTATE_CW). There is however no protection when drawing in the opposite directions (ROTATE_UD and ROTATE_CCW). Add back this protection. The regression is 20-odd years old but the mindless warning-killing mentality displayed in commit 34bdb666f4b2 ("fbdev: fbmem: remove positive test on unsigned values") is also to blame, methinks. Fixes: 448d479747b8 ("fbdev: fb_do_show_logo() updates") Signed-off-by: Peter Rosin --- drivers/video/fbdev/core/fbmem.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c index bb7f5f23e347..1abeb0b72455 100644 --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -435,7 +435,9 @@ static void fb_do_show_logo(struct fb_info *info, struct fb_image *image, image->dx += image->width + 8; } } else if (rotate == FB_ROTATE_UD) { - for (x = 0; x < num; x++) { + u32 dx = image->dx; + + for (x = 0; x < num && image->dx <= dx; x++) { info->fbops->fb_imageblit(info, image); image->dx -= image->width + 8; } @@ -447,7 +449,9 @@ static void fb_do_show_logo(struct fb_info *info, struct fb_image *image, image->dy += image->height + 8; } } else if (rotate == FB_ROTATE_CCW) { - for (x = 0; x < num; x++) { + u32 dy = image->dy; + + for (x = 0; x < num && image->dy <= dy; x++) { info->fbops->fb_imageblit(info, image); image->dy -= image->height + 8; }