From: Helge Deller <deller@gmx.de>
To: "Sven Schnelle" <svens@stackframe.org>,
"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
"Richard Henderson" <richard.henderson@linaro.org>,
qemu-devel@nongnu.org,
"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>
Cc: Helge Deller <deller@gmx.de>
Subject: [PULL 4/7] artist: Fix vertical X11 cursor position in HP-UX
Date: Wed, 18 May 2022 18:17:55 +0200 [thread overview]
Message-ID: <20220518161758.49036-5-deller@gmx.de> (raw)
In-Reply-To: <20220518161758.49036-1-deller@gmx.de>
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 <deller@gmx.de>
Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
hw/display/artist.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
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:
--
2.35.3
next prev parent reply other threads:[~2022-05-18 16:27 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-18 16:17 [PULL 0/7] Artist cursor fix final patches Helge Deller
2022-05-18 16:17 ` [PULL 1/7] seabios-hppa: Update SeaBIOS-hppa to VERSION 5 Helge Deller
2022-05-18 16:17 ` [PULL 2/7] artist: Introduce constant for max cursor size Helge Deller
2022-05-18 16:17 ` [PULL 3/7] artist: Use human-readable variable names instead of reg_xxx Helge Deller
2022-05-18 16:17 ` Helge Deller [this message]
2022-05-18 16:17 ` [PULL 5/7] artist: Allow to turn cursor on or off Helge Deller
2022-05-18 16:17 ` [PULL 6/7] artist: Emulate screen blanking Helge Deller
2022-05-18 16:17 ` [PULL 7/7] artist: Fix X cursor position calculation in X11 Helge Deller
2022-05-18 20:03 ` [PULL 0/7] Artist cursor fix final patches Richard Henderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220518161758.49036-5-deller@gmx.de \
--to=deller@gmx.de \
--cc=f4bug@amsat.org \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=svens@stackframe.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.