Subject: wsdisplay cursor emulop question
To: None <tech-kern@netbsd.org>
From: Jukka Andberg <jandberg@netbsd.org>
List: tech-kern
Date: 03/30/2002 16:29:27
Hello tech-kern,

I've been wondering about the meaning of the cursor
callback in the wsdisplay_emulops structure. In particular,
should it mean:
1) position cursor (and pretend it is a hardware cursor), or
2) draw cursor?

For displays with hardware cursor this should not matter but bitmapped
displays are another thing. As the cursor image is rendered into the
bitmap any of the putchar, erase and copy operations can destroy the
cursor if they are performed in an area that contains the cursor.

As I see it, option 1) would let the MD code to deal it as it wishes, and
with option 2) the MI emulation code would make sure to erase cursor
before doing any operations that might affect it, and redraw it
afterwards.

I couldn't find it documented either way, the code mostly seems
to suggest 2). That it, the cursor is always cleared before entering the
emulation loop, and redrawn after exiting it.

Exception is that the code (in wsemul_vt100_subr.c) that handles
a escape sequence that turns cursor on/off makes immediate call
to the cursor emulop.