From patchwork Mon May 16 14:49:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 12850944 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 A949EC433F5 for ; Mon, 16 May 2022 15:13:20 +0000 (UTC) Received: from localhost ([::1]:50346 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nqcPP-0003cn-Na for qemu-devel@archiver.kernel.org; Mon, 16 May 2022 11:13:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51176) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nqc3y-0005xX-9E for qemu-devel@nongnu.org; Mon, 16 May 2022 10:51:10 -0400 Received: from mout.gmx.net ([212.227.17.20]:39935) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nqc2o-0008DI-Ui for qemu-devel@nongnu.org; Mon, 16 May 2022 10:51:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1652712577; bh=bC8k4CmHvr7MWuEgzVuQnCwm1AP7Chq+SHlVnjE75DI=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=RXM67Nt7nLZGQ5BbNbH72GdQ8XQjahF61JiDkzbJKfj1laifUDM5pU9p40egAkTRx JgOFbn7iNyIkSwqcpIZZPr/DYiDB7sYQMkJmpZHzBJoyVnkHpQkcFr4UThc4KgJjTy vRkFxiE5tF8xJrFxb83i077m3IMxy3UXwyKG2oNE= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from p100.fritz.box ([92.116.160.68]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MDQic-1nzvRn02fm-00AWo8; Mon, 16 May 2022 16:49:37 +0200 From: Helge Deller To: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , Mark Cave-Ayland , Sven Schnelle , qemu-devel@nongnu.org Cc: Stefano Repici , Helge Deller Subject: [PATCH v3 4/7] artist: Fix vertical X11 cursor position in HP-UX Date: Mon, 16 May 2022 16:49:31 +0200 Message-Id: <20220516144934.36273-5-deller@gmx.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220516144934.36273-1-deller@gmx.de> References: <20220516144934.36273-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:dMcpvdYYnl6y6eOFfVtmF87w3e5Ls0+NvJwzvU4c+dFglbxH04s O5P6C2414Gje55yXQlUdIN32b2nMq7cC/uqCU97Vf0W2Ecpt9SjPOjQKcHyh9CCONpKzvcg RxtnabEuhVn3PWUn7NBuaeq+ig1ZioZRIREzUm84etpU6FmnK9SEwaRA7LiM6b35VWNt85v reY4TkvSldIL/nlbI2yJQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:wfJg0RjVH6U=:Qvyw6nlTi1vX656jq1msdG tyxX+CKqzV7CYK+Yyxfpvgo6BcruaP8CbmCXO3pmP63e/+Nsij3nzRjJVmr3Pu0ajBjsCsi09 JTSwX5BUzXF1gC9dcGGMKdDARRYkZ2YEg8NnT10Lu5MdthI6lfyozPtSZoNwM0f2uECMAQ8G4 IGTAYyyLQGMJCHt5EH0+XJ6cwIHst4SIV4Hw9Oc0A8kh69mZ6ZA298SQpB2aGLpj7a+pbwthb IE3Hd+Z8RbuU8N9PDntKf9dALEsPKYpV3WGC27Ts8KiTDJPHX3JeRg4XhCfRMvEFdziIMmVtv IAJ9JZa7ve4semciLF48/OsKo+F3NWMrAcO+C95gwJk86+vKe+uKUSsk+UGiZH8sEL5Y+sJ4v cQ5SWOxtnR+FTnYJ6jhXMPWxtQ7qAk1OpQWMiuYEifW0/H7usHYlfIxDC8KRekDV7Kywf5ci/ CiIJIic8CoM3p7KEI6dCNXwCmCvjmFKIEjdTAc0RkwoBKg4e1nMHck2StNmeBuLkLiWYuM19S EPfSQQnkknNxdO+u/cvJDjrzeJxB/FeEEClT+KWQl/9I+j51V0wdGcnACdKOqxrUzZ74hJXqa MdqH02+NoQsNX1xKdiiiZNn7D89niWAk0G3N2For6sPuDDkIxZ7mdkOto+SiZQejUzh3mTJY3 oxE5Ab9YC6Z8S7tkazKKWXZpZFeDZn2NFMBvKi7nXRn+zZHUyA/4JVG3uzE43M4VaO59uqH08 23CuP1e7M2Tq2gkz8sZ5SZX6C1Eo2bgrrwOMfu3if7+CZefnz9pDduelsMYjVROpaherlbS9n uHSlsSVm5kN+7tMqYxAjZ/GwlQhTXggK33E8YOcawEaZ6d25pxuiIUrotMb/zzv2w9UR6ljDH 7GOTi+yqt11BIHLHwlDChZBvYefoT308nBC9G1KOQFoWBgm1zANZZPnFgYpLcgwAdmpNUGiqE iUsyjtswUbQhFYAF22AIzEaVl+2s6oO+UZmRRacDleLJE//bPcaIrZcYCBc9pLLDzclzgprbf EsitxJxk78sNLAGszHwX8Xr2d+pOYUwqqie/UqrBsNX7qBucZ9/XmGtHBwIZ3TtnCoFhvqK2R 0MgPnks5Ace3Eo= Received-SPF: pass client-ip=212.227.17.20; envelope-from=deller@gmx.de; helo=mout.gmx.net X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, FREEMAIL_FROM=0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_HELO_TEMPERROR=0.01, T_SPF_TEMPERROR=0.01 autolearn=no 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: