******************************************************************************
   WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING !
******************************************************************************

THIS CODE IS ALPHA AND IT PLAYS WITH HARDWARE RESOURCEN AT VERY LOW LEVEL. A
LOT OF FUNCTIONALITY HAS TO BE IMPROVED AND TESTED, THEREFORE, USING IT COULD
BE (IN THE WORST CASE) DANGEROUS FOR YOUR SYSTEM. USE IT ON YOUR OWN RISK !!!

******************************************************************************
   WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING !
******************************************************************************



1)  Install Mesa-3.0 source tree somewhere. Make sure that the Mesa root is
    called 'mesa'. Rename it or make symbolic link:
	'ln -s Mesa-3.0 mesa'

2)  You need to enable write permissions inside of mesa tree:
	'chmod -R +w Mesa-3.0'

3)  Untar the aclMesa.tgz in parent directory of the mesa root:
	'tar xvfz aclMesa.tgz'

4)  Change to superuser. Untar mlx.tgz - the files should automaticly go into
    /usr/local/mlx - YOU HAVE TO USE TAR OPTION 'P':
	'tar xvfzP mlx.tgz'

5)  Untar kernel.tgz somewhere. As superuser you can load and unload kernel
    module with ./ldm and ./rmm; So, now load the module with ./ldm

6)  Copy XF86Config in your /etc dir. There are a lot of funny modelines which
    work on the most modern screens. Otherwise, if you have crapy monitor,
    please check modelines section, or calculate your own modelines. The
    "no_accel" option is needed, to switch off 2d acceleration. 32, 16 and 15
    bpp should work.
    
    ANYWAY, BE CAREFULL WITH MODELINES! TOO HIGH FREQUENCY SETTINGS (ESPECIALY
    HORIZONTAL) CAN DAMAGE OR EVEN KILL YOUR MONITOR !

				    * * *

    After you installed mlx.tgz, loaded kernel module and edited XF86Config,
    the superuser rights are not required anymore, except if you play with
    Quake or DGA.

				    * * *

7)  To be able to compile and link demos, export LD_LIBRARY_PATH:
	'export LD_LIBRARY_PATH=/usr/local/mlx/lib: \
				/parrent-of-mesa-root/mesa/lib'

8)  Now you can build mesa with MLX support:
	'cd mesa; make linux-386-acl'

9)  start X server (The normal 3.3.2 one, with PM2 support)

10) export ACL_MESA_HW=PM2

11) If you want to test quake, you have to be superuser. AFAIK, the quake2
    version looks after 'libMesaGL.so.2', so you have to make folowing
    symbolic link inside of quake directory:
	'ln -s /parrent-of-mesa-root/mesa/lib/libMesaGL.so.3.0 libMesaGL.so.2'
	
    The LD_LIBRARY_PATH should be extended with '.' directory - and you have
    to start quake from its root directory:
	'export LD_LIBRARY_PATH=.:/usr/local/mlx/lib: \
				/parrent-of-mesa-root/mesa/lib'

    Don't forget to export hack for quake:
	'export ACL_MESA_QUAKE=1'
	
    To start quake, try:
	'quake2 +set vid_ref glx'

    To check librarys which are linked with quake try:
	'ldd ref_glx.so'.

    The Quake can be downloaded at
	ftp://ftp.idsoftware.com/idstuff/quake2/unix/

    YOU NEED Quake2 VERSION 3.19a OR NEWER ONE !!!

12) Mesa/OpenGL demos work with normal user rights, except if you play
    with DGA.



ACL Mesa Device Driver:
-----------------------

The folowing environment variables could be used to config ACL DD:

- ACL_MESA_HW:
	sets the rendering hardware. Currently supported: 'PM2'

- ACL_MESA_VIDMODE:
	0/1 - enables switching to the best resolutions. This depends on
	modelines you have in your XF86Config.

- ACL_MESA_DGA:
	0/1 - enables usage of the DGA extension (superuser required) The
	mouse doesn't work properly when using it, but you can save your
	screen layout when playing with the MLX toy.

- ACL_MESA_QUAKE:
	0/1 - switches the Quake hack off/on. Quake and our library have
	some problems with alpha-blending, because PM2 doesn't support all 
	alpha-blending operations.

- ACL_MESA_FULL:
	0 - rendering into window (not implemented yet)
	1 - Screen Offset double buffering
	2 - Bit Blit double buffering
	3 - Color Depth double buffering (not implemented yet)


