Subject: Re: wsdisplay cursor emulop question
To: None <tech-kern@netbsd.org>
From: Jukka Andberg <jandberg@netbsd.org>
List: tech-kern
Date: 03/31/2002 23:46:06
It is told that on Mar 30, the "Valeriy E. Ushakov" wrote thus:
> On Sat, Mar 30, 2002 at 16:29:27 +0200, Jukka Andberg wrote:
> > 1) position cursor (and pretend it is a hardware cursor), or
> > 2) draw cursor?
> Since the signature of the "cursor" op is:
> void (*cursor)(void *c, int on, int row, int col);
> it both position (row, col) *and* draws (on) cursor.
In my mind positioning implies that the cursor location would be
remembered, but drawing would be a one-off operation.
What happens when say, a character is drawn at the cursor
location, or the line is cleared? Whose responsibility is it
to redraw the cursor?
> Check sys/dev/rasops/rasops.c for MI implementation of emulops for
> framebuffers.
As far as I can tell it assumes that the cursor is erased before any other
drawing operations are performed. For example if a row with visible
cursor is copied then you have two rows with cursor drawn on them.
But in some rare cases, the cursor can be on while the other emulops are
called. I haven't experimented much with rasops, but this looks like it
could be trouble.
For my own code, I would like to know if it needs to handle the cases of
cursor being visible while doing other emulops, or if the MI emulation
functions should be changed to make sure the cursor is off while calling
the emulops. Or both.