|
From: Antonino D. <ad...@po...> - 2003-01-10 10:39:20
|
On Fri, 2003-01-10 at 02:16, James Simmons wrote: > > > BTW, is it possible that someone passes data that is larger (except for bugs)? > > We have control over what happens in the kernel. Data passed from userspace is > > a different issue, of course. > > Yes. Soon the standard ioctl for a cursor will be truly in place. This > means cfb_imageblit could be a issue from userland. > If you are going to export the cursor API to userland, then soft_cursor is useless, because it implies that we always have a copy of the screen under the cursor (so we can restore it when we move the cursor) and it also implies that fb_imageblit can support transparency (so the mask bits will work). For soft cursors, the userland has to take care of it. For those with hardware cursors, this is exportable to user space. The structure fbcursor has one field that is console specific fbcursor.dest which we basically use to invert the cursor image. So the structure that is passed via the cursor ioctl will be slightly different, it should not have the 'dest' field. So when it gets passed to fb_cursor(), dest == NULL. Then this is how drivers can respond: 1. soft_cursor - if cursor->dest == NULL, always exit with an error. 2. hardware cursors which cannot do invert - if cursor->dest == NULL and rop == ROP_XOR, exit with an error, otherwise (ROP_COPY), proceed. 3. hardware cursors with invert - cursor->dest will be ignored so it has full support. The rivafb_cursor() and i810fb_cursor() already behaves like #2 already. Anyway, inverting the cursor image is not commonly used in GUI apps. Typically, they just need an opaque cursor + a transparency mask to "shape" the cursor. Tony |