* A new graphics driver approach ... v0.1.0 is out
@ 1995-05-26 4:00 becka
0 siblings, 0 replies; only message in thread
From: becka @ 1995-05-26 4:00 UTC (permalink / raw)
Hello Folks !
-------------
This is a new approach to create something like a GGI (General Graphics
Interface) for Linux.
First of all the current state,as it has changed since the last posting:
===============================
This approach has currently reached V 0.1.0 and is useable for my system
(Spea Mercury P64 and a Multisync-Monitor) now.
I will soon write a driver for TVGA8900 (Trident) and "dumb" Monitors.
Now - what is this GGI ?
=========================
We all know that it is a real mess to work with lots of different graphics
and textmode systems all on the same Linux console :
There is XFree with its own (complicated) config and Svgalib with another
one and SVGATextMode with yet another.(Not to mention DOSEMU using the
cards BIOS).And there are several "special" applications (like vgamp) out
there that use their own approach ...
They all bring along their own drivers (though source is quite the same, as
one adapts it from the other ...) and they do not interact nicely at all
times ...
This is the reason, why I wanted to create a new interface that all systems
could depend on and request all the graphics services they need from.
There were some major flaws in the existing systems that I really wanted to
have corrected:
1. All graphics programs needed to be suid-root, as they needed to use the
iopl()-call which is super-user only.I deem this to be a major security
risk,as I personally would not like to install such a program from a
binary-only distribution,while binary-only is necessary for commercial
purposes (e.g. DOOM, ...).
2. Ease of configuration <=> optimal usage of system ressources
While svgalib is easy to configure,it does not use the system at the
edge of its capabilities - most modes run with quite low refresh-rates.
On the other hand XFree allows you to configure the system according
to its limits,but the config-file is VERY hard to setup for the beginning
user.
3. No "central" control over the graphics,resulting in problems when
switching between VTs with different graphics-packages running.
4. Special servers for accelerated cards (XFree) or only limited
acceleration support (svgalib)
(NOTE: ALL THE MENTIONED PROGRAMS/SYSTEMS ARE GREAT AND I DO NOT WANT TO
FLAME ANYONE WITH THE ABOVE STATEMENTS !)
My approach tries to overcome these limitations/problems by the following
concepts:
1. The graphics-subsystem is installed as several KLMs (kernel loadable module)
what results in :
a) no need for suid-programs,access permissions for the graphics-device
will be sufficient,thus allowing control over who has access to
graphics-mode applications.(This is accomplished in the current version)
b) all graphics/text-modes on all VTs will be controlled from a central
authority,thus guaranteeing perfect interaction.(This will still need
some work, probably a slight change in the kernel ...)
c) easy configuration by choosing the right modules (one for the monitor,
one or more for the graphics-card) while still using the hardware
at its limits (thus the monitor-driver !).
2. An open interface to the driver via the graphics library:
The library will first ask the driver to do a requested task (like
drawing a filled box) on its own.If the driver is capable of doing
so (i.e. it has an optimized function for that,maybe the hardware can
do it all by itself) it will service the request and everything is done.
If it cannot it will return an error to the library, stating that it is
not capable to do a DrawBox either just now (maybe due to a strange
drawing mode, the library will retry at the next call to this function),
in this mode (thus the library will retry when modes have changed) or in
any case (so the library will never retry). The driver may also give away
a hint whether the library should try to use lower-level functions (which
might have accelerated support) or use the mmap()ed graphics-buffer
directly.
In these cases the driver will try to emulate the function by reverting
to more primitive functions - e.g. to draw lots of horizontal lines.
This function will then be handled as above - either by the driver or the
library will use even more primitive functions (like DrawPixel) to fulfill
the request.
Most of the time a hint to use mmap() will be ignored (e.g. it does not
matter for drawing circles), but for example filling the screen might use
another method (memset in the place of several hlines) to gain some speed.
As a consequence from this architecture, the driver will not need to
support hundreds of "standard" algorithms (such as e.g. Bresenham for
line-drawing),if there is no need to do so,as the library would use
it anyway,when the driver says "DrawLine is unsupported".
This will also speed up driver development considerably, as all that
has to be done is to write code for setting the modes and switching
pages.Anything else can be done be defaulting to standard functions.
The driver will already work at this stage and (for unaccelerated cards)
will probably be almost complete.For accelerated cards you can add
acceleration support slowly - function by function until it works ...
The drawback is a slight loss of speed, as every call to a graphics-
function will include a "switch()"-statement that chooses whether to
check the function for availability (once only,the function will be
performed,if successful,else the switch-argument will be altered to
"emulate it"), or to use the driver-funtion or to emulate it.
I consider this to be quite unimportant as a calculated jump does not
need that much time.
This mechanism will also enable background-processing of graphics
applications,as all the driver has to do is to say it cannot do
acceleration when the display is flipped away - the lib will then
revert to using a mem-buffer which will be restored when the display
is flipped to again ...
3. A really COMPLETE graphics library that will be put together from the
XFree and Svgalib sources (and anything else we find useful) so that
EVERY application will find what it needs in this library.
I do NOT want the old mess of everybody doing its own job to turn up
again - the new interface should be easy to integrate into all major
graphics packages - in the best case only a small "compatibility-
library" should be needed to fuse the worlds together.
The current version is quite close tho svgalib - a "#define vga GGI"
at the beginning of the source should do some of the work.
But as I wanted to get a really "consistent" interface it seems to
me that a compatibility-lib will be needed.
So now let's come to the point of it - why all this talk ?
=====================================
I NEED YOUR HELP !
==================
The package you received with this file is FAR from completeness, but that
does not mean it can't be used now - it works really fine for me, except
for some flaws that will need patches to the kernel to correct.
I am NO graphics-wizard - in fact most of the code in this package is stolen
from other packages (see CREDITS).
So I need volunteers for the following tasks:
1. Creating/improving drivers for all major graphics-cards. For most
unaccelerated cards this should be quite easy and maybe I do one for
the TVGA8900 Chipset myself, as I have such a card in my secondary
system (But tell me,if you want to do it ... ) .
2. Creating drivers or config-files (if someone builds a configurable driver)
for the lots of monitors out there.
3. Writing code for the graphics-library (especially emulation-code for
graphics-primitives like filling polygons,...)
Please look into the existing source and tell me
a) if and how it can be improved
b) what you would like to have supported
4. Helping me to improve the interface and check if it can be made even
faster (16 Mpix/second now when filling the screen - without acceleration-
support ...) !
5. Creating interface-libraries that will make the driver usable for
svgalib-applications
6. Building an X-Server using the driver. - Big task ... we should just wait
until we have lots of drivers for just about any hardware - I think the
XFree-Team will then do this all by itself ...
7. Creating a utility that will autodetect the hardware (if possible) and
lets you choose undetectable HW (like the monitor) from a menu or
configure new values for generic drivers.
Maybe SuperProbe would be a good point to start out with, but it should
be able to configure/install the whole system ...
8. Find a better way to cooperate with the kernel in mmap().
9. dunno now - but I am sure I will get lots of suggestions ... :-)
So - if you feel like joining my effort - send me EMail - I will try to
coordinate the work, inform you about others that want to work on the same
task and put the results together to a useful package.
BTW: Can anybody provide a mailing list that will help to coordinate our
efforts and keep everybody "up-to-date" ?
I am sorry,but I cannot do this myself, as my machine is only on the net
via a dialup SLIP connection and thus not always available.
Thanks in advance to all who want to help !
Andy
--
==============================================================================
Andreas Beck | Email : <becka@hp.rz.uni-duesseldorf.de>
Zur Goetscher Muehle 25 | Phone : +49 2173 72916
D-40764 Langenfeld | Fax : +49 2173 83563
==============================================================================
--
Send submissions for comp.os.linux.announce to: linux-announce@news.ornl.gov
PLEASE remember Keywords: and a short description of the software.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1995-05-26 4:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1995-05-26 4:00 A new graphics driver approach ... v0.1.0 is out becka
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox