From patchwork Mon May 16 14:29:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 12850925 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id A8D73C433F5 for ; Mon, 16 May 2022 14:34:38 +0000 (UTC) Received: from localhost ([::1]:39394 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nqbnv-0000Qz-Gb for qemu-devel@archiver.kernel.org; Mon, 16 May 2022 10:34:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45946) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nqbip-000376-1x for qemu-devel@nongnu.org; Mon, 16 May 2022 10:29:20 -0400 Received: from mout.gmx.net ([212.227.17.22]:55031) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nqbin-0004vp-7z for qemu-devel@nongnu.org; Mon, 16 May 2022 10:29:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1652711350; bh=bC8k4CmHvr7MWuEgzVuQnCwm1AP7Chq+SHlVnjE75DI=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=VsAHdfKzfndavWuseHH/RfqlOI5ByCuPCCJqRW5KYgq6meFdemieASBKwDYCh9LsO jJaR5rlqamacttMMYhgVkJzKZQmjPplS9qJkTFXegJMM/66DPs5Zh94bTAfxBrpMnw iyYCEAM2YWHhy/Tdii59+OaFO/0+MSdOKx0mov54= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from p100.fritz.box ([92.116.160.68]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Md6R1-1nHGhZ0zR5-00aHXP; Mon, 16 May 2022 16:29:10 +0200 From: Helge Deller To: Mark Cave-Ayland , qemu-devel@nongnu.org, Richard Henderson , Sven Schnelle , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Cc: Helge Deller , Stefano Repici Subject: [PATCH v2 4/7] artist: Fix vertical X11 cursor position in HP-UX Date: Mon, 16 May 2022 16:29:04 +0200 Message-Id: <20220516142907.32827-5-deller@gmx.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220516142907.32827-1-deller@gmx.de> References: <20220516142907.32827-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:AkgWy1lYZ+D1SGX51J6RBmRcwq8F9cDEbs48hnJATeit79pWBKe UfBarKV/Qia2IE4ueLcgA46D+dBpoTh6jOvWOuVW93IBnKR7do/SC70jk6F/b4Z+GmC9ZFz h0uW48Y/kyj1XbsVmtpW+cwnOVToxMpKf4lb9rLDay5wgsWmnJfRoEHvdDrsyWYK5ZBfT12 For/jRijyY5JLRI+CCfqg== X-UI-Out-Filterresults: notjunk:1;V03:K0:SreHGUHXYjo=:T+WXT3nDY+P+uiLBvq8Ema BLTOzTCmZrCNg0PgbAYeKh+/ZCsIHwvNtSWOB0RHGknkvyvA5vlJ7lWGyhC7uokoG/yTYHUXP MJRdXAQN6Ba/W9NsdVKfW3HfItPjZfFmDK5MYu8nEjt+MDe00KOLVFukYNGgzU4naPiFdJQAR il2Vfgs03GmJ08vJtUIjGfNVZo8R3kSL3HqMS38YDIeRSsFfR5KHlhGZ2L36a7t2nLxSAip3X ezk6DP32U7YLg5m+dJUU+FzbY0aMtdCJemx5Fxv2QPcqjFtchoq43yik+E1SZAUFavEkhUCr5 XAiflhYZ9CTb1a8j2ByZWz1QxXPb0rtF2hATTfGu+0IsvC8uwRBpKA+Fj1phAMLZQa2MgrYzc a+CxgkK+l4ECd15trRK5ehdokoF/yu5yHWpvYXc644QN9K2NGDbSFJ0m9mfOXDuiTkC8p67ZF IGvrMYY7xVb70JW3ZdbAW8tatZiJXSgLkOOwOwZSSbM+ktY3dMC/Z2UNYGU7g5PSeLSyeW1wC RrHkSB3uEbpPj0Ia5rVaEIf1KnZcrTMIVJVw3lAqWx9VAgC52I1lAYK8JAueu9GHfGAIItS3V GUYWdGHP+BRSh7vYHjc8UgJ6xvBPWaLC8ssOxQosYhM3FTF3e9yHUu4c/yg0jbb1q1CXBgCJV 71xHSfrWkdgywqLI4CBHjD1izIwwN9IXI3zN3F2CcT4bGkx+F7tT3p4xYO9VVjUm43/mnM7s/ omTEWVlxMkl9U5Zv5Ml46C63E3/A6Z++tIBBIAQyPejrdIWT+hFftaYcT3fXYq6aTMlQhiC7P LbR6wWQE8odGLakAwouYYPf7SgTUfh+f/nUFi2fUgElpTGUk8NdroTwTiBKgogH+0gntA8p2j cVqWKC7fiBJT4AqmrMKo934ijUVs2FicKZtC5WZ41I7bhk4xtEwoX9iuB2vAzSOH+tDP13D29 7nzAVnnITTw9aqxV/mPRVVD0qGiqt18MGSSMod9Nwd/FBDdO4RwOtRRbUy9RBivsE0C066hDh rsjSwRdMlql8eX/ngNQaprzzppEbWPD052pT2nXb3d2pNPe3zLY4HM7eDmxicrBOKB/o8c3oZ 1IwJK9JijFxfodH7vjcQLEiZCTUvPD5wGkKeWPoMCujOSwRqBM38Ie0Hg== Received-SPF: pass client-ip=212.227.17.22; 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_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Drop the hard-coded value of 1146 lines which seems to work with HP-UX 11, but not with HP-UX 10. Instead encode the screen height in byte 0 of active_lines_low and byte 3 of misc_video as it's expected by the Xorg X11 graphics driver. This potentially allows for higher vertical screen resolutions than 1280x1024 with X11. Signed-off-by: Helge Deller Acked-by: Mark Cave-Ayland --- hw/display/artist.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) -- 2.35.3 diff --git a/hw/display/artist.c b/hw/display/artist.c index c8b261a52e..780cb15026 100644 --- a/hw/display/artist.c +++ b/hw/display/artist.c @@ -337,10 +337,11 @@ static void artist_get_cursor_pos(ARTISTState *s, int *x, int *y) } *x = (lx - offset) / 2; - *y = 1146 - artist_get_y(s->cursor_pos); - /* subtract cursor offset from cursor control register */ *x -= (s->cursor_cntrl & 0xf0) >> 4; + + /* height minus nOffscreenScanlines is stored in cursor control register */ + *y = s->height - artist_get_y(s->cursor_pos); *y -= (s->cursor_cntrl & 0x0f); if (*x > s->width) { @@ -1158,14 +1159,17 @@ static uint64_t artist_reg_read(void *opaque, hwaddr addr, unsigned size) case ACTIVE_LINES_LOW: val = s->active_lines_low; /* activeLinesLo for cursor is in reg20.b.b0 */ - val |= ((s->height - 1) & 0xff); + val &= ~(0xff << 24); + val |= (s->height & 0xff) << 24; break; case MISC_VIDEO: /* emulate V-blank */ - val = s->misc_video ^ 0x00040000; + s->misc_video ^= 0x00040000; /* activeLinesHi for cursor is in reg21.b.b2 */ - val |= ((s->height - 1) & 0xff00); + val = s->misc_video; + val &= ~0xff00UL; + val |= (s->height & 0xff00); break; case MISC_CTRL: