Index: [thread] [date] [subject] [author]
  From: Morten Rolland <Morten.Rolland@asker.mail.telia.com>
  To  : ggi-develop@eskimo.com
  Date: Mon, 01 Feb 1999 22:19:09 +0000

Re: The battles.

James Simmons wrote:

[reformatted for easy reading]

> > If (2) is not available as an (emulated) accel in
> > the kernel, you have to break up the accel list
> > into two ioctls - with a userland "put-some-image"
> > performed in the middle?
>
> No call the accel capability ioctl call. If you don't
> use this and still call the accels it will just ignore
> the command. The reason to avoid software emulation
> kernel side is to avoid putting things like software Z
> buffering into the kernel. This would be bad and very
> very slow.

OK.  Put another way:

I write a GGI-application, and I want it to run fast and
use accels where available.  If accels are not available
for some operation I want to do, like "put-some-image"
(which is easily detected as you explained), I may *still*
have to do "put-some-image"... Question is *how* do I do
it?

Case 1: If "put-some-image" is part of the GGI-primitives,
        it would be insane not relying on GGI to do a good
        job doing it for me, so I use the GGI-primitive.

Case 2: If "put-some-image" is not part of the GGI-
        primitives, like z-buffering that you mentioned,
        I may have to do it myself, using GGI-primitives
        when my algorithm finishes.

In order to make my program run everywhere, I should as a
last resort, rely only upon GGI-primitives available
everywhere.  My program may even be very simple, and *only*
uses primitives and has no special tests for accels.

Now, the problem is:  What if 50% of those primitives
are available as accels, and 50% are not?

Example: I draw lines, so I tell GGI to draw lines.  My
gfx only supports accels for horisontal and vertical
lines (rectangles), but that is something GGI should
figure out, right?

The result would be mixed user-space SW and accels,
introducing context-switching that reduces the speed of
the draw-line primitive.

> Need to use that accel ability call. Then you make sure
> you don't send that packet.

Exactly, but what do I do instead (or GGI) ?

If the primitive had a kernel-side SW implementation,
a context-switch would possibly have been avoided.

Intermingeled accels/SW operations would be a selling
point for user-space accels only (Ie. the X-server),
since context-switching would be eliminated, and the
input feed to X would be heavily buffered, shared
memory even. Hmm.

I know this is a can of worms, and I can't really
imagine how Mr. Torvalds would react upon discovering
an attempt to put software line-drawing into the
kernel.

- Morten

Index: [thread] [date] [subject] [author]