From patchwork Mon May 24 20:23:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 12276929 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F93CC04FF3 for ; Mon, 24 May 2021 20:25:58 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9FBBF613CC for ; Mon, 24 May 2021 20:25:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9FBBF613CC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmx.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:32782 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1llH9A-0004fZ-EG for qemu-devel@archiver.kernel.org; Mon, 24 May 2021 16:25:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36104) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llH7n-0003mP-Vx; Mon, 24 May 2021 16:24:32 -0400 Received: from mout.gmx.net ([212.227.17.21]:58523) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llH7m-0002gW-5x; Mon, 24 May 2021 16:24:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1621887855; bh=ybB/jK3BAitA9YZKDHQ3eipIY7xVQZrgcRLdG2b4tAg=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject; b=EEPO702qltdm4QRVK8rhfZlqj6eHMvNn9DwX6PAXE4JUX0tiQ5GM2PDJYj+Qqqqe/ wRqu6/QC/3AAk08Fb4WmlJU5VngsFs5InUhCYi8QseS+AuUaFtrT7dRhG/o59At9WB 4pplCda3EhkEU8BS3a7kYn7O94m/aiWjrfbOhmcw= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from ls3530 ([92.116.143.138]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1M1HZi-1ljc9t0hkw-002rXD; Mon, 24 May 2021 22:24:15 +0200 Date: Mon, 24 May 2021 22:23:20 +0200 From: Helge Deller To: qemu-devel@nongnu.org Subject: [PATCH] hw/display/artist: Fix bug in coordinate extraction in artist_vram_read() Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Provags-ID: V03:K1:i8UdfH+aOC1sacxOY/buPS4wY5YwB94pcyCuDmG1DP2b7VKMOBS lULrHjQBtzf8DeXSQjaX+QojJdm1R3Izf2iTUM6CQrbi45t0CkO+RWZYRZj5/pucsVtAsho 45hGkt4nvFNZq1iRuCHq3x3sKKLMs8beERbaIEvNcrgyIira9N3f5QpqtRANC0rxxY6Wkgk 3FmKCJbWpxP4xmDzMuwug== X-UI-Out-Filterresults: notjunk:1;V03:K0:apXmfdWBS7s=:tEu/EzJiSolGj9lmv5wsTq F6M7jDav6qjhWCdsNfqDdbXhC8UE2ndUc0mq5fMU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Nr54x3rwYMFxEMSdTG4WMk0l5lVmvW/ qHVQYemNcWlo6zvtoqkQhPA1pS7nZRshPN6lBaeqirb14IGGznOKbJfOvqOgn2Roxikn4= Received-SPF: pass client-ip=212.227.17.21; envelope-from=deller@gmx.de; helo=mout.gmx.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sven Schnelle , Richard Henderson , Philippe =?iso-8859-15?q?Mathieu-Daud=E9?= , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" The CDE desktop on HP-UX 10 shows wrongly rendered pixels when the local screen menu is closed. This bug was introduced by commit c7050f3f167b ("hw/display/artist: Refactor x/y coordination extraction") which converted the coordinate extraction in artist_vram_read() to use the ADDR_TO_X and ADDR_TO_Y macros, but forgot to right-shift the address by 2 as it was done before. Signed-off-by: Helge Deller Fixes: c7050f3f167b ("hw/display/artist: Refactor x/y coordination extraction") Cc: Philippe Mathieu-Daudé Cc: Richard Henderson Cc: Sven Schnelle Cc: qemu-stable@nongnu.org diff --git a/hw/display/artist.c b/hw/display/artist.c index ed0e637f25..34efd3a565 100644 --- a/hw/display/artist.c +++ b/hw/display/artist.c @@ -1233,8 +1233,8 @@ static uint64_t artist_vram_read(void *opaque, hwaddr addr, unsigned size) return 0; } - posy = ADDR_TO_Y(addr); - posx = ADDR_TO_X(addr); + posy = ADDR_TO_Y(addr >> 2); + posx = ADDR_TO_X(addr >> 2); if (posy > buf->height || posx > buf->width) { return 0;