summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralanh <alanh>2000-09-24 09:33:55 +0000
committeralanh <alanh>2000-09-24 09:33:55 +0000
commitc3ddda50187b5b23b5e93f7cbdf637f2f2d24fd3 (patch)
tree1f643a4ce46d389a893476bd6120a72d10d60d86
parent31f0e3e7eea143de496b45bd61e487cce5e3cd0b (diff)
commit xfree86 4.0.1d-pre update
-rw-r--r--xc/config/cf/FreeBSD.cf12
-rw-r--r--xc/config/cf/Imake.tmpl10
-rw-r--r--xc/config/cf/X11.tmpl45
-rw-r--r--xc/config/cf/cygwin.rules4
-rw-r--r--xc/config/cf/kdrive.cf8
-rw-r--r--xc/config/cf/linux.cf487
-rw-r--r--xc/config/cf/xfree86.cf25
-rw-r--r--xc/config/util/mkhtmlindex.sh4
-rw-r--r--xc/doc/specs/GL/Imakefile4
-rw-r--r--xc/doc/specs/GL/libGL.txt197
-rw-r--r--xc/extras/Mesa/src/fog.c6
-rw-r--r--xc/extras/Mesa/src/teximage.c2
-rw-r--r--xc/extras/Mesa/src/vbrender.c2
-rw-r--r--xc/extras/rman/contrib/bennett.txt2
-rwxr-xr-xxc/extras/rman/contrib/hman.pl2
-rw-r--r--xc/extras/rman/contrib/http-rman.c2
-rw-r--r--xc/extras/rman/rman.12
-rw-r--r--xc/extras/rman/rman.html2
-rw-r--r--xc/lib/GL/Imakefile2
-rw-r--r--xc/lib/GL/dri/XF86dri.c2
-rw-r--r--xc/lib/GL/dri/drm/Imakefile32
-rw-r--r--xc/lib/GL/glx/packsingle.h4
-rwxr-xr-xxc/lib/GL/makeprofile.sh1
-rw-r--r--xc/lib/GL/mesa/src/drv/Imakefile4
-rw-r--r--xc/lib/GL/mesa/src/drv/ffb/Imakefile8
-rw-r--r--xc/lib/GL/mesa/src/drv/gamma/Imakefile9
-rw-r--r--xc/lib/GL/mesa/src/drv/i810/Imakefile16
-rw-r--r--xc/lib/GL/mesa/src/drv/i810/i810_3d_reg.h2
-rw-r--r--xc/lib/GL/mesa/src/drv/i810/i810_xmesa.c2
-rw-r--r--xc/lib/GL/mesa/src/drv/i810/i810context.h2
-rw-r--r--xc/lib/GL/mesa/src/drv/i810/i810fastpath.c1
-rw-r--r--xc/lib/GL/mesa/src/drv/i810/i810ioctl.c3
-rw-r--r--xc/lib/GL/mesa/src/drv/i810/i810ioctl.h2
-rw-r--r--xc/lib/GL/mesa/src/drv/i810/i810state.c2
-rw-r--r--xc/lib/GL/mesa/src/drv/i810/i810tris.c1
-rw-r--r--xc/lib/GL/mesa/src/drv/i810/i810tris.h1
-rw-r--r--xc/lib/GL/mesa/src/drv/i810/i810tritmp.h1
-rw-r--r--xc/lib/GL/mesa/src/drv/i810/i810vb.c1
-rw-r--r--xc/lib/GL/mesa/src/drv/i810/i810vb.h1
-rw-r--r--xc/lib/GL/mesa/src/drv/mga/Imakefile16
-rw-r--r--xc/lib/GL/mesa/src/drv/mga/mga_xmesa.c3
-rw-r--r--xc/lib/GL/mesa/src/drv/mga/mga_xmesa.h1
-rw-r--r--xc/lib/GL/mesa/src/drv/mga/mgabuffers.c2
-rw-r--r--xc/lib/GL/mesa/src/drv/mga/mgabuffers.h2
-rw-r--r--xc/lib/GL/mesa/src/drv/mga/mgadd.c2
-rw-r--r--xc/lib/GL/mesa/src/drv/mga/mgaeltpath.c1
-rw-r--r--xc/lib/GL/mesa/src/drv/mga/mgaelttmp.h1
-rw-r--r--xc/lib/GL/mesa/src/drv/mga/mgafastpath.c1
-rw-r--r--xc/lib/GL/mesa/src/drv/mga/mgaioctl.c4
-rw-r--r--xc/lib/GL/mesa/src/drv/mga/mgaioctl.h3
-rw-r--r--xc/lib/GL/mesa/src/drv/mga/mgaspan.c2
-rw-r--r--xc/lib/GL/mesa/src/drv/mga/mgastate.c2
-rw-r--r--xc/lib/GL/mesa/src/drv/mga/mgatex.c2
-rw-r--r--xc/lib/GL/mesa/src/drv/mga/mgatris.c7
-rw-r--r--xc/lib/GL/mesa/src/drv/mga/mgatris.h1
-rw-r--r--xc/lib/GL/mesa/src/drv/mga/mgatritmp.h1
-rw-r--r--xc/lib/GL/mesa/src/drv/mga/mgavb.c1
-rw-r--r--xc/lib/GL/mesa/src/drv/mga/mgavb.h1
-rw-r--r--xc/lib/GL/mesa/src/drv/r128/Imakefile5
-rw-r--r--xc/lib/GL/mesa/src/drv/r128/r128_cce.c2
-rw-r--r--xc/lib/GL/mesa/src/drv/r128/r128_cce.h2
-rw-r--r--xc/lib/GL/mesa/src/drv/r128/r128_clear.c2
-rw-r--r--xc/lib/GL/mesa/src/drv/r128/r128_context.c2
-rw-r--r--xc/lib/GL/mesa/src/drv/r128/r128_context.h2
-rw-r--r--xc/lib/GL/mesa/src/drv/r128/r128_dd.c2
-rw-r--r--xc/lib/GL/mesa/src/drv/r128/r128_fastpath.c2
-rw-r--r--xc/lib/GL/mesa/src/drv/r128/r128_init.h2
-rw-r--r--xc/lib/GL/mesa/src/drv/r128/r128_pipeline.c2
-rw-r--r--xc/lib/GL/mesa/src/drv/r128/r128_pipeline.h2
-rw-r--r--xc/lib/GL/mesa/src/drv/r128/r128_screen.c2
-rw-r--r--xc/lib/GL/mesa/src/drv/r128/r128_screen.h2
-rw-r--r--xc/lib/GL/mesa/src/drv/r128/r128_span.c2
-rw-r--r--xc/lib/GL/mesa/src/drv/r128/r128_state.c2
-rw-r--r--xc/lib/GL/mesa/src/drv/r128/r128_swap.c2
-rw-r--r--xc/lib/GL/mesa/src/drv/r128/r128_tex.c2
-rw-r--r--xc/lib/GL/mesa/src/drv/r128/r128_tris.c2
-rw-r--r--xc/lib/GL/mesa/src/drv/r128/r128_tris.h2
-rw-r--r--xc/lib/GL/mesa/src/drv/r128/r128_tritmp.h2
-rw-r--r--xc/lib/GL/mesa/src/drv/r128/r128_vb.c2
-rw-r--r--xc/lib/GL/mesa/src/drv/r128/r128_vb.h2
-rw-r--r--xc/lib/GL/mesa/src/drv/sis/Imakefile15
-rw-r--r--xc/lib/GL/mesa/src/drv/sis/sis_alloc.c79
-rw-r--r--xc/lib/GL/mesa/src/drv/sis/sis_clear.c43
-rw-r--r--xc/lib/GL/mesa/src/drv/sis/sis_common.h35
-rw-r--r--xc/lib/GL/mesa/src/drv/sis/sis_ctx.c33
-rw-r--r--xc/lib/GL/mesa/src/drv/sis/sis_ctx.h51
-rw-r--r--xc/lib/GL/mesa/src/drv/sis/sis_debug.c33
-rw-r--r--xc/lib/GL/mesa/src/drv/sis/sis_debug.h33
-rw-r--r--xc/lib/GL/mesa/src/drv/sis/sis_fastpath.c33
-rw-r--r--xc/lib/GL/mesa/src/drv/sis/sis_fog.c33
-rw-r--r--xc/lib/GL/mesa/src/drv/sis/sis_init.h33
-rw-r--r--xc/lib/GL/mesa/src/drv/sis/sis_linefunc.h35
-rw-r--r--xc/lib/GL/mesa/src/drv/sis/sis_lock.h33
-rw-r--r--xc/lib/GL/mesa/src/drv/sis/sis_mesa.c33
-rw-r--r--xc/lib/GL/mesa/src/drv/sis/sis_mesa.h33
-rw-r--r--xc/lib/GL/mesa/src/drv/sis/sis_reg.h33
-rw-r--r--xc/lib/GL/mesa/src/drv/sis/sis_render.c35
-rw-r--r--xc/lib/GL/mesa/src/drv/sis/sis_span.c35
-rw-r--r--xc/lib/GL/mesa/src/drv/sis/sis_stencil.c33
-rw-r--r--xc/lib/GL/mesa/src/drv/sis/sis_swzfunc.h33
-rw-r--r--xc/lib/GL/mesa/src/drv/sis/sis_texture.c48
-rw-r--r--xc/lib/GL/mesa/src/drv/sis/sis_trifunc.h33
-rw-r--r--xc/lib/GL/mesa/src/drv/sis/sis_xmesa.c37
-rw-r--r--xc/lib/GL/mesa/src/drv/sis/sis_xmesaP.h2
-rw-r--r--xc/lib/GL/mesa/src/drv/sis/sis_xwin.c33
-rw-r--r--xc/lib/GL/mesa/src/drv/tdfx/Imakefile5
-rw-r--r--xc/programs/Imakefile10
-rw-r--r--xc/programs/Xserver/Imakefile85
-rw-r--r--xc/programs/Xserver/hw/kdrive/igs/Imakefile9
-rw-r--r--xc/programs/Xserver/hw/kdrive/igs/igs.c5
-rw-r--r--xc/programs/Xserver/hw/xfree86/common/xf86Config.c13
-rw-r--r--xc/programs/Xserver/hw/xfree86/common/xf86PciInfo.h32
-rw-r--r--xc/programs/Xserver/hw/xfree86/common/xf86pciBus.c220
-rw-r--r--xc/programs/Xserver/hw/xfree86/common/xf86pciBus.h17
-rw-r--r--xc/programs/Xserver/hw/xfree86/doc/README.DRIcomp201
-rw-r--r--xc/programs/Xserver/hw/xfree86/doc/sgml/DRI.sgml2
-rw-r--r--xc/programs/Xserver/hw/xfree86/doc/sgml/DRIcomp.sgml10
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64io.h51
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/chips/ct_video.c82
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp.h18
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_driver.c270
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_xaa.c473
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_xaam.c58
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/glint/Imakefile5
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/glint/README.pm3128
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/glint/glint.cpp25
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/glint/glint.h6
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/glint/glint_driver.c90
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/glint/glint_regs.h48
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_accel.c383
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_dac.c243
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/i810/Imakefile7
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/i810/i810.cpp53
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/i810/i810.h23
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/i810/i810_accel.c29
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/i810/i810_dga.c83
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/i810/i810_dri.c52
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c367
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/i810/i810_memory.c230
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/i810/i810_reg.h2
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/i810/i810_video.c426
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/i810/i810_wmark.c13
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt_driver.c4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/mga/Imakefile3
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/mga/mga.h13
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dacG.c54
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dri.c2
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/mga/mga_driver.c64
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/mga/mga_video.c51
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/r128/Imakefile4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/r128/r128.h17
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/r128/r128_accel.c26
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/r128/r128_dri.c2
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/r128/r128_driver.c667
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/r128/r128_reg.h14
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/sis/init300.c60
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/sis/init300.h16
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/sis/init301.c967
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/sis/init301.h31
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/sis/initdef.h52
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.c15
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/tdfx/Imakefile4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_accel.c6
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_driver.c30
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_io.c10
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_sli.c1
-rw-r--r--xc/programs/Xserver/hw/xfree86/loader/xf86sym.c47
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/amoeba/Imakefile35
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/amoeba/am_init.c105
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/amoeba/am_io.c192
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/amoeba/am_video.c102
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/bsd/Imakefile19
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/Imakefile11
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/drmmodule.c56
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/Imakefile14
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/drm.h362
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/i810_drm.h188
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/mga_drm.h274
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/r128_drm.h111
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/xf86drmHash.c435
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/xf86drmI810.c86
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/xf86drmMga.c116
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/xf86drmR128.c198
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/xf86drmRandom.c219
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/xf86drmSL.c490
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/bsdi/Imakefile7
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/cygwin/Imakefile30
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/cygwin/cygwin_io.c18
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/dgux/Imakefile7
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/hurd/Imakefile7
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/Imakefile6
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/agpgart.h3
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/Makefile.kernel1
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/Makefile.linux16
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/README.drm2
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/agpsupport.c2
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/auth.c1
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/bufs.c1
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm.h9
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drmP.h6
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/fops.c1
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/gamma_drv.c1
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/gamma_drv.h1
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_context.c1
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_dma.c1
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_drv.c1
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_drv.h1
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/init.c1
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/lists.c1
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/memory.c1
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mga_context.c1
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mga_dma.c1
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mga_drv.c1
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mga_drv.h1
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mga_state.c1
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/picker.c9
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/proc.c1
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_bufs.c1
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_context.c1
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_drv.c1
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_drv.h1
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_context.c33
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_drv.c183
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_drv.h7
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_ds.c33
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_ds.h31
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_mm.c31
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/tdfx_context.c1
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/tdfx_drv.c1
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/tdfx_drv.h1
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/vm.c1
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drm.c10
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmI810.c4
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmMga.c4
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmR128.c3
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/lnxResource.c6
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/lynxos/Imakefile7
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/mach/Imakefile35
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/mach/bios_mmap.c76
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/mach/mach_init.c70
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/mach/mach_io.c289
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/mach/mach_video.c195
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/minix/Imakefile29
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/minix/bios_devmem.c78
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/minix/local.h13
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/minix/mnx_init.c110
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/minix/mnx_io.c277
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/minix/mnx_video.c98
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/nto/Imakefile19
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/os2/Imakefile7
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/pmax/Imakefile7
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/qnx4/Imakefile7
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/sco/Imakefile7
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/drm.h9
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/shared/libc_wrapper.c17
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/sol8_x86/Imakefile7
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/solx86/Imakefile7
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/sysv/Imakefile7
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/xf86_OSproc.h26
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/xf86_ansic.h6
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/xf86_libc.h9
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/xf86drm.h42
262 files changed, 5581 insertions, 7204 deletions
diff --git a/xc/config/cf/FreeBSD.cf b/xc/config/cf/FreeBSD.cf
index 4f5657a8f..1285bc66a 100644
--- a/xc/config/cf/FreeBSD.cf
+++ b/xc/config/cf/FreeBSD.cf
@@ -2,7 +2,7 @@ XCOMM platform: $TOG: FreeBSD.cf /main/21 1997/10/05 20:42:34 kaleb $
XCOMM
XCOMM
XCOMM
-XCOMM platform: $XFree86: xc/config/cf/FreeBSD.cf,v 3.97 2000/08/01 23:38:45 dawes Exp $
+XCOMM platform: $XFree86: xc/config/cf/FreeBSD.cf,v 3.98 2000/08/16 01:45:27 dawes Exp $
#ifndef UseElfFormat
#define UseElfFormat DefaultToElfFormat
@@ -132,6 +132,16 @@ XCOMM operating system: OSName (OSMajorVersion./**/OSMinorVersion./**/OSTeenyVe
#endif
#endif
+/*
+ * 4.1/i386 and 5.0/i386 have the AGP driver.
+ */
+#ifndef HasAgpGart
+#if defined(i386Architecture) && \
+ (OSMajorVersion >= 5 || (OSMajorVersion == 4 && OSMinorVersion >= 1))
+#define HasAgpGart YES
+#endif
+#endif
+
/*
* This doesn't work the way it does on every other system. On FreeBSD it's
* only a "hint, not a demand", whatever that means. Note that this is not
diff --git a/xc/config/cf/Imake.tmpl b/xc/config/cf/Imake.tmpl
index cf62c8596..321fe408c 100644
--- a/xc/config/cf/Imake.tmpl
+++ b/xc/config/cf/Imake.tmpl
@@ -5,7 +5,7 @@ XCOMM
XCOMM
XCOMM
XCOMM
-XCOMM $XFree86: xc/config/cf/Imake.tmpl,v 3.81 2000/06/25 20:17:28 dawes Exp $
+XCOMM $XFree86: xc/config/cf/Imake.tmpl,v 3.82 2000/08/25 13:42:15 dawes Exp $
XCOMM ----------------------------------------------------------------------
/*
@@ -493,6 +493,14 @@ GLIDE2INCDIR = Glide2IncDir
#endif
#endif
GLIDE3INCDIR = Glide3IncDir
+#ifndef Glide3LibName
+#if HasGlide3
+#define Glide3LibName glide3
+#else
+#define Glide3LibName
+#endif
+#endif
+GLIDE3LIBNAME = Glide3LibName
#ifndef HasTk
#define HasTk NO
#endif
diff --git a/xc/config/cf/X11.tmpl b/xc/config/cf/X11.tmpl
index 29d80c9b8..9bd5711f0 100644
--- a/xc/config/cf/X11.tmpl
+++ b/xc/config/cf/X11.tmpl
@@ -5,7 +5,7 @@ XCOMM
XCOMM
XCOMM
XCOMM
-XCOMM $XFree86: xc/config/cf/X11.tmpl,v 1.73 2000/08/09 02:57:19 tsi Exp $
+XCOMM $XFree86: xc/config/cf/X11.tmpl,v 1.75 2000/08/26 16:37:55 keithp Exp $
/***************************************************************************
* *
@@ -298,6 +298,12 @@ XCOMM $XFree86: xc/config/cf/X11.tmpl,v 1.73 2000/08/09 02:57:19 tsi Exp $
#ifndef BuildPSResLibrary
#define BuildPSResLibrary BuildDPSLibraries
#endif
+#ifndef BuildRender
+#define BuildRender NO
+#endif
+#ifndef BuildRenderLibrary
+#define BuildRenderLibrary BuildRender
+#endif
#ifndef BuildMiscDocs
#define BuildMiscDocs NO
@@ -711,6 +717,14 @@ FCHOWN_DEFINES = -DHAS_FCHOWN
#endif
#endif
+#ifndef RenderDefines
+#if BuildRender
+#define RenderDefines -DRENDER
+#else
+#define RenderDefines /**/
+#endif
+#endif
+
#ifndef FontCacheExtentionDefines
#if BuildFontCache
#define FontCacheExtensionDefines -DFONTCACHE
@@ -728,7 +742,7 @@ FCHOWN_DEFINES = -DHAS_FCHOWN
XCSecurityDefines CupDefines PervasiveDBEDefines \
XF86BigfontExtensionDefines DPMSDefines \
LowMemDefines XprintDefines XineramaDefines \
- SitePervasiveExtensionDefines
+ SitePervasiveExtensionDefines RenderDefines
#endif
#ifndef SiteExtensionDefines
#define SiteExtensionDefines /**/
@@ -1408,6 +1422,21 @@ ProjectUnsharedLibReferences(XTHRSTUB,XThrStub,$(XTHRSTUBSRC),XBuildLibDir)
#endif
#endif
+#if BuildRenderLibrary
+#ifndef SharedLibXrender
+#define SharedLibXrender HasSharedLibraries
+#endif
+#ifndef NormalLibXrender
+#define NormalLibXrender YES
+#endif
+#ifndef DebugLibXrender
+#define DebugLibXrender NO
+#endif
+#ifndef ProfileLibXrender
+#define ProfileLibXrender NO
+#endif
+#endif
+
#if BuildGLXLibrary
#ifndef SharedLibGlx
#define SharedLibGlx HasSharedLibraries
@@ -1609,6 +1638,18 @@ ProjectUnsharedLibReferences(GLX,GL,$(GLXLIBSRC),XBuildLibDir)
#endif
#endif
+#if BuildRenderLibrary
+ XRENDERLIBSRC = $(LIBSRC)/Xrender
+#if SharedLibXrender
+#ifndef SharedXrenderRev
+#define SharedXrenderRev 1.0
+#endif
+SharedLibReferences(XRENDER,Xrender,$(XRENDERLIBSRC),SOXRENDERREV,SharedXrenderRev)
+#else
+ProjectUnsharedLibReferences(XRENDER,Xrender,$(XRENDERLIBSRC),XBuildLibDir)
+#endif
+#endif
+
#if BuildFontCacheLib
# ifndef SharedLibXfontcache
# define SharedLibXfontcache NO
diff --git a/xc/config/cf/cygwin.rules b/xc/config/cf/cygwin.rules
index 9ed93be31..a0c6bfa74 100644
--- a/xc/config/cf/cygwin.rules
+++ b/xc/config/cf/cygwin.rules
@@ -1,4 +1,4 @@
-XCOMM $XFree86: xc/config/cf/cygwin.rules,v 3.1 2000/08/09 23:40:09 dawes Exp $
+XCOMM $XFree86: xc/config/cf/cygwin.rules,v 3.2 2000/08/23 21:06:18 dawes Exp $
#define CPPOnlyAsm(basename,options) RemoveFile(basename.i) @@\
$(CPP) AsmDefines $(DEFINES) $(INCLUDES) options basename.S | grep -v '^\#' > basename.i
@@ -120,7 +120,7 @@ CppFileTarget(libname.def,libname-def.cpp,-DLIBRARY_VERSION=rev,$(ICONFIGFILES))
@@\
junk.c: @@\
echo "#include <cygwin/cygwin_dll.h>" >junk.c @@\
- echo "DECLARE_CYGWIN_DLL(dll_main);" >>junk.c @@\
+ echo "/*DECLARE_CYGWIN_DLL(dll_main);*/" >>junk.c @@\
echo "int WINAPI dll_main(HANDLE a, DWORD reason, void *q)" >>junk.c @@\
echo "{ return 1; }" >>junk.c @@\
Concat3(lib,libname,.dll): solist junk.o libname.def @@\
diff --git a/xc/config/cf/kdrive.cf b/xc/config/cf/kdrive.cf
index 68417bac9..f4d42e9a6 100644
--- a/xc/config/cf/kdrive.cf
+++ b/xc/config/cf/kdrive.cf
@@ -1,4 +1,4 @@
-XCOMM $XFree86: xc/config/cf/kdrive.cf,v 1.4 2000/07/07 20:06:56 tsi Exp $
+XCOMM $XFree86: xc/config/cf/kdrive.cf,v 1.6 2000/08/31 04:34:50 keithp Exp $
/*
* This configuration file contains all of the configuration
* information for the XFree86 based X Servers.
@@ -28,6 +28,9 @@ XCOMM $XConsortium: $
#ifndef XItsyServer
#define XItsyServer NO
#endif
+#ifndef XvesaServer
+#define XvesaServer NO
+#endif
#if XItsyServer
#include <itsy.cf>
@@ -43,6 +46,9 @@ XCOMM $XConsortium: $
#ifndef BuildPseudo8
#define BuildPseudo8 NO
#endif
+#ifndef BuildRender
+#define BuildRender YES
+#endif
/*
* By default, build all of the fonts.
diff --git a/xc/config/cf/linux.cf b/xc/config/cf/linux.cf
index 555c4339e..8e63ac181 100644
--- a/xc/config/cf/linux.cf
+++ b/xc/config/cf/linux.cf
@@ -4,47 +4,47 @@ XCOMM platform: $TOG: linux.cf /main/47 1998/04/17 11:32:51 mgreess
-XCOMM platform: $XFree86: xc/config/cf/linux.cf,v 3.133 2000/08/11 17:27:10 dawes Exp $
+XCOMM platform: $XFree86: xc/config/cf/linux.cf,v 3.137 2000/09/19 12:46:03 eich Exp $
#ifndef LinuxElfDefault
-#define LinuxElfDefault YES
+# define LinuxElfDefault YES
#endif
#ifndef UseElfFormat
-#define UseElfFormat LinuxElfDefault
+# define UseElfFormat LinuxElfDefault
#endif
#ifndef OSBinaryType
-#if UseElfFormat
-#define OSBinaryType [ELF]
-#else
-#ifdef AlphaArchitecture
-#define OSBinaryType [ECOFF]
-#else
-#define OSBinaryType [a.out]
-#endif
-#endif
+# if UseElfFormat
+# define OSBinaryType [ELF]
+# else
+# ifdef AlphaArchitecture
+# define OSBinaryType [ECOFF]
+# else
+# define OSBinaryType [a.out]
+# endif
+# endif
#endif
#ifndef OSName
-#define OSName DefaultOSName OSBinaryType
+# define OSName DefaultOSName OSBinaryType
#endif
#ifndef OSVendor
-#define OSVendor /**/
+# define OSVendor /**/
#endif
#ifndef OSMajorVersion
-#define OSMajorVersion DefaultOSMajorVersion
+# define OSMajorVersion DefaultOSMajorVersion
#endif
#ifndef OSMinorVersion
-#define OSMinorVersion DefaultOSMinorVersion
+# define OSMinorVersion DefaultOSMinorVersion
#endif
#ifndef OSTeenyVersion
-#define OSTeenyVersion DefaultOSTeenyVersion
+# define OSTeenyVersion DefaultOSTeenyVersion
#endif
#ifndef LinuxDistribution
-#define LinuxDistribution DefaultLinuxDistribution
+# define LinuxDistribution DefaultLinuxDistribution
/*
Add "#define LinuxDistribution Linux<mumble>" to your site.def or host.def.
Currently only LinuxSuSE, LinuxRedHat and LinuxDebian will be figured out
@@ -66,20 +66,20 @@ XCOMM platform: $XFree86: xc/config/cf/linux.cf,v 3.133 2000/08/11 17:27:10 daw
*/
#endif
#ifndef LinuxDistName
-#define LinuxDistName DefaultLinuxDistName
+# define LinuxDistName DefaultLinuxDistName
#endif
#ifndef LinuxCLibMajorVersion
-#define LinuxCLibMajorVersion DefaultLinuxCLibMajorVersion
+# define LinuxCLibMajorVersion DefaultLinuxCLibMajorVersion
#endif
#ifndef LinuxCLibMinorVersion
-#define LinuxCLibMinorVersion DefaultLinuxCLibMinorVersion
+# define LinuxCLibMinorVersion DefaultLinuxCLibMinorVersion
#endif
#ifndef LinuxCLibTeenyVersion
-#define LinuxCLibTeenyVersion DefaultLinuxCLibTeenyVersion
+# define LinuxCLibTeenyVersion DefaultLinuxCLibTeenyVersion
#endif
#ifndef LinuxBinUtilsMajorVersion
-#define LinuxBinUtilsMajorVersion DefaultLinuxBinUtilsMajorVersion
+# define LinuxBinUtilsMajorVersion DefaultLinuxBinUtilsMajorVersion
#endif
XCOMM operating system: OSName (OSMajorVersion./**/OSMinorVersion./**/OSTeenyVersion)
@@ -94,71 +94,71 @@ XCOMM binutils: (LinuxBinUtilsMajorVersion)
*
*/
#ifndef BinUtilsMajorVersion
-#define BinUtilsMajorVersion LinuxBinUtilsMajorVersion
+# define BinUtilsMajorVersion LinuxBinUtilsMajorVersion
#endif
#if (LinuxCLibMajorVersion >= 6 || LinuxDistribution == LinuxSuSE)
-#define LinuxLocaleDefines /**/
+# define LinuxLocaleDefines /**/
#else
-#define LinuxLocaleDefines -DX_LOCALE
+# define LinuxLocaleDefines -DX_LOCALE
#endif
#if LinuxDistribution == LinuxDebian
-#define LinuxAdditionalIncludes -I/usr/src/linux/include
+# define LinuxAdditionalIncludes -I/usr/src/linux/include
#else
-#define LinuxAdditionalIncludes /**/
+# define LinuxAdditionalIncludes /**/
#endif
#ifndef LinuxGnuSourceDefines
-#ifdef UseInstalled
-#define LinuxGnuSourceDefines /**/
-#else
-#define LinuxGnuSourceDefines -D_GNU_SOURCE
-#endif
+# ifdef UseInstalled
+# define LinuxGnuSourceDefines /**/
+# else
+# define LinuxGnuSourceDefines -D_GNU_SOURCE
+# endif
#endif
#if LinuxCLibMajorVersion >= 6
-#define LinuxSourceDefines -D_POSIX_C_SOURCE=199309L \
+# define LinuxSourceDefines -D_POSIX_C_SOURCE=199309L \
-D_POSIX_SOURCE -D_XOPEN_SOURCE \
-D_BSD_SOURCE -D_SVID_SOURCE \
LinuxAdditionalIncludes LinuxGnuSourceDefines \
LinuxLocaleDefines
-#define XawI18nDefines -DHAS_WCHAR_H -DHAS_WCTYPE_H -DNO_WIDEC_H
-#define HasPosixThreads YES
-#define ThreadedX YES
-#define HasThreadSafeAPI YES
-#define ThreadsLibraries -lpthread
-#define SystemMTDefines -D_REENTRANT
-#ifndef HasLibCrypt
-#define HasLibCrypt YES
-#endif
+# define XawI18nDefines -DHAS_WCHAR_H -DHAS_WCTYPE_H -DNO_WIDEC_H
+# define HasPosixThreads YES
+# define ThreadedX YES
+# define HasThreadSafeAPI YES
+# define ThreadsLibraries -lpthread
+# define SystemMTDefines -D_REENTRANT
+# ifndef HasLibCrypt
+# define HasLibCrypt YES
+# endif
/* netscape wraps select but not poll as of communicator 4.72 */
-#ifndef HasPoll
-#define HasPoll NO
-#endif
+# ifndef HasPoll
+# define HasPoll NO
+# endif
#else
-#define LinuxSourceDefines -D_POSIX_SOURCE -D_POSIX_C_SOURCE=2 \
+# define LinuxSourceDefines -D_POSIX_SOURCE -D_POSIX_C_SOURCE=2 \
-D_BSD_SOURCE -D_SVID_SOURCE \
LinuxGnuSourceDefines LinuxLocaleDefines
-#define XawI18nDefines -DUSE_XWCHAR_STRING -DUSE_XMBTOWC
-#ifndef HasLibCrypt
-#define HasLibCrypt NO
-#endif
+# define XawI18nDefines -DUSE_XWCHAR_STRING -DUSE_XMBTOWC
+# ifndef HasLibCrypt
+# define HasLibCrypt NO
+# endif
#endif
/* On x86, determine whether to build with MTRR support */
#ifndef HasMTRRSupport
-#ifdef i386Architecture
+# ifdef i386Architecture
/* There is no certain way to know if <asm/mtrr.h> is available,
but it made it into kernel 2.2, so... */
-#if OSMajorVersion > 2 || (OSMajorVersion == 2 && OSMinorVersion >= 2)
-#define HasMTRRSupport YES
-#else
-#define HasMTRRSupport NO
-#endif
-#else
-#define HasMTRRSupport NO /* no for non-ix86 */
-#endif
+# if OSMajorVersion > 2 || (OSMajorVersion == 2 && OSMinorVersion >= 2)
+# define HasMTRRSupport YES
+# else
+# define HasMTRRSupport NO
+# endif
+# else
+# define HasMTRRSupport NO /* no for non-ix86 */
+# endif
#endif
#ifndef XF86INT10_BUILD
@@ -230,11 +230,11 @@ XCOMM binutils: (LinuxBinUtilsMajorVersion)
* The Rush extension support.
*/
#ifndef BuildXF86RushExt
-#define BuildXF86RushExt YES
+# define BuildXF86RushExt YES
#endif
#ifndef LinuxFBDevSupport
-#define LinuxFBDevSupport YES
+# define LinuxFBDevSupport YES
#endif
/* For compatibility */
@@ -287,124 +287,133 @@ XCOMM binutils: (LinuxBinUtilsMajorVersion)
#define UseStaticTermcapLib NO
#endif
+#ifndef BourneShell
+/*
+ * This will cause builds/installs to terminate on errors, as on other
+ * platforms.
+ */
+#define BourneShell /bin/sh -e
+#endif
+
#define MkdirHierCmd mkdir -p
+
#if LinuxElfDefault
-#if UseElfFormat
-# ifdef MipsArchitecture
+# if UseElfFormat
+# ifdef MipsArchitecture
+# ifndef AsCmd
+# define AsCmd gcc -c -x assembler-with-cpp
+# endif
+# ifndef DoLoadableServer
+# define DoLoadableServer NO
+# endif
+# endif /* MipsArchitecure */
+# ifndef CcCmd
+# define CcCmd gcc
+# endif
# ifndef AsCmd
-# define AsCmd gcc -c -x assembler-with-cpp
+# define AsCmd as
# endif
-# ifndef DoLoadableServer
-# define DoLoadableServer NO
+# ifndef LdCmd
+# define LdCmd ld
# endif
-# endif /* MipsArchitecure */
-#ifndef CcCmd
-#define CcCmd gcc
-#endif
-#ifndef AsCmd
-#define AsCmd as
-#endif
-#ifndef LdCmd
-#define LdCmd ld
-#endif
-#define AsmDefines -D__ELF__
-#define CplusplusCmd c++
-#ifndef LinuxUsesNcurses
-#if LinuxCLibMajorVersion >= 6 || (LinuxDistribution == LinuxSuSE)
-#define LinuxUsesNcurses YES
-#else
-#define LinuxUsesNcurses NO
-#endif
-#endif
-#ifndef TermcapLibrary
-#if UseStaticTermcapLib
-#if LinuxUsesNcurses
-#define TermcapLibrary StaticLibrary(/usr/lib,ncurses)
-#else
-#define TermcapLibrary StaticLibrary(/usr/lib/termcap,termcap)
-#endif
-#else
-#if LinuxUsesNcurses
-#define TermcapLibrary -lncurses
-#else
-#define TermcapLibrary -ltermcap
-#endif
-#endif
-#endif
-#else
-#ifdef AlphaArchitecture
-#define CcCmd gcc -b alpha-linuxecoff
-#define CplusplusCmd g++ -b alpha-linuxecoff
-#define AsCmd /usr/alpha-linuxecoff/bin/as
-#define LdCmd /usr/alpha-linuxecoff/bin/ld -m alpha
-#define AsmDefines -DUSE_GAS -U__ELF__
-#endif /* AlphaArchitecture */
-#ifdef ia64Architecture
-#define CcCmd gcc
-#define CplusplusCmd g++
-#define AsCmd as
-#define LdCmd ld
-#define AsmDefines -DUSE_GAS -U__ELF__
-#endif /* ia64Architecture */
-#ifdef i386Architecture
-#define CcCmd gcc -b i486-linuxaout
-#define CplusplusCmd g++ -b i486-linuxaout
-#define AsCmd /usr/i486-linuxaout/bin/as
-#define LdCmd /usr/i486-linuxaout/bin/ld -m i386linux
-#define AsmDefines -DUSE_GAS -U__ELF__
-#endif /* i386Architecture */
-#ifdef Mc68020Architecture
-#define CcCmd gcc -b m68k-linuxaout
-#define CplusplusCmd g++ -b m68k-linuxaout
-#define AsCmd /usr/m68k-linuxaout/bin/as
-#define LdCmd /usr/m68k-linuxaout/bin/ld -m m68klinux
-#define AsmDefines -DUSE_GAS -U__ELF__
-#endif /* Mc68020Architecture */
-#endif
-#else
-#if UseElfFormat
-#ifdef AlphaArchitecture
-#define CcCmd gcc -b alpha-linux
-#define AsCmd /usr/alpha-linux/bin/as
-#define LdCmd ld -m elf64alpha
-#define AsmDefines -D__ELF__
-#define CplusplusCmd c++ -b alpha-linux
-#endif /* AlphaArchitecture */
-#ifdef ia64Architecture
-#define CcCmd gcc
-#define CplusplusCmd g++
-#define AsCmd as
-#define LdCmd ld
-#define AsmDefines -D__ELF__
-#endif /* ia64Architecture */
-#ifdef i386Architecture
-#define CcCmd gcc -b i486-linux
-#define AsCmd /usr/i486-linux/bin/as
-#define LdCmd ld -m elf_i386
-#define AsmDefines -D__ELF__
-#define CplusplusCmd c++ -b i486-linux
-#endif /* i386Architecture */
-#ifdef Mc68020Architecture
-#define CcCmd gcc -b m68k-linux
-#define AsCmd /usr/m68k-linux/bin/as
-#define LdCmd ld -m m68kelf
-#define AsmDefines -D__ELF__
-#define CplusplusCmd c++ -b m68k-linux
-#endif /* Mc68020Architecture */
+# define AsmDefines -D__ELF__
+# define CplusplusCmd c++
+# ifndef LinuxUsesNcurses
+# if LinuxCLibMajorVersion >= 6 || (LinuxDistribution == LinuxSuSE)
+# define LinuxUsesNcurses YES
+# else
+# define LinuxUsesNcurses NO
+# endif
+# endif
+# ifndef TermcapLibrary
+# if UseStaticTermcapLib
+# if LinuxUsesNcurses
+# define TermcapLibrary StaticLibrary(/usr/lib,ncurses)
+# else
+# define TermcapLibrary StaticLibrary(/usr/lib/termcap,termcap)
+# endif
+# else
+# if LinuxUsesNcurses
+# define TermcapLibrary -lncurses
+# else
+# define TermcapLibrary -ltermcap
+# endif
+# endif
+# endif
+# else
+# ifdef AlphaArchitecture
+# define CcCmd gcc -b alpha-linuxecoff
+# define CplusplusCmd g++ -b alpha-linuxecoff
+# define AsCmd /usr/alpha-linuxecoff/bin/as
+# define LdCmd /usr/alpha-linuxecoff/bin/ld -m alpha
+# define AsmDefines -DUSE_GAS -U__ELF__
+# endif /* AlphaArchitecture */
+# ifdef ia64Architecture
+# define CcCmd gcc
+# define CplusplusCmd g++
+# define AsCmd as
+# define LdCmd ld
+# define AsmDefines -DUSE_GAS -U__ELF__
+# endif /* ia64Architecture */
+# ifdef i386Architecture
+# define CcCmd gcc -b i486-linuxaout
+# define CplusplusCmd g++ -b i486-linuxaout
+# define AsCmd /usr/i486-linuxaout/bin/as
+# define LdCmd /usr/i486-linuxaout/bin/ld -m i386linux
+# define AsmDefines -DUSE_GAS -U__ELF__
+# endif /* i386Architecture */
+# ifdef Mc68020Architecture
+# define CcCmd gcc -b m68k-linuxaout
+# define CplusplusCmd g++ -b m68k-linuxaout
+# define AsCmd /usr/m68k-linuxaout/bin/as
+# define LdCmd /usr/m68k-linuxaout/bin/ld -m m68klinux
+# define AsmDefines -DUSE_GAS -U__ELF__
+# endif /* Mc68020Architecture */
+# endif
#else
-#define CcCmd gcc
-#define AsCmd as
-#define LdCmd ld
-#define AsmDefines -DUSE_GAS
-#endif
+# if UseElfFormat
+# ifdef AlphaArchitecture
+# define CcCmd gcc -b alpha-linux
+# define AsCmd /usr/alpha-linux/bin/as
+# define LdCmd ld -m elf64alpha
+# define AsmDefines -D__ELF__
+# define CplusplusCmd c++ -b alpha-linux
+# endif /* AlphaArchitecture */
+# ifdef ia64Architecture
+# define CcCmd gcc
+# define CplusplusCmd g++
+# define AsCmd as
+# define LdCmd ld
+# define AsmDefines -D__ELF__
+# endif /* ia64Architecture */
+# ifdef i386Architecture
+# define CcCmd gcc -b i486-linux
+# define AsCmd /usr/i486-linux/bin/as
+# define LdCmd ld -m elf_i386
+# define AsmDefines -D__ELF__
+# define CplusplusCmd c++ -b i486-linux
+# endif /* i386Architecture */
+# ifdef Mc68020Architecture
+# define CcCmd gcc -b m68k-linux
+# define AsCmd /usr/m68k-linux/bin/as
+# define LdCmd ld -m m68kelf
+# define AsmDefines -D__ELF__
+# define CplusplusCmd c++ -b m68k-linux
+# endif /* Mc68020Architecture */
+# else
+# define CcCmd gcc
+# define AsCmd as
+# define LdCmd ld
+# define AsmDefines -DUSE_GAS
+# endif
#endif
#if UseElfFormat
-#ifndef DoLoadableServer
-#define DoLoadableServer YES
-#endif
+# ifndef DoLoadableServer
+# define DoLoadableServer YES
+# endif
#endif
#ifndef CppCmd
-#define CppCmd /lib/cpp
+# define CppCmd /lib/cpp
#endif
/* Some Linux distributions have yacc, some don't. All have bison. */
#define YaccCmd bison -y
@@ -414,107 +423,113 @@ XCOMM binutils: (LinuxBinUtilsMajorVersion)
#define PostIncDir DefaultGccIncludeDir
#define LdCombineFlags -r
#ifndef LdPostLib
-#define LdPostLib /* Never needed */
+# define LdPostLib /* Never needed */
#endif
#define HasWChar32 YES
#define StandardCppOptions -traditional
#define StandardCppDefines StandardDefines
#define HasVarRun YES
-#define VarDbDirectory /var/state
+#define VarDbDirectory /var/lib
#ifndef XF86OSCardDrivers
-#define XF86OSCardDrivers v4l
+# define XF86OSCardDrivers v4l
#endif
#ifdef i386Architecture
-#define OptimizedCDebugFlags DefaultGcc2i386Opt
-#define LinuxMachineDefines -D__i386__
-#define ServerOSDefines XFree86ServerOSDefines -DDDXTIME -DPART_NET
-#define ServerExtraDefines -DGCCUSESGAS XFree86ServerDefines
-#if UseElfFormat
-#define HasPlugin YES
-#define VendorHasX11R6_3libXext YES /* XC or XFree86 >= 3.3.1 */
-#endif
+# define OptimizedCDebugFlags DefaultGcc2i386Opt
+# define LinuxMachineDefines -D__i386__
+# define ServerOSDefines XFree86ServerOSDefines -DDDXTIME -DPART_NET
+# define ServerExtraDefines -DGCCUSESGAS XFree86ServerDefines
+# if UseElfFormat
+# define HasPlugin YES
+# define VendorHasX11R6_3libXext YES /* XC or XFree86 >= 3.3.1 */
+# endif
#endif /* i386Architecture */
+#ifdef s390Architecture
+#define OptimizedCDebugFlags -O2
+#define LinuxMachineDefines -D__s390__
+#define ServerOSDefines XFree86ServerOSDefines -DDDXTIME -DPART_NET
+#define ServerExtraDefines -DGCCUSESGAS XFree86ServerDefines
+#endif /* s390Architecture */
+
#ifdef AlphaArchitecture
-#define OptimizedCDebugFlags DefaultGcc2AxpOpt
-#define LinuxMachineDefines -D__alpha__
-#define ServerOSDefines XFree86ServerOSDefines -DDDXTIME -DPART_NET
-#define ServerExtraDefines -DGCCUSESGAS XFree86ServerDefines -D_XSERVER64
+# define OptimizedCDebugFlags DefaultGcc2AxpOpt
+# define LinuxMachineDefines -D__alpha__
+# define ServerOSDefines XFree86ServerOSDefines -DDDXTIME -DPART_NET
+# define ServerExtraDefines -DGCCUSESGAS XFree86ServerDefines -D_XSERVER64
#endif /* AlphaArchitecture */
#ifdef Arm32Architecture
-#define DefaultCCOptions -fsigned-char
-#define OptimizedCDebugFlags -O3
-#define LinuxMachineDefines -D__arm__ -U__arm -Uarm
-#define ServerOSDefines XFree86ServerOSDefines -DDDXTIME -DPART_NET
-#define ServerExtraDefines -DGCCUSEGAS XFree86ServerDefines
+# define DefaultCCOptions -fsigned-char
+# define OptimizedCDebugFlags -O3
+# define LinuxMachineDefines -D__arm__ -U__arm -Uarm
+# define ServerOSDefines XFree86ServerOSDefines -DDDXTIME -DPART_NET
+# define ServerExtraDefines -DGCCUSEGAS XFree86ServerDefines
#endif /* Arm32Achitecture */
#ifdef ia64Architecture
-#define OptimizedCDebugFlags -O2
-#define LinuxMachineDefines -D__ia64__
-#define ServerOSDefines XFree86ServerOSDefines -DDDXTIME -DPART_NET
-#define ServerExtraDefines -DGCCUSESGAS XFree86ServerDefines -D_XSERVER64
-#define DoLoadableServer NO
+# define OptimizedCDebugFlags -O2
+# define LinuxMachineDefines -D__ia64__
+# define ServerOSDefines XFree86ServerOSDefines -DDDXTIME -DPART_NET
+# define ServerExtraDefines -DGCCUSESGAS XFree86ServerDefines -D_XSERVER64
#endif /* ia64Architecture */
#ifdef Mc68020Architecture
-#define OptimizedCDebugFlags -O2
-#define LinuxMachineDefines -D__mc68000__
-#define ServerOSDefines XFree86ServerOSDefines -DDDXTIME -DPART_NET
-#define ServerExtraDefines -DGCCUSESGAS XFree86ServerDefines
-#define PositionIndependentCFlags -fpic
-#define PositionIndependentCplusplusFlags -fpic
+# define OptimizedCDebugFlags -O2
+# define LinuxMachineDefines -D__mc68000__
+# define ServerOSDefines XFree86ServerOSDefines -DDDXTIME -DPART_NET
+# define ServerExtraDefines -DGCCUSESGAS XFree86ServerDefines
+# define PositionIndependentCFlags -fpic
+# define PositionIndependentCplusplusFlags -fpic
#endif /* Mc68020Architecture */
#ifdef PpcArchitecture
-#define DefaultCCOptions -fsigned-char
-#define OptimizedCDebugFlags -O2
-#define LinuxMachineDefines -D__powerpc__
-#define ServerOSDefines XFree86ServerOSDefines -DDDXTIME -DPART_NET
-#define ServerExtraDefines -DGCCUSESGAS XFree86ServerDefines
+# define DefaultCCOptions -fsigned-char
+# define OptimizedCDebugFlags -O2
+# define LinuxMachineDefines -D__powerpc__
+# define ServerOSDefines XFree86ServerOSDefines -DDDXTIME -DPART_NET
+# define ServerExtraDefines -DGCCUSESGAS XFree86ServerDefines
#endif /* PpcArchitecture */
#ifdef SparcArchitecture
-#define OptimizedCDebugFlags -O2
-#define LinuxMachineDefines -D__sparc__
-#define ServerOSDefines XFree86ServerOSDefines -DDDXTIME -DPART_NET
-#define ServerExtraDefines -DGCCUSESGAS XFree86ServerDefines
-#define AsVISOption -Av9a
-#ifdef Sparc64Architecture
-#define AsOutputArchSize 64
-#else
-#define AsOutputArchSize 32
-#endif
+# define OptimizedCDebugFlags -O2
+# define LinuxMachineDefines -D__sparc__
+# define ServerOSDefines XFree86ServerOSDefines -DDDXTIME -DPART_NET
+# define ServerExtraDefines -DGCCUSESGAS XFree86ServerDefines
+# define AsVISOption -Av9a
+# ifdef Sparc64Architecture
+# define AsOutputArchSize 64
+# else
+# define AsOutputArchSize 32
+# endif
#endif
#ifdef MipsArchitecture
-#define OptimizedCDebugFlags -O2
-#define LinuxMachineDefines -D__mips__
-#define ServerOSDefines XFree86ServerOSDefines -DDDXTIME -DPART_NET
-#define ServerExtraDefines -DGCCUSESGAS XFree86ServerDefines
+# define OptimizedCDebugFlags -O2
+# define LinuxMachineDefines -D__mips__
+# define ServerOSDefines XFree86ServerOSDefines -DDDXTIME -DPART_NET
+# define ServerExtraDefines -DGCCUSESGAS XFree86ServerDefines
#endif
#ifndef StandardDefines
-#define StandardDefines -Dlinux LinuxMachineDefines LinuxSourceDefines
+# define StandardDefines -Dlinux LinuxMachineDefines LinuxSourceDefines
#endif
#if UseElfFormat
-#define DlLibrary -rdynamic -ldl
+# define DlLibrary -rdynamic -ldl
#else
-#define DlLibrary /**/
+# define DlLibrary /**/
#endif
#define ServerExtraSysLibs /**/
#if HasDECnet
-#define ConnectionFlags -DUNIXCONN -DTCPCONN -DDNETCONN
-#define ExtraLibraries -ldnet
+# define ConnectionFlags -DUNIXCONN -DTCPCONN -DDNETCONN
+# define ExtraLibraries -ldnet
#else
-#define ConnectionFlags -DUNIXCONN -DTCPCONN
+# define ConnectionFlags -DUNIXCONN -DTCPCONN
#endif
/* Some of these man page defaults are overriden in the above OS sections */
@@ -538,18 +553,18 @@ XCOMM binutils: (LinuxBinUtilsMajorVersion)
#endif
#ifndef StaticLibrary
-#define StaticLibrary(libpath,libname) -Wl,-Bstatic Concat(-L,libpath) Concat(-l,libname) -Wl,-Bdynamic
+# define StaticLibrary(libpath,libname) -Wl,-Bstatic Concat(-L,libpath) Concat(-l,libname) -Wl,-Bdynamic
#endif
#ifndef LinkGLToUsrLib
-#define LinkGLToUsrLib YES
+# define LinkGLToUsrLib YES
#endif
-#ifndef LinkGLToUsrInclude
-#define LinkGLToUsrInclude YES
+# ifndef LinkGLToUsrInclude
+# define LinkGLToUsrInclude YES
#endif
-#define HasGnuMake YES
+#define HasGnuMake YES
#define MakeNamedTargetSubdir(dir,flags,subname)\
$(MAKE) -C dir $(MFLAGS) $(PARALLELMFLAGS) flags subname
@@ -559,13 +574,17 @@ XCOMM binutils: (LinuxBinUtilsMajorVersion)
#define TtClientLibs $(TTLIB) $(XTOOLLIB) $(XLIB)
#define TtClientDepLibs $(DEPTTLIB) $(DEPXTOOLLIB) $(DEPXLIB)
+#ifdef S390Architecture
+# define HasXServer NO
+#endif
+
#include <lnxLib.rules>
#ifdef KDriveXServer
-#include <kdrive.cf>
+# include <kdrive.cf>
#else
-#include <xfree86.cf>
+# include <xfree86.cf>
#endif
#ifndef XFree86ServerOSDefines
-#define XFree86ServerOSDefines
+# define XFree86ServerOSDefines
#endif
diff --git a/xc/config/cf/xfree86.cf b/xc/config/cf/xfree86.cf
index dc84604f0..6e88852b0 100644
--- a/xc/config/cf/xfree86.cf
+++ b/xc/config/cf/xfree86.cf
@@ -1,4 +1,4 @@
-XCOMM $XFree86: xc/config/cf/xfree86.cf,v 3.308 2000/08/11 19:10:36 dawes Exp $
+XCOMM $XFree86: xc/config/cf/xfree86.cf,v 3.314 2000/09/20 02:03:46 keithp Exp $
/*
* This configuration file contains all of the configuration
* information for the XFree86 based X Servers.
@@ -16,6 +16,10 @@ XCOMM $TOG: xfree86.cf /main/38 1997/10/22 13:01:59 kaleb $
# define XFree86Devel YES
#endif
+#ifndef BuildDebug
+# define BuildDebug YES
+#endif
+
/*
* settings for the config file parser
*/
@@ -149,11 +153,7 @@ XCOMM $TOG: xfree86.cf /main/38 1997/10/22 13:01:59 kaleb $
# define XF86AFB YES
# endif
-/*
- * XXX Should change this to allow such drivers to be built without agpgart
- * support (when it is useful to do so).
- */
-# if HasAgpGart
+# if HasAgpGart || XFree86Devel
# define AgpGartDrivers i810
# else
# define AgpGartDrivers /**/
@@ -462,6 +462,11 @@ XCOMM $TOG: xfree86.cf /main/38 1997/10/22 13:01:59 kaleb $
# endif
#endif
+#if BuildDebug
+# define DebugDefines -DBUILDDEBUG
+#else
+# define DebugDefines /**/
+#endif
/*
* Fbdev module defines. They are set to indicate the fb types supported
@@ -611,7 +616,7 @@ IPLAN2P8_DEFS = -DUSE_IPLAN2P8
# define GlxCoreLibDefines /**/
# endif
-# if defined(SparcArchitecture)
+# if defined(SparcArchitecture) || defined(ia64Architecture)
# define GlxArchDefines -D__GLX_ALIGN64
# else
# if defined(AlphaArchitecture)
@@ -703,6 +708,11 @@ IPLAN2P8_DEFS = -DUSE_IPLAN2P8
# define BuildXinerama YES
#endif
+/* Build Render extension */
+#ifndef BuildRender
+# define BuildRender YES
+#endif
+
#if 0
#ifndef JoystickSupport
# define JoystickSupport NO
@@ -987,6 +997,7 @@ IPLAN2P8_DEFS = -DUSE_IPLAN2P8
VidModeExtensionDefines \
ServerSnprintfDefines \
SmartScheduleDefines \
+ DebugDefines \
-DX_BYTE_ORDER=ByteOrder
#endif
diff --git a/xc/config/util/mkhtmlindex.sh b/xc/config/util/mkhtmlindex.sh
index 70f68a466..43e06f57e 100644
--- a/xc/config/util/mkhtmlindex.sh
+++ b/xc/config/util/mkhtmlindex.sh
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $XFree86: xc/config/util/mkhtmlindex.sh,v 1.2 2000/03/22 21:23:34 dawes Exp $
+# $XFree86: xc/config/util/mkhtmlindex.sh,v 1.3 2000/08/26 04:30:49 dawes Exp $
#
# Copyright © 2000 by Precision Insight, Inc.
#
@@ -25,7 +25,7 @@ fi
cd $1
for s in $VOLLIST; do
- list="`ls *.$s.html 2> /dev/null`"
+ list="`ls *.$s.html 2> /dev/null`" || : # ignore failed glob expansion
if [ X"$list" != X ]; then
file=$INDEX$s.html
rm -f $file
diff --git a/xc/doc/specs/GL/Imakefile b/xc/doc/specs/GL/Imakefile
deleted file mode 100644
index f112c4d1e..000000000
--- a/xc/doc/specs/GL/Imakefile
+++ /dev/null
@@ -1,4 +0,0 @@
-XCOMM $XFree86: xc/doc/specs/GL/Imakefile,v 1.1 2000/03/02 17:52:57 dawes Exp $
-
-InstallDoc(libGL,libGL.txt)
-
diff --git a/xc/doc/specs/GL/libGL.txt b/xc/doc/specs/GL/libGL.txt
deleted file mode 100644
index 93dcf082d..000000000
--- a/xc/doc/specs/GL/libGL.txt
+++ /dev/null
@@ -1,197 +0,0 @@
-
-
-
-Introduction
-------------
-
-This document describes the implementation of the XFree86 4.0 libGL.so
-library defined by the Linux/OpenGL Base specification found at
-http://reality.sgi.com/opengl/linux/linuxbase.html.
-
-The documentation is divided into two sections:
- User's Guide
- Driver Developer's Guide
-
-Author: Brian Paul (brian@precisioninsight.com)
-Date: February 2000
-
-
-
-User's Guide
-------------
-
-Using libGL.so
-
-The libGL.so library defines the gl- and glX-prefixed functions needed to
-run OpenGL programs. OpenGL client applications should link with the
--lGL option to use it.
-
-libGL.so serves two primary functions: GLX protocol generation for indirect
-rendering and loading/management of hardware drivers for direct rendering.
-
-When libGL.so initializes itself it uses the DRI to determine the
-appropriate hardware driver for each screen on the local X display.
-The hardware drivers are expected to be in the /usr/X11R6/lib/modules/dri/
-directory. Drivers are named with the convention <name>_dri.so where
-<name> is a driver such as "tdfx", "i810", "gamma", etc.
-
-The LIBGL_DRIVERS_PATH environment variable may be used to specify a
-different DRI modules directory, overriding /usr/X11R6/lib/modules/dri/.
-This environment variable is ignored in setuid programs for security
-reasons.
-
-When libGL.so is unable to locate appropriate hardware drivers it will
-fall back to using indirect GLX rendering.
-
-To aid in solving problems, libGL.so will print diagnostic messages to
-stderr if the LIBGL_DEBUG environment variable is defined.
-
-libGL.so is thread safe. The overhead of thread safety for common,
-single-thread clients is negligible. However, the overhead of thread
-safety for multi-threaded clients is significant. Each GL API call
-requires two calls to pthread_get_specific() which can noticably
-impact performance. Warning: libGL.so is thread safe but individual
-DRI drivers may not be. Please consult the documentation for a driver
-to learn if it is thread safe.
-
-
-
-Indirect Rendering
-
-You can force indirect rendering mode by setting the LIBGL_ALWAYS_INDIRECT
-environment variable. Hardware acceleration will not be used.
-
-
-
-libGL.so Extensibility
-
-libGL.so is designed to be extended without upgrading. That is,
-drivers may install new OpenGL extension functions into libGL.so
-without requiring libGL.so to be replaced. Clients of libGL.so should
-use the glXGetProcAddressEXT() function to obtain the address of
-functions by name. For more details of GLX_ARB_get_proc_address see
-http://oss.sgi.com/projects/ogl-sample/registry/ARB/get_proc_address.txt
-
-libGL.so is also designed with flexibility such that it may be used
-with many generations of hardware drivers to come.
-
-
-
-
-Driver Developer's Guide
-------------------------
-
-This section describes the requirements to make an XFree86 4.0
-libGL.so-compatible hardware driver. It is not intended for end
-users of libGL.so.
-
-
-XFree86 source files
-
-libGL.so is built inside XFree86 with sources found in xc/lib/GL/.
-Specifically, libGL.so is built from:
-
- xc/lib/GL/glx/*.c
- xc/lib/dri/XF86dri.c
- xc/lib/dri/dri_glx.c
- xc/lib/GL/mesa/src/glapi.c
- xc/lib/GL/mesa/src/glapitemp.h
- xc/lib/GL/mesa/src/glapitable.h
- xc/lib/GL/mesa/src/glapioffsets.h
- xc/lib/GL/mesa/src/glapinoop.c
- xc/lib/GL/mesa/src/glheader.h
- xc/lib/GL/mesa/src/glthread.c
- xc/lib/GL/mesa/src/glthread.h
- xc/lib/GL/mesa/src/X86/glapi_x86.S
- xc/lib/GL/mesa/src/X86/assyntax.h
-
-Understand that the mesa/src/gl*.[ch] files are not tied to Mesa. They
-have no dependencies on the rest of Mesa and are designed to be reusable
-in a number of projects.
-
-The glapi_x86.X and assyntax.h files implement x86-optimized dispatch
-of GL functions. They are not required; C-based dispatch can be used
-instead, with a slight performance penalty.
-
-
-
-Driver loading and binding
-
-When libGL.so initializes itself (via the __glXInitialize function) a
-call is made to driCreateDisplay(). This function uses DRI facilities
-to determine the driver file appropriate for each screen on the local
-display. Each screen's driver is then opened with dlopen() and asked
-for its __driCreateScreen() function. The pointers to the __driCreateScreen()
-functions are kept in an array, indexed by screen number, in the
-__DRIdisplayRec struct.
-
-When a driver's __driCreateScreen() function is called, it must initialize
-a __DRIscreenRec struct. This struct acts as the root of a tree of
-function pointers which are called to create and destroy contexts and
-drawables and perform all the operations needed by the GLX interface.
-See the xc/lib/GL/glx/glxclient.h file for details.
-
-
-
-Dynamic Extension Function Registration
-
-In order to provide forward compatibility with future drivers, libGL.so
-allows drivers to register new OpenGL extension functions which weren't
-known when libGL.so was built.
-
-The register_extensions() function in xc/lib/GL/dri/dri_glx.c is called
-as soon as libGL.so is loaded. This is done with gcc's constructor
-attribute. This mechanism will likely have to be changed for other compilers.
-
-register_extensions() loops over all local displays and screens, determines
-the DRI driver for each, and calls the driver's __driRegisterExtensions()
-function, if present.
-
-The __driRegisterExtensions() function can add new entrypoints to libGL
-by calling:
-
- GLboolean _glapi_add_entrypoint(const char *funcName, GLuint offset)
-
-The parameters are the name of the function (such as "glFoobarEXT") and the
-offset of the dispatch slot in the API dispatch table. The return value
-indicates success (GL_TRUE) or failure (GL_FALSE).
-
-_glapi_add_entrypoint() will synthesize entrypoint code in assembly
-language. Assembly languages is required since parameter passing
-can't be handled correctly using a C-based solution.
-
-The address of the new entrypoint is obtained by calling the
-glXGetProcAddressARB() function.
-
-The dispatch offset number MUST be a number allocated by SGI in the same
-manner in which new GL_* constants are allocated. Using an arbitrary
-offset number will result in many problems.
-
-
-
-Dispatch Management
-
-When a GL context is made current, the driver must install its dispatch
-table as the current dispatch table. This is done by calling
-
- void _glapi_set_dispatch(struct _glapi_table *dispatch);
-
-This will install the named dispatch table for the calling thread.
-The current dispatch table for a thread can be obtained by calling
-
- struct _glapi_table *_glapi_get_dispatch(void);
-
-For higher performance in the common single-thread case, the global
-variable _glapi_Dispatch will point to the current dispatch table.
-This variable will be NULL when in multi-thread mode.
-
-
-
-Context Management
-
-libGL.so uses the XFree86 xthreads package to manage a thread-specific
-current context pointer. See __glXGet/SetCurrentContext() in glext.c
-
-Drivers may use the _glapi_set/get_context() functions to maintain
-a private thread-specific context pointer.
-
diff --git a/xc/extras/Mesa/src/fog.c b/xc/extras/Mesa/src/fog.c
index 1a7ca2546..15dad1d36 100644
--- a/xc/extras/Mesa/src/fog.c
+++ b/xc/extras/Mesa/src/fog.c
@@ -22,7 +22,7 @@
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-
+/* $XFree86: xc/extras/Mesa/src/fog.c,v 1.7 2000/08/23 22:10:00 tsi Exp $ */
#ifdef PC_HEADER
#include "all.h"
@@ -330,7 +330,7 @@ _mesa_fog_rgba_pixels( const GLcontext *ctx,
GLfloat eyez = d / (c+ndcz);
GLfloat f, g;
GLfloat tmp = negDensitySquared * eyez * eyez;
-#ifdef __alpha__
+#if defined(__alpha__) || defined(__alpha)
/* XXX this underflow check may be needed for other systems */
if (tmp < FLT_MIN_10_EXP)
f = exp( FLT_MIN_10_EXP );
@@ -409,7 +409,7 @@ _mesa_fog_ci_pixels( const GLcontext *ctx,
if (eyez < 0.0)
eyez = -eyez;
tmp = negDensitySquared * eyez * eyez;
-#ifdef __alpha__
+#if defined(__alpha__) || defined(__alpha)
/* XXX this underflow check may be needed for other systems */
if (tmp < FLT_MIN_10_EXP)
f = exp( FLT_MIN_10_EXP );
diff --git a/xc/extras/Mesa/src/teximage.c b/xc/extras/Mesa/src/teximage.c
index 05520e4eb..8f55409e6 100644
--- a/xc/extras/Mesa/src/teximage.c
+++ b/xc/extras/Mesa/src/teximage.c
@@ -22,7 +22,7 @@
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-
+/* $XFree86: xc/extras/Mesa/src/teximage.c,v 1.9 2000/08/28 02:43:09 tsi Exp $ */
#ifdef PC_HEADER
#include "all.h"
diff --git a/xc/extras/Mesa/src/vbrender.c b/xc/extras/Mesa/src/vbrender.c
index 5391ff186..3d053fd4d 100644
--- a/xc/extras/Mesa/src/vbrender.c
+++ b/xc/extras/Mesa/src/vbrender.c
@@ -22,7 +22,7 @@
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-
+/* $XFree86: xc/extras/Mesa/src/vbrender.c,v 1.6 2000/08/28 02:43:10 tsi Exp $ */
/*
* Render points, lines, and polygons. The only entry point to this
diff --git a/xc/extras/rman/contrib/bennett.txt b/xc/extras/rman/contrib/bennett.txt
index dd16e9305..df80b3ed8 100644
--- a/xc/extras/rman/contrib/bennett.txt
+++ b/xc/extras/rman/contrib/bennett.txt
@@ -3,7 +3,7 @@
***************
*** 1,5 ****
--- 1,9 ----
- static char rcsid[] = "$Header: /home/ajax/dri-backup/xc/xc/extras/rman/contrib/bennett.txt,v 1.2 2000/09/07 12:40:24 alanh Exp $";
+ static char rcsid[] = "$Header: /home/ajax/dri-backup/xc/xc/extras/rman/contrib/bennett.txt,v 1.3 2000/09/24 09:33:55 alanh Exp $";
+ /* ELS: SearchDirs by "Edward L. Sutter" <els@sage.sage.att.com> */
+ /* AB: HTMLHeader and HTMLFooter by Anne Bennett <anne@alcor.concordia.ca> */
diff --git a/xc/extras/rman/contrib/hman.pl b/xc/extras/rman/contrib/hman.pl
index 29b96a0d2..70919c8c0 100755
--- a/xc/extras/rman/contrib/hman.pl
+++ b/xc/extras/rman/contrib/hman.pl
@@ -1,7 +1,7 @@
#!/usr/bin/perl -w
#!/citi/gtfd/mach/bin/perl -w
###############
-# $Id: hman.pl,v 1.2 2000/09/07 12:40:24 alanh Exp $
+# $Id: hman.pl,v 1.3 2000/09/24 09:33:55 alanh Exp $
# $Source: /home/ajax/dri-backup/xc/xc/extras/rman/contrib/hman.pl,v $
############################################
# TODO:
diff --git a/xc/extras/rman/contrib/http-rman.c b/xc/extras/rman/contrib/http-rman.c
index 39dcee60b..b75e9c8b7 100644
--- a/xc/extras/rman/contrib/http-rman.c
+++ b/xc/extras/rman/contrib/http-rman.c
@@ -1,4 +1,4 @@
-/* $Id: http-rman.c,v 1.2 2000/09/07 12:40:24 alanh Exp $
+/* $Id: http-rman.c,v 1.3 2000/09/24 09:33:55 alanh Exp $
*
* Name:
* http-rman.c -- a rudimentary man-page HTTP server
diff --git a/xc/extras/rman/rman.1 b/xc/extras/rman/rman.1
index 7e4c48cb2..f645f7c81 100644
--- a/xc/extras/rman/rman.1
+++ b/xc/extras/rman/rman.1
@@ -266,4 +266,4 @@ University of California, Berkeley
.br
Computer Science Division
.PP
-Manual page last updated on $Date: 2000/09/07 12:40:24 $
+Manual page last updated on $Date: 2000/09/24 09:33:55 $
diff --git a/xc/extras/rman/rman.html b/xc/extras/rman/rman.html
index af2ecd18f..b9360bb7c 100644
--- a/xc/extras/rman/rman.html
+++ b/xc/extras/rman/rman.html
@@ -317,6 +317,6 @@ developed at the<BR>
University of California, Berkeley<BR>
Computer Science Division
-<P>Manual page last updated on $Date: 2000/09/07 12:40:24 $
+<P>Manual page last updated on $Date: 2000/09/24 09:33:55 $
</BODY></HTML>
diff --git a/xc/lib/GL/Imakefile b/xc/lib/GL/Imakefile
index 917ac2f60..cb4170d0e 100644
--- a/xc/lib/GL/Imakefile
+++ b/xc/lib/GL/Imakefile
@@ -1,4 +1,4 @@
-XCOMM $XFree86: xc/lib/GL/Imakefile,v 1.29 2000/07/02 19:23:34 dawes Exp $
+XCOMM $XFree86: xc/lib/GL/Imakefile,v 1.31 2000/08/28 16:04:47 dawes Exp $
#include <Threads.tmpl>
diff --git a/xc/lib/GL/dri/XF86dri.c b/xc/lib/GL/dri/XF86dri.c
index e99320db5..44eac8b84 100644
--- a/xc/lib/GL/dri/XF86dri.c
+++ b/xc/lib/GL/dri/XF86dri.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/dri/XF86dri.c,v 1.7 2000/06/20 05:08:37 dawes Exp $ */
+/* $XFree86: xc/lib/GL/dri/XF86dri.c,v 1.9 2000/08/28 16:04:48 dawes Exp $ */
/**************************************************************************
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
diff --git a/xc/lib/GL/dri/drm/Imakefile b/xc/lib/GL/dri/drm/Imakefile
index 0433cd081..9ee61da95 100644
--- a/xc/lib/GL/dri/drm/Imakefile
+++ b/xc/lib/GL/dri/drm/Imakefile
@@ -1,4 +1,4 @@
-XCOMM $XFree86: xc/lib/GL/dri/drm/Imakefile,v 1.7 2000/08/09 23:40:11 dawes Exp $
+XCOMM $XFree86: xc/lib/GL/dri/drm/Imakefile,v 1.9 2000/08/24 15:35:46 tsi Exp $
#define DoNormalLib NormalLibGlx
#define DoSharedLib SharedLibGlx
@@ -11,7 +11,10 @@ ALLOC_DEFINES = -DMALLOC_0_RETURNS_NULL
#endif
DEFINES = $(ALLOC_DEFINES)
- INCLUDES = -I$(XLIBSRC) -I$(EXTINCSRC) -I.
+ INCLUDES = -I$(XLIBSRC) -I$(EXTINCSRC) -I. \
+ -I$(XF86OSSRC)/$(OS_SUBDIR)/drm \
+ -I$(XF86OSSRC)/$(OS_SUBDIR)/drm/kernel \
+ -I$(XF86OSSRC)
SRCS = xf86drm.c xf86drmHash.c xf86drmRandom.c xf86drmSL.c \
xf86drmR128.c
OBJS = xf86drm.o xf86drmHash.o xf86drmRandom.o xf86drmSL.o \
@@ -19,25 +22,28 @@ ALLOC_DEFINES = -DMALLOC_0_RETURNS_NULL
#if defined(LinuxArchitecture)
OS_SUBDIR = linux
+OS_SUBDIR2 = linux
#endif
#if defined(FreeBSDArchitecture) || defined(BSDOSArchitecture)
OS_SUBDIR = bsd
+OS_SUBDIR2 = linux
#endif
-#if defined(cygwinArchitecture)
+#if defined(cygwinArchitecture) && 0 /* XXX FIX ME */
OS_SUBDIR = cygwin
+OS_SUBDIR2 = cygwin
#endif
LinkSourceFile(xf86drm.c,$(XF86OSSRC)/$(OS_SUBDIR)/drm)
-LinkSourceFile(xf86drmHash.c,$(XF86OSSRC)/$(OS_SUBDIR)/drm)
-LinkSourceFile(xf86drmRandom.c,$(XF86OSSRC)/$(OS_SUBDIR)/drm)
-LinkSourceFile(xf86drmSL.c,$(XF86OSSRC)/$(OS_SUBDIR)/drm)
-LinkSourceFile(xf86drm.h,$(XF86OSSRC))
-LinkSourceFile(drm.h,$(XF86OSSRC)/$(OS_SUBDIR)/drm/kernel)
-LinkSourceFile(mga_drm.h,$(XF86OSSRC)/$(OS_SUBDIR)/drm/kernel)
-LinkSourceFile(i810_drm.h,$(XF86OSSRC)/$(OS_SUBDIR)/drm/kernel)
-LinkSourceFile(xf86drmR128.c,$(XF86OSSRC)/$(OS_SUBDIR)/drm)
-LinkSourceFile(xf86drmR128.h,$(XF86OSSRC))
-LinkSourceFile(r128_drm.h,$(XF86OSSRC)/$(OS_SUBDIR)/drm/kernel)
+LinkSourceFile(xf86drmHash.c,$(XF86OSSRC)/$(OS_SUBDIR2)/drm)
+LinkSourceFile(xf86drmRandom.c,$(XF86OSSRC)/$(OS_SUBDIR2)/drm)
+LinkSourceFile(xf86drmSL.c,$(XF86OSSRC)/$(OS_SUBDIR2)/drm)
+LinkSourceFile(xf86drmR128.c,$(XF86OSSRC)/$(OS_SUBDIR2)/drm)
+
+LinkSourceFile(drm.h,$(XF86OSSRC)/$(OS_SUBDIR2)/drm/kernel)
+LinkSourceFile(i810_drm.h,$(XF86OSSRC)/$(OS_SUBDIR2)/drm/kernel)
+LinkSourceFile(mga_drm.h,$(XF86OSSRC)/$(OS_SUBDIR2)/drm/kernel)
+LinkSourceFile(r128_drm.h,$(XF86OSSRC)/$(OS_SUBDIR2)/drm/kernel)
+LinkSourceFile(sis_drm.h,$(XF86OSSRC)/$(OS_SUBDIR2)/drm/kernel)
#include <Library.tmpl>
diff --git a/xc/lib/GL/glx/packsingle.h b/xc/lib/GL/glx/packsingle.h
index 830944262..f3195a274 100644
--- a/xc/lib/GL/glx/packsingle.h
+++ b/xc/lib/GL/glx/packsingle.h
@@ -1,7 +1,7 @@
#ifndef __GLX_packsingle_h__
#define __GLX_packsingle_h__
-/* $XFree86: xc/lib/GL/glx/packsingle.h,v 1.3 2000/02/08 17:18:33 dawes Exp $ */
+/* $XFree86: xc/lib/GL/glx/packsingle.h,v 1.4 2000/08/28 16:04:48 dawes Exp $ */
/*
** The contents of this file are subject to the GLX Public License Version 1.0
** (the "License"). You may not use this file except in compliance with the
@@ -85,7 +85,7 @@
*((FLOAT32 *) (pc + offset)) = a
#else
-#define __GLX_SINGLE_PUT_SHORT(offset,a) \
+#define __GLX_SINGLE_PUT_SHORT(offset,a) \
{ GLubyte *cp = (pc+offset); \
int shift = (64-16) - ((int)(cp) >> (64-6)); \
*(int *)cp = (*(int *)cp & ~(0xffff << shift)) | ((a & 0xffff) << shift); }
diff --git a/xc/lib/GL/makeprofile.sh b/xc/lib/GL/makeprofile.sh
index 9cf2cd1d7..fd4427595 100755
--- a/xc/lib/GL/makeprofile.sh
+++ b/xc/lib/GL/makeprofile.sh
@@ -1,4 +1,5 @@
#!/bin/sh
+# $XFree86: xc/lib/GL/makeprofile.sh,v 1.3 2000/08/28 02:43:11 tsi Exp $
libname=$1
diff --git a/xc/lib/GL/mesa/src/drv/Imakefile b/xc/lib/GL/mesa/src/drv/Imakefile
index cdac99c61..b01e433ff 100644
--- a/xc/lib/GL/mesa/src/drv/Imakefile
+++ b/xc/lib/GL/mesa/src/drv/Imakefile
@@ -1,4 +1,4 @@
-XCOMM $XFree86: xc/lib/GL/mesa/src/drv/Imakefile,v 1.14 2000/08/01 20:52:18 dawes Exp $
+XCOMM $XFree86: xc/lib/GL/mesa/src/drv/Imakefile,v 1.15 2000/08/24 22:20:06 tsi Exp $
#define DoNormalLib NormalLibGlx
#define DoSharedLib SharedLibGlx
@@ -34,7 +34,7 @@ DRIVER += sis
SUBDIRS = $(DRIVER)
#else
-#if defined(i386Architecture)
+#if defined(i386Architecture) || defined(ia64Architecture)
SUBDIRS += gamma
#if HasGlide3
SUBDIRS += tdfx
diff --git a/xc/lib/GL/mesa/src/drv/ffb/Imakefile b/xc/lib/GL/mesa/src/drv/ffb/Imakefile
index 06fbd148c..5ad3d5a18 100644
--- a/xc/lib/GL/mesa/src/drv/ffb/Imakefile
+++ b/xc/lib/GL/mesa/src/drv/ffb/Imakefile
@@ -1,4 +1,4 @@
-XCOMM $XFree86: xc/lib/GL/mesa/src/drv/ffb/Imakefile,v 1.3 2000/06/25 14:44:26 alanh Exp $
+XCOMM $XFree86: xc/lib/GL/mesa/src/drv/ffb/Imakefile,v 1.5 2000/08/24 22:20:06 tsi Exp $
#include <Threads.tmpl>
@@ -19,11 +19,11 @@ ALLOC_DEFINES = -DMALLOC_0_RETURNS_NULL
-I$(XF86OSSRC) -I$(SERVERSRC)/GL/dri \
-I$(XF86DRIVERSRC)/sunffb \
-I../../../include -I../.. -I../../X -I../common \
- -I../../../dri \
- -I$(XF86OSSRC)/linux/drm/kernel
+ -I../../../dri
#endif
-MESA_INCLUDES = -I. -I.. -I../../include
+MESA_INCLUDES = -I. -I.. -I../../include \
+ -I../../../../dri/drm
DEFINES = $(ALLOC_DEFINES) $(DRI_DEFINES)
diff --git a/xc/lib/GL/mesa/src/drv/gamma/Imakefile b/xc/lib/GL/mesa/src/drv/gamma/Imakefile
index 2ce5519c1..33d3759ba 100644
--- a/xc/lib/GL/mesa/src/drv/gamma/Imakefile
+++ b/xc/lib/GL/mesa/src/drv/gamma/Imakefile
@@ -1,4 +1,4 @@
-XCOMM $XFree86: xc/lib/GL/mesa/src/drv/gamma/Imakefile,v 1.11 2000/06/25 14:44:26 alanh Exp $
+XCOMM $XFree86: xc/lib/GL/mesa/src/drv/gamma/Imakefile,v 1.13 2000/08/24 22:20:06 tsi Exp $
#include <Threads.tmpl>
@@ -19,12 +19,11 @@ ALLOC_DEFINES = -DMALLOC_0_RETURNS_NULL
-I$(TOP)/include -I$(TOP)/include/GL \
-I$(XF86OSSRC) -I$(SERVERSRC)/GL/dri \
-I$(XF86DRIVERSRC)/glint \
- -I../../../include -I../.. -I../../X -I../common \
- -I$(XF86OSSRC)/linux/drm/kernel
+ -I../../../include -I../.. -I../../X -I../common
#endif
-MESA_INCLUDES = -I. -I.. -I../../include
-
+MESA_INCLUDES = -I. -I.. -I../../include \
+ -I../../../../dri/drm
DEFINES = $(ALLOC_DEFINES) $(DRI_DEFINES)
diff --git a/xc/lib/GL/mesa/src/drv/i810/Imakefile b/xc/lib/GL/mesa/src/drv/i810/Imakefile
index ffc358180..5f5815a17 100644
--- a/xc/lib/GL/mesa/src/drv/i810/Imakefile
+++ b/xc/lib/GL/mesa/src/drv/i810/Imakefile
@@ -1,3 +1,4 @@
+XCOMM $XFree86: xc/lib/GL/mesa/src/drv/i810/Imakefile,v 1.9 2000/08/25 13:42:19 dawes Exp $
#include <Threads.tmpl>
@@ -11,13 +12,6 @@
ALLOC_DEFINES = -DMALLOC_0_RETURNS_NULL
#endif
-#if defined(LinuxArchitecture)
-OS_SUBDIR = linux
-#endif
-#if defined(FreeBSDArchitecture) || defined(BSDOSArchitecture)
-OS_SUBDIR = bsd
-#endif
-
#if BuildXF86DRI
DRI_DEFINES = GlxDefines -DDRIVERTS
DRI_INCLUDES = -I../../../../dri -I../../../../glx \
@@ -25,13 +19,11 @@ OS_SUBDIR = bsd
-I$(TOP)/include -I$(TOP)/include/GL \
-I$(XF86OSSRC) -I$(SERVERSRC)/GL/dri \
-I$(XF86DRIVERSRC)/i810 \
- -I../../../include -I../.. -I../common -I../../X \
- -I$(XF86OSSRC)/$(OS_SUBDIR)/drm/kernel
+ -I../../../include -I../.. -I../common -I../../X
#endif
-MESA_INCLUDES = -I. -I.. -I../../include
-
-
+MESA_INCLUDES = -I. -I.. -I../../include \
+ -I../../../../dri/drm
DEFINES = $(ALLOC_DEFINES) $(DRI_DEFINES)
INCLUDES = -I$(XLIBSRC) -I$(EXTINCSRC) $(MESA_INCLUDES) $(DRI_INCLUDES)
diff --git a/xc/lib/GL/mesa/src/drv/i810/i810_3d_reg.h b/xc/lib/GL/mesa/src/drv/i810/i810_3d_reg.h
index bb19196ce..a7200f1b8 100644
--- a/xc/lib/GL/mesa/src/drv/i810/i810_3d_reg.h
+++ b/xc/lib/GL/mesa/src/drv/i810/i810_3d_reg.h
@@ -1,4 +1,4 @@
-
+/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810_3d_reg.h,v 1.5 2000/08/28 02:43:11 tsi Exp $ */
#ifndef I810_3D_REG_H
#define I810_3D_REG_H
diff --git a/xc/lib/GL/mesa/src/drv/i810/i810_xmesa.c b/xc/lib/GL/mesa/src/drv/i810/i810_xmesa.c
index 1622638cb..035e78de3 100644
--- a/xc/lib/GL/mesa/src/drv/i810/i810_xmesa.c
+++ b/xc/lib/GL/mesa/src/drv/i810/i810_xmesa.c
@@ -24,7 +24,7 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
**************************************************************************/
-/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810_xmesa.c,v 1.5 2000/08/03 02:30:19 dawes Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810_xmesa.c,v 1.6 2000/08/25 13:42:20 dawes Exp $ */
/*
* Authors:
diff --git a/xc/lib/GL/mesa/src/drv/i810/i810context.h b/xc/lib/GL/mesa/src/drv/i810/i810context.h
index d716e0e7c..17882b3be 100644
--- a/xc/lib/GL/mesa/src/drv/i810/i810context.h
+++ b/xc/lib/GL/mesa/src/drv/i810/i810context.h
@@ -21,7 +21,7 @@
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
-
+/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810context.h,v 1.5 2000/08/28 02:43:11 tsi Exp $ */
#ifndef I810CONTEXT_INC
#define I810CONTEXT_INC
diff --git a/xc/lib/GL/mesa/src/drv/i810/i810fastpath.c b/xc/lib/GL/mesa/src/drv/i810/i810fastpath.c
index abffcb737..f313fd559 100644
--- a/xc/lib/GL/mesa/src/drv/i810/i810fastpath.c
+++ b/xc/lib/GL/mesa/src/drv/i810/i810fastpath.c
@@ -21,6 +21,7 @@
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
+/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810fastpath.c,v 1.4 2000/08/28 02:43:11 tsi Exp $ */
#include <stdio.h>
diff --git a/xc/lib/GL/mesa/src/drv/i810/i810ioctl.c b/xc/lib/GL/mesa/src/drv/i810/i810ioctl.c
index 5826485bd..2f16e33d7 100644
--- a/xc/lib/GL/mesa/src/drv/i810/i810ioctl.c
+++ b/xc/lib/GL/mesa/src/drv/i810/i810ioctl.c
@@ -1,7 +1,8 @@
+/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810ioctl.c,v 1.4 2000/08/28 02:43:11 tsi Exp $ */
+
#include <stdio.h>
#include <unistd.h>
-
#include "types.h"
#include "pb.h"
#include "dd.h"
diff --git a/xc/lib/GL/mesa/src/drv/i810/i810ioctl.h b/xc/lib/GL/mesa/src/drv/i810/i810ioctl.h
index f44dc60fe..57f72be67 100644
--- a/xc/lib/GL/mesa/src/drv/i810/i810ioctl.h
+++ b/xc/lib/GL/mesa/src/drv/i810/i810ioctl.h
@@ -1,3 +1,5 @@
+/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810ioctl.h,v 1.4 2000/08/28 02:43:11 tsi Exp $ */
+
#ifndef MGA_IOCTL_H
#define MGA_IOCTL_H
diff --git a/xc/lib/GL/mesa/src/drv/i810/i810state.c b/xc/lib/GL/mesa/src/drv/i810/i810state.c
index 0607edfea..55f63db2e 100644
--- a/xc/lib/GL/mesa/src/drv/i810/i810state.c
+++ b/xc/lib/GL/mesa/src/drv/i810/i810state.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810state.c,v 1.4 2000/06/22 16:59:24 tsi Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810state.c,v 1.5 2000/08/25 13:42:21 dawes Exp $ */
#include <stdio.h>
diff --git a/xc/lib/GL/mesa/src/drv/i810/i810tris.c b/xc/lib/GL/mesa/src/drv/i810/i810tris.c
index 9f5fd26d0..b05affec2 100644
--- a/xc/lib/GL/mesa/src/drv/i810/i810tris.c
+++ b/xc/lib/GL/mesa/src/drv/i810/i810tris.c
@@ -22,6 +22,7 @@
*
*
*/
+/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810tris.c,v 1.4 2000/08/28 02:43:11 tsi Exp $ */
#include <stdio.h>
#include <math.h>
diff --git a/xc/lib/GL/mesa/src/drv/i810/i810tris.h b/xc/lib/GL/mesa/src/drv/i810/i810tris.h
index 8a17b4112..c1e8cf7bc 100644
--- a/xc/lib/GL/mesa/src/drv/i810/i810tris.h
+++ b/xc/lib/GL/mesa/src/drv/i810/i810tris.h
@@ -22,6 +22,7 @@
*
*
*/
+/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810tris.h,v 1.4 2000/08/28 02:43:11 tsi Exp $ */
#ifndef I810TRIS_INC
#define I810TRIS_INC
diff --git a/xc/lib/GL/mesa/src/drv/i810/i810tritmp.h b/xc/lib/GL/mesa/src/drv/i810/i810tritmp.h
index 7eea0038d..caaf264bf 100644
--- a/xc/lib/GL/mesa/src/drv/i810/i810tritmp.h
+++ b/xc/lib/GL/mesa/src/drv/i810/i810tritmp.h
@@ -1,3 +1,4 @@
+/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810tritmp.h,v 1.4 2000/08/28 02:43:11 tsi Exp $ */
static __inline void TAG(triangle)(GLcontext *ctx,
GLuint e0, GLuint e1, GLuint e2,
diff --git a/xc/lib/GL/mesa/src/drv/i810/i810vb.c b/xc/lib/GL/mesa/src/drv/i810/i810vb.c
index 002920100..fe7627f1e 100644
--- a/xc/lib/GL/mesa/src/drv/i810/i810vb.c
+++ b/xc/lib/GL/mesa/src/drv/i810/i810vb.c
@@ -22,6 +22,7 @@
*
*
*/
+/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810vb.c,v 1.5 2000/08/28 02:43:12 tsi Exp $ */
#include <stdio.h>
#include <stdlib.h>
diff --git a/xc/lib/GL/mesa/src/drv/i810/i810vb.h b/xc/lib/GL/mesa/src/drv/i810/i810vb.h
index b5553d791..0da60344e 100644
--- a/xc/lib/GL/mesa/src/drv/i810/i810vb.h
+++ b/xc/lib/GL/mesa/src/drv/i810/i810vb.h
@@ -22,6 +22,7 @@
*
*
*/
+/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810vb.h,v 1.3 2000/08/28 02:43:12 tsi Exp $ */
#ifndef I810VB_INC
#define I810VB_INC
diff --git a/xc/lib/GL/mesa/src/drv/mga/Imakefile b/xc/lib/GL/mesa/src/drv/mga/Imakefile
index 5076e10c9..1fdd283a7 100644
--- a/xc/lib/GL/mesa/src/drv/mga/Imakefile
+++ b/xc/lib/GL/mesa/src/drv/mga/Imakefile
@@ -1,3 +1,4 @@
+XCOMM $XFree86: xc/lib/GL/mesa/src/drv/mga/Imakefile,v 1.9 2000/08/25 13:42:22 dawes Exp $
#include <Threads.tmpl>
@@ -11,13 +12,6 @@
ALLOC_DEFINES = -DMALLOC_0_RETURNS_NULL
#endif
-#if defined(LinuxArchitecture)
-OS_SUBDIR = linux
-#endif
-#if defined(FreeBSDArchitecture) || defined(BSDOSArchitecture)
-OS_SUBDIR = bsd
-#endif
-
#ifdef i386Architecture
#ifdef MesaUse3DNow
ASM_DEFS = -DUSE_MMX_ASM -DUSE_X86_ASM -DUSE_3DNOW_ASM
@@ -34,13 +28,11 @@ OS_SUBDIR = bsd
-I$(TOP)/include -I$(TOP)/include/GL \
-I$(XF86OSSRC) -I$(SERVERSRC)/GL/dri \
-I$(XF86DRIVERSRC)/mga \
- -I../../../include -I../.. -I../../X -I../common \
- -I$(XF86OSSRC)/$(OS_SUBDIR)/drm/kernel
+ -I../../../include -I../.. -I../../X -I../common
#endif
-MESA_INCLUDES = -I. -I.. -I../../include
-
-
+MESA_INCLUDES = -I. -I.. -I../../include \
+ -I../../../../dri/drm
DEFINES = $(ALLOC_DEFINES) $(DRI_DEFINES) $(ASM_DEFS)
INCLUDES = -I$(XLIBSRC) -I$(EXTINCSRC) $(MESA_INCLUDES) $(DRI_INCLUDES)
diff --git a/xc/lib/GL/mesa/src/drv/mga/mga_xmesa.c b/xc/lib/GL/mesa/src/drv/mga/mga_xmesa.c
index 6468a6000..7d8da52da 100644
--- a/xc/lib/GL/mesa/src/drv/mga/mga_xmesa.c
+++ b/xc/lib/GL/mesa/src/drv/mga/mga_xmesa.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mga_xmesa.c,v 1.4 2000/06/22 16:59:24 tsi Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mga_xmesa.c,v 1.5 2000/08/25 13:42:22 dawes Exp $ */
/**************************************************************************
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
@@ -302,7 +302,6 @@ GLboolean XMesaCreateContext( Display *dpy, GLvisual *mesaVis,
make_empty_list(&mmesa->TexObjList[i]);
}
-
/* Set the maximum texture size small enough that we can guarentee
* that both texture units can bind a maximal texture and have them
* on the card at once.
diff --git a/xc/lib/GL/mesa/src/drv/mga/mga_xmesa.h b/xc/lib/GL/mesa/src/drv/mga/mga_xmesa.h
index af5a096bc..2e9877eb2 100644
--- a/xc/lib/GL/mesa/src/drv/mga/mga_xmesa.h
+++ b/xc/lib/GL/mesa/src/drv/mga/mga_xmesa.h
@@ -24,6 +24,7 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
**************************************************************************/
+/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mga_xmesa.h,v 1.5 2000/08/28 02:43:12 tsi Exp $ */
/*
* Authors:
diff --git a/xc/lib/GL/mesa/src/drv/mga/mgabuffers.c b/xc/lib/GL/mesa/src/drv/mga/mgabuffers.c
index 3111a9fbe..d37027473 100644
--- a/xc/lib/GL/mesa/src/drv/mga/mgabuffers.c
+++ b/xc/lib/GL/mesa/src/drv/mga/mgabuffers.c
@@ -24,7 +24,7 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
**************************************************************************/
-/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgabuffers.c,v 1.2 2000/06/22 16:59:24 tsi Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgabuffers.c,v 1.3 2000/08/25 13:42:22 dawes Exp $ */
/*
* Authors:
diff --git a/xc/lib/GL/mesa/src/drv/mga/mgabuffers.h b/xc/lib/GL/mesa/src/drv/mga/mgabuffers.h
index 7f1bf1c11..2a72aba6f 100644
--- a/xc/lib/GL/mesa/src/drv/mga/mgabuffers.h
+++ b/xc/lib/GL/mesa/src/drv/mga/mgabuffers.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgabuffers.h,v 1.2 2000/06/22 16:59:24 tsi Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgabuffers.h,v 1.3 2000/08/25 13:42:23 dawes Exp $ */
#ifndef MGA_BUFFERS_H
#define MGA_BUFFERS_H
diff --git a/xc/lib/GL/mesa/src/drv/mga/mgadd.c b/xc/lib/GL/mesa/src/drv/mga/mgadd.c
index 0e1469de9..1b7442ce6 100644
--- a/xc/lib/GL/mesa/src/drv/mga/mgadd.c
+++ b/xc/lib/GL/mesa/src/drv/mga/mgadd.c
@@ -23,7 +23,7 @@
*
* Wittawat Yamwong <Wittawat.Yamwong@stud.uni-hannover.de>
*/
-/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgadd.c,v 1.3 2000/06/22 16:59:24 tsi Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgadd.c,v 1.4 2000/08/25 13:42:23 dawes Exp $ */
diff --git a/xc/lib/GL/mesa/src/drv/mga/mgaeltpath.c b/xc/lib/GL/mesa/src/drv/mga/mgaeltpath.c
index 631466515..3dcfa5eed 100644
--- a/xc/lib/GL/mesa/src/drv/mga/mgaeltpath.c
+++ b/xc/lib/GL/mesa/src/drv/mga/mgaeltpath.c
@@ -21,6 +21,7 @@
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
+/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgaeltpath.c,v 1.3 2000/08/28 02:43:12 tsi Exp $ */
#include <stdio.h>
diff --git a/xc/lib/GL/mesa/src/drv/mga/mgaelttmp.h b/xc/lib/GL/mesa/src/drv/mga/mgaelttmp.h
index 8a5328226..2bc19ddcd 100644
--- a/xc/lib/GL/mesa/src/drv/mga/mgaelttmp.h
+++ b/xc/lib/GL/mesa/src/drv/mga/mgaelttmp.h
@@ -21,6 +21,7 @@
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
+/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgaelttmp.h,v 1.3 2000/08/28 02:43:12 tsi Exp $ */
/* Buffers fill from high addresses down with vertices and from low
* addresses up with elements.
diff --git a/xc/lib/GL/mesa/src/drv/mga/mgafastpath.c b/xc/lib/GL/mesa/src/drv/mga/mgafastpath.c
index a0767328e..ad69cf8f6 100644
--- a/xc/lib/GL/mesa/src/drv/mga/mgafastpath.c
+++ b/xc/lib/GL/mesa/src/drv/mga/mgafastpath.c
@@ -21,6 +21,7 @@
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
+/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgafastpath.c,v 1.4 2000/08/28 02:43:12 tsi Exp $ */
#include <stdio.h>
diff --git a/xc/lib/GL/mesa/src/drv/mga/mgaioctl.c b/xc/lib/GL/mesa/src/drv/mga/mgaioctl.c
index 65402b099..26030c28c 100644
--- a/xc/lib/GL/mesa/src/drv/mga/mgaioctl.c
+++ b/xc/lib/GL/mesa/src/drv/mga/mgaioctl.c
@@ -1,5 +1,6 @@
-#include <stdio.h>
+/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgaioctl.c,v 1.5 2000/08/28 02:43:12 tsi Exp $ */
+#include <stdio.h>
#include "types.h"
#include "pb.h"
@@ -165,7 +166,6 @@ GLbitfield mgaClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
clear.clear_depth = 0;
clear.clear_depth_mask = 0;
-
FLUSH_BATCH( mmesa );
if (mask & DD_FRONT_LEFT_BIT) {
diff --git a/xc/lib/GL/mesa/src/drv/mga/mgaioctl.h b/xc/lib/GL/mesa/src/drv/mga/mgaioctl.h
index fad4267db..f84ec731a 100644
--- a/xc/lib/GL/mesa/src/drv/mga/mgaioctl.h
+++ b/xc/lib/GL/mesa/src/drv/mga/mgaioctl.h
@@ -1,3 +1,5 @@
+/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgaioctl.h,v 1.4 2000/08/28 02:43:12 tsi Exp $ */
+
#ifndef MGA_IOCTL_H
#define MGA_IOCTL_H
@@ -87,5 +89,4 @@ GLuint *mgaAllocVertexDwordsInline( mgaContextPtr mmesa, int dwords )
return head;
}
-
#endif
diff --git a/xc/lib/GL/mesa/src/drv/mga/mgaspan.c b/xc/lib/GL/mesa/src/drv/mga/mgaspan.c
index 3fc811045..b3442d3fa 100644
--- a/xc/lib/GL/mesa/src/drv/mga/mgaspan.c
+++ b/xc/lib/GL/mesa/src/drv/mga/mgaspan.c
@@ -1,3 +1,5 @@
+/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgaspan.c,v 1.4 2000/08/28 02:43:12 tsi Exp $ */
+
#include "types.h"
#include "mgadd.h"
#include "mgacontext.h"
diff --git a/xc/lib/GL/mesa/src/drv/mga/mgastate.c b/xc/lib/GL/mesa/src/drv/mga/mgastate.c
index 1be6b5b05..ae8b9ad16 100644
--- a/xc/lib/GL/mesa/src/drv/mga/mgastate.c
+++ b/xc/lib/GL/mesa/src/drv/mga/mgastate.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgastate.c,v 1.3 2000/06/21 12:10:59 tsi Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgastate.c,v 1.4 2000/08/25 13:42:25 dawes Exp $ */
#include <stdio.h>
diff --git a/xc/lib/GL/mesa/src/drv/mga/mgatex.c b/xc/lib/GL/mesa/src/drv/mga/mgatex.c
index 16bad1439..4ce61bd64 100644
--- a/xc/lib/GL/mesa/src/drv/mga/mgatex.c
+++ b/xc/lib/GL/mesa/src/drv/mga/mgatex.c
@@ -25,7 +25,7 @@
* 9/20/99 rewrite by John Carmack <johnc@idsoftware.com>
* 13/1/00 port to DRI by Keith Whitwell <keithw@precisioninsight.com>
*/
-/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgatex.c,v 1.4 2000/06/22 16:59:24 tsi Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgatex.c,v 1.5 2000/08/25 13:42:25 dawes Exp $ */
#include <stdlib.h>
#include <stdio.h>
diff --git a/xc/lib/GL/mesa/src/drv/mga/mgatris.c b/xc/lib/GL/mesa/src/drv/mga/mgatris.c
index 5a1488502..d63796946 100644
--- a/xc/lib/GL/mesa/src/drv/mga/mgatris.c
+++ b/xc/lib/GL/mesa/src/drv/mga/mgatris.c
@@ -23,6 +23,7 @@
*
* Wittawat Yamwong <Wittawat.Yamwong@stud.uni-hannover.de>
*/
+/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgatris.c,v 1.4 2000/08/28 02:43:12 tsi Exp $ */
#include <stdio.h>
#include <math.h>
@@ -70,7 +71,6 @@ static quad_func quad_tab[0x10];
static line_func line_tab[0x10];
static points_func points_tab[0x10];
-
#define IND (0)
#define TAG(x) x
#include "mgatritmp.h"
@@ -197,8 +197,3 @@ void mgaDDChooseRenderState(GLcontext *ctx)
}
}
}
-
-
-
-
-
diff --git a/xc/lib/GL/mesa/src/drv/mga/mgatris.h b/xc/lib/GL/mesa/src/drv/mga/mgatris.h
index abc80bbb8..6fcf73d58 100644
--- a/xc/lib/GL/mesa/src/drv/mga/mgatris.h
+++ b/xc/lib/GL/mesa/src/drv/mga/mgatris.h
@@ -23,6 +23,7 @@
*
* Wittawat Yamwong <Wittawat.Yamwong@stud.uni-hannover.de>
*/
+/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgatris.h,v 1.4 2000/08/28 02:43:12 tsi Exp $ */
#ifndef MGATIS_INC
#define MGATIS_INC
diff --git a/xc/lib/GL/mesa/src/drv/mga/mgatritmp.h b/xc/lib/GL/mesa/src/drv/mga/mgatritmp.h
index 4146da97a..47629cd4d 100644
--- a/xc/lib/GL/mesa/src/drv/mga/mgatritmp.h
+++ b/xc/lib/GL/mesa/src/drv/mga/mgatritmp.h
@@ -1,3 +1,4 @@
+/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgatritmp.h,v 1.4 2000/08/28 02:43:13 tsi Exp $ */
static __inline void TAG(triangle)(GLcontext *ctx,
GLuint e0, GLuint e1, GLuint e2,
diff --git a/xc/lib/GL/mesa/src/drv/mga/mgavb.c b/xc/lib/GL/mesa/src/drv/mga/mgavb.c
index ef1ec41d6..681ebcb8a 100644
--- a/xc/lib/GL/mesa/src/drv/mga/mgavb.c
+++ b/xc/lib/GL/mesa/src/drv/mga/mgavb.c
@@ -23,6 +23,7 @@
*
* Wittawat Yamwong <Wittawat.Yamwong@stud.uni-hannover.de>
*/
+/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgavb.c,v 1.5 2000/08/28 02:43:13 tsi Exp $ */
#include "mgacontext.h"
#include "mgavb.h"
diff --git a/xc/lib/GL/mesa/src/drv/mga/mgavb.h b/xc/lib/GL/mesa/src/drv/mga/mgavb.h
index 16be34e31..c79fd5b6e 100644
--- a/xc/lib/GL/mesa/src/drv/mga/mgavb.h
+++ b/xc/lib/GL/mesa/src/drv/mga/mgavb.h
@@ -23,6 +23,7 @@
*
* Wittawat Yamwong <Wittawat.Yamwong@stud.uni-hannover.de>
*/
+/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgavb.h,v 1.4 2000/08/28 02:43:13 tsi Exp $ */
#ifndef MGAVB_INC
#define MGAVB_INC
diff --git a/xc/lib/GL/mesa/src/drv/r128/Imakefile b/xc/lib/GL/mesa/src/drv/r128/Imakefile
index c3666b7fc..3b6e0a2b5 100644
--- a/xc/lib/GL/mesa/src/drv/r128/Imakefile
+++ b/xc/lib/GL/mesa/src/drv/r128/Imakefile
@@ -1,4 +1,4 @@
-XCOMM $XFree86: xc/lib/GL/mesa/src/drv/r128/Imakefile,v 1.4 2000/06/26 05:41:29 martin Exp $
+XCOMM $XFree86: xc/lib/GL/mesa/src/drv/r128/Imakefile,v 1.5 2000/08/24 22:20:07 tsi Exp $
#include <Threads.tmpl>
@@ -42,7 +42,8 @@ LinkSourceFile(mm.h, ../common)
LinkSourceFile(hwlog.c, ../common)
LinkSourceFile(hwlog.h, ../common)
-MESA_INCLUDES = -I. -I.. -I../../include
+MESA_INCLUDES = -I. -I.. -I../../include \
+ -I../../../../dri/drm
DEFINES = $(ALLOC_DEFINES) $(DRI_DEFINES) $(ASM_DEFINES)
INCLUDES = -I$(XLIBSRC) -I$(EXTINCSRC) $(MESA_INCLUDES) $(DRI_INCLUDES)
diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_cce.c b/xc/lib/GL/mesa/src/drv/r128/r128_cce.c
index 44d74c6b0..8f9c3eba3 100644
--- a/xc/lib/GL/mesa/src/drv/r128/r128_cce.c
+++ b/xc/lib/GL/mesa/src/drv/r128/r128_cce.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_cce.c,v 1.2 2000/06/26 05:41:29 martin Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_cce.c,v 1.3 2000/08/25 13:42:27 dawes Exp $ */
/**************************************************************************
Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc.,
diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_cce.h b/xc/lib/GL/mesa/src/drv/r128/r128_cce.h
index 36748b68e..ca265c1a9 100644
--- a/xc/lib/GL/mesa/src/drv/r128/r128_cce.h
+++ b/xc/lib/GL/mesa/src/drv/r128/r128_cce.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_cce.h,v 1.1 2000/06/17 00:03:04 martin Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_cce.h,v 1.2 2000/08/25 13:42:27 dawes Exp $ */
/**************************************************************************
Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc.,
diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_clear.c b/xc/lib/GL/mesa/src/drv/r128/r128_clear.c
index 30cfd598d..60c86d8ad 100644
--- a/xc/lib/GL/mesa/src/drv/r128/r128_clear.c
+++ b/xc/lib/GL/mesa/src/drv/r128/r128_clear.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_clear.c,v 1.2 2000/06/26 05:41:29 martin Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_clear.c,v 1.3 2000/08/25 13:42:27 dawes Exp $ */
/**************************************************************************
Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc.,
diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_context.c b/xc/lib/GL/mesa/src/drv/r128/r128_context.c
index fabdbabda..169cf212b 100644
--- a/xc/lib/GL/mesa/src/drv/r128/r128_context.c
+++ b/xc/lib/GL/mesa/src/drv/r128/r128_context.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_context.c,v 1.1 2000/06/17 00:03:04 martin Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_context.c,v 1.2 2000/08/25 13:42:28 dawes Exp $ */
/**************************************************************************
Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc.,
diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_context.h b/xc/lib/GL/mesa/src/drv/r128/r128_context.h
index ae8ef6a2d..5d80eb0a5 100644
--- a/xc/lib/GL/mesa/src/drv/r128/r128_context.h
+++ b/xc/lib/GL/mesa/src/drv/r128/r128_context.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_context.h,v 1.1 2000/06/17 00:03:05 martin Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_context.h,v 1.2 2000/08/25 13:42:28 dawes Exp $ */
/**************************************************************************
Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc.,
diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_dd.c b/xc/lib/GL/mesa/src/drv/r128/r128_dd.c
index 74cb2e2cd..f0698e21b 100644
--- a/xc/lib/GL/mesa/src/drv/r128/r128_dd.c
+++ b/xc/lib/GL/mesa/src/drv/r128/r128_dd.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_dd.c,v 1.1 2000/06/17 00:03:05 martin Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_dd.c,v 1.2 2000/08/25 13:42:28 dawes Exp $ */
/**************************************************************************
Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc.,
diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_fastpath.c b/xc/lib/GL/mesa/src/drv/r128/r128_fastpath.c
index ac251a3ad..5f00e6992 100644
--- a/xc/lib/GL/mesa/src/drv/r128/r128_fastpath.c
+++ b/xc/lib/GL/mesa/src/drv/r128/r128_fastpath.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_fastpath.c,v 1.1 2000/06/17 00:03:05 martin Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_fastpath.c,v 1.2 2000/08/25 13:42:28 dawes Exp $ */
/**************************************************************************
Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc.,
diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_init.h b/xc/lib/GL/mesa/src/drv/r128/r128_init.h
index fe8d69c3d..758995f7f 100644
--- a/xc/lib/GL/mesa/src/drv/r128/r128_init.h
+++ b/xc/lib/GL/mesa/src/drv/r128/r128_init.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_init.h,v 1.1 2000/06/17 00:03:05 martin Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_init.h,v 1.2 2000/08/25 13:42:28 dawes Exp $ */
/**************************************************************************
Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc.,
diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_pipeline.c b/xc/lib/GL/mesa/src/drv/r128/r128_pipeline.c
index 070b1e509..325c1978a 100644
--- a/xc/lib/GL/mesa/src/drv/r128/r128_pipeline.c
+++ b/xc/lib/GL/mesa/src/drv/r128/r128_pipeline.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_pipeline.c,v 1.1 2000/06/17 00:03:06 martin Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_pipeline.c,v 1.2 2000/08/25 13:42:29 dawes Exp $ */
/**************************************************************************
Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc.,
diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_pipeline.h b/xc/lib/GL/mesa/src/drv/r128/r128_pipeline.h
index e8d077bfc..3afb0947c 100644
--- a/xc/lib/GL/mesa/src/drv/r128/r128_pipeline.h
+++ b/xc/lib/GL/mesa/src/drv/r128/r128_pipeline.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_pipeline.h,v 1.1 2000/06/17 00:03:06 martin Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_pipeline.h,v 1.2 2000/08/25 13:42:29 dawes Exp $ */
/**************************************************************************
Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc.,
diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_screen.c b/xc/lib/GL/mesa/src/drv/r128/r128_screen.c
index 0ffa37348..315891274 100644
--- a/xc/lib/GL/mesa/src/drv/r128/r128_screen.c
+++ b/xc/lib/GL/mesa/src/drv/r128/r128_screen.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_screen.c,v 1.1 2000/06/17 00:03:06 martin Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_screen.c,v 1.2 2000/08/25 13:42:29 dawes Exp $ */
/**************************************************************************
Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc.,
diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_screen.h b/xc/lib/GL/mesa/src/drv/r128/r128_screen.h
index 775af5073..b8a904043 100644
--- a/xc/lib/GL/mesa/src/drv/r128/r128_screen.h
+++ b/xc/lib/GL/mesa/src/drv/r128/r128_screen.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_screen.h,v 1.1 2000/06/17 00:03:06 martin Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_screen.h,v 1.2 2000/08/25 13:42:30 dawes Exp $ */
/**************************************************************************
Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc.,
diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_span.c b/xc/lib/GL/mesa/src/drv/r128/r128_span.c
index 6f5bb4f0c..8ac51c32c 100644
--- a/xc/lib/GL/mesa/src/drv/r128/r128_span.c
+++ b/xc/lib/GL/mesa/src/drv/r128/r128_span.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_span.c,v 1.1 2000/06/17 00:03:07 martin Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_span.c,v 1.2 2000/08/25 13:42:30 dawes Exp $ */
/**************************************************************************
Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc.,
diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_state.c b/xc/lib/GL/mesa/src/drv/r128/r128_state.c
index 42e602ae6..06584784a 100644
--- a/xc/lib/GL/mesa/src/drv/r128/r128_state.c
+++ b/xc/lib/GL/mesa/src/drv/r128/r128_state.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_state.c,v 1.3 2000/06/26 05:41:29 martin Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_state.c,v 1.4 2000/08/25 13:42:30 dawes Exp $ */
/**************************************************************************
Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc.,
diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_swap.c b/xc/lib/GL/mesa/src/drv/r128/r128_swap.c
index d047f3777..d05403c41 100644
--- a/xc/lib/GL/mesa/src/drv/r128/r128_swap.c
+++ b/xc/lib/GL/mesa/src/drv/r128/r128_swap.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_swap.c,v 1.1 2000/06/17 00:03:07 martin Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_swap.c,v 1.2 2000/08/25 13:42:30 dawes Exp $ */
/**************************************************************************
Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc.,
diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_tex.c b/xc/lib/GL/mesa/src/drv/r128/r128_tex.c
index d03d49211..5d140adb8 100644
--- a/xc/lib/GL/mesa/src/drv/r128/r128_tex.c
+++ b/xc/lib/GL/mesa/src/drv/r128/r128_tex.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_tex.c,v 1.2 2000/06/26 05:41:29 martin Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_tex.c,v 1.3 2000/08/25 13:42:30 dawes Exp $ */
/**************************************************************************
Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc.,
diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_tris.c b/xc/lib/GL/mesa/src/drv/r128/r128_tris.c
index 40c462171..2dc13af19 100644
--- a/xc/lib/GL/mesa/src/drv/r128/r128_tris.c
+++ b/xc/lib/GL/mesa/src/drv/r128/r128_tris.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_tris.c,v 1.1 2000/06/17 00:03:08 martin Exp $ */ /* -*- c-basic-offset: 4 -*- */
+/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_tris.c,v 1.2 2000/08/25 13:42:31 dawes Exp $ */ /* -*- c-basic-offset: 4 -*- */
/**************************************************************************
Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc.,
diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_tris.h b/xc/lib/GL/mesa/src/drv/r128/r128_tris.h
index e66442fc3..c6f4db2ad 100644
--- a/xc/lib/GL/mesa/src/drv/r128/r128_tris.h
+++ b/xc/lib/GL/mesa/src/drv/r128/r128_tris.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_tris.h,v 1.1 2000/06/17 00:03:08 martin Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_tris.h,v 1.2 2000/08/25 13:42:31 dawes Exp $ */
/**************************************************************************
Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc.,
diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_tritmp.h b/xc/lib/GL/mesa/src/drv/r128/r128_tritmp.h
index 9eda433b9..12a813e66 100644
--- a/xc/lib/GL/mesa/src/drv/r128/r128_tritmp.h
+++ b/xc/lib/GL/mesa/src/drv/r128/r128_tritmp.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_tritmp.h,v 1.1 2000/06/17 00:03:09 martin Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_tritmp.h,v 1.2 2000/08/25 13:42:31 dawes Exp $ */
/**************************************************************************
Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc.,
diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_vb.c b/xc/lib/GL/mesa/src/drv/r128/r128_vb.c
index 05eb07e28..326b0b6e6 100644
--- a/xc/lib/GL/mesa/src/drv/r128/r128_vb.c
+++ b/xc/lib/GL/mesa/src/drv/r128/r128_vb.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_vb.c,v 1.3 2000/06/25 16:03:43 tsi Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_vb.c,v 1.4 2000/08/25 13:42:31 dawes Exp $ */
/**************************************************************************
Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc.,
diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_vb.h b/xc/lib/GL/mesa/src/drv/r128/r128_vb.h
index 131a982a1..761b3de85 100644
--- a/xc/lib/GL/mesa/src/drv/r128/r128_vb.h
+++ b/xc/lib/GL/mesa/src/drv/r128/r128_vb.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_vb.h,v 1.1 2000/06/17 00:03:09 martin Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_vb.h,v 1.2 2000/08/25 13:42:31 dawes Exp $ */
/**************************************************************************
Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc.,
diff --git a/xc/lib/GL/mesa/src/drv/sis/Imakefile b/xc/lib/GL/mesa/src/drv/sis/Imakefile
index 275a36693..56f93a157 100644
--- a/xc/lib/GL/mesa/src/drv/sis/Imakefile
+++ b/xc/lib/GL/mesa/src/drv/sis/Imakefile
@@ -1,4 +1,4 @@
-XCOMM $XFree86: xc/lib/GL/mesa/src/drv/sis/Imakefile,v 1.4 2000/08/11 17:27:10 dawes Exp $
+XCOMM $XFree86: xc/lib/GL/mesa/src/drv/sis/Imakefile,v 1.7 2000/08/24 22:20:08 tsi Exp $
#include <Threads.tmpl>
@@ -18,13 +18,6 @@ XCOMM DEBUG_DEFINES = -DSIS_DEBUG
ALLOC_DEFINES = -DMALLOC_0_RETURNS_NULL
#endif
-#if defined(LinuxArchitecture)
-OS_SUBDIR = linux
-#endif
-#if defined(FreeBSDArchitecture) || defined(BSDOSArchitecture)
-OS_SUBDIR = bsd
-#endif
-
#ifdef i386Architecture
#ifdef MesaUse3DNow
ASM_DEFS = -DUSE_MMX_ASM -DUSE_X86_ASM -DUSE_3DNOW_ASM
@@ -42,11 +35,11 @@ OS_SUBDIR = bsd
-I$(XF86OSSRC) -I$(SERVERSRC)/GL/dri \
-I$(XF86DRIVERSRC)/sis \
-I../../../include -I../.. -I../../X \
- -I../common/ \
- -I$(XF86OSSRC)/linux/drm/kernel
+ -I../common/
#endif
-MESA_INCLUDES = -I. -I.. -I../../include
+MESA_INCLUDES = -I. -I.. -I../../include \
+ -I../../../../dri/drm
LinkSourceFile(xdriP.h, ../../X)
diff --git a/xc/lib/GL/mesa/src/drv/sis/sis_alloc.c b/xc/lib/GL/mesa/src/drv/sis/sis_alloc.c
index e7b54256f..e9ce26d30 100644
--- a/xc/lib/GL/mesa/src/drv/sis/sis_alloc.c
+++ b/xc/lib/GL/mesa/src/drv/sis/sis_alloc.c
@@ -1,4 +1,35 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_alloc.c,v 1.3 2000/08/04 03:51:41 tsi Exp $ */
+/**************************************************************************
+
+Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan.
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sub license, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Sung-Ching Lin <sclin@sis.com.tw>
+ *
+ */
#include <assert.h>
@@ -16,7 +47,7 @@
#define Z_BUFFER_HW_ALIGNMENT 16
#define Z_BUFFER_HW_PLUS (16 + 4)
-/* 3D engine uses 2,and bitblt uses 4 */
+/* 3D engine uses 2, and bitblt uses 4 */
#define DRAW_BUFFER_HW_ALIGNMENT 16
#define DRAW_BUFFER_HW_PLUS (16 + 4)
@@ -60,13 +91,15 @@ sis_alloc_fb (__GLSiScontext * hwcx, GLuint size, void **free)
}
static void
-sis_free_fb (__GLSiScontext * hwcx, void *free)
+sis_free_fb (int hHWContext, void *free)
{
xf86FreeOffscreenArea ((FBAreaPtr) free);
}
#else
+int gDRMSubFD = -1;
+
/* debug */
#if 1
@@ -103,11 +136,8 @@ sis_alloc_fb (__GLSiScontext * hwcx, GLuint size, void **free)
}
static void
-sis_free_fb (__GLSiScontext * hwcx, void *free)
+sis_free_fb (int hHWContext, void *free)
{
- GLcontext *ctx = hwcx->gc;
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
-
drm_sis_mem_t fb;
if (SIS_VERBOSE&VERBOSE_SIS_MEMORY)
@@ -116,9 +146,9 @@ sis_free_fb (__GLSiScontext * hwcx, void *free)
(DWORD)free, (DWORD)getpid(), --_total_video_memory_count);
}
- fb.context = xmesa->driContextPriv->hHWContext;
+ fb.context = hHWContext;
fb.free = (unsigned int)free;
- ioctl(hwcx->drmSubFD, SIS_IOCTL_FB_FREE, &fb);
+ ioctl(gDRMSubFD, SIS_IOCTL_FB_FREE, &fb);
}
#else
@@ -139,7 +169,7 @@ sis_alloc_fb (__GLSiScontext * hwcx, GLuint size, void **free)
}
static void
-sis_free_fb (__GLSiScontext * hwcx, void *free)
+sis_free_fb (int hHWContext, void *free)
{
return;
}
@@ -176,11 +206,8 @@ sis_alloc_agp (__GLSiScontext * hwcx, GLuint size, void **free)
}
static void
-sis_free_agp (__GLSiScontext * hwcx, void *free)
+sis_free_agp (int hHWContext, void *free)
{
- GLcontext *ctx = hwcx->gc;
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
-
drm_sis_mem_t agp;
if (SIS_VERBOSE&VERBOSE_SIS_MEMORY)
@@ -189,9 +216,9 @@ sis_free_agp (__GLSiScontext * hwcx, void *free)
(DWORD)free, (DWORD)getpid(), --_total_video_memory_count);
}
- agp.context = xmesa->driContextPriv->hHWContext;
+ agp.context = hHWContext;
agp.free = (unsigned int)free;
- ioctl(hwcx->drmSubFD, SIS_IOCTL_AGP_FREE, &agp);
+ ioctl(gDRMSubFD, SIS_IOCTL_AGP_FREE, &agp);
}
/* debug */
@@ -277,9 +304,9 @@ void
sis_free_z_stencil_buffer (XMesaBuffer buf)
{
sisBufferInfo *priv = (sisBufferInfo *) buf->private;
- __GLSiScontext *hwcx = (__GLSiScontext *) buf->xm_context->private;
+ XMesaContext xmesa = buf->xm_context;
- sis_free_fb (hwcx, priv->zbFree);
+ sis_free_fb (xmesa->driContextPriv->hHWContext, priv->zbFree);
priv->zbFree = NULL;
buf->depthbuffer = NULL;
}
@@ -307,6 +334,7 @@ sis_alloc_back_image (GLcontext * ctx, XMesaImage *image, void **free,
width2 = (depth == 2) ? ALIGNMENT (xm_buffer->width, 2) : xm_buffer->width;
size = width2 * xm_buffer->height * depth + DRAW_BUFFER_HW_PLUS;
+ /* Fixme: unique context alloc/free back-buffer? */
addr = sis_alloc_fb (hwcx, size, free);
if (!addr)
{
@@ -316,7 +344,7 @@ sis_alloc_back_image (GLcontext * ctx, XMesaImage *image, void **free,
addr = (GLbyte *) ALIGNMENT ((GLuint) addr, DRAW_BUFFER_HW_ALIGNMENT);
- image->data = (char *)addr;
+ image->data = addr;
image->bytes_per_line = width2 * depth;
image->bits_per_pixel = depth * 8;
@@ -351,9 +379,9 @@ sis_alloc_back_image (GLcontext * ctx, XMesaImage *image, void **free,
void
sis_free_back_image (XMesaBuffer buf, XMesaImage *image, void *free)
{
- __GLSiScontext *hwcx = (__GLSiScontext *) buf->xm_context->private;
+ XMesaContext xmesa = buf->xm_context;
- sis_free_fb (hwcx, free);
+ sis_free_fb (xmesa->driContextPriv->hHWContext, free);
image->data = NULL;
}
@@ -476,7 +504,7 @@ sis_alloc_texture_image (GLcontext * ctx, GLtextureImage * image)
area->Format = driver_format;
area->Size = image->Width * image->Height * texel_size;
area->texelSize = texel_size;
- area->hwcx = hwcx;
+ area->hHWContext = xmesa->driContextPriv->hHWContext;
/* debug */
area->realSize = area->Size;
@@ -490,7 +518,6 @@ void
sis_free_texture_image (GLtextureImage * image)
{
SIStextureArea *area = (SIStextureArea *) image->DriverData;
- __GLSiScontext *hwcx = (__GLSiScontext *) area->hwcx;
/* debug */
Total_Real_Textures_Used -= area->realSize;
@@ -498,14 +525,14 @@ sis_free_texture_image (GLtextureImage * image)
if (!area)
return;
-
+
if (area->Data)
switch(area->memType){
case VIDEO_TYPE:
- sis_free_fb (hwcx, area->free);
+ sis_free_fb (area->hHWContext, area->free);
break;
case AGP_TYPE:
- sis_free_agp (hwcx, area->free);
+ sis_free_agp (area->hHWContext, area->free);
break;
default:
assert(0);
diff --git a/xc/lib/GL/mesa/src/drv/sis/sis_clear.c b/xc/lib/GL/mesa/src/drv/sis/sis_clear.c
index 86240b1b4..03da12499 100644
--- a/xc/lib/GL/mesa/src/drv/sis/sis_clear.c
+++ b/xc/lib/GL/mesa/src/drv/sis/sis_clear.c
@@ -1,4 +1,35 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_clear.c,v 1.3 2000/08/04 03:51:41 tsi Exp $ */
+/**************************************************************************
+
+Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan.
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sub license, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Sung-Ching Lin <sclin@sis.com.tw>
+ *
+ */
#include "sis_ctx.h"
#include "sis_mesa.h"
@@ -558,12 +589,12 @@ sis_swap_buffers (XMesaBuffer b)
/* TODO: need lock? */
#if 1
- while((*hwcx->FrameCountPtr) - *(DWORD volatile *)(hwcx->IOBase+0x8a2c)
- > SIS_MAX_FRAME_LENGTH)
{
- /*
- DWORD temp = *(DWORD *)(hwcx->IOBase+0x8a2c);
- */
+ int repeat = 0;
+
+ while(((*hwcx->FrameCountPtr) - *(DWORD volatile *)(hwcx->IOBase+0x8a2c)
+ > SIS_MAX_FRAME_LENGTH) &&
+ (repeat++ < 10));
}
#endif
diff --git a/xc/lib/GL/mesa/src/drv/sis/sis_common.h b/xc/lib/GL/mesa/src/drv/sis/sis_common.h
index a492bd24b..8b62fadcf 100644
--- a/xc/lib/GL/mesa/src/drv/sis/sis_common.h
+++ b/xc/lib/GL/mesa/src/drv/sis/sis_common.h
@@ -1,4 +1,35 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_common.h,v 1.3 2000/08/04 03:51:42 tsi Exp $ */
+/**************************************************************************
+
+Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan.
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sub license, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Sung-Ching Lin <sclin@sis.com.tw>
+ *
+ */
#ifndef _sis_common_h_
#define _sis_common_h_
@@ -146,7 +177,7 @@ typedef struct sis_texure_area
GLuint Pitch;
GLuint Size;
GLuint texelSize;
- void *hwcx;
+ unsigned int hHWContext;
/* Debug */
GLuint realSize;
diff --git a/xc/lib/GL/mesa/src/drv/sis/sis_ctx.c b/xc/lib/GL/mesa/src/drv/sis/sis_ctx.c
index 820e7d733..a45934fac 100644
--- a/xc/lib/GL/mesa/src/drv/sis/sis_ctx.c
+++ b/xc/lib/GL/mesa/src/drv/sis/sis_ctx.c
@@ -1,3 +1,36 @@
+/**************************************************************************
+
+Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan.
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sub license, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Sung-Ching Lin <sclin@sis.com.tw>
+ *
+ */
+
#ifdef XFree86Server
# define PSZ 8
# include "cfb.h"
diff --git a/xc/lib/GL/mesa/src/drv/sis/sis_ctx.h b/xc/lib/GL/mesa/src/drv/sis/sis_ctx.h
index f225fc0cf..5bbaa29b4 100644
--- a/xc/lib/GL/mesa/src/drv/sis/sis_ctx.h
+++ b/xc/lib/GL/mesa/src/drv/sis/sis_ctx.h
@@ -1,4 +1,35 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_ctx.h,v 1.3 2000/08/04 03:51:42 tsi Exp $ */
+/**************************************************************************
+
+Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan.
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sub license, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Sung-Ching Lin <sclin@sis.com.tw>
+ *
+ */
#ifndef _sis_ctx_h_
#define _sis_ctx_h_
@@ -109,9 +140,8 @@ typedef struct __GLSiSHardwareRec
}
__GLSiSHardware;
-/*
- ** Device dependent context state
- */
+/* Device dependent context state */
+
typedef struct __GLSiScontextRec
{
/* This must be first in this structure */
@@ -121,10 +151,10 @@ typedef struct __GLSiScontextRec
unsigned int bytesPerPixel;
unsigned char *IOBase;
unsigned char *FbBase;
- unsigned int displayWidth; /* per byte */
+ unsigned int displayWidth;
unsigned int pitch;
- /* for sw-render */
+ /* For Software Renderer */
GLubyte *swRenderBase;
GLuint swRenderPitch;
GLubyte *swZBase;
@@ -143,7 +173,7 @@ typedef struct __GLSiScontextRec
unsigned int clearColorPattern;
unsigned int clearZStencilPattern;
- /* render function */
+ /* Render Function */
points_func PointsFunc;
line_func LineFunc;
triangle_func TriangleFunc;
@@ -196,7 +226,7 @@ typedef struct __GLSiScontextRec
void (*SwapBuffers)(XMesaBuffer b);
- /* stereo */
+ /* Stereo */
GLboolean isFullScreen;
GLboolean useStereo;
GLboolean stereoEnabled;
@@ -221,7 +251,7 @@ typedef struct __GLSiScontextRec
}
__GLSiScontext;
-/* Macros to access hwcx */
+/* Macros */
#define GET_IOBase(x) ((x)->IOBase)
#define GET_FbBase(x) ((x)->FbBase)
#define GET_AGPBase(x) ((x)->AGPBase)
@@ -253,6 +283,9 @@ void sis_StartAGP (GLcontext * ctx);
void sis_FlushAGP (GLcontext * ctx);
extern float *AGP_CurrentPtr;
+/* DRM FD */
+extern int gDRMSubFD;
+
void sis_fatal_error (void);
#endif
diff --git a/xc/lib/GL/mesa/src/drv/sis/sis_debug.c b/xc/lib/GL/mesa/src/drv/sis/sis_debug.c
index 3d9c21012..d95579ac0 100644
--- a/xc/lib/GL/mesa/src/drv/sis/sis_debug.c
+++ b/xc/lib/GL/mesa/src/drv/sis/sis_debug.c
@@ -1,4 +1,35 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_debug.c,v 1.3 2000/08/04 03:51:42 tsi Exp $ */
+/**************************************************************************
+
+Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan.
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sub license, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Sung-Ching Lin <sclin@sis.com.tw>
+ *
+ */
/*
* dump HW states, set environment variable SIS_DEBUG
diff --git a/xc/lib/GL/mesa/src/drv/sis/sis_debug.h b/xc/lib/GL/mesa/src/drv/sis/sis_debug.h
index ea4c16204..546aa361a 100644
--- a/xc/lib/GL/mesa/src/drv/sis/sis_debug.h
+++ b/xc/lib/GL/mesa/src/drv/sis/sis_debug.h
@@ -1,3 +1,36 @@
+/**************************************************************************
+
+Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan.
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sub license, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Sung-Ching Lin <sclin@sis.com.tw>
+ *
+ */
+
#ifndef _sis_debug_h_
#define _sis_debug_h_
diff --git a/xc/lib/GL/mesa/src/drv/sis/sis_fastpath.c b/xc/lib/GL/mesa/src/drv/sis/sis_fastpath.c
index 725c9e10a..ba1092d30 100644
--- a/xc/lib/GL/mesa/src/drv/sis/sis_fastpath.c
+++ b/xc/lib/GL/mesa/src/drv/sis/sis_fastpath.c
@@ -1,3 +1,36 @@
+/**************************************************************************
+
+Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan.
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sub license, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Sung-Ching Lin <sclin@sis.com.tw>
+ *
+ */
+
/*
* FOR
* 1. triangle/strip with 2-texture with no other capability
diff --git a/xc/lib/GL/mesa/src/drv/sis/sis_fog.c b/xc/lib/GL/mesa/src/drv/sis/sis_fog.c
index 61bab48d8..7a2f5302c 100644
--- a/xc/lib/GL/mesa/src/drv/sis/sis_fog.c
+++ b/xc/lib/GL/mesa/src/drv/sis/sis_fog.c
@@ -1,3 +1,36 @@
+/**************************************************************************
+
+Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan.
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sub license, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Sung-Ching Lin <sclin@sis.com.tw>
+ *
+ */
+
#include "sis_ctx.h"
#include "sis_mesa.h"
diff --git a/xc/lib/GL/mesa/src/drv/sis/sis_init.h b/xc/lib/GL/mesa/src/drv/sis/sis_init.h
index 12fd6164a..8b8f3b4ab 100644
--- a/xc/lib/GL/mesa/src/drv/sis/sis_init.h
+++ b/xc/lib/GL/mesa/src/drv/sis/sis_init.h
@@ -1,3 +1,36 @@
+/**************************************************************************
+
+Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan.
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sub license, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Sung-Ching Lin <sclin@sis.com.tw>
+ *
+ */
+
#ifndef _sis_init_h_
#define _sis_init_h_
diff --git a/xc/lib/GL/mesa/src/drv/sis/sis_linefunc.h b/xc/lib/GL/mesa/src/drv/sis/sis_linefunc.h
index 28f5007c0..33f4542bf 100644
--- a/xc/lib/GL/mesa/src/drv/sis/sis_linefunc.h
+++ b/xc/lib/GL/mesa/src/drv/sis/sis_linefunc.h
@@ -1,4 +1,35 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_linefunc.h,v 1.3 2000/08/04 03:51:42 tsi Exp $ */
+/**************************************************************************
+
+Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan.
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sub license, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Sung-Ching Lin <sclin@sis.com.tw>
+ *
+ */
#define SIS_TRI_FUNC 0
@@ -156,7 +187,7 @@ else{ \
AGP_CurrentPtr+=3; \
if (SIS_STATES & (SIS_USE_W)) \
{ \
- if(VB->TexCoordPtr[1]->size == 4){ \
+ if(VB->TexCoordPtr[0]->size == 4){ \
AGP_CurrentPtr[0] = VB->Win.data[v][3] * \
VB->TexCoordPtr[0]->data[v][3]; \
} \
diff --git a/xc/lib/GL/mesa/src/drv/sis/sis_lock.h b/xc/lib/GL/mesa/src/drv/sis/sis_lock.h
index 7e6dadb20..99bee12ca 100644
--- a/xc/lib/GL/mesa/src/drv/sis/sis_lock.h
+++ b/xc/lib/GL/mesa/src/drv/sis/sis_lock.h
@@ -1,3 +1,36 @@
+/**************************************************************************
+
+Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan.
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sub license, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Sung-Ching Lin <sclin@sis.com.tw>
+ *
+ */
+
#ifndef _sis_dri_h_
#define _sis_dri_h_
diff --git a/xc/lib/GL/mesa/src/drv/sis/sis_mesa.c b/xc/lib/GL/mesa/src/drv/sis/sis_mesa.c
index ca09b153f..d733a4cf8 100644
--- a/xc/lib/GL/mesa/src/drv/sis/sis_mesa.c
+++ b/xc/lib/GL/mesa/src/drv/sis/sis_mesa.c
@@ -1,4 +1,35 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_mesa.c,v 1.3 2000/08/04 03:51:42 tsi Exp $ */
+/**************************************************************************
+
+Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan.
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sub license, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Sung-Ching Lin <sclin@sis.com.tw>
+ *
+ */
#include "sis_ctx.h"
#include "sis_mesa.h"
diff --git a/xc/lib/GL/mesa/src/drv/sis/sis_mesa.h b/xc/lib/GL/mesa/src/drv/sis/sis_mesa.h
index 9d3d05db7..033ee56ad 100644
--- a/xc/lib/GL/mesa/src/drv/sis/sis_mesa.h
+++ b/xc/lib/GL/mesa/src/drv/sis/sis_mesa.h
@@ -1,3 +1,36 @@
+/**************************************************************************
+
+Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan.
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sub license, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Sung-Ching Lin <sclin@sis.com.tw>
+ *
+ */
+
#ifndef _sis_mesa_h_
#define _sis_mesa_h_
diff --git a/xc/lib/GL/mesa/src/drv/sis/sis_reg.h b/xc/lib/GL/mesa/src/drv/sis/sis_reg.h
index d9b408b42..1d023e634 100644
--- a/xc/lib/GL/mesa/src/drv/sis/sis_reg.h
+++ b/xc/lib/GL/mesa/src/drv/sis/sis_reg.h
@@ -1,3 +1,36 @@
+/**************************************************************************
+
+Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan.
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sub license, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Sung-Ching Lin <sclin@sis.com.tw>
+ *
+ */
+
#ifndef _sis_reg_h_
#define _sis_reg_h_
diff --git a/xc/lib/GL/mesa/src/drv/sis/sis_render.c b/xc/lib/GL/mesa/src/drv/sis/sis_render.c
index f59e4be2e..f990d43b5 100644
--- a/xc/lib/GL/mesa/src/drv/sis/sis_render.c
+++ b/xc/lib/GL/mesa/src/drv/sis/sis_render.c
@@ -1,4 +1,35 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_render.c,v 1.3 2000/08/04 03:51:42 tsi Exp $ */
+/**************************************************************************
+
+Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan.
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sub license, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Sung-Ching Lin <sclin@sis.com.tw>
+ *
+ */
#include "sis_ctx.h"
#include "sis_mesa.h"
@@ -425,6 +456,8 @@ sis_set_render_func (GLcontext * ctx)
ctx->Driver.LineFunc = NULL;
ctx->Driver.TriangleFunc = NULL;
hwcx->swRenderFlag = ~0x0;
+ ctx->Visual->DepthMax = (sizeof(GLdepth)==2)?0xffff:0xffffffff;
+ ctx->Visual->DepthMaxF = (double)(sizeof(GLdepth)==2)?0xffff:0xffffffff;
*/
}
diff --git a/xc/lib/GL/mesa/src/drv/sis/sis_span.c b/xc/lib/GL/mesa/src/drv/sis/sis_span.c
index fcee409d1..1128e39b3 100644
--- a/xc/lib/GL/mesa/src/drv/sis/sis_span.c
+++ b/xc/lib/GL/mesa/src/drv/sis/sis_span.c
@@ -1,4 +1,35 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_span.c,v 1.2 2000/08/04 03:51:42 tsi Exp $ */
+/**************************************************************************
+
+Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan.
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sub license, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Sung-Ching Lin <sclin@sis.com.tw>
+ *
+ */
#include "sis_ctx.h"
#include "sis_mesa.h"
@@ -14,7 +45,7 @@
XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
__GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; \
GLuint pitch = hwcx->swRenderPitch; \
- char *buf = (char *)hwcx->swRenderBase
+ char *buf = hwcx->swRenderBase
#define CLIPPIXEL(_x,_y) (_x >= minx && _x < maxx && \
_y >= miny && _y < maxy)
diff --git a/xc/lib/GL/mesa/src/drv/sis/sis_stencil.c b/xc/lib/GL/mesa/src/drv/sis/sis_stencil.c
index 950435cf4..3f2abb5bb 100644
--- a/xc/lib/GL/mesa/src/drv/sis/sis_stencil.c
+++ b/xc/lib/GL/mesa/src/drv/sis/sis_stencil.c
@@ -1,3 +1,36 @@
+/**************************************************************************
+
+Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan.
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sub license, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Sung-Ching Lin <sclin@sis.com.tw>
+ *
+ */
+
#include "sis_ctx.h"
#include "sis_mesa.h"
diff --git a/xc/lib/GL/mesa/src/drv/sis/sis_swzfunc.h b/xc/lib/GL/mesa/src/drv/sis/sis_swzfunc.h
index 322a7ad40..f2969bec2 100644
--- a/xc/lib/GL/mesa/src/drv/sis/sis_swzfunc.h
+++ b/xc/lib/GL/mesa/src/drv/sis/sis_swzfunc.h
@@ -1,3 +1,36 @@
+/**************************************************************************
+
+Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan.
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sub license, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Sung-Ching Lin <sclin@sis.com.tw>
+ *
+ */
+
static void SIS_TAG (sis_WriteDepthSpan) (GLcontext * ctx, GLuint n, GLint x,
GLint y, const GLdepth depth[],
const GLubyte mask[])
diff --git a/xc/lib/GL/mesa/src/drv/sis/sis_texture.c b/xc/lib/GL/mesa/src/drv/sis/sis_texture.c
index eb9042563..bbbe73dd7 100644
--- a/xc/lib/GL/mesa/src/drv/sis/sis_texture.c
+++ b/xc/lib/GL/mesa/src/drv/sis/sis_texture.c
@@ -1,4 +1,35 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_texture.c,v 1.3 2000/08/04 03:51:42 tsi Exp $ */
+/**************************************************************************
+
+Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan.
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sub license, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Sung-Ching Lin <sclin@sis.com.tw>
+ *
+ */
#include "sis_ctx.h"
#include "sis_mesa.h"
@@ -113,10 +144,8 @@ sis_TexImage (GLcontext * ctx, GLenum target,
SIStextureArea *area;
if (target == GL_TEXTURE_3D || image->Border)
- {
- return;
- }
-
+ return;
+
if (!tObj->DriverData)
{
sisTexobjInfo *info;
@@ -139,8 +168,7 @@ sis_TexImage (GLcontext * ctx, GLenum target,
}
else
{
- /* Optimize */
-
+ /* Optimize */
((sisTexobjInfo *) tObj->DriverData)->dirtyFlag |= (SIS_TEX_PARAMETER
| SIS_TEX_ENV);
}
@@ -153,7 +181,7 @@ sis_TexImage (GLcontext * ctx, GLenum target,
if (area->Format == GL_RGB8)
{
int i;
- GLbyte *src = (GLbyte *)image->Data;
+ GLbyte *src = image->Data;
GLbyte *dst = area->Data;
for (i = 0; i < area->Size / 4; i++)
@@ -203,7 +231,7 @@ sis_TexSubImage (GLcontext * ctx, GLenum target,
if (area->Format == GL_RGB8)
{
- src = (GLbyte *)image->Data + (xoffset + yoffset * image->Width) * 3;
+ src = image->Data + (xoffset + yoffset * image->Width) * 3;
dst = area->Data + (xoffset + yoffset * image->Width) * 4;
soffset = (image->Width - width) * 3;
doffset = (image->Width - width) * 4;
@@ -224,7 +252,7 @@ sis_TexSubImage (GLcontext * ctx, GLenum target,
GLuint texelSize = area->texelSize;
GLuint copySize = texelSize * width;
- src = (GLbyte *)image->Data + (xoffset + yoffset * image->Width) * texelSize;
+ src = image->Data + (xoffset + yoffset * image->Width) * texelSize;
dst = area->Data + (xoffset + yoffset * image->Width) * texelSize;
soffset = image->Width * texelSize;
diff --git a/xc/lib/GL/mesa/src/drv/sis/sis_trifunc.h b/xc/lib/GL/mesa/src/drv/sis/sis_trifunc.h
index 126b1ac53..7c57a615f 100644
--- a/xc/lib/GL/mesa/src/drv/sis/sis_trifunc.h
+++ b/xc/lib/GL/mesa/src/drv/sis/sis_trifunc.h
@@ -1,3 +1,36 @@
+/**************************************************************************
+
+Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan.
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sub license, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Sung-Ching Lin <sclin@sis.com.tw>
+ *
+ */
+
#define SIS_TRI_FUNC 1
static void
diff --git a/xc/lib/GL/mesa/src/drv/sis/sis_xmesa.c b/xc/lib/GL/mesa/src/drv/sis/sis_xmesa.c
index 1dd01a51a..0f9bb0619 100644
--- a/xc/lib/GL/mesa/src/drv/sis/sis_xmesa.c
+++ b/xc/lib/GL/mesa/src/drv/sis/sis_xmesa.c
@@ -1,4 +1,35 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_xmesa.c,v 1.3 2000/08/04 03:51:42 tsi Exp $ */
+/**************************************************************************
+
+Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan.
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sub license, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Sung-Ching Lin <sclin@sis.com.tw>
+ *
+ */
#include <unistd.h>
#include <sys/mman.h>
@@ -78,6 +109,8 @@ GLboolean XMesaInitDriver (__DRIscreenPrivate * driScrnPriv)
global_regs = priv->regs;
global_agp = priv->agp;
global_FbBase = driScrnPriv->pFB;
+
+ gDRMSubFD = driScrnPriv->fd;
return GL_TRUE;
}
@@ -302,7 +335,7 @@ GLframebuffer *XMesaCreatePixmapBuffer( Display *dpy,
static void SISDestroyBuffer (XMesaBuffer b)
{
if (SIS_VERBOSE&VERBOSE_SIS_BUFFER){
- fprintf(stderr, "XMesaDestroyBuffer: b=%lu\n", (DWORD)b);
+ fprintf(stderr, "SISDestroyBuffer: b=%lu\n", (DWORD)b);
}
if (b->backimage && b->backimage->data)
diff --git a/xc/lib/GL/mesa/src/drv/sis/sis_xmesaP.h b/xc/lib/GL/mesa/src/drv/sis/sis_xmesaP.h
index f7e5b667a..dc19c1be4 100644
--- a/xc/lib/GL/mesa/src/drv/sis/sis_xmesaP.h
+++ b/xc/lib/GL/mesa/src/drv/sis/sis_xmesaP.h
@@ -21,7 +21,7 @@
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_xmesaP.h,v 1.3 2000/08/04 03:51:42 tsi Exp $ */
+
#ifndef XMESAP_H
#define XMESAP_H
diff --git a/xc/lib/GL/mesa/src/drv/sis/sis_xwin.c b/xc/lib/GL/mesa/src/drv/sis/sis_xwin.c
index 5b6268179..c651b444b 100644
--- a/xc/lib/GL/mesa/src/drv/sis/sis_xwin.c
+++ b/xc/lib/GL/mesa/src/drv/sis/sis_xwin.c
@@ -1,3 +1,36 @@
+/**************************************************************************
+
+Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan.
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sub license, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Sung-Ching Lin <sclin@sis.com.tw>
+ *
+ */
+
#include "sis_ctx.h"
#include "sis_mesa.h"
diff --git a/xc/lib/GL/mesa/src/drv/tdfx/Imakefile b/xc/lib/GL/mesa/src/drv/tdfx/Imakefile
index ea80d8e4f..43d62f0c4 100644
--- a/xc/lib/GL/mesa/src/drv/tdfx/Imakefile
+++ b/xc/lib/GL/mesa/src/drv/tdfx/Imakefile
@@ -1,4 +1,4 @@
-XCOMM $XFree86: xc/lib/GL/mesa/src/drv/tdfx/Imakefile,v 1.10 2000/08/04 03:51:44 tsi Exp $
+XCOMM $XFree86: xc/lib/GL/mesa/src/drv/tdfx/Imakefile,v 1.12 2000/08/25 13:42:32 dawes Exp $
#include <Threads.tmpl>
@@ -22,7 +22,8 @@ ALLOC_DEFINES = -DMALLOC_0_RETURNS_NULL
-I../../../include -I../.. -I../../X
#endif
-MESA_INCLUDES = -I. -I.. -I../../include
+MESA_INCLUDES = -I. -I.. -I../../include \
+ -I../../../../dri/drm
DEFINES = $(ALLOC_DEFINES) $(DRI_DEFINES)
INCLUDES = -I$(XLIBSRC) -I$(EXTINCSRC) $(MESA_INCLUDES) $(DRI_INCLUDES) \
diff --git a/xc/programs/Imakefile b/xc/programs/Imakefile
index 33a60c4f5..32a0d35df 100644
--- a/xc/programs/Imakefile
+++ b/xc/programs/Imakefile
@@ -2,7 +2,7 @@ XCOMM $TOG: Imakefile /main/85 1998/02/26 17:14:44 kaleb $
XCOMM
XCOMM
XCOMM
-XCOMM $XFree86: xc/programs/Imakefile,v 3.29 2000/06/15 20:49:59 dawes Exp $
+XCOMM $XFree86: xc/programs/Imakefile,v 3.31 2000/09/22 11:35:41 alanh Exp $
#define IHaveSubdirs
#define PassCDebugFlags CDEBUGFLAGS="$(CDEBUGFLAGS)"
@@ -46,6 +46,9 @@ XFINDPROXYSRCDIR = xfindproxy
#if BuildXF86VidModeExt
XGAMMASRCDIR = xgamma
#endif
+#if BuildXvExt
+ XVINFOSRCDIR = xvinfo
+#endif
XHOSTSRCDIR = xhost
#if BuildPlugin
XRXSRCDIR = xrx
@@ -84,8 +87,9 @@ SUBDIRS = \
xrefresh $(XRXSRCDIR) xset \
xsetroot $(XSMSRCDIR) xstdcmap xsetmode xsetpointer \
$(XTERMSRCDIR) $(XVIDTUNESRCDIR) xwd xwininfo xwud \
- $(XPMCLIENTDIRS) \
- $(XSSRCDIR) $(XASSRCDIR) $(LBXPROXYSRCDIR) $(SCRIPTSDIR)
+ $(XPMCLIENTDIRS) $(XVINFOSRCDIR) \
+ $(XSSRCDIR) $(XASSRCDIR) $(LBXPROXYSRCDIR) $(SCRIPTSDIR) \
+ glxinfo
#endif
MakeSubdirs($(SUBDIRS))
diff --git a/xc/programs/Xserver/Imakefile b/xc/programs/Xserver/Imakefile
index bcccf3203..4ed670b60 100644
--- a/xc/programs/Xserver/Imakefile
+++ b/xc/programs/Xserver/Imakefile
@@ -2,7 +2,7 @@ XCOMM $TOG: Imakefile /main/249 1997/12/11 11:18:14 kaleb $
/*
* Server Master Makefile
*/
-XCOMM $XFree86: xc/programs/Xserver/Imakefile,v 3.186 2000/08/11 17:25:02 dawes Exp $
+XCOMM $XFree86: xc/programs/Xserver/Imakefile,v 3.195 2000/09/22 05:56:35 keithp Exp $
#ifndef InstallXserverSetUID
#define InstallXserverSetUID NO
@@ -46,6 +46,8 @@ INSTPGMFLAGS =
#define FbPostFbLibs $(FB) NoMfbPostFbLibs
#define FBLibs PreFbLibs FbPostFbLibs
+#define MiExtLibs $(SHADOW)
+
#define AllFBLibs PreFbLibs $(FB) $(CFB) PostFbLibs
#if BuildPexExt
@@ -183,20 +185,24 @@ XPDDXFBLIBS = $(MFB) $(CFB32)
XPFBLIBS = dix/LibraryTargetName(xpstubs)
#endif
+#if BuildRender
+ RENDERDIR = render
+ RENDERLIB = $(RENDERDIR)/librender.a
+#endif
#if DoLoadableServer
- EXTENSIONS = $(OTHEREXTS)
+ EXTENSIONS = $(OTHEREXTS) $(RENDERLIB)
LOADABLEEXTS = $(PEXLIBS) $(XIEEXT) $(MISCEXT) $(DBEEXT) $(RECORDEXT) \
$(GLXEXT)
MISCEXT = Xext/LibraryTargetName(ext)
OTHEREXTS = Xext/LibraryTargetName(exts) $(XKBEXT) $(XINPUTEXT) \
$(LBXEXT) $(SITEEXTS)
#else
- EXTENSIONS = $(OTHEREXTS) $(PEXLIBS) $(GLXEXT)
+ EXTENSIONS = $(OTHEREXTS) $(PEXLIBS) $(GLXEXT) $(RENDERLIB)
OTHEREXTS = Xext/LibraryTargetName(ext) $(XKBEXT) $(XINPUTEXT) \
$(XIEEXT) $(LBXEXT) $(DBEEXT) $(RECORDEXT) $(SITEEXTS)
#endif
EXTDIRS = Xext $(XKBDIR) $(XIDIR) $(XIEDIR) $(PEXDIR) $(GLXDIR) \
- $(LBXDIRS) $(DBEDIR) $(RECORDDIR) $(SITEEXTDIRS)
+ $(LBXDIRS) $(DBEDIR) $(RECORDDIR) $(SITEEXTDIRS) $(RENDERDIR)
XAULIB = $(XAUTHSRC)/LibraryTargetName(Xau)
XDMCPLIB = $(XDMCPLIBSRC)/LibraryTargetName(Xdmcp)
#if BuildLBX || GzipFontCompression
@@ -220,6 +226,7 @@ XPFBLIBS = dix/LibraryTargetName(xpstubs)
cfb24/ModuleLibraryTargetName(cfb24)
CFB32 = cfb/ModuleLibraryTargetName(cfb) \
cfb32/ModuleLibraryTargetName(cfb32)
+ SHADOW = miext/shadow/ModuleLibraryTargetName(shadow)
#else
MFB = mfb/LibraryTargetName(mfb)
FB = fb/LibraryTargetName(fb)
@@ -230,6 +237,7 @@ XPFBLIBS = dix/LibraryTargetName(xpstubs)
CFB16 = cfb/LibraryTargetName(cfb) cfb16/LibraryTargetName(cfb16)
CFB24 = cfb/LibraryTargetName(cfb) cfb24/LibraryTargetName(cfb24)
CFB32 = cfb/LibraryTargetName(cfb) cfb32/LibraryTargetName(cfb32)
+ SHADOW = miext/shadow/LibraryTargetName(shadow)
#endif
#if BuildLowMem
LMFCFB = lmfcfb/LibraryTargetName(cfb)
@@ -527,16 +535,19 @@ XCOMM
#if XF86Server
XF86SERVER = XFree86
#endif
-#if XnestServer && !MakeDllModules
+#if XnestServer
XNEST = Xnest
#endif
-#if XVirtualFramebufferServer && !MakeDllModules
+#if XVirtualFramebufferServer
XVFB = Xvfb
#endif
#if XWinServer && !MakeDllModules
XWIN = XWin
#endif
-#if defined(XF86Server) || (!MakeDllModules && (defined(XnestServer) || defined(XVirtualFramebufferServer) || defined(XWinServer)))
+#if defined(XF86Server) || \
+ defined(XnestServer) || \
+ defined(XVirtualFramebufferServer) || \
+ (!MakeDllModules && defined(XWinServer))
MakeMutex($(XF86SERVER) $(XNEST) $(XVFB) $(XWIN))
#endif
MakeMutex($(STDDIRS) mfb fb cfb cfb16 cfb24 cfb32)
@@ -553,11 +564,12 @@ CFB8DIR = cfb
CFB16DIR = cfb16
CFB24DIR = cfb24
CFB32DIR = cfb32
+SHADOWDIR = miext/shadow
#if XF86AFB
AFBDIR = afb
#endif
DDXDIR1 = hw/xfree86
-XF86SERVERSUBDIRS = $(STDDIRS) $(MFBDIR) $(FBDIR) $(CFB8DIR) $(CFB16DIR) $(CFB24DIR) $(CFB32DIR) $(AFBDIR) $(DDXDIR1) $(DEPDIRS)
+XF86SERVERSUBDIRS = $(STDDIRS) $(MFBDIR) $(FBDIR) $(CFB8DIR) $(CFB16DIR) $(CFB24DIR) $(CFB32DIR) $(AFBDIR) $(SHADOWDIR) $(DDXDIR1) $(DEPDIRS)
XF86INIT = $(XF86COMSRC)/xf86Init.o $(XF86COMSRC)/xf86IniExt.o
XF86COMLIB = $(XF86COMSRC)/LibraryTargetName(xf86)
XF86PARSLIB= $(XF86PARSERSRC)/LibraryTargetName(xf86config)
@@ -628,17 +640,16 @@ XF86LIBS = $(XF86INIT) $(XF86COMLIB) $(XF86PARSLIB) $(XF86OSLIB)
#endif
#if DoLoadableServer
XF86LOADERLIB = $(XF86SRC)/loader/LibraryTargetName(loader)
-XF86MAINLIBS = PreFbLibsNoFont $(FONTBASE) $(OTHEREXTS) $(XF86COMLIB) \
+XF86MAINLIBS = MiExtLibs PreFbLibsNoFont $(FONTBASE) $(OTHEREXTS) $(XF86COMLIB) \
NoMfbPostFbLibs
XF86SERVERSYSLIBS = $(SYSLIBS) $(LIBDL) $(LIBREGEX)
#else
-XF86MAINLIBS = AllFBLibs $(XF86COMLIB) $(MI)
+XF86MAINLIBS = MiExtLibs AllFBLibs $(XF86COMLIB) $(MI)
XF86SERVERSYSLIBS = $(FONTLIBS) $(SYSLIBS) $(LIBDL) $(LIBREGEX)
#endif
XF86SERVEROBJS = $(XF86DRVOBJS) $(XF86IDRVOBJS)
XF86SERVERLIBS = $(XF86DRVLIBS) $(XF86IDRVLIBS) $(XF86LIBS) $(XF86LOADERLIB) \
- $(XF86COMLIB) $(XF86MAINLIBS) $(XF86SCANLIB) $(XF86OSLIB) \
- $(XF86DDCLIB)
+ $(XF86COMLIB) $(XF86MAINLIBS) $(XF86SCANLIB) $(XF86OSLIB)
#if HasParallelMake
MakeMutex($(XF86SERVERSUBDIRS) $(XF86SERVERLIBS) $(XF86SERVERSYSLIBS))
#endif
@@ -655,6 +666,7 @@ ServerDriverSDKTarget(XFree86)
#endif
#endif /* XF86Server */
+#ifdef KDriveXServer
XCOMM
XCOMM Tiny X server section
XCOMM
@@ -674,13 +686,14 @@ XCOMM
PSEUDO8 = $(KDRIVE)/pseudo8/LibraryTargetName(pseudo8)
PSEUDO8DIR = $(KDRIVE)/pseudo8
#endif
+ SHADOWDIR = miext/shadow
KD = $(KDRIVE)/LibraryTargetName(kdrive)
KDFBDEV = $(KDRIVE)/fbdev/LibraryTargetName(fbdev)
#define StdKdDirs $(KDRIVE) $(KDOSDIR) $(PSEUDO8DIR) fb $(DEPDIRS)
#define StdKdSysLibs $(FONTLIBS) $(SYSLIBS)
-#define KdLibs $(KD) $(KDOS) $(PSEUDO8)
+#define KdLibs $(KD) $(KDOS) $(PSEUDO8) MiExtLibs $(RENDERLIB)
#if XfbdevServer
XCOMM
@@ -764,14 +777,17 @@ XCOMM
FBDEVDIR = $(KDRIVE)/fbdev
FBDEV = $(FBDEVDIR)/LibraryTargetName(fbdev)
+ VESADIR = $(KDRIVE)/vesa
+ VESA = $(VESADIR)/LibraryTargetName(vesa)
+ SHADOWDIR = miext/shadow
TRIDENTDIR = $(KDRIVE)/trident
TRIDENT = $(TRIDENTDIR)/LibraryTargetName(trident)
KDDIRS = StdKdDirs
- TRIDENTDIRS = $(STDDIRS) $(KDDIRS) $(FBDEVDIR) $(TRIDENTDIR)
+ TRIDENTDIRS = $(STDDIRS) $(KDDIRS) $(FBDEVDIR) $(VESADIR) $(SHADOWDIR) $(TRIDENTDIR)
- TRIDENTLIBS = PreFbLibs $(TRIDENT) $(FBDEV) KdLibs FbPostFbLibs
+ TRIDENTLIBS = PreFbLibs $(TRIDENT) $(FBDEV) $(VESA) KdLibs FbPostFbLibs
TRIDENTSYSLIBS = StdKdSysLibs
#if HasParallelMake
@@ -889,10 +905,38 @@ $(ITSYOBJS) $(ITSYLIBS) $(ITSYSYSLIBS):: $(ITSYDIRS)
ServerTarget(Xitsy,$(ITSYDIRS),$(ITSYOBJS),$(ITSYLIBS),$(ITSYSYSLIBS))
#endif /* XItsyServer */
+#if XvesaServer
+XCOMM
+XCOMM server with vesa driver only based on Keith's server
+XCOMM
+
+ VESADIR = $(KDRIVE)/vesa
+ VESA = $(VESADIR)/LibraryTargetName(vesa)
+
+ KDDIRS = StdKdDirs
+
+ SHADOWDIR = miext/shadow
+
+ VESADIRS = $(STDDIRS) $(KDDIRS) $(VESADIR) $(SHADOWDIR)
+
+ VESALIBS = PreFbLibs $(VESA) KdLibs FbPostFbLibs
+VESASYSLIBS = StdKdSysLibs
+
+#if HasParallelMake
+MakeMutex($(VESADIRS) $(VESAOBJS) $(VESALIBS) $(VESASYSLIBS))
+#endif
+#if ForceServerRemake
+$(VESAOBJS) $(XVESA) $(VESALIBS) $(VESASYSLIBS):: $(VESADIRS)
+ @if [ -f $@ ]; then touch $@; fi
+#endif
+ServerTarget(Xvesa,$(VESADIRS),$(VESAOBJS),$(VESALIBS),$(VESASYSLIBS))
+#endif /* XvesaServer */
+
KDRIVEDIRS=$(KDDIRS) $(FBDEVDIR) $(SAVAGEDIR) $(TRIDENTDIR) $(SIS530DIR) \
- $(TRIODIR) $(TS300DIR) $(ITSYDIR) $(IGSDIR)
+ $(TRIODIR) $(TS300DIR) $(ITSYDIR) $(IGSDIR) $(VESADIR)
+#endif /* KDriveXServer */
-#if XprtServer && !MakeDllModules
+#if XprtServer
XCOMM
XCOMM Print Server
XCOMM
@@ -925,7 +969,7 @@ $(XPOBJS) $(XPLIBS) $(XPSYSLIBS):: $(XPSUBDIRS)
ServerTarget(Xprt,$(XPSUBDIRS),$(XPOBJS),$(XPLIBS) $(LOADABLEEXTS) $(LIBCWRAPPER),$(XPSYSLIBS))
#endif /* XprtServer */
-#if XnestServer && !MakeDllModules
+#if XnestServer
XCOMM
XCOMM Server with Xlib-based ddx
XCOMM
@@ -974,7 +1018,7 @@ Xnon: $(STDDIRS) $(MFBDIR) $(CFB8DIR) $(CFB16DIR) $(CFB32DIR) $(DEPDIRS)
#endif /* XnonServer */
-#if XVirtualFramebufferServer && !MakeDllModules
+#if XVirtualFramebufferServer
XCOMM
XCOMM server with Virtual (malloced) framebuffer
XCOMM
@@ -1056,10 +1100,11 @@ ServerTarget(XWin,$(XWINDIRS),$(XWINOBJS), \
CFBDIRS = $(CFB8DIR) $(CFB16DIR) $(CFB24DIR) $(CFB32DIR)
+MIEXTDIRS = $(SHADOWDIR)
IPLANDIRS = $(IPLAN2P2DIR) $(IPLAN2P4DIR) $(IPLAN2P8DIR)
DDXDIRS = $(DDXDIR1) $(DDXDIR2) $(DDXDIR3) $(XVFBDDXDIR) $(XNESTDDXDIR)
SUBDIRS = $(STDDIRS) $(MFBDIR) $(CFBDIRS) $(IPLANDIRS) $(ILBMDIR) $(AFBDIR) \
- $(LMFCFBDIR) $(DDXDIRS) $(FBDIR) $(KDRIVEDIRS)
+ $(LMFCFBDIR) $(DDXDIRS) $(FBDIR) $(KDRIVEDIRS) $(MIEXTDIRS)
#if defined(ServerToInstall) && !defined(OS2Architecture) && !defined(QNX4Architecture)
install::
diff --git a/xc/programs/Xserver/hw/kdrive/igs/Imakefile b/xc/programs/Xserver/hw/kdrive/igs/Imakefile
index cf18d0efe..444c78fe0 100644
--- a/xc/programs/Xserver/hw/kdrive/igs/Imakefile
+++ b/xc/programs/Xserver/hw/kdrive/igs/Imakefile
@@ -1,13 +1,12 @@
-XCOMM $XFree86: xc/programs/Xserver/hw/kdrive/igs/Imakefile,v 1.2 2000/05/24 23:52:47 keithp Exp $
-#include <Server.tmpl>
+XCOMM $XFree86: xc/programs/Xserver/hw/kdrive/igs/Imakefile,v 1.3 2000/09/03 05:11:17 keithp Exp $
+KDRIVE=..
+#include "../Kdrive.tmpl"
SRCS = igs.c igscmap.c igscurs.c igsdraw.c igsreg.c igsstub.c
OBJS = igs.o igscmap.o igscurs.o igsdraw.o igsreg.o igsstub.o
-INCLUDES = -I.. -I. -I$(XBUILDINCDIR) -I$(FONTINCSRC) \
- -I../../../fb -I../../../mi -I../../../include -I../../../os \
- -I$(EXTINCSRC) -I$(XINCLUDESRC)
+INCLUDES = -I. $(KDINCS)
NormalLibraryObjectRule()
NormalLibraryTarget(igs,$(OBJS))
diff --git a/xc/programs/Xserver/hw/kdrive/igs/igs.c b/xc/programs/Xserver/hw/kdrive/igs/igs.c
index a526b774e..ee110e047 100644
--- a/xc/programs/Xserver/hw/kdrive/igs/igs.c
+++ b/xc/programs/Xserver/hw/kdrive/igs/igs.c
@@ -1,5 +1,5 @@
/*
- * $XFree86: xc/programs/Xserver/hw/kdrive/igs/igs.c,v 1.2 2000/05/24 23:52:47 keithp Exp $
+ * $XFree86: xc/programs/Xserver/hw/kdrive/igs/igs.c,v 1.3 2000/09/03 05:11:17 keithp Exp $
*
* Copyright © 1999 SuSE, Inc.
*
@@ -331,7 +331,7 @@ igsGetClock (int target, int *Mp, int *Np, int *Pp, int maxM, int maxN, int maxP
*Pp = P;
}
-void
+Bool
igsEnable (ScreenPtr pScreen)
{
KdScreenPriv(pScreen);
@@ -562,6 +562,7 @@ igsEnable (ScreenPtr pScreen)
VgaFetch (&igsvga->card, reg));
}
#endif
+ return TRUE;
}
Bool
diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86Config.c b/xc/programs/Xserver/hw/xfree86/common/xf86Config.c
index e2111f4a8..4a64bc21b 100644
--- a/xc/programs/Xserver/hw/xfree86/common/xf86Config.c
+++ b/xc/programs/Xserver/hw/xfree86/common/xf86Config.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Config.c,v 3.228 2000/08/11 19:51:02 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Config.c,v 3.230 2000/09/19 12:46:12 eich Exp $ */
/*
@@ -941,11 +941,7 @@ configInputKbd(IDevPtr inputp)
#ifdef XKB
if (!xf86IsPc98()) {
xf86Info.xkbrules = "xfree86";
-#ifdef __SOL8__
- xf86Info.xkbmodel = "pc101_sol8x86";
-#else
xf86Info.xkbmodel = "pc101";
-#endif
xf86Info.xkblayout = "us";
xf86Info.xkbvariant = NULL;
xf86Info.xkboptions = NULL;
@@ -1343,6 +1339,13 @@ configLayout(serverLayoutPtr servlayoutp, XF86ConfLayoutPtr conf_layout,
slp[i].right = slp[j].screen;
}
}
+ if (slp[i].where != CONF_ADJ_OBSOLETE
+ && slp[i].where != CONF_ADJ_ABSOLUTE
+ && !slp[i].refscreen) {
+ xf86Msg(X_ERROR,"Screen %s doesn't exist: deleting placement\n",
+ slp[i].refname);
+ slp[i].where = 0;
+ }
}
#ifdef LAYOUT_DEBUG
diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86PciInfo.h b/xc/programs/Xserver/hw/xfree86/common/xf86PciInfo.h
index 060c4ef7d..c58bd5073 100644
--- a/xc/programs/Xserver/hw/xfree86/common/xf86PciInfo.h
+++ b/xc/programs/Xserver/hw/xfree86/common/xf86PciInfo.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86PciInfo.h,v 1.67 2000/08/11 21:12:48 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86PciInfo.h,v 1.72 2000/09/13 15:47:31 martin Exp $ */
/*
* PCI Probe
*
@@ -86,7 +86,6 @@
#define PCI_VENDOR_PICOP 0x1066
#define PCI_VENDOR_MYLEX 0x1069
#define PCI_VENDOR_APPLE 0x106B
-/* Yahama is a guess based on chipset */
#define PCI_VENDOR_YAMAHA 0x1073
#define PCI_VENDOR_NEXGEN 0x1074
#define PCI_VENDOR_QLOGIC 0x1077
@@ -98,6 +97,7 @@
#define PCI_VENDOR_SUN 0x108E
#define PCI_VENDOR_DIAMOND 0x1092
#define PCI_VENDOR_CMD 0x1095
+#define PCI_VENDOR_APPIAN 0x1097
#define PCI_VENDOR_VISION 0x1098
#define PCI_VENDOR_BROOKTREE 0x109E
#define PCI_VENDOR_SIERRA 0x10A8
@@ -229,6 +229,8 @@
#define PCI_CHIP_MACH64LP 0x4C50
#define PCI_CHIP_MACH64LR 0x4C52
#define PCI_CHIP_MACH64LS 0x4C53
+#define PCI_CHIP_RAGE128MF 0x4D46
+#define PCI_CHIP_RAGE128ML 0x4D4C
#define PCI_CHIP_RAGE128PF 0x5046
#define PCI_CHIP_RAGE128PR 0x5052
#define PCI_CHIP_RAGE128RE 0x5245
@@ -472,7 +474,7 @@
#define PCI_CHIP_QUADRO2MXR 0x0113
#define PCI_CHIP_GEFORCE2GTS 0x0150
#define PCI_CHIP_GEFORCE2GTS_1 0x0151
-#define PCI_CHIP_GEFORCE2GTS_2 0x0152
+#define PCI_CHIP_GEFORCE2ULTRA 0x0152
#define PCI_CHIP_QUADRO2PRO 0x0153
/* NVIDIA & SGS */
@@ -550,6 +552,7 @@
#define PCI_CHIP_NM2097 0x0083
#define PCI_CHIP_NM2160 0x0004
#define PCI_CHIP_NM2200 0x0005
+#define PCI_CHIP_NM2230 0x0025
#define PCI_CHIP_NM2360 0x0006
#define PCI_CHIP_NM2380 0x0016
@@ -630,6 +633,7 @@ static SymTabRec xf86PCIVendorNameInfoData[] = {
{PCI_VENDOR_SUN, "Sun"},
{PCI_VENDOR_DIAMOND, "Diamond"},
{PCI_VENDOR_CMD, "CMD"},
+ {PCI_VENDOR_APPIAN, "Appian Graphics"},
{PCI_VENDOR_VISION, "Vision"},
{PCI_VENDOR_BROOKTREE, "BrookTree"},
{PCI_VENDOR_SIERRA, "Sierra"},
@@ -766,8 +770,8 @@ static pciVendorDeviceInfo xf86PCIVendorInfoData[] = {
{PCI_CHIP_MACH64GZ, "Mach64 GZ",0},
{PCI_CHIP_MACH64LB, "Mach64 LB",0},
{PCI_CHIP_MACH64LD, "Mach64 LD",0},
- {PCI_CHIP_RAGE128LE, "Rage 128 Mobility LE",0},
- {PCI_CHIP_RAGE128LF, "Rage 128 Mobility LF",0},
+ {PCI_CHIP_RAGE128LE, "Rage 128 Mobility LE",0},
+ {PCI_CHIP_RAGE128LF, "Rage 128 Mobility LF",0},
{PCI_CHIP_MACH64LG, "Mach64 LG",0},
{PCI_CHIP_MACH64LI, "Mach64 LI",0},
{PCI_CHIP_MACH64LM, "Mach64 LM",0},
@@ -775,8 +779,10 @@ static pciVendorDeviceInfo xf86PCIVendorInfoData[] = {
{PCI_CHIP_MACH64LP, "Mach64 LP",0},
{PCI_CHIP_MACH64LR, "Mach64 LR",0},
{PCI_CHIP_MACH64LS, "Mach64 LS",0},
- {PCI_CHIP_RAGE128PF, "Rage 128 Pro PF",0},
- {PCI_CHIP_RAGE128PR, "Rage 128 Pro PR",0},
+ {PCI_CHIP_RAGE128MF, "Rage 128 Mobility MF",0},
+ {PCI_CHIP_RAGE128ML, "Rage 128 Mobility ML",0},
+ {PCI_CHIP_RAGE128PF, "Rage 128 Pro PF",0},
+ {PCI_CHIP_RAGE128PR, "Rage 128 Pro PR",0},
{PCI_CHIP_RAGE128RE, "Rage 128 RE",0},
{PCI_CHIP_RAGE128RF, "Rage 128 RF",0},
{PCI_CHIP_RAGE128RK, "Rage 128 RK",0},
@@ -970,6 +976,7 @@ static pciVendorDeviceInfo xf86PCIVendorInfoData[] = {
{PCI_CHIP_TI_PERMEDIA2, "Permedia 2",0},
{PCI_CHIP_PCI_1130, "PCI 1130",0},
{PCI_CHIP_PCI_1131, "PCI 1131",0},
+ {0x8019, "TSB12LV23 IEEE1394/FireWire",0},
{0x0000, NULL,0}}},
#ifdef VENDOR_INCLUDE_NONVIDEO
{PCI_VENDOR_SONY, {
@@ -1024,6 +1031,9 @@ static pciVendorDeviceInfo xf86PCIVendorInfoData[] = {
{0x0001, "Bandit",0 },
{0x0002, "Grand Central",0 },
{0x000E, "Hydra",0 },
+ {0x0019, "Keylargo USB",0 },
+ {0x0020, "Uni-North AGP",0 },
+ {0x0022, "Keylargo I/O",0 },
{0x0000, NULL,0}}},
#ifdef INCLUDE_EMPTY_LISTS
{PCI_VENDOR_NEXGEN, {
@@ -1076,6 +1086,11 @@ static pciVendorDeviceInfo xf86PCIVendorInfoData[] = {
{0x0646, "646",0 },
{0x0670, "670",0 },
{0x0000, NULL,0}}},
+#endif
+ {PCI_VENDOR_APPIAN, {
+ {0x3D32, "Jeronimo 2000 AGP",0 },
+ {0x0000, NULL,0}}},
+#ifdef VENDOR_INCLUDE_NONVIDEO
{PCI_VENDOR_VISION, {
{0x0001, "QD 8500",0 },
{0x0002, "QD 8580",0 },
@@ -1144,6 +1159,7 @@ static pciVendorDeviceInfo xf86PCIVendorInfoData[] = {
{PCI_CHIP_NM2093, "NM2093",0},
{PCI_CHIP_NM2160, "NM2160",0},
{PCI_CHIP_NM2200, "NM2200",0},
+ {PCI_CHIP_NM2230, "NM2230 MagicMedia 256AV+",0},
{PCI_CHIP_NM2360, "NM2360",0},
{PCI_CHIP_NM2380, "NM2380",0},
#ifdef VENDOR_INCLUDE_NONVIDEO
@@ -1177,7 +1193,7 @@ static pciVendorDeviceInfo xf86PCIVendorInfoData[] = {
{PCI_CHIP_QUADRO2MXR, "GeForce2 MXR",0},
{PCI_CHIP_GEFORCE2GTS, "GeForce2 GTS",0},
{PCI_CHIP_GEFORCE2GTS_1,"GeForce2 GTS (rev 1)",0},
- {PCI_CHIP_GEFORCE2GTS_2,"GeForce2 GTS (rev 2)",0},
+ {PCI_CHIP_GEFORCE2ULTRA,"GeForce2 ultra",0},
{PCI_CHIP_QUADRO2PRO, "Quadro 2 Pro",0},
{0x0000, NULL,0}}},
#ifdef VENDOR_INCLUDE_NONVIDEO
diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86pciBus.c b/xc/programs/Xserver/hw/xfree86/common/xf86pciBus.c
index 0b856ac9d..a6c217cfd 100644
--- a/xc/programs/Xserver/hw/xfree86/common/xf86pciBus.c
+++ b/xc/programs/Xserver/hw/xfree86/common/xf86pciBus.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86pciBus.c,v 3.20 2000/08/04 16:13:26 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86pciBus.c,v 3.21 2000/09/19 12:46:13 eich Exp $ */
/*
* Copyright (c) 1997-1999 by The XFree86 Project, Inc.
@@ -734,11 +734,11 @@ removeOverlapsWithBridges(int busIndex, resPtr target)
for (pbp=xf86PciBus; pbp; pbp = pbp->next) {
if (pbp->primary == busIndex) {
- tmp = xf86DupResList(pbp->io);
+ tmp = xf86DupResList(pbp->preferred_io);
bridgeRes = xf86JoinResLists(tmp,bridgeRes);
- tmp = xf86DupResList(pbp->mem);
+ tmp = xf86DupResList(pbp->preferred_mem);
bridgeRes = xf86JoinResLists(tmp,bridgeRes);
- tmp = xf86DupResList(pbp->pmem);
+ tmp = xf86DupResList(pbp->preferred_pmem);
bridgeRes = xf86JoinResLists(tmp,bridgeRes);
}
}
@@ -1043,28 +1043,42 @@ fixPciResource(int prt, memType alignment, pciVideoPtr pvp, long type)
#if 0 /*EE*/
|| (res_n == 0xff)/* bios should also be prefetchable */
#endif
- )
- && pbp->pmem) {
- w = xf86FindIntersectOfLists(pbp->pmem,ResRange);
- if (pbp->mem) {
- w_2nd = xf86FindIntersectOfLists(pbp->mem,ResRange);
- }
- } else if (pbp->mem) {
- w = xf86FindIntersectOfLists(pbp->mem,ResRange);
- }
- } else if (pbp->io) {
+ )) {
+ if (pbp->preferred_pmem)
+ w = xf86FindIntersectOfLists(pbp->preferred_pmem,
+ ResRange);
+ else if (pbp->pmem)
+ w = xf86FindIntersectOfLists(pbp->pmem,ResRange);
+
+ if (pbp->preferred_mem)
+ w_2nd = xf86FindIntersectOfLists(pbp->preferred_mem,
+ ResRange);
+ else if (pbp->mem)
+ w_2nd = xf86FindIntersectOfLists(pbp->mem,
+ ResRange);
+ } else {
+ if (pbp->preferred_mem)
+ w = xf86FindIntersectOfLists(pbp->preferred_mem,
+ ResRange);
+ else if (pbp->mem)
+ w = xf86FindIntersectOfLists(pbp->mem,ResRange);
+ }
+ } else {
+ if (pbp->preferred_io)
+ w = xf86FindIntersectOfLists(pbp->preferred_io,ResRange);
+ if (pbp->io)
w = xf86FindIntersectOfLists(pbp->io,ResRange);
}
while (pbp1) {
if (pbp1->primary == pvp->bus) {
if (type & ResMem) {
- tmp = xf86DupResList(pbp1->pmem);
+ tmp = xf86DupResList(pbp1->preferred_pmem);
avoid = xf86JoinResLists(avoid,tmp);
- tmp = xf86DupResList(pbp1->mem);
+ tmp = xf86DupResList(pbp1->preferred_mem);
avoid = xf86JoinResLists(avoid,tmp);
} else {
- tmp = xf86DupResList(pbp1->io);
+ tmp = xf86DupResList(pbp1->preferred_io);
avoid = xf86JoinResLists(avoid,tmp);
}
}
@@ -1224,10 +1238,10 @@ fixPciResource(int prt, memType alignment, pciVideoPtr pvp, long type)
while (alignment >> (*p_size))
(*p_size)++;
(*p_base) = H2B(tag,range.rBegin,type);
-
+#ifdef DEBUG
ErrorF("New PCI res %i base: 0x%lx, size: 0x%lx, type %s\n",
res_n,(*p_base),(1 << (*p_size)),type | ResMem ? "Mem" : "Io");
-
+#endif
if (res_n != 0xff) {
pciWriteLong(tag,PCI_CMD_BASE_REG + res_n * sizeof(CARD32),
(CARD32)(*p_base) | (CARD32)(p_type));
@@ -1339,9 +1353,15 @@ getValidBIOSBase(PCITAG tag, int num)
pbp = pbp1 = xf86PciBus;
while (pbp) {
if (pbp->secondary == pvp->bus) {
- tmp = xf86DupResList(pbp->pmem);
+ if (pbp->preferred_pmem)
+ tmp = xf86DupResList(pbp->preferred_pmem);
+ else
+ tmp = xf86DupResList(pbp->pmem);
m = xf86JoinResLists(m,tmp);
- tmp = xf86DupResList(pbp->mem);
+ if (pbp->preferred_mem)
+ tmp = xf86DupResList(pbp->preferred_mem);
+ else
+ tmp = xf86DupResList(pbp->mem);
m = xf86JoinResLists(m,tmp);
tmp = m;
while (tmp) {
@@ -1351,8 +1371,12 @@ getValidBIOSBase(PCITAG tag, int num)
}
while (pbp1) {
if (pbp1->primary == pvp->bus) {
+ tmp = xf86DupResList(pbp1->preferred_pmem);
+ avoid = xf86JoinResLists(avoid,tmp);
tmp = xf86DupResList(pbp1->pmem);
avoid = xf86JoinResLists(avoid,tmp);
+ tmp = xf86DupResList(pbp1->preferred_mem);
+ avoid = xf86JoinResLists(avoid,tmp);
tmp = xf86DupResList(pbp1->mem);
avoid = xf86JoinResLists(avoid,tmp);
}
@@ -1429,6 +1453,29 @@ xf86PciProbe(void)
static void alignBridgeRanges(PciBusPtr PciBusBase, PciBusPtr primary);
+static void
+printBridgeInfo(PciBusPtr PciBus)
+{
+ xf86MsgVerb(X_INFO, 3, "Bus %d: bridge is at (%d:%d:%d), "
+ "(%d,%d,%d), BCTRL: 0x%02x (VGA_EN is %s)\n",
+ PciBus->secondary,PciBus->brbus, PciBus->brdev,
+ PciBus->brfunc, PciBus->primary,
+ PciBus->secondary, PciBus->subordinate,
+ PciBus->brcontrol,
+ (PciBus->brcontrol & PCI_PCI_BRIDGE_VGA_EN)
+ ? "set" : "cleared");
+ xf86MsgVerb(X_INFO, 3, "Bus %d I/O range:\n",
+ PciBus->secondary);
+ xf86PrintResList(3, PciBus->preferred_io);
+ xf86MsgVerb(X_INFO, 3,
+ "Bus %d non-prefetchable memory range:\n",
+ PciBus->secondary);
+ xf86PrintResList(3, PciBus->preferred_mem);
+ xf86MsgVerb(X_INFO, 3, "Bus %d prefetchable memory range:"
+ "\n",PciBus->secondary);
+ xf86PrintResList(3, PciBus->preferred_pmem);
+}
+
PciBusPtr
xf86GetPciBridgeInfo(const pciConfigPtr *pciInfo)
{
@@ -1470,6 +1517,7 @@ xf86GetPciBridgeInfo(const pciConfigPtr *pciInfo)
PciBus->brdev = pcrp->devnum;
PciBus->brfunc = pcrp->funcnum;
PciBus->subclass = sub_class;
+ PciBus->interface = pcrp->pci_prog_if;
PciBus->brcontrol = pcrp->pci_bridge_control;
if (pcrp->pci_command & PCI_CMD_IO_ENABLE) {
base = (pcrp->pci_upper_io_base << 16) |
@@ -1485,15 +1533,16 @@ xf86GetPciBridgeInfo(const pciConfigPtr *pciInfo)
PCI_I_RANGE(range, pcrp->tag,
base, base + (CARD8)(-1),
ResIo | ResBlock | ResExclusive);
- PciBus->io = xf86AddResToList(PciBus->io,
- &range, -1);
+ PciBus->preferred_io = xf86AddResToList(
+ PciBus->preferred_io,&range, -1);
base += 0x0400;
}
}
if (base <= limit) {
PCI_I_RANGE(range, pcrp->tag, base, limit,
ResIo | ResBlock | ResExclusive);
- PciBus->io = xf86AddResToList(PciBus->io, &range, -1);
+ PciBus->preferred_io = xf86AddResToList(
+ PciBus->preferred_io, &range, -1);
}
}
if (pcrp->pci_command & PCI_CMD_MEM_ENABLE) {
@@ -1503,7 +1552,8 @@ xf86GetPciBridgeInfo(const pciConfigPtr *pciInfo)
PCI_M_RANGE(range, pcrp->tag,
base << 16, (limit << 16) | 0x0fffff,
ResMem | ResBlock | ResExclusive);
- PciBus->mem = xf86AddResToList(NULL, &range, -1);
+ PciBus->preferred_mem
+ = xf86AddResToList(NULL, &range, -1);
}
base = pcrp->pci_prefetch_mem_base & 0xfff0u;
limit = pcrp->pci_prefetch_mem_limit & 0xfff0u;
@@ -1515,7 +1565,8 @@ xf86GetPciBridgeInfo(const pciConfigPtr *pciInfo)
PCI_M_RANGE(range, pcrp->tag,
base << 16, (limit << 16) | 0xfffff,
ResMem | ResBlock | ResExclusive);
- PciBus->pmem = xf86AddResToList(NULL, &range, -1);
+ PciBus->preferred_pmem
+ = xf86AddResToList(NULL, &range, -1);
}
}
break;
@@ -1528,6 +1579,8 @@ xf86GetPciBridgeInfo(const pciConfigPtr *pciInfo)
PciBus->brdev = pcrp->devnum;
PciBus->brfunc = pcrp->funcnum;
PciBus->subclass = sub_class;
+ xf86MsgVerb(X_INFO,3,"PCI-to-ISA bridge:\n");
+ printBridgeInfo(PciBus);
break;
case PCI_SUBCLASS_BRIDGE_HOST:
*pnPciBus = PciBus = xnfcalloc(1, sizeof(PciBusRec));
@@ -1535,12 +1588,14 @@ xf86GetPciBridgeInfo(const pciConfigPtr *pciInfo)
PciBus->primary = -1;
PciBus->secondary = -1; /* to be set below */
PciBus->subclass = sub_class;
- PciBus->io = xf86ExtractTypeFromList(
+ PciBus->preferred_io = xf86ExtractTypeFromList(
xf86PciBusAccWindowsFromOS(),ResIo);
- PciBus->mem = xf86ExtractTypeFromList(
+ PciBus->preferred_mem = xf86ExtractTypeFromList(
xf86PciBusAccWindowsFromOS(),ResMem);
- PciBus->pmem = xf86ExtractTypeFromList(
+ PciBus->preferred_pmem = xf86ExtractTypeFromList(
xf86PciBusAccWindowsFromOS(),ResMem);
+ xf86MsgVerb(X_INFO,3,"Host-to-PCI bridge:\n");
+ printBridgeInfo(PciBus);
break;
default:
break;
@@ -1570,12 +1625,14 @@ xf86GetPciBridgeInfo(const pciConfigPtr *pciInfo)
PciBus->primary = -1;
PciBus->secondary = i;
PciBus->subclass = PCI_SUBCLASS_BRIDGE_HOST;
- PciBus->io = xf86ExtractTypeFromList(
+ PciBus->preferred_io = xf86ExtractTypeFromList(
xf86PciBusAccWindowsFromOS(),ResIo);
- PciBus->mem = xf86ExtractTypeFromList(
+ PciBus->preferred_mem = xf86ExtractTypeFromList(
xf86PciBusAccWindowsFromOS(),ResMem);
- PciBus->pmem = xf86ExtractTypeFromList(
+ PciBus->preferred_pmem = xf86ExtractTypeFromList(
xf86PciBusAccWindowsFromOS(),ResMem);
+ xf86MsgVerb(X_INFO,3,"Host-to-PCI bridge:\n");
+ printBridgeInfo(PciBus);
}
}
}
@@ -1585,6 +1642,25 @@ xf86GetPciBridgeInfo(const pciConfigPtr *pciInfo)
alignBridgeRanges(PciBusBase, PciBus);
}
}
+ for (PciBus = PciBusBase; PciBus; PciBus = PciBus->next) {
+ if (PciBus->subclass == PCI_SUBCLASS_BRIDGE_PCI &&
+ PciBus->interface == PCI_IF_BRIDGE_PCI_SUBTRACTIVE) {
+ PciBusPtr PciBus1;
+ for (PciBus1 = PciBusBase; PciBus1; PciBus1 = PciBus->next) {
+ if (PciBus1->secondary == PciBus->primary) {
+ PciBus->io = PciBus1->io ? PciBus1->io
+ : PciBus1->preferred_io;
+ PciBus->mem = PciBus1->mem ? PciBus1->mem
+ : PciBus1->preferred_mem;
+ PciBus->pmem = PciBus1->pmem ? PciBus1->pmem
+ : PciBus1->preferred_pmem;
+ xf86MsgVerb(X_INFO,3,"Subtractive PCI-to-PCI bridge:\n");
+ printBridgeInfo(PciBus);
+ break;
+ }
+ }
+ }
+ }
return PciBusBase;
@@ -1599,33 +1675,20 @@ alignBridgeRanges(PciBusPtr PciBusBase, PciBusPtr primary)
if ((PciBus->primary == primary->secondary)
&& (PciBus->subclass == PCI_SUBCLASS_BRIDGE_PCI)) {
resPtr tmp;
- tmp = xf86FindIntersectOfLists(primary->io,PciBus->io);
- xf86FreeResList(PciBus->io);
- PciBus->io = tmp;
- tmp = xf86FindIntersectOfLists(primary->pmem,PciBus->pmem);
- xf86FreeResList(PciBus->pmem);
- PciBus->pmem = tmp;
- tmp = xf86FindIntersectOfLists(primary->mem,PciBus->mem);
- xf86FreeResList(PciBus->mem);
- PciBus->mem = tmp;
- xf86MsgVerb(X_INFO, 3, "Bus %d: bridge is at (%d:%d:%d), "
- "(%d,%d,%d), BCTRL: 0x%02x (VGA_EN is %s)\n",
- PciBus->secondary,PciBus->brbus, PciBus->brdev,
- PciBus->brfunc, PciBus->primary,
- PciBus->secondary, PciBus->subordinate,
- PciBus->brcontrol,
- (PciBus->brcontrol & PCI_PCI_BRIDGE_VGA_EN)
- ? "set" : "cleared");
- xf86MsgVerb(X_INFO, 3, "Bus %d I/O range:\n",
- PciBus->secondary);
- xf86PrintResList(3, PciBus->io);
- xf86MsgVerb(X_INFO, 3,
- "Bus %d non-prefetchable memory range:\n",
- PciBus->secondary);
- xf86PrintResList(3, PciBus->mem);
- xf86MsgVerb(X_INFO, 3, "Bus %d prefetchable memory range:"
- "\n",PciBus->secondary);
- xf86PrintResList(3, PciBus->pmem);
+ tmp = xf86FindIntersectOfLists(primary->preferred_io,
+ PciBus->preferred_io);
+ xf86FreeResList(PciBus->preferred_io);
+ PciBus->preferred_io = tmp;
+ tmp = xf86FindIntersectOfLists(primary->preferred_pmem,
+ PciBus->preferred_pmem);
+ xf86FreeResList(PciBus->preferred_pmem);
+ PciBus->preferred_pmem = tmp;
+ tmp = xf86FindIntersectOfLists(primary->preferred_mem,
+ PciBus->preferred_mem);
+ xf86FreeResList(PciBus->preferred_mem);
+ PciBus->preferred_mem = tmp;
+ xf86MsgVerb(X_INFO,3,"PCI-to-PCI bridge:\n");
+ printBridgeInfo(PciBus);
alignBridgeRanges(PciBusBase, PciBus);
}
}
@@ -1761,25 +1824,37 @@ ValidatePci(void)
pbp = pbp1 = xf86PciBus;
while (pbp) {
if (pbp->secondary == pvp->bus) {
- if (pbp->pmem) {
+ if (pbp->preferred_pmem) {
/* keep prefetchable separate */
- res_mp = xf86FindIntersectOfLists(pbp->pmem,ResRange);
+ res_mp = xf86FindIntersectOfLists(pbp->preferred_pmem,
+ ResRange);
+ }
+ if (pbp->pmem) {
+ res_mp = xf86FindIntersectOfLists(pbp->pmem, ResRange);
+ }
+ if (pbp->preferred_mem) {
+ res_m_io = xf86FindIntersectOfLists(pbp->preferred_mem,
+ ResRange);
}
if (pbp->mem) {
- res_m_io = xf86FindIntersectOfLists(pbp->mem,ResRange);
+ res_m_io = xf86FindIntersectOfLists(pbp->mem, ResRange);
+ }
+ if (pbp->preferred_io) {
+ res_m_io = xf86JoinResLists(res_m_io,
+ xf86FindIntersectOfLists(pbp->preferred_io,ResRange));
}
if (pbp->io) {
res_m_io = xf86JoinResLists(res_m_io,
- xf86FindIntersectOfLists(pbp->io,ResRange));
+ xf86FindIntersectOfLists(pbp->preferred_io,ResRange));
}
}
while (pbp1) {
if (pbp1->primary == pvp->bus) {
- tmp = xf86DupResList(pbp1->pmem);
+ tmp = xf86DupResList(pbp1->preferred_pmem);
avoid = xf86JoinResLists(avoid,tmp);
- tmp = xf86DupResList(pbp1->mem);
+ tmp = xf86DupResList(pbp1->preferred_mem);
avoid = xf86JoinResLists(avoid,tmp);
- tmp = xf86DupResList(pbp1->io);
+ tmp = xf86DupResList(pbp1->preferred_io);
avoid = xf86JoinResLists(avoid,tmp);
}
pbp1 = pbp1->next;
@@ -1849,16 +1924,16 @@ ValidatePci(void)
"****INVALID MEM ALLOCATION**** b: 0x%lx e: 0x%lx "
"correcting\a\n", range.rBegin,range.rEnd);
if (ChkConflict(&range,own,SETUP)) {
- ErrorF("own\n");
- xf86PrintResList(0,own);
+ xf86MsgVerb(X_INFO,3,"own\n");
+ xf86PrintResList(3,own);
}
if (ChkConflict(&range,avoid,SETUP)) {
- ErrorF("avoid\n");
- xf86PrintResList(0,avoid);
+ xf86MsgVerb(X_INFO,3,"avoid\n");
+ xf86PrintResList(3,avoid);
}
if (ChkConflict(&range,NonSys,SETUP)) {
- ErrorF("NonSys\n");
- xf86PrintResList(0,NonSys);
+ xf86MsgVerb(X_INFO,3,"NonSys\n");
+ xf86PrintResList(3,NonSys);
}
#ifdef DEBUG
@@ -2752,4 +2827,3 @@ pciConvertRange2Host(int entityIndex, resRange *pRange)
}
}
-
diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86pciBus.h b/xc/programs/Xserver/hw/xfree86/common/xf86pciBus.h
index 19434edfa..fd39dc92d 100644
--- a/xc/programs/Xserver/hw/xfree86/common/xf86pciBus.h
+++ b/xc/programs/Xserver/hw/xfree86/common/xf86pciBus.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86pciBus.h,v 3.4 2000/02/12 23:59:10 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86pciBus.h,v 3.5 2000/09/19 12:46:13 eich Exp $ */
#ifndef _XF86_PCI_BUS_H
#define _XF86_PCI_BUS_H
@@ -43,6 +43,21 @@ typedef struct {
CARD8 control;
} pciBridgeSave, *pciBridgeSavePtr;
+typedef struct pciBusRec {
+ int brbus, brdev, brfunc; /* ID of the bridge to this bus */
+ int primary, secondary, subordinate;
+ int subclass; /* bridge type */
+ int interface;
+ resPtr preferred_io; /* I/O range */
+ resPtr preferred_mem; /* non-prefetchable memory range */
+ resPtr preferred_pmem; /* prefetchable memory range */
+ resPtr io; /* for subtractive PCI-PCI bridges */
+ resPtr mem;
+ resPtr pmem;
+ int brcontrol; /* bridge_control byte */
+ struct pciBusRec *next;
+} PciBusRec, *PciBusPtr;
+
void xf86PciProbe(void);
PciBusPtr xf86GetPciBridgeInfo(const pciConfigPtr *pciInfo);
void ValidatePci(void);
diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.DRIcomp b/xc/programs/Xserver/hw/xfree86/doc/README.DRIcomp
index 1726dd18a..725866f79 100644
--- a/xc/programs/Xserver/hw/xfree86/doc/README.DRIcomp
+++ b/xc/programs/Xserver/hw/xfree86/doc/README.DRIcomp
@@ -1,15 +1,14 @@
DRI Compilation Guide
- Precision Insight, Inc.
+ VA Linux Systems, Inc. Professional Services - Graphics.
- 18 May 2000
+ 8 August 2000
1. Preamble
1.1 Copyright
-Copyright © 2000 by Precision Insight, Inc., Cedar Park, Texas. All Rights
-Reserved.
+Copyright © 2000 by VA Linux Systems, Inc. All Rights Reserved.
Permission is granted to make and distribute verbatim copies of this document
provided the copyright notice and this permission notice are preserved on all
@@ -34,8 +33,8 @@ This document describes how to download, compile and install the DRI project.
This information is intended for experienced Linux developers. Beginners are
probably better off installing precompiled packages.
-Edits, corrections and updates to this document may be mailed to brian@preci-
-sioninsight.com.
+Edits, corrections and updates to this document may be mailed to brianp@val-
+inux.com.
3. Prerequisites
@@ -201,17 +200,30 @@ the mailing lists.
The -z3 flag causes compression to be used in order to reduce the down-
load time.
-6. Updating your CVS sources
+5.3 Updating your CVS sources
In the future you'll want to occasionally update your local copy of the DRI
source code to get the latest changes. This can be done with:
- cd ~/DRI-CVS
- cvs -z3 update -dA xc
+ cd ~/DRI-CVS
+ cvs -z3 update -dA xc
The -d flag causes any new subdirectories to be created and -A causes most
recent trunk sources to be fetched, not branch sources.
+6. Mesa
+
+Most of the DRI 3D drivers are based on Mesa (the free implementation of the
+OpenGL API). The relevant files from Mesa are already included in the
+XFree86/DRI source tree. There is no need to download or install the Mesa
+source files separately.
+
+Sometimes a newer version of Mesa will be available than the version included
+in XFree86/DRI. Upgrading Mesa within XFree86/DRI is not always straightfor-
+ward. It can be an error-prone undertaking, especially for beginners, and is
+not generally recommended. The DRI developers will upgrade Mesa when appro-
+priate.
+
7. Compiling the XFree86/DRI tree
7.1 Make a build tree
@@ -260,7 +272,7 @@ The ProjectRoot variable specifies where the XFree86 files will be installed.
You probably don't want to use /usr/X11R6/ because that would overwrite your
default X files. The following is recommended:
- #define ProjectRoot /usr/XF86-main
+ #define ProjectRoot /usr/X11R6-DRI
Especially note the XF86CardDrivers line to be sure your driver is listed.
@@ -270,7 +282,7 @@ If you have 3dfx hardware be sure that the Glide 3x headers are installed in
If you do not have 3dfx hardware comment out the HasGlide3 line in host.def.
-7.3 Compile
+7.3 Compilation
To compile the complete DRI tree:
@@ -289,6 +301,9 @@ ing compilation.
Building will take some time so you may want to go check your email or visit
slashdot.
+WARNING: do not use the -j option with make. It's reported that it does not
+work with XFree86/DRI.
+
7.4 Check for compilation errors
Using your text editor, examine World.LOG for errors by searching for the
@@ -317,43 +332,44 @@ If the path to your kernel source is /bigdisk/linux-2.3.99-pre6,
or alternatively, edit Makefile to include this change.
-After fixing the errors, do make World again. Later, you might just compile
+After fixing the errors, run make World again. Later, you might just compile
parts of the source tree but it's important that the whole tree will build
first.
-8. Installing
+8. Normal Installation and Configuration
+
+Most users will want to install the new X server and use it instead of the
+original X server. This section explains how to do that. We assume that the
+user is upgrading from XFree86 3.3.x.
-After the DRI tree has been compiled you can install the XFree86 headers,
-libraries, programs, etc for testing.
+Developers, on the other hand, may just want to test the X server without
+actually installing it as their default server. If you want to do that, skip
+to the next section.
8.1 X Installation
-As mentioned above, the install directory is specified by the ProjectRoot
-variable in the host.def file. Create that directory now if it doesn't
-already exist:
+You'll need to run as root to do the following commands:
- mkdir /usr/XF86-main
+ su
-You'll have to change to root since the install process puts several files in
-/etc/X11/ and sets the setuid flag on the X server executable.
+As mentioned above, the installation directory is specified by the Project-
+Root variable in the host.def file. Create that directory now if it doesn't
+already exist, then run the install commands:
+ mkdir /usr/X11R6-DRI
cd ~/DRI-CVS/build/xc
- su
make install
-Edit your /etc/ld.so.conf file and put /usr/XF86-main/lib as the first line.
-Continue with:
+8.2 Linker configuration
- ldconfig
- exit
+Edit your /etc/ld.so.conf file and put /usr/X11R6-DRI/lib as the first line.
+Then run:
-Look in /usr/XF86-main to be sure the files installed there.
+ ldconfig
-Strictly speaking, installing the DRI tree isn't required. It's possible to
-run and test the X server directly from the build directory but it's a bit
-error prone.
+This will ensure that you use the new X libraries when you run X programs.
-8.2 Update Locale Information
+8.3 Update Locale Information
To update your X locale information do the following:
@@ -365,53 +381,112 @@ To update your X locale information do the following:
This will prevent a locale error message from being printed when you run Xlib
programs.
-9. X Server Configuration
+8.4 Setup Miscellaneous Files
-If your X server is currently running you'll have to stop it and return to a
-virtual terminal.
+Issue the following commands:
-First, setup your XF86Config file. It should load the GLX and DRI modules
-and specify the driver to use for your hardware. See the DRI User Guide for
-detailed information.
+ cd /usr/X11R6-DRI/lib/X11
+ ln -s /usr/X11R6/lib/X11/rgb.txt .
+ ln -s /usr/X11R6/lib/X11/fonts .
+ ln -s /usr/X11R6/lib/X11/app-defaults .
-You may want to make a backup copy of your existing /etc/X11/XF86Config file
-first.
+This will allow applications to use the fonts and resources that they used in
+the past.
+
+8.5 Disable the Old X Server and Enable the New One
+
+Assuming that an installation of XFree86 3.3.x is present, we need to disable
+the old 3.3.x X server and enable the new 4.0.x X server.
+
+Issue the following commands:
+
+ cd /usr/X11R6/bin
+ mv Xwrapper Xwrapper.old
+ rm X
+ ln -s /usr/X11R6-4.0.1/lib/X11/XFree86 X
+
+This will cause the new X server to be used instead of the original one.
+
+8.6 Create the XF86Config File
+
+Configuration files for XFree86 3.3.x will not work with XFree86 4.0.x.
+
+The new 4.0.x server can generate a basic configuration file itself. Simply
+do this:
+
+ cd /usr/X11R6-DRI/bin
+ ./XFree86 -configure
+
+A file named /root/XF86Config.new will be created. It should allow you to
+try your X server but you'll almost certainly have to edit it. For example,
+you should add HorizSync and VertRefresh options to the Monitor section and
+Modes options to the Screen section. Also, the ModulePath option in the
+Files section should be set to /usr/X11R6-DRI/lib/modules.
+
+On the DRI web site, in the resources section, you'll find example XF86Config
+files for a number of graphics cards. These configuration files also setup
+DRI options so it's highly recommended that you look at these examples.
+
+In any case, your new XF86Config file should be placed in /etc/X11/XF86Con-
+fig-4. This configuration file will be recognized by the 4.0.x server but
+not by 3.3.x servers. You can instead name it /etc/X11/XF86Config but
+that'll overwrite your old config file, which you may want to preserve.
+
+8.7 Start the New X Server
+
+The new X server should be ready to use now. Start your X server in your
+usual manner. Typically, the startx command is used:
+
+ startx
+
+9. Testing the Server Without Installing It
+
+As mentioned at the start of section 8, developers may want to simply run the
+X server without installing it. This can save some time and allow you to
+keep a number of X servers available for testing.
+
+9.1 Configuration
+
+As described in the preceding section, you'll need to create a configuration
+file for the new server. Put the XF86Config file in your ~/DRI-
+CVS/build/xc/programs/Xserver directory.
-It's very important that you set the ModulePath option to point to your
-installation directory:
+Be sure the ModulePath option is set correctly.
- ModulePath "/usr/XF86-main/lib/modules"
+9.2 A Startup Script
-Double check with this:
+A simple shell script can be used to start the X server. Here's an example.
- grep ModulePath /etc/X11/XF86Config
+ #!/bin/sh
+ export DISPLAY=:0
+ ./XFree86 -xf86config XF86Config & \
+ sleep 2
+ fvwm2 &
+ xset b off
+ xmodmap -e "clear mod4"
+ xsetroot -solid "#00306f"
+ xterm -geometry 80x40+0+0
-Next, your ~/.xinitrc file controls which clients will be launched when your
-X server starts. You might put the following in yours:
+You might name this script start-dri. Put it in your ~/DRI-CVS/build/xc/pro-
+grams/Xserver directory.
- xset b off
- xsetroot -solid "#004070"
- xmodmap -e "clear mod4"
- xrdb -merge ~/.Xdefaults
- xterm -geometry +0+0 &
- xterm -geometry +512+0 &
- fvwm
+To test the server run the script:
-10. X Server Start-up
+ cd ~/DRI-CVS/build/xc/programs/Xserver
+ ./start-dri
-The X server can be started with:
+For debugging, you may also want to capture the log messages printed by the
+server in a file. If you're using the C-shell:
- xinit -- /usr/XF86-main/bin/XFree86
+ ./start-dri >& log
-Automatic loading of DRM kernel modules was added to the X server in XFree86
-4.0.1. This feature, and manual loading of kernel modules, is documented in
-the DRI user guide.
+10. Where To Go From Here
At this point your X server should be up and running with hardware-acceler-
-ated direct rendering. Please read the DRI User Guide for trouble shooting
-information.
+ated direct rendering. Please read the DRI User Guide for information about
+trouble shooting and how to use the DRI-enabled X server for 3D applications.
- Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DRIcomp.sgml,v 1.3 2000/06/17 02:16:49 dawes Exp $
+ Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DRIcomp.sgml,v 1.5 2000/08/28 18:24:15 dawes Exp $
-$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.DRIcomp,v 3.1 2000/06/17 17:44:20 dawes Exp $
+$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.DRIcomp,v 3.2 2000/08/28 18:29:06 dawes Exp $
diff --git a/xc/programs/Xserver/hw/xfree86/doc/sgml/DRI.sgml b/xc/programs/Xserver/hw/xfree86/doc/sgml/DRI.sgml
index fbe626031..4968f8d43 100644
--- a/xc/programs/Xserver/hw/xfree86/doc/sgml/DRI.sgml
+++ b/xc/programs/Xserver/hw/xfree86/doc/sgml/DRI.sgml
@@ -15,7 +15,7 @@
<date>22 August 2000
<ident>
- $XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DRI.sgml,v 1.5 2000/06/17 00:03:17 martin Exp $
+ $XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DRI.sgml,v 1.7 2000/08/28 18:24:15 dawes Exp $
</ident>
<toc>
diff --git a/xc/programs/Xserver/hw/xfree86/doc/sgml/DRIcomp.sgml b/xc/programs/Xserver/hw/xfree86/doc/sgml/DRIcomp.sgml
index 7504b82e9..03b396ad2 100644
--- a/xc/programs/Xserver/hw/xfree86/doc/sgml/DRIcomp.sgml
+++ b/xc/programs/Xserver/hw/xfree86/doc/sgml/DRIcomp.sgml
@@ -15,7 +15,7 @@
<date>8 August 2000
<ident>
- $XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DRI.sgml,v 1.3 2000/04/05 05:38:41 brianp Exp $
+ $XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DRIcomp.sgml,v 1.5 2000/08/28 18:24:15 dawes Exp $
</ident>
<toc>
@@ -269,12 +269,12 @@
cvs -z3 update -dA xc
</verb>
The -d flag causes any new subdirectories to be created and -A causes
- most recent trunc sources to be fetched, not branch sources.
+ most recent trunk sources to be fetched, not branch sources.
<sect>Mesa <p>
- Most of the DRI 3D drivers are based on Mesa (the free implmentation
+ Most of the DRI 3D drivers are based on Mesa (the free implementation
of the OpenGL API).
The relevant files from Mesa are already included in the XFree86/DRI
source tree.
@@ -516,7 +516,7 @@
Also, the <tt>ModulePath</tt> option in the <tt>Files</tt>
section should be set to <tt>/usr/X11R6-DRI/lib/modules</tt>.
<p>
- On the DRI website, in the resources section, you'll find example
+ On the DRI web site, in the resources section, you'll find example
XF86Config files for a number of graphics cards.
These configuration files also setup DRI options so it's highly
recommended that you look at these examples.
@@ -549,7 +549,7 @@
<p>
<sect1>Configuration <p>
- As described in the preceeding section, you'll need to create a
+ As described in the preceding section, you'll need to create a
configuration file for the new server.
Put the <tt>XF86Config</tt> file in your
<tt>~/DRI-CVS/build/xc/programs/Xserver</tt> directory.
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64io.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64io.h
index 70e27ee8e..663e06918 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64io.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64io.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64io.h,v 1.2 2000/08/04 21:07:14 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64io.h,v 1.3 2000/08/22 21:54:30 tsi Exp $ */
/*
* Copyright 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
@@ -180,31 +180,34 @@ extern void ATIAccessMach64PLLReg FunctionPrototype((ATIPtr, const CARD8,
in8(CLOCK_CNTL + 2) \
)
#define ATIPutMach64PLLReg(_Index, _Value) \
- ( \
- ATIAccessMach64PLLReg(pATI, _Index, TRUE), \
- out8(CLOCK_CNTL + 2, _Value) \
- )
-
-#define ATIGetMach64LCDReg(_Index) \
- ( \
- out8(LCD_INDEX, SetBits((_Index), LCD_REG_INDEX)), \
- inr(LCD_DATA) \
+ do \
+ { \
+ ATIAccessMach64PLLReg(pATI, _Index, TRUE); \
+ out8(CLOCK_CNTL + 2, _Value); \
+ } while(0)
+
+#define ATIGetMach64LCDReg(_Index) \
+ ( \
+ out8(LCD_INDEX, SetBits(_Index, LCD_REG_INDEX)), \
+ inr(LCD_DATA) \
)
-#define ATIPutMach64LCDReg(_Index, _Value) \
+#define ATIPutMach64LCDReg(_Index, _Value) \
+ do \
+ { \
+ out8(LCD_INDEX, SetBits(_Index, LCD_REG_INDEX)); \
+ outr(LCD_DATA, _Value); \
+ } while(0)
+
+#define ATIGetMach64TVReg(_Index) \
( \
- out8(LCD_INDEX, SetBits((_Index), LCD_REG_INDEX)), \
- outr(LCD_DATA, (_Value)) \
- )
-
-#define ATIGetMach64TVReg(_Index) \
- ( \
- out8(TV_OUT_INDEX, SetBits((_Index), TV_REG_INDEX)), \
- inr(TV_OUT_DATA) \
- )
-#define ATIPutMach64TVReg(_Index, _Value) \
- ( \
- out8(TV_OUT_INDEX, SetBits((_Index), TV_REG_INDEX)), \
- outr(TV_OUT_DATA, (_Value)) \
+ out8(TV_OUT_INDEX, SetBits(_Index, TV_REG_INDEX)), \
+ inr(TV_OUT_DATA) \
)
+#define ATIPutMach64TVReg(_Index, _Value) \
+ do \
+ { \
+ out8(TV_OUT_INDEX, SetBits(_Index, TV_REG_INDEX)); \
+ outr(TV_OUT_DATA, _Value); \
+ } while(0)
#endif /* ___ATIMACH64IO_H___ */
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_video.c b/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_video.c
index b47e55e44..fc0fbffb3 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_video.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_video.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_video.c,v 1.3 2000/08/04 16:13:30 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_video.c,v 1.5 2000/09/22 11:35:48 alanh Exp $ */
#include "xf86.h"
#include "xf86_OSproc.h"
@@ -15,6 +15,7 @@
#include "xaa.h"
#include "xaalocal.h"
#include "dixstruct.h"
+#include "fourcc.h"
#define OFF_DELAY 200 /* milliseconds */
#define FREE_DELAY 60000
@@ -152,40 +153,8 @@ static XF86ImageRec Images[NUM_IMAGES] =
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
XvTopToBottom
},
- {
- 0x32315659,
- XvYUV,
- LSBFirst,
- {'Y','V','1','2',
- 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71},
- 12,
- XvPlanar,
- 3,
- 0, 0, 0, 0 ,
- 8, 8, 8,
- 1, 2, 2,
- 1, 2, 2,
- {'Y','V','U',
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
- XvTopToBottom
- },
- {
- 0x32595559,
- XvYUV,
- LSBFirst,
- {'Y','U','Y','2',
- 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71},
- 16,
- XvPacked,
- 1,
- 0, 0, 0, 0 ,
- 8, 8, 8,
- 1, 2, 2,
- 1, 1, 1,
- {'Y','U','Y','V',
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
- XvTopToBottom
- }
+ XVIMAGE_YV12,
+ XVIMAGE_YUY2
};
typedef struct {
@@ -419,14 +388,18 @@ CHIPSStopVideo(ScrnInfoPtr pScrn, pointer data, Bool exit)
{
CHIPSPortPrivPtr pPriv = (CHIPSPortPrivPtr)data;
CHIPSPtr cPtr = CHIPSPTR(pScrn);
- unsigned char mr3c;
+ unsigned char mr3c, tmp;
+ ErrorF("StopVideo\n");
REGION_EMPTY(pScrn->pScreen, &pPriv->clip);
CHIPSHiQVSync(pScrn);
if(exit) {
if(pPriv->videoStatus & CLIENT_VIDEO_ON) {
+ ErrorF("StopVideo Exit\n");
mr3c = cPtr->readMR(cPtr, 0x3C);
cPtr->writeMR(cPtr, 0x3C, (mr3c & 0xFE));
+ tmp = cPtr->readXR(cPtr, 0xD0);
+ cPtr->writeXR(cPtr, 0xD0, (tmp & 0xf));
}
if(pPriv->area) {
xf86FreeOffscreenArea(pPriv->area);
@@ -637,6 +610,10 @@ CHIPSDisplayVideo(
CHIPSHiQVSync(pScrn);
+ ErrorF("DisplayVideo\n");
+ tmp = cPtr->readXR(cPtr, 0xD0);
+ cPtr->writeXR(cPtr, 0xD0, (tmp | 0x10));
+
tmp = cPtr->readMR(cPtr, 0x1E);
tmp &= 0xE0; /* Set Zoom and Direction */
if ((!(cPtr->PanelType & ChipsLCD)) && (mode->Flags & V_INTERLACE))
@@ -651,10 +628,10 @@ CHIPSDisplayVideo(
case 0x36315652: /* RGB16 */
tmp |= 0x08;
break;
- case 0x32315659: /* YV12 */
- tmp |= 0x00;
+ case FOURCC_YV12: /* YV12 */
+ tmp |= 0x03;
break;
- case 0x32595559: /* YUY2 */
+ case FOURCC_YUY2: /* YUY2 */
default:
tmp |= 0x00; /* Do nothing here */
break;
@@ -778,16 +755,13 @@ CHIPSPutImage(
new_h = ((dstPitch * height) + pitch - 1) / pitch;
switch(id) {
- case 0x32315659: /* YV12 */
+ case FOURCC_YV12: /* YV12 */
srcPitch = (width + 3) & ~3;
offset2 = srcPitch * height;
srcPitch2 = ((width >> 1) + 3) & ~3;
offset3 = (srcPitch2 * (height >> 1)) + offset2;
break;
- case 0x35315652: /* RGB15 */
- case 0x36315652: /* RGB16 */
- case 0x32595559: /* YUY2 */
- default:
+ default: /* RGB15, RGB16, YUY2 */
srcPitch = (width << 1);
break;
}
@@ -804,8 +778,8 @@ CHIPSPutImage(
dst_start = cPtr->FbBase + offset + left;
switch(id) {
- case 0x32315659: /* YV12 */
- top &= ~1;
+ case FOURCC_YV12: /* YV12 */
+ top &= ~1;
tmp = ((top >> 1) * srcPitch2) + (left >> 2);
offset2 += tmp;
offset3 += tmp;
@@ -814,10 +788,7 @@ CHIPSPutImage(
buf + offset2, buf + offset3, dst_start,
srcPitch, srcPitch2, dstPitch, nlines, npixels);
break;
- case 0x35315652: /* RGB15 */
- case 0x36315652: /* RGB16 */
- case 0x32595559: /* YUY2 */
- default:
+ default: /* RGB15, RGB16, YUY2 */
buf += (top * srcPitch) + left;
nlines = ((y2 + 0xffff) >> 16) - top;
CHIPSCopyData(buf, dst_start, srcPitch, dstPitch, nlines, npixels);
@@ -857,7 +828,7 @@ CHIPSQueryImageAttributes(
if(offsets) offsets[0] = 0;
switch(id) {
- case 0x32315659: /* YV12 */
+ case FOURCC_YV12: /* YV12 */
*h = (*h + 1) & ~1;
size = (*w + 3) & ~3;
if(pitches) pitches[0] = size;
@@ -870,10 +841,7 @@ CHIPSQueryImageAttributes(
if(offsets) offsets[2] = size;
size += tmp;
break;
- case 0x35315652: /* RGB15 */
- case 0x36315652: /* RGB16 */
- case 0x32595559: /* YUY2 */
- default:
+ default: /* RGB15, RGB16, YUY2 */
size = *w << 1;
if(pitches) pitches[0] = size;
size *= *h;
@@ -991,7 +959,9 @@ CHIPSStopSurface(
if(pPriv->isOn) {
CHIPSPtr cPtr = CHIPSPTR(surface->pScrn);
- unsigned char mr3c;
+ unsigned char mr3c, tmp;
+ tmp = cPtr->readXR(cPtr, 0xD0);
+ cPtr->writeXR(cPtr, 0xD0, (tmp & 0xf));
mr3c = cPtr->readMR(cPtr, 0x3C);
cPtr->writeMR(cPtr, 0x3C, (mr3c & 0xFE));
pPriv->isOn = FALSE;
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp.h b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp.h
index 8fdf05b12..280f417a8 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp.h
@@ -1,12 +1,10 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp.h,v 1.2 2000/02/08 13:13:13 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp.h,v 1.3 2000/09/22 11:12:32 alanh Exp $ */
/* (c) Itai Nahshon */
#ifndef ALP_H
#define ALP_H
-#undef ALP_DEBUG
-
/* Saved registers that are not part of the core VGA */
/* CRTC >= 0x19; Sequencer >= 0x05; Graphics >= 0x09; Attribute >= 0x15 */
@@ -20,7 +18,10 @@ enum {
SR0E,
SR12,
SR13,
+ SR17,
SR1E,
+ SR21,
+ SR2D,
/* GR regs */
GR17,
GR18,
@@ -52,6 +53,17 @@ typedef struct alpRec {
int CursorWidth;
int CursorHeight;
int waitMsk;
+ int scanlineDest;
+ int scanlineCount;
+ int scanlineWidth;
+
+ int SubsequentColorExpandScanlineDest;
+ int SubsequentColorExpandScanlineByteWidth;
+ int SubsequentColorExpandScanlineDWordWidth;
+
+ /* Offset into framebuffer of a 8-byte scratch area for fills */
+ CARD32 monoPattern8x8;
+
Bool autoStart;
/* XXX For XF86Config based mem configuration */
CARD32 sr0f, sr17;
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_driver.c
index 7f02d9481..3873c2f08 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_driver.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_driver.c
@@ -2,6 +2,8 @@
* Driver for CL-GD5480.
* Itai Nahshon.
*
+ * Support for the CL-GD7548: David Monniaux
+ *
* This is mainly a cut & paste from the MGA driver.
* Original autors and contributors list include:
* Radoslaw Kapitan, Andrew Vanderstock, Dirk Hohndel,
@@ -9,7 +11,7 @@
* Guy DESBIEF
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_driver.c,v 1.12 2000/08/04 16:13:30 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_driver.c,v 1.14 2000/09/22 11:12:32 alanh Exp $ */
/* All drivers should typically include these */
#include "xf86.h"
@@ -45,6 +47,12 @@
/* Needed by the Shadow Framebuffer */
#include "shadowfb.h"
+/* Note: can HWCUR64 be set even though the hw cursor is disabled for
+ want of memory ? */
+
+/* Framebuffer memory manager */
+#include "xf86fbman.h"
+
/*
* If using cfb, cfb.h is required. Select the others for the bpp values
* the driver supports.
@@ -111,6 +119,8 @@ static void AlpSave(ScrnInfoPtr pScrn);
static void AlpRestore(ScrnInfoPtr pScrn);
static Bool AlpModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode);
+static void AlpProbeLCD(ScrnInfoPtr pScrn);
+
static void AlpSetClock(CirPtr pCir, vgaHWPtr hwp, int freq);
#ifdef DPMSExtension
@@ -151,6 +161,7 @@ static int unsupp_MaxClocks[] = { 0, 0, 0, 0, 0 }; */
static int gd5430_MaxClocks[] = { 85500, 85500, 50000, 28500, 0 };
static int gd5446_MaxClocks[] = { 135100, 135100, 85500, 85500, 0 };
static int gd5480_MaxClocks[] = { 135100, 200000, 200000, 135100, 135100 };
+static int gd7548_MaxClocks[] = { 80100, 80100, 80100, 80100, 80100 };
/*
* List of symbols from other modules that this module references. This
@@ -357,10 +368,18 @@ AlpCountRam(ScrnInfoPtr pScrn)
pCir->IoMapSize = 0x4000; /* 16K for moment */
if (!CirMapMem(pCir, pScrn->scrnIndex))
return 0;
-
- if (pCir->UseMMIO)
+
+ /* The 754x supports MMIO for the BitBlt engine but
+ not for the VGA registers */
+ switch (pCir->Chipset)
+ {
+ case PCI_CHIP_GD7548:
+ break;
+ default:
+ if (pCir->UseMMIO)
vgaHWSetMmioFuncs(hwp, pCir->IOBase, -0x3C0);
-
+ }
+
if (pCir->chip.alp->sr0f != (CARD32)-1) {
from = X_CONFIG;
hwp->writeSeq(hwp, 0x0F, pCir->chip.alp->sr0f);
@@ -448,6 +467,10 @@ AlpCountRam(ScrnInfoPtr pScrn)
if (pCir->chip.alp->sr17 & 0x80)
videoram <<= 1;
break;
+
+ case PCI_CHIP_GD7548:
+ videoram = 1024; /* TODO: actual size */
+ break;
}
/* UNMap the Alp memory and MMIO areas */
@@ -564,6 +587,13 @@ AlpPreInit(ScrnInfoPtr pScrn, int flags)
xf86DrvMsg(pScrn->scrnIndex,X_INFO,"initializing int10\n");
pInt = xf86InitInt10(pCir->pEnt->index);
xf86FreeInt10(pInt);
+ /*
+ * This is a hack: We restore the PCI base regs as some Colorgraphic
+ * BIOSes tend to mess them up
+ */
+ pciWriteLong(pCir->PciTag,0x10,pCir->PciInfo->memBase[0]);
+ pciWriteLong(pCir->PciTag,0x14,pCir->PciInfo->memBase[1]);
+
#endif
}
#endif
@@ -775,6 +805,9 @@ AlpPreInit(ScrnInfoPtr pScrn, int flags)
xf86SetDDCproperties(pScrn,xf86PrintEDID(
xf86DoEDID_DDC2(pScrn->scrnIndex,pCir->I2CPtr1)));
+ /* Probe the possible LCD display */
+ AlpProbeLCD(pScrn);
+
#ifdef CIRPROBEI2C
CirProbeI2C(pScrn->scrnIndex);
#endif
@@ -863,7 +896,12 @@ AlpPreInit(ScrnInfoPtr pScrn, int flags)
if ((pCir->chip.alp->sr0f & 0x18) > 0x8)
pCir->properties |= HWCUR64;
+
switch (pCir->Chipset) {
+ case PCI_CHIP_GD7548:
+ pCir->properties |= HWCUR64;
+ pCir->properties |= ACCEL_AUTOSTART;
+ break;
case PCI_CHIP_GD5436:
case PCI_CHIP_GD5480:
pCir->properties |= ACCEL_AUTOSTART;
@@ -905,6 +943,9 @@ AlpPreInit(ScrnInfoPtr pScrn, int flags)
case PCI_CHIP_GD5480:
p = gd5480_MaxClocks;
break;
+ case PCI_CHIP_GD7548:
+ p = gd7548_MaxClocks;
+ break;
}
if (!p)
return FALSE;
@@ -954,7 +995,15 @@ AlpPreInit(ScrnInfoPtr pScrn, int flags)
clockRanges->ClockDivFactor = 1;
clockRanges->PrivFlags = 0;
- pCir->Rounding = 128 >> pCir->BppShift;
+ switch (pCir->Chipset)
+ {
+ case PCI_CHIP_GD7548:
+ pCir->Rounding = 1;
+ break;
+
+ default:
+ pCir->Rounding = 128 >> pCir->BppShift;
+ }
#if 0
if (pCir->Chipset != PCI_CHIP_GD5446 &&
@@ -1100,7 +1149,10 @@ AlpSave(ScrnInfoPtr pScrn)
pCir->chip.alp->ModeReg.ExtVga[SR0E] = pCir->chip.alp->SavedReg.ExtVga[SR0E] = hwp->readSeq(hwp, 0x0E);
pCir->chip.alp->ModeReg.ExtVga[SR12] = pCir->chip.alp->SavedReg.ExtVga[SR12] = hwp->readSeq(hwp, 0x12);
pCir->chip.alp->ModeReg.ExtVga[SR13] = pCir->chip.alp->SavedReg.ExtVga[SR13] = hwp->readSeq(hwp, 0x13);
+ pCir->chip.alp->ModeReg.ExtVga[SR17] = pCir->chip.alp->SavedReg.ExtVga[SR17] = hwp->readSeq(hwp, 0x17);
pCir->chip.alp->ModeReg.ExtVga[SR1E] = pCir->chip.alp->SavedReg.ExtVga[SR1E] = hwp->readSeq(hwp, 0x1E);
+ pCir->chip.alp->ModeReg.ExtVga[SR21] = pCir->chip.alp->SavedReg.ExtVga[SR21] = hwp->readSeq(hwp, 0x21);
+ pCir->chip.alp->ModeReg.ExtVga[SR2D] = pCir->chip.alp->SavedReg.ExtVga[SR2D] = hwp->readSeq(hwp, 0x2D);
pCir->chip.alp->ModeReg.ExtVga[GR17] = pCir->chip.alp->SavedReg.ExtVga[GR17] = hwp->readGr(hwp, 0x17);
pCir->chip.alp->ModeReg.ExtVga[GR18] = pCir->chip.alp->SavedReg.ExtVga[GR18] = hwp->readGr(hwp, 0x18);
/* The first 4 reads are for the pixel mask register. After 4 times that
@@ -1139,7 +1191,10 @@ alpRestore(vgaHWPtr hwp, AlpRegPtr cirReg)
hwp->writeSeq(hwp, 0x0E, cirReg->ExtVga[SR0E]);
hwp->writeSeq(hwp, 0x12, cirReg->ExtVga[SR12]);
hwp->writeSeq(hwp, 0x13, cirReg->ExtVga[SR13]);
+ hwp->writeSeq(hwp, 0x17, cirReg->ExtVga[SR17]);
hwp->writeSeq(hwp, 0x1E, cirReg->ExtVga[SR1E]);
+ hwp->writeSeq(hwp, 0x21, cirReg->ExtVga[SR21]);
+ hwp->writeSeq(hwp, 0x2D, cirReg->ExtVga[SR2D]);
hwp->writeGr(hwp, 0x17, cirReg->ExtVga[GR17]);
hwp->writeGr(hwp, 0x18, cirReg->ExtVga[GR18]);
/* The first 4 reads are for the pixel mask register. After 4 times that
@@ -1234,7 +1289,16 @@ AlpModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
/* Turn off HW cursor, gamma correction, overscan color protect. */
pCir->chip.alp->ModeReg.ExtVga[SR12] = 0;
if ((pCir->properties & HWCUR64) == HWCUR64)
- pCir->chip.alp->ModeReg.ExtVga[SR12] = 0x4;
+ {
+ pCir->chip.alp->ModeReg.ExtVga[SR12] = 0x4;
+ switch (pCir->Chipset)
+ {
+ case PCI_CHIP_GD7548:
+ pCir->chip.alp->ModeReg.ExtVga[SR21] |= 0x10;
+ break;
+ }
+
+ }
else
pCir->chip.alp->ModeReg.ExtVga[SR12] = 0;
@@ -1314,6 +1378,27 @@ AlpModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
else
pCir->chip.alp->ModeReg.ExtVga[GR18] &= ~0x20;
+
+ /* Some extra init stuff */
+ switch (pCir->Chipset)
+ {
+ case PCI_CHIP_GD7548:
+ /* Do we use MMIO ?
+ If we do and we are on a 7548, we need to tell the board
+ that we want MMIO. */
+ if (pCir->UseMMIO)
+ {
+ pCir->chip.alp->ModeReg.ExtVga[SR17] =
+ (pCir->chip.alp->ModeReg.ExtVga[SR17] & ~0x40) | 4;
+ ErrorF("UseMMIO: SR17=%2X\n", (int) (pCir->chip.alp->ModeReg.ExtVga[SR17]));
+ }
+#ifdef ALP_SETUP
+ ErrorF("SR2D=%2X\n", (int) (pCir->chip.alp->ModeReg.ExtVga[SR17]));
+#endif
+ pCir->chip.alp->ModeReg.ExtVga[SR2D] |= 0xC0;
+ break;
+ }
+
/* No support for interlace (yet) */
pCir->chip.alp->ModeReg.ExtVga[CR1A] = 0x00;
@@ -1382,6 +1467,7 @@ AlpScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
ScrnInfoPtr pScrn;
vgaHWPtr hwp;
CirPtr pCir;
+ AlpPtr pAlp;
int i, ret;
VisualPtr visual;
int displayWidth,width,height;
@@ -1398,7 +1484,8 @@ AlpScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
hwp = VGAHWPTR(pScrn);
pCir = CIRPTR(pScrn);
-
+ pAlp = ALPPTR(pCir);
+
/* Map the VGA memory when the primary video */
if (!vgaHWMapMem(pScrn))
return FALSE;
@@ -1407,8 +1494,16 @@ AlpScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
if (!CirMapMem(pCir, pScrn->scrnIndex))
return FALSE;
- if(pCir->UseMMIO)
+ /* The 754x supports MMIO for the BitBlt engine but
+ not for the VGA registers */
+ switch (pCir->Chipset)
+ {
+ case PCI_CHIP_GD7548:
+ break;
+ default:
+ if(pCir->UseMMIO)
vgaHWSetMmioFuncs(hwp, pCir->IOBase, -0x3C0);
+ }
vgaHWGetIOBase(hwp);
@@ -1565,29 +1660,77 @@ AlpScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
*/
xf86SetBlackWhitePixels(pScreen);
- if (!pCir->NoAccel) { /* Initialize XAA functions */
- if (!(pCir->UseMMIO ? AlpXAAInitMMIO(pScreen) :
- AlpXAAInit(pScreen)))
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Could not initialize XAA\n");
- }
-
/* Initialise cursor functions */
miDCInitialize(pScreen, xf86GetPointerScreenFuncs());
- if (pCir->HWCursor) { /* Initialize HW cursor layer */
- int offscreen_size = pScrn->videoRam * 1024 -
- (BitmapBytePad(pScrn->displayWidth
- * pScrn->bitsPerPixel) * pScrn->virtualY);
- int cursor_size = 32;
- if ((pCir->properties & HWCUR64)
- && (offscreen_size >= 64*8*2))
- cursor_size = 64;
- else if (offscreen_size < 32*4*2)
- cursor_size = 0;
- if (!AlpHWCursorInit(pScreen,cursor_size))
+ /* Allocation of off-screen memory to various stuff
+ (hardware cursor, 8x8 mono pattern...)
+ Allocation goes top-down in memory, since the cursor
+ *must* be in the last videoram locations */
+ {
+ int offscreen_offset = pScrn->videoRam*1024,
+ offscreen_size = pScrn->videoRam * 1024 - pScrn->virtualY *
+ (BitmapBytePad(pScrn->displayWidth * pScrn->bitsPerPixel));
+ int cursor_size = 0;
+
+#ifdef ALP_DEBUG
+ ErrorF("offscreen_offset=%d, offscreen_size=%d\n",
+ offscreen_offset, offscreen_size);
+#endif
+
+ /* Initialise cursor functions */
+ if (pCir->HWCursor) { /* Initialize HW cursor layer */
+ if ((pCir->properties & HWCUR64)
+ && (offscreen_size >= 64*8*2))
+ {
+ cursor_size = 64;
+ offscreen_size -= 64*8*2;
+ offscreen_offset -= 64*8*2;
+ }
+ else if (offscreen_size >= 32*4*2)
+ {
+ cursor_size = 32;
+ offscreen_size -= 32*8*2;
+ offscreen_offset -= 32*8*2;
+ }
+ if (!AlpHWCursorInit(pScreen, cursor_size))
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "Hardware cursor initialization failed\n");
+ "Hardware cursor initialization failed\n");
+ }
+#ifdef ALP_DEBUG
+ ErrorF("AlpHWCursorInit complete.\n");
+#endif
+ if (offscreen_size >= 8 && !pCir->NoAccel &&
+ pCir->Chipset == PCI_CHIP_GD7548)
+ {
+ offscreen_offset -= 8;
+ offscreen_size -= 8;
+ pAlp->monoPattern8x8 = offscreen_offset;
+#ifdef ALP_DEBUG
+ ErrorF("monoPattern8x8=%d\n", pAlp->monoPattern8x8);
+#endif
+ }
+ else pAlp->monoPattern8x8 = 0;
+ {
+ /* TODO: probably not correct if rotated */
+ BoxRec box;
+ box.x1=0;
+ box.y1=0;
+ box.x2=pScrn->virtualX;
+ box.y2=offscreen_offset / pCir->pitch;
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "Using %d lines for offscreen memory\n",
+ box.y2 - pScrn->virtualY);
+ }
+
}
+
+ if (!pCir->NoAccel) { /* Initialize XAA functions */
+ if (!(pCir->UseMMIO ? AlpXAAInitMMIO(pScreen) :
+ AlpXAAInit(pScreen)))
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Could not initialize XAA\n");
+ }
+
#if 0
if (!AlpDGAInit(pScreen))
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "DGA initialization failed\n");
@@ -1848,7 +1991,9 @@ AlpSetClock(CirPtr pCir, vgaHWPtr hwp, int freq)
int num, den, ffreq, usemclk, diff, mclk;
CARD8 tmp;
+#ifdef ALP_DEBUG
ErrorF("AlpSetClock freq=%d.%03dMHz\n", freq / 1000, freq % 1000);
+#endif
ffreq = freq;
if (!CirrusFindClock(&ffreq, pCir->MaxClock, &num, &den))
@@ -1867,9 +2012,10 @@ AlpSetClock(CirPtr pCir, vgaHWPtr hwp, int freq)
else
usemclk = FALSE;
+#ifdef ALP_DEBUG
ErrorF("AlpSetClock: nom=%x den=%x ffreq=%d.%03dMHz usemclk=%x\n",
num, den, ffreq / 1000, ffreq % 1000, usemclk);
-
+#endif
/* So - how do we use MCLK here for the VCLK ? */
/* Set VCLK3. */
@@ -1957,3 +2103,73 @@ static void AlpProbeI2C(int scrnIndex)
}
}
#endif
+
+static void
+AlpProbeLCD(ScrnInfoPtr pScrn)
+{
+ CirPtr pCir = CIRPTR(pScrn);
+ vgaHWPtr hwp = VGAHWPTR(pScrn);
+ static const char* lcd_type_names[] =
+ {
+ "none",
+ "dual-scan monochrome",
+ "unknown",
+ "DSTN (dual scan color)",
+ "TFT (active matrix)"
+ };
+
+
+ pCir -> lcdType = LCD_NONE;
+
+ switch (pCir -> Chipset)
+ {
+ case PCI_CHIP_GD7548:
+ switch (hwp->readCrtc(hwp, 0x2C) >> 6)
+ {
+ case 0: pCir->lcdType = LCD_DUAL_MONO; break;
+ case 1: pCir->lcdType = LCD_UNKNOWN; break;
+ case 2: pCir->lcdType = LCD_DSTN; break;
+ case 3: pCir->lcdType = LCD_TFT; break;
+ }
+
+ /* Enable LCD control registers instead of normal CRTC registers */
+ hwp->writeCrtc(hwp, 0x2D, hwp->readCrtc(hwp, 0x2D) | 0x80);
+
+ switch ((hwp->readCrtc(hwp, 0x9) >> 2) & 3)
+ {
+ case 0:
+ pCir->lcdWidth = 640;
+ pCir->lcdHeight = 480;
+ break;
+
+ case 1:
+ pCir->lcdWidth = 800;
+ pCir->lcdHeight = 600;
+ break;
+
+ case 2:
+ pCir->lcdWidth = 1024;
+ pCir->lcdHeight = 768;
+ break;
+
+ case 3:
+ pCir->lcdWidth = 0;
+ pCir->lcdHeight = 0;
+ break;
+ }
+
+ /* Disable LCD control registers */
+ hwp->writeCrtc(hwp, 0x2D, hwp->readCrtc(hwp, 0x2D) & ~0x80);
+ break;
+ }
+
+ if (pCir -> lcdType != LCD_NONE)
+ {
+ xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
+ "LCD display: %dx%d %s\n",
+ pCir->lcdWidth, pCir->lcdHeight,
+ lcd_type_names[pCir->lcdType]);
+ }
+}
+
+
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_xaa.c b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_xaa.c
index c101559e2..52aabaed9 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_xaa.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_xaa.c
@@ -1,6 +1,6 @@
/* (c) Itai Nahshon */
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_xaa.c,v 1.2 2000/02/08 13:13:14 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_xaa.c,v 1.3 2000/09/22 11:12:32 alanh Exp $ */
#include "xf86.h"
#include "xf86_OSproc.h"
@@ -109,6 +109,7 @@ AlpSetupForSolidFill(ScrnInfoPtr pScrn, int color, int rop,
unsigned int planemask)
{
CirPtr pCir = CIRPTR(pScrn);
+ AlpPtr pAlp = ALPPTR(pCir);
int pitch = pCir->pitch;
#ifdef ALP_DEBUG
@@ -117,12 +118,35 @@ AlpSetupForSolidFill(ScrnInfoPtr pScrn, int color, int rop,
#endif
WAIT;
- outb(0x3CE, 0x32); outb(0x3CF, 0x0d);
+ /* GR32 = 0x0D => verbatim source copy (no logical op) */
+ outw(0x3CE, 0x0D32);
+
+ switch (pCir -> Chipset)
+ {
+ case PCI_CHIP_GD7548:
+ /* The GD7548 does not (apparently) support solid filling
+ directly, it always need an actual source.
+ We therefore use it as a pattern fill with a solid
+ pattern */
+ {
+ int source = pAlp->monoPattern8x8;
+ /* source = 8x8 solid mono pattern */
+ outw(0x3CE, ((source << 8) & 0xff00) | 0x2C);
+ outw(0x3CE, ((source) & 0xff00) | 0x2D);
+ outw(0x3CE, ((source >> 8) & 0x3f00) | 0x2E);
+ /* memset() may not be the fastest */
+ memset(pCir->FbBase + pAlp->monoPattern8x8, 0xFF, 8);
+ write_mem_barrier();
+ break;
+ }
+ default:
+ /* GR33 = 0x04 => does not exist on GD7548 */
+ outw(0x3CE, 0x0433);
+ }
- outb(0x3CE, 0x33);
- outb(0x3CF, 0x04);
- outb(0x3CE, 0x30);
- outb(0x3CF, 0xC0|((pScrn->bitsPerPixel - 8) << 1));
+ /* GR30 = color expansion, pattern copy */
+ /* Choses 8bpp / 16bpp color expansion */
+ outw(0x3CE, 0xC030 |((pScrn->bitsPerPixel - 8) << 9));
outw(0x3CE, ((color << 8) & 0xff00) | 0x01);
outw(0x3CE, ((color) & 0xff00) | 0x11);
@@ -169,12 +193,361 @@ AlpSubsequentSolidFillRect(ScrnInfoPtr pScrn, int x, int y, int w, int h)
}
+static void
+AlpSetupForMono8x8PatternFill(ScrnInfoPtr pScrn,
+ int patx, int paty,
+ int fg, int bg,
+ int rop, unsigned int planemask)
+{
+ CirPtr pCir = CIRPTR(pScrn);
+ AlpPtr pAlp = ALPPTR(pCir);
+ int pitch = pCir->pitch;
+
+#ifdef ALP_DEBUG
+ ErrorF("AlpSetupFor8x8PatternFill pattern=%8x%8x"
+ "fg=%x bg=%x rop=%x planemask=%x\n",
+ patx, paty, fg, bg, rop, planemask);
+#endif
+ WAIT;
+
+ /* GR32 = 0x0D => verbatim source copy (no logical op) */
+ outw(0x3CE, 0x0D32);
+
+ {
+ int source = pAlp->monoPattern8x8;
+ /* source = 8x8 solid mono pattern */
+ outw(0x3CE, ((source << 8) & 0xff00) | 0x2C);
+ outw(0x3CE, ((source) & 0xff00) | 0x2D);
+ outw(0x3CE, ((source >> 8) & 0x3f00) | 0x2E);
+ }
+
+ /* GR30 = color expansion, pattern copy */
+ /* Choses 8bpp / 16bpp color expansion */
+ if (bg == -1)
+ { /* transparency requested */
+ outw(0x3CE, 0xC830 |((pScrn->bitsPerPixel - 8) << 9));
+
+ bg = ~fg;
+ /* transparent color compare */
+ outw(0x3CE, ((bg << 8) & 0xff00) | 0x34);
+ outw(0x3CE, ((bg) & 0xff00) | 0x35);
+
+ /* transparent color mask = 0 (all bits matters) */
+ outw(0x3CE, 0x38);
+ outw(0x3CE, 0x39);
+ }
+ else
+ {
+ outw(0x3CE, 0xC030 |((pScrn->bitsPerPixel - 8) << 9));
+ }
+
+ outw(0x3CE, ((fg << 8) & 0xff00) | 0x01);
+ outw(0x3CE, ((fg) & 0xff00) | 0x11);
+
+ outw(0x3CE, ((bg << 8) & 0xff00) | 0x00);
+ outw(0x3CE, ((bg) & 0xff00) | 0x10);
+
+ /* Set dest pitch */
+ outw(0x3CE, ((pitch << 8) & 0xff00) | 0x24);
+ outw(0x3CE, ((pitch) & 0x1f00) | 0x25);
+}
+
+static void
+AlpSubsequentMono8x8PatternFillRect(ScrnInfoPtr pScrn, int patx, int paty,
+ int x, int y, int w, int h)
+{
+ CirPtr pCir = CIRPTR(pScrn);
+ AlpPtr pAlp = ALPPTR(pCir);
+ int dest;
+ int hh, ww;
+ int pitch = pCir->pitch;
+
+ ww = (w * pScrn->bitsPerPixel / 8) - 1;
+ hh = h - 1;
+ dest = y * pitch + x * pScrn->bitsPerPixel / 8;
+
+ WAIT;
+ /* memcpy() may not be the fastest */
+ memcpy(pCir->FbBase + pAlp->monoPattern8x8, &patx, 4);
+ memcpy(pCir->FbBase + pAlp->monoPattern8x8 + 4, &paty, 4);
+ write_mem_barrier();
+
+ /* Width */
+ outw(0x3CE, ((ww << 8) & 0xff00) | 0x20);
+ outw(0x3CE, ((ww) & 0x1f00) | 0x21);
+ /* Height */
+ outw(0x3CE, ((hh << 8) & 0xff00) | 0x22);
+ outw(0x3CE, ((hh) & 0x0700) | 0x23);
+
+ /* dest */
+ outw(0x3CE, ((dest << 8) & 0xff00) | 0x28);
+ outw(0x3CE, ((dest) & 0xff00) | 0x29);
+ outw(0x3CE, ((dest >> 8) & 0x3f00) | 0x2A);
+ if (!pCir->chip.alp->autoStart)
+ outw(0x3CE,0x0231);
+
+#ifdef ALP_DEBUG
+ ErrorF("AlpSubsequent8x8PatternFill x=%d y=%d w=%d h=%d\n",
+ x, y, w, h);
+#endif
+
+}
+
+#if 0
+/* XF86 does not support byte-padded scanlines */
+
+static void
+AlpSetupForCPUToScreenColorExpandFill(ScrnInfoPtr pScrn,
+ int fg, int bg,
+ int rop,
+ unsigned int planemask)
+{
+ CirPtr pCir = CIRPTR(pScrn);
+ AlpPtr pAlp = ALPPTR(pCir);
+ int pitch = pCir->pitch;
+
+#ifdef ALP_DEBUG
+ ErrorF("AlpSetupForCPUToScreenColorExpandFill "
+ "fg=%x bg=%x rop=%x planemask=%x\n",
+ fg, bg, rop, planemask);
+#endif
+ WAIT;
+
+ /* GR32 = 0x0D => verbatim source copy (no logical op) */
+ outw(0x3CE, 0x0D32);
+
+ /* GR30 = color expansion, CPU->display copy */
+ /* Choses 8bpp / 16bpp color expansion */
+ if (bg == -1)
+ { /* transparency requested */
+ outw(0x3CE, 0x8C30 |((pScrn->bitsPerPixel - 8) << 9));
+
+ bg = ~fg;
+ /* transparent color compare */
+ outw(0x3CE, ((bg << 8) & 0xff00) | 0x34);
+ outw(0x3CE, ((bg) & 0xff00) | 0x35);
+
+ /* transparent color mask = 0 (all bits matters) */
+ outw(0x3CE, 0x38);
+ outw(0x3CE, 0x39);
+ }
+ else
+ {
+ outw(0x3CE, 0x8430 |((pScrn->bitsPerPixel - 8) << 9));
+ }
+
+ outw(0x3CE, ((bg << 8) & 0xff00) | 0x00);
+ outw(0x3CE, ((bg) & 0xff00) | 0x10);
+
+ outw(0x3CE, ((fg << 8) & 0xff00) | 0x01);
+ outw(0x3CE, ((fg) & 0xff00) | 0x11);
+
+ /* Set dest pitch */
+ outw(0x3CE, ((pitch << 8) & 0xff00) | 0x24);
+ outw(0x3CE, ((pitch) & 0x1f00) | 0x25);
+}
+
+static void
+AlpSubsequentCPUToScreenColorExpandFill(
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h,
+ int skipleft)
+{
+ CirPtr pCir = CIRPTR(pScrn);
+ int dest;
+ int hh, ww;
+ int pitch = pCir->pitch;
+
+ ww = (((w+7) & ~7) * pScrn->bitsPerPixel / 8) - 1;
+ hh = h - 1;
+ dest = y * pitch + x * pScrn->bitsPerPixel / 8;
+
+ WAIT;
+
+ /* Width */
+ outw(0x3CE, ((ww << 8) & 0xff00) | 0x20);
+ outw(0x3CE, ((ww) & 0x1f00) | 0x21);
+ /* Height */
+ outw(0x3CE, ((hh << 8) & 0xff00) | 0x22);
+ outw(0x3CE, ((hh) & 0x0700) | 0x23);
+
+ /* source = CPU ; description of bit 2 of GR30 in the 7548 manual
+ says that if we do color expansion we must zero the source
+ adress registers (GR2C, GR2D, GR2E) */
+ outw(0x3CE, 0x2C);
+ outw(0x3CE, 0x2D);
+ outw(0x3CE, 0x2E);
+
+ /* dest */
+ outw(0x3CE, ((dest << 8) & 0xff00) | 0x28);
+ outw(0x3CE, ((dest) & 0xff00) | 0x29);
+ outw(0x3CE, ((dest >> 8) & 0x3f00) | 0x2A);
+ if (!pCir->chip.alp->autoStart)
+ outw(0x3CE,0x0231);
+
+#ifdef ALP_DEBUG
+ ErrorF("AlpSubsequentCPUToScreenColorExpandFill x=%d y=%d w=%d h=%d\n",
+ x, y, w, h);
+#endif
+}
+#endif
+
+#if 1
+static void
+AlpSetupForScanlineCPUToScreenColorExpandFill(ScrnInfoPtr pScrn,
+ int fg, int bg,
+ int rop,
+ unsigned int planemask)
+{
+ CirPtr pCir = CIRPTR(pScrn);
+ int pitch = pCir->pitch;
+
+#ifdef ALP_DEBUG
+ ErrorF("AlpSetupForCPUToScreenColorExpandFill "
+ "fg=%x bg=%x rop=%x planemask=%x, bpp=%d\n",
+ fg, bg, rop, planemask, pScrn->bitsPerPixel);
+#endif
+ WAIT;
+
+ /* GR32 = 0x0D => verbatim source copy (no logical op) */
+ outw(0x3CE, 0x0D32);
+
+ /* GR30 = color expansion, CPU->display copy */
+ /* Choses 8bpp / 16bpp color expansion */
+ if (bg == -1)
+ { /* transparency requested */
+ if (pScrn->bitsPerPixel > 8) /* 16 bpp */
+ {
+ outw(0x3CE, 0x9C30);
+
+ bg = ~fg;
+ /* transparent color compare */
+ outw(0x3CE, ((bg << 8) & 0xff00) | 0x34);
+ outw(0x3CE, ((bg) & 0xff00) | 0x35);
+ } else /* 8 bpp */
+ {
+ outw(0x3CE, 0x8C30);
+
+ bg = ~fg;
+ /* transparent color compare */
+ outw(0x3CE, ((bg << 8) & 0xff00) | 0x34);
+ outw(0x3CE, ((bg << 8) & 0xff00) | 0x35);
+ }
+
+ /* transparent color mask = 0 (all bits matters) */
+ outw(0x3CE, 0x38);
+ outw(0x3CE, 0x39);
+ }
+ else
+ {
+ outw(0x3CE, 0x8430 |((pScrn->bitsPerPixel - 8) << 9));
+ }
+
+ outw(0x3CE, ((bg << 8) & 0xff00) | 0x00);
+ outw(0x3CE, ((bg) & 0xff00) | 0x10);
+
+ outw(0x3CE, ((fg << 8) & 0xff00) | 0x01);
+ outw(0x3CE, ((fg) & 0xff00) | 0x11);
+
+ /* Set dest pitch */
+ outw(0x3CE, ((pitch << 8) & 0xff00) | 0x24);
+ outw(0x3CE, ((pitch) & 0x1f00) | 0x25);
+}
+
+static void
+AlpSubsequentScanlineCPUToScreenColorExpandFill(
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h,
+ int skipleft)
+{
+ CirPtr pCir = CIRPTR(pScrn);
+ AlpPtr pAlp = ALPPTR(pCir);
+
+ int pitch = pCir->pitch;
+
+ pAlp->SubsequentColorExpandScanlineByteWidth =
+ (w * pScrn->bitsPerPixel / 8) - 1;
+ pAlp->SubsequentColorExpandScanlineDWordWidth =
+ (w + 31) >> 5;
+ pAlp->SubsequentColorExpandScanlineDest =
+ y * pitch + x * pScrn->bitsPerPixel / 8;
+
+#ifdef ALP_DEBUG
+ ErrorF("AlpSubsequentScanlineCPUToScreenColorExpandFill x=%d y=%d w=%d h=%d skipleft=%d\n",
+ x, y, w, h, skipleft);
+#endif
+}
+
+static void
+AlpSubsequentColorExpandScanline(
+ ScrnInfoPtr pScrn,
+ int bufno)
+{
+ CirPtr pCir = CIRPTR(pScrn);
+ AlpPtr pAlp = ALPPTR(pCir);
+ int dest=pAlp->SubsequentColorExpandScanlineDest;
+ int ww=pAlp->SubsequentColorExpandScanlineByteWidth;
+ int width=pAlp->SubsequentColorExpandScanlineDWordWidth;
+ CARD32* from;
+ volatile CARD32 *to;
+
+#ifdef ALP_DEBUG
+ ErrorF("AlpSubsequentColorExpandScanline\n");
+#endif
+
+ pAlp->SubsequentColorExpandScanlineDest += pCir->pitch;
+
+ to = (CARD32*) pCir->FbBase;
+ from = (CARD32*) (pCir->ScanlineColorExpandBuffers[bufno]);
+ WAIT_1;
+
+ /* Width */
+ outw(0x3CE, ((ww << 8) & 0xff00) | 0x20);
+ outw(0x3CE, ((ww) & 0x1f00) | 0x21);
+
+ /* Height = 1 */
+ outw(0x3CE, 0x22);
+ outw(0x3CE, 0x23);
+
+ /* source = CPU ; description of bit 2 of GR30 in the 7548 manual
+ says that if we do color expansion we must zero the source
+ adress registers (GR2C, GR2D, GR2E) */
+ outw(0x3CE, 0x2C);
+ outw(0x3CE, 0x2D);
+ outw(0x3CE, 0x2E);
+
+ /* dest */
+ outw(0x3CE, ((dest << 8) & 0xff00) | 0x28);
+ outw(0x3CE, ((dest) & 0xff00) | 0x29);
+ write_mem_barrier();
+
+#ifdef ALP_DEBUG
+ ErrorF("AlpSubsequentColorExpandScanline (2)\n");
+#endif
+
+ outw(0x3CE, ((dest >> 8) & 0x3f00) | 0x2A);
+ if (!pCir->chip.alp->autoStart)
+ outw(0x3CE,0x0231);
+
+ {
+ int i;
+ for (i=0; i<width; i++)
+ *to=*(from++);
+ write_mem_barrier();
+ }
+
+#ifdef ALP_DEBUG
+ ErrorF("AlpSubsequentColorExpandScanline (3)\n");
+#endif
+}
+#endif
Bool
AlpXAAInit(ScreenPtr pScreen)
{
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
CirPtr pCir = CIRPTR(pScrn);
+ AlpPtr pAlp = ALPPTR(pCir);
XAAInfoRecPtr XAAPtr;
#ifdef ALP_DEBUG
@@ -188,18 +561,90 @@ AlpXAAInit(ScreenPtr pScreen)
XAAPtr->SubsequentScreenToScreenCopy = AlpSubsequentScreenToScreenCopy;
XAAPtr->ScreenToScreenCopyFlags = GXCOPY_ONLY|NO_TRANSPARENCY|NO_PLANEMASK;
- if (pCir->Chipset == PCI_CHIP_GD5446 ||
- pCir->Chipset == PCI_CHIP_GD5480) {
-
- XAAPtr->SetupForSolidFill = AlpSetupForSolidFill;
- XAAPtr->SubsequentSolidFillRect = AlpSubsequentSolidFillRect;
- XAAPtr->SubsequentSolidFillTrap = NULL;
- XAAPtr->SolidFillFlags = GXCOPY_ONLY|NO_TRANSPARENCY|NO_PLANEMASK;
+ switch (pCir->Chipset)
+ {
+ case PCI_CHIP_GD7548:
+ if (!pAlp->monoPattern8x8) break;
+ XAAPtr->SetupForSolidFill = AlpSetupForSolidFill;
+ XAAPtr->SubsequentSolidFillRect = AlpSubsequentSolidFillRect;
+ XAAPtr->SubsequentSolidFillTrap = NULL;
+ XAAPtr->SolidFillFlags = GXCOPY_ONLY|NO_PLANEMASK;
+
+ XAAPtr->SetupForMono8x8PatternFill = AlpSetupForMono8x8PatternFill;
+ XAAPtr->SubsequentMono8x8PatternFillRect =
+ AlpSubsequentMono8x8PatternFillRect;
+ XAAPtr->SubsequentMono8x8PatternFillTrap = NULL;
+ XAAPtr->Mono8x8PatternFillFlags =
+ GXCOPY_ONLY|NO_PLANEMASK|
+ HARDWARE_PATTERN_PROGRAMMED_BITS|BIT_ORDER_IN_BYTE_MSBFIRST;
+
+#if 0
+ /* Currently disabled: XF86 sends DWORD-padded data,
+ not byte-padded */
+ XAAPtr->SetupForCPUToScreenColorExpandFill =
+ AlpSetupForCPUToScreenColorExpandFill;
+ XAAPtr->SubsequentCPUToScreenColorExpandFill =
+ AlpSubsequentCPUToScreenColorExpandFill;
+ XAAPtr->ColorExpandBase = pCir->FbBase + 4;
+ XAAPtr->CPUToScreenColorExpandFillFlags =
+ GXCOPY_ONLY|NO_PLANEMASK|BIT_ORDER_IN_BYTE_MSBFIRST|
+ SCANLINE_PAD_DWORD|
+ CPU_TRANSFER_PAD_DWORD|CPU_TRANSFER_BASE_FIXED;
+#endif
+#if 1
+ /* kludge: since XF86 does not support byte-padded
+ mono bitmaps (only dword-padded), use the
+ scanline version */
+ XAAPtr->SetupForScanlineCPUToScreenColorExpandFill =
+ AlpSetupForScanlineCPUToScreenColorExpandFill;
+ XAAPtr->SubsequentScanlineCPUToScreenColorExpandFill =
+ AlpSubsequentScanlineCPUToScreenColorExpandFill;
+ XAAPtr->SubsequentColorExpandScanline =
+ AlpSubsequentColorExpandScanline;
+ {
+ const int NumScanlineColorExpandBuffers = 2;
+ int i;
+ int buffer_size = (pCir->pScrn->virtualX + 31) & ~31;
+#ifdef ALP_DEBUG
+ ErrorF("Computing buffers for %d pixel lines\n",
+ pCir->pScrn->virtualX);
+#endif
+ XAAPtr->NumScanlineColorExpandBuffers =
+ NumScanlineColorExpandBuffers;
+ XAAPtr->ScanlineColorExpandBuffers =
+ pCir->ScanlineColorExpandBuffers = (unsigned char **)
+ (malloc(sizeof(unsigned char *) *
+ NumScanlineColorExpandBuffers));
+ /* TODO: are those mallocs to be freed ? */
+
+ for(i=0; i<NumScanlineColorExpandBuffers; i++)
+ pCir->ScanlineColorExpandBuffers[i] = (unsigned char *)
+ malloc(buffer_size);
+ }
+ XAAPtr->ScanlineCPUToScreenColorExpandFillFlags =
+ GXCOPY_ONLY|NO_PLANEMASK|BIT_ORDER_IN_BYTE_MSBFIRST|
+ SCANLINE_PAD_DWORD;
+#endif
+ break;
+
+ case PCI_CHIP_GD5446:
+ case PCI_CHIP_GD5480:
+ XAAPtr->SetupForSolidFill = AlpSetupForSolidFill;
+ XAAPtr->SubsequentSolidFillRect = AlpSubsequentSolidFillRect;
+ XAAPtr->SubsequentSolidFillTrap = NULL;
+ XAAPtr->SolidFillFlags = GXCOPY_ONLY|NO_TRANSPARENCY|NO_PLANEMASK;
+ outw(0x3CE, 0x200E); /* enable writes to gr33 */
+ break;
}
+ /* TODO: probably too limited */
+
XAAPtr->Sync = AlpSync;
- outw(0x3CE, 0x200E); /* enable writes to gr33 */
+ /* Pixmap cache */
+ XAAPtr -> Flags |= LINEAR_FRAMEBUFFER;
+
+ /* Setup things for autostart */
if (pCir->properties & ACCEL_AUTOSTART) {
outw(0x3CE, 0x8031); /* enable autostart */
pCir->chip.alp->waitMsk = 0x10;
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_xaam.c b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_xaam.c
index e2f6c4873..8c0eb09dc 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_xaam.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_xaam.c
@@ -1,6 +1,6 @@
/* (c) Itai Nahshon */
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_xaam.c,v 1.2 2000/02/08 13:13:14 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_xaam.c,v 1.3 2000/09/22 11:12:32 alanh Exp $ */
#include "xf86.h"
#include "xf86_OSproc.h"
@@ -15,16 +15,22 @@
#include "cir.h"
#include "alp.h"
-#define minb(p) MMIO_IN8(hwp->MMIOBase, hwp->MMIOOffset + (p))
+#define minb(p) \
+ ErrorF("minb(%X)\n", p),\
+ MMIO_IN8(pCir->IOBase, (p))
#define moutb(p,v) \
- MMIO_OUT8(hwp->MMIOBase, hwp->MMIOOffset + (p),(v))
-#define minl(p) MMIO_IN32(pCir->IOBase, (p))
+ ErrorF("moutb(%X)\n", p),\
+ MMIO_OUT8(pCir->IOBase, (p),(v))
+#define minl(p) \
+ ErrorF("minl(%X)\n", p),\
+ MMIO_IN32(pCir->IOBase, (p))
#define moutl(p,v) \
+ ErrorF("moutl(%X)\n", p),\
MMIO_OUT32(pCir->IOBase, (p),(v))
-#define WAIT while(minl(0x140) & pCir->chip.alp->waitMsk){};
-#define WAIT_1 while(minl(0x140) & 0x100){};
+#define WAIT while(minb(0x40) & pCir->chip.alp->waitMsk){};
+#define WAIT_1 while(minb(0x40) & 0x1){};
static void AlpSync(ScrnInfoPtr pScrn)
{
@@ -49,7 +55,7 @@ AlpSetupForScreenToScreenCopy(ScrnInfoPtr pScrn, int xdir, int ydir, int rop,
ErrorF("AlpSetupForScreenToScreenCopy xdir=%d ydir=%d rop=%x planemask=%x trans_color=%x\n",
xdir, ydir, rop, planemask, trans_color);
#endif
- moutl(0x10C, (pitch << 16) | pitch);
+ moutl(0x0C, (pitch << 16) | pitch);
}
@@ -76,14 +82,14 @@ AlpSubsequentScreenToScreenCopy(ScrnInfoPtr pScrn, int x1, int y1, int x2,
WAIT;
/* Width / Height */
- moutl(0x108, (hh << 16) | ww);
+ moutl(0x08, (hh << 16) | ww);
/* source */
- moutl(0x114, source & 0x3fffff);
- moutl(0x118, 0x0d0000 | decrement);
+ moutl(0x14, source & 0x3fffff);
+ moutl(0x18, 0x0d0000 | decrement);
/* dest */
write_mem_barrier();
- moutl(0x110, dest & 0x3fffff);
+ moutl(0x10, dest & 0x3fffff);
#ifdef ALP_DEBUG
ErrorF("AlpSubsequentScreenToScreenCopy x1=%d y1=%d x2=%d y2=%d w=%d h=%d\n",
@@ -92,7 +98,7 @@ AlpSubsequentScreenToScreenCopy(ScrnInfoPtr pScrn, int x1, int y1, int x2,
source, dest, ww, hh);
#endif
if (!pCir->chip.alp->autoStart)
- moutl(0x140,0x02);
+ moutb(0x40,0x02);
write_mem_barrier();
}
@@ -111,11 +117,11 @@ AlpSetupForSolidFill(ScrnInfoPtr pScrn, int color, int rop,
color, rop, planemask);
#endif
- moutl(0x104, color & 0xffffff);
+ moutl(0x04, color & 0xffffff);
/* Set dest pitch */
- moutl(0x10C, pitch & 0x1fff);
- moutl(0x118, (0xC0|((pScrn->bitsPerPixel - 8) << 1)) | 0x040d0000);
+ moutl(0x0C, pitch & 0x1fff);
+ moutl(0x18, (0xC0|((pScrn->bitsPerPixel - 8) << 1)) | 0x040d0000);
}
static void
@@ -134,17 +140,17 @@ AlpSubsequentSolidFillRect(ScrnInfoPtr pScrn, int x, int y, int w, int h)
/* Width / Height */
write_mem_barrier();
- moutl(0x108, (hh << 16) | ww);
+ moutl(0x08, (hh << 16) | ww);
#ifdef ALP_DEBUG
ErrorF("AlpSubsequentSolidFillRect x=%d y=%d w=%d h=%d\n",
x, y, w, h);
#endif
/* dest */
- moutl(0x110, (dest & 0x3fffff));
+ moutl(0x10, (dest & 0x3fffff));
if (!pCir->chip.alp->autoStart)
- moutl(0x140,0x02);
+ moutb(0x40,0x02);
write_mem_barrier();
}
@@ -157,7 +163,7 @@ AlpXAAInitMMIO(ScreenPtr pScreen)
XAAInfoRecPtr XAAPtr;
#ifdef ALP_DEBUG
- ErrorF("AlpXAAInit\n");
+ ErrorF("AlpXAAInit mm\n");
#endif
XAAPtr = XAACreateInfoRec();
@@ -174,14 +180,18 @@ AlpXAAInitMMIO(ScreenPtr pScreen)
XAAPtr->Sync = AlpSync;
- moutb(0x3CE, 0x0E); /* enable writes to gr33 */
- moutb(0x3CF, 0x20); /* enable writes to gr33 */
+ if (pCir->Chipset != PCI_CHIP_GD7548)
+ {
+ moutb(0x3CE, 0x0E); /* enable writes to gr33 */
+ moutb(0x3CF, 0x20); /* enable writes to gr33 */
+ }
+
if (pCir->properties & ACCEL_AUTOSTART) {
- moutl(0x140, 0x80); /* enable autostart */
- pCir->chip.alp->waitMsk = 0x1000;
+ moutb(0x40, 0x80); /* enable autostart */
+ pCir->chip.alp->waitMsk = 0x10;
pCir->chip.alp->autoStart = TRUE;
} else {
- pCir->chip.alp->waitMsk = 0x100;
+ pCir->chip.alp->waitMsk = 0x1;
pCir->chip.alp->autoStart = FALSE;
}
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/Imakefile b/xc/programs/Xserver/hw/xfree86/drivers/glint/Imakefile
index a2079af0b..d4978cc14 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/glint/Imakefile
+++ b/xc/programs/Xserver/hw/xfree86/drivers/glint/Imakefile
@@ -1,4 +1,4 @@
-XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/Imakefile,v 1.28 2000/06/12 10:11:37 alanh Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/Imakefile,v 1.29 2000/09/20 00:09:21 keithp Exp $
XCOMM
XCOMM This is an Imakefile for the GLINT driver.
XCOMM
@@ -35,7 +35,8 @@ INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) -I$(SERVERSRC)/Xext \
-I$(XF86SRC)/xf4bpp -I$(SERVERSRC)/include -I$(XINCLUDESRC) \
-I$(XF86SRC)/ddc -I$(XF86SRC)/i2c -I$(EXTINCSRC) $(DRIINCLUDES) \
-I$(XF86SRC)/shadowfb -I$(XF86SRC)/fbdevhw \
- -I$(XTOP)/include -I$(XF86OSSRC)/vbe
+ -I$(XTOP)/include -I$(XF86OSSRC)/vbe \
+ -I$(SERVERSRC)/render
#endif
DEFINES = $(GLX_DEFINES) -DPPC_MMIO_IS_BE
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/README.pm3 b/xc/programs/Xserver/hw/xfree86/drivers/glint/README.pm3
index 2815efcd1..8502a81e8 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/glint/README.pm3
+++ b/xc/programs/Xserver/hw/xfree86/drivers/glint/README.pm3
@@ -1,55 +1,77 @@
-STATUS as of Sat, 10 Jun 2000 13:43:50 +0200.
-
-Known problems :
-
- * Dual head : worked with 4.0a, but got broken in 4.0b
- * Depth 8 with 8bpp : Tested only upto 1280x1024 as my monitor don't support
- higher modes.
- * Depth 15, 16 with 16 bpp : Modes above 1024x768 show a partial overlap
- of the screen on the right.
- * Depth 24 with 32 bpp : left half of the screen is repeated on the
- right half.
- * 2D Accel : only clipping pseudo accel is working.
- * Video overlay : not supported by pm3 yet.
-
-Unaccelerated video modes :
-
- * [OK] Depths 8 is working upto 1280x1024 (didn't test higher modes).
- * [PROBLEM] Depth 15 and 16 are working up to 1024x768 modes. Higher modes
- show a partial overlap of the screen on the right.
- * [PROBLEM] Depth 24, 32 bpp : the screen is repeated in the second half
- * [NEED HELP] Dot clock is 300MHz. I see pm2 is lowering dotclock for
- 24 & 32 bpp. I did the same for now, but don't know if it is the right.
-
-Hardware features :
-
- * [OK] HW cursor & ShadowFb works.
-
-Video Overlay :
-
- * [NOTHING DONE] Video Overlay is untested. nothing has been done here.
-
-2D Accels :
-
- * [NEED MORE WORK] only clipping pseudo accel is enabled, it makes a
- difference in some case, as for example the Gnome logout anim.
- True accels need more work, especially accel engine setup need to be
- done with pm3 values.
-
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/README.pm3,v 1.2 2000/09/19 14:12:31 alanh Exp $ */
+
+STATUS as of Sat, 9 Sep 2000 11:34:31 +0200
+
+Working :
+ * Unaccelerated : Depth 8, 15, 16 and 24 are ok. I tested them upto
+ 1280x1024 only as my monitor don't support higher modes.
+ * HW cursor.
+ * Partial 2D Accels.
+ * ShadowFb works.
+
+Not Working (see below for more detail) :
+ * Dual head : Dual head should work, but there is still a bug in the vga
+ functions mmio vs io issue. When run in dual head mode, the console,
+ altough still there will show no output. Blind typing will work though.
+ Well ctr-alt-del will work and is especially friendly to your partitions.
+ * Full 2D Accels.
+ * Video Overlay.
+ * DRI.
+ * Initialization on non Appian J2000 boards, if not done by the BIOS will
+ cause problems.
+
Dual head :
+
+ * glint_driver.c:2322-2325:
+ The problem is that the usage of mmio functions for vga graphics index &
+ port (GraphicsIndexReg : 0x63ce, GraphicsPort : 0x3cf) corrupts the
+ console font for pm3 and pm2v. Using IO functions for it solve this, but
+ breaks dualheaded as there is no more console ouput then.
+
+2D Accels [WORK IN PROGRESS] :
+
+ * Only little endian is supported right now. Big endian may work also,
+ but i don't have a big endian box to test it on.
+ * Implemented are :
+ - Screen to screen copy.
+ - Solid fills.
+ - Pixmap cache.
+ - Offscreen pixmaps.
+ - Sync.
+ - Clipping.
+ * Screen to screen copy present two problems :
+ - when doing the copy, there are temporary noise around the area getting
+ copied.
+ - when doing very small copies from left to right (as when the window
+ manager is doing opaque moves) there is corruption on the left side of
+ the window. Using ONLY_LEFT_TO_RIGHT_BITBLT solves this. But still, the
+ pm3 should be able to handle this.
+
+Video Overlay [NOTHING DONE YET] :
+
+ * I have not done anything yet here.
+
+DRI/3D Accels [NOTHING DONE YET] :
+
+ * Current Gamma support only works with dualmx boards and the like where
+ the gamma chip is actually doing the rendering, and the rasterizer chip
+ are slaves of the gamma chip.
+
+ * The approach taken by the current pm3 driver is to have each pm3 having
+ its own driver instance. We thus need a setup for sharing the gamma between
+ both pm3. Such a setup was already done for the G400 dual head feature.
+ Need to investigate this.
+
+ * One alternative could be to use the pm3 for 3D Accels, but as the pm3 has
+ only a Delta unit, this is not optimal. However it would be nice for
+ pm3 boards lacking gamma chip, and could maybe be shared with pm2 boards ?
+
+ * Also it could maybe be possible to share the workload between the Gamma
+ and the pm3. Don't know about this though ...
+
+Initialization [NEED TESTING ON NON J2000 BOARD] :
+
+ * Second head of Jeronimo 2000 is not initialized by the bios, So memory
+ timings need to be set. I set them only if subsysVendor & subsysCard are
+ matching J2000. Need feedback of other dual pm3 boards.
- * [NEW PROBLEM] Dual head got broken in 4.0b. Culprit is the pci slot
- claiming code in GLINTProbe, around line 700 of glint_driver.c
- * [OK] Dual head did working fine, just, i didn't know how to make
- enlightenment use both heads (:0.0 and :0.1). 3.3.6 twm has also
- problems with this, should use 4.0 twm instead maybe.
- * [SOLUTION] I need to make a XF86Config with orientation of various screens.
-
- * [NEED TESTING ON NON J2000 BOARD] Second head of Jeronimo 2000 is not
- initialized by the bios, So memory timings need to be set. I set them only
- if subsysVendor & subsysCard are matching J2000. Need feedback of other
- dual pm3 boards.
-
-
-
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/README.pm3,v 1.1 2000/06/13 23:34:38 dawes Exp $ */
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/glint.cpp b/xc/programs/Xserver/hw/xfree86/drivers/glint/glint.cpp
index ed908577c..e96e9e40b 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/glint/glint.cpp
+++ b/xc/programs/Xserver/hw/xfree86/drivers/glint/glint.cpp
@@ -1,4 +1,4 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/glint.cpp,v 1.7 2000/06/14 02:13:09 dawes Exp $
+.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/glint.cpp,v 1.8 2000/09/19 14:12:31 alanh Exp $
.\" shorthand for double quote that works everywhere.
.ds q \N'34'
.TH GLINT __drivermansuffix__ "Version 4.0.1" "XFree86"
@@ -18,9 +18,15 @@ is an XFree86 driver for 3Dlabs & Texas Instruments GLINT/Permedia based video
cards. The driver is rather fully accelerated, and provides support for the
following framebuffer depths: 8, 15 (may give bad results with FBDev support),
16, 24 (32 bpp recommended, 24 bpp has problems), 30, and an 8+24 overlay mode.
-.B Glint permedia 3
-only support depth 8 (tested upto 1280x1024) and 15/16
-(ok upto 1024x768, partial screen overlap on the right at 1280x1024) and acceleration is not yet fully supported.
+For the
+.B Glint Permedia 3
+, the driver supports unaccelerated modes of depth 8 (bpp 8), 15 and 16 (bpp 16)
+and 24 (bppi 32) in single headed mode.
+2D Acceleration is working, but there are some visual artifacts with the
+ScreenToScreenCopy accel.
+Dual head (on the Appian J2000 board) is working, but the console screen will
+get corrupted, blind typing still works though.
+See the README.pm3 file for more details.
.SH SUPPORTED HARDWARE
The
.B glint
@@ -110,17 +116,6 @@ If you have a card of the same name, turn this on. Default: off.
The driver will try to auto-detect the memory clock for all chips. If it's not
detected correctly, the actual value (in MHz) should be specified with this
option.
-.SH Known problems with the Glint Permedia 3 chip
-The
-.B Glint Permedia 3
-chip is newly supported since the 4.0.1 release but is still work in progress.
-The driver supports already unaccelerated modes at depth 8 (tested upto
-1280x1024) and depth 15 and 16 (ok upto 1024x768)
-Depth 24 and Depth 15 and 16 with modes higher than 1024x768 are showing a
-partial overlap of the right part of the screen.
-Acceleration only support clipping pseudo acceleration.
-Dual head for the Appian J2000 board was working but got broken since 4.0b,
-since now the driver claims all chip of the board.
.SH "SEE ALSO"
XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__)
.SH AUTHORS
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/glint.h b/xc/programs/Xserver/hw/xfree86/drivers/glint/glint.h
index 7ead39d60..9da2b8c26 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/glint/glint.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/glint/glint.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/glint.h,v 1.31 2000/06/17 16:32:50 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/glint.h,v 1.34 2000/09/19 19:19:22 eich Exp $ */
/*
* Copyright 1997,1998 by Alan Hourihane <alanh@fairlite.demon.co.uk>
*
@@ -142,6 +142,9 @@ typedef struct {
I2CBusPtr DDCBus, VSBus;
CARD8* XAAScanlineColorExpandBuffers[2];
CARD32 RasterizerSwap;
+ int PM3_Config2D;
+ int PM3_Render2D;
+ int PM3_VideoControl;
#ifdef XF86DRI
Bool directRenderingEnabled;
DRIInfoPtr pDRIInfo;
@@ -211,7 +214,6 @@ int Permedia3MemorySizeDetect(ScrnInfoPtr pScrn);
void Permedia3Restore(ScrnInfoPtr pScrn, GLINTRegPtr glintReg);
void Permedia3Save(ScrnInfoPtr pScrn, GLINTRegPtr glintReg);
Bool Permedia3Init(ScrnInfoPtr pScrn, DisplayModePtr mode);
-Bool Permedia3HWCursorInit(ScreenPtr pScreen);
/* pm3_accel.c */
Bool Permedia3AccelInit(ScreenPtr pScreen);
void Permedia3Sync(ScrnInfoPtr pScrn);
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/glint_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/glint/glint_driver.c
index 4463cb90b..b63dabd90 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/glint/glint_driver.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/glint/glint_driver.c
@@ -28,7 +28,7 @@
* this work is sponsored by S.u.S.E. GmbH, Fuerth, Elsa GmbH, Aachen,
* Siemens Nixdorf Informationssysteme and Appian Graphics.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/glint_driver.c,v 1.91 2000/07/09 21:02:18 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/glint_driver.c,v 1.96 2000/09/19 14:12:31 alanh Exp $ */
#include "fb.h"
#include "cfb8_32.h"
@@ -801,25 +801,25 @@ GLINTProbeTIramdac(ScrnInfoPtr pScrn)
GLINTPtr pGlint;
CARD32 temp = 0;
pGlint = GLINTPTR(pScrn);
+
+ pGlint->RamDacRec = RamDacCreateInfoRec();
if (pGlint->numMXDevices == 2) {
- pGlint->RamDacRec = RamDacCreateInfoRec();
pGlint->RamDacRec->ReadDAC = DUALglintInTIIndReg;
pGlint->RamDacRec->WriteDAC = DUALglintOutTIIndReg;
pGlint->RamDacRec->ReadAddress = DUALglintTIReadAddress;
pGlint->RamDacRec->WriteAddress = DUALglintTIWriteAddress;
pGlint->RamDacRec->ReadData = DUALglintTIReadData;
pGlint->RamDacRec->WriteData = DUALglintTIWriteData;
- pGlint->RamDacRec->LoadPalette = TIramdacLoadPalette;
} else {
- pGlint->RamDacRec = RamDacCreateInfoRec();
pGlint->RamDacRec->ReadDAC = glintInTIIndReg;
pGlint->RamDacRec->WriteDAC = glintOutTIIndReg;
pGlint->RamDacRec->ReadAddress = glintTIReadAddress;
pGlint->RamDacRec->WriteAddress = glintTIWriteAddress;
pGlint->RamDacRec->ReadData = glintTIReadData;
pGlint->RamDacRec->WriteData = glintTIWriteData;
- pGlint->RamDacRec->LoadPalette = TIramdacLoadPalette;
}
+ pGlint->RamDacRec->LoadPalette = TIramdacLoadPalette;
+
if(!RamDacInit(pScrn, pGlint->RamDacRec)) {
RamDacDestroyInfoRec(pGlint->RamDacRec);
return;
@@ -1274,7 +1274,7 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags)
pGlint->irq = pGlint->pEnt->device->irq;
/* Register all entities */
- for (i = 1; i < pScrn->numEntities; i++) {
+ for (i = 0; i < pScrn->numEntities; i++) {
EntityInfoPtr pEnt;
pEnt = xf86GetEntityInfo(pScrn->entityList[i]);
if (xf86RegisterResources(pEnt->index, NULL, ResExclusive)) {
@@ -1431,7 +1431,6 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags)
return FALSE;
}
break;
- case PCI_VENDOR_3DLABS_CHIP_PERMEDIA3:
case PCI_VENDOR_3DLABS_CHIP_PERMEDIA2V:
maxheight = 2048;
maxwidth = 2048;
@@ -1449,6 +1448,23 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags)
return FALSE;
}
break;
+ case PCI_VENDOR_3DLABS_CHIP_PERMEDIA3:
+ maxheight = 4096;
+ maxwidth = 4096;
+ pGlint->RefClock = 14318;
+ pGlint->VGAcore = TRUE;
+ pGlint->RamDacRec = RamDacCreateInfoRec();
+ pGlint->RamDacRec->ReadDAC = Permedia2vInIndReg;
+ pGlint->RamDacRec->WriteDAC = Permedia2vOutIndReg;
+ pGlint->RamDacRec->ReadAddress = Permedia2ReadAddress;
+ pGlint->RamDacRec->WriteAddress = Permedia2WriteAddress;
+ pGlint->RamDacRec->ReadData = Permedia2ReadData;
+ pGlint->RamDacRec->WriteData = Permedia2WriteData;
+ if(!RamDacInit(pScrn, pGlint->RamDacRec)) {
+ RamDacDestroyInfoRec(pGlint->RamDacRec);
+ return FALSE;
+ }
+ break;
case PCI_VENDOR_TI_CHIP_PERMEDIA:
case PCI_VENDOR_3DLABS_CHIP_PERMEDIA:
maxheight = 1024;
@@ -1456,7 +1472,7 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags)
pGlint->VGAcore = TRUE; /* chip has a vga core */
GLINTProbeIBMramdac(pScrn);
if (pGlint->RamDac == NULL) return FALSE;
- if (pGlint->RamDac->RamDacType != (IBM526DB_RAMDAC) ||
+ if (pGlint->RamDac->RamDacType != (IBM526DB_RAMDAC) &&
pGlint->RamDac->RamDacType != (IBM526_RAMDAC))
return FALSE;
pGlint->RefClock = 14318;
@@ -1596,24 +1612,8 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags)
break;
}
}
- if ( (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_PERMEDIA3) ) {
- switch (pScrn->bitsPerPixel) {
- case 8:
- pGlint->MaxClock = 300000;
- break;
- case 16:
- pGlint->MaxClock = 300000;
- break;
- case 24:
- /* Not sure about the 24 & 32 bpp clocks, ... */
- pGlint->MaxClock = 150000;
- break;
- case 32:
- /* Not sure about the 24 & 32 bpp clocks, ... */
- pGlint->MaxClock = 150000;
- break;
- }
- }
+ if (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_PERMEDIA3)
+ pGlint->MaxClock = 300000;
}
xf86DrvMsg(pScrn->scrnIndex, from, "Max pixel clock is %d MHz\n",
pGlint->MaxClock / 1000);
@@ -1638,7 +1638,8 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags)
*/
/* Select valid modes from those available */
- if (pGlint->NoAccel) {
+ if ((pGlint->NoAccel) ||
+ (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_PERMEDIA3)) {
/*
* XXX Assuming min pitch 256, max <maxwidth>
* XXX Assuming min height 128, max <maxheight>
@@ -1745,7 +1746,6 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags)
case PCI_VENDOR_TI_CHIP_PERMEDIA2:
case PCI_VENDOR_3DLABS_CHIP_PERMEDIA2:
case PCI_VENDOR_3DLABS_CHIP_PERMEDIA2V:
- case PCI_VENDOR_3DLABS_CHIP_PERMEDIA3:
case PCI_VENDOR_TI_CHIP_PERMEDIA:
case PCI_VENDOR_3DLABS_CHIP_PERMEDIA:
pGlint->pprod = partprodPermedia[pScrn->displayWidth >> 5];
@@ -2307,9 +2307,23 @@ GLINTScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
return FALSE;
}
/* Timing problem with PM3 & PM2V chips dont like being blasted */
- if ((pGlint->Chipset != PCI_VENDOR_3DLABS_CHIP_PERMEDIA3) &&
- (pGlint->Chipset != PCI_VENDOR_3DLABS_CHIP_PERMEDIA2V))
+ /* This solves the dual head problem but trahses the console font. */
+
+ if (pGlint->Chipset = PCI_VENDOR_3DLABS_CHIP_PERMEDIA3) {
+ /* Graphics Index VGA register don't work in mmio mode
+ * for the Permedia3 chip, it thrashes the console font.
+ * Let's keep the IO functions for this instead ... */
+ vgaHWWriteIndexProcPtr writeGr = hwp->writeGr;
+ vgaHWReadIndexProcPtr readGr = hwp->readGr;
+ vgaHWSetMmioFuncs(hwp, pGlint->IOBaseVGA, 0);
+ hwp->writeGr = writeGr;
+ hwp->readGr = readGr;
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "SVEN : Permedia 3 don't use mmio for VGA Graphics Index.\n");
+ }
+ else if (pGlint->Chipset != PCI_VENDOR_3DLABS_CHIP_PERMEDIA2V)
vgaHWSetMmioFuncs(hwp, pGlint->IOBaseVGA, 0);
+
vgaHWGetIOBase(hwp);
}
@@ -2511,12 +2525,10 @@ GLINTScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
(pGlint->Chipset == PCI_VENDOR_TI_CHIP_PERMEDIA2))
Permedia2HWCursorInit(pScreen);
else
- if (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_PERMEDIA2V)
+ if ((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_PERMEDIA2V) ||
+ (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_PERMEDIA3))
Permedia2vHWCursorInit(pScreen);
else
- if (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_PERMEDIA3)
- Permedia3HWCursorInit(pScreen);
- else
/* If we get here pGlint->Ramdac should have been set */
if ( ((pGlint->RamDac->RamDacType == (IBM526DB_RAMDAC)) ||
(pGlint->RamDac->RamDacType == (IBM526_RAMDAC)) ||
@@ -2683,6 +2695,7 @@ GLINTAdjustFrame(int scrnIndex, int x, int y, int flags)
base = ((y * pScrn->displayWidth + x) >> 1) >> pGlint->BppShift;
if (pScrn->bitsPerPixel == 24) base *= 3;
+ if (pScrn->bitsPerPixel == 32) base *= 4;
switch (pGlint->Chipset)
{
@@ -2728,6 +2741,9 @@ GLINTEnterVT(int scrnIndex, int flags)
Permedia2VideoEnterVT(pScrn);
}
+ if (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_PERMEDIA3)
+ pGlint->PM3_VideoControl = GLINT_READ_REG(PMVideoControl);
+
if (!pGlint->NoAccel) {
switch (pGlint->Chipset) {
case PCI_VENDOR_TI_CHIP_PERMEDIA2:
@@ -2779,6 +2795,12 @@ GLINTLeaveVT(int scrnIndex, int flags)
GLINTRestore(pScrn);
if (pGlint->VGAcore)
vgaHWLock(VGAHWPTR(pScrn));
+
+ if (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_PERMEDIA3)
+ GLINT_SLOW_WRITE_REG(0, PMVideoControl);
+ /* Don't know why the follwong is wrong, should be ok ?
+ GLINT_SLOW_WRITE_REG(pGlint->PM3_VideoControl, PMVideoControl);
+ */
if (xf86IsPc98())
outb(0xfac, 0x00);
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/glint_regs.h b/xc/programs/Xserver/hw/xfree86/drivers/glint/glint_regs.h
index a1c5e5914..8e319152b 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/glint/glint_regs.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/glint/glint_regs.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/glint_regs.h,v 1.19 2000/05/10 20:01:31 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/glint_regs.h,v 1.21 2000/09/19 14:12:32 alanh Exp $ */
/*
* glint register file
@@ -93,10 +93,6 @@
#define SCLK_SEL_MCLK_HALF (3 << 10)
#define ByDMAControl 0x00D8
-/* GLINT R3 & Permedia3 Region 0 Bypass Controls */
-#define PM3ByAperture1Mode 0x0300
-#define PM3ByAperture2Mode 0x0328
-
/* GLINT 500TX LocalBuffer Registers */
#define LBMemoryCtl 0x1000
#define LBNumBanksMask 0x00000001
@@ -199,17 +195,6 @@
#define PMFramebufferWriteMask 0x1140
#define PMCount 0x1180
-/* Permedia 3 & GLINT R3 Memory Control */
-#define PM3MemCounter 0x1000
-#define PM3MemBypassWriteMask 0x1008
-#define PM3MemScratch 0x1010
-#define PM3LocalMemCaps 0x1018
-#define PM3LocalMemTimings 0x1020
-#define PM3LocalMemControl 0x1028
-#define PM3LocalMemRefresh 0x1030
-#define PM3LocalMemPowerDown 0x1038
-#define PM3RemoteMemControl 0x1100
-
/* Framebuffer Registers */
#define FBMemoryCtl 0x1800
#define FBModeSel 0x1808
@@ -494,8 +479,6 @@
#define GMultGLINT1 0x0d10
#define GMultGLINT2 0x0d18
-
-
/************************
* GLINT Core Registers *
************************/
@@ -504,7 +487,7 @@
#define GLINT_TAG_ADDR(major,offset) (0x8000 | GLINT_TAG((major),(offset)))
#define UNIT_DISABLE 0
-#define UNIT_ENABLE 1
+#define UNIT_ENABLE 1
#define StartXDom GLINT_TAG_ADDR(0x00,0x00)
#define dXDom GLINT_TAG_ADDR(0x00,0x01)
@@ -955,9 +938,10 @@
/* 0: */
/* FBWM_NoColorUpload */
/* FBWM_WriteDisable */
-
#define FBWM_WriteEnable 1
#define FBWM_UploadColor 1 << 3
+/* Permedia3 extensions */
+ #define FBWM_Enable0 1 << 12
#define FBHardwareWriteMask GLINT_TAG_ADDR(0x15,0x08)
#define FBBlockColor GLINT_TAG_ADDR(0x15,0x09)
@@ -1152,6 +1136,30 @@
#define RepeatLine GLINT_TAG_ADDR(0x26,0x05)
#define BroadcastMask GLINT_TAG_ADDR(0x26,0x0F)
+/* Permedia 3 - Accelerator Extensions */
+#define FillRectanglePosition 0x8348
+#define FillRender2D 0x8350
+#define FBDstReadBufAddr0 0xAE80
+#define FBDstReadBufOffset0 0xAEA0
+#define FBDstReadBufWidth0 0xAEC0
+#define FBDstReadMode 0xAEE0
+#define FBDRM_Enable0 1<<8
+#define FBDRM_Blocking 1<<24
+#define FBDstReadEnables 0xAEE8
+#define FBSrcReadMode 0xAF00
+#define FBSRM_Blocking 1<<11
+#define FBSrcReadBufAddr 0xAF08
+#define FBSrcReadBufOffset0 0xAF10
+#define FBSrcReadBufWidth 0xAF18
+#define FBWriteBufAddr0 0xB000
+#define FBWriteBufOffset0 0xB020
+#define FBWriteBufWidth0 0xB040
+#define FBBlockColorBack 0xB0A0
+#define ForegroundColor 0xB0C0
+#define BackgroundColor 0xB0C8
+#define RectanglePosition 0xB600
+#define Render2D 0xB640
+
/* Colorformats */
#define BGR555 1
#define BGR565 16
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_accel.c b/xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_accel.c
index 70ae35407..7c512d542 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_accel.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_accel.c
@@ -30,7 +30,7 @@
*
* Permedia 3 accelerated options.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_accel.c,v 1.2 2000/06/14 18:20:34 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_accel.c,v 1.3 2000/09/11 16:58:56 alanh Exp $ */
#include "Xarch.h"
#include "xf86.h"
@@ -161,7 +161,7 @@ Permedia3InitializeEngine(ScrnInfoPtr pScrn)
TRACE_ENTER("Permedia3InitializeEngine");
GLINT_SLOW_WRITE_REG(UNIT_DISABLE, ScissorMode);
- GLINT_SLOW_WRITE_REG(UNIT_ENABLE, FBWriteMode);
+ GLINT_SLOW_WRITE_REG(UNIT_ENABLE | FBWM_Enable0, FBWriteMode);
GLINT_SLOW_WRITE_REG(0, dXSub);
GLINT_SLOW_WRITE_REG(GWIN_DisableLBUpdate, GLINTWindow);
GLINT_SLOW_WRITE_REG(UNIT_DISABLE, DitherMode);
@@ -170,7 +170,6 @@ Permedia3InitializeEngine(ScrnInfoPtr pScrn)
GLINT_SLOW_WRITE_REG(UNIT_DISABLE, TextureColorMode);
GLINT_SLOW_WRITE_REG(UNIT_DISABLE, TextureAddressMode);
GLINT_SLOW_WRITE_REG(UNIT_DISABLE, PMTextureReadMode);
- GLINT_SLOW_WRITE_REG(pGlint->pprod, LBReadMode);
GLINT_SLOW_WRITE_REG(UNIT_DISABLE, AlphaBlendMode);
GLINT_SLOW_WRITE_REG(UNIT_DISABLE, TexelLUTMode);
GLINT_SLOW_WRITE_REG(UNIT_DISABLE, YUVMode);
@@ -250,6 +249,31 @@ Permedia3InitializeEngine(ScrnInfoPtr pScrn)
GLINT_SLOW_WRITE_REG(0, StartY);
GLINT_SLOW_WRITE_REG(0, GLINTCount);
+ GLINT_SLOW_WRITE_REG(1 | 1<<8, 0xAEE0);
+ GLINT_SLOW_WRITE_REG(1, 0xAEE0);
+ GLINT_SLOW_WRITE_REG(pScrn->displayWidth, FBSrcReadBufWidth);
+ GLINT_SLOW_WRITE_REG(pScrn->displayWidth, FBDstReadBufWidth0);
+ GLINT_SLOW_WRITE_REG(pScrn->displayWidth, FBWriteBufWidth0);
+ GLINT_SLOW_WRITE_REG(0, FBSrcReadBufAddr);
+ GLINT_SLOW_WRITE_REG(0, FBDstReadBufAddr0);
+ GLINT_SLOW_WRITE_REG(0, FBWriteBufAddr0);
+ GLINT_SLOW_WRITE_REG(0, FBSrcReadBufOffset0);
+ GLINT_SLOW_WRITE_REG(0, FBDstReadBufOffset0);
+ GLINT_SLOW_WRITE_REG(0, FBWriteBufOffset0);
+ GLINT_SLOW_WRITE_REG(0xff00ffff, FBDstReadEnables);
+
+ switch (pScrn->bitsPerPixel) {
+ case 8:
+ GLINT_SLOW_WRITE_REG(0x2, PixelSize);
+ break;
+ case 16:
+ GLINT_SLOW_WRITE_REG(0x1, PixelSize);
+ break;
+ case 32:
+ GLINT_SLOW_WRITE_REG(0x0, PixelSize);
+ break;
+ }
+
TRACE_EXIT("Permedia3InitializeEngine");
}
@@ -274,16 +298,16 @@ Permedia3AccelInit(ScreenPtr pScreen)
infoPtr->SetClippingRectangle = Permedia3SetClippingRectangle;
infoPtr->DisableClipping = Permedia3DisableClipping;
- infoPtr->ClippingFlags = HARDWARE_CLIP_MONO_8x8_FILL;
+ infoPtr->ClippingFlags = HARDWARE_CLIP_SCREEN_TO_SCREEN_COPY;
+#if 0
infoPtr->SolidFillFlags = 0;
- infoPtr->ScreenToScreenCopyFlags = NO_TRANSPARENCY;
infoPtr->WriteBitmapFlags = 0;
if (pScrn->bitsPerPixel == 24) {
/* SVEN : This should be bad also,
* didn't tested it since 24bpp is broken....
infoPtr->SetupForSolidFill =
- Permedia3SetupForFillRectSolid24bpp;
+ Permedia3SetupFortillRectSolid24bpp;
infoPtr->SubsequentSolidFillRect =
Permedia3SubsequentFillRectSolid24bpp;
*/
@@ -292,7 +316,6 @@ Permedia3AccelInit(ScreenPtr pScreen)
infoPtr->PolySegmentThinSolidFlags = 0;
infoPtr->PolylinesThinSolidFlags = 0;
infoPtr->SetupForSolidLine = Permedia3SetupForSolidLine;
- infoPtr->SubsequentSolidHorVertLine = Permedia3SubsequentHorVertLine;
if (!(pScrn->overlayFlags & OVERLAY_8_32_PLANAR))
{
infoPtr->SubsequentSolidBresenhamLine =
@@ -300,53 +323,30 @@ Permedia3AccelInit(ScreenPtr pScreen)
}
infoPtr->PolySegmentThinSolid = Permedia3PolySegmentThinSolidWrapper;
infoPtr->PolylinesThinSolid = Permedia3PolylinesThinSolidWrapper;
- /* SVEN : This evidently seems to be bad ...
- infoPtr->SetupForSolidFill = Permedia3SetupForFillRectSolid;
- infoPtr->SubsequentSolidFillRect = Permedia3SubsequentFillRectSolid;
- */
}
+ infoPtr->SetupForSolidFill = Permedia3SetupForFillRectSolid;
+ infoPtr->SubsequentSolidFillRect = Permedia3SubsequentFillRectSolid;
+#endif
- if (pScrn->bitsPerPixel >= 24) {
- /* SVEN : This should be bad also,
- * didn't tested it since 24bpp is broken....
- infoPtr->SetupForScreenToScreenCopy =
- Permedia3SetupForScreenToScreenCopy2432bpp;
- infoPtr->SubsequentScreenToScreenCopy =
- Permedia3SubsequentScreenToScreenCopy2432bpp;
- */
- } else {
- /* SVEN : This evidently seems to be bad ...
- infoPtr->SetupForScreenToScreenCopy =
+ infoPtr->ScreenToScreenCopyFlags = NO_TRANSPARENCY;
+ infoPtr->SetupForScreenToScreenCopy =
Permedia3SetupForScreenToScreenCopy;
- infoPtr->SubsequentScreenToScreenCopy =
+ infoPtr->SubsequentScreenToScreenCopy =
Permedia3SubsequentScreenToScreenCopy;
- */
- }
+#if 0
infoPtr->Mono8x8PatternFillFlags =
HARDWARE_PATTERN_PROGRAMMED_ORIGIN |
HARDWARE_PATTERN_PROGRAMMED_BITS |
HARDWARE_PATTERN_SCREEN_ORIGIN;
- if (pScrn->bitsPerPixel == 24) {
- /* SVEN : This should be bad also,
- * didn't tested it since 24bpp is broken....
- infoPtr->SetupForMono8x8PatternFill =
- Permedia3SetupForMono8x8PatternFill24bpp;
- infoPtr->SubsequentMono8x8PatternFillRect =
- Permedia3SubsequentMono8x8PatternFillRect24bpp;
- */
- } else {
- /* SVEN : This evidently seems to be bad ...
- infoPtr->SetupForMono8x8PatternFill =
+ infoPtr->SetupForMono8x8PatternFill =
Permedia3SetupForMono8x8PatternFill;
- infoPtr->SubsequentMono8x8PatternFillRect =
+ infoPtr->SubsequentMono8x8PatternFillRect =
Permedia3SubsequentMono8x8PatternFillRect;
- */
- }
+#endif
-/* Didn't try, but anyway, pm3 uses PCIRetry, but i don't know if
- * it gets declared corectly by glint_driver.c. Need to check this.
+#if 0
if (pGlint->UsePCIRetry) {
infoPtr->CPUToScreenColorExpandFillFlags = SYNC_AFTER_COLOR_EXPAND |
BIT_ORDER_IN_BYTE_LSBFIRST |
@@ -374,11 +374,11 @@ Permedia3AccelInit(ScreenPtr pScreen)
infoPtr->SubsequentColorExpandScanline =
Permedia3SubsequentColorExpandScanline;
}
-*/
+#endif
infoPtr->ColorExpandRange = MAX_FIFO_ENTRIES;
- /* Seems broken also, ...
+#if 0
infoPtr->WriteBitmap = Permedia3WriteBitmap;
if (pScrn->bitsPerPixel == 8)
@@ -387,16 +387,14 @@ Permedia3AccelInit(ScreenPtr pScreen)
if (pScrn->bitsPerPixel == 16)
infoPtr->WritePixmap = Permedia3WritePixmap16bpp;
else
-#if 0
if (pScrn->bitsPerPixel == 24) {
infoPtr->WritePixmap = Permedia3WritePixmap24bpp;
infoPtr->WritePixmapFlags |= NO_PLANEMASK;
}
else
-#endif
if (pScrn->bitsPerPixel == 32)
infoPtr->WritePixmap = Permedia3WritePixmap32bpp;
- */
+#endif
/* Now fixup if we are 24bpp */
if (pScrn->bitsPerPixel == 24) {
@@ -411,10 +409,10 @@ Permedia3AccelInit(ScreenPtr pScreen)
AvailFBArea.x1 = 0;
AvailFBArea.y1 = 0;
AvailFBArea.x2 = pScrn->displayWidth;
- AvailFBArea.y2 = pGlint->FbMapSize / (pScrn->displayWidth *
+ AvailFBArea.y2 = ((pGlint->FbMapSize > 16384*1024) ? 16384*1024 : pGlint->FbMapSize) / (pScrn->displayWidth *
pScrn->bitsPerPixel / 8);
- if (AvailFBArea.y2 > 2047) AvailFBArea.y2 = 2047;
+ if (AvailFBArea.y2 > 4095) AvailFBArea.y2 = 4095;
xf86InitFBManager(pScreen, &AvailFBArea);
@@ -476,50 +474,6 @@ Permedia3DisableClipping(ScrnInfoPtr pScrn)
}
static void
-Permedia3SetupForScreenToScreenCopy2432bpp(ScrnInfoPtr pScrn,
- int xdir, int ydir, int rop,
- unsigned int planemask, int transparency_color)
-{
- GLINTPtr pGlint = GLINTPTR(pScrn);
-
- pGlint->BltScanDirection = 0;
- if (xdir == 1) pGlint->BltScanDirection |= XPositive;
- if (ydir == 1) pGlint->BltScanDirection |= YPositive;
-
- if (pScrn->bitsPerPixel == 24) {
- GLINT_WAIT(4);
- } else {
- GLINT_WAIT(5);
- DO_PLANEMASK(planemask);
- }
-
- GLINT_WRITE_REG(UNIT_DISABLE, ColorDDAMode);
- if ((rop == GXset) || (rop == GXclear)) {
- GLINT_WRITE_REG(pGlint->pprod, FBReadMode);
- } else {
- if ((rop == GXcopy) || (rop == GXcopyInverted)) {
- GLINT_WRITE_REG(pGlint->pprod|FBRM_SrcEnable, FBReadMode);
- } else {
- GLINT_WRITE_REG(pGlint->pprod|FBRM_SrcEnable|FBRM_DstEnable,
- FBReadMode);
- }
- }
- LOADROP(rop);
-}
-
-static void
-Permedia3SubsequentScreenToScreenCopy2432bpp(ScrnInfoPtr pScrn, int x1,
- int y1, int x2, int y2, int w, int h)
-{
- GLINTPtr pGlint = GLINTPTR(pScrn);
-
- GLINT_WAIT(4);
- Permedia3LoadCoord(pScrn, x2, y2, w, h);
- GLINT_WRITE_REG(((y1-y2)&0x0FFF)<<16 | ((x1-x2)&0x0FFF), FBSourceDelta);
- GLINT_WRITE_REG(PrimitiveRectangle | pGlint->BltScanDirection, Render);
-}
-
-static void
Permedia3SetupForScreenToScreenCopy(ScrnInfoPtr pScrn,
int xdir, int ydir, int rop,
unsigned int planemask, int transparency_color)
@@ -528,23 +482,20 @@ Permedia3SetupForScreenToScreenCopy(ScrnInfoPtr pScrn,
TRACE_ENTER("Permedia3SetupForScreenToScreenCopy");
pGlint->BltScanDirection = 0;
- if (xdir == 1) pGlint->BltScanDirection |= XPositive;
- if (ydir == 1) pGlint->BltScanDirection |= YPositive;
+ if (xdir == 1) pGlint->BltScanDirection |= 1<<28;
+ if (ydir == 1) pGlint->BltScanDirection |= 1<<29;
- GLINT_WAIT(4);
+ GLINT_WAIT(5);
DO_PLANEMASK(planemask);
GLINT_WRITE_REG(UNIT_DISABLE, ColorDDAMode);
- if ((rop == GXset) || (rop == GXclear)) {
- pGlint->FrameBufferReadMode = pGlint->pprod;
- } else
+ GLINT_WRITE_REG(UNIT_ENABLE /*| FBSRM_Blocking*/, FBSrcReadMode);
if ((rop == GXcopy) || (rop == GXcopyInverted)) {
- pGlint->FrameBufferReadMode = pGlint->pprod |FBRM_SrcEnable;
+ GLINT_WRITE_REG(UNIT_DISABLE, FBDstReadMode);
} else {
- pGlint->FrameBufferReadMode = pGlint->pprod | FBRM_SrcEnable |
- FBRM_DstEnable;
+ GLINT_WRITE_REG(UNIT_ENABLE | FBDRM_Enable0 /*| FBDRM_Blocking*/, FBDstReadMode);
}
- LOADROP(rop);
+ GLINT_WRITE_REG(rop<<1|1, LogicalOpMode);
TRACE_EXIT("Permedia3SetupForScreenToScreenCopy");
}
@@ -553,27 +504,13 @@ Permedia3SubsequentScreenToScreenCopy(ScrnInfoPtr pScrn, int x1, int y1,
int x2, int y2, int w, int h)
{
GLINTPtr pGlint = GLINTPTR(pScrn);
- char align;
TRACE_ENTER("Permedia3SubsequentScreenToScreenCopy");
- /* We can only use GXcopy for Packed modes */
- if (pGlint->ROP != GXcopy) {
- GLINT_WAIT(5);
- GLINT_WRITE_REG(pGlint->FrameBufferReadMode, FBReadMode);
- Permedia3LoadCoord(pScrn, x2, y2, w, h);
- GLINT_WRITE_REG(((y1-y2)&0x0FFF)<<16 | ((x1-x2)&0x0FFF), FBSourceDelta);
- } else {
- align = (x2 & pGlint->bppalign) - (x1 & pGlint->bppalign);
- GLINT_WAIT(6);
- GLINT_WRITE_REG(pGlint->FrameBufferReadMode|FBRM_Packed, FBReadMode);
- Permedia3LoadCoord(pScrn, x2>>pGlint->BppShift, y2,
- (w+7)>>pGlint->BppShift, h);
- GLINT_WRITE_REG(align<<29|x2<<16|(x2+w), PackedDataLimits);
- GLINT_WRITE_REG(((y1-y2)&0x0FFF)<<16 | (((x1 & ~pGlint->bppalign)-(x2 & ~pGlint->bppalign))&0x0FFF), FBSourceDelta);
- }
- GLINT_WRITE_REG(PrimitiveRectangle | pGlint->BltScanDirection, Render);
- TRACE_EXIT("Permedia3SubsequentScreenToScreenCopy");
+ GLINT_WAIT(3);
+ GLINT_WRITE_REG(y2<<16 | x2, RectanglePosition);
+ GLINT_WRITE_REG((y1-y2)<<16 | (x1-x2) & 0xffff, FBSrcReadBufOffset0);
+ GLINT_WRITE_REG(w | 3<<14| h<<16 | pGlint->BltScanDirection, Render2D);
}
@@ -627,26 +564,6 @@ Permedia3SetupForSolidLine(ScrnInfoPtr pScrn, int color,
LOADROP(rop);
}
-static void
-Permedia3SubsequentHorVertLine(ScrnInfoPtr pScrn,int x,int y,int len,int dir)
-{
- GLINTPtr pGlint = GLINTPTR(pScrn);
-
- GLINT_WAIT(6);
- GLINT_WRITE_REG(x<<16, StartXDom);
- GLINT_WRITE_REG(y<<16, StartY);
- if (dir == DEGREES_0) {
- GLINT_WRITE_REG(1<<16, dXDom);
- GLINT_WRITE_REG(0<<16, dY);
- } else {
- GLINT_WRITE_REG(0<<16, dXDom);
- GLINT_WRITE_REG(1<<16, dY);
- }
-
- GLINT_WRITE_REG(len, GLINTCount);
- GLINT_WRITE_REG(PrimitiveLine, Render);
-}
-
static void
Permedia3SubsequentSolidBresenhamLine( ScrnInfoPtr pScrn,
int x, int y, int dmaj, int dmin, int e, int len, int octant)
@@ -682,24 +599,6 @@ Permedia3SubsequentSolidBresenhamLine( ScrnInfoPtr pScrn,
}
static void
-Permedia3SetupForFillRectSolid24bpp(ScrnInfoPtr pScrn, int color,
- int rop, unsigned int planemask)
-{
- GLINTPtr pGlint = GLINTPTR(pScrn);
- pGlint->ForeGroundColor = color;
-
- GLINT_WAIT(5);
- GLINT_WRITE_REG(UNIT_ENABLE, ColorDDAMode);
- GLINT_WRITE_REG(color, ConstantColor);
- if (rop == GXcopy) {
- GLINT_WRITE_REG(pGlint->pprod, FBReadMode);
- } else {
- GLINT_WRITE_REG(pGlint->pprod | FBRM_DstEnable, FBReadMode);
- }
- LOADROP(rop);
-}
-
-static void
Permedia3SetupForFillRectSolid(ScrnInfoPtr pScrn, int color,
int rop, unsigned int planemask)
{
@@ -707,51 +606,27 @@ Permedia3SetupForFillRectSolid(ScrnInfoPtr pScrn, int color,
TRACE_ENTER("Permedia3SetupForFillRectSolid");
REPLICATE(color);
-
- GLINT_WAIT(6);
+ GLINT_WAIT(4);
DO_PLANEMASK(planemask);
- if (rop == GXcopy) {
- GLINT_WRITE_REG(UNIT_DISABLE, ColorDDAMode);
- GLINT_WRITE_REG(pGlint->pprod, FBReadMode);
- GLINT_WRITE_REG(color, FBBlockColor);
+ GLINT_WRITE_REG(color, FBBlockColor);
+ if ((rop == GXcopy) || (rop == GXcopyInverted)) {
+ GLINT_WRITE_REG(UNIT_DISABLE, FBDstReadMode);
} else {
- GLINT_WRITE_REG(UNIT_ENABLE, ColorDDAMode);
- GLINT_WRITE_REG(color, ConstantColor);
- /* We can use Packed mode for filling solid non-GXcopy rasters */
- GLINT_WRITE_REG(pGlint->pprod|FBRM_DstEnable|FBRM_Packed, FBReadMode);
+ GLINT_WRITE_REG(UNIT_ENABLE | FBDRM_Enable0 /*| FBDRM_Blocking*/, FBDstReadMode);
}
- LOADROP(rop);
+ GLINT_WRITE_REG(rop<<1| 1, LogicalOpMode);
TRACE_EXIT("Permedia3SetupForFillRectSolid");
}
static void
-Permedia3SubsequentFillRectSolid24bpp(ScrnInfoPtr pScrn, int x, int y, int w, int h)
-{
- GLINTPtr pGlint = GLINTPTR(pScrn);
- GLINT_WAIT(3);
- Permedia3LoadCoord(pScrn, x, y, w, h);
- GLINT_WRITE_REG(PrimitiveRectangle | XPositive | YPositive, Render);
-}
-
-static void
Permedia3SubsequentFillRectSolid(ScrnInfoPtr pScrn, int x, int y, int w, int h)
{
GLINTPtr pGlint = GLINTPTR(pScrn);
- int speed = 0;
TRACE_ENTER("Permedia3SubsequentFillRectSolid");
- if (pGlint->ROP == GXcopy) {
- GLINT_WAIT(3);
- Permedia3LoadCoord(pScrn, x, y, w, h);
- speed = FastFillEnable;
- } else {
- GLINT_WAIT(4);
- Permedia3LoadCoord(pScrn, x>>pGlint->BppShift, y,
- (w+7)>>pGlint->BppShift, h);
- GLINT_WRITE_REG(x<<16|(x+w), PackedDataLimits);
- speed = 0;
- }
- GLINT_WRITE_REG(PrimitiveRectangle | XPositive | YPositive | speed, Render);
+ GLINT_WAIT(3);
+ GLINT_WRITE_REG(y<<16 | x, RectanglePosition);
+ GLINT_WRITE_REG(w | 3<<28 | h<<16, Render2D);
TRACE_EXIT("Permedia3SubsequentFillRectSolid");
}
@@ -811,42 +686,6 @@ static void MoveDWORDS(
*(dest + 2) = *(src + 2);
}
-
-static void
-Permedia3SetupForMono8x8PatternFill24bpp(ScrnInfoPtr pScrn,
- int patternx, int patterny,
- int fg, int bg, int rop,
- unsigned int planemask)
-{
- GLINTPtr pGlint = GLINTPTR(pScrn);
-
- if (bg == -1) pGlint->FrameBufferReadMode = -1;
- else pGlint->FrameBufferReadMode = 0;
-
- pGlint->ForeGroundColor = fg;
- pGlint->BackGroundColor = bg;
- REPLICATE(pGlint->ForeGroundColor);
- REPLICATE(pGlint->BackGroundColor);
-
- GLINT_WAIT(12);
- GLINT_WRITE_REG((patternx & 0xFF), AreaStipplePattern0);
- GLINT_WRITE_REG((patternx & 0xFF00) >> 8, AreaStipplePattern1);
- GLINT_WRITE_REG((patternx & 0xFF0000) >> 16, AreaStipplePattern2);
- GLINT_WRITE_REG((patternx & 0xFF000000) >> 24, AreaStipplePattern3);
- GLINT_WRITE_REG((patterny & 0xFF), AreaStipplePattern4);
- GLINT_WRITE_REG((patterny & 0xFF00) >> 8, AreaStipplePattern5);
- GLINT_WRITE_REG((patterny & 0xFF0000) >> 16, AreaStipplePattern6);
- GLINT_WRITE_REG((patterny & 0xFF000000) >> 24, AreaStipplePattern7);
-
- GLINT_WRITE_REG(UNIT_ENABLE, ColorDDAMode);
- if (rop == GXcopy) {
- GLINT_WRITE_REG(pGlint->pprod, FBReadMode);
- } else {
- GLINT_WRITE_REG(pGlint->pprod | FBRM_DstEnable, FBReadMode);
- }
- LOADROP(rop);
-}
-
static void
Permedia3SetupForMono8x8PatternFill(ScrnInfoPtr pScrn,
int patternx, int patterny,
@@ -856,19 +695,16 @@ Permedia3SetupForMono8x8PatternFill(ScrnInfoPtr pScrn,
GLINTPtr pGlint = GLINTPTR(pScrn);
TRACE_ENTER("Permedia3SetupForMono8x8PatternFill");
- if (bg == -1) pGlint->FrameBufferReadMode = -1;
- else pGlint->FrameBufferReadMode = 0;
+ GLINT_WAIT(14);
- pGlint->ForeGroundColor = fg;
- pGlint->BackGroundColor = bg;
- REPLICATE(pGlint->ForeGroundColor);
- REPLICATE(pGlint->BackGroundColor);
-
-#if DEBUG
- ErrorF("patternx: %x patterny: %x\n", patternx, patterny);
-#endif
+ GLINT_WRITE_REG(fg, ForegroundColor);
+ pGlint->FrameBufferReadMode = 0;
+
+ if (bg != -1) {
+ GLINT_WRITE_REG(bg, BackgroundColor);
+ pGlint->FrameBufferReadMode = 1<<20;
+ }
- GLINT_WAIT(13);
DO_PLANEMASK(planemask);
GLINT_WRITE_REG((patternx & 0xFF), AreaStipplePattern0);
GLINT_WRITE_REG((patternx & 0xFF00) >> 8, AreaStipplePattern1);
@@ -879,40 +715,14 @@ Permedia3SetupForMono8x8PatternFill(ScrnInfoPtr pScrn,
GLINT_WRITE_REG((patterny & 0xFF0000) >> 16, AreaStipplePattern6);
GLINT_WRITE_REG((patterny & 0xFF000000) >> 24, AreaStipplePattern7);
- if (rop == GXcopy) {
- GLINT_WRITE_REG(UNIT_DISABLE, ColorDDAMode);
- GLINT_WRITE_REG(pGlint->pprod, FBReadMode);
+ if ((rop == GXcopy) || (rop == GXcopyInverted)) {
+ GLINT_WRITE_REG(UNIT_DISABLE, FBDstReadMode);
} else {
- GLINT_WRITE_REG(UNIT_ENABLE, ColorDDAMode);
- GLINT_WRITE_REG(pGlint->pprod | FBRM_DstEnable, FBReadMode);
- }
- LOADROP(rop);
- TRACE_EXIT("Permedia3SetupForMono8x8PatternFill");
-}
-
-static void
-Permedia3SubsequentMono8x8PatternFillRect24bpp(ScrnInfoPtr pScrn,
- int patternx, int patterny,
- int x, int y,
- int w, int h)
-{
- GLINTPtr pGlint = GLINTPTR(pScrn);
-
- GLINT_WAIT(8);
- Permedia3LoadCoord(pScrn, x, y, w, h);
-
- if (pGlint->FrameBufferReadMode != -1) {
- GLINT_WRITE_REG(pGlint->BackGroundColor, ConstantColor);
- GLINT_WRITE_REG(patternx<<7|patterny<<12| ASM_InvertPattern |
- STIPPLE_SWAP | UNIT_ENABLE, AreaStippleMode);
- GLINT_WRITE_REG(AreaStippleEnable | XPositive |
- YPositive | PrimitiveRectangle, Render);
+ GLINT_WRITE_REG(UNIT_ENABLE | FBDRM_Enable0 /*| FBDRM_Blocking*/, FBDstReadMode);
}
- GLINT_WRITE_REG(pGlint->ForeGroundColor, ConstantColor);
- GLINT_WRITE_REG(patternx<<7|patterny<<12|UNIT_ENABLE, AreaStippleMode);
- GLINT_WRITE_REG(AreaStippleEnable | XPositive | YPositive |
- PrimitiveRectangle, Render);
+ GLINT_WRITE_REG(rop<<1 | 1, LogicalOpMode);
+ TRACE_EXIT("Permedia3SetupForMono8x8PatternFill");
}
static void
@@ -924,38 +734,11 @@ Permedia3SubsequentMono8x8PatternFillRect(ScrnInfoPtr pScrn,
GLINTPtr pGlint = GLINTPTR(pScrn);
TRACE_ENTER("Permedia3SubsequentMono8x8PatternFillRect()");
-
- GLINT_WAIT(9);
- Permedia3LoadCoord(pScrn, x, y, w, h);
-
- if (pGlint->FrameBufferReadMode != -1) {
- if (pGlint->ROP == GXcopy) {
- GLINT_WRITE_REG(pGlint->BackGroundColor, FBBlockColor);
- GLINT_WRITE_REG(ASM_InvertPattern|patternx<<7|patterny<<12|
- STIPPLE_SWAP | UNIT_ENABLE, AreaStippleMode);
- GLINT_WRITE_REG(AreaStippleEnable | FastFillEnable |
- XPositive | YPositive | PrimitiveRectangle, Render);
- } else {
- GLINT_WRITE_REG(pGlint->ForeGroundColor, ConstantColor);
- GLINT_WRITE_REG(pGlint->BackGroundColor, Texel0);
- GLINT_WRITE_REG(patternx<<7|patterny<<12|
- STIPPLE_SWAP | UNIT_ENABLE, AreaStippleMode);
- GLINT_WRITE_REG(AreaStippleEnable | XPositive | TextureEnable |
- YPositive | PrimitiveRectangle, Render);
- return;
- }
- }
- if (pGlint->ROP == GXcopy) {
- GLINT_WRITE_REG(pGlint->ForeGroundColor, FBBlockColor);
- pGlint->FrameBufferReadMode = FastFillEnable;
- } else {
- GLINT_WRITE_REG(pGlint->ForeGroundColor, ConstantColor);
- pGlint->FrameBufferReadMode = 0;
- }
- GLINT_WRITE_REG(patternx<<7|patterny<<12|STIPPLE_SWAP|UNIT_ENABLE, AreaStippleMode);
- GLINT_WRITE_REG(AreaStippleEnable | pGlint->FrameBufferReadMode |
- XPositive | YPositive | PrimitiveRectangle, Render);
+ GLINT_WAIT(4);
+ GLINT_WRITE_REG(pGlint->FrameBufferReadMode|patternx<<7|patterny<<12|2<<1|2<<4|STIPPLE_SWAP|UNIT_ENABLE, AreaStippleMode);
+ GLINT_WRITE_REG(y<<16 | x, RectanglePosition);
+ GLINT_WRITE_REG(w | 1<<30 | 3<<28 |h<<16, Render2D);
TRACE_EXIT("Permedia3SubsequentMono8x8PatternFillRect()");
}
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_dac.c b/xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_dac.c
index f92c9bdd6..37ee0059f 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_dac.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_dac.c
@@ -19,7 +19,9 @@
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*
- * Authors: Sven Luther, <luther@dpt-info.u-strasbg.fr>
+ * Authors: Sven Luther, <luther@dpt-info.u-strasbg.fr>
+ * Thomas Witzel, <twitzel@nmr.mgh.harvard.edu>
+ *
*
*
*
@@ -27,7 +29,7 @@
* this work is sponsored by Appian Graphics.
*
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_dac.c,v 1.4 2000/07/09 21:02:21 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_dac.c,v 1.6 2000/09/19 14:12:32 alanh Exp $ */
#include "xf86.h"
#include "xf86_OSproc.h"
@@ -37,6 +39,7 @@
#include "xf86Pci.h"
#include "glint_regs.h"
+#include "pm3_regs.h"
#include "glint.h"
#define DEBUG 0
@@ -65,18 +68,16 @@ Permedia3PreInit(ScrnInfoPtr pScrn, GLINTPtr pGlint)
* This is needed for the second head which is left unitilialized
* by the bios, thus freezing the machine.
*/
- GLINT_SLOW_WRITE_REG(0xffffffff, PM3MemBypassWriteMask);
GLINT_SLOW_WRITE_REG(0x02e311B8, PM3LocalMemCaps);
GLINT_SLOW_WRITE_REG(0x07424905, PM3LocalMemTimings);
GLINT_SLOW_WRITE_REG(0x0c000003, PM3LocalMemControl);
- GLINT_SLOW_WRITE_REG(0x00000069, PM3LocalMemRefresh);
- }
- else {
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "Unknown Glint Permedia3 board detected.\n\t"
- "subsysVendor = 0x%04x, subsysCard = 0x%04x.\n",
- pGlint->PciInfo->subsysVendor, pGlint->PciInfo->subsysCard);
+ GLINT_SLOW_WRITE_REG(0x00000061, PM3LocalMemRefresh);
+ GLINT_SLOW_WRITE_REG(0x00000000, PM3LocalMemPowerDown);
}
+ else xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "Unknown Glint Permedia3 board detected.\n\t"
+ "subsysVendor = 0x%04x, subsysCard = 0x%04x.\n",
+ pGlint->PciInfo->subsysVendor, pGlint->PciInfo->subsysCard);
TRACE_EXIT("Permedia3PreInit");
}
@@ -197,13 +198,10 @@ PM3DAC_CalculateClock
for (f=1;f<256;f++) {
for (pre=1;pre<256;pre++) {
for (post=0;post<5;post++) {
- /* P3Lib multiplies it by two here lets try it alsos
- * Didn't work at all, don't know why, ...
- */
- freq = ((2*refclock * f) / (pre * (1 << post)));
+ freq = ((2* refclock * f) / (pre * (1 << post)));
if ((reqclock > freq - freqerr)&&(reqclock < freq + freqerr)){
freqerr = (reqclock > freq) ?
- reqclock - freq : freq - reqclock;
+ reqclock - freq : freq - reqclock;
*feedback = f;
*prescale = pre;
*postscale = post;
@@ -212,6 +210,7 @@ PM3DAC_CalculateClock
}
}
}
+
return(actualclock);
}
@@ -228,16 +227,17 @@ Permedia3Init(ScrnInfoPtr pScrn, DisplayModePtr mode)
*/
if ((pGlint->PciInfo->subsysVendor == 0x1097) &&
(pGlint->PciInfo->subsysCard == 0x3d32)) {
- pReg->glintRegs[PM3MemBypassWriteMask >> 3] = 0xffffffff;
pReg->glintRegs[PM3LocalMemCaps >> 3] = 0x02e311B8;
pReg->glintRegs[PM3LocalMemTimings >> 3] = 0x07424905;
pReg->glintRegs[PM3LocalMemControl >> 3] = 0x0c000003;
- pReg->glintRegs[PM3LocalMemRefresh >> 3] = 0x00000069;
- pReg->glintRegs[PM3LocalMemPowerDown >> 3] = 0x00000000;
- pReg->glintRegs[PM3ByAperture1Mode >> 3] = 0x00000000;
- pReg->glintRegs[PM3ByAperture2Mode >> 3] = 0x00000000;
+ pReg->glintRegs[PM3LocalMemRefresh >> 3] = 0x00000061;
}
+ pReg->glintRegs[PM3LocalMemPowerDown >> 3] = 0x00000000;
+ pReg->glintRegs[PM3MemBypassWriteMask >> 3] = 0xffffffff;
+ pReg->glintRegs[PM3ByAperture1Mode >> 3] = 0x00000000;
+ pReg->glintRegs[PM3ByAperture2Mode >> 3] = 0x00000000;
+
pReg->glintRegs[Aperture0 >> 3] = 0;
pReg->glintRegs[Aperture1 >> 3] = 0;
@@ -276,8 +276,34 @@ Permedia3Init(ScrnInfoPtr pScrn, DisplayModePtr mode)
/* The hw cursor needs /VSYNC to recognize vert retrace. We'll stick
both sync lines to active high here and if needed invert them
using the RAMDAC's RDSyncControl below. */
- pReg->glintRegs[PMVideoControl >> 3] =
- (1 << 5) | (1 << 3) | 1;
+ /* We need to set the pixelsize (bit 19 & 20) also ... */
+ switch (pScrn->bitsPerPixel)
+ {
+ case 8:
+ pReg->glintRegs[PM3ByAperture1Mode >> 3] =
+ PM3ByApertureMode_PIXELSIZE_8BIT;
+ pReg->glintRegs[PM3ByAperture2Mode >> 3] =
+ PM3ByApertureMode_PIXELSIZE_8BIT;
+ pReg->glintRegs[PMVideoControl >> 3] =
+ 1 | (1 << 3) | (1 << 5) | (0 << 19);
+ break;
+ case 16:
+ pReg->glintRegs[PM3ByAperture1Mode >> 3] =
+ PM3ByApertureMode_PIXELSIZE_16BIT;
+ pReg->glintRegs[PM3ByAperture2Mode >> 3] =
+ PM3ByApertureMode_PIXELSIZE_16BIT;
+ pReg->glintRegs[PMVideoControl >> 3] =
+ 1 | (1 << 3) | (1 << 5) | (1 << 19);
+ break;
+ case 32:
+ pReg->glintRegs[PM3ByAperture1Mode >> 3] =
+ PM3ByApertureMode_PIXELSIZE_32BIT;
+ pReg->glintRegs[PM3ByAperture2Mode >> 3] =
+ PM3ByApertureMode_PIXELSIZE_32BIT;
+ pReg->glintRegs[PMVideoControl >> 3] =
+ 1 | (1 << 3) | (1 << 5) | (2 << 19);
+ break;
+ }
pReg->glintRegs[VClkCtl >> 3] = (GLINT_READ_REG(VClkCtl) & 0xFFFFFFFC);
pReg->glintRegs[PMScreenBase >> 3] = 0;
@@ -290,11 +316,31 @@ Permedia3Init(ScrnInfoPtr pScrn, DisplayModePtr mode)
unsigned char m,n,p;
unsigned long clockused;
- clockused = PM3DAC_CalculateClock(mode->Clock,pGlint->RefClock,
- &m,&n,&p);
- pReg->DacRegs[PM2VDACRDDClk0PreScale] = m;
- pReg->DacRegs[PM2VDACRDDClk0FeedbackScale] = n;
- pReg->DacRegs[PM2VDACRDDClk0PostScale] = p;
+ /* Let's program the KClk to 100Mhz and set the S & M Clk too. */
+/* clockused = PM3DAC_CalculateClock(100000,
+ pGlint->RefClock, &m,&n,&p);
+ pReg->DacRegs[PM3RD_KClkPreScale] = m;
+ pReg->DacRegs[PM3RD_KClkFeedbackScale] = n;
+ pReg->DacRegs[PM3RD_KClkPostScale] = p;
+ pReg->DacRegs[PM3RD_KClkControl] =
+ PM3RD_KClkControl_STATE_RUN |
+ PM3RD_KClkControl_SOURCE_PLL |
+ PM3RD_KClkControl_ENABLE;
+ pReg->DacRegs[PM3RD_MClkControl] =
+ PM3RD_MClkControl_STATE_RUN |
+ PM3RD_MClkControl_SOURCE_KCLK |
+ PM3RD_MClkControl_ENABLE;
+ pReg->DacRegs[PM3RD_SClkControl] =
+ PM3RD_SClkControl_STATE_RUN |
+ PM3RD_SClkControl_SOURCE_HALF_KCLK |
+ PM3RD_SClkControl_ENABLE;
+*/
+ /* Let's program the dot clock */
+ clockused = PM3DAC_CalculateClock(mode->Clock,
+ pGlint->RefClock, &m,&n,&p);
+ pReg->DacRegs[PM3RD_DClk0PreScale] = m;
+ pReg->DacRegs[PM3RD_DClk0FeedbackScale] = n;
+ pReg->DacRegs[PM3RD_DClk0PostScale] = p;
}
pReg->DacRegs[PM2VDACRDIndexControl] = 0x00;
@@ -317,7 +363,6 @@ Permedia3Init(ScrnInfoPtr pScrn, DisplayModePtr mode)
pReg->DacRegs[PM2VDACRDColorFormat] = 0x2E;
break;
case 16:
- pReg->DacRegs[PM2VDACRDMiscControl] |= 0x08;
pReg->DacRegs[PM2VDACRDPixelSize] = 0x01;
if (pScrn->depth == 15)
pReg->DacRegs[PM2VDACRDColorFormat] = 0x61;
@@ -325,17 +370,15 @@ Permedia3Init(ScrnInfoPtr pScrn, DisplayModePtr mode)
pReg->DacRegs[PM2VDACRDColorFormat] = 0x70;
break;
case 24:
- pReg->DacRegs[PM2VDACRDMiscControl] |= 0x08;
pReg->DacRegs[PM2VDACRDPixelSize] = 0x04;
pReg->DacRegs[PM2VDACRDColorFormat] = 0x60;
break;
case 32:
- pReg->DacRegs[PM2VDACRDMiscControl] |= 0x08;
pReg->DacRegs[PM2VDACRDPixelSize] = 0x02;
pReg->DacRegs[PM2VDACRDColorFormat] = 0x20;
if (pScrn->overlayFlags & OVERLAY_8_32_PLANAR) {
pReg->DacRegs[PM2VDACRDMiscControl] |= 0x10;
- pReg->DacRegs[PM2VDACRDOverlayKey] = 0xFF;
+ pReg->DacRegs[PM2VDACRDOverlayKey] = pScrn->colorKey;
}
break;
}
@@ -410,6 +453,20 @@ Permedia3Save(ScrnInfoPtr pScrn, GLINTRegPtr glintReg)
glintReg->DacRegs[PM2VDACRDDClk0PreScale] = Permedia2vInIndReg(pScrn, PM2VDACRDDClk0PreScale);
glintReg->DacRegs[PM2VDACRDDClk0FeedbackScale] = Permedia2vInIndReg(pScrn, PM2VDACRDDClk0FeedbackScale);
glintReg->DacRegs[PM2VDACRDDClk0PostScale] = Permedia2vInIndReg(pScrn, PM2VDACRDDClk0PostScale);
+ /* save KClk, MClk and SClk settings */
+ /* glintReg->DacRegs[PM3RD_KClkControl] =
+ Permedia2vInIndReg(pScrn,PM3RD_KClkControl);
+ glintReg->DacRegs[PM3RD_MClkControl] =
+ Permedia2vInIndReg(pScrn,PM3RD_MClkControl);
+ glintReg->DacRegs[PM3RD_SClkControl] =
+ Permedia2vInIndReg(pScrn,PM3RD_SClkControl);
+ glintReg->DacRegs[PM3RD_KClkPreScale] =
+ Permedia2vInIndReg(pScrn,PM3RD_KClkPreScale);
+ glintReg->DacRegs[PM3RD_KClkFeedbackScale] =
+ Permedia2vInIndReg(pScrn,PM3RD_KClkFeedbackScale);
+ glintReg->DacRegs[PM3RD_KClkPostScale] =
+ Permedia2vInIndReg(pScrn,PM3RD_KClkPostScale);
+*/
}
void
@@ -487,113 +544,25 @@ Permedia3Restore(ScrnInfoPtr pScrn, GLINTRegPtr glintReg)
temp = Permedia2vInIndReg(pScrn, PM2VDACIndexClockControl) & 0xFC;
Permedia2vOutIndReg(pScrn, PM2VDACRDDClk0PreScale, 0x00,
- glintReg->DacRegs[PM2VDACRDDClk0PreScale]);
+ glintReg->DacRegs[PM2VDACRDDClk0PreScale]);
Permedia2vOutIndReg(pScrn, PM2VDACRDDClk0FeedbackScale, 0x00,
- glintReg->DacRegs[PM2VDACRDDClk0FeedbackScale]);
+ glintReg->DacRegs[PM2VDACRDDClk0FeedbackScale]);
Permedia2vOutIndReg(pScrn, PM2VDACRDDClk0PostScale, 0x00,
- glintReg->DacRegs[PM2VDACRDDClk0PostScale]);
+ glintReg->DacRegs[PM2VDACRDDClk0PostScale]);
Permedia2vOutIndReg(pScrn, PM2VDACIndexClockControl, 0x00, temp|0x03);
-}
-
-static void
-Permedia3ShowCursor(ScrnInfoPtr pScrn)
-{
- /* Enable cursor - X11 mode */
- Permedia2vOutIndReg(pScrn, PM2VDACRDCursorMode, 0x00, 0x11);
-}
-
-static void
-Permedia3HideCursor(ScrnInfoPtr pScrn)
-{
- /* Disable cursor - X11 mode */
- Permedia2vOutIndReg(pScrn, PM2VDACRDCursorMode, 0x00, 0x10);
-}
-
-static void
-Permedia3LoadCursorImage(
- ScrnInfoPtr pScrn,
- unsigned char *src
-)
-{
- int i;
-
- for (i=0; i<1024; i++)
- Permedia2vOutIndReg(pScrn, PM2VDACRDCursorPattern+i, 0x00, *(src++));
-}
-
-static void
-Permedia3SetCursorPosition(
- ScrnInfoPtr pScrn,
- int x, int y
-)
-{
- x += 64;
- y += 64;
-
- /* Output position - "only" 11 bits of location documented */
-
- Permedia2vOutIndReg(pScrn, PM2VDACRDCursorHotSpotX, 0x00, 0x3f);
- Permedia2vOutIndReg(pScrn, PM2VDACRDCursorHotSpotY, 0x00, 0x3f);
- Permedia2vOutIndReg(pScrn, PM2VDACRDCursorXLow, 0x00, x & 0xFF);
- Permedia2vOutIndReg(pScrn, PM2VDACRDCursorXHigh, 0x00, (x>>8) & 0x0F);
- Permedia2vOutIndReg(pScrn, PM2VDACRDCursorYLow, 0x00, y & 0xFF);
- Permedia2vOutIndReg(pScrn, PM2VDACRDCursorYHigh, 0x00, (y>>8) & 0x0F);
- Permedia2vOutIndReg(pScrn, PM2DACCursorControl, 0x00, 0x00);
-}
-
-
-static void
-Permedia3SetCursorColor(
- ScrnInfoPtr pScrn,
- int index,
- int color
-)
-{
- Permedia2vOutIndReg(pScrn, PM2VDACRDCursorPalette+3*(14-index)+0,
- 0x00, 0xff & (color >>16));
- Permedia2vOutIndReg(pScrn, PM2VDACRDCursorPalette+3*(14-index)+1,
- 0x00, 0xff & (color >>8));
- Permedia2vOutIndReg(pScrn, PM2VDACRDCursorPalette+3*(14-index)+2,
- 0x00, 0xff & color);
-}
-
-static void
-Permedia3SetCursorColors(
- ScrnInfoPtr pScrn,
- int bg, int fg
-)
-{
- Permedia3SetCursorColor (pScrn, 0, bg);
- Permedia3SetCursorColor (pScrn, 1, fg);
-}
-
-static Bool
-Permedia3UseHWCursor(ScreenPtr pScr, CursorPtr pCurs)
-{
- return TRUE;
-}
-
-Bool
-Permedia3HWCursorInit(ScreenPtr pScreen)
-{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- GLINTPtr pGlint = GLINTPTR(pScrn);
- xf86CursorInfoPtr infoPtr;
-
- infoPtr = xf86CreateCursorInfoRec();
- if(!infoPtr) return FALSE;
-
- pGlint->CursorInfoRec = infoPtr;
-
- infoPtr->MaxWidth = 64;
- infoPtr->MaxHeight = 64;
- infoPtr->Flags = HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_1;
- infoPtr->SetCursorColors = Permedia3SetCursorColors;
- infoPtr->SetCursorPosition = Permedia3SetCursorPosition;
- infoPtr->LoadCursorImage = Permedia3LoadCursorImage;
- infoPtr->HideCursor = Permedia3HideCursor;
- infoPtr->ShowCursor = Permedia3ShowCursor;
- infoPtr->UseHWCursor = Permedia3UseHWCursor;
-
- return(xf86InitCursor(pScreen, infoPtr));
+ /* retsore the KClk, MClk and SClk settings */
+ /* Permedia2vOutIndReg(pScrn, PM3RD_KClkPreScale, 0x00,
+ glintReg->DacRegs[PM3RD_KClkPreScale]);
+ Permedia2vOutIndReg(pScrn, PM3RD_KClkFeedbackScale, 0x00,
+ glintReg->DacRegs[PM3RD_KClkFeedbackScale]);
+ Permedia2vOutIndReg(pScrn, PM3RD_KClkPostScale, 0x00,
+ glintReg->DacRegs[PM3RD_KClkPostScale]);
+ Permedia2vOutIndReg(pScrn, PM3RD_KClkControl, 0x00,
+ glintReg->DacRegs[PM3RD_KClkControl]);
+ */ /* Should we wait for KClk to be locked here ? */
+ /* Permedia2vOutIndReg(pScrn, PM3RD_MClkControl, 0x00,
+ glintReg->DacRegs[PM3RD_MClkControl]);
+ Permedia2vOutIndReg(pScrn, PM3RD_SClkControl, 0x00,
+ glintReg->DacRegs[PM3RD_SClkControl]);
+*/
}
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/i810/Imakefile b/xc/programs/Xserver/hw/xfree86/drivers/i810/Imakefile
index 8c4c521c0..661c7000e 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/i810/Imakefile
+++ b/xc/programs/Xserver/hw/xfree86/drivers/i810/Imakefile
@@ -1,4 +1,4 @@
-XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/Imakefile,v 1.10 2000/08/01 19:03:15 dawes Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/Imakefile,v 1.13 2000/09/20 00:09:21 keithp Exp $
XCOMM
XCOMM This is the Imakefile for the i810 driver.
XCOMM
@@ -26,11 +26,12 @@ INCLUDES = -I. -I../../include
INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) \
-I$(SERVERSRC)/mfb -I$(SERVERSRC)/mi \
-I$(XF86SRC)/xaa -I$(XF86SRC)/rac \
- -I$(SERVERSRC)/cfb -I$(XF86SRC)/xaa -I$(XF86SRC)/ramdac \
+ -I$(SERVERSRC)/fb -I$(XF86SRC)/xaa -I$(XF86SRC)/ramdac \
-I$(XF86SRC)/vgahw -I$(XF86SRC)/ddc -I$(XF86SRC)/i2c \
+ -I$(XF86OSSRC)/vbe -I$(XF86SRC)/int10 \
-I$(SERVERSRC)/Xext -I$(XF86SRC)/xf24_32bpp \
-I$(FONTINCSRC) -I$(SERVERSRC)/include -I$(XINCLUDESRC) \
- -I$(EXTINCSRC) \
+ -I$(EXTINCSRC) -I$(SERVERSRC)/render \
$(DRIINCLUDES)
#endif
DEFINES = $(DRIDEFINES)
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/i810/i810.cpp b/xc/programs/Xserver/hw/xfree86/drivers/i810/i810.cpp
index 88a1c572b..29fb289a1 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/i810/i810.cpp
+++ b/xc/programs/Xserver/hw/xfree86/drivers/i810/i810.cpp
@@ -1,4 +1,4 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810.cpp,v 1.4 2000/06/14 02:13:10 dawes Exp $
+.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810.cpp,v 1.5 2000/09/17 19:44:29 mvojkovi Exp $
.\" shorthand for double quote that works everywhere.
.ds q \N'34'
.TH I810 __drivermansuffix__ "Version 4.0.1" "XFree86"
@@ -14,17 +14,58 @@ i810 \- Intel i810 video driver
.fi
.SH DESCRIPTION
.B i810
-is an XFree86 driver for Intel i810 video cards.
-THIS MAN PAGE NEEDS TO BE FILLED IN.
+is an XFree86 driver for the Intel i810 family of graphics chipsets.
+The driver supports depths 8, 15, 16 and 24. All visual types are
+supported in depth 8, other depths only support TrueColor. The driver
+supports hardware accelerated 3D via the Direct Rendering Infrastructure (DRI),
+but only in depth 16.
.SH SUPPORTED HARDWARE
-The
.B i810
-driver supports...
+supports the i810, i810-DC100, i810e and i815 chipsets.
+
.SH CONFIGURATION DETAILS
Please refer to XF86Config(__filemansuffix__) for general configuration
details. This section only covers configuration details specific to this
driver.
+.PP
+The i810 has a unified memory architecture and uses system memory
+for video ram. By default 8 Megabytes of system memory are used
+for graphics. This amount may be changed with the
+.B VideoRam
+entry in the config file
+.B "Device"
+section. It may be set to any power of two between 4 and 32 Megabytes
+inclusive to allow the user to customize the balance between main
+memory usage and graphics performance. Too little memory reserved for
+graphics can result in decreased 3D and 2D graphics performance and
+features.
+.PP
+The following driver
+.B Options
+are supported
+.TP
+.BI "Option \*qNoAccel\*q \*q" boolean \*q
+Disable or enable acceleration. Default: acceleration is enabled.
+.TP
+.BI "Option \*qSWCursor\*q \*q" boolean \*q
+Disable or enable software cursor. Default: software cursor is disable
+and a hardware cursor is used.
+.TP
+.BI "Option \*qColorKey\*q \*q" integer \*q
+This sets the default pixel value for the YUV video overlay key.
+Default: undefined.
+.TP
+.BI "Option \*qCacheLines\*q \*q" integer \*q
+This allows the user to change the amount of graphics memory used for
+2D acceleration and video. Decreasing this amount leaves more for 3D
+textures. Increasing it can improve 2D performance at the expense of
+3D performance.
+Default: 256 to 768 depending on the resolution and depth.
+
+
+
.SH "SEE ALSO"
XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__)
.SH AUTHORS
-Authors include: ...
+Authors include: Keith Whitwell, and also Jonathan Bian, Matthew J Sottek,
+Jeff Hartmann, Mark Vojkovich, Alan Hourihane, H. J. Lu.
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/i810/i810.h b/xc/programs/Xserver/hw/xfree86/drivers/i810/i810.h
index f218cf657..a9d77a2a7 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/i810/i810.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/i810/i810.h
@@ -25,7 +25,7 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
**************************************************************************/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810.h,v 1.13 2000/08/03 02:30:24 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810.h,v 1.16 2000/09/17 01:36:27 mvojkovi Exp $ */
/*
* Authors:
@@ -148,19 +148,17 @@ typedef struct _I810Rec {
I810MemRange TexMem;
I810MemRange Scratch;
I810MemRange BufferMem;
- I810MemRange OverlayBuf0;
- I810MemRange OverlayBuf1;
int auxPitch;
int auxPitchBits;
int CursorOffset;
- int CursorPhysical;
- int CursorStart;
- int OverlayPhysical;
- int OverlayStart;
-
+ unsigned long CursorPhysical;
+ unsigned long CursorStart;
+ unsigned long OverlayPhysical;
+ unsigned long OverlayStart;
+ int colorKey;
DGAModePtr DGAModes;
int numDGAModes;
@@ -177,15 +175,14 @@ typedef struct _I810Rec {
I810RingBuffer LpRing;
unsigned int BR[20];
- int gartfd;
int LmFreqSel;
int VramKey;
- long VramOffset;
+ unsigned long VramOffset;
int DcacheKey;
- long DcacheOffset;
+ unsigned long DcacheOffset;
int HwcursKey;
- long HwcursOffset;
+ unsigned long HwcursOffset;
int GttBound;
@@ -296,6 +293,8 @@ extern void I810EmitInvarientState(ScrnInfoPtr pScrn);
extern Bool I810DGAInit(ScreenPtr pScreen);
+extern void I810InitVideo(ScreenPtr pScreen);
+
#define minb(p) *(volatile CARD8 *)(pI810->MMIOBase + (p))
#define moutb(p,v) *(volatile CARD8 *)(pI810->MMIOBase + (p)) = (v)
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_accel.c b/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_accel.c
index e918ad6e1..7a8063a45 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_accel.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_accel.c
@@ -25,7 +25,7 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
**************************************************************************/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_accel.c,v 1.5 2000/06/17 18:23:23 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_accel.c,v 1.11 2000/09/15 23:25:48 mvojkovi Exp $ */
/*
* Authors:
@@ -99,8 +99,6 @@ static void I810SubsequentScanlineCPUToScreenColorExpandFill(ScrnInfoPtr pScrn,
static void I810SubsequentColorExpandScanline(ScrnInfoPtr pScrn, int bufno);
-
-
/* The following function sets up the supported acceleration. Call it
* from the FbInit() function in the SVGA driver, or before ScreenInit
* in a monolithic server.
@@ -115,20 +113,15 @@ I810AccelInit( ScreenPtr pScreen )
if (I810_DEBUG & DEBUG_VERBOSE_ACCEL)
ErrorF( "I810AccelInit\n");
- if (pScrn->depth == 32)
- return FALSE;
-
pI810->AccelInfoRec = infoPtr = XAACreateInfoRec();
if (!infoPtr) return FALSE;
pI810->bufferOffset = 0;
- infoPtr->Flags = LINEAR_FRAMEBUFFER;
-
- /* In 24bpp mode, XAA seems to want to manage offscreen pixmaps as
- * 32bpp even though we've said we can't support that format.
- */
- if (pScrn->depth != 24)
- infoPtr->Flags |= (PIXMAP_CACHE | OFFSCREEN_PIXMAPS);
+ infoPtr->Flags = LINEAR_FRAMEBUFFER | OFFSCREEN_PIXMAPS;
+ /* There is a bit blt bug in 24 bpp. This is a problem, but
+ at least without the pixmap cache we can pass the test suite */
+ if(pScrn->depth != 24)
+ infoPtr->Flags |= PIXMAP_CACHE;
/* Sync
*/
@@ -193,7 +186,6 @@ I810AccelInit( ScreenPtr pScreen )
NO_PLANEMASK |
ROP_NEEDS_SOURCE |
BIT_ORDER_IN_BYTE_MSBFIRST |
- HARDWARE_PATTERN_SCREEN_ORIGIN |
0);
infoPtr->ScanlineColorExpandBuffers = (unsigned char **)
@@ -523,7 +515,6 @@ I810SetupForScanlineCPUToScreenColorExpandFill( ScrnInfoPtr pScrn,
}
-
static void
I810SubsequentScanlineCPUToScreenColorExpandFill(ScrnInfoPtr pScrn,
int x, int y,
@@ -537,7 +528,8 @@ I810SubsequentScanlineCPUToScreenColorExpandFill(ScrnInfoPtr pScrn,
"I810SubsequentScanlineCPUToScreenColorExpandFill "
"%d,%d %dx%x %d\n",
x,y,w,h,skipleft);
-
+
+ pI810->BR[0] = BR00_BITBLT_CLIENT | BR00_OP_MONO_SRC_COPY_BLT | 0x06;
pI810->BR[9] = (pI810->bufferOffset +
(y * pScrn->displayWidth + x) * pI810->cpp);
pI810->BR[14] = ( (1 << 16) | (w * pI810->cpp));
@@ -561,10 +553,7 @@ I810SubsequentColorExpandScanline(ScrnInfoPtr pScrn, int bufno)
{
BEGIN_LP_RING( 8 );
- OUT_RING( BR00_BITBLT_CLIENT |
- BR00_OP_MONO_SRC_COPY_BLT |
- 0x6 );
-
+ OUT_RING( pI810->BR[0]);
OUT_RING( pI810->BR[13]);
OUT_RING( pI810->BR[14] );
OUT_RING( pI810->BR[9] );
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_dga.c b/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_dga.c
index 82b15514e..56eeb7863 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_dga.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_dga.c
@@ -21,7 +21,7 @@
*
* Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk>
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_dga.c,v 1.1 2000/06/22 17:44:03 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_dga.c,v 1.2 2000/09/17 23:18:19 mvojkovi Exp $ */
#include "xf86.h"
#include "xf86_OSproc.h"
@@ -33,6 +33,7 @@
#include "i810.h"
#include "i810_reg.h"
#include "dgaproc.h"
+#include "vgaHW.h"
static Bool I810_OpenFramebuffer(ScrnInfoPtr, char **, unsigned char **,
int *, int *, int *);
@@ -71,34 +72,26 @@ I810DGAInit(ScreenPtr pScreen)
DisplayModePtr pMode, firstMode;
int Bpp = pScrn->bitsPerPixel >> 3;
int num = 0;
- Bool oneMore;
pMode = firstMode = pScrn->modes;
while(pMode) {
- if(0 /*pScrn->displayWidth != pMode->HDisplay*/) {
- newmodes = xrealloc(modes, (num + 2) * sizeof(DGAModeRec));
- oneMore = TRUE;
- } else {
- newmodes = xrealloc(modes, (num + 1) * sizeof(DGAModeRec));
- oneMore = FALSE;
- }
+ newmodes = xrealloc(modes, (num + 1) * sizeof(DGAModeRec));
- if(!newmodes) {
+ if(!newmodes) {
xfree(modes);
return FALSE;
}
modes = newmodes;
-SECOND_PASS:
-
currentMode = modes + num;
num++;
currentMode->mode = pMode;
currentMode->flags = DGA_CONCURRENT_ACCESS | DGA_PIXMAP_AVAILABLE;
- currentMode->flags |= DGA_FILL_RECT | DGA_BLIT_RECT;
+ if(pI810->AccelInfoRec)
+ currentMode->flags |= DGA_FILL_RECT | DGA_BLIT_RECT;
if(pMode->Flags & V_DBLSCAN)
currentMode->flags |= DGA_DOUBLESCAN;
if(pMode->Flags & V_INTERLACE)
@@ -112,38 +105,23 @@ SECOND_PASS:
currentMode->visualClass = (Bpp == 1) ? PseudoColor : TrueColor;
currentMode->viewportWidth = pMode->HDisplay;
currentMode->viewportHeight = pMode->VDisplay;
- currentMode->xViewportStep = 1;
+ currentMode->xViewportStep = (Bpp == 3) ? 2 : 1;
currentMode->yViewportStep = 1;
currentMode->viewportFlags = DGA_FLIP_RETRACE;
currentMode->offset = 0;
currentMode->address = pI810->FbBase;
- if(oneMore) { /* first one is narrow width */
- currentMode->bytesPerScanline = ((pMode->HDisplay * Bpp) + 3) & ~3L;
- currentMode->imageWidth = pMode->HDisplay;
- currentMode->imageHeight = pMode->VDisplay;
- currentMode->pixmapWidth = currentMode->imageWidth;
- currentMode->pixmapHeight = currentMode->imageHeight;
- currentMode->maxViewportX = currentMode->imageWidth -
- currentMode->viewportWidth;
- /* this might need to get clamped to some maximum */
- currentMode->maxViewportY = currentMode->imageHeight -
- currentMode->viewportHeight;
- oneMore = FALSE;
- goto SECOND_PASS;
- } else {
- currentMode->bytesPerScanline =
+ currentMode->bytesPerScanline =
((pScrn->displayWidth * Bpp) + 3) & ~3L;
- currentMode->imageWidth = pScrn->displayWidth;
- currentMode->imageHeight = pMode->VDisplay;
- currentMode->pixmapWidth = currentMode->imageWidth;
- currentMode->pixmapHeight = currentMode->imageHeight;
- currentMode->maxViewportX = currentMode->imageWidth -
+ currentMode->imageWidth = pI810->FbMemBox.x2;
+ currentMode->imageHeight = pI810->FbMemBox.y2;
+ currentMode->pixmapWidth = currentMode->imageWidth;
+ currentMode->pixmapHeight = currentMode->imageHeight;
+ currentMode->maxViewportX = currentMode->imageWidth -
currentMode->viewportWidth;
- /* this might need to get clamped to some maximum */
- currentMode->maxViewportY = currentMode->imageHeight -
+ /* this might need to get clamped to some maximum */
+ currentMode->maxViewportY = currentMode->imageHeight -
currentMode->viewportHeight;
- }
pMode = pMode->next;
if(pMode == firstMode)
@@ -157,32 +135,29 @@ SECOND_PASS:
}
+static DisplayModePtr I810SavedDGAModes[MAXSCREENS];
+
static Bool
I810_SetMode(
ScrnInfoPtr pScrn,
DGAModePtr pMode
){
- static int OldDisplayWidth[MAXSCREENS];
int index = pScrn->pScreen->myNum;
I810Ptr pI810 = I810PTR(pScrn);
if(!pMode) { /* restore the original mode */
- /* put the ScreenParameters back */
-
- pScrn->displayWidth = OldDisplayWidth[index];
-
- I810SwitchMode(index, pScrn->currentMode, 0);
- pI810->DGAactive = FALSE;
+ if(pI810->DGAactive) {
+ pScrn->currentMode = I810SavedDGAModes[index];
+ I810SwitchMode(index, pScrn->currentMode, 0);
+ I810AdjustFrame(index, 0, 0, 0);
+ pI810->DGAactive = FALSE;
+ }
} else {
- if(!pI810->DGAactive) { /* save the old parameters */
- OldDisplayWidth[index] = pScrn->displayWidth;
-
+ if(!pI810->DGAactive) {
+ I810SavedDGAModes[index] = pScrn->currentMode;
pI810->DGAactive = TRUE;
}
- pScrn->displayWidth = pMode->bytesPerScanline /
- (pMode->bitsPerPixel >> 3);
-
I810SwitchMode(index, pMode->mode, 0);
}
@@ -205,9 +180,15 @@ I810_SetViewport(
int flags
){
I810Ptr pI810 = I810PTR(pScrn);
+ vgaHWPtr hwp = VGAHWPTR(pScrn);
I810AdjustFrame(pScrn->pScreen->myNum, x, y, flags);
- pI810->DGAViewportStatus = 0; /* I810AdjustFrame loops until finished */
+
+ /* wait for retrace */
+ while((hwp->readST01(hwp) & 0x08));
+ while(!(hwp->readST01(hwp) & 0x08));
+
+ pI810->DGAViewportStatus = 0;
}
static void
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_dri.c b/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_dri.c
index c256c7ac7..2e97a3c26 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_dri.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_dri.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_dri.c,v 1.9 2000/08/03 02:30:25 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_dri.c,v 1.11 2000/09/17 01:36:27 mvojkovi Exp $ */
#include "xf86.h"
#include "xf86_OSproc.h"
@@ -7,13 +7,8 @@
#include "xf86PciInfo.h"
#include "xf86Pci.h"
-#define PSZ 8
-#include "cfb.h"
-#undef PSZ
-#include "cfb16.h"
-#include "cfb32.h"
-#include "miline.h"
+#include "windowstr.h"
#include "GL/glxtokens.h"
@@ -226,7 +221,8 @@ Bool I810DRIScreenInit(ScreenPtr pScreen)
int i;
/* Hardware 3D rendering only implemented for 16bpp */
- if (pScrn->bitsPerPixel != 16)
+ /* And it only works for 5:6:5 (Mark) */
+ if (pScrn->depth != 16)
return FALSE;
/* Check that the GLX, DRI, and DRM modules have been loaded by testing
@@ -568,28 +564,6 @@ Bool I810DRIScreenInit(ScreenPtr pScreen)
pI810->OverlayPhysical = pI810->CursorPhysical + 1024;
pI810->OverlayStart = pI810->CursorStart + 1024;
- /* Allocate overlay memory */
- I810AllocHigh( &(pI810->OverlayBuf0), &(pI810->SysMem),
- 202 * 4096);
-
- if(pI810->OverlayBuf0.Start == 0 ||
- pI810->OverlayBuf0.End - pI810->OverlayBuf0.Start >
- 202 * 4096) {
- ErrorF("Not enough memory for overlay buffer\n");
- DRICloseScreen(pScreen);
- return FALSE;
- }
- I810AllocHigh( &(pI810->OverlayBuf1), &(pI810->SysMem),
- 202 * 4096);
-
- if(pI810->OverlayBuf1.Start == 0 ||
- pI810->OverlayBuf1.End - pI810->OverlayBuf1.Start >
- 202 * 4096) {
- ErrorF("Not enough memory for overlay buffer\n");
- DRICloseScreen(pScreen);
- return FALSE;
- }
-
/* drmAddMap happens later to preserve index order */
@@ -706,24 +680,6 @@ Bool I810DRIScreenInit(ScreenPtr pScreen)
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[drm] added %d %d byte DMA buffers\n",
bufs, I810_DMA_BUF_SZ);
- /* add the drm map for the overlay. It is added here so that the index
- * numbers of the other maps didn't have to be changed.
- */
- if(drmAddMap(pI810->drmSubFD, (drmHandle)pI810->OverlayBuf0.Start,
- pI810->OverlayBuf0.Size, DRM_AGP, 0,
- &pI810->overlay_map) < 0) {
- ErrorF("drmAddMap(overlay_map) failed\n");
- DRICloseScreen(pScreen);
- return FALSE;
- }
- if(drmAddMap(pI810->drmSubFD, (drmHandle)pI810->OverlayBuf1.Start,
- pI810->OverlayBuf1.Size, DRM_AGP, 0,
- &pI810->overlay_map) < 0) {
- ErrorF("drmAddMap(overlay_map) failed\n");
- DRICloseScreen(pScreen);
- return FALSE;
- }
-
I810InitDma(pScrn);
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c
index 50bfb76cf..2e55a7849 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c
@@ -25,7 +25,7 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
**************************************************************************/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c,v 1.18 2000/08/11 17:27:14 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c,v 1.32 2000/09/19 12:46:16 eich Exp $ */
/*
* Authors:
@@ -57,17 +57,11 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "micmap.h"
-#define PSZ 8
-#include "cfb.h"
-#undef PSZ
-
-#include "cfb16.h"
-#include "cfb24.h"
-#include "cfb32.h"
-#include "cfb24_32.h"
+#include "fb.h"
#include "miscstruct.h"
#include "xf86xv.h"
#include "Xv.h"
+#include "vbe.h"
#include "i810.h"
@@ -78,6 +72,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
/* Required Functions: */
static void I810Identify(int flags);
+static OptionInfoPtr I810AvailableOptions(int chipid, int busid);
static Bool I810Probe(DriverPtr drv, int flags);
static Bool I810PreInit(ScrnInfoPtr pScrn, int flags);
static Bool I810ScreenInit(int Index, ScreenPtr pScreen, int argc, char **argv);
@@ -100,6 +95,7 @@ DriverRec I810 = {
"Accelerated driver for Intel i810 cards",
I810Identify,
I810Probe,
+ I810AvailableOptions,
NULL,
0
};
@@ -124,12 +120,16 @@ static PciChipsets I810PciChipsets[] = {
typedef enum {
OPTION_NOACCEL,
OPTION_SW_CURSOR,
+ OPTION_COLOR_KEY,
+ OPTION_CACHE_LINES,
OPTION_DAC_6BIT
} I810Opts;
static OptionInfoRec I810Options[] = {
{ OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE },
+ { OPTION_COLOR_KEY, "ColorKey", OPTV_INTEGER, {0}, FALSE },
+ { OPTION_CACHE_LINES, "CacheLines", OPTV_INTEGER, {0}, FALSE},
{ OPTION_DAC_6BIT, "Dac6Bit", OPTV_BOOLEAN, {0}, FALSE},
{ -1, NULL, OPTV_NONE, {0}, FALSE}
};
@@ -151,20 +151,11 @@ static const char *vgahwSymbols[] = {
0
};
-static const char *cfbSymbols[] = {
- "cfbScreenInit",
- "cfb16ScreenInit",
- "cfb24ScreenInit",
- "cfb32ScreenInit",
- "cfb8_32ScreenInit",
- "cfb24_32ScreenInit",
+static const char *fbSymbols[] = {
+ "fbScreenInit",
NULL
};
-static const char *xf8_32bppSymbols[] = {
- "xf86Overlay8Plus32Init",
- NULL
-};
static const char *miscSymbols[] = {
"GetTimeInMillis",
@@ -190,12 +181,6 @@ static const char *ramdacSymbols[] = {
NULL
};
-/*
- * This is intentionally screen-independent. It indicates the binding
- * choice made in the first PreInit.
- */
-static int pix24bpp = 0;
-
#ifdef XF86DRI
static const char *drmSymbols[] = {
"drmAvailable",
@@ -295,19 +280,18 @@ i810Setup(pointer module, pointer opts, int *errmaj, int *errmin)
* might refer to.
*/
LoaderRefSymLists(vgahwSymbols,
- cfbSymbols,
+ fbSymbols,
xaaSymbols,
- xf8_32bppSymbols,
ramdacSymbols,
miscSymbols,
#ifdef XF86DRI
drmSymbols,
driSymbols,
#endif
- 0 /* ddcsymbols */,
- 0 /* i2csymbols */,
- 0 /* shadowSymbols */,
- 0 /* fbdevsymbols */,
+ NULL /* ddcsymbols */,
+ NULL /* i2csymbols */,
+ NULL /* shadowSymbols */,
+ NULL /* fbdevsymbols */,
NULL);
/*
@@ -358,6 +342,12 @@ I810Identify(int flags) {
xf86PrintChipsets(I810_NAME, "Driver for Intel i810 chipset", I810Chipsets);
}
+static
+OptionInfoPtr
+I810AvailableOptions(int chipid, int busid)
+{
+ return I810Options;
+}
/*
* I810Probe --
*
@@ -391,6 +381,9 @@ I810Probe(DriverPtr drv, int flags) {
devSections, numDevSections,
drv, &usedChips);
+ if (flags & PROBE_DETECT)
+ foundScreen = TRUE;
+ else
for (i=0; i<numUsed; i++) {
ScrnInfoPtr pScrn = NULL;
/* Allocate new ScrnInfoRec and claim the slot */
@@ -418,6 +411,16 @@ I810Probe(DriverPtr drv, int flags) {
return foundScreen;
}
+static void
+I810ProbeDDC(ScrnInfoPtr pScrn, int index)
+{
+ vbeInfoPtr pVbe;
+ if (xf86LoadSubModule(pScrn, "vbe")) {
+ pVbe = VBEInit(NULL,index);
+ ConfiguredMonitor = vbeDoEDID(pVbe, NULL);
+ }
+}
+
/*
* I810PreInit --
*
@@ -432,7 +435,6 @@ I810PreInit(ScrnInfoPtr pScrn, int flags) {
ClockRangePtr clockRanges;
int i;
MessageType from;
- char *mod=0, *reqSym=0;
int flags24;
rgb defaultWeight = {0, 0, 0};
@@ -454,6 +456,11 @@ I810PreInit(ScrnInfoPtr pScrn, int flags) {
pI810->pEnt = xf86GetEntityInfo(pScrn->entityList[0]);
if (pI810->pEnt->location.type != BUS_PCI) return FALSE;
+ if (flags & PROBE_DETECT) {
+ I810ProbeDDC(pScrn, pI810->pEnt->index);
+ return TRUE;
+ }
+
pI810->PciInfo = xf86GetPciInfoForEntity(pI810->pEnt->index);
pI810->PciTag = pciTag(pI810->PciInfo->bus, pI810->PciInfo->device,
pI810->PciInfo->func);
@@ -465,14 +472,13 @@ I810PreInit(ScrnInfoPtr pScrn, int flags) {
/* Set pScrn->monitor */
pScrn->monitor = pScrn->confScreen->monitor;
- /* No support for 32bpp.
- */
flags24=Support24bppFb | PreferConvert32to24 | SupportConvert32to24;
if (!xf86SetDepthBpp(pScrn, 8, 8, 8, flags24)) {
return FALSE;
} else {
switch (pScrn->depth) {
case 8:
+ case 15:
case 16:
case 24:
break;
@@ -485,9 +491,17 @@ I810PreInit(ScrnInfoPtr pScrn, int flags) {
}
xf86PrintDepthBpp(pScrn);
- /* Get the depth24 pixmap format */
- if (pScrn->depth == 24 && pix24bpp == 0)
- pix24bpp = xf86GetBppFromDepth(pScrn, 24);
+ switch (pScrn->bitsPerPixel) {
+ case 8:
+ case 16:
+ case 24:
+ break;
+ default:
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "Given bpp (%d) is not supported by i810 driver\n",
+ pScrn->bitsPerPixel);
+ return FALSE;
+ }
pScrn->rgbBits=8;
if (xf86ReturnOptValBool(I810Options, OPTION_DAC_6BIT, FALSE))
@@ -500,7 +514,7 @@ I810PreInit(ScrnInfoPtr pScrn, int flags) {
return FALSE;
/* We don't currently support DirectColor at > 8bpp */
- if (pScrn->depth > 8 && pScrn->defaultVisual != TrueColor) {
+ if ((pScrn->depth > 8) && (pScrn->defaultVisual != TrueColor)) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Given default visual"
" (%s) is not supported at depth %d\n",
xf86GetVisualName(pScrn->defaultVisual), pScrn->depth);
@@ -608,8 +622,10 @@ I810PreInit(ScrnInfoPtr pScrn, int flags) {
/* Default to 4MB framebuffer, which is sufficient for all
* supported 2d resolutions. If the user has specified a different
* size in the XF86Config, use that amount instead.
+ *
+ * Changed to 8 Meg so we can have acceleration by default (Mark).
*/
- pScrn->videoRam = 4096;
+ pScrn->videoRam = 8192;
from = X_PROBED;
if (pI810->pEnt->device->videoRam) {
pScrn->videoRam = pI810->pEnt->device->videoRam;
@@ -647,7 +663,7 @@ I810PreInit(ScrnInfoPtr pScrn, int flags) {
case 24:
pI810->MaxClock = pI810->pEnt->device->dacSpeeds[DAC_BPP24];
break;
- case 32:
+ case 32: /* not supported */
pI810->MaxClock = pI810->pEnt->device->dacSpeeds[DAC_BPP32];
break;
}
@@ -665,7 +681,7 @@ I810PreInit(ScrnInfoPtr pScrn, int flags) {
case 24:
pI810->MaxClock = 136000;
break;
- case 32:
+ case 32: /* not supported */
pI810->MaxClock = 86000;
}
}
@@ -709,34 +725,11 @@ I810PreInit(ScrnInfoPtr pScrn, int flags) {
xf86SetDpi(pScrn, 0, 0);
- switch (pScrn->bitsPerPixel) {
- case 8:
- mod = "cfb";
- reqSym = "cfbScreenInit";
- break;
- case 16:
- mod = "cfb16";
- reqSym = "cfb16ScreenInit";
- break;
- case 24:
- if (pix24bpp == 24) {
- mod = "cfb24";
- reqSym = "cfb24ScreenInit";
- } else {
- mod = "xf24_32bpp";
- reqSym = "cfb24_32ScreenInit";
- }
- break;
- case 32:
- mod = "cfb32";
- reqSym = "cfb32ScreenInit";
- break;
- }
- if (mod && !xf86LoadSubModule(pScrn, mod)) {
+ if (!xf86LoadSubModule(pScrn, "fb")) {
I810FreeRec(pScrn);
return FALSE;
}
- xf86LoaderReqSymbols(reqSym, NULL);
+ xf86LoaderReqSymbols("fbScreenInit", NULL);
if (!xf86ReturnOptValBool(I810Options, OPTION_NOACCEL, FALSE)) {
if (!xf86LoadSubModule(pScrn, "xaa")) {
@@ -753,6 +746,16 @@ I810PreInit(ScrnInfoPtr pScrn, int flags) {
xf86LoaderReqSymLists(ramdacSymbols, NULL);
}
+ if (xf86GetOptValInteger(I810Options, OPTION_COLOR_KEY, &(pI810->colorKey)))
+ {
+ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "video overlay key set to 0x%x\n",
+ pI810->colorKey);
+ } else {
+ pI810->colorKey = (1 << pScrn->offset.red) |
+ (1 << pScrn->offset.green) |
+ (((pScrn->mask.blue >> pScrn->offset.blue) - 1) << pScrn->offset.blue);
+ }
+
/* We wont be using the VGA access after the probe */
{
resRange vgaio[] = { {ResShrIoBlock,0x3B0,0x3BB},
@@ -1283,7 +1286,7 @@ I810CalcVCLK( ScrnInfoPtr pScrn, double freq )
i810Reg->VideoClk2_N = (n_best-2) & 0x3FF;
i810Reg->VideoClk2_DivisorSel = (p_best << 4);
- ErrorF("Setting dot clock to %.1lf MHz "
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Setting dot clock to %.1lf MHz "
"[ 0x%x 0x%x 0x%x ] "
"[ %d %d %d ]\n",
CALC_VCLK(m_best,n_best,p_best),
@@ -1301,7 +1304,7 @@ I810SetMode(ScrnInfoPtr pScrn, DisplayModePtr mode)
vgaRegPtr pVga = &VGAHWPTR(pScrn)->ModeReg;
double dclk = mode->Clock/1000.0;
- switch (pScrn->depth) {
+ switch (pScrn->bitsPerPixel) {
case 8:
pVga->CRTC[0x13] = pScrn->displayWidth >> 3;
i810Reg->ExtOffset = pScrn->displayWidth >> 11;
@@ -1319,24 +1322,12 @@ I810SetMode(ScrnInfoPtr pScrn, DisplayModePtr mode)
i810Reg->BitBLTControl = COLEXP_16BPP;
break;
case 24:
- if (pScrn->bitsPerPixel == 24) {
- pVga->CRTC[0x13] = (pScrn->displayWidth * 3) >> 3;
- i810Reg->ExtOffset = (pScrn->displayWidth * 3) >> 11;
- } else {
- /* never happens */
- pVga->CRTC[0x13] = pScrn->displayWidth >> 1;
- i810Reg->ExtOffset = pScrn->displayWidth >> 9;
- }
+ pVga->CRTC[0x13] = (pScrn->displayWidth * 3) >> 3;
+ i810Reg->ExtOffset = (pScrn->displayWidth * 3) >> 11;
+
i810Reg->PixelPipeCfg1 = DISPLAY_24BPP_MODE;
i810Reg->BitBLTControl = COLEXP_24BPP;
break;
- case 32:
- /* never happens */
- pVga->CRTC[0x13] = pScrn->displayWidth >> 1;
- i810Reg->ExtOffset = pScrn->displayWidth >> 9;
- i810Reg->PixelPipeCfg1 = DISPLAY_32BPP_MODE;
- i810Reg->BitBLTControl = COLEXP_RESERVED; /* Not implemented on i810 */
- break;
default:
break;
}
@@ -1370,13 +1361,17 @@ I810SetMode(ScrnInfoPtr pScrn, DisplayModePtr mode)
i810Reg->ExtHorizBlank = (((mode->CrtcHBlankEnd >> 3) - 1) & 0x40) >> 6;
/*
- * The following workaround is needed to get video overlay working
- * at 1024x768 display resolution.
+ * The following workarounds are needed to get video overlay working
+ * at 1024x768 and 1280x1024 display resolutions.
*/
if ((mode->CrtcVDisplay == 768) && (i810Reg->ExtVertBlankStart == 3))
{
i810Reg->ExtVertBlankStart = 2;
}
+ if ((mode->CrtcVDisplay == 1024) && (i810Reg->ExtVertBlankStart == 4))
+ {
+ i810Reg->ExtVertBlankStart = 3;
+ }
/* OVRACT Register */
i810Reg->OverlayActiveStart = mode->CrtcHTotal - 32;
@@ -1526,6 +1521,7 @@ I810LoadPalette24(ScrnInfoPtr pScrn, int numColors, int *indices, LOCO *colors,
Bool
I810AllocateFront(ScrnInfoPtr pScrn) {
I810Ptr pI810 = I810PTR(pScrn);
+ int cache_lines = -1;
if(pI810->DoneFrontAlloc)
return TRUE;
@@ -1536,12 +1532,21 @@ I810AllocateFront(ScrnInfoPtr pScrn) {
pI810->FbMemBox.x2=pScrn->displayWidth;
pI810->FbMemBox.y1=0;
pI810->FbMemBox.y2=pScrn->virtualY;
-
- /* Make sure there is room for pixcache either beside or below
- * the screen.
- */
- if (pScrn->displayWidth < pScrn->virtualX + 64)
- pI810->FbMemBox.y2 += 64;
+
+ xf86GetOptValInteger(I810Options, OPTION_CACHE_LINES, &cache_lines);
+
+ if(cache_lines >= 0)
+ pI810->FbMemBox.y2 += cache_lines;
+ else {
+ /* make sure there is enough for two DVD sized YUV buffers */
+ pI810->FbMemBox.y2 += (pScrn->depth == 24) ? 256 : 384;
+ if (pScrn->displayWidth <= 1024)
+ pI810->FbMemBox.y2 += (pScrn->depth == 24) ? 256 : 384;
+ cache_lines = pI810->FbMemBox.y2 - pScrn->virtualY;
+ }
+
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "Adding %i scanlines for pixmap caching\n", cache_lines);
/* Reserve room for the framebuffer and pixcache. Put at the top
* of memory so we can have nice alignment for the tiled regions at
@@ -1591,9 +1596,18 @@ I810ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) {
miClearVisualTypes();
- if (!miSetVisualTypes(pScrn->depth, miGetDefaultVisualMask(pScrn->depth),
+#if 1 /* disable DirectColor */
+ if(pScrn->depth > 8) {
+ if (!miSetVisualTypes(pScrn->depth, TrueColorMask,
+ pScrn->rgbBits, pScrn->defaultVisual))
+ return FALSE;
+ } else
+#endif
+ {
+ if (!miSetVisualTypes(pScrn->depth, miGetDefaultVisualMask(pScrn->depth),
pScrn->rgbBits, pScrn->defaultVisual))
- return FALSE;
+ return FALSE;
+ }
{
I810RegPtr i810Reg = &pI810->ModeReg;
@@ -1623,6 +1637,7 @@ I810ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) {
}
#else
+ pI810->directRenderingEnabled = FALSE;
if (!I810AllocateGARTMemory( pScrn ))
return FALSE;
I810AllocateFront(pScrn);
@@ -1643,75 +1658,74 @@ I810ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) {
I810SaveScreen(pScreen, FALSE);
I810AdjustFrame(scrnIndex, pScrn->frameX0, pScrn->frameY0, 0);
- switch (pScrn->bitsPerPixel) {
- case 8:
- if (!cfbScreenInit(pScreen, pI810->FbBase + pScrn->fbOffset,
- pScrn->virtualX, pScrn->virtualY,
- pScrn->xDpi, pScrn->yDpi,
- pScrn->displayWidth))
- return FALSE;
- break;
- case 16:
- if (!cfb16ScreenInit(pScreen, pI810->FbBase + pScrn->fbOffset,
- pScrn->virtualX, pScrn->virtualY,
- pScrn->xDpi, pScrn->yDpi,
- pScrn->displayWidth))
- return FALSE;
- break;
- case 24:
- if (pix24bpp == 24) {
- if (!cfb24ScreenInit(pScreen, pI810->FbBase + pScrn->fbOffset,
- pScrn->virtualX, pScrn->virtualY,
- pScrn->xDpi, pScrn->yDpi,
- pScrn->displayWidth))
- return FALSE;
- } else {
- if (!cfb24_32ScreenInit(pScreen, pI810->FbBase + pScrn->fbOffset,
- pScrn->virtualX, pScrn->virtualY,
+ if(!fbScreenInit(pScreen, pI810->FbBase + pScrn->fbOffset,
+ pScrn->virtualX, pScrn->virtualY,
pScrn->xDpi, pScrn->yDpi,
- pScrn->displayWidth))
- return FALSE;
- }
- break;
- case 32:
- if (!cfb32ScreenInit(pScreen, pI810->FbBase + pScrn->fbOffset,
- pScrn->virtualX, pScrn->virtualY,
- pScrn->xDpi, pScrn->yDpi,
- pScrn->displayWidth))
- return FALSE;
- break;
- default:
- xf86DrvMsg(scrnIndex, X_ERROR,
- "Internal error: invalid bpp (%d) in I810ScrnInit\n",
- pScrn->bitsPerPixel);
- return FALSE;
+ pScrn->displayWidth, pScrn->bitsPerPixel))
+ return FALSE;
+
+
+ if (pScrn->bitsPerPixel > 8) {
+ /* Fixup RGB ordering */
+ visual = pScreen->visuals + pScreen->numVisuals;
+ while (--visual >= pScreen->visuals) {
+ if ((visual->class | DynamicClass) == DirectColor) {
+ visual->offsetRed = pScrn->offset.red;
+ visual->offsetGreen = pScrn->offset.green;
+ visual->offsetBlue = pScrn->offset.blue;
+ visual->redMask = pScrn->mask.red;
+ visual->greenMask = pScrn->mask.green;
+ visual->blueMask = pScrn->mask.blue;
+ }
+ }
}
xf86SetBlackWhitePixels(pScreen);
+#ifdef XF86DRI
+ if (!pI810->directRenderingEnabled) {
+ pI810->DoneFrontAlloc = FALSE;
+ if (!I810AllocateGARTMemory( pScrn ))
+ return FALSE;
+ I810AllocateFront(pScrn);
+ }
+#endif
+
I810DGAInit(pScreen);
- if (pScrn->bitsPerPixel>8) {
- visual = pScreen->visuals + pScreen->numVisuals;
- while (--visual >= pScreen->visuals) {
- if ((visual->class | DynamicClass) == DirectColor) {
- visual->offsetRed = pScrn->offset.red;
- visual->offsetGreen = pScrn->offset.green;
- visual->offsetBlue = pScrn->offset.blue;
- visual->redMask = pScrn->mask.red;
- visual->greenMask = pScrn->mask.green;
- visual->blueMask = pScrn->mask.blue;
- }
+ if (!xf86InitFBManager(pScreen, &(pI810->FbMemBox))) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "Failed to init memory manager\n");
+ return FALSE;
+ }
+
+ if (!xf86ReturnOptValBool(I810Options, OPTION_NOACCEL, FALSE)) {
+ if (pI810->LpRing.mem.Size != 0) {
+ I810SetRingRegs( pScrn );
+
+ if (!I810AccelInit(pScreen)) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "Hardware acceleration initialization failed\n");
+ }
}
}
miInitializeBackingStore(pScreen);
xf86SetBackingStore(pScreen);
+ xf86SetSilkenMouse(pScreen);
miDCInitialize(pScreen, xf86GetPointerScreenFuncs());
+ if (!xf86ReturnOptValBool(I810Options, OPTION_SW_CURSOR, FALSE)) {
+ if (!I810CursorInit(pScreen)) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "Hardware cursor initialization failed\n");
+ }
+ }
+
if (!miCreateDefColormap(pScreen)) return FALSE;
+#if 0 /* palettes do not work */
if (pScrn->bitsPerPixel==16) {
if (!xf86HandleColormaps(pScreen, 256, 8, I810LoadPalette16, 0,
CMAP_PALETTED_TRUECOLOR|
@@ -1723,59 +1737,15 @@ I810ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) {
CMAP_RELOAD_ON_MODE_SWITCH))
return FALSE;
}
+#else
+ if (!vgaHWHandleColormaps(pScreen))
+ return FALSE;
+#endif
#ifdef DPMSExtension
xf86DPMSInit(pScreen, I810DisplayPowerManagementSet, 0);
#endif
-
-
-#ifdef XvExtension
- {
- XF86VideoAdaptorPtr *ptr;
- int n;
-
- n = xf86XVListGenericAdaptors(pScrn, &ptr);
- if (n) {
- xf86XVScreenInit(pScreen, ptr, n);
- }
- }
-#endif
-
-#ifdef XF86DRI
- if (!pI810->directRenderingEnabled) {
- pI810->DoneFrontAlloc = FALSE;
- if (!I810AllocateGARTMemory( pScrn ))
- return FALSE;
- I810AllocateFront(pScrn);
- }
-#endif
-
-
- if (!xf86InitFBManager(pScreen, &(pI810->FbMemBox))) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "Failed to init memory manager\n");
- return FALSE;
- }
-
- if (!xf86ReturnOptValBool(I810Options, OPTION_NOACCEL, FALSE)) {
- if (pI810->LpRing.mem.Size != 0) {
- I810SetRingRegs( pScrn );
-
- if (!I810AccelInit(pScreen)) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "Hardware acceleration initialization failed\n");
- }
- }
- }
-
- if (!xf86ReturnOptValBool(I810Options, OPTION_SW_CURSOR, FALSE)) {
- if (!I810CursorInit(pScreen)) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "Hardware cursor initialization failed\n");
- }
- }
-
I810InitVideo(pScreen);
#ifdef XF86DRI
@@ -1940,13 +1910,16 @@ I810CloseScreen(int scrnIndex, ScreenPtr pScreen)
pI810->directRenderingEnabled=FALSE;
}
#endif
- if (pScrn->vtSema == TRUE) {
+
+ if(pScrn->vtSema == TRUE) {
I810UnbindGARTMemory(pScrn);
+ I810Restore(pScrn);
+ vgaHWLock(hwp);
}
-
+
I810UnmapMem(pScrn);
vgaHWUnmapMem(pScrn);
-
+
if (pI810->ScanlineColorExpandBuffers) {
xfree(pI810->ScanlineColorExpandBuffers);
pI810->ScanlineColorExpandBuffers = 0;
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_memory.c b/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_memory.c
index 367efb72a..42893411d 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_memory.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_memory.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_memory.c,v 1.12 2000/08/04 03:51:45 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_memory.c,v 1.15 2000/08/28 18:12:55 dawes Exp $ */
/**************************************************************************
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
@@ -32,20 +32,9 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
-#ifndef XFree86LOADER
#include "xf86.h"
#include "xf86_ansic.h"
-#endif
-
-#ifdef linux
-#include <asm/ioctl.h>
-#include <linux/agpgart.h>
-#endif
-
-#ifdef XFree86LOADER
-#include "xf86.h"
-#include "xf86_ansic.h"
-#endif
+#include "xf86_OSproc.h"
#include "i810.h"
#include "i810_reg.h"
@@ -74,78 +63,39 @@ int I810AllocHigh( I810MemRange *result, I810MemRange *pool, int size )
int I810AllocateGARTMemory( ScrnInfoPtr pScrn )
{
-#ifdef AGPIOC_ACQUIRE
- struct _agp_info agpinf;
- struct _agp_bind bind;
- struct _agp_allocate alloc;
- int pages = pScrn->videoRam / 4;
+ unsigned long size = pScrn->videoRam * 1024;
I810Ptr pI810 = I810PTR(pScrn);
+ int key;
long tom = 0;
- int gartfd = -1;
-
- if (pI810->agpAcquired2d == TRUE) {
- I810BindGARTMemory(pScrn);
- return TRUE;
- }
-
- gartfd = open("/dev/agpgart", O_RDWR, 0);
+ unsigned long physical;
- if (gartfd == -1) {
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "unable to open /dev/agpgart\n");
+ if (!xf86AgpGARTSupported())
return FALSE;
- }
- if (ioctl(gartfd, AGPIOC_ACQUIRE, 0) != 0) {
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "AGPIOC_ACQUIRE failed\n");
+ if (!xf86AcquireGART(pScrn->scrnIndex))
return FALSE;
- }
/* This allows the 2d only Xserver to regen */
pI810->agpAcquired2d = TRUE;
- pI810->gartfd = gartfd;
-
- if (ioctl(pI810->gartfd, AGPIOC_INFO, &agpinf) != 0) {
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "error doing ioctl(AGPIOC_INFO)\n");
- return FALSE;
- }
-
- if (agpinf.version.major != 0 ||
- agpinf.version.minor != 99) {
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "Agp kernel driver version not correct\n");
- return FALSE;
- }
-
/* Treat the gart like video memory - we assume we own all that is
* there, so ignore EBUSY errors. Don't try to remove it on
* failure, either, as other X server may be using it.
*/
- alloc.pg_count = pages;
- alloc.type = 0;
- if (ioctl(pI810->gartfd, AGPIOC_ALLOCATE, &alloc) != 0) {
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "AGPGART: allocation of %d pages failed\n", pages);
+ if ((key = xf86AllocateGARTMemory(pScrn->scrnIndex, size, 0, NULL)) == -1)
return FALSE;
- }
- bind.pg_start = 0;
- bind.key = alloc.key;
- pI810->VramOffset = (off_t) bind.pg_start;
- pI810->VramKey = bind.key;
+ pI810->VramOffset = 0;
+ pI810->VramKey = key;
- if (ioctl(pI810->gartfd, AGPIOC_BIND, &bind) != 0) {
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "GART: allocation of %d pages failed\n", pages);
+ if (!xf86BindGARTMemory(pScrn->scrnIndex, key, 0))
return FALSE;
- }
pI810->SysMem.Start = 0;
- pI810->SysMem.Size = pages * 4096;
- pI810->SysMem.End = pages * 4096;
+ pI810->SysMem.Size = size;
+ pI810->SysMem.End = size;
pI810->SavedSysMem = pI810->SysMem;
tom = pI810->SysMem.End;
@@ -159,32 +109,29 @@ int I810AllocateGARTMemory( ScrnInfoPtr pScrn )
* a 2d server. Don't bother reporting its presence. This is
* mapped in addition to the requested amount of system ram.
*/
- alloc.pg_count = 1024;
- alloc.type = 1;
-
+ size = 1024 * 4096;
/* Keep it 512K aligned for the sake of tiled regions.
*/
tom += 0x7ffff;
tom &= ~0x7ffff;
- if (ioctl(pI810->gartfd, AGPIOC_ALLOCATE, &alloc) == 0) {
- bind.pg_start = tom / 4096;
- bind.key = alloc.key;
- pI810->DcacheOffset= (off_t) bind.pg_start;
- pI810->DcacheKey = bind.key;
-
- if (ioctl(pI810->gartfd, AGPIOC_BIND, &bind) != 0) {
+ if ((key = xf86AllocateGARTMemory(pScrn->scrnIndex, size, 1, NULL)) != -1) {
+ pI810->DcacheOffset= tom;
+ pI810->DcacheKey = key;
+ if (!xf86BindGARTMemory(pScrn->scrnIndex, key, tom)) {
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "GART: allocation of %d DCACHE pages failed\n",
- alloc.pg_count);
+ "Allocation of %d bytes for DCACHE failed\n", size);
pI810->DcacheKey = -1;
} else {
pI810->DcacheMem.Start = tom;
- pI810->DcacheMem.Size = 1024 * 4096;
+ pI810->DcacheMem.Size = size;
pI810->DcacheMem.End = pI810->DcacheMem.Start + pI810->DcacheMem.Size;
tom = pI810->DcacheMem.End;
}
} else {
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "No physical memory available for %d bytes of DCACHE\n",
+ size);
pI810->DcacheKey = -1;
}
@@ -199,31 +146,25 @@ int I810AllocateGARTMemory( ScrnInfoPtr pScrn )
* overlay registers later
*/
- alloc.pg_count = 1;
- alloc.type = 2;
-
+ size = 4096;
- if (ioctl(pI810->gartfd, AGPIOC_ALLOCATE, &alloc) != 0) {
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "GART: No physical memory available for mouse\n",
- alloc.pg_count);
+ if ((key = xf86AllocateGARTMemory(pScrn->scrnIndex, size, 2,
+ &physical)) == -1) {
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "No physical memory available for HW cursor\n");
pI810->HwcursKey = -1;
} else {
- bind.pg_start = tom / 4096;
- bind.key = alloc.key;
- pI810->HwcursOffset = (off_t) bind.pg_start;
- pI810->HwcursKey = bind.key;
-
- if (ioctl(pI810->gartfd, AGPIOC_BIND, &bind) != 0) {
+ pI810->HwcursOffset= tom;
+ pI810->HwcursKey = key;
+ if (!xf86BindGARTMemory(pScrn->scrnIndex, key, tom)) {
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "GART: allocation of %d physical pages failed\n",
- alloc.pg_count);
+ "Allocation of %d bytes for HW cursor failed\n",
+ size);
pI810->HwcursKey = -1;
} else {
- pI810->CursorPhysical = alloc.physical;
+ pI810->CursorPhysical = physical;
pI810->CursorStart = tom;
-
- tom += 4096;
+ tom += size;
}
}
@@ -239,11 +180,9 @@ int I810AllocateGARTMemory( ScrnInfoPtr pScrn )
pI810->GttBound = 1;
return TRUE;
-#else
- return FALSE;
-#endif
}
+#if 0
void I810FreeGARTMemory( ScrnInfoPtr pScrn )
{
#ifdef linux
@@ -255,6 +194,7 @@ void I810FreeGARTMemory( ScrnInfoPtr pScrn )
}
#endif
}
+#endif
@@ -276,26 +216,30 @@ void I810SetTiledMemory(ScrnInfoPtr pScrn,
CARD32 val;
if (nr < 0 || nr > 7) {
- ErrorF("I810SetTiledMemory - fence %d out of range\n", nr);
+ xf86DrvMsg(X_WARNING, pScrn->scrnIndex,
+ "I810SetTiledMemory - fence %d out of range\n", nr);
return;
}
i810Reg->Fence[nr] = 0;
if (start & ~FENCE_START_MASK) {
- ErrorF("I810SetTiledMemory %d: start (%x) is not 512k aligned\n",
- nr, start);
+ xf86DrvMsg(X_WARNING, pScrn->scrnIndex,
+ "I810SetTiledMemory %d: start (%x) is not 512k aligned\n",
+ nr, start);
return;
}
if (start % size) {
- ErrorF("I810SetTiledMemory %d: start (%x) is not size (%x) aligned\n",
- nr, start, size);
+ xf86DrvMsg(X_WARNING, pScrn->scrnIndex,
+ "I810SetTiledMemory %d: start (%x) is not size (%x) aligned\n",
+ nr, start, size);
return;
}
if (pitch & 127) {
- ErrorF("I810SetTiledMemory %d: pitch (%x) not a multiple of 128 bytes\n",
- nr, pitch);
+ xf86DrvMsg(X_WARNING, pScrn->scrnIndex,
+ "I810SetTiledMemory %d: pitch (%x) not a multiple of 128 bytes\n",
+ nr, pitch);
return;
}
@@ -310,7 +254,8 @@ void I810SetTiledMemory(ScrnInfoPtr pScrn,
case (16*1024*1024): val |= FENCE_SIZE_16M; break;
case (32*1024*1024): val |= FENCE_SIZE_32M; break;
default:
- ErrorF("I810SetTiledMemory %d: illegal size (%x)\n");
+ xf86DrvMsg(X_WARNING, pScrn->scrnIndex,
+ "I810SetTiledMemory %d: illegal size (0x%x)\n", size);
return;
}
@@ -322,7 +267,8 @@ void I810SetTiledMemory(ScrnInfoPtr pScrn,
case 16: val |= FENCE_PITCH_16; break;
case 32: val |= FENCE_PITCH_32; break;
default:
- ErrorF("I810SetTiledMemory %d: illegal size (%x)\n");
+ xf86DrvMsg(X_WARNING, pScrn->scrnIndex,
+ "%d: illegal size (0x%x)\n", size);
return;
}
@@ -332,78 +278,50 @@ void I810SetTiledMemory(ScrnInfoPtr pScrn,
Bool
I810BindGARTMemory( ScrnInfoPtr pScrn )
{
-#ifdef AGPIOC_ACQUIRE
I810Ptr pI810 = I810PTR(pScrn);
- struct _agp_bind bind;
-
- if (
-#ifdef XF86DRI
- !pI810->directRenderingEnabled &&
-#endif
- !pI810->GttBound) {
- if (ioctl(pI810->gartfd, AGPIOC_ACQUIRE, 0) != 0)
- FatalError ("i810: Unable to acquire agp interface on VT switch!!\n");
- bind.pg_start = (off_t) pI810->VramOffset;
- bind.key = pI810->VramKey;
- if (ioctl(pI810->gartfd, AGPIOC_BIND, &bind) != 0)
- FatalError("i810: Unable to bind agp memory on VT switch!!\n");
+ if (xf86AgpGARTSupported() && !pI810->directRenderingEnabled &&
+ !pI810->GttBound) {
+ if (!xf86AcquireGART(pScrn->scrnIndex))
+ return FALSE;
+ if (!xf86BindGARTMemory(pScrn->scrnIndex, pI810->VramKey,
+ pI810->VramOffset))
+ return FALSE;
if (pI810->DcacheKey != -1) {
- bind.pg_start = (off_t) pI810->DcacheOffset;
- bind.key = pI810->DcacheKey;
- if (ioctl(pI810->gartfd, AGPIOC_BIND, &bind) != 0)
- FatalError("i810: Unable to bind agp dcache on VT switch!!\n");
+ if (!xf86BindGARTMemory(pScrn->scrnIndex, pI810->DcacheKey,
+ pI810->DcacheOffset))
+ return FALSE;
}
if (pI810->HwcursKey != -1) {
- bind.pg_start = (off_t) pI810->HwcursOffset;
- bind.key = pI810->HwcursKey;
- if (ioctl(pI810->gartfd, AGPIOC_BIND, &bind) != 0)
- FatalError("i810: Unable to bind agp hardware cursor"
- " on VT switch!!\n");
+ if (!xf86BindGARTMemory(pScrn->scrnIndex, pI810->HwcursKey,
+ pI810->HwcursOffset))
+ return FALSE;
}
pI810->GttBound = 1;
}
return TRUE;
-#else
- return FALSE;
-#endif
}
Bool
I810UnbindGARTMemory( ScrnInfoPtr pScrn )
{
-#ifdef AGPIOC_ACQUIRE
I810Ptr pI810 = I810PTR(pScrn);
- struct _agp_unbind unbind;
- if (
-#ifdef XF86DRI
- !pI810->directRenderingEnabled &&
-#endif
+ if (xf86AgpGARTSupported() && !pI810->directRenderingEnabled &&
pI810->GttBound) {
- unbind.priority = 0;
- unbind.key = pI810->VramKey;
- if (ioctl(pI810->gartfd, AGPIOC_UNBIND, &unbind) != 0)
- FatalError("i810: Unable to unbind agp memory on VT switch!!\n");
+ if (!xf86UnbindGARTMemory(pScrn->scrnIndex, pI810->VramKey))
+ return FALSE;
if (pI810->DcacheKey != -1) {
- unbind.key = pI810->DcacheKey;
- if (ioctl(pI810->gartfd, AGPIOC_UNBIND, &unbind) != 0)
- FatalError("i810: Unable to unbind agp dcache on VT switch!!\n");
+ if (!xf86UnbindGARTMemory(pScrn->scrnIndex, pI810->DcacheKey))
+ return FALSE;
}
-
if (pI810->HwcursKey != -1) {
- unbind.key = pI810->HwcursKey;
- if (ioctl(pI810->gartfd, AGPIOC_UNBIND, &unbind) != 0)
- FatalError("i810: Unable to unbind agp hardware cursor on "
- "VT switch!!\n");
+ if (!xf86UnbindGARTMemory(pScrn->scrnIndex, pI810->HwcursKey))
+ return FALSE;
}
- if (ioctl(pI810->gartfd, AGPIOC_RELEASE, 0) != 0)
- FatalError("i810: Unable to release agp interface on VT switch!!\n");
+ if (!xf86ReleaseGART(pScrn->scrnIndex))
+ return FALSE;
pI810->GttBound = 0;
}
-
return TRUE;
-#else
- return FALSE;
-#endif
}
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_reg.h b/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_reg.h
index db67793ab..450f88570 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_reg.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_reg.h
@@ -415,7 +415,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define BR00_OP_MONO_SRC_BLT 0x11800000
#define BR00_OP_MONO_SRC_COPY_BLT 0x11000000
#define BR00_OP_MONO_PAT_BLT 0x11C00000
-#define BR00_OP_MONO_SRC_COPY_IMMEDIATE_BLT 0x18400000
+#define BR00_OP_MONO_SRC_COPY_IMMEDIATE_BLT (0x61 << 22)
#define BR00_OP_TEXT_IMMEDIATE_BLT 0xc000000
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_video.c b/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_video.c
index 46706ca98..2a65bc328 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_video.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_video.c
@@ -23,7 +23,7 @@ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
THE USE OR OTHER DEALINGS IN THE SOFTWARE.
**************************************************************************/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_video.c,v 1.3 2000/08/03 12:24:02 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_video.c,v 1.12 2000/09/17 01:36:27 mvojkovi Exp $ */
/*
* i810_video.c: i810 Xv driver. Based on the mga Xv driver by Mark Vojkovich.
@@ -53,9 +53,10 @@ THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "xaa.h"
#include "xaalocal.h"
#include "dixstruct.h"
+#include "fourcc.h"
-#define OFF_DELAY 200 /* milliseconds */
-#define FREE_DELAY 60000
+#define OFF_DELAY 250 /* milliseconds */
+#define FREE_DELAY 15000
#define OFF_TIMER 0x01
#define FREE_TIMER 0x02
@@ -115,18 +116,22 @@ static Atom xvBrightness, xvContrast, xvColorKey;
#define HL_PIXEL_DROPPING 0x00280000
#define HL_DOWN_INTERPOLATION 0x00300000
-#define Y_ADJUST 0x00010000
-#define SOURCE_FORMAT 0x00003C00
+#define Y_ADJUST 0x00010000
+#define OV_BYTE_ORDER 0x0000C000
+#define UV_SWAP 0x00004000
+#define Y_SWAP 0x00008000
+#define Y_AND_UV_SWAP 0x0000C000
+#define SOURCE_FORMAT 0x00003C00
#define RGB_555 0x00000800
#define RGB_565 0x00000C00
#define YUV_422 0x00002000
#define YUV_411 0x00002400
#define YUV_420 0x00003000
#define YUV_410 0x00003800
-#define BUFFER_AND_FIELD 0x00000006
-#define BUFFER0_FIELD0 0x00000000
-#define BUFFER1_FIELD0 0x00000004
-#define OVERLAY_ENABLE 0x00000001
+#define BUFFER_AND_FIELD 0x00000006
+#define BUFFER0_FIELD0 0x00000000
+#define BUFFER1_FIELD0 0x00000004
+#define OVERLAY_ENABLE 0x00000001
/*
* DOV0STA - Display/Overlay 0 Status Register
@@ -135,6 +140,12 @@ static Atom xvBrightness, xvContrast, xvColorKey;
#define MINUV_SCALE 0x1
+#define RGB16ToColorKey(c) \
+ (((c & 0xF800) << 8) | ((c & 0x07E0) << 5) | ((c & 0x001F) << 3))
+
+#define RGB15ToColorKey(c) \
+ (((c & 0x7c00) << 9) | ((c & 0x03E0) << 6) | ((c & 0x001F) << 3))
+
void I810InitVideo(ScreenPtr pScreen)
{
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
@@ -184,11 +195,11 @@ static XF86VideoEncodingRec DummyEncoding[1] =
}
};
-#define NUM_FORMATS 2
+#define NUM_FORMATS 3
static XF86VideoFormatRec Formats[NUM_FORMATS] =
{
- {16, TrueColor}, {24, TrueColor}
+ {15, TrueColor}, {16, TrueColor}, {24, TrueColor}
};
#define NUM_ATTRIBUTES 3
@@ -200,44 +211,14 @@ static XF86AttributeRec Attributes[NUM_ATTRIBUTES] =
{XvSettable | XvGettable, 0, 255, "XV_CONTRAST"}
};
-#define NUM_IMAGES 2
+#define NUM_IMAGES 4
static XF86ImageRec Images[NUM_IMAGES] =
{
- {
- 0x32595559,
- XvYUV,
- LSBFirst,
- {'Y','U','Y','2',
- 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71},
- 16,
- XvPacked,
- 1,
- 0, 0, 0, 0 ,
- 8, 8, 8,
- 1, 2, 2,
- 1, 1, 1,
- {'Y','U','Y','V',
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
- XvTopToBottom
- },
- {
- 0x32315659,
- XvYUV,
- LSBFirst,
- {'Y','V','1','2',
- 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71},
- 12,
- XvPlanar,
- 3,
- 0, 0, 0, 0 ,
- 8, 8, 8,
- 1, 2, 2,
- 1, 2, 2,
- {'Y','V','U',
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
- XvTopToBottom
- }
+ XVIMAGE_YUY2,
+ XVIMAGE_YV12,
+ XVIMAGE_I420,
+ XVIMAGE_UYVY
};
typedef struct {
@@ -271,13 +252,13 @@ typedef struct {
} I810OverlayRegRec, *I810OverlayRegPtr;
typedef struct {
- CARD32 YBuf0VirtAddr;
- CARD32 UBuf0VirtAddr;
- CARD32 VBuf0VirtAddr;
+ CARD32 YBuf0offset;
+ CARD32 UBuf0offset;
+ CARD32 VBuf0offset;
- CARD32 YBuf1VirtAddr;
- CARD32 UBuf1VirtAddr;
- CARD32 VBuf1VirtAddr;
+ CARD32 YBuf1offset;
+ CARD32 UBuf1offset;
+ CARD32 VBuf1offset;
unsigned char currentBuf;
@@ -290,27 +271,22 @@ typedef struct {
CARD32 videoStatus;
Time offTime;
Time freeTime;
+ FBLinearPtr linear;
} I810PortPrivRec, *I810PortPrivPtr;
#define GET_PORT_PRIVATE(pScrn) \
(I810PortPrivPtr)((I810PTR(pScrn))->adaptor->pPortPrivates[0].ptr)
-void I810ResetVideo(ScrnInfoPtr pScrn)
+static void I810ResetVideo(ScrnInfoPtr pScrn)
{
I810Ptr pI810 = I810PTR(pScrn);
+ I810PortPrivPtr pPriv = pI810->adaptor->pPortPrivates[0].ptr;
I810OverlayRegPtr overlay = (I810OverlayRegPtr) (pI810->FbBase + pI810->OverlayStart);
/*
* Default to maximum image size in YV12
*/
- overlay->OBUF_0Y = pI810->OverlayBuf0.Start;
- overlay->OBUF_1Y = pI810->OverlayBuf1.Start;
- overlay->OBUF_0U = overlay->OBUF_0Y + Y_BUF_SIZE;
- overlay->OBUF_0V = overlay->OBUF_0U + (Y_BUF_SIZE >> 2);
- overlay->OBUF_1U = overlay->OBUF_1Y + Y_BUF_SIZE;
- overlay->OBUF_1V = overlay->OBUF_1U + (Y_BUF_SIZE >> 2);
- overlay->OV0STRIDE = IMAGE_MAX_WIDTH | (IMAGE_MAX_WIDTH << 15); /* YV12 */
overlay->YRGB_VPH = 0;
overlay->UV_VPH = 0;
overlay->HORZ_PH = 0;
@@ -324,8 +300,22 @@ void I810ResetVideo(ScrnInfoPtr pScrn)
overlay->UVSCALE = 0x80004000; /* scale factor 1 */
overlay->OV0CLRC0 = 0x4000; /* brightness: 0 contrast: 1.0 */
overlay->OV0CLRC1 = 0x80; /* saturation: bypass */
- overlay->DCLRKV = 0; /* destination color key: 0 */
- overlay->DCLRKM = 0x80FFFFFF; /* destination color key enable */
+
+ /*
+ * Enable destination color keying
+ */
+ switch(pScrn->depth) {
+ case 16: overlay->DCLRKV = RGB16ToColorKey(pPriv->colorKey);
+ overlay->DCLRKM = 0x80070307;
+ break;
+ case 15: overlay->DCLRKV = RGB15ToColorKey(pPriv->colorKey);
+ overlay->DCLRKM = 0x80070707;
+ break;
+ default: overlay->DCLRKV = pPriv->colorKey;
+ overlay->DCLRKM = 0x80000000;
+ break;
+ }
+
overlay->SCLRKVH = 0;
overlay->SCLRKVL = 0;
overlay->SCLRKM = 0; /* source color key disable */
@@ -365,8 +355,8 @@ I810SetupImageVideo(ScreenPtr pScreen)
adapt->pPortPrivates[0].ptr = (pointer)(pPriv);
adapt->pAttributes = Attributes;
- adapt->nImages = 2;
- adapt->nAttributes = 3;
+ adapt->nImages = NUM_IMAGES;
+ adapt->nAttributes = NUM_ATTRIBUTES;
adapt->pImages = Images;
adapt->PutVideo = NULL;
adapt->PutStill = NULL;
@@ -379,29 +369,11 @@ I810SetupImageVideo(ScreenPtr pScreen)
adapt->PutImage = I810PutImage;
adapt->QueryImageAttributes = I810QueryImageAttributes;
- pPriv->colorKey = 0;
+ pPriv->colorKey = pI810->colorKey & ((1 << pScrn->depth) - 1);
pPriv->videoStatus = 0;
pPriv->brightness = 0;
pPriv->contrast = 128;
-
-#ifndef XF86DRI
- if (!I810AllocHigh(&(pI810->OverlayBuf0), &(pI810->SysMem), Y_BUF_SIZE*2))
- return NULL;
- if (!I810AllocHigh(&(pI810->OverlayBuf1), &(pI810->SysMem), Y_BUF_SIZE*2))
- return NULL;
-#endif
-
- if((!pI810->OverlayBuf0.Start) || (!pI810->OverlayBuf1.Start))
- return NULL;
-
- pPriv->YBuf0VirtAddr = (CARD32) (pI810->FbBase + pI810->OverlayBuf0.Start);
- pPriv->UBuf0VirtAddr = pPriv->YBuf0VirtAddr + Y_BUF_SIZE;
- pPriv->VBuf0VirtAddr = pPriv->UBuf0VirtAddr + (Y_BUF_SIZE >> 2);
-
- pPriv->YBuf1VirtAddr = (CARD32) (pI810->FbBase + pI810->OverlayBuf1.Start);
- pPriv->UBuf1VirtAddr = pPriv->YBuf1VirtAddr + Y_BUF_SIZE;
- pPriv->VBuf1VirtAddr = pPriv->UBuf1VirtAddr + (Y_BUF_SIZE >> 2);
-
+ pPriv->linear = NULL;
pPriv->currentBuf = 0;
/* gotta uninit this someplace */
@@ -541,6 +513,10 @@ I810StopVideo(ScrnInfoPtr pScrn, pointer data, Bool exit)
overlay->OV0CMD &= 0xFFFFFFFE;
OVERLAY_UPDATE(pI810->OverlayPhysical);
}
+ if(pPriv->linear) {
+ xf86FreeOffscreenLinear(pPriv->linear);
+ pPriv->linear = NULL;
+ }
pPriv->videoStatus = 0;
} else {
if(pPriv->videoStatus & CLIENT_VIDEO_ON) {
@@ -580,7 +556,14 @@ I810SetPortAttribute(
} else
if(attribute == xvColorKey) {
pPriv->colorKey = value;
- overlay->DCLRKV = value;
+ switch(pScrn->depth) {
+ case 16: overlay->DCLRKV = RGB16ToColorKey(pPriv->colorKey);
+ break;
+ case 15: overlay->DCLRKV = RGB15ToColorKey(pPriv->colorKey);
+ break;
+ default: overlay->DCLRKV = pPriv->colorKey;
+ break;
+ }
OVERLAY_UPDATE(pI810->OverlayPhysical);
REGION_EMPTY(pScrn->pScreen, &pPriv->clip);
} else return BadMatch;
@@ -621,8 +604,6 @@ I810QueryBestSize(
){
*p_w = drw_w;
*p_h = drw_h;
-
- if(*p_w > 16384) *p_w = 16384;
}
@@ -631,6 +612,7 @@ I810CopyPackedData(
ScrnInfoPtr pScrn,
unsigned char *buf,
int srcPitch,
+ int dstPitch,
int top,
int left,
int h,
@@ -644,15 +626,15 @@ I810CopyPackedData(
src = buf + (top*srcPitch) + (left<<1);
if (pPriv->currentBuf == 0)
- dst = (unsigned char*) pPriv->YBuf0VirtAddr;
+ dst = pI810->FbBase + pPriv->YBuf0offset;
else
- dst = (unsigned char*) pPriv->YBuf1VirtAddr;
+ dst = pI810->FbBase + pPriv->YBuf1offset;
w <<= 1;
while(h--) {
memcpy(dst, src, w);
src += srcPitch;
- dst += 720*2;
+ dst += dstPitch;
}
}
@@ -661,10 +643,13 @@ I810CopyPlanarData(
ScrnInfoPtr pScrn,
unsigned char *buf,
int srcPitch,
+ int dstPitch, /* of chroma */
+ int srcH,
int top,
int left,
int h,
- int w
+ int w,
+ int id
)
{
I810Ptr pI810 = I810PTR(pScrn);
@@ -675,40 +660,54 @@ I810CopyPlanarData(
/* Copy Y data */
src1 = buf + (top*srcPitch) + left;
if (pPriv->currentBuf == 0)
- dst1 = (unsigned char *) pPriv->YBuf0VirtAddr;
+ dst1 = pI810->FbBase + pPriv->YBuf0offset;
else
- dst1 = (unsigned char *) pPriv->YBuf1VirtAddr;
+ dst1 = pI810->FbBase + pPriv->YBuf1offset;
for (i = 0; i < h; i++) {
memcpy(dst1, src1, w);
src1 += srcPitch;
- dst1 += 720;
+ dst1 += dstPitch << 1;
}
- /* Copy V data */
- src2 = buf + (h*srcPitch) + (top*(srcPitch>>1)) + (left>>1);
- if (pPriv->currentBuf == 0)
- dst2 = (unsigned char *) pPriv->VBuf0VirtAddr;
- else
- dst2 = (unsigned char *) pPriv->VBuf1VirtAddr;
+ /* Copy V data for YV12, or U data for I420 */
+ src2 = buf + (srcH*srcPitch) + ((top*srcPitch)>>2) + (left>>1);
+ if (pPriv->currentBuf == 0) {
+ if (id == FOURCC_I420)
+ dst2 = pI810->FbBase + pPriv->UBuf0offset;
+ else
+ dst2 = pI810->FbBase + pPriv->VBuf0offset;
+ } else {
+ if (id == FOURCC_I420)
+ dst2 = pI810->FbBase + pPriv->UBuf1offset;
+ else
+ dst2 = pI810->FbBase + pPriv->VBuf1offset;
+ }
for (i = 0; i < h/2; i++) {
memcpy(dst2, src2, w/2);
src2 += srcPitch>>1;
- dst2 += 360;
+ dst2 += dstPitch;
}
- /* Copy U data */
- src3 = buf + (h*srcPitch) + (h*srcPitch/4) + (top*(srcPitch>>1)) + (left>>1);
- if (pPriv->currentBuf == 0)
- dst3 = (unsigned char *) pPriv->UBuf0VirtAddr;
- else
- dst3 = (unsigned char *) pPriv->UBuf1VirtAddr;
+ /* Copy U data for YV12, or V data for I420 */
+ src3 = buf + (srcH*srcPitch) + ((srcH*srcPitch)>>2) + ((top*srcPitch)>>2) + (left>>1);
+ if (pPriv->currentBuf == 0) {
+ if (id == FOURCC_I420)
+ dst3 = pI810->FbBase + pPriv->VBuf0offset;
+ else
+ dst3 = pI810->FbBase + pPriv->UBuf0offset;
+ } else {
+ if (id == FOURCC_I420)
+ dst3 = pI810->FbBase + pPriv->VBuf1offset;
+ else
+ dst3 = pI810->FbBase + pPriv->UBuf1offset;
+ }
for (i = 0; i < h/2; i++) {
memcpy(dst3, src3, w/2);
src3 += srcPitch>>1;
- dst3 += 360;
+ dst3 += dstPitch;
}
}
@@ -717,6 +716,7 @@ I810DisplayVideo(
ScrnInfoPtr pScrn,
int id,
short width, short height,
+ int dstPitch, /* of chroma for 4:2:0 */
int x1, int y1, int x2, int y2,
BoxPtr dstBox,
short src_w, short src_h,
@@ -730,12 +730,14 @@ I810DisplayVideo(
unsigned int swidth;
switch(id) {
- case 0x32315659: /* YV12 */
+ case FOURCC_YV12:
+ case FOURCC_I420:
swidth = (width + 7) & ~7;
overlay->SWID = (swidth << 15) | swidth;
overlay->SWIDQW = (swidth << 12) | (swidth >> 3);
break;
- case 0x32595559: /* YUY2 */
+ case FOURCC_UYVY:
+ case FOURCC_YUY2:
default:
swidth = ((width + 3) & ~3) << 1;
overlay->SWID = swidth;
@@ -748,6 +750,14 @@ I810DisplayVideo(
overlay->DWINSZ = ((dstBox->y2 - dstBox->y1) << 16) |
(dstBox->x2 - dstBox->x1);
+ /* buffer locations */
+ overlay->OBUF_0Y = pPriv->YBuf0offset;
+ overlay->OBUF_1Y = pPriv->YBuf1offset;
+ overlay->OBUF_0U = pPriv->UBuf0offset;
+ overlay->OBUF_0V = pPriv->VBuf0offset;
+ overlay->OBUF_1U = pPriv->UBuf1offset;
+ overlay->OBUF_1V = pPriv->VBuf1offset;
+
/*
* Calculate horizontal and vertical scaling factors, default to 1:1
*/
@@ -846,16 +856,21 @@ I810DisplayVideo(
}
switch(id) {
- case 0x32315659: /* YV12 */
- overlay->OV0STRIDE = IMAGE_MAX_WIDTH | (IMAGE_MAX_WIDTH << 15);
+ case FOURCC_YV12:
+ case FOURCC_I420:
+ overlay->OV0STRIDE = (dstPitch << 1) | (dstPitch << 16);
overlay->OV0CMD &= ~SOURCE_FORMAT;
overlay->OV0CMD |= YUV_420;
break;
- case 0x32595559: /* YUY2 */
- overlay->OV0STRIDE = IMAGE_MAX_WIDTH << 1;
+ case FOURCC_UYVY:
+ case FOURCC_YUY2:
+ default:
+ overlay->OV0STRIDE = dstPitch;
overlay->OV0CMD &= ~SOURCE_FORMAT;
overlay->OV0CMD |= YUV_422;
- default: /* we may have to do something different here ? */
+ overlay->OV0CMD &= ~OV_BYTE_ORDER;
+ if (id == FOURCC_UYVY)
+ overlay->OV0CMD |= Y_SWAP;
break;
}
@@ -867,14 +882,46 @@ I810DisplayVideo(
OVERLAY_UPDATE(pI810->OverlayPhysical);
- /* wait for the current buffer flipped in */
- while (((INREG(DOV0STA)&0x00100000)>>20) != pPriv->currentBuf);
+}
- /* buffer swap */
- if (pPriv->currentBuf == 0)
- pPriv->currentBuf = 1;
- else
- pPriv->currentBuf = 0;
+static FBLinearPtr
+I810AllocateMemory(
+ ScrnInfoPtr pScrn,
+ FBLinearPtr linear,
+ int size
+){
+ ScreenPtr pScreen;
+ FBLinearPtr new_linear;
+
+ if(linear) {
+ if(linear->size >= size)
+ return linear;
+
+ if(xf86ResizeOffscreenLinear(linear, size))
+ return linear;
+
+ xf86FreeOffscreenLinear(linear);
+ }
+
+ pScreen = screenInfo.screens[pScrn->scrnIndex];
+
+ new_linear = xf86AllocateOffscreenLinear(pScreen, size, 4,
+ NULL, NULL, NULL);
+
+ if(!new_linear) {
+ int max_size;
+
+ xf86QueryLargestOffscreenLinear(pScreen, &max_size, 4,
+ PRIORITY_EXTREME);
+
+ if(max_size < size) return NULL;
+
+ xf86PurgeUnlockedOffscreenAreas(pScreen);
+ new_linear = xf86AllocateOffscreenLinear(pScreen, size, 4,
+ NULL, NULL, NULL);
+ }
+
+ return new_linear;
}
static int
@@ -889,45 +936,73 @@ I810PutImage(
Bool sync,
RegionPtr clipBoxes, pointer data
){
- I810PortPrivPtr pPriv = (I810PortPrivPtr)data;
- INT32 x1, x2, y1, y2;
- int srcPitch;
- int top, left, npixels, nlines;
- BoxRec dstBox;
-
- if(drw_w > 16384) drw_w = 16384;
-
- /* Clip */
- x1 = src_x;
- x2 = src_x + src_w;
- y1 = src_y;
- y2 = src_y + src_h;
-
- dstBox.x1 = drw_x;
- dstBox.x2 = drw_x + drw_w;
- dstBox.y1 = drw_y;
- dstBox.y2 = drw_y + drw_h;
-
- I810ClipVideo(&dstBox, &x1, &x2, &y1, &y2,
- REGION_EXTENTS(pScreen, clipBoxes), width, height);
-
- if((x1 >= x2) || (y1 >= y2))
- return Success;
-
- dstBox.x1 -= pScrn->frameX0;
- dstBox.x2 -= pScrn->frameX0;
- dstBox.y1 -= pScrn->frameY0;
- dstBox.y2 -= pScrn->frameY0;
-
- switch(id) {
- case 0x32315659: /* YV12 */
- srcPitch = (width + 3) & ~3;
- break;
- case 0x32595559: /* YUY2 */
- default:
- srcPitch = (width << 1);
- break;
- }
+ I810Ptr pI810 = I810PTR(pScrn);
+ I810PortPrivPtr pPriv = (I810PortPrivPtr)data;
+ INT32 x1, x2, y1, y2;
+ int srcPitch, dstPitch;
+ int top, left, npixels, nlines, size;
+ BoxRec dstBox;
+
+ /* Clip */
+ x1 = src_x;
+ x2 = src_x + src_w;
+ y1 = src_y;
+ y2 = src_y + src_h;
+
+ dstBox.x1 = drw_x;
+ dstBox.x2 = drw_x + drw_w;
+ dstBox.y1 = drw_y;
+ dstBox.y2 = drw_y + drw_h;
+
+ I810ClipVideo(&dstBox, &x1, &x2, &y1, &y2,
+ REGION_EXTENTS(pScreen, clipBoxes), width, height);
+
+ if((x1 >= x2) || (y1 >= y2))
+ return Success;
+
+ dstBox.x1 -= pScrn->frameX0;
+ dstBox.x2 -= pScrn->frameX0;
+ dstBox.y1 -= pScrn->frameY0;
+ dstBox.y2 -= pScrn->frameY0;
+
+ switch(id) {
+ case FOURCC_YV12:
+ case FOURCC_I420:
+ srcPitch = (width + 3) & ~3;
+ dstPitch = ((width >> 1) + 7) & ~7; /* of chroma */
+ size = dstPitch * height * 3;
+ break;
+ case FOURCC_UYVY:
+ case FOURCC_YUY2:
+ default:
+ srcPitch = (width << 1);
+ dstPitch = (srcPitch + 7) & ~7;
+ size = dstPitch * height;
+ break;
+ }
+
+ if(!(pPriv->linear = I810AllocateMemory(pScrn, pPriv->linear,
+ (pScrn->bitsPerPixel == 16) ? size : (size >> 1))))
+ return BadAlloc;
+
+ /* fixup pointers */
+ pPriv->YBuf0offset = pPriv->linear->offset * pI810->cpp;
+ pPriv->UBuf0offset = pPriv->YBuf0offset + (dstPitch * 2 * height);
+ pPriv->VBuf0offset = pPriv->UBuf0offset + (dstPitch * height >> 1);
+
+ pPriv->YBuf1offset = (pPriv->linear->offset * pI810->cpp) + size;
+ pPriv->UBuf1offset = pPriv->YBuf1offset + (dstPitch * 2 * height);
+ pPriv->VBuf1offset = pPriv->UBuf1offset + (dstPitch * height >> 1);
+
+
+ /* wait for the last rendered buffer to be flipped in */
+ while (((INREG(DOV0STA)&0x00100000)>>20) != pPriv->currentBuf);
+
+ /* buffer swap */
+ if (pPriv->currentBuf == 0)
+ pPriv->currentBuf = 1;
+ else
+ pPriv->currentBuf = 0;
/* copy data */
top = y1 >> 16;
@@ -935,14 +1010,19 @@ I810PutImage(
npixels = ((((x2 + 0xffff) >> 16) + 1) & ~1) - left;
switch(id) {
- case 0x32315659: /* YV12 */
+ case FOURCC_YV12:
+ case FOURCC_I420:
+ top &= ~1;
nlines = ((((y2 + 0xffff) >> 16) + 1) & ~1) - top;
- I810CopyPlanarData(pScrn, buf, srcPitch, top, left, nlines, npixels);
+ I810CopyPlanarData(pScrn, buf, srcPitch, dstPitch, height, top, left,
+ nlines, npixels, id);
break;
- case 0x32595559: /* YUY2 */
+ case FOURCC_UYVY:
+ case FOURCC_YUY2:
default:
nlines = ((y2 + 0xffff) >> 16) - top;
- I810CopyPackedData(pScrn, buf, srcPitch, top, left, nlines, npixels);
+ I810CopyPackedData(pScrn, buf, srcPitch, dstPitch, top, left, nlines,
+ npixels);
break;
}
@@ -956,7 +1036,7 @@ I810PutImage(
}
- I810DisplayVideo(pScrn, id, width, height,
+ I810DisplayVideo(pScrn, id, width, height, dstPitch,
x1, y1, x2, y2, &dstBox, src_w, src_h, drw_w, drw_h);
pPriv->videoStatus = CLIENT_VIDEO_ON;
@@ -981,7 +1061,8 @@ I810QueryImageAttributes(
if(offsets) offsets[0] = 0;
switch(id) {
- case 0x32315659: /* YV12 */
+ case FOURCC_YV12:
+ case FOURCC_I420:
*h = (*h + 1) & ~1;
size = (*w + 3) & ~3;
if(pitches) pitches[0] = size;
@@ -994,7 +1075,8 @@ I810QueryImageAttributes(
if(offsets) offsets[2] = size;
size += tmp;
break;
- case 0x32595559: /* YUY2 */
+ case FOURCC_UYVY:
+ case FOURCC_YUY2:
default:
size = *w << 1;
if(pitches) pitches[0] = size;
@@ -1037,10 +1119,10 @@ I810BlockHandler (
}
} else { /* FREE_TIMER */
if(pPriv->freeTime < currentTime.milliseconds) {
- /*
- * If we want to allocate the buffers on-demand, then should
- * free the YUV buffers here
- */
+ if(pPriv->linear) {
+ xf86FreeOffscreenLinear(pPriv->linear);
+ pPriv->linear = NULL;
+ }
pPriv->videoStatus = 0;
}
}
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_wmark.c b/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_wmark.c
index f2ed336ca..447e0521e 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_wmark.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_wmark.c
@@ -25,12 +25,14 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
**************************************************************************/
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_wmark.c,v 1.4 2000/09/08 22:43:06 mvojkovi Exp $ */
/*
* Authors:
* Keith Whitwell <keithw@precisioninsight.com>
*/
+#include "xf86.h"
#include "i810.h"
struct wm_info {
@@ -253,7 +255,7 @@ unsigned int I810CalcWatermark( ScrnInfoPtr pScrn, double freq, Bool dcache )
int i;
if (pI810->LmFreqSel == 100) {
- switch(pScrn->depth) {
+ switch(pScrn->bitsPerPixel) {
case 8:
tab = i810_wm_8_100;
nr = Elements(i810_wm_8_100);
@@ -263,7 +265,6 @@ unsigned int I810CalcWatermark( ScrnInfoPtr pScrn, double freq, Bool dcache )
nr = Elements(i810_wm_16_100);
break;
case 24:
- case 32:
tab = i810_wm_24_100;
nr = Elements(i810_wm_24_100);
break;
@@ -271,7 +272,7 @@ unsigned int I810CalcWatermark( ScrnInfoPtr pScrn, double freq, Bool dcache )
return 0;
}
} else {
- switch(pScrn->depth) {
+ switch(pScrn->bitsPerPixel) {
case 8:
tab = i810_wm_8_133;
nr = Elements(i810_wm_8_133);
@@ -281,7 +282,6 @@ unsigned int I810CalcWatermark( ScrnInfoPtr pScrn, double freq, Bool dcache )
nr = Elements(i810_wm_16_133);
break;
case 24:
- case 32:
tab = i810_wm_24_133;
nr = Elements(i810_wm_24_133);
break;
@@ -295,8 +295,9 @@ unsigned int I810CalcWatermark( ScrnInfoPtr pScrn, double freq, Bool dcache )
if (i == nr)
i--;
- ErrorF("%s %s: chose watermark 0x%x: (tab.freq %.1f)\n",
- XCONFIG_PROBED, NAME, tab[i].wm, tab[i].freq);
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "chose watermark 0x%x: (tab.freq %.1f)\n",
+ tab[i].wm, tab[i].freq);
/* None of these values (sourced from intel) have watermarks for
* the dcache memory. Fake it for now by using the same watermark
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt_driver.c
index de3b0e656..62ae5e47a 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt_driver.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt_driver.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt_driver.c,v 1.8 2000/08/01 20:05:43 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt_driver.c,v 1.9 2000/08/23 22:10:13 tsi Exp $ */
/*
* Copyright 2000 Ani Joshi <ajoshi@unixbox.com>
@@ -225,7 +225,7 @@ pointer IMSTTSetup(pointer module, pointer opts, int *errmaj,
if (!setupDone) {
setupDone = TRUE;
xf86AddDriver(&IMSTT, module, 0);
- LoaderRefSymLists(0, cfbSymbols, xaaSymbols, 0, 9, fbdevHWSymbols, 0, 0, 0, NULL);
+ LoaderRefSymLists(cfbSymbols, xaaSymbols, fbdevHWSymbols, NULL);
return (pointer) 1;
} else {
if (errmaj)
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/mga/Imakefile b/xc/programs/Xserver/hw/xfree86/drivers/mga/Imakefile
index 94b7e71fa..abfc49e87 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/mga/Imakefile
+++ b/xc/programs/Xserver/hw/xfree86/drivers/mga/Imakefile
@@ -1,4 +1,4 @@
-XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/Imakefile,v 1.34 2000/07/08 22:09:09 mvojkovi Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/Imakefile,v 1.35 2000/09/20 00:09:22 keithp Exp $
XCOMM
XCOMM This is an Imakefile for the MGA driver.
XCOMM
@@ -51,6 +51,7 @@ INCLUDES = -I. $(MGAHALINCLUDES) -I$(XF86COMSRC) -I$(XF86OSSRC) \
-I$(SERVERSRC)/Xext -I$(XF86SRC)/xf8_32bpp\
-I$(FONTINCSRC) -I$(SERVERSRC)/include -I$(XINCLUDESRC) \
-I$(XF86SRC)/xf24_32bpp -I$(XF86SRC)/shadowfb -I$(EXTINCSRC) \
+ -I$(SERVERSRC)/render \
-I$(XF86OSSRC)/vbe $(DRIINCLUDES)
#endif
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/mga/mga.h b/xc/programs/Xserver/hw/xfree86/drivers/mga/mga.h
index fc929dbb3..db606283c 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/mga/mga.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/mga/mga.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga.h,v 1.60 2000/07/08 22:09:10 mvojkovi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga.h,v 1.61 2000/08/21 00:36:37 mvojkovi Exp $ */
/*
* MGA Millennium (MGA2064W) functions
*
@@ -127,6 +127,13 @@ typedef struct {
/* Card-specific driver information */
+typedef struct {
+ Bool update;
+ unsigned char red;
+ unsigned char green;
+ unsigned char blue;
+} MGAPaletteInfo;
+
#define MGAPTR(p) ((MGAPtr)((p)->driverPrivate))
#ifdef DISABLE_VGA_IO
@@ -286,6 +293,9 @@ typedef struct {
int x, int y, int w, int h);
void (*RestoreAccelState)(ScrnInfoPtr pScrn);
int allowedWidth;
+ void (*VideoTimerCallback)(ScrnInfoPtr, Time);
+ void (*PaletteLoadCallback)(ScrnInfoPtr);
+ MGAPaletteInfo palinfo[256]; /* G400 hardware bug workaround */
} MGARec, *MGAPtr;
#ifdef XF86DRI
@@ -307,6 +317,7 @@ extern CARD32 MGAAtypeNoBLK[16];
#define MGA_NO_PLANEMASK 0x00000080
#define USE_LINEAR_EXPANSION 0x00000100
#define LARGE_ADDRESSES 0x00000200
+
#define MGAIOMAPSIZE 0x00004000
#define MGAILOADMAPSIZE 0x00400000
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dacG.c b/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dacG.c
index d63fa29cc..091dd3edb 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dacG.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dacG.c
@@ -2,7 +2,7 @@
* MGA-1064, MGA-G100, MGA-G200, MGA-G400 RAMDAC driver
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dacG.c,v 1.36 2000/06/17 00:03:19 martin Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dacG.c,v 1.37 2000/08/21 00:36:37 mvojkovi Exp $ */
/*
* This is a first cut at a non-accelerated version to work with the
@@ -573,6 +573,29 @@ MGAGInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
* MGAGLoadPalette
*/
+static void
+MGAPaletteLoadCallback(ScrnInfoPtr pScrn)
+{
+ MGAPtr pMga = MGAPTR(pScrn);
+ MGAPaletteInfo *pal = pMga->palinfo;
+ int i;
+
+ while (!(INREG8(0x1FDA) & 0x08));
+
+ for(i = 0; i < 256; i++) {
+ if(pal->update) {
+ outMGAdreg(MGA1064_WADR_PAL, i);
+ outMGAdreg(MGA1064_COL_PAL, pal->red);
+ outMGAdreg(MGA1064_COL_PAL, pal->green);
+ outMGAdreg(MGA1064_COL_PAL, pal->blue);
+ pal->update = FALSE;
+ }
+ pal++;
+ }
+
+ pMga->PaletteLoadCallback = NULL;
+}
+
void MGAGLoadPalette(
ScrnInfoPtr pScrn,
int numColors,
@@ -581,17 +604,30 @@ void MGAGLoadPalette(
VisualPtr pVisual
){
MGAPtr pMga = MGAPTR(pScrn);
- int i, index;
- if(pMga->CurrentLayout.Overlay8Plus24 && (pVisual->nplanes != 8))
+ if((pMga->CurrentLayout.Overlay8Plus24) && (pVisual->nplanes != 8))
return;
- for(i = 0; i < numColors; i++) {
- index = indices[i];
- outMGAdreg(MGA1064_WADR_PAL, index);
- outMGAdreg(MGA1064_COL_PAL, colors[index].red);
- outMGAdreg(MGA1064_COL_PAL, colors[index].green);
- outMGAdreg(MGA1064_COL_PAL, colors[index].blue);
+ if(pMga->Chipset == PCI_CHIP_MGAG400){
+ /* load them at the retrace in the block handler instead to
+ work around some problems with static on the screen */
+ while(numColors--) {
+ pMga->palinfo[*indices].update = TRUE;
+ pMga->palinfo[*indices].red = colors[*indices].red;
+ pMga->palinfo[*indices].green = colors[*indices].green;
+ pMga->palinfo[*indices].blue = colors[*indices].blue;
+ indices++;
+ }
+ pMga->PaletteLoadCallback = MGAPaletteLoadCallback;
+ return;
+ } else {
+ while(numColors--) {
+ outMGAdreg(MGA1064_WADR_PAL, *indices);
+ outMGAdreg(MGA1064_COL_PAL, colors[*indices].red);
+ outMGAdreg(MGA1064_COL_PAL, colors[*indices].green);
+ outMGAdreg(MGA1064_COL_PAL, colors[*indices].blue);
+ indices++;
+ }
}
}
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dri.c b/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dri.c
index 3ee7a3ad5..7dbecf882 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dri.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dri.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dri.c,v 1.5 2000/06/23 23:43:44 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dri.c,v 1.7 2000/08/25 13:42:37 dawes Exp $ */
#include "xf86.h"
#include "xf86_OSproc.h"
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_driver.c
index 690b6086d..56c4e192b 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_driver.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_driver.c
@@ -43,7 +43,7 @@
* Fixed 32bpp hires 8MB horizontal line glitch at middle right
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_driver.c,v 1.165 2000/07/11 01:46:36 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_driver.c,v 1.167 2000/09/20 00:09:22 keithp Exp $ */
/*
* This is a first cut at a non-accelerated version to work with the
@@ -81,7 +81,7 @@
#include "fb.h"
#include "cfb8_32.h"
-
+#include "dixstruct.h"
#include "mga_reg.h"
#include "mga.h"
@@ -97,6 +97,10 @@
#endif
+#ifdef RENDER
+#include "picturestr.h"
+#endif
+
/*
* Forward definitions for the functions that make up the driver.
*/
@@ -138,6 +142,7 @@ static void MGASave(ScrnInfoPtr pScrn);
static void MGARestore(ScrnInfoPtr pScrn);
static Bool MGAModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode);
void MGAAdjustFrameCrtc2(int scrnIndex, int x, int y, int flags);
+static void MGABlockHandler(int, pointer, pointer, pointer);
static int MGAEntityIndex = -1;
@@ -453,12 +458,6 @@ mgaSetup(pointer module, pointer opts, int *errmaj, int *errmin)
#endif /* XFree86LOADER */
-/*
- * This is intentionally screen-independent. It indicates the binding
- * choice made in the first PreInit.
- */
-static int pix24bpp = 0;
-
/*
* ramdac info structure initialization
*/
@@ -1090,7 +1089,7 @@ VgaIOEnable(void *arg)
}
#endif /* DISABLE_VGA_IO */
-void
+static void
MGAProbeDDC(ScrnInfoPtr pScrn, int index)
{
vbeInfoPtr pVbe;
@@ -1320,10 +1319,6 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
}
xf86PrintDepthBpp(pScrn);
- /* Get the depth24 pixmap format */
- if (pScrn->depth == 24 && pix24bpp == 0)
- pix24bpp = xf86GetBppFromDepth(pScrn, 24);
-
/*
* This must happen after pScrn->display has been set because
* xf86SetWeight references it.
@@ -1340,11 +1335,6 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
}
}
-#if 0
- if (!xf86SetDefaultVisual(pScrn, -1))
- return FALSE;
-#endif
-
bytesPerPixel = pScrn->bitsPerPixel / 8;
/* We use a programamble clock */
@@ -2202,6 +2192,10 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
return FALSE;
}
reqSym = "fbScreenInit";
+ xf86LoaderReqSymbols("fbScreenInit", NULL);
+#ifdef RENDER
+ xf86LoaderReqSymbols("fbPictureInit", NULL);
+#endif
}
xf86LoaderReqSymbols(reqSym, NULL);
@@ -2783,6 +2777,8 @@ MGAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
miGetDefaultVisualMask(pScrn->depth),
pScrn->rgbBits, pScrn->defaultVisual))
return FALSE;
+ if (!miSetPixmapDepths ())
+ return FALSE;
}
@@ -2836,6 +2832,10 @@ MGAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
ret = fbScreenInit(pScreen, FBStart, width, height,
pScrn->xDpi, pScrn->yDpi,
displayWidth, pScrn->bitsPerPixel);
+#ifdef RENDER
+ if (ret)
+ fbPictureInit (pScreen, 0, 0);
+#endif
}
if (!ret)
@@ -2859,6 +2859,9 @@ MGAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
xf86SetBlackWhitePixels(pScreen);
+ pMga->BlockHandler = pScreen->BlockHandler;
+ pScreen->BlockHandler = MGABlockHandler;
+
if(!pMga->ShadowFB) /* hardware cursor needs to wrap this layer */
MGADGAInit(pScreen);
@@ -3387,6 +3390,31 @@ MGADisplayPowerManagementSet(ScrnInfoPtr pScrn, int PowerManagementMode,
}
#endif
+
+static void
+MGABlockHandler (
+ int i,
+ pointer blockData,
+ pointer pTimeout,
+ pointer pReadmask
+){
+ ScreenPtr pScreen = screenInfo.screens[i];
+ ScrnInfoPtr pScrn = xf86Screens[i];
+ MGAPtr pMga = MGAPTR(pScrn);
+
+ if(pMga->PaletteLoadCallback)
+ (*pMga->PaletteLoadCallback)(pScrn);
+
+ pScreen->BlockHandler = pMga->BlockHandler;
+ (*pScreen->BlockHandler) (i, blockData, pTimeout, pReadmask);
+ pScreen->BlockHandler = MGABlockHandler;
+
+ if(pMga->VideoTimerCallback) {
+ UpdateCurrentTime();
+ (*pMga->VideoTimerCallback)(pScrn, currentTime.milliseconds);
+ }
+}
+
#if defined (DEBUG)
/*
* some functions to track input/output in the server
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_video.c b/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_video.c
index 444a1fc2b..1bb193516 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_video.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_video.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_video.c,v 1.15 2000/06/17 00:03:20 martin Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_video.c,v 1.17 2000/09/08 02:22:00 mvojkovi Exp $ */
#include "xf86.h"
#include "xf86_OSproc.h"
@@ -30,7 +30,7 @@
#define TIMER_MASK (OFF_TIMER | FREE_TIMER)
-#define MGA_MAX_PORTS 16
+#define MGA_MAX_PORTS 32
#ifndef XvExtension
void MGAInitVideo(ScreenPtr pScreen) {}
@@ -55,10 +55,11 @@ static int MGAPutImage(ScrnInfoPtr, short, short, short, short, short,
static int MGAQueryImageAttributes(ScrnInfoPtr, int, unsigned short *,
unsigned short *, int *, int *);
-static void MGABlockHandler(int, pointer, pointer, pointer);
static void MGAResetVideoOverlay(ScrnInfoPtr);
+static void MGAVideoTimerCallback(ScrnInfoPtr pScrn, Time time);
+
#define MAKE_ATOM(a) MakeAtom(a, sizeof(a) - 1, TRUE)
@@ -93,8 +94,6 @@ void MGAInitVideo(ScreenPtr pScreen)
if(!pMga->Overlay8Plus24 /* && !dualhead */)
MGAInitOffscreenImages(pScreen);
- pMga->BlockHandler = pScreen->BlockHandler;
- pScreen->BlockHandler = MGABlockHandler;
}
@@ -141,10 +140,9 @@ static XF86VideoEncodingRec DummyEncoding[2] =
}
};
-#define NUM_FORMATS_OVERLAY 3
-#define NUM_FORMATS_TEXTURE 6
+#define NUM_FORMATS 6
-static XF86VideoFormatRec Formats[NUM_FORMATS_TEXTURE] =
+static XF86VideoFormatRec Formats[NUM_FORMATS] =
{
{15, TrueColor}, {16, TrueColor}, {24, TrueColor},
{15, DirectColor}, {16, DirectColor}, {24, DirectColor}
@@ -251,7 +249,7 @@ MGASetupImageVideoOverlay(ScreenPtr pScreen)
adapt->name = "Matrox G-Series Backend Scaler";
adapt->nEncodings = 1;
adapt->pEncodings = &DummyEncoding[0];
- adapt->nFormats = NUM_FORMATS_OVERLAY;
+ adapt->nFormats = NUM_FORMATS;
adapt->pFormats = Formats;
adapt->nPorts = 1;
adapt->pAttributes = Attributes;
@@ -297,7 +295,7 @@ MGASetupImageVideoTexture(ScreenPtr pScreen)
adapt->name = "Matrox G-Series Texture Engine";
adapt->nEncodings = 1;
adapt->pEncodings = &DummyEncoding[1];
- adapt->nFormats = NUM_FORMATS_TEXTURE;
+ adapt->nFormats = NUM_FORMATS;
adapt->pFormats = Formats;
adapt->nPorts = MGA_MAX_PORTS;
adapt->pAttributes = NULL;
@@ -940,7 +938,8 @@ MGAPutImage(
x1, y1, x2, y2, &dstBox, src_w, src_h, drw_w, drw_h);
pPriv->videoStatus = CLIENT_VIDEO_ON;
- }
+ }
+ pMga->VideoTimerCallback = MGAVideoTimerCallback;
return Success;
}
@@ -995,41 +994,30 @@ MGAQueryImageAttributes(
}
static void
-MGABlockHandler (
- int i,
- pointer blockData,
- pointer pTimeout,
- pointer pReadmask
-){
- ScreenPtr pScreen = screenInfo.screens[i];
- ScrnInfoPtr pScrn = xf86Screens[i];
- MGAPtr pMga = MGAPTR(pScrn);
+MGAVideoTimerCallback(ScrnInfoPtr pScrn, Time time)
+{
+ MGAPtr pMga = MGAPTR(pScrn);
MGAPortPrivPtr pPriv = pMga->portPrivate;
- pScreen->BlockHandler = pMga->BlockHandler;
-
- (*pScreen->BlockHandler) (i, blockData, pTimeout, pReadmask);
-
- pScreen->BlockHandler = MGABlockHandler;
-
if(pPriv->videoStatus & TIMER_MASK) {
- UpdateCurrentTime();
if(pPriv->videoStatus & OFF_TIMER) {
- if(pPriv->offTime < currentTime.milliseconds) {
+ if(pPriv->offTime < time) {
OUTREG(MGAREG_BESCTL, 0);
pPriv->videoStatus = FREE_TIMER;
- pPriv->freeTime = currentTime.milliseconds + FREE_DELAY;
+ pPriv->freeTime = time + FREE_DELAY;
}
} else { /* FREE_TIMER */
- if(pPriv->freeTime < currentTime.milliseconds) {
+ if(pPriv->freeTime < time) {
if(pPriv->area) {
xf86FreeOffscreenArea(pPriv->area);
pPriv->area = NULL;
}
pPriv->videoStatus = 0;
+ pMga->VideoTimerCallback = NULL;
}
}
- }
+ } else /* shouldn't get here */
+ pMga->VideoTimerCallback = NULL;
}
@@ -1199,6 +1187,7 @@ MGADisplaySurface(
UpdateCurrentTime();
portPriv->videoStatus = FREE_TIMER;
portPriv->freeTime = currentTime.milliseconds + FREE_DELAY;
+ pMga->VideoTimerCallback = MGAVideoTimerCallback;
}
return Success;
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/r128/Imakefile b/xc/programs/Xserver/hw/xfree86/drivers/r128/Imakefile
index 06dd69865..23fa7504d 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/r128/Imakefile
+++ b/xc/programs/Xserver/hw/xfree86/drivers/r128/Imakefile
@@ -1,4 +1,4 @@
-XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/r128/Imakefile,v 1.8 2000/06/17 00:03:21 martin Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/r128/Imakefile,v 1.9 2000/09/20 00:09:26 keithp Exp $
XCOMM
XCOMM This is the Imakefile for the ATI Rage 128 (r128) driver.
XCOMM
@@ -30,7 +30,7 @@ INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) \
-I$(XF86SRC)/int10 -I$(SERVERSRC)/Xext \
-I$(FONTINCSRC) -I$(SERVERSRC)/include -I$(XINCLUDESRC) \
-I$(EXTINCSRC) -I$(XF86SRC)/xf24_32bpp \
- $(DRIINCLUDES)
+ $(DRIINCLUDES) -I$(SERVERSRC)/render
#endif
DEFINES = $(DRIDEFINES)
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/r128/r128.h b/xc/programs/Xserver/hw/xfree86/drivers/r128/r128.h
index 7adb19523..29895d14d 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/r128/r128.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/r128/r128.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/r128/r128.h,v 1.11 2000/08/04 16:13:32 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/r128/r128.h,v 1.12 2000/09/13 15:47:32 martin Exp $ */
/**************************************************************************
Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc.,
@@ -40,6 +40,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#define R128_TIMEOUT 2000000 /* Fall out of wait loops after this count */
#define R128_MMIOSIZE 0x80000
+#define R128_VBIOS_SIZE 0x00010000
+
/* R128_NAME is used for the server-side
ddx driver, the client-side DRI driver,
and the kernel-level DRM driver. */
@@ -179,6 +181,7 @@ typedef struct {
unsigned long LinearAddr; /* Frame buffer physical address */
unsigned long MMIOAddr; /* MMIO region physical address */
unsigned long BIOSAddr; /* BIOS physical address */
+ Bool BIOSFromPCI; /* BIOS is read from PCI space */
unsigned char *MMIO; /* Map of MMIO region */
unsigned char *FB; /* Map of frame buffer */
@@ -188,19 +191,15 @@ typedef struct {
unsigned long FbMapSize; /* Size of frame buffer, in bytes */
int Flags; /* Saved copy of mode flags */
- Bool EnableFP; /* Enable use of FP registers */
- Bool CRTOnly; /* Only use External CRT instead of FP */
Bool HasPanelRegs; /* Current chip can connect to a FP */
+ Bool CRTOnly; /* Only use External CRT instead of FP */
+ CARD8 *VBIOS; /* Video BIOS for mode validation on FPs */
+ int FPBIOSstart; /* Start of the flat panel info */
/* Computed values for FPs */
int PanelXRes;
int PanelYRes;
- int PanelHNonVis;
- int PanelHOverPlus;
- int PanelHSyncWidth;
- int PanelVNonVis;
- int PanelVOverPlus;
- int PanelVSyncWidth;
+ int PanelPwrDly;
R128PLLRec pll;
R128RAMPtr ram;
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/r128/r128_accel.c b/xc/programs/Xserver/hw/xfree86/drivers/r128/r128_accel.c
index 7a1ce0ed1..0729e13a5 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/r128/r128_accel.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/r128/r128_accel.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/r128/r128_accel.c,v 1.13 2000/06/26 05:41:32 martin Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/r128/r128_accel.c,v 1.14 2000/08/24 22:20:17 tsi Exp $ */
/**************************************************************************
Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc.,
@@ -138,11 +138,12 @@ static struct {
void R128EngineFlush(ScrnInfoPtr pScrn)
{
int i;
+ unsigned int j;
R128MMIO_VARS();
OUTREGP(R128_PC_NGUI_CTLSTAT, R128_PC_FLUSH_ALL, ~R128_PC_FLUSH_ALL);
for (i = 0; i < R128_TIMEOUT; i++) {
- if (!(INREG(R128_PC_NGUI_CTLSTAT) & R128_PC_BUSY)) break;
+ if (!((j=INREG(R128_PC_NGUI_CTLSTAT)) & R128_PC_BUSY)) break;
}
}
@@ -153,6 +154,7 @@ void R128EngineReset(ScrnInfoPtr pScrn)
CARD32 clock_cntl_index;
CARD32 mclk_cntl;
CARD32 gen_reset_cntl;
+ unsigned int j;
R128MMIO_VARS();
R128EngineFlush(pScrn);
@@ -165,9 +167,9 @@ void R128EngineReset(ScrnInfoPtr pScrn)
gen_reset_cntl = INREG(R128_GEN_RESET_CNTL);
OUTREG(R128_GEN_RESET_CNTL, gen_reset_cntl | R128_SOFT_RESET_GUI);
- INREG(R128_GEN_RESET_CNTL);
+ j = INREG(R128_GEN_RESET_CNTL);
OUTREG(R128_GEN_RESET_CNTL, gen_reset_cntl & ~R128_SOFT_RESET_GUI);
- INREG(R128_GEN_RESET_CNTL);
+ j = INREG(R128_GEN_RESET_CNTL);
OUTPLL(R128_MCLK_CNTL, mclk_cntl);
OUTREG(R128_CLOCK_CNTL_INDEX, clock_cntl_index);
@@ -184,16 +186,18 @@ void R128WaitForFifoFunction(ScrnInfoPtr pScrn, int entries)
{
R128InfoPtr info = R128PTR(pScrn);
int i;
+ unsigned int j;
R128MMIO_VARS();
for (;;) {
for (i = 0; i < R128_TIMEOUT; i++) {
- info->fifo_slots = INREG(R128_GUI_STAT) & R128_GUI_FIFOCNT_MASK;
+ j = INREG(R128_GUI_STAT);
+ info->fifo_slots = j & R128_GUI_FIFOCNT_MASK;
if (info->fifo_slots >= entries) return;
}
R128TRACE(("FIFO timed out: %d entries, stat=0x%08x, probe=0x%08x\n",
- INREG(R128_GUI_STAT) & R128_GUI_FIFOCNT_MASK,
- INREG(R128_GUI_STAT),
+ j & R128_GUI_FIFOCNT_MASK,
+ j,
INREG(R128_GUI_PROBE)));
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"FIFO timed out, resetting engine...\n");
@@ -211,20 +215,22 @@ void R128WaitForIdle(ScrnInfoPtr pScrn)
{
R128InfoPtr info = R128PTR(pScrn);
int i;
+ unsigned int j;
R128MMIO_VARS();
+
R128WaitForFifoFunction(pScrn, 64);
for (;;) {
for (i = 0; i < R128_TIMEOUT; i++) {
- if (!(INREG(R128_GUI_STAT) & R128_GUI_ACTIVE)) {
+ if (!((j=INREG(R128_GUI_STAT)) & R128_GUI_ACTIVE)) {
R128EngineFlush(pScrn);
return;
}
}
R128TRACE(("Idle timed out: %d entries, stat=0x%08x, probe=0x%08x\n",
- INREG(R128_GUI_STAT) & R128_GUI_FIFOCNT_MASK,
- INREG(R128_GUI_STAT),
+ j & R128_GUI_FIFOCNT_MASK,
+ j,
INREG(R128_GUI_PROBE)));
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Idle timed out, resetting engine...\n");
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/r128/r128_dri.c b/xc/programs/Xserver/hw/xfree86/drivers/r128/r128_dri.c
index 3fe3fd0a7..4e8005602 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/r128/r128_dri.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/r128/r128_dri.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/r128/r128_dri.c,v 1.4 2000/06/26 05:41:32 martin Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/r128/r128_dri.c,v 1.5 2000/08/25 13:42:37 dawes Exp $ */
/**************************************************************************
Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc.,
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/r128/r128_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/r128/r128_driver.c
index 215761d29..618abb408 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/r128/r128_driver.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/r128/r128_driver.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/r128/r128_driver.c,v 1.40 2000/08/04 16:13:32 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/r128/r128_driver.c,v 1.46 2000/09/20 00:09:26 keithp Exp $ */
/**************************************************************************
Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc.,
@@ -120,6 +120,9 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "r128_sarea.h"
#endif
+#ifdef RENDER
+#include "picturestr.h"
+#endif
/* Driver data structures */
#include "r128.h"
#include "r128_reg.h"
@@ -171,6 +174,8 @@ static SymTabRec R128Chipsets[] = {
{ PCI_CHIP_RAGE128PF, "ATI Rage 128 Pro PF (AGP)" },
{ PCI_CHIP_RAGE128LE, "ATI Rage 128 Mobility LE (PCI)" },
{ PCI_CHIP_RAGE128LF, "ATI Rage 128 Mobility LF (AGP)" },
+ { PCI_CHIP_RAGE128MF, "ATI Rage 128 Mobility MF (AGP)" },
+ { PCI_CHIP_RAGE128ML, "ATI Rage 128 Mobility ML (AGP)" },
{ -1, NULL }
};
@@ -182,6 +187,8 @@ static PciChipsets R128PciChipsets[] = {
{ PCI_CHIP_RAGE128PF, PCI_CHIP_RAGE128PF, RES_SHARED_VGA },
{ PCI_CHIP_RAGE128LE, PCI_CHIP_RAGE128LE, RES_SHARED_VGA },
{ PCI_CHIP_RAGE128LF, PCI_CHIP_RAGE128LF, RES_SHARED_VGA },
+ { PCI_CHIP_RAGE128MF, PCI_CHIP_RAGE128MF, RES_SHARED_VGA },
+ { PCI_CHIP_RAGE128ML, PCI_CHIP_RAGE128ML, RES_SHARED_VGA },
{ -1, -1, RES_UNDEFINED }
};
@@ -203,8 +210,12 @@ typedef enum {
OPTION_VBUF_SIZE,
OPTION_USE_CCE_2D,
#endif
- OPTION_ENABLE_FP,
+#if 0
+ /* FIXME: Disable CRTOnly until it is tested */
OPTION_CRT,
+#endif
+ OPTION_PANEL_WIDTH,
+ OPTION_PANEL_HEIGHT,
OPTION_FBDEV
} R128Opts;
@@ -226,8 +237,12 @@ static OptionInfoRec R128Options[] = {
{ OPTION_VBUF_SIZE, "VBSize", OPTV_INTEGER, {0}, FALSE },
{ OPTION_USE_CCE_2D, "UseCCEfor2D", OPTV_BOOLEAN, {0}, FALSE },
#endif
- { OPTION_ENABLE_FP, "EnableFP", OPTV_BOOLEAN, {0}, FALSE },
+#if 0
+ /* FIXME: Disable CRTOnly until it is tested */
{ OPTION_CRT, "CRTOnly", OPTV_BOOLEAN, {0}, FALSE },
+#endif
+ { OPTION_PANEL_WIDTH, "PanelWidth", OPTV_INTEGER, {0}, FALSE },
+ { OPTION_PANEL_HEIGHT, "PanelHeight", OPTV_INTEGER, {0}, FALSE },
{ OPTION_FBDEV, "UseFBDev", OPTV_BOOLEAN, {0}, FALSE },
{ -1, NULL, OPTV_NONE, {0}, FALSE }
};
@@ -280,14 +295,6 @@ static const char *fbdevHWSymbols[] = {
NULL
};
-static const char *vbeSymbols[] = {
- "VBEInit",
- "vbeDoEDID",
- NULL
-};
-
-#if 0
- /* Not used until DDC is supported. */
static const char *ddcSymbols[] = {
"xf86PrintEDID",
"xf86DoEDID_DDC1",
@@ -295,6 +302,7 @@ static const char *ddcSymbols[] = {
NULL
};
+#if 0
static const char *i2cSymbols[] = {
"xf86CreateI2CBusRec",
"xf86I2CBusInit",
@@ -303,9 +311,18 @@ static const char *i2cSymbols[] = {
#endif
#ifdef XFree86LOADER
+static const char *vbeSymbols[] = {
+ "VBEInit",
+ "vbeDoEDID",
+ NULL
+};
+
#ifdef USE_FB
static const char *fbSymbols[] = {
"fbScreenInit",
+#ifdef RENDER
+ "fbPictureInit",
+#endif
NULL
};
#else
@@ -431,9 +448,11 @@ static pointer R128Setup(pointer module, pointer opts, int *errmaj,
#endif
fbdevHWSymbols,
vbeSymbols,
- 0 /* ddcsymbols */,
- 0 /* i2csymbols */,
- 0 /* shadowSymbols */,
+#if 0
+ NULL /* ddcsymbols */,
+ NULL /* i2csymbols */,
+ NULL /* shadowSymbols */,
+#endif
NULL);
/*
@@ -525,7 +544,7 @@ static Bool R128UnmapFB(ScrnInfoPtr pScrn)
{
R128InfoPtr info = R128PTR(pScrn);
- if(info->FBDev)
+ if (info->FBDev)
fbdevHWUnmapVidmem(pScrn);
else
xf86UnMapVidMem(pScrn->scrnIndex, info->FB, info->FbMapSize);
@@ -576,10 +595,12 @@ void R128WaitForVerticalSync(ScrnInfoPtr pScrn)
{
int i;
R128MMIO_VARS();
+ unsigned int j;
OUTREG(R128_GEN_INT_STATUS, R128_VSYNC_INT_AK);
for (i = 0; i < R128_TIMEOUT; i++) {
- if (INREG(R128_GEN_INT_STATUS) & R128_VSYNC_INT) break;
+ j = INREG(R128_GEN_INT_STATUS);
+ if (j & R128_VSYNC_INT) break;
}
}
@@ -615,6 +636,118 @@ static int R128Div(int n, int d)
return (n + (d / 2)) / d;
}
+/* Read the Video BIOS block and the FP registers (if applicable). */
+static Bool R128GetBIOSParameters(ScrnInfoPtr pScrn)
+{
+ R128InfoPtr info = R128PTR(pScrn);
+ int i;
+ int FPHeader = 0;
+
+#define R128ReadBIOS(offset, buffer, length) \
+ (info->BIOSFromPCI ? \
+ xf86ReadPciBIOS(offset, info->PciTag, 0, buffer, length) : \
+ xf86ReadBIOS(info->BIOSAddr, offset, buffer, length))
+
+#define R128_BIOS8(v) (*((CARD8 *)(info->VBIOS + (v))))
+#define R128_BIOS16(v) (*((CARD16 *)(info->VBIOS + (v))))
+#define R128_BIOS32(v) (*((CARD32 *)(info->VBIOS + (v))))
+
+ if (!(info->VBIOS = xalloc(R128_VBIOS_SIZE))) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "Cannot allocate space for hold Video BIOS!\n");
+ return FALSE;
+ }
+
+ info->BIOSFromPCI = TRUE;
+ R128ReadBIOS(0x0000, info->VBIOS, R128_VBIOS_SIZE);
+ if (info->VBIOS[0] != 0x55 || info->VBIOS[1] != 0xaa) {
+ xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
+ "Video BIOS not detected in PCI space!\n");
+ xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
+ "Attempting to read Video BIOS from legacy ISA space!\n");
+ info->BIOSFromPCI = FALSE;
+ info->BIOSAddr = 0x000c0000;
+ R128ReadBIOS(0x0000, info->VBIOS, R128_VBIOS_SIZE);
+ }
+ if (info->VBIOS[0] != 0x55 || info->VBIOS[1] != 0xaa) {
+ info->BIOSAddr = 0x00000000;
+ xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
+ "Video BIOS not found!\n");
+ }
+
+ if (info->HasPanelRegs) {
+ info->FPBIOSstart = 0;
+
+ /* FIXME: There should be direct access to the start of the FP info
+ tables, but until we find out where that offset is stored, we
+ must search for the ATI signature string: "M3 ". */
+ for (i = 4; i < R128_VBIOS_SIZE-8; i++) {
+ if (R128_BIOS8(i) == 'M' &&
+ R128_BIOS8(i+1) == '3' &&
+ R128_BIOS8(i+2) == ' ' &&
+ R128_BIOS8(i+3) == ' ' &&
+ R128_BIOS8(i+4) == ' ' &&
+ R128_BIOS8(i+5) == ' ' &&
+ R128_BIOS8(i+6) == ' ' &&
+ R128_BIOS8(i+7) == ' ') {
+ FPHeader = i-2;
+ break;
+ }
+ }
+
+ if (!FPHeader) return TRUE;
+
+ /* Assume that only one panel is attached and supported */
+ for (i = FPHeader+20; i < FPHeader+84; i += 2) {
+ if (R128_BIOS16(i) != 0) {
+ info->FPBIOSstart = R128_BIOS16(i);
+ break;
+ }
+ }
+ if (!info->FPBIOSstart) return TRUE;
+
+ if (!info->PanelXRes)
+ info->PanelXRes = R128_BIOS16(info->FPBIOSstart+25);
+ if (!info->PanelYRes)
+ info->PanelYRes = R128_BIOS16(info->FPBIOSstart+27);
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Panel size: %dx%d\n",
+ info->PanelXRes, info->PanelYRes);
+
+ info->PanelPwrDly = R128_BIOS8(info->FPBIOSstart+56);
+
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Panel ID: ");
+ for (i = 1; i <= 24; i++)
+ ErrorF("%c", R128_BIOS8(info->FPBIOSstart+i));
+ ErrorF("\n");
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Panel Type: ");
+ i = R128_BIOS16(info->FPBIOSstart+29);
+ if (i & 1) ErrorF("Color, ");
+ else ErrorF("Monochrome, ");
+ if (i & 2) ErrorF("Dual(split), ");
+ else ErrorF("Single, ");
+ switch ((i >> 2) & 0x3f) {
+ case 0: ErrorF("STN"); break;
+ case 1: ErrorF("TFT"); break;
+ case 2: ErrorF("Active STN"); break;
+ case 3: ErrorF("EL"); break;
+ case 4: ErrorF("Plasma"); break;
+ default: ErrorF("UNKNOWN"); break;
+ }
+ ErrorF("\n");
+ if (R128_BIOS8(info->FPBIOSstart+61) & 1) {
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Panel Interface: LVDS\n");
+ } else {
+ /* FIXME: Add Non-LVDS flat pael support */
+ xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
+ "Non-LVDS panel interface detected! "
+ "This support is untested and may not "
+ "function properly\n");
+ }
+ }
+
+ return TRUE;
+}
+
/* Read PLL parameters from BIOS block. Default to typical values if there
is no BIOS. */
static Bool R128GetPLLParameters(ScrnInfoPtr pScrn)
@@ -623,26 +756,8 @@ static Bool R128GetPLLParameters(ScrnInfoPtr pScrn)
R128PLLPtr pll = &info->pll;
CARD16 bios_header;
CARD16 pll_info_block;
- CARD8 tmp[64];
- Bool BIOSFromPCI = TRUE;
-
-#define R128ReadBIOS(offset, buffer, length) \
- (BIOSFromPCI ? \
- xf86ReadPciBIOS(offset, info->PciTag, 0, buffer, length) : \
- xf86ReadBIOS(info->BIOSAddr, offset, buffer, length))
- R128ReadBIOS(0, tmp, sizeof(tmp));
- if (tmp[0] != 0x55 || tmp[1] != 0xaa)
- {
- xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
- "Video BIOS not detected in PCI space!\n");
- xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
- "Attempting to read Video BIOS from legacy ISA space!\n");
- BIOSFromPCI = FALSE;
- info->BIOSAddr = 0x000c0000;
- R128ReadBIOS(0, tmp, sizeof(tmp));
- }
- if (tmp[0] != 0x55 || tmp[1] != 0xaa) {
+ if (!info->VBIOS) {
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
"Video BIOS not detected, using default PLL parameters!\n");
/* These probably aren't going to work for
@@ -655,27 +770,16 @@ static Bool R128GetPLLParameters(ScrnInfoPtr pScrn)
pll->max_pll_freq = 25000;
pll->xclk = 10300;
} else {
- R128ReadBIOS(0x48,
- (CARD8 *)&bios_header, sizeof(bios_header));
- R128ReadBIOS(bios_header + 0x30,
- (CARD8 *)&pll_info_block, sizeof(pll_info_block));
+ bios_header = R128_BIOS16(0x48);
+ pll_info_block = R128_BIOS16(bios_header + 0x30);
R128TRACE(("Header at 0x%04x; PLL Information at 0x%04x\n",
bios_header, pll_info_block));
- R128ReadBIOS(pll_info_block + 0x0e,
- (CARD8 *)&pll->reference_freq,
- sizeof(pll->reference_freq));
- R128ReadBIOS(pll_info_block + 0x10,
- (CARD8 *)&pll->reference_div,
- sizeof(pll->reference_div));
- R128ReadBIOS(pll_info_block + 0x12,
- (CARD8 *)&pll->min_pll_freq,
- sizeof(pll->min_pll_freq));
- R128ReadBIOS(pll_info_block + 0x16,
- (CARD8 *)&pll->max_pll_freq,
- sizeof(pll->max_pll_freq));
- R128ReadBIOS(pll_info_block + 0x08,
- (CARD8 *)&pll->xclk, sizeof(pll->xclk));
+ pll->reference_freq = R128_BIOS16(pll_info_block + 0x0e);
+ pll->reference_div = R128_BIOS16(pll_info_block + 0x10);
+ pll->min_pll_freq = R128_BIOS32(pll_info_block + 0x12);
+ pll->max_pll_freq = R128_BIOS32(pll_info_block + 0x16);
+ pll->xclk = R128_BIOS16(pll_info_block + 0x08);
}
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
@@ -863,9 +967,6 @@ static Bool R128PreInitConfig(ScrnInfoPtr pScrn)
int offset = 0; /* RAM Type */
MessageType from;
unsigned char *R128MMIO;
- CARD32 fp_horz_stretch = 0, fp_vert_stretch = 0;
- CARD32 crtc_h_total_disp = 0, crtc_v_total_disp = 0;
- CARD32 crtc_h_sync_strt_wid = 0, crtc_v_sync_strt_wid = 0;
/* Chipset */
from = X_PROBED;
@@ -953,7 +1054,9 @@ static Bool R128PreInitConfig(ScrnInfoPtr pScrn)
/* FIXME: Make this an option */
switch (info->Chipset) {
case PCI_CHIP_RAGE128LE:
- case PCI_CHIP_RAGE128LF: info->HasPanelRegs = TRUE; break;
+ case PCI_CHIP_RAGE128LF:
+ case PCI_CHIP_RAGE128MF:
+ case PCI_CHIP_RAGE128ML: info->HasPanelRegs = TRUE; break;
case PCI_CHIP_RAGE128RE:
case PCI_CHIP_RAGE128RF:
case PCI_CHIP_RAGE128RK:
@@ -972,14 +1075,6 @@ static Bool R128PreInitConfig(ScrnInfoPtr pScrn)
pScrn->videoRam = INREG(R128_CONFIG_MEMSIZE) / 1024;
info->MemCntl = INREG(R128_MEM_CNTL);
info->BusCntl = INREG(R128_BUS_CNTL);
- if (info->HasPanelRegs) {
- fp_horz_stretch = INREG(R128_FP_HORZ_STRETCH);
- fp_vert_stretch = INREG(R128_FP_VERT_STRETCH);
- crtc_h_total_disp = INREG(R128_CRTC_H_TOTAL_DISP);
- crtc_v_total_disp = INREG(R128_CRTC_V_TOTAL_DISP);
- crtc_h_sync_strt_wid = INREG(R128_CRTC_H_SYNC_STRT_WID);
- crtc_v_sync_strt_wid = INREG(R128_CRTC_V_SYNC_STRT_WID);
- }
R128MMIO = NULL;
R128UnmapMMIO(pScrn);
@@ -989,6 +1084,8 @@ static Bool R128PreInitConfig(ScrnInfoPtr pScrn)
switch (info->Chipset) {
case PCI_CHIP_RAGE128LE:
case PCI_CHIP_RAGE128LF:
+ case PCI_CHIP_RAGE128MF:
+ case PCI_CHIP_RAGE128ML:
case PCI_CHIP_RAGE128RE:
case PCI_CHIP_RAGE128RF: offset = 0; break; /* 128-bit SDR SGRAM 1:1 */
case PCI_CHIP_RAGE128RK:
@@ -1016,10 +1113,12 @@ static Bool R128PreInitConfig(ScrnInfoPtr pScrn)
"VideoRAM: %d kByte (%s)\n", pScrn->videoRam, info->ram->name);
/* Flat panel (part 2) */
- if ((info->EnableFP = xf86ReturnOptValBool(R128Options,
- OPTION_ENABLE_FP, FALSE))) {
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
- "Enabling use of flat panel registers\n");
+ if (info->HasPanelRegs) {
+#if 1
+ info->CRTOnly = FALSE;
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "Using flat panel for display\n");
+#else
if ((info->CRTOnly = xf86ReturnOptValBool(R128Options,
OPTION_CRT, FALSE))) {
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
@@ -1029,57 +1128,24 @@ static Bool R128PreInitConfig(ScrnInfoPtr pScrn)
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"Using flat panel for display\n");
}
+#endif
+ } else {
+ info->CRTOnly = FALSE;
}
if (info->HasPanelRegs) {
- int tmp;
-
- info->PanelXRes =
- (fp_horz_stretch & R128_HORZ_PANEL_SIZE) >> R128_HORZ_PANEL_SHIFT;
- info->PanelXRes = (info->PanelXRes + 1) * 8;
- info->PanelYRes =
- (fp_vert_stretch & R128_VERT_PANEL_SIZE) >> R128_VERT_PANEL_SHIFT;
- info->PanelYRes += 1;
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Panel dimensions: %dx%d\n",
- info->PanelXRes, info->PanelYRes);
-
- info->PanelHNonVis =
- (crtc_h_total_disp & R128_CRTC_H_TOTAL) >> R128_CRTC_H_TOTAL_SHIFT;
- info->PanelHNonVis += 4; /* Add 4 since we are in VGA mode */
- tmp =
- (crtc_h_total_disp & R128_CRTC_H_DISP) >> R128_CRTC_H_DISP_SHIFT;
- info->PanelHNonVis -= tmp;
- info->PanelHOverPlus =
- (crtc_h_sync_strt_wid & R128_CRTC_H_SYNC_STRT_CHAR)
- >> R128_CRTC_H_SYNC_STRT_CHAR_SHIFT;
- info->PanelHOverPlus -= tmp;
- switch (info->CurrentLayout.pixel_code) {
- /* Adjustments are from ATI */
- case 8: info->PanelHOverPlus += 2; break;
- case 15:
- case 16: info->PanelHOverPlus += 1; break;
- case 24:
- case 32: info->PanelHOverPlus += 0; break;
+ info->PanelXRes = 0;
+ info->PanelYRes = 0;
+ if (xf86GetOptValInteger(R128Options,
+ OPTION_PANEL_WIDTH, &(info->PanelXRes))) {
+ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
+ "Flat panel width: %d\n", info->PanelXRes);
+ }
+ if (xf86GetOptValInteger(R128Options,
+ OPTION_PANEL_HEIGHT, &(info->PanelYRes))) {
+ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
+ "Flat panel height: %d\n", info->PanelYRes);
}
- info->PanelHSyncWidth =
- (crtc_h_sync_strt_wid & R128_CRTC_H_SYNC_WID)
- >> R128_CRTC_H_SYNC_WID_SHIFT;
- info->PanelHSyncWidth += 14; /* ??? */
-
- info->PanelVNonVis =
- (crtc_v_total_disp & R128_CRTC_V_TOTAL) >> R128_CRTC_V_TOTAL_SHIFT;
- info->PanelVNonVis += 1; /* Add 1 since we are in VGA mode */
- tmp =
- (crtc_v_total_disp & R128_CRTC_V_DISP) >> R128_CRTC_V_DISP_SHIFT;
- info->PanelVNonVis -= tmp;
- info->PanelVOverPlus =
- (crtc_v_sync_strt_wid & R128_CRTC_V_SYNC_STRT)
- >> R128_CRTC_V_SYNC_STRT_SHIFT;
- info->PanelVOverPlus -= tmp + 1;
- info->PanelVSyncWidth =
- (crtc_v_sync_strt_wid & R128_CRTC_V_SYNC_WID)
- >> R128_CRTC_V_SYNC_WID_SHIFT;
- info->PanelVSyncWidth -= 2; /* ??? */
}
#ifdef XF86DRI
@@ -1093,6 +1159,8 @@ static Bool R128PreInitConfig(ScrnInfoPtr pScrn)
case PCI_CHIP_RAGE128RE:
case PCI_CHIP_RAGE128RK: info->IsPCI = TRUE; break;
case PCI_CHIP_RAGE128LF:
+ case PCI_CHIP_RAGE128MF:
+ case PCI_CHIP_RAGE128ML:
case PCI_CHIP_RAGE128RF:
case PCI_CHIP_RAGE128RL:
case PCI_CHIP_RAGE128PF:
@@ -1106,33 +1174,19 @@ static Bool R128PreInitConfig(ScrnInfoPtr pScrn)
static Bool R128PreInitDDC(ScrnInfoPtr pScrn)
{
- /* FIXME: DDC support goes here. */
-#if 0
- /* Using the GPIO_MONID register for DDC2
- does not appear to work as expected.
- Hence, the implementation of DDC is
- deferred. */
R128InfoPtr info = R128PTR(pScrn);
- Bool ret = TRUE;
-
+ vbeInfoPtr pVbe;
+
if (!xf86LoadSubModule(pScrn, "ddc")) return FALSE;
xf86LoaderReqSymLists(ddcSymbols, NULL);
- if (!xf86LoadSubModule(pScrn, "i2c")) return FALSE;
- xf86LoaderReqSymLists(i2cSymbols, NULL);
-
- R128MapMMIO(pScrn);
- if (!R128I2CInit(pScrn)) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "I2C initialization failed\n");
- ret = FALSE;
- } else {
- xf86SetDDCProperties(pScrn,xf86PrintEDID(
- xf86DoEDID_DDC2(pScrn->scrnIndex, info->i2c)));
- }
- R128UnmapMMIO(pScrn);
- return ret;
-#else
- return TRUE;
-#endif
+ if (xf86LoadSubModule(pScrn, "vbe")) {
+ pVbe = VBEInit(NULL,info->pEnt->index);
+ if (!pVbe) return NULL;
+
+ xf86SetDDCproperties(pScrn,xf86PrintEDID(vbeDoEDID(pVbe,NULL)));
+ return TRUE;
+ } else
+ return FALSE;
}
/* This is called by R128PreInit to initialize gamma correction. */
@@ -1155,14 +1209,19 @@ static Bool R128PreInitModes(ScrnInfoPtr pScrn)
const char *Sym = NULL;
/* Get mode information */
- pScrn->progClock = TRUE;
- clockRanges = xnfcalloc(sizeof(*clockRanges), 1);
- clockRanges->next = NULL;
- clockRanges->minClock = info->pll.min_pll_freq;
- clockRanges->maxClock = info->pll.max_pll_freq * 10;
- clockRanges->clockIndex = -1;
- clockRanges->interlaceAllowed = TRUE;
- clockRanges->doubleScanAllowed = TRUE;
+ pScrn->progClock = TRUE;
+ clockRanges = xnfcalloc(sizeof(*clockRanges), 1);
+ clockRanges->next = NULL;
+ clockRanges->minClock = info->pll.min_pll_freq;
+ clockRanges->maxClock = info->pll.max_pll_freq * 10;
+ clockRanges->clockIndex = -1;
+ if (info->HasPanelRegs) {
+ clockRanges->interlaceAllowed = FALSE;
+ clockRanges->doubleScanAllowed = FALSE;
+ } else {
+ clockRanges->interlaceAllowed = TRUE;
+ clockRanges->doubleScanAllowed = TRUE;
+ }
modesFound = xf86ValidateModes(pScrn,
pScrn->monitor->Modes,
@@ -1218,6 +1277,11 @@ static Bool R128PreInitModes(ScrnInfoPtr pScrn)
#endif
if (mod && !xf86LoadSubModule(pScrn, mod)) return FALSE;
xf86LoaderReqSymbols(Sym, NULL);
+#ifdef USE_FB
+#ifdef RENDER
+ xf86LoaderReqSymbols("fbPictureInit", NULL);
+#endif
+#endif
info->CurrentLayout.displayWidth = pScrn->displayWidth;
info->CurrentLayout.mode = pScrn->currentMode;
@@ -1263,13 +1327,11 @@ static Bool R128PreInitDRI(ScrnInfoPtr pScrn)
R128InfoPtr info = R128PTR(pScrn);
if (info->IsPCI) {
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "CCE in PIO mode\n");
info->CCEMode = R128_DEFAULT_CCE_PIO_MODE;
} else if (xf86ReturnOptValBool(R128Options, OPTION_CCE_PIO, FALSE)) {
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "CCE in PIO mode\n");
+ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Forcing CCE into PIO mode\n");
info->CCEMode = R128_DEFAULT_CCE_PIO_MODE;
} else {
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "CCE in BM mode\n");
info->CCEMode = R128_DEFAULT_CCE_BM_MODE;
}
@@ -1370,19 +1432,6 @@ static Bool R128PreInitDRI(ScrnInfoPtr pScrn)
info->agpTexSize = info->agpSize - (info->ringSize +
info->vbSize +
info->indSize);
-
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
- "Using %d MB AGP aperture\n", info->agpSize);
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
- "Using %d MB for the ring buffer\n", info->ringSize);
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
- "Using %d MB for vertex buffers\n", info->vbSize);
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
- "Using %d MB for indirect buffers\n", info->indSize);
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
- "Using %d MB for AGP textures\n", info->agpTexSize);
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
- "Using %d byte vertex buffers\n", info->vbBufSize);
}
if (xf86GetOptValInteger(R128Options, OPTION_USEC_TIMEOUT,
@@ -1475,30 +1524,45 @@ static Bool R128PreInit(ScrnInfoPtr pScrn, int flags)
}
if (!info->FBDev)
- if (!R128PreInitInt10(pScrn)) goto fail;
+ if (!R128PreInitInt10(pScrn)) goto fail;
- if (!R128PreInitConfig(pScrn)) goto fail;
+ if (!R128PreInitConfig(pScrn)) goto fail;
- if (!R128GetPLLParameters(pScrn)) goto fail;
+ if (!R128GetBIOSParameters(pScrn)) goto fail;
- if (!R128PreInitDDC(pScrn)) goto fail;
+ if (!R128GetPLLParameters(pScrn)) goto fail;
- if (!R128PreInitGamma(pScrn)) goto fail;
+ if (!R128PreInitDDC(pScrn)) goto fail;
- if (!R128PreInitModes(pScrn)) goto fail;
+ if (!R128PreInitGamma(pScrn)) goto fail;
- if (!R128PreInitCursor(pScrn)) goto fail;
+ if (!R128PreInitModes(pScrn)) goto fail;
- if (!R128PreInitAccel(pScrn)) goto fail;
+ if (!R128PreInitCursor(pScrn)) goto fail;
+
+ if (!R128PreInitAccel(pScrn)) goto fail;
#ifdef XF86DRI
- if (!R128PreInitDRI(pScrn)) goto fail;
+ if (!R128PreInitDRI(pScrn)) goto fail;
#endif
+ /* Free the video bios (if applicable) */
+ if (info->VBIOS) {
+ xfree(info->VBIOS);
+ info->VBIOS = NULL;
+ }
+
return TRUE;
fail:
/* Pre-init failed. */
+
+ /* Free the video bios (if applicable) */
+ if (info->VBIOS) {
+ xfree(info->VBIOS);
+ info->VBIOS = NULL;
+ }
+
vgaHWFreeHWRec(pScrn);
R128FreeRec(pScrn);
return FALSE;
@@ -1595,17 +1659,39 @@ static Bool R128ScreenInit(int scrnIndex, ScreenPtr pScreen,
miGetDefaultVisualMask(pScrn->depth),
pScrn->rgbBits,
pScrn->defaultVisual)) return FALSE;
-
+ miSetPixmapDepths ();
+
#ifdef XF86DRI
/* Setup DRI after visuals have been
established, but before cfbScreenInit is
called. cfbScreenInit will eventually
call the driver's InitGLXVisuals call
back. */
- if (!xf86ReturnOptValBool(R128Options, OPTION_NOACCEL, FALSE))
- info->directRenderingEnabled = R128DRIScreenInit(pScreen);
- else
- info->directRenderingEnabled = FALSE;
+ {
+ /* FIXME: When we move to dynamic allocation of back and depth
+ buffers, we will want to revisit the following check for 3
+ times the virtual size of the screen below. */
+ int width_bytes = (pScrn->displayWidth *
+ info->CurrentLayout.pixel_bytes);
+ int maxy = info->FbMapSize / width_bytes;
+
+ if (!xf86ReturnOptValBool(R128Options, OPTION_NOACCEL, FALSE) &&
+ (maxy > pScrn->virtualY * 3)
+#if 1
+ /* FIXME: Disable 3D support for FPs until it is tested */
+ && !info->HasPanelRegs
+#endif
+ ) {
+ info->directRenderingEnabled = R128DRIScreenInit(pScreen);
+ } else {
+ xf86DrvMsg(scrnIndex, X_WARNING,
+ "Static buffer allocation failed -- "
+ "need at least %d kB video memory\n",
+ (pScrn->displayWidth * pScrn->virtualY *
+ info->CurrentLayout.pixel_bytes * 3 + 1023) / 1024);
+ info->directRenderingEnabled = FALSE;
+ }
+ }
#endif
#ifdef USE_FB
@@ -1614,6 +1700,9 @@ static Bool R128ScreenInit(int scrnIndex, ScreenPtr pScreen,
pScrn->xDpi, pScrn->yDpi, pScrn->displayWidth,
pScrn->bitsPerPixel))
return FALSE;
+#ifdef RENDER
+ fbPictureInit (pScreen, 0, 0);
+#endif
#else
switch (pScrn->bitsPerPixel) {
case 8:
@@ -1727,7 +1816,32 @@ static Bool R128ScreenInit(int scrnIndex, ScreenPtr pScreen,
info->CurrentLayout.pixel_bytes);
int maxy = info->FbMapSize / width_bytes;
int l;
-
+
+ switch (info->CCEMode) {
+ case R128_DEFAULT_CCE_PIO_MODE:
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CCE in PIO mode\n");
+ break;
+ case R128_DEFAULT_CCE_BM_MODE:
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CCE in BM mode\n");
+ break;
+ default:
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CCE in UNKNOWN mode\n");
+ break;
+ }
+
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "Using %d MB AGP aperture\n", info->agpSize);
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "Using %d MB for the ring buffer\n", info->ringSize);
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "Using %d MB for vertex buffers\n", info->vbSize);
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "Using %d MB for indirect buffers\n", info->indSize);
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "Using %d MB for AGP textures\n", info->agpTexSize);
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "Using %d byte vertex buffers\n", info->vbBufSize);
+
/* Allocate the shared back buffer */
if ((fbarea = xf86AllocateOffscreenArea(pScreen,
pScrn->virtualX,
@@ -1874,7 +1988,8 @@ static Bool R128ScreenInit(int scrnIndex, ScreenPtr pScreen,
/* DPMS setup */
#ifdef DPMSExtension
- xf86DPMSInit(pScreen, R128DisplayPowerManagementSet, 0);
+ if (!info->HasPanelRegs || info->CRTOnly)
+ xf86DPMSInit(pScreen, R128DisplayPowerManagementSet, 0);
#endif
/* Xv setup */
@@ -1962,6 +2077,7 @@ static void R128RestoreCrtcRegisters(ScrnInfoPtr pScrn, R128SavePtr restore)
/* Write flat panel registers */
static void R128RestoreFPRegisters(ScrnInfoPtr pScrn, R128SavePtr restore)
{
+ CARD32 tmp;
R128MMIO_VARS();
OUTREG(R128_CRTC2_GEN_CNTL, restore->crtc2_gen_cntl);
@@ -1973,8 +2089,23 @@ static void R128RestoreFPRegisters(ScrnInfoPtr pScrn, R128SavePtr restore)
OUTREG(R128_FP_PANEL_CNTL, restore->fp_panel_cntl);
OUTREG(R128_FP_V_SYNC_STRT_WID, restore->fp_v_sync_strt_wid);
OUTREG(R128_FP_VERT_STRETCH, restore->fp_vert_stretch);
- OUTREG(R128_LVDS_GEN_CNTL, restore->lvds_gen_cntl);
OUTREG(R128_TMDS_CRC, restore->tmds_crc);
+
+ tmp = INREG(R128_LVDS_GEN_CNTL);
+ if ((tmp & (R128_LVDS_ON | R128_LVDS_BLON)) ==
+ (restore->lvds_gen_cntl & (R128_LVDS_ON | R128_LVDS_BLON))) {
+ OUTREG(R128_LVDS_GEN_CNTL, restore->lvds_gen_cntl);
+ } else {
+ if (restore->lvds_gen_cntl & (R128_LVDS_ON | R128_LVDS_BLON)) {
+ OUTREG(R128_LVDS_GEN_CNTL, restore->lvds_gen_cntl & ~R128_LVDS_BLON);
+ usleep(R128PTR(pScrn)->PanelPwrDly * 1000);
+ OUTREG(R128_LVDS_GEN_CNTL, restore->lvds_gen_cntl);
+ } else {
+ OUTREG(R128_LVDS_GEN_CNTL, restore->lvds_gen_cntl | R128_LVDS_BLON);
+ usleep(R128PTR(pScrn)->PanelPwrDly * 1000);
+ OUTREG(R128_LVDS_GEN_CNTL, restore->lvds_gen_cntl);
+ }
+ }
}
static void R128PLLWaitForReadUpdateComplete(ScrnInfoPtr pScrn)
@@ -2061,12 +2192,15 @@ static void R128RestorePalette(ScrnInfoPtr pScrn, R128SavePtr restore)
/* Write out state to define a new video mode. */
static void R128RestoreMode(ScrnInfoPtr pScrn, R128SavePtr restore)
{
+ R128InfoPtr info = R128PTR(pScrn);
+
R128TRACE(("R128RestoreMode(%p)\n", restore));
R128RestoreCommonRegisters(pScrn, restore);
R128RestoreCrtcRegisters(pScrn, restore);
- if (R128PTR(pScrn)->HasPanelRegs && R128PTR(pScrn)->EnableFP)
+ if (info->HasPanelRegs)
R128RestoreFPRegisters(pScrn, restore);
- R128RestorePLLRegisters(pScrn, restore);
+ if (!info->HasPanelRegs || info->CRTOnly)
+ R128RestorePLLRegisters(pScrn, restore);
R128RestoreDDARegisters(pScrn, restore);
R128RestorePalette(pScrn, restore);
}
@@ -2174,7 +2308,7 @@ static void R128SaveMode(ScrnInfoPtr pScrn, R128SavePtr save)
R128SaveCommonRegisters(pScrn, save);
R128SaveCrtcRegisters(pScrn, save);
- if (R128PTR(pScrn)->HasPanelRegs && R128PTR(pScrn)->EnableFP)
+ if (R128PTR(pScrn)->HasPanelRegs)
R128SaveFPRegisters(pScrn, save);
R128SavePLLRegisters(pScrn, save);
R128SaveDDARegisters(pScrn, save);
@@ -2273,14 +2407,17 @@ static Bool R128InitCrtcRegisters(ScrnInfoPtr pScrn, R128SavePtr save,
int hsync_fudge;
int vsync_wid;
int bytpp;
+ int hsync_fudge_default[] = { 0x00, 0x12, 0x09, 0x09, 0x06, 0x05 };
+ int hsync_fudge_fp[] = { 0x12, 0x11, 0x09, 0x09, 0x05, 0x05 };
+ int hsync_fudge_fp_crt[] = { 0x12, 0x10, 0x08, 0x08, 0x04, 0x04 };
switch (info->CurrentLayout.pixel_code) {
- case 4: format = 1; bytpp = 0; hsync_fudge = 0; break;
- case 8: format = 2; bytpp = 1; hsync_fudge = 18; break;
- case 15: format = 3; bytpp = 2; hsync_fudge = 9; break; /* 555 */
- case 16: format = 4; bytpp = 2; hsync_fudge = 9; break; /* 565 */
- case 24: format = 5; bytpp = 3; hsync_fudge = 6; break; /* RGB */
- case 32: format = 6; bytpp = 4; hsync_fudge = 5; break; /* xRGB */
+ case 4: format = 1; bytpp = 0; break;
+ case 8: format = 2; bytpp = 1; break;
+ case 15: format = 3; bytpp = 2; break; /* 555 */
+ case 16: format = 4; bytpp = 2; break; /* 565 */
+ case 24: format = 5; bytpp = 3; break; /* RGB */
+ case 32: format = 6; bytpp = 4; break; /* xRGB */
default:
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Unsupported pixel depth (%d)\n", info->CurrentLayout.bitsPerPixel);
@@ -2288,6 +2425,10 @@ static Bool R128InitCrtcRegisters(ScrnInfoPtr pScrn, R128SavePtr save,
}
R128TRACE(("Format = %d (%d bytes per pixel)\n", format, bytpp));
+ if (info->HasPanelRegs)
+ if (info->CRTOnly) hsync_fudge = hsync_fudge_fp_crt[format-1];
+ else hsync_fudge = hsync_fudge_fp[format-1];
+ else hsync_fudge = hsync_fudge_default[format-1];
save->crtc_gen_cntl = (R128_CRTC_EXT_DISP_EN
| R128_CRTC_EN
@@ -2358,7 +2499,6 @@ static void R128InitFPRegisters(ScrnInfoPtr pScrn, R128SavePtr orig,
int xres = mode->CrtcHDisplay;
int yres = mode->CrtcVDisplay;
float Hratio, Vratio;
- int disp_end;
if (info->CRTOnly) {
save->crtc_ext_cntl |= R128_CRTC_CRT_ON;
@@ -2372,7 +2512,8 @@ static void R128InitFPRegisters(ScrnInfoPtr pScrn, R128SavePtr orig,
save->fp_gen_cntl |= (R128_FP_SEL_CRTC2 |
R128_FP_CRTC_DONT_SHADOW_VPAR);
save->fp_panel_cntl = orig->fp_panel_cntl & ~R128_FP_DIGON;
- save->lvds_gen_cntl = orig->lvds_gen_cntl & ~R128_LVDS_ON;
+ save->lvds_gen_cntl = orig->lvds_gen_cntl & ~(R128_LVDS_ON |
+ R128_LVDS_BLON);
return;
}
@@ -2383,35 +2524,39 @@ static void R128InitFPRegisters(ScrnInfoPtr pScrn, R128SavePtr orig,
Vratio = (float)yres/(float)info->PanelYRes;
save->fp_horz_stretch =
- (((((int)(Hratio * R128_HORZ_STRETCH_RATIO_MAX))
+ (((((int)(Hratio * R128_HORZ_STRETCH_RATIO_MAX + 0.5))
& R128_HORZ_STRETCH_RATIO_MASK) << R128_HORZ_STRETCH_RATIO_SHIFT) |
(orig->fp_horz_stretch & (R128_HORZ_PANEL_SIZE |
R128_HORZ_FP_LOOP_STRETCH |
R128_HORZ_STRETCH_RESERVED)));
- if (Hratio != 1.0) save->fp_horz_stretch |= (R128_HORZ_STRETCH_BLEND |
- R128_HORZ_STRETCH_ENABLE);
+ save->fp_horz_stretch &= ~R128_HORZ_AUTO_RATIO_FIX_EN;
+ if (Hratio == 1.0) save->fp_horz_stretch &= ~(R128_HORZ_STRETCH_BLEND |
+ R128_HORZ_STRETCH_ENABLE);
+ else save->fp_horz_stretch |= (R128_HORZ_STRETCH_BLEND |
+ R128_HORZ_STRETCH_ENABLE);
save->fp_vert_stretch =
- (((((int)(Vratio * R128_VERT_STRETCH_RATIO_MAX))
+ (((((int)(Vratio * R128_VERT_STRETCH_RATIO_MAX + 0.5))
& R128_VERT_STRETCH_RATIO_MASK) << R128_VERT_STRETCH_RATIO_SHIFT) |
(orig->fp_vert_stretch & (R128_VERT_PANEL_SIZE |
- R128_VERT_STRETCH_RESERVED |
- R128_VERT_STRETCH_BLEND)));
- if (Vratio == 1.0) save->fp_vert_stretch &= ~R128_VERT_STRETCH_ENABLE;
- else save->fp_vert_stretch |= R128_VERT_STRETCH_ENABLE;
-
- save->fp_gen_cntl = ((orig->fp_gen_cntl & ~(R128_FP_SEL_CRTC2 |
- R128_FP_CRTC_USE_SHADOW_VEND |
- R128_FP_CRTC_HORZ_DIV2_EN |
- R128_FP_CRTC_HOR_CRT_DIV2_DIS |
- R128_FP_USE_SHADOW_EN)) |
- R128_FP_CRTC_DONT_SHADOW_VPAR |
- R128_FP_TDMS_EN);
+ R128_VERT_STRETCH_RESERVED)));
+ save->fp_vert_stretch &= ~R128_VERT_AUTO_RATIO_EN;
+ if (Vratio == 1.0) save->fp_vert_stretch &= ~(R128_VERT_STRETCH_ENABLE |
+ R128_VERT_STRETCH_BLEND);
+ else save->fp_vert_stretch |= (R128_VERT_STRETCH_ENABLE |
+ R128_VERT_STRETCH_BLEND);
+
+ save->fp_gen_cntl = (orig->fp_gen_cntl & ~(R128_FP_SEL_CRTC2 |
+ R128_FP_CRTC_USE_SHADOW_VEND |
+ R128_FP_CRTC_HORZ_DIV2_EN |
+ R128_FP_CRTC_HOR_CRT_DIV2_DIS |
+ R128_FP_USE_SHADOW_EN));
+ if (orig->fp_gen_cntl & R128_FP_DETECT_SENSE) {
+ save->fp_gen_cntl |= (R128_FP_CRTC_DONT_SHADOW_VPAR |
+ R128_FP_TDMS_EN);
+ }
+
save->fp_panel_cntl = orig->fp_panel_cntl;
- save->fp_crtc_h_total_disp = orig->fp_crtc_h_total_disp;
- save->fp_crtc_v_total_disp = orig->fp_crtc_v_total_disp;
- save->fp_h_sync_strt_wid = orig->fp_h_sync_strt_wid;
- save->fp_v_sync_strt_wid = orig->fp_v_sync_strt_wid;
save->lvds_gen_cntl = orig->lvds_gen_cntl;
save->tmds_crc = orig->tmds_crc;
@@ -2425,51 +2570,18 @@ static void R128InitFPRegisters(ScrnInfoPtr pScrn, R128SavePtr orig,
save->dac_cntl |= R128_DAC_CRT_SEL_CRTC2;
save->crtc2_gen_cntl = 0;
+ /* WARNING: Be careful about turning on the flat panel */
+#if 1
+ save->lvds_gen_cntl |= (R128_LVDS_ON | R128_LVDS_BLON);
+#else
save->fp_panel_cntl |= (R128_FP_DIGON | R128_FP_BLON);
save->fp_gen_cntl |= (R128_FP_FPON);
+#endif
- save->crtc_gen_cntl &= ~(R128_CRTC_DBL_SCAN_EN |
- R128_CRTC_INTERLACE_EN |
- R128_CRTC_CSYNC_EN |
- R128_CRTC_CUR_EN |
- R128_CRTC_CUR_MODE_MASK |
- R128_CRTC_ICON_EN |
- R128_CRTC_EXT_DISP_EN |
- R128_CRTC_EN |
- R128_CRTC_DISP_REQ_EN_B);
- save->crtc_gen_cntl |= R128_CRTC_EXT_DISP_EN | R128_CRTC_EN;
-
- disp_end = xres/8 - 1;
- save->crtc_h_total_disp = ((disp_end << R128_CRTC_H_DISP_SHIFT) |
- (disp_end + info->PanelHNonVis));
-
- save->crtc_h_sync_strt_wid &= ~(R128_CRTC_H_SYNC_STRT_PIX |
- R128_CRTC_H_SYNC_STRT_CHAR |
- R128_CRTC_H_SYNC_WID);
- save->crtc_h_sync_strt_wid |=
- (disp_end + info->PanelHOverPlus) << R128_CRTC_H_SYNC_STRT_CHAR_SHIFT;
- switch (info->CurrentLayout.pixel_code) {
- /* Adjustments are from ATI */
- case 8: save->crtc_h_sync_strt_wid |= 2; break;
- case 15:
- case 16: save->crtc_h_sync_strt_wid |= 1; break;
- case 24: save->crtc_h_sync_strt_wid |= 6; break;
- case 32: save->crtc_h_sync_strt_wid |= 5; break;
- }
- save->crtc_h_sync_strt_wid |=
- info->PanelHSyncWidth << R128_CRTC_H_SYNC_WID_SHIFT;
- save->crtc_h_sync_strt_wid |= R128_CRTC_H_SYNC_POL;
-
- disp_end = yres - 1;
- save->crtc_v_total_disp = ((disp_end << R128_CRTC_V_DISP_SHIFT) |
- (disp_end + info->PanelVNonVis));
-
- save->crtc_v_sync_strt_wid &= ~(R128_CRTC_V_SYNC_STRT |
- R128_CRTC_V_SYNC_WID);
- save->crtc_v_sync_strt_wid |= (disp_end + info->PanelVOverPlus);
- save->crtc_v_sync_strt_wid |=
- info->PanelVSyncWidth << R128_CRTC_V_SYNC_WID_SHIFT;
- save->crtc_v_sync_strt_wid |= R128_CRTC_V_SYNC_POL;
+ save->fp_crtc_h_total_disp = save->crtc_h_total_disp;
+ save->fp_crtc_v_total_disp = save->crtc_v_total_disp;
+ save->fp_h_sync_strt_wid = save->crtc_h_sync_strt_wid;
+ save->fp_v_sync_strt_wid = save->crtc_v_sync_strt_wid;
}
/* Define PLL registers for requested video mode. */
@@ -2653,7 +2765,7 @@ static Bool R128Init(ScrnInfoPtr pScrn, DisplayModePtr mode, R128SavePtr save)
R128InitCommonRegisters(save, mode, info);
if (!R128InitCrtcRegisters(pScrn, save, mode, info)) return FALSE;
- if (info->HasPanelRegs && info->EnableFP)
+ if (info->HasPanelRegs)
R128InitFPRegisters(pScrn, &info->SavedReg, save, mode, info);
R128InitPLLRegisters(pScrn, save, mode, &info->pll, dot_clock);
if (!R128InitDDARegisters(pScrn, save, mode, &info->pll, info))
@@ -2708,6 +2820,51 @@ Bool R128SwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
static int R128ValidMode(int scrnIndex, DisplayModePtr mode,
Bool verbose, int flag)
{
+ ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+ R128InfoPtr info = R128PTR(pScrn);
+
+ if (info->HasPanelRegs) {
+ if (mode->Flags & V_INTERLACE) return MODE_NO_INTERLACE;
+ if (mode->Flags & V_DBLSCAN) return MODE_NO_DBLESCAN;
+ }
+
+ if (info->HasPanelRegs && !info->CRTOnly && info->VBIOS) {
+ int i;
+ for (i = info->FPBIOSstart+64; R128_BIOS16(i) != 0; i += 2) {
+ int j = R128_BIOS16(i);
+
+ if (mode->CrtcHDisplay == R128_BIOS16(j) &&
+ mode->CrtcVDisplay == R128_BIOS16(j+2)) {
+ /* Assume we are using expanded mode */
+ if (R128_BIOS16(j+5)) j = R128_BIOS16(j+5);
+ else j += 9;
+
+ mode->Clock = (CARD32)R128_BIOS16(j) * 10;
+
+ mode->HDisplay = mode->CrtcHDisplay =
+ ((R128_BIOS16(j+10) & 0x01ff)+1)*8;
+ mode->HSyncStart = mode->CrtcHSyncStart =
+ ((R128_BIOS16(j+12) & 0x01ff)+1)*8;
+ mode->HSyncEnd = mode->CrtcHSyncEnd =
+ mode->CrtcHSyncStart + (R128_BIOS8(j+14) & 0x1f);
+ mode->HTotal = mode->CrtcHTotal =
+ ((R128_BIOS16(j+8) & 0x01ff)+1)*8;
+
+ mode->VDisplay = mode->CrtcVDisplay =
+ (R128_BIOS16(j+17) & 0x07ff)+1;
+ mode->VSyncStart = mode->CrtcVSyncStart =
+ (R128_BIOS16(j+19) & 0x07ff)+1;
+ mode->VSyncEnd = mode->CrtcVSyncEnd =
+ mode->CrtcVSyncStart + ((R128_BIOS16(j+19) >> 11) & 0x1f);
+ mode->VTotal = mode->CrtcVTotal =
+ (R128_BIOS16(j+15) & 0x07ff)+1;
+
+ return MODE_OK;
+ }
+ }
+ return MODE_NOMODE;
+ }
+
return MODE_OK;
}
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/r128/r128_reg.h b/xc/programs/Xserver/hw/xfree86/drivers/r128/r128_reg.h
index 0bc455afb..e8ff8b915 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/r128/r128_reg.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/r128/r128_reg.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/r128/r128_reg.h,v 1.11 2000/07/01 01:40:46 martin Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/r128/r128_reg.h,v 1.13 2000/09/13 15:47:32 martin Exp $ */
/**************************************************************************
Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc.,
@@ -536,6 +536,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#define R128_FP_GEN_CNTL 0x0284
# define R128_FP_FPON (1 << 0)
# define R128_FP_TDMS_EN (1 << 2)
+# define R128_FP_DETECT_SENSE (1 << 8)
# define R128_FP_SEL_CRTC2 (1 << 13)
# define R128_FP_CRTC_DONT_SHADOW_VPAR (1 << 16)
# define R128_FP_CRTC_USE_SHADOW_VEND (1 << 18)
@@ -553,7 +554,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
# define R128_HORZ_STRETCH_BLEND (1 << 25)
# define R128_HORZ_STRETCH_ENABLE (1 << 26)
# define R128_HORZ_FP_LOOP_STRETCH (0x7 << 27)
-# define R128_HORZ_STRETCH_RESERVED 0xc0000000
+# define R128_HORZ_STRETCH_RESERVED (1 << 30)
+# define R128_HORZ_AUTO_RATIO_FIX_EN (1 << 31)
#define R128_FP_PANEL_CNTL 0x0288
# define R128_FP_DIGON (1 << 0)
@@ -568,6 +570,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
# define R128_VERT_STRETCH_ENABLE (1 << 24)
# define R128_VERT_STRETCH_LINEREP (0 << 25)
# define R128_VERT_STRETCH_BLEND (1 << 25)
+# define R128_VERT_AUTO_RATIO_EN (1 << 26)
# define R128_VERT_STRETCH_RESERVED 0xf8e00000
#define R128_GEN_INT_CNTL 0x0040
@@ -652,8 +655,11 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#define R128_LEAD_BRES_LNTH 0x161c
#define R128_LEAD_BRES_LNTH_SUB 0x1624
#define R128_LVDS_GEN_CNTL 0x02d0
-# define R128_LVDS_ON (1 << 0)
-# define R128_LVDS_SEL_CRTC2 (1 << 23)
+# define R128_LVDS_ON (1 << 0)
+# define R128_LVDS_BLON (1 << 19)
+# define R128_LVDS_SEL_CRTC2 (1 << 23)
+# define R128_HSYNC_DELAY_SHIFT 28
+# define R128_HSYNC_DELAY_MASK (0xf << 28)
#define R128_MAX_LATENCY 0x0f3f /* PCI */
#define R128_MCLK_CNTL 0x000f /* PLL */
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/sis/init300.c b/xc/programs/Xserver/hw/xfree86/drivers/sis/init300.c
index 5c4e01e98..2b669d811 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/sis/init300.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/sis/init300.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/init300.c,v 1.2 2000/08/04 03:51:46 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/init300.c,v 1.3 2000/09/22 11:35:46 alanh Exp $ */
#include "xf86.h"
#include "xf86PciInfo.h"
@@ -22,6 +22,7 @@ Bool SiSSetMode(ScrnInfoPtr pScrn, DisplayModePtr mode)
USHORT BaseAddr = (USHORT) (SISPTR(pScrn)->RelIO +0x30);
USHORT ModeNo=0;
USHORT Rate;
+ USHORT tempal,i,Part1Port;
P3c4=BaseAddr+0x14;
P3d4=BaseAddr+0x24;
@@ -40,7 +41,12 @@ Bool SiSSetMode(ScrnInfoPtr pScrn, DisplayModePtr mode)
SetReg1(P3d4, 0x33, Rate);
SetReg1(P3c4, 0x20, 0xa1);
- SetReg1(P3c4, 0x1E, 0x42);
+ SetReg1(P3c4, 0x1E, 0x5A);
+
+ if(pSiS->LVDSFlags)
+ IF_DEF_LVDS = 1;
+ else
+ IF_DEF_LVDS = 0;
PresetScratchregister(P3d4); /* add for CRT2 */
/* replace GetSenseStatus,SetTVSystem,SetDisplayInfo */
@@ -50,9 +56,9 @@ Bool SiSSetMode(ScrnInfoPtr pScrn, DisplayModePtr mode)
if(temp==0) return(0);
SetTVSystem(); /* add for CRT2 */
- GetLCDDDCInfo(pScrn); /* add for CRT2 */
+ /*GetLCDDDCInfo(pScrn);*/ /* add for CRT2 */
GetVBInfo(BaseAddr,ROMAddr); /* add for CRT2 */
- GetLCDResInfo(P3d4); /* add for CRT2 */
+ GetLCDResInfo(ROMAddr, P3d4); /* add for CRT2 */
temp=CheckMemorySize(ROMAddr); /* 3.Check memory size */
if(temp==0) return(0);
@@ -89,8 +95,9 @@ Bool SiSSetMode(ScrnInfoPtr pScrn, DisplayModePtr mode)
if(((cr30flag&0x01)==1)||((cr30flag&0x03)==0x02)||
(((cr30flag&0x03)==0x00)&&((cr31flag&0x20)==0x20))) {
/* if CR30 d[0]=1 or d[1:0]=10, set CRT2 or cr30 cr31== 0x00 0x20 */
- SetCRT2Group(BaseAddr,ROMAddr,ModeNo, pScrn); /* add for CRT2 */
+ SetCRT2Group(BaseAddr,ROMAddr,ModeNo, pScrn); /* add for CRT2 */
}
+
SetPitch(pScrn, BaseAddr); /* 16.SetPitch */
DisplayOn(); /* 17.DisplayOn */
return TRUE;
@@ -158,6 +165,15 @@ VOID SetSeqRegs(ULONG ROMAddr)
SetReg1(P3c4,0x00,0x03); /* Set SR0 */
StandTable=StandTable+0x05;
SRdata=*((UCHAR *)(ROMAddr+StandTable)); /* Get SR01 from file */
+ if(IF_DEF_LVDS==1){
+ if(VBInfo&SetCRT2ToLCD){
+ if(VBInfo&SetInSlaveMode){
+ if(LCDInfo&LCDNonExpanding){
+ SRdata=SRdata|0x01;
+ }
+ }
+ }
+ }
SRdata=SRdata|0x20;
SetReg1(P3c4,0x01,SRdata); /* Set SR1 */
for(i=02;i<=04;i++) {
@@ -200,10 +216,30 @@ VOID SetATTRegs(ULONG ROMAddr)
for(i=0;i<=0x13;i++) {
StandTable++;
ARdata=*((UCHAR *)(ROMAddr+StandTable)); /* Get AR for file */
+ if(IF_DEF_LVDS==1){ /*for LVDS*/
+ if(VBInfo&SetCRT2ToLCD){
+ if(VBInfo&SetInSlaveMode){
+ if(LCDInfo&LCDNonExpanding){
+ if(i==0x13){
+ ARdata=0;
+ }
+ }
+ }
+ }
+ }
GetReg2(P3da); /* reset 3da */
SetReg3(P3c0,i); /* set index */
SetReg3(P3c0,ARdata); /* set data */
}
+ if(IF_DEF_LVDS==1){ /*for LVDS*/
+ if(VBInfo&SetCRT2ToLCD){
+ if(VBInfo&SetInSlaveMode){
+ if(LCDInfo&LCDNonExpanding){
+
+ }
+ }
+ }
+ }
GetReg2(P3da); /* reset 3da */
SetReg3(P3c0,0x14); /* set index */
SetReg3(P3c0,0x00); /* set data */
@@ -969,6 +1005,12 @@ USHORT CalcModeIndex(ScrnInfoPtr pScrn, DisplayModePtr mode)
case 640:
ModeIndex = ModeIndex_640x480[i];
break;
+ case 720:
+ if(mode->VDisplay == 480)
+ ModeIndex = ModeIndex_720x480[i];
+ else
+ ModeIndex = ModeIndex_720x576[i];
+ break;
case 800:
ModeIndex = ModeIndex_800x600[i];
break;
@@ -1012,9 +1054,15 @@ USHORT CalcRefreshRate(ScrnInfoPtr pScrn, DisplayModePtr mode)
case 1600:
Index = 4;
break;
+ case 720:
+ if(mode->VDisplay == 480)
+ Index = 5;
+ else
+ Index = 6;
+ break;
}
- while(RefreshRate[Index][i] != 0)
+ while(RefreshRate[Index][i] != NULL)
{
if(temp == RefreshRate[Index][i])
{
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/sis/init300.h b/xc/programs/Xserver/hw/xfree86/drivers/sis/init300.h
index 1dfa249b8..76de15da2 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/sis/init300.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/sis/init300.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/init300.h,v 1.2 2000/08/03 12:24:03 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/init300.h,v 1.3 2000/09/22 11:35:46 alanh Exp $ */
#include "initdef.h"
@@ -52,16 +52,20 @@ USHORT VGA_DAC[]={0x00,0x10,0x04,0x14,0x01,0x11,0x09,0x15,
0x0B,0x0C,0x0D,0x0F,0x10};
USHORT ModeIndex_640x480[] = {0x2E, 0x44, 0x45, 0x62};
+USHORT ModeIndex_720x480[] = {0x31, 0x33, 0x00, 0x35};
+USHORT ModeIndex_720x576[] = {0x32, 0x34, 0x00, 0x36};
USHORT ModeIndex_800x600[] = {0x30, 0x47, 0x48, 0x63};
USHORT ModeIndex_1024x768[] = {0x38, 0x4A, 0x4B, 0x64};
USHORT ModeIndex_1280x1024[] = {0x3A, 0x4D, 0x4E, 0x65};
USHORT ModeIndex_1600x1200[] = {0x3C, 0x3D, 0x3E, 0x66};
-USHORT RefreshRate[5][8] = {
+USHORT RefreshRate[7][8] = {
{60, 72, 75, 85, 100, 120, 160, 200},
{56, 60, 72, 75, 85, 100, 120, 160},
{43, 60, 70, 75, 85, 100, 120, 0},
{43, 60, 75, 85, 0, 0, 0, 0},
- {60, 65, 70, 75, 85, 0, 0, 0}};
+ {60, 65, 70, 75, 85, 0, 0, 0},
+ {60, 0 , 0 , 0 , 0 , 0 , 0 , 0 },
+ {60, 0 , 0 , 0 , 0 , 0 , 0 , 0 }};
USHORT P3c4,P3d4,P3c0,P3ce,P3c2,P3ca,P3c6,P3c7,P3c8,P3c9,P3da;
USHORT CRT1VCLKLen; /*VCLKData table length of bytes of each entry*/
@@ -69,6 +73,8 @@ USHORT flag_clearbuffer; /*0: no clear frame buffer 1:clear frame buffer*/
int RAMType;
int ModeIDOffset,StandTable,CRT1Table,ScreenOffset,VCLKData,MCLKData, ECLKData;
int REFIndex,ModeType;
+USHORT IF_DEF_LVDS;
+USHORT VBInfo,LCDResInfo,LCDTypeInfo,LCDInfo;
USHORT CalcRefreshRate(ScrnInfoPtr, DisplayModePtr);
USHORT CalcModeIndex(ScrnInfoPtr, DisplayModePtr);
@@ -103,8 +109,8 @@ USHORT CalcDelay(ULONG ,USHORT);
extern BOOLEAN SetCRT2Group(USHORT BaseAddr,ULONG ROMAddr,USHORT ModeNo,ScrnInfoPtr pScrn);
extern VOID GetVBInfo(USHORT BaseAddr,ULONG ROMAddr);
extern VOID PresetScratchregister(USHORT P3d4);
-extern BOOLEAN GetLCDResInfo(USHORT P3d4);
+extern BOOLEAN GetLCDResInfo(ULONG ROMAddr, USHORT P3d4);
extern VOID SetTVSystem();
extern BOOLEAN GetLCDDDCInfo(ScrnInfoPtr pScrn);
extern USHORT GetVCLKLen(ULONG ROMAddr);
-
+extern USHORT Part1[];
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/sis/init301.c b/xc/programs/Xserver/hw/xfree86/drivers/sis/init301.c
index 1c3d44010..e2ff6bea7 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/sis/init301.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/sis/init301.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/init301.c,v 1.1 2000/08/01 20:52:24 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/init301.c,v 1.2 2000/09/22 11:35:46 alanh Exp $ */
#include "xf86.h"
#include "xf86PciInfo.h"
@@ -18,25 +18,36 @@ BOOLEAN SetCRT2Group(USHORT BaseAddr,ULONG ROMAddr,USHORT ModeNo, ScrnInfoPtr pS
if(((temp&0x02)==0) && ((VBInfo&CRT2DisplayFlag)==0))
return(FALSE);
SaveCRT2Info(ModeNo);
-
- DisableBridge(BaseAddr);
+ DisableBridge(BaseAddr);
UnLockCRT2(BaseAddr);
- SetDefCRT2ExtRegs(BaseAddr);
- SetCRT2ModeRegs(BaseAddr,ModeNo);
- if(VBInfo&CRT2DisplayFlag){
- LockCRT2(BaseAddr);
- return 0;
+ SetDefCRT2ExtRegs(BaseAddr);
+ SetCRT2ModeRegs(BaseAddr,ModeNo);
+ if(IF_DEF_LVDS==0) {
+ if(VBInfo&CRT2DisplayFlag){
+ LockCRT2(BaseAddr);
+ return 0;
+ }
+ }
+ GetCRT2Data(ROMAddr,ModeNo);
+ if(IF_DEF_LVDS==1) {
+ GetLVDSDesData(ROMAddr,ModeNo);
+ }
+ SetGroup1(BaseAddr,ROMAddr,ModeNo,pScrn);
+ if(IF_DEF_LVDS==0) {
+ SetGroup2(BaseAddr,ROMAddr);
+ SetGroup3(BaseAddr);
+ SetGroup4(BaseAddr,ROMAddr,ModeNo);
+ SetGroup5(BaseAddr,ROMAddr);
+ }
+ else {
+ ModCRT1CRTC(ROMAddr,ModeNo);
+ SetCRT2ECLK(ROMAddr,ModeNo);
}
- GetCRT2Data(ROMAddr,ModeNo);
- SetGroup1(BaseAddr,ROMAddr,ModeNo,pScrn);
- SetGroup2(BaseAddr,ROMAddr);
- SetGroup3(BaseAddr);
- SetGroup4(BaseAddr,ROMAddr,ModeNo);
- SetGroup5(BaseAddr,ROMAddr);
-
EnableCRT2();
EnableBridge(BaseAddr);
- SetLockRegs();
+ if(IF_DEF_LVDS==0) {
+ /* SetLockRegs(); */
+ }
LockCRT2(BaseAddr);
return 1;
}
@@ -48,12 +59,17 @@ VOID SetDefCRT2ExtRegs(USHORT BaseAddr)
Part1Port=BaseAddr+IND_SIS_CRT2_PORT_04;
Part2Port=BaseAddr+IND_SIS_CRT2_PORT_10;
Part4Port=BaseAddr+IND_SIS_CRT2_PORT_14;
- SetReg1(Part1Port,0x02,0x40);
- SetReg1(Part4Port,0x10,0x80);
- temp=(UCHAR)GetReg1(P3c4,0x16);
- temp=temp&0xC3;
- SetReg1(P3d4,0x35,temp);
-
+ if(IF_DEF_LVDS==0) {
+ SetReg1(Part1Port,0x02,0x40);
+ SetReg1(Part4Port,0x10,0x80);
+ temp=(UCHAR)GetReg1(P3c4,0x16);
+ temp=temp&0xC3;
+ SetReg1(P3d4,0x35,temp);
+ }
+ else {
+ SetReg1(P3d4,0x32,0x02);
+ SetReg1(Part1Port,0x02,0x00);
+ }
}
USHORT GetRatePtrCRT2(ULONG ROMAddr, USHORT ModeNo)
@@ -73,10 +89,15 @@ USHORT GetRatePtrCRT2(ULONG ROMAddr, USHORT ModeNo)
if(SetFlag&ProgrammingCRT2){
if(VBInfo&SetCRT2ToLCD){
- temp=LCDResInfo;
- temp1=LCDRefreshIndex[temp];
- if(index>temp1){
- index=temp1;
+ if(IF_DEF_LVDS==0) {
+ temp=LCDResInfo;
+ temp1=LCDRefreshIndex[temp];
+ if(index>temp1){
+ index=temp1;
+ }
+ }
+ else {
+ index=0;
}
}
}
@@ -111,40 +132,61 @@ USHORT GetRatePtrCRT2(ULONG ROMAddr, USHORT ModeNo)
temp1=0;
}
+/* REFIndex=0x2598; */
return(0x01|(temp1<<1));
}
BOOLEAN AjustCRT2Rate(ULONG ROMAddr)
{
- USHORT tempax,tempbx,temp;
+ USHORT tempax,tempbx=0,temp;
USHORT tempextinfoflag;
tempax=0;
- if(VBInfo&SetCRT2ToRAMDAC){
- tempax=tempax|SupportRAMDAC2;
- }
- if(VBInfo&SetCRT2ToLCD){
- tempax=tempax|SupportLCD;
- if(LCDResInfo!=Panel1280x1024){
- temp=*((UCHAR *)(ROMAddr+ModeIDOffset+0x09)); /* si+Ext_ResInfo */
- if(temp>=9){
- tempax=0;
+ if(IF_DEF_LVDS==0) {
+ if(VBInfo&SetCRT2ToRAMDAC){
+ tempax=tempax|SupportRAMDAC2;
+ }
+ if(VBInfo&SetCRT2ToLCD){
+ tempax=tempax|SupportLCD;
+ if(LCDResInfo!=Panel1280x1024){
+ temp=*((UCHAR *)(ROMAddr+ModeIDOffset+0x09)); /* si+Ext_ResInfo */
+ if(temp>=9){
+ tempax=0;
+ }
}
}
- }
- if(VBInfo&(SetCRT2ToAVIDEO|SetCRT2ToSVIDEO|SetCRT2ToSCART)){
- tempax=tempax|SupportTV;
- if(!(VBInfo&SetPALTV)){
- tempextinfoflag=*((USHORT *)(ROMAddr+REFIndex+0x0)); /* di+Ext_InfoFlag */
- if(tempextinfoflag&NoSupportSimuTV){
- if(VBInfo&SetInSlaveMode){
- if(!(VBInfo&SetNotSimuTVMode)){
- return 0;
+ if(VBInfo&(SetCRT2ToAVIDEO|SetCRT2ToSVIDEO|SetCRT2ToSCART)){
+ tempax=tempax|SupportTV;
+ if(!(VBInfo&SetPALTV)){
+ tempextinfoflag=*((USHORT *)(ROMAddr+REFIndex+0x0)); /* di+Ext_InfoFlag */
+ if(tempextinfoflag&NoSupportSimuTV){
+ if(VBInfo&SetInSlaveMode){
+ if(!(VBInfo&SetNotSimuTVMode)){
+ return 0;
+ }
}
}
}
}
+ tempbx=*((USHORT *)(ROMAddr+ModeIDOffset+0x04)); /* si+Ext_point */
+ }
+ else {
+ tempbx=*((USHORT *)(ROMAddr+ModeIDOffset+0x04));
+ if(VBInfo&SetCRT2ToLCD){
+ tempax=tempax|SupportLCD;
+ temp=*((UCHAR *)(ROMAddr+ModeIDOffset+0x09)); /*si+Ext_ResInfo */
+ if(temp>0x08){ /*1024x768 */
+ return 0;
+ }
+ if(LCDResInfo<Panel1024x768){
+ if(temp>0x07){ /*800x600 */
+ return 0;
+ }
+ if(temp==0x04){ /*512x384 */
+ return 0;
+ }
+ }
+ }
}
- tempbx=*((USHORT *)(ROMAddr+ModeIDOffset+0x04)); /* si+Ext_point */
for(;REFIndex>tempbx;REFIndex-=Ext2StructSize){
tempextinfoflag=*((USHORT *)(ROMAddr+REFIndex+0x0)); /* di+Ext_InfoFlag */
if(tempextinfoflag&tempax){
@@ -193,28 +235,96 @@ VOID DisableCRT2(){
VOID DisableBridge(USHORT BaseAddr)
{
UCHAR temp3,part2_02,part2_05;
- USHORT Part2Port;
+ USHORT Part2Port,Part1Port=0;
Part2Port=BaseAddr+IND_SIS_CRT2_PORT_10;
- part2_02=(UCHAR)GetReg1(Part2Port,0x02);
- part2_05=(UCHAR)GetReg1(Part2Port,0x05);
- if(!WaitVBRetrace(BaseAddr)) /* return 0:no enable read dram */
- {
- LongWait();
+ if(IF_DEF_LVDS==0) {
+ part2_02=(UCHAR)GetReg1(Part2Port,0x02);
+ part2_05=(UCHAR)GetReg1(Part2Port,0x05);
+ if(!WaitVBRetrace(BaseAddr)) /* return 0:no enable read dram */
+ {
+ LongWait();
+ DisableLockRegs();
+ }
+ SetReg1(Part2Port,0x02,0x38);
+ SetReg1(Part2Port,0x05,0xFF);
+ temp3=(UCHAR)GetReg1(Part2Port,0x00);
+ temp3=temp3&0xDF;
+ SetReg1(Part2Port,0x00,(USHORT)temp3);
+ SetReg1(Part2Port,0x02,part2_02);
+ SetReg1(Part2Port,0x05,part2_05);
+ DisableCRT2();
+ }
+ else {
DisableLockRegs();
+ DisableCRT2();
+ UnLockCRT2(BaseAddr);
+ SetRegANDOR(Part1Port,0x02,0xFF,0x40); /*et Part1Port ,index 2, D6=1, */
}
- SetReg1(Part2Port,0x02,0x38);
- SetReg1(Part2Port,0x05,0xFF);
- temp3=(UCHAR)GetReg1(Part2Port,0x00);
- temp3=temp3&0xDF;
- SetReg1(Part2Port,0x00,(USHORT)temp3);
- SetReg1(Part2Port,0x02,part2_02);
- SetReg1(Part2Port,0x05,part2_05);
- DisableCRT2();
}
VOID GetCRT2Data(ULONG ROMAddr,USHORT ModeNo)
{
+ if(IF_DEF_LVDS==0){ /*301 */
+ GetCRT2Data301(ROMAddr,ModeNo);
+ return;
+ }else{ /*LVDS */
+ GetCRT2DataLVDS(ROMAddr,ModeNo);
+ return;
+ }
+}
+
+VOID GetCRT2DataLVDS(ULONG ROMAddr,USHORT ModeNo)
+{
+ USHORT tempax,tempbx,OldREFIndex;
+
+ OldREFIndex=(USHORT)REFIndex; /*push di */
+ GetResInfo(ROMAddr,ModeNo);
+ GetCRT2Ptr(ROMAddr,ModeNo);
+
+ tempax=*((USHORT *)(ROMAddr+REFIndex));
+ tempax=tempax&0x0FFF;
+ VGAHT=tempax;
+
+ tempax=*((USHORT *)(ROMAddr+REFIndex+1));
+ tempax=tempax>>4;
+ tempax=tempax&0x07FF;
+ VGAVT=tempax;
+/* VGAVT=518; */
+
+ tempax=*((USHORT *)(ROMAddr+REFIndex+3));
+ tempax=tempax&0x0FFF;
+ tempbx=*((USHORT *)(ROMAddr+REFIndex+4));
+ tempbx=tempbx>>4;
+ tempbx=tempbx&0x07FF;
+
+ HT=tempax;
+ VT=tempbx;
+
+ if(IF_DEF_TRUMPION==0){
+ if(VBInfo&SetCRT2ToLCD){
+ if(!(LCDInfo&LCDNonExpanding)){
+ if(LCDResInfo==Panel800x600){
+ tempax=800;
+ tempbx=600;
+ }else if(LCDResInfo==Panel1024x768){
+ tempax=1024;
+ tempbx=768;
+ }else{
+ tempax=1280;
+ tempbx=1024;
+ }
+ HDE=tempax;
+ VDE=tempbx;
+ }
+ }
+ }
+ REFIndex=OldREFIndex; /*pop di */
+ return;
+}
+
+VOID GetCRT2Data301(ULONG ROMAddr,USHORT ModeNo)
+{
USHORT tempax,tempbx,modeflag1,OldREFIndex;
USHORT tempal,tempah,tempbl;
@@ -339,12 +449,44 @@ VOID GetResInfo(ULONG ROMAddr,USHORT ModeNo)
if(yres==360) yres=375;
}
}
+ if(IF_DEF_LVDS==1) {
+ if(xres==720) xres=640;
+ }
VGAHDE=xres;
HDE=xres;
VGAVDE=yres;
VDE=yres;
}
+VOID GetLVDSDesData(ULONG ROMAddr,USHORT ModeNo)
+{
+ USHORT old_REFIndex,tempax;
+
+ old_REFIndex=(USHORT)REFIndex; /*push di */
+ REFIndex=GetLVDSDesPtr(ROMAddr,ModeNo);
+
+ tempax=*((USHORT *)(ROMAddr+REFIndex));
+ tempax=tempax&0x0FFF;
+ LCDHDES=tempax;
+
+ if(LCDInfo&LCDNonExpanding){ /*hw walk-a-round */
+ if(LCDResInfo>=Panel1024x768){
+ if(ModeNo<=0x13){
+ LCDHDES=320;
+ }
+ }
+ }
+
+ tempax=*((USHORT *)(ROMAddr+REFIndex+1));
+ tempax=tempax>>4;
+ tempax=tempax&0x07FF;
+ LCDVDES=tempax;
+
+ REFIndex=old_REFIndex; /*pop di */
+ return;
+}
+
+
VOID GetRAMDAC2DATA(ULONG ROMAddr,USHORT ModeNo)
{
USHORT tempax,tempbx,tempbh,modeflag1,t1=0,t2;
@@ -387,32 +529,52 @@ VOID GetRAMDAC2DATA(ULONG ROMAddr,USHORT ModeNo)
VOID GetCRT2Ptr(ULONG ROMAddr,USHORT ModeNo)
{
- USHORT tempcl,tempbx,tempal,tempax;
- if(VBInfo&SetCRT2ToLCD){ /* LCD */
- tempbx=LCDResInfo;
- tempcl=LCDDataLen;
- if(!(SetFlag&LCDVESATiming)) tempbx+=5;
- }else if(VBInfo&SetPALTV){
- tempcl=TVDataLen;
- tempbx=3;
- }else{
- tempbx=4;
- tempcl=TVDataLen;
- }
+ USHORT tempcl,tempbx,tempal,tempax,CRT2PtrData=0;
+ if(IF_DEF_LVDS==0) {
+ if(VBInfo&SetCRT2ToLCD){ /* LCD */
+ tempbx=LCDResInfo;
+ tempcl=LCDDataLen;
+ tempbx=tempbx-Panel1024x768;
+ if(!(SetFlag&LCDVESATiming)) tempbx+=5;
+ }else if(VBInfo&SetPALTV){
+ tempcl=TVDataLen;
+ tempbx=3;
+ }else{
+ tempbx=4;
+ tempcl=TVDataLen;
+ }
+
+ if(SetFlag&TVSimuMode){
+ tempbx=tempbx+4;
+ }
+ if(ModeNo<=0x13){
+ tempal=*((UCHAR *)(ROMAddr+ModeIDOffset+0x04)); /* si+St_CRT2CRTC */
+ }else{
+ tempal=*((UCHAR *)(ROMAddr+REFIndex+4)); /* di+Ext_CRT2CRTC */
+ }
+ tempal=tempal&0x1F;
- if(SetFlag&TVSimuMode){
- tempbx=tempbx+4;
+ tempax=tempal*tempcl;
+ REFIndex=*((USHORT *)(ROMAddr + 0x20E + tempbx*2));
+ REFIndex+=tempax;
}
- if(ModeNo<=0x13){
- tempal=*((UCHAR *)(ROMAddr+ModeIDOffset+0x04)); /* si+St_CRT2CRTC */
- }else{
- tempal=*((UCHAR *)(ROMAddr+REFIndex+4)); /* di+Ext_CRT2CRTC */
+ else {
+ tempcl=LVDSDataLen;
+ tempbx=LCDResInfo-Panel800x600;
+ if(LCDInfo&LCDNonExpanding){
+ tempbx=tempbx+3;
+ }
+ if(ModeNo<=0x13){
+ tempal=*((UCHAR *)(ROMAddr+ModeIDOffset+0x04)); /* si+St_CRT2CRTC */
+ }else{
+ tempal=*((UCHAR *)(ROMAddr+REFIndex+0x04)); /* di+Ext_CRT2CRTC */
+ }
+ tempal=tempal&0x1F;
+ tempax=tempal*tempcl;
+ CRT2PtrData=*((USHORT *)(ROMAddr+ADR_CRT2PtrData)); /*ADR_CRT2PtrData is defined in init.def */
+ REFIndex=*((USHORT *)(ROMAddr+CRT2PtrData+tempbx*2));
+ REFIndex+=tempax;
}
- tempal=tempal&0x1F;
-
- tempax=tempal*tempcl;
- REFIndex=*((USHORT *)(ROMAddr + 0x20E + tempbx*2));
- REFIndex+=tempax;
}
VOID UnLockCRT2(USHORT BaseAddr)
@@ -455,42 +617,320 @@ VOID SetCRT2ModeRegs(USHORT BaseAddr,USHORT ModeNo)
}
SetReg1(Part1Port,0,tempah);
- tempah=0x01;
- if(!(VBInfo&SetInSlaveMode)){
- tempah=(tempah|0x02);
- }
- if(!(VBInfo&SetCRT2ToRAMDAC)){
- tempah=(tempah^0x05);
- if(!(VBInfo&SetCRT2ToLCD)){
- tempah=(tempah^0x01);
+
+ if(IF_DEF_LVDS==0) {
+ tempah=0x01;
+ if(!(VBInfo&SetInSlaveMode)){
+ tempah=(tempah|0x02);
}
+ if(!(VBInfo&SetCRT2ToRAMDAC)){
+ tempah=(tempah^0x05);
+ if(!(VBInfo&SetCRT2ToLCD)){
+ tempah=(tempah^0x01);
+ }
+ }
+ tempah=(tempah<<5)&0xFF;
+ if(VBInfo&CRT2DisplayFlag){
+ tempah=0;
+ }
+ SetReg1(Part1Port,0x01,tempah);
+
+ tempah=tempah>>5;
+ if((ModeType==ModeVGA)&&(!(VBInfo&SetInSlaveMode))){
+ tempah=tempah|0x010;
+ }
+ if(LCDResInfo!=Panel1024x768){
+ tempah=tempah|0x080;
+ }
+ if(VBInfo&SetCRT2ToTV){
+ if(VBInfo&SetInSlaveMode){
+ tempah=tempah|0x020;
+ }
+ }
+
+ temp3=(UCHAR)GetReg1(Part4Port,0x0D);
+ temp3=temp3&(~0x0BF);
+ temp3=temp3|tempah;
+ SetReg1(Part4Port,0x0D,(USHORT)temp3);
}
- tempah=(tempah<<5)&0xFF;
- if(VBInfo&CRT2DisplayFlag){
+ else {
tempah=0;
+ if(!(VBInfo&SetInSlaveMode)){
+ tempah=tempah|0x02;
+ }
+ tempah=(tempah<<5)&0x0FF;
+ if(VBInfo&CRT2DisplayFlag){
+ tempah=0;
+ }
+ SetReg1(Part1Port,0x01,tempah);
}
- SetReg1(Part1Port,0x01,tempah);
+}
- tempah=tempah>>5;
- if((ModeType==ModeVGA)&&(!(VBInfo&SetInSlaveMode))){
- tempah=tempah|0x010;
- }
- if(LCDResInfo!=Panel1024x768){
- tempah=tempah|0x080;
+VOID SetGroup1(USHORT BaseAddr,ULONG ROMAddr,USHORT ModeNo,
+ ScrnInfoPtr pScrn)
+{
+ if(IF_DEF_LVDS==0){ /*301 */
+ SetGroup1_301(BaseAddr,ROMAddr,ModeNo,pScrn);
+ }else{ /*LVDS */
+ SetGroup1_LVDS(BaseAddr,ROMAddr,ModeNo,pScrn);
}
- if(VBInfo&SetCRT2ToTV){
- if(VBInfo&SetInSlaveMode){
- tempah=tempah|0x020;
+}
+
+VOID SetGroup1_LVDS(USHORT BaseAddr,ULONG ROMAddr,USHORT ModeNo,
+ ScrnInfoPtr pScrn)
+{
+ USHORT temp1,temp2,tempcl,tempch,tempbh,tempal,tempah,tempax,tempbx;
+ USHORT tempcx,OldREFIndex,lcdhdee;
+ USHORT Part1Port;
+ USHORT temppush1,temppush2;
+ unsigned long int tempeax,tempebx,tempecx,templong;
+
+ Part1Port=BaseAddr+IND_SIS_CRT2_PORT_04;
+ OldREFIndex=(USHORT)REFIndex; /*push di */
+
+ SetCRT2Offset(Part1Port,ROMAddr);
+ SetCRT2FIFO(Part1Port,ROMAddr,ModeNo,pScrn);
+ SetCRT2Sync(BaseAddr,ROMAddr,ModeNo);
+
+ temp1=(VGAHT-1)&0x0FF; /*BTVGA2HT 0x08,0x09 */
+ SetReg1(Part1Port,0x08,temp1);
+ temp1=(((VGAHT-1)&0xFF00)>>8)<<4;
+ SetRegANDOR(Part1Port,0x09,~0x0F0,temp1);
+
+
+ temp1=(VGAHDE+12)&0x0FF; /*BTVGA2HDEE 0x0A,0x0C */
+ SetReg1(Part1Port,0x0A,temp1);
+ /*temp1=((VGAHDE+12)&0xFF00)>>8; Wrong */
+ /*SetReg1(Part1Port,0x0C,temp1); */
+
+ temp1=VGAHDE+12; /*bx BTVGA@HRS 0x0B,0x0C */
+ temp2=(VGAHT-VGAHDE)>>2; /* */
+ temp1=temp1+temp2;
+ temp2=(temp2<<1)+temp1;
+ tempcl=temp2&0x0FF;
+
+ SetReg1(Part1Port,0x0B,(USHORT)(temp1&0x0FF));
+ tempah=(temp1&0xFF00)>>8;
+ tempbh=((((VGAHDE+12)&0xFF00)>>8)<<4)&0x0FF;
+ tempah=tempah|tempbh;
+ SetReg1(Part1Port,0x0C,tempah);
+ SetReg1(Part1Port,0x0D,tempcl); /*BTVGA2HRE 0x0D */
+ tempcx=(VGAVT-1);
+ tempah=tempcx&0x0FF;
+ SetReg1(Part1Port,0x0E,tempah); /*BTVGA2TV 0x0E,0x12 */
+ tempbx=VGAVDE-1;
+ tempah=tempbx&0x0FF;
+ SetReg1(Part1Port,0x0F,tempah); /*BTVGA2VDEE 0x0F,0x12 */
+ tempah=((tempbx&0xFF00)<<3)>>8;
+ tempah=tempah|((tempcx&0xFF00)>>8);
+ SetReg1(Part1Port,0x12,tempah);
+
+ tempbx=(VGAVT+VGAVDE)>>1; /*BTVGA2VRS 0x10,0x11 */
+ tempcx=((VGAVT-VGAVDE)>>4)+tempbx+1; /*BTVGA2VRE 0x11 */
+
+ tempah=tempbx&0x0FF;
+ SetReg1(Part1Port,0x10,tempah);
+ tempbh=(tempbx&0xFF00)>>8;
+ tempah=((tempbh<<4)&0x0FF)|(tempcx&0x0F);
+ SetReg1(Part1Port,0x11,tempah);
+
+ SetRegANDOR(Part1Port,0x13,~0x03C,tempah);
+
+ /*lines below are newly added for LVDS */
+ tempax=LCDHDES;
+ tempbx=HDE;
+ tempcx=HT;
+ tempcx=tempcx-tempbx; /*HT-HDE */
+ /*push ax lcdhdes */
+ tempax=tempax+tempbx; /*lcdhdee */
+ tempbx=HT;
+ if(tempax>=tempbx){
+ tempax=tempax-tempbx;
+ }
+ /*push ax lcdhdee */
+ lcdhdee=tempax;
+ tempcx=tempcx>>2; /*temp */
+ tempcx=tempcx+tempax; /*lcdhrs */
+ if(tempcx>=tempbx){
+ tempcx=tempcx-tempbx;
+ }
+ /* v ah,cl */
+ tempax=tempcx;
+ tempax=tempax>>3; /*BPLHRS */
+ tempah=tempax&0x0FF;
+ SetReg1(Part1Port,0x14,tempah); /*Part1_14h */
+ tempah=tempah+2;
+ tempah=tempah+0x01F;
+ tempcl=tempcx&0x0FF;
+ tempcl=tempcl&0x07;
+ tempcl=(tempcl<<5)&0xFF; /* PHLHSKEW */
+ tempah=tempah|tempcl;
+ SetReg1(Part1Port,0x15,tempah); /*Part1_15h */
+ tempbx=lcdhdee; /*lcdhdee */
+ tempcx=LCDHDES; /*lcdhdes */
+ tempah=(tempcx&0xFF);
+ tempah=tempah&0x07; /*BPLHDESKEW */
+ SetReg1(Part1Port,0x1A,tempah); /*Part1_1Ah */
+ tempcx=tempcx>>3; /*BPLHDES */
+ tempah=(tempcx&0xFF);
+ SetReg1(Part1Port,0x16,tempah); /*Part1_16h */
+ tempbx=tempbx>>3; /*BPLHDEE */
+ tempah=tempbx&0xFF;
+ SetReg1(Part1Port,0x17,tempah); /*Part1_17h */
+
+ tempcx=VGAVT;
+ tempbx=VGAVDE;
+ tempcx=tempcx-tempbx; /* GAVT-VGAVDE */
+ tempbx=LCDVDES; /*VGAVDES */
+ temppush1=tempbx; /*push bx temppush1 */
+ if(IF_DEF_TRUMPION==0){
+ if(LCDResInfo==Panel800x600){
+ tempax=600;
+ }else{
+ tempax=768;
}
+ }else{
+ tempax=VGAVDE;
+ }
+ tempbx=tempbx+tempax;
+ tempax=VT; /*VT */
+ if(tempbx>=VT){
+ tempbx=tempbx-tempax;
+ }
+ temppush2=tempbx; /*push bx temppush2 */
+ tempcx=tempcx>>1;
+ tempbx=tempbx+tempcx;
+ tempbx++; /*BPLVRS */
+ if(tempbx>=tempax){
+ tempbx=tempbx-tempax;
+ }
+ tempah=tempbx&0xFF;
+ SetReg1(Part1Port,0x18,tempah); /*Part1_18h */
+ tempcx=tempcx>>3;
+ tempcx=tempcx+tempbx;
+ tempcx++; /*BPLVRE */
+ tempah=tempcx&0xFF;
+ tempah=tempah&0x0F;
+ tempah=tempah|0x030;
+ SetRegANDOR(Part1Port,0x19,~0x03F,tempah); /*Part1_19h */
+ tempbh=(tempbx&0xFF00)>>8;
+ tempbh=tempbh&0x07;
+ tempah=tempbh;
+ tempah=(tempah<<3)&0xFF; /*BPLDESKEW =0 */
+ /*movzx */
+ tempbx=VGAVDE;
+ if(tempbx!=VDE){
+ tempah=tempah|0x40;
+ }
+ SetRegANDOR(Part1Port,0x1A,0x07,tempah); /*Part1_1Ah */
+ tempecx=VGAVT;
+ tempebx=VDE;
+ tempeax=VGAVDE;
+ tempecx=tempecx-tempeax; /*VGAVT-VGAVDE */
+ tempeax=tempeax*64;
+ templong=tempeax/tempebx;
+ if(templong*tempebx<tempeax){
+ templong++;
+ }
+ tempebx=templong; /*BPLVCFACT */
+ if(SetFlag&EnableLVDSDDA){
+ tempebx=tempebx&0x03F;
+ }
+ tempah=(USHORT)(tempebx&0x0FF);
+ SetReg1(Part1Port,0x1E,tempah); /*Part1_1Eh */
+ tempbx=temppush2; /* p bx temppush2 BPLVDEE */
+ tempcx=temppush1; /*pop cx temppush1 NPLVDES */
+ tempbh=(tempbx&0xFF00)>>8;
+ tempah=tempah&0x07;
+ tempah=tempbh;
+ tempah=tempah<<3;
+ tempch=(tempcx&0xFF00)>>8;
+ tempch=tempch&0x07;
+ tempah=tempah|tempch;
+ SetReg1(Part1Port,0x1D,tempah); /*Part1_1Dh */
+ tempah=tempbx&0xFF;
+ SetReg1(Part1Port,0x1C,tempah); /*Part1_1Ch */
+ tempah=tempcx&0xFF;
+ SetReg1(Part1Port,0x1B,tempah); /*Part1_1Bh */
+
+ tempecx=VGAHDE;
+ tempebx=HDE;
+ tempeax=tempecx;
+ tempeax=tempeax<<6;
+ tempeax=tempeax<<10;
+ tempeax=tempeax/tempebx;
+ if(tempebx==tempecx){
+ tempeax=65535;
+ }
+ tempecx=tempeax;
+ tempeax=VGAHT;
+ tempeax=tempeax<<6;
+ tempeax=tempeax<<10;
+ tempeax=tempeax/tempecx;
+ tempecx=tempecx<<16;
+ tempeax=tempeax-1;
+ tempax=(USHORT)(tempeax&0x00FFFF);
+ tempcx=tempax;
+ tempah=tempcx&0x0FF;
+ SetReg1(Part1Port,0x1F,tempah); /*Part1_1Fh */
+ tempbx=VDE;
+ tempbx--; /*BENPLACCEND */
+ if(SetFlag&EnableLVDSDDA){
+ tempbx=1;
+ }
+ tempah=(tempbx&0xFF00)>>8;
+ tempah=(tempah<<3)&0xFF;
+ tempch=(tempcx&0xFF00)>>8;
+ tempch=tempch&0x07;
+ tempah=tempah|tempch;
+ SetReg1(Part1Port,0x20,tempah); /*Part1_20h */
+ tempah=tempbx&0xFF;
+ SetReg1(Part1Port,0x21,tempah); /*Part1_21h */
+ tempecx=tempecx>>16; /*BPLHCFACT */
+ temp1=*((USHORT *)(ROMAddr+ModeIDOffset+0x01)); /* si+St_ModeFlag */
+ if(temp1&HalfDCLK){
+ tempecx=tempecx>>1;
}
+ tempcx=(USHORT)(tempecx&0x0FFFF);
+ tempah=(tempcx&0xFF00)>>8;
+ SetReg1(Part1Port,0x22,tempah); /*Part1_22h */
+ tempah=tempcx&0x0FF;
+ SetReg1(Part1Port,0x23,tempah); /*Part1_23h */
+ if(IF_DEF_TRUMPION==1){
+ tempal=(USHORT)*((UCHAR *)(ROMAddr+ModeIDOffset+0x05)); /* si+St_ResInfo */
+ if(ModeNo>0x13){
+ SetFlag=SetFlag|ProgrammingCRT2;
+ GetRatePtrCRT2(ROMAddr,ModeNo);
+ tempal=*((UCHAR *)(ROMAddr+REFIndex+0x04)); /* di+Ext_CRT2CRTC */
+ tempal=tempal&0x1F;
+ }
+ tempah=0x80;
+ tempal=tempal*tempah;
+ REFIndex= offset_Zurac; /*offset Zurac need added in rompost.asm */
+ REFIndex=REFIndex+tempal;
+ SetTPData(); /*this function not implemented yet */
+ SetTPData();
+ SetTPData();
+ SetTPData();
+ SetTPData();
+ SetTPData();
+ SetTPData();
+ SetTPData();
+ SetTPData();
+ }
+
+ REFIndex=OldREFIndex; /*pop di */
- temp3=(UCHAR)GetReg1(Part4Port,0x0D);
- temp3=temp3&(~0x0BF);
- temp3=temp3|tempah;
- SetReg1(Part4Port,0x0D,(USHORT)temp3);
+ return;
}
-VOID SetGroup1(USHORT BaseAddr,ULONG ROMAddr,USHORT ModeNo,ScrnInfoPtr pScrn)
+VOID SetTPData()
+{
+ return;
+}
+
+
+VOID SetGroup1_301(USHORT BaseAddr,ULONG ROMAddr,USHORT ModeNo,ScrnInfoPtr pScrn)
{
SISPtr pSiS = SISPTR(pScrn);
USHORT temp1,temp2,tempcl,tempch,tempbl,tempbh,tempal,tempah,tempax,tempbx;
@@ -899,15 +1339,27 @@ USHORT GetQueueConfig()
USHORT GetVCLKPtr(ULONG ROMAddr,USHORT ModeNo)
{
USHORT tempal;
- tempal=(UCHAR)GetReg2((USHORT)(P3ca+0x02)); /* Port 3cch */
- tempal=((tempal>>2)&0x03);
- if(ModeNo>0x13){
- tempal=*((UCHAR *)(ROMAddr+REFIndex+0x03)); /* di+Ext_CRTVCLK */
+ if(IF_DEF_LVDS==0) {
+ tempal=(UCHAR)GetReg2((USHORT)(P3ca+0x02)); /* Port 3cch */
+ tempal=((tempal>>2)&0x03);
+ if(ModeNo>0x13){
+ tempal=*((UCHAR *)(ROMAddr+REFIndex+0x03)); /* di+Ext_CRTVCLK */
+ }
+ VCLKLen=GetVCLKLen(ROMAddr);
+ tempal=tempal*VCLKLen;
+ tempal=tempal+(*((USHORT *)(ROMAddr+0x208))); /* VCLKData */
+ return ((USHORT)tempal);
+ } else {
+ if(LCDResInfo==Panel800x600) {
+ tempal=VCLK40;
+ } else if(LCDResInfo==Panel1024x768) {
+ tempal=VCLK65;
+ }
+ VCLKLen=GetVCLKLen(ROMAddr);
+ tempal=tempal*VCLKLen;
+ tempal=tempal+(*((USHORT *)(ROMAddr+0x208)));
+ return((USHORT)tempal);
}
- VCLKLen=GetVCLKLen(ROMAddr);
- tempal=tempal*VCLKLen;
- tempal=tempal+(*((USHORT *)(ROMAddr+0x208))); /* VCLKData */
- return ((USHORT)tempal);
}
USHORT GetColorTh(ULONG ROMAddr)
@@ -1039,12 +1491,25 @@ USHORT GetVCLKLen(ULONG ROMAddr)
VOID SetCRT2Sync(USHORT BaseAddr,ULONG ROMAddr,USHORT ModeNo)
{
- USHORT temp1,tempah;
+ USHORT temp1,tempah=0;
USHORT temp;
USHORT Part1Port;
Part1Port=BaseAddr+IND_SIS_CRT2_PORT_04;
+ if(IF_DEF_LVDS==1){
+ if(VBInfo&SetCRT2ToLCD){
+ tempah=LCDInfo;
+ if(!(tempah&LCDSync)){
+ temp=*((USHORT *)(ROMAddr+REFIndex)); /*di+Ext_InfoFlag */
+ tempah=(temp>>8)&0x0C0;
+ }else{
+ tempah=tempah&0x0C0;
+ }
+ }
+ }
+ else {
temp=*((USHORT *)(ROMAddr+REFIndex)); /* di+Ext_InfoFlag */
tempah=(temp>>8)&0x0C0;
+ }
temp1=(UCHAR)GetReg1(Part1Port,0x19); /* part1port index 02 */
temp1=(temp1&(~0x0C0))|tempah;
SetReg1(Part1Port,0x19,temp1);
@@ -1495,7 +1960,7 @@ VOID SetGroup4(USHORT BaseAddr,ULONG ROMAddr,USHORT ModeNo)
tempah=tempah|((tempcx&0xFF00)>>8);
SetReg1(Part4Port,0x19,tempah);
- SetCRT2VCLK(BaseAddr,ROMAddr,ModeNo);
+ SetCRT2VCLK(BaseAddr,ROMAddr,ModeNo);
}
VOID SetCRT2VCLK(USHORT BaseAddr,ULONG ROMAddr,USHORT ModeNo)
@@ -1658,29 +2123,36 @@ VOID SetLockRegs()
USHORT temp1;
if((VBInfo&SetInSlaveMode)&&(!(VBInfo&SetCRT2ToRAMDAC))){
- VBLongWait();
+ VBLongWait();
temp1=GetReg1(P3c4,0x32);
temp1=temp1|0x20;
SetReg1(P3c4,0x32,temp1);
- VBLongWait();
+ VBLongWait();
}
}
VOID EnableBridge(USHORT BaseAddr)
{
USHORT part2_02,part2_05;
- USHORT Part2Port;
+ USHORT Part2Port,Part1Port=0;
Part2Port=BaseAddr+IND_SIS_CRT2_PORT_10;
- part2_02=(UCHAR)GetReg1(Part2Port,0x02);
- part2_05=(UCHAR)GetReg1(Part2Port,0x05);
- SetReg1(Part2Port,0x02,0x38);
- SetReg1(Part2Port,0x05,0xFF);
- LongWait();
- SetRegANDOR(Part2Port,0x00,~0x0E0,0x020);
- WaitVBRetrace(BaseAddr);
- SetReg1(Part2Port,0x02,part2_02);
- SetReg1(Part2Port,0x05,part2_05);
+ if(IF_DEF_LVDS==0) {
+ part2_02=(UCHAR)GetReg1(Part2Port,0x02);
+ part2_05=(UCHAR)GetReg1(Part2Port,0x05);
+ SetReg1(Part2Port,0x02,0x38);
+ SetReg1(Part2Port,0x05,0xFF);
+ LongWait();
+ SetRegANDOR(Part2Port,0x00,~0x0E0,0x020);
+ /* WaitVBRetrace(BaseAddr); */
+ SetReg1(Part2Port,0x02,part2_02);
+ SetReg1(Part2Port,0x05,part2_05);
+ }
+ else {
+ EnableCRT2();
+ UnLockCRT2(BaseAddr);
+/* SetRegANDOR(Part1Port,0x02,~0x040,0x0); */
+ }
}
VOID GetVBInfo(USHORT BaseAddr,ULONG ROMAddr)
@@ -1693,24 +2165,48 @@ VOID GetVBInfo(USHORT BaseAddr,ULONG ROMAddr)
ModeType=tempbl;
tempbx=0;
flag1=GetReg1(P3c4,0x38); /* call BridgeisOn */
- if(!(flag1&0x20)){
- VBInfo=CRT2DisplayFlag;
- return;
+ if(IF_DEF_LVDS==0) {
+ if(!(flag1&0x20)){
+ VBInfo=CRT2DisplayFlag;
+ return;
+ }
}
tempbl=GetReg1(P3d4,0x30);
tempbh=GetReg1(P3d4,0x31);
+ if(IF_DEF_LVDS==0) {
+ tempah=SetInSlaveMode;
+ tempah=tempah>>8;
+ tempah=tempah^0xFF;
+ tempbh=tempbh&tempah;
+ }
+ else {
+ tempbh=tempbh&(!(SetInSlaveMode>>8));
+ }
if(!(tempbl&0x07C)){
VBInfo=CRT2DisplayFlag;
return;
}
- if(tempbl&SetCRT2ToRAMDAC){
- tempbl=tempbl&(SetCRT2ToRAMDAC|SwitchToCRT2|SetSimuScanMode);
- }else if(tempbl&SetCRT2ToLCD){
- tempbl=tempbl&(SetCRT2ToLCD|SwitchToCRT2|SetSimuScanMode);
- }else if(tempbl&SetCRT2ToSCART){
- tempbl=tempbl&(SetCRT2ToSCART|SwitchToCRT2|SetSimuScanMode);
- }else if(tempbl&SetCRT2ToHiVisionTV){
- tempbl=tempbl&(SetCRT2ToHiVisionTV|SwitchToCRT2|SetSimuScanMode);
+ if(IF_DEF_LVDS==1){ /* or LVDS */
+ if(!(tempbl&SetCRT2ToLCD)){
+ VBInfo=CRT2DisplayFlag;
+ return;
+ }
+ }
+ if(IF_DEF_LVDS==0) {
+ if(tempbl&SetCRT2ToRAMDAC){
+ tempbl=tempbl&(SetCRT2ToRAMDAC|SwitchToCRT2|SetSimuScanMode);
+ }else if(tempbl&SetCRT2ToLCD){
+ tempbl=tempbl&(SetCRT2ToLCD|SwitchToCRT2|SetSimuScanMode);
+ }else if(tempbl&SetCRT2ToSCART){
+ tempbl=tempbl&(SetCRT2ToSCART|SwitchToCRT2|SetSimuScanMode);
+ }else if(tempbl&SetCRT2ToHiVisionTV){
+ tempbl=tempbl&(SetCRT2ToHiVisionTV|SwitchToCRT2|SetSimuScanMode);
+ }
+ }
+ else {
+ if(tempbl&SetCRT2ToLCD){
+ tempbl=tempbl&(SetCRT2ToLCD|SwitchToCRT2|SetSimuScanMode);
+ }
}
tempah=GetReg1(P3d4,0x31);
if(tempah&(CRT2DisplayFlag>>8)){
@@ -1751,6 +2247,10 @@ BOOLEAN BridgeIsEnable(USHORT BaseAddr)
USHORT flag1;
USHORT Part1Port;
Part1Port=BaseAddr+IND_SIS_CRT2_PORT_04;
+
+ if(IF_DEF_LVDS==1){
+ return 1;
+ }
flag1=GetReg1(P3c4,0x38); /* call BridgeisOn */
if(!(flag1&0x20)){ return 0;}
flag1=GetReg1(Part1Port,0x0);
@@ -1772,14 +2272,14 @@ BOOLEAN BridgeInSlave()
}
}
-BOOLEAN GetLCDResInfo(USHORT P3d4)
+BOOLEAN GetLCDResInfo(ULONG ROMAddr,USHORT P3d4)
{
- USHORT tempah,tempbh;
+ USHORT tempah,tempbh,tempflag;
tempah=(UCHAR)GetReg1(P3d4,0x36);
tempbh=tempah;
tempah=tempah&0x0F;
- if(tempah!=0) tempah--;
+/* if(tempah!=0) tempah--; */
if(tempah>Panel1280x1024) tempah=0;
LCDResInfo=tempah;
tempbh=tempbh>>4;
@@ -1788,6 +2288,33 @@ BOOLEAN GetLCDResInfo(USHORT P3d4)
tempah=(UCHAR)GetReg1(P3d4,0x37);
LCDInfo=tempah;
+ if(IF_DEF_LVDS==1){
+ tempflag=*((USHORT *)(ROMAddr+ModeIDOffset+0x01)); /* si+St_ModeFlag */
+ if(tempflag&HalfDCLK){
+ if(IF_DEF_TRUMPION==0){
+ if(!(LCDInfo&LCDNonExpanding)){
+ if(LCDResInfo==Panel1024x768){
+ tempflag=*((UCHAR *)(ROMAddr+ModeIDOffset+0x09));/*si+Ext_ResInfo*/
+ if(tempflag==4){ /*512x384 */
+ SetFlag=SetFlag|EnableLVDSDDA;
+ }
+ }else{
+ if(LCDResInfo==Panel800x600){
+ tempflag=*((UCHAR*)(ROMAddr+ModeIDOffset+0x09));/*si+Ext_ResInfo*/
+ if(tempflag==3){ /*400x300 */
+ SetFlag=SetFlag|EnableLVDSDDA;
+ }
+ }
+ }
+ }else{
+ SetFlag=SetFlag|EnableLVDSDDA;
+ }
+ }else{
+ SetFlag=SetFlag|EnableLVDSDDA;
+ }
+ }
+ }
+
if(!(VBInfo&SetCRT2ToLCD)){
return 1;
}
@@ -1883,3 +2410,155 @@ BOOLEAN WaitVBRetrace(USHORT BaseAddr)
}
return 1;
}
+
+
+VOID ModCRT1CRTC(ULONG ROMAddr,USHORT ModeNo)
+{
+ USHORT OldREFIndex,temp,tempah,i,modeflag1;
+
+ OldREFIndex=(USHORT)REFIndex;
+ temp=GetLVDSCRT1Ptr(ROMAddr,ModeNo);
+ if(temp==0){
+ REFIndex=OldREFIndex;
+ return;
+ }
+ tempah=(UCHAR)GetReg1(P3d4,0x11);/*unlock cr0-7 */
+ tempah=tempah&0x7F;
+ SetReg1(P3d4,0x11,tempah);
+ tempah=*((UCHAR *)(ROMAddr+REFIndex));
+ SetReg1(P3d4,0x0,tempah);
+ REFIndex++;
+ for(i=0x02;i<=0x05;REFIndex++,i++){
+ tempah=*((UCHAR *)(ROMAddr+REFIndex));
+ SetReg1(P3d4,i,tempah);
+ }
+ for(i=0x06;i<=0x07;REFIndex++,i++){
+ tempah=*((UCHAR *)(ROMAddr+REFIndex));
+ SetReg1(P3d4,i,tempah);
+ }
+ for(i=0x10;i<=0x11;REFIndex++,i++){
+ tempah=*((UCHAR *)(ROMAddr+REFIndex));
+ SetReg1(P3d4,i,tempah);
+ }
+ for(i=0x15;i<=0x16;REFIndex++,i++){
+ tempah=*((UCHAR *)(ROMAddr+REFIndex));
+ SetReg1(P3d4,i,tempah);
+ }
+
+ for(i=0x0A;i<=0x0C;REFIndex++,i++){
+ tempah=*((UCHAR *)(ROMAddr+REFIndex));
+ SetReg1(P3c4,i,tempah);
+ }
+ tempah=*((UCHAR *)(ROMAddr+REFIndex));
+ tempah=tempah&0x0E0;
+ SetReg1(P3c4,0x0E,tempah);
+
+ tempah=*((UCHAR *)(ROMAddr+REFIndex));
+ tempah=tempah&0x01;
+ tempah=tempah<<5;
+ modeflag1=*((USHORT *)(ROMAddr+ModeIDOffset+0x01)); /* si+St_ModeFlag */
+ if(modeflag1&DoubleScanMode){
+ tempah=tempah|0x080;
+ }
+ SetRegANDOR(P3d4,0x09,~0x020,tempah);
+ REFIndex=OldREFIndex;
+ return;
+}
+
+VOID SetCRT2ECLK(ULONG ROMAddr, USHORT ModeNo)
+{
+ USHORT OldREFIndex,tempah,tempal;
+ USHORT P3cc=P3c9+3;
+ OldREFIndex=(USHORT)REFIndex;
+ if(IF_DEF_TRUMPION==0){ /*no trumpion */
+ tempal=GetReg2(P3cc);
+ tempal=tempal&0x0C;
+/* SetReg3(P3c2,tempal); */
+ REFIndex=GetVCLKPtr(ROMAddr,ModeNo);
+ }else{ /*trumpion */
+ SetFlag=SetFlag&(~ProgrammingCRT2);
+ tempal=*((UCHAR *)(ROMAddr+REFIndex+0x03)); /*&di+Ext_CRTVCLK */
+ /*[6/8/2000],Mars Wen,for vbios version >=v1.03.00 */
+ tempal=tempal&0x03F;
+ /*~[6/8/2000],Mars Wen,for vbios version >=v1.03.00 */
+ /* tempal=tempal&0x01F; */
+ if(tempal==0x02){ /*31.5MHz */
+ REFIndex=REFIndex-Ext2StructSize;
+ }
+ REFIndex=GetVCLKPtr(ROMAddr,ModeNo);
+ SetFlag=SetFlag|ProgrammingCRT2;
+ }
+ tempal=0x02B;
+ if(!(VBInfo&SetInSlaveMode)){
+ tempal=tempal+3;
+ }
+ SetReg1(P3c4,0x05,0x86);
+ tempah=*((UCHAR *)(ROMAddr+REFIndex));
+ SetReg1(P3c4,tempal,tempah);
+ tempah=*((UCHAR *)(ROMAddr+REFIndex+1));
+ tempal++;
+ SetReg1(P3c4,tempal,tempah);
+ tempal++;
+ SetReg1(P3c4,tempal,0x80);
+ REFIndex=OldREFIndex;
+ return;
+}
+
+USHORT GetLVDSDesPtr(ULONG ROMAddr,USHORT ModeNo)
+{
+ USHORT tempcl,tempbx,tempal,tempptr,LVDSDesPtrData;
+ tempcl=LVDSDesDataLen;
+ tempbx=LCDTypeInfo;
+ if(LCDInfo&LCDNonExpanding){
+ tempbx=tempbx+16;
+ }
+ if(ModeNo<=0x13){
+ tempal=*((UCHAR *)(ROMAddr+ModeIDOffset+0x04)); /* si+St_CRT2CRTC */
+ }else{
+ tempal=*((UCHAR *)(ROMAddr+REFIndex+4)); /*di+Ext_CRT2CRTC */
+ }
+ tempal=tempal&0x1F;
+ tempal=tempal*tempcl;
+ tempbx=tempbx<<1;
+ LVDSDesPtrData=*((USHORT *)(ROMAddr+ADR_LVDSDesPtrData));
+ tempptr=*((USHORT *)(ROMAddr+LVDSDesPtrData+tempbx));
+ tempptr=tempptr+tempal;
+ return(tempptr);
+
+}
+
+BOOLEAN GetLVDSCRT1Ptr(ULONG ROMAddr,USHORT ModeNo)
+{
+ USHORT tempal,tempbx,modeflag1;
+ USHORT LVDSCRT1DataPtr;
+
+ if(!(VBInfo&SetInSlaveMode)){
+/* return 0; */
+ }
+ if(ModeNo<=0x13){
+ tempal=*((UCHAR *)(ROMAddr+ModeIDOffset+0x04)); /* si+St_CRT2CRTC */
+ }else{
+ tempal=*((UCHAR *)(ROMAddr+REFIndex+4)); /*di+Ext_CRT2CRTC */
+ }
+ tempal=tempal&0x3F;
+
+ tempbx=LCDResInfo;
+ tempbx=tempbx-Panel800x600;
+ if(LCDInfo&LCDNonExpanding){
+ tempbx=tempbx+6;
+ }
+ modeflag1=*((USHORT *)(ROMAddr+ModeIDOffset+0x01)); /* si+St_ModeFlag */
+ if(modeflag1&HalfDCLK){
+ tempbx=tempbx+3;
+ }
+ tempbx=tempbx<<1;
+ LVDSCRT1DataPtr=*((USHORT *)(ROMAddr+ADR_LVDSCRT1DataPtr));
+ REFIndex=*((USHORT *)(ROMAddr+LVDSCRT1DataPtr+tempbx));
+ tempal=tempal*LVDSCRT1Len;
+ REFIndex=REFIndex+tempal;
+ return 1;
+
+}
+
+
+
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/sis/init301.h b/xc/programs/Xserver/hw/xfree86/drivers/sis/init301.h
index 73ff0d3d0..a2cb8f174 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/sis/init301.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/sis/init301.h
@@ -1,17 +1,18 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/init301.h,v 1.2 2000/08/03 12:24:03 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/init301.h,v 1.3 2000/09/22 11:35:46 alanh Exp $ */
#include "initdef.h"
USHORT VBInfo,SetFlag,RVBHCFACT,RVBHCMAX,VGAVT,VGAHT,VT,HT,VGAVDE,VGAHDE;
USHORT VDE,HDE,RVBHRS,NewFlickerMode,RY1COE,RY2COE,RY3COE,RY4COE;
USHORT LCDResInfo,LCDTypeInfo,LCDInfo,VCLKLen;
+USHORT LCDHDES,LCDVDES;
USHORT StResInfo[5][2]={{640,400},{640,350},{720,400},{720,350},{640,480}};
-USHORT ModeResInfo[13][4]={{320,200,8,8},{320,240,8,8},{320,400,8,8},
+USHORT ModeResInfo[15][4]={{320,200,8,8},{320,240,8,8},{320,400,8,8},
{400,300,8,8},{512,384,8,8},{640,400,8,16},
{640,480,8,16},{800,600,8,16},{1024,768,8,16},
{1280,1024,8,16},{1600,1200,8,16},{1920,1440,8,16},
- {2048,1536,8,16}};
+ {720,480,8,16},{720,576,8,16},{1280,960,8,16}};
USHORT NTSCTiming[61]={0x017,0x01D,0x003,0x009,0x005,0x006,0x00C,0x00C,
0x094,0x049,0x001,0x00A,0x006,0x00D,0x004,0x00A,
@@ -50,6 +51,12 @@ USHORT PALGroup3Data[63]={0x000,0x01A,0x022,0x063,0x062,0x022,0x008,0x085,
0x030,0x030,0x000,0x0F3,0x0F3,0x000,0x0A2,0x0A2,
0x000,0x048,0x0FE,0x07E,0x008,0x040,0x008,0x091,
0x018,0x005,0x018,0x005,0x04C,0x0A8,0x001};
+USHORT Part1[41]={0x30, 0x16, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x3f, 0x30, 0x8c, 0xbc, 0x22, 0x1c, 0x05, 0xdf,
+ 0xf3, 0x16, 0x0a, 0x20, 0x89, 0x93, 0x00, 0x80,
+ 0x14, 0xf7, 0x58, 0x00, 0x00, 0x18, 0x28, 0x32,
+ 0x15, 0xff, 0xa0, 0x00, 0x01, 0x03, 0x2c, 0x11,
+ 0x92};
VOID SetDefCRT2ExtRegs(USHORT BaseAddr);
BOOLEAN SetCRT2Group(USHORT BaseAddr,ULONG ROMAddr,USHORT ModeNo, ScrnInfoPtr pScrn);
@@ -60,12 +67,17 @@ VOID DisableLockRegs(VOID);
VOID DisableCRT2(VOID);
VOID DisableBridge(USHORT BaseAddr);
VOID GetCRT2Data(ULONG ROMAddr,USHORT ModeNo);
+VOID GetCRT2DataLVDS(ULONG ROMAddr,USHORT ModeNo);
+VOID GetCRT2Data301(ULONG ROMAddr,USHORT ModeNo);
VOID GetResInfo(ULONG ROMAddr,USHORT ModeNo);
VOID GetRAMDAC2DATA(ULONG ROMAddr,USHORT ModeNo);
VOID GetCRT2Ptr(ULONG ROMAddr,USHORT ModeNo);
VOID UnLockCRT2(USHORT BaseAddr);
VOID SetCRT2ModeRegs(USHORT BaseAddr,USHORT ModeNo);
VOID SetGroup1(USHORT BaseAddr,ULONG ROMAddr,USHORT ModeNo,ScrnInfoPtr pScrn);
+VOID SetGroup1_LVDS(USHORT BaseAddr,ULONG ROMAddr,USHORT ModeNo,ScrnInfoPtr pScrn);
+VOID SetGroup1301(USHORT BaseAddr,ULONG ROMAddr,USHORT ModeNo,ScrnInfoPtr pScrn);
+VOID GetLVDSDesData(ULONG ROMAddr,USHORT ModeNo);
VOID SetCRT2Offset(USHORT Part1Port,ULONG ROMAddr);
USHORT GetOffset(ULONG ROMAddr);
USHORT GetColorDepth(ULONG ROMAddr);
@@ -96,7 +108,7 @@ VOID EnableBridge(USHORT BaseAddr);
VOID GetVBInfo(USHORT BaseAddr,ULONG ROMAddr);
BOOLEAN BridgeIsEnable(USHORT BaseAddr);
BOOLEAN BridgeInSlave(VOID);
-BOOLEAN GetLCDResInfo(USHORT P3d4);
+BOOLEAN GetLCDResInfo(ULONG ROMAddr,USHORT P3d4);
VOID PresetScratchregister(USHORT P3d4);
BOOLEAN GetLCDDDCInfo(ScrnInfoPtr pScrn);
VOID SetTVSystem();
@@ -105,6 +117,15 @@ USHORT GetQueueConfig();
VOID VBLongWait();
USHORT GetVCLKLen(ULONG ROMAddr);
BOOLEAN WaitVBRetrace(USHORT BaseAddr);
+VOID ModCRT1CRTC(ULONG ROMAddr,USHORT ModeNo);
+VOID SetCRT2ECLK(ULONG ROMAddr, USHORT ModeNo);
+USHORT GetLVDSDesPtr(ULONG ROMAddr,USHORT ModeNo);
+BOOLEAN GetLVDSCRT1Ptr(ULONG ROMAddr,USHORT ModeNo);
+VOID SetGroup1_301(USHORT BaseAddr,ULONG ROMAddr,USHORT ModeNo,ScrnInfoPtr pScrn);
+VOID SetGroup1_LVDS(USHORT BaseAddr,ULONG ROMAddr,USHORT ModeNo,ScrnInfoPtr pScrn);
+VOID SetTPData();
+BOOLEAN GetPanelID();
+BOOLEAN GetLVDSCRT1Ptr(ULONG ROMAddr,USHORT ModeNo);
extern USHORT MDA_DAC[];
extern USHORT CGA_DAC[];
@@ -116,6 +137,8 @@ extern USHORT flag_clearbuffer; /* 0:no clear frame buffer 1:clear frame buffe
extern int RAMType;
extern int ModeIDOffset,StandTable,CRT1Table,ScreenOffset,VCLKData,MCLKData, ECLKData;
extern int REFIndex,ModeType;
+extern USHORT VBInfo,LCDResInfo,LCDTypeInfo,LCDInfo;
+extern USHORT IF_DEF_LVDS;
extern VOID SetReg1(USHORT, USHORT, USHORT);
extern VOID SetReg3(USHORT, USHORT);
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/sis/initdef.h b/xc/programs/Xserver/hw/xfree86/drivers/sis/initdef.h
index 0201d697a..5fdb37121 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/sis/initdef.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/sis/initdef.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/initdef.h,v 1.2 2000/08/03 12:24:03 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/initdef.h,v 1.3 2000/09/22 11:35:46 alanh Exp $ */
#define ModeInfoFlag 0x07
#define MemoryInfoFlag 0x1E0
@@ -51,13 +51,15 @@
#define VCLKStartFreq 25
#define SoftDramType 0x80
+#define VCLK40 0x04
#define VCLK65 0x09
#define VCLK108_2 0x14
#define TVSimuMode 0x02
#define SetCRT2ToSVIDEO 0x08
#define LCDRGB18Bit 0x01
-#define Panel1280x1024 0x01
-#define Panel1024x768 0x00
+#define Panel1280x1024 0x03
+#define Panel1024x768 0x02
+#define Panel800x600 0x01
#define RPLLDIV2XO 0x04
#define LoadDACFlag 0x1000
#define AfterLockCRT2 0x4000
@@ -87,3 +89,47 @@
#define IND_SIS_CRT2_PORT_10 0x10 - 0x30
#define IND_SIS_CRT2_PORT_12 0x12 - 0x30
#define IND_SIS_CRT2_PORT_14 0x14 - 0x30
+
+#define IF_DEF_TRUMPION 0
+#define LCDNonExpanding 0x10
+#define LVDSCRT1Len 15
+#define ADR_CRT2PtrData 0x20E
+#define offset_Zurac 0x210
+#define ADR_LVDSDesPtrData 0x212
+#define ADR_LVDSCRT1DataPtr 0x214
+
+#define ExtChip301 0x02
+#define ExtChipLVDS 0x04
+#define ExtChipTrumpion 0x06
+#define LCDNonExpanding 0x10
+#define LCDNonExpandingShift 4
+#define LVDSDataLen 6
+#define EnableLVDSDDA 0x10
+#define LCDSync 0x20
+#define SyncPP 0x0000
+#define LCDSyncBit 0xE0
+#define LVDSDesDataLen 3
+#define LVDSCRT1Len 15
+#define ActiveNonExpanding 0x40
+#define ActiveNonExpandingShift 6
+#define ModeSwitchStatus 0x0F
+#define SoftTVType 0x40
+
+#define PanelType00 0x00
+#define PanelType01 0x08
+#define PanelType02 0x10
+#define PanelType03 0x18
+#define PanelType04 0x20
+#define PanelType05 0x28
+#define PanelType06 0x30
+#define PanelType07 0x38
+#define PanelType08 0x40
+#define PanelType09 0x48
+#define PanelType0A 0x50
+#define PanelType0B 0x58
+#define PanelType0C 0x60
+#define PanelType0D 0x68
+#define PanelType0E 0x70
+#define PanelType0F 0x78
+
+
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.c b/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.c
index 3e52def07..446b4d29e 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.c,v 1.2 2000/08/04 03:51:46 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.c,v 1.3 2000/09/22 11:35:46 alanh Exp $ */
/* modified from tdfx_dri.c, mga_dri.c */
@@ -189,6 +189,7 @@ Bool SISDRIScreenInit(ScreenPtr pScreen)
{
unsigned int port_3c5_value;
+#if 0
/* Set magic number */
outb (0x3c4, 0x05);
if (inb (0x3c5) == 0x21){
@@ -205,6 +206,7 @@ Bool SISDRIScreenInit(ScreenPtr pScreen)
/* Enable HW to retry MMIO command */
outb (0x3c4, 0x22);
outb (0x3c5, 0xb2);
+#endif
}
/* Check that the GLX, DRI, and DRM modules have been loaded by testing
@@ -318,7 +320,6 @@ Bool SISDRIScreenInit(ScreenPtr pScreen)
pSIS->agpCmdBufSize = 0;
pSISDRI->AGPCmdBufSize = 0;
- /* TODO: if enable fails, not call drmAgpRelease */
if (drmAgpAcquire(pSIS->drmSubFD) < 0) {
xf86DrvMsg(pScreen->myNum, X_ERROR, "[drm] drmAgpAcquire failed\n");
break;
@@ -331,17 +332,19 @@ Bool SISDRIScreenInit(ScreenPtr pScreen)
}
ErrorF("[drm] drmAgpEnabled succeeded\n");
- drmAgpAlloc(pSIS->drmSubFD, AGP_SIZE, 0, 0, &pSIS->agpHandle);
-
- if (pSIS->agpHandle == 0) {
+ if (drmAgpAlloc(pSIS->drmSubFD, AGP_SIZE, 0, NULL, &pSIS->agpHandle) < 0) {
xf86DrvMsg(pScreen->myNum, X_ERROR,
"[drm] drmAgpAlloc failed\n");
+ drmAgpRelease(pSIS->drmSubFD);
break;
}
if (drmAgpBind(pSIS->drmSubFD, pSIS->agpHandle, 0) < 0) {
- DRICloseScreen(pScreen); xf86DrvMsg(pScreen->myNum, X_ERROR,
+ xf86DrvMsg(pScreen->myNum, X_ERROR,
"[drm] drmAgpBind failed\n");
+ drmAgpFree(pSIS->drmSubFD, pSIS->agpHandle);
+ drmAgpRelease(pSIS->drmSubFD);
+
break;
}
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/Imakefile b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/Imakefile
index 29db072d0..7ec7f391b 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/Imakefile
+++ b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/Imakefile
@@ -1,4 +1,4 @@
-XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/Imakefile,v 1.16 2000/06/30 17:15:17 dawes Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/Imakefile,v 1.17 2000/09/20 00:09:29 keithp Exp $
XCOMM
XCOMM This is the Imakefile for the TDFX driver.
XCOMM
@@ -33,7 +33,7 @@ INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) \
-I$(XF86SRC)/vgahw -I$(XF86SRC)/ddc -I$(XF86SRC)/i2c \
-I$(XF86SRC)/ddc -I$(XF86OSSRC)/vbe -I$(SERVERSRC)/Xext \
-I$(FONTINCSRC) -I$(SERVERSRC)/include -I$(XINCLUDESRC) \
- -I$(EXTINCSRC) \
+ -I$(EXTINCSRC) -I$(SERVERSRC)/render \
$(DRIINCLUDES)
#endif
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_accel.c b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_accel.c
index 6429ccc1c..87960acf3 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_accel.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_accel.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_accel.c,v 1.12 2000/06/17 17:44:25 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_accel.c,v 1.14 2000/08/25 16:25:36 tsi Exp $ */
/* All drivers should typically include these */
#include "xf86.h"
@@ -73,8 +73,6 @@ static void TDFXSubsequentCPUToScreenColorExpandFill(ScrnInfoPtr pScrn,
int skipleft);
static void TDFXSubsequentColorExpandScanline(ScrnInfoPtr pScrn, int bufno);
-void TDFXSelectBuffer(TDFXPtr pTDFX, int which);
-
void
TDFXNeedSync(ScrnInfoPtr pScrn) {
TDFXPtr pTDFX = TDFXPTR(pScrn);
@@ -241,7 +239,7 @@ TDFXAccelInit(ScreenPtr pScreen)
TDFXSetupForCPUToScreenColorExpandFill;
infoPtr->SubsequentCPUToScreenColorExpandFill =
TDFXSubsequentCPUToScreenColorExpandFill;
- infoPtr->ColorExpandBase = pTDFX->MMIOBase+SST_2D_LAUNCH;
+ infoPtr->ColorExpandBase = pTDFX->MMIOBase[0]+SST_2D_LAUNCH;
infoPtr->ColorExpandRange = 128;
infoPtr->CPUToScreenColorExpandFillFlags = commonFlags |
CPU_TRANSFER_PAD_DWORD | SCANLINE_PAD_DWORD |
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_driver.c
index 3f0aee798..201216076 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_driver.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_driver.c
@@ -25,7 +25,7 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
**************************************************************************/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_driver.c,v 1.39 2000/06/23 23:43:45 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_driver.c,v 1.42 2000/09/20 00:09:30 keithp Exp $ */
/*
* Authors:
@@ -97,6 +97,10 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "dri.h"
#endif
+#ifdef RENDER
+#include "picturestr.h"
+#endif
+
/* Required Functions: */
static OptionInfoPtr TDFXAvailableOptions(int chipid, int busid);
@@ -205,6 +209,9 @@ static const char *vgahwSymbols[] = {
static const char *fbSymbols[] = {
"fbScreenInit",
+#ifdef RENDER
+ "fbPictureInit",
+#endif
NULL
};
@@ -804,7 +811,7 @@ TDFXPreInit(ScrnInfoPtr pScrn, int flags)
}
}
xf86DrvMsg(pScrn->scrnIndex, from, "MMIO registers at addr 0x%lX\n",
- (unsigned long)pTDFX->MMIOAddr);
+ (unsigned long)pTDFX->MMIOAddr[0]);
if (match->ioBase[2]) {
pTDFX->PIOBase[0] = match->ioBase[2]&0xFFFFFFFC;
@@ -927,6 +934,9 @@ TDFXPreInit(ScrnInfoPtr pScrn, int flags)
return FALSE;
}
xf86LoaderReqSymbols("fbScreenInit", NULL);
+#ifdef RENDER
+ xf86LoaderReqSymbols("fbPictureInit", NULL);
+#endif
if (!xf86ReturnOptValBool(TDFXOptions, OPTION_NOACCEL, FALSE)) {
if (!xf86LoadSubModule(pScrn, "xaa")) {
@@ -1752,6 +1762,8 @@ TDFXScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) {
pScrn->rgbBits, pScrn->defaultVisual))
return FALSE;
+ miSetPixmapDepths ();
+
#ifdef XF86DRI
/*
* Setup DRI after visuals have been established, but before fbScreenInit
@@ -1774,6 +1786,9 @@ TDFXScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) {
pScrn->xDpi, pScrn->yDpi,
pScrn->displayWidth, pScrn->bitsPerPixel))
return FALSE;
+#ifdef RENDER
+ fbPictureInit (pScreen, 0, 0);
+#endif
break;
default:
xf86DrvMsg(scrnIndex, X_ERROR,
@@ -1977,10 +1992,13 @@ TDFXCloseScreen(int scrnIndex, ScreenPtr pScreen)
TDFXShutdownPrivate(pScreen);
#endif
- TDFXRestore(pScrn);
- vgaHWLock(hwp);
- TDFXUnmapMem(pScrn);
- vgaHWUnmapMem(pScrn);
+ if (pScrn->vtSema) {
+ TDFXRestore(pScrn);
+ vgaHWLock(hwp);
+ TDFXUnmapMem(pScrn);
+ vgaHWUnmapMem(pScrn);
+ }
+
if (pTDFX->AccelInfoRec) XAADestroyInfoRec(pTDFX->AccelInfoRec);
pTDFX->AccelInfoRec=0;
if (pTDFX->DGAModes) xfree(pTDFX->DGAModes);
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_io.c b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_io.c
index f15f321bf..0bb5a1b3b 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_io.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_io.c
@@ -24,7 +24,7 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
**************************************************************************/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_io.c,v 1.5 2000/06/17 00:03:25 martin Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_io.c,v 1.6 2000/08/25 16:25:36 tsi Exp $ */
/*
* Authors:
@@ -71,8 +71,8 @@ static int TDFXReadLongPIO(TDFXPtr pTDFX, int addr) {
}
void TDFXSetPIOAccess(TDFXPtr pTDFX) {
- if (!pTDFX->PIOBase)
- ErrorF("Can not set PIO Access before PIOBase\n");
+ if (!pTDFX->PIOBase[0])
+ ErrorF("Can not set PIO Access before PIOBase[0]\n");
pTDFX->writeControl=TDFXWriteControlPIO;
pTDFX->readControl=TDFXReadControlPIO;
pTDFX->writeLong=TDFXWriteLongPIO;
@@ -108,8 +108,8 @@ int TDFXReadLongMMIO(TDFXPtr pTDFX, int addr) {
}
void TDFXSetMMIOAccess(TDFXPtr pTDFX) {
- if (!pTDFX->MMIOBase)
- ErrorF("Can not set MMIO access before MMIOBase\n");
+ if (!pTDFX->MMIOBase[0])
+ ErrorF("Can not set MMIO access before MMIOBase[0]\n");
pTDFX->writeControl=TDFXWriteControlMMIO;
pTDFX->readControl=TDFXReadControlMMIO;
pTDFX->writeLong=TDFXWriteLongMMIO;
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_sli.c b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_sli.c
index fd442c49d..07d4a711e 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_sli.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_sli.c
@@ -1,3 +1,4 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_sli.c,v 1.4 2000/08/25 16:25:36 tsi Exp $ */
#include "xf86.h"
#include "xf86_ansic.h"
diff --git a/xc/programs/Xserver/hw/xfree86/loader/xf86sym.c b/xc/programs/Xserver/hw/xfree86/loader/xf86sym.c
index 0b8ed7881..37ccbee14 100644
--- a/xc/programs/Xserver/hw/xfree86/loader/xf86sym.c
+++ b/xc/programs/Xserver/hw/xfree86/loader/xf86sym.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/xf86sym.c,v 1.159 2000/08/08 08:58:08 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/xf86sym.c,v 1.163 2000/09/19 12:46:21 eich Exp $ */
/*
*
@@ -109,6 +109,12 @@ extern void* __remq(long, long);
extern void* __remqu(long, long);
#endif
+#if defined(__ia64__)
+extern long __divdi3(long, long);
+extern long __moddi3(long, long);
+extern long __divdf3(long, long);
+#endif
+
#if defined(__sparc__) && defined(__GNUC__)
#define SYMFUNCDOT(func) { "." #func, (funcptr)&__sparc_dot_ ## func },
#define SYMFUNCDOT89(func) { "." #func, (funcptr)&func ## _sparcv89 },
@@ -250,6 +256,14 @@ LOOKUP xfree86LookupTab[] = {
SYMFUNC(xf86SerialModemClearBits)
SYMFUNC(xf86LoadKernelModule)
SYMFUNC(xf86OSMouseInit)
+ SYMFUNC(xf86AgpGARTSupported)
+ SYMFUNC(xf86GetAGPInfo)
+ SYMFUNC(xf86AcquireGART)
+ SYMFUNC(xf86ReleaseGART)
+ SYMFUNC(xf86AllocateGARTMemory)
+ SYMFUNC(xf86BindGARTMemory)
+ SYMFUNC(xf86UnbindGARTMemory)
+ SYMFUNC(xf86EnableAGP)
#ifdef XINPUT
/* XISB routines (Merged from Metrolink tree) */
@@ -430,9 +444,6 @@ LOOKUP xfree86LookupTab[] = {
SYMFUNC(xf86LoaderCheckSymbol)
SYMFUNC(xf86LoaderReqSymLists)
SYMFUNC(xf86LoaderReqSymbols)
- SYMFUNC(xf86Break1)
- SYMFUNC(xf86Break2)
- SYMFUNC(xf86Break3)
SYMFUNC(xf86SetBackingStore)
SYMFUNC(xf86SetSilkenMouse)
/* SYMFUNC(xf86NewSerialNumber) */
@@ -537,6 +548,11 @@ LOOKUP xfree86LookupTab[] = {
SYMFUNC(xf86QueryLargestOffscreenArea)
SYMFUNC(xf86PurgeUnlockedOffscreenAreas)
SYMFUNC(xf86RegisterOffscreenManager)
+ SYMFUNC(xf86AllocateOffscreenLinear)
+ SYMFUNC(xf86ResizeOffscreenLinear)
+ SYMFUNC(xf86QueryLargestOffscreenLinear)
+ SYMFUNC(xf86FreeOffscreenLinear)
+
/* xf86cmap.c */
SYMFUNC(xf86HandleColormaps)
@@ -616,7 +632,15 @@ LOOKUP xfree86LookupTab[] = {
#ifdef DPMSExtension
SYMFUNC(DPMSSet)
#endif
-
+/* xf86Debug.c */
+#ifdef BUILDDEBUG
+ SYMFUNC(xf86Break1)
+ SYMFUNC(xf86Break2)
+ SYMFUNC(xf86Break3)
+ SYMFUNC(xf86SPTimestamp)
+ SYMFUNC(xf86STimestamp)
+#endif
+
#if 0 /* we want to move the hw stuff in a module */
SYMFUNC(xf86dactopel)
SYMFUNC(xf86dactocomm)
@@ -764,16 +788,16 @@ LOOKUP xfree86LookupTab[] = {
SYMFUNC(xf86memchr)
SYMFUNC(xf86memcmp)
SYMFUNC(xf86memcpy)
-#if (defined(__powerpc__) && (defined(Lynx) || defined(linux))) || defined(__sparc__)
+#if (defined(__powerpc__) && (defined(Lynx) || defined(linux))) || defined(__sparc__) || defined(__ia64__)
/*
- * Some PPC and SPARC compilers generate calls to memcpy to handle
+ * Some PPC, SPARC, and IA64 compilers generate calls to memcpy to handle
* structure copies. This causes a problem both here and in shared
* libraries as there is no way to map the name of the call to the
* correct function.
*/
SYMFUNC(memcpy)
/*
- * Some PPC and SPARC compilers generate calls to memset to handle
+ * Some PPC, SPARC, and IA64 compilers generate calls to memset to handle
* aggregate initializations.
*/
SYMFUNC(memset)
@@ -859,6 +883,8 @@ LOOKUP xfree86LookupTab[] = {
SYMFUNC(xf86shmat)
SYMFUNC(xf86shmdt)
SYMFUNC(xf86shmctl)
+ SYMFUNC(xf86setjmp)
+ SYMFUNC(xf86longjmp)
#ifdef XF86DRI
/* These may have more general uses, but
for now, they are only used by the DRI.
@@ -975,6 +1001,11 @@ LOOKUP xfree86LookupTab[] = {
SYMFUNC(debug_outl)
#endif
#endif
+#if defined(__ia64__)
+ SYMFUNC(__divdi3)
+ SYMFUNC(__moddi3)
+ SYMFUNC(__divdf3)
+#endif
#ifdef __FreeBSD__
SYMFUNC(sysctlbyname)
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/amoeba/Imakefile b/xc/programs/Xserver/hw/xfree86/os-support/amoeba/Imakefile
deleted file mode 100644
index 86518badb..000000000
--- a/xc/programs/Xserver/hw/xfree86/os-support/amoeba/Imakefile
+++ /dev/null
@@ -1,35 +0,0 @@
-XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/os-support/amoeba/Imakefile,v 3.4 2000/06/27 14:27:29 tsi Exp $
-
-
-
-
-XCOMM $XConsortium: Imakefile /main/4 1996/09/28 17:23:26 rws $
-
-#include <Server.tmpl>
-
-#if AckToolset
-IOSRC = inout.S
-IOOBJ = inout.o
-#endif
-
-SRCS = am_init.c am_video.c am_io.c ioperm_noop.c \
- VTsw_noop.c $(IOSRC) kmod_noop.c
-OBJS = am_init.o am_video.o am_io.o ioperm_noop.o \
- VTsw_noop.o $(IOOBJ) kmod_noop.o
-
-INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) -I. -I$(SERVERSRC)/include \
- -I$(XINCLUDESRC)
-
-SubdirLibraryRule($(OBJS))
-NormalLibraryObjectRule()
-NormalAsmObjectRule()
-
-ObjectFromSpecialSource(ioperm_noop,../shared/ioperm_noop,/**/)
-ObjectFromSpecialSource(VTsw_noop,../shared/VTsw_noop,/**/)
-ObjectFromSpecialSource(kmod_noop,../shared/kmod_noop,/**/)
-#if AckToolset
-ObjectFromSpecialAsmSource(inout,../shared/inout,/**/)
-#endif
-
-DependTarget()
-
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/amoeba/am_init.c b/xc/programs/Xserver/hw/xfree86/os-support/amoeba/am_init.c
deleted file mode 100644
index 57cdb87da..000000000
--- a/xc/programs/Xserver/hw/xfree86/os-support/amoeba/am_init.c
+++ /dev/null
@@ -1,105 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/amoeba/am_init.c,v 3.6 1998/07/25 16:56:31 dawes Exp $ */
-/*
- * Copyright 1993 by Vrije Universiteit, The Netherlands
- * Copyright 1993 by David Wexelblat <dwex@goblin.org>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the names of the Vrije Universiteit and David
- * Wexelblat not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior permission.
- * The Vrije Universiteit and David Wexelblat make no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * THE VRIJE UNIVERSITEIT AND DAVID WEXELBLAT DISCLAIM ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE VRIJE UNIVERSITEIT OR
- * DAVID WEXELBLAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/* $XConsortium: am_init.c /main/5 1996/02/21 17:50:35 kaleb $ */
-
-#include "X.h"
-#include "Xmd.h"
-#include "input.h"
-#include "scrnintstr.h"
-
-#include "compiler.h"
-
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-
-static capability vgaMemCap;
-
-void xf86OpenConsole()
-{
- char *findhole();
- segid seg;
- int nbytes;
- errstat err;
-
- if (serverGeneration == 1)
- {
- /*
- * Get segment capability for video memory, and map it in.
- * We do it this early since a side effect is that the I/O
- * space is also mapped in.
- */
- if ((err = iop_map_mem(&iopcap, &vgaMemCap)) != STD_OK)
- {
- FatalError("xf86OpenConsole: iop_map_mem failed (%s)\n",
- err_why(err));
- }
-
- /* Map in aligned screen memory */
- nbytes = 0x10000; /* 64 Kb */
- xf86Info.screenPtr =
- (pointer)(((unsigned) findhole(2 * nbytes) & ~0xFFF) + 0x1000);
- if ((seg = seg_map(&vgaMemCap,xf86Info.screenPtr, nbytes,
- MAP_TYPEDATA|MAP_READWRITE|MAP_INPLACE)) < 0)
- {
- FatalError("xf86OpenConsole: Map segment failed: %s\n",
- err_why(ERR_CONVERT(seg)));
- }
- }
- return;
-}
-
-void xf86CloseConsole()
-{
- static am_port_t nullport;
- errstat err;
-
- if (!NULLPORT(&vgaMemCap.cap_port)) {
- /* Unmap video's memory segment */
- if ((err = iop_unmap_mem(&iopcap, &vgaMemCap)) != STD_OK)
- {
- xf86FatalError("xf86CloseConsole: iop_map_mem failed (%s)\n",
- err_why(err));
- }
- vgaMemCap.cap_port = nullport;
- }
- return;
-}
-
-/* ARGSUSED */
-int xf86ProcessArgument (argc, argv, i)
-int argc;
-char *argv[];
-int i;
-{
- return(0);
-}
-
-void xf86UseMsg()
-{
- return;
-}
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/amoeba/am_io.c b/xc/programs/Xserver/hw/xfree86/os-support/amoeba/am_io.c
deleted file mode 100644
index 9a2ade17b..000000000
--- a/xc/programs/Xserver/hw/xfree86/os-support/amoeba/am_io.c
+++ /dev/null
@@ -1,192 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/amoeba/am_io.c,v 3.11 1999/05/07 02:56:18 dawes Exp $ */
-/*
- * Copyright 1993 by Vrije Universiteit, The Netherlands
- * Copyright 1993 by David Dawes <dawes@xfree86.org>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the names of the Vrije Universiteit and David
- * Dawes not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior permission.
- * The Vrije Universiteit and David Dawes make no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * THE VRIJE UNIVERSITEIT AND DAVID DAWES DISCLAIM ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE VRIJE UNIVERSITEIT OR
- * DAVID DAWES BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/* $XConsortium: am_io.c /main/9 1996/10/19 18:05:55 kaleb $ */
-
-#define NEED_EVENTS
-#include "X.h"
-#include "Xproto.h"
-#include "inputstr.h"
-#include "scrnintstr.h"
-
-#include "compiler.h"
-
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-#include "xf86Config.h"
-
-Bool xf86SupportedMouseTypes[] =
-{
- TRUE, /* Microsoft */
- TRUE, /* MouseSystems */
- TRUE, /* MMSeries */
- TRUE, /* Logitech */
- TRUE, /* BusMouse */
- TRUE, /* MouseMan */
- TRUE, /* PS/2 */
- FALSE, /* Hitachi Tablet */
-};
-
-int xf86NumMouseTypes = sizeof(xf86SupportedMouseTypes) /
- sizeof(xf86SupportedMouseTypes[0]);
-
-void xf86SoundKbdBell(loudness, pitch, duration)
-int loudness;
-int pitch;
-int duration;
-{
- if (loudness)
- {
- errstat err;
-
- if ((err = iop_ringbell(&iopcap, loudness, pitch, duration))
- != STD_OK)
- {
- FatalError("iop_ringbell failed (%s)\n", err_why(err));
- }
- }
-}
-
-void xf86SetKbdLeds(leds)
-int leds;
-{
- errstat err;
-
- if ((err = iop_setleds(&iopcap, (int)leds)) != STD_OK)
- {
- FatalError("iop_set_leds failed (%s)\n", err_why(err));
- }
-}
-
-int xf86GetKbdLeds()
-{
- int cur_leds;
- errstat err;
-
- err = iop_getleds(&iopcap, &cur_leds);
- if (err != STD_OK)
- {
- FatalError("iop_get_leds failed (%s)\n", err_why(err));
- }
- return cur_leds;
-}
-
-#if NeedFunctionPrototypes
-void xf86SetKbdRepeat(char rad)
-#else
-void xf86SetKbdRepeat(rad)
-char rad;
-#endif
-{
- return;
-}
-
-void xf86KbdInit()
-{
- return;
-}
-
-int xf86KbdOn()
-{
- return(-1);
-}
-
-int xf86KbdOff()
-{
- return(-1);
-}
-
-/* Amoeba doesn't use this */
-void xf86KbdEvents()
-{
- return;
-}
-
-void xf86SetMouseSpeed(mouse, old, new, cflag)
-MouseDevPtr mouse;
-int old;
-int new;
-unsigned cflag;
-{
- return;
-}
-
-void xf86MouseInit(mouse)
-MouseDevPtr mouse;
-{
- return;
-}
-
-/* Xserver/iopsvr mouse type translation table: */
-static int mtypes[] = {
- IOP_MOUSE_MS, /* P_MS */
- IOP_MOUSE_MM, /* P_MSC */
- IOP_MOUSE_MMS, /* P_MM */
- IOP_MOUSE_LOGI, /* P_LOGI */
- IOP_MOUSE_LB, /* P_BM */
- IOP_MOUSE_LOGIMAN, /* P_LOGIMAN */
- IOP_MOUSE_PS2 /* P_PS2 */
-};
-
-int xf86MouseOn(mouse)
-MouseDevPtr mouse;
-{
- int msetype;
- errstat err;
-
- msetype = mouse->mseType;
- if (msetype >= 0 && msetype < (sizeof(mtypes) / sizeof(mtypes[0]))) {
- /* translate */
- msetype = mtypes[msetype];
- }
-
- if ((err = iop_mousecontrol(&iopcap, msetype, mouse->baudRate,
- mouse->sampleRate)) != STD_OK)
- {
- if (xf86Info.allowMouseOpenFail) {
- ErrorF("iop_mousecontrol failed (%s) - Continuing...\n",
- err_why(err));
- return(-2);
- }
- FatalError("iop_mousecontrol failed (%s)\n", err_why(err));
- }
- return(-1);
-}
-
-int xf86MouseOff(mouse, doclose)
-MouseDevPtr mouse;
-Bool doclose;
-{
- return -1;
-}
-
-/* Amoeba doesn't use this */
-void xf86MouseEvents(device)
-DeviceIntPtr device;
-{
- return;
-}
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/amoeba/am_video.c b/xc/programs/Xserver/hw/xfree86/os-support/amoeba/am_video.c
deleted file mode 100644
index 26254ad7f..000000000
--- a/xc/programs/Xserver/hw/xfree86/os-support/amoeba/am_video.c
+++ /dev/null
@@ -1,102 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/amoeba/am_video.c,v 3.1 1996/12/23 06:49:13 dawes Exp $ */
-/*
- * Copyright 1993 by Vrije Universiteit, The Netherlands
- * Copyright 1993 by David Wexelblat <dwex@XFree86.org>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the names of the Vrije Universiteit and David
- * Wexelblat not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior permission.
- * The Vrije Universiteit and David Wexelblat make no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * THE VRIJE UNIVERSITEIT AND DAVID WEXELBLAT DISCLAIM ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE VRIJE UNIVERSITEIT OR
- * DAVID WEXELBLAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/* $XConsortium: am_video.c /main/3 1996/02/21 17:50:46 kaleb $ */
-
-#include "X.h"
-#include "input.h"
-#include "scrnintstr.h"
-
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-
-/***************************************************************************/
-/* Video Memory Mapping section */
-/***************************************************************************/
-
-/* ARGSUSED */
-pointer xf86MapVidMem(ScreenNum, Region, Base, Size)
-int ScreenNum;
-int Region;
-pointer Base;
-unsigned long Size;
-{
- return((pointer)xf86Info.screenPtr);
-}
-
-/* ARGSUSED */
-void xf86UnMapVidMem(ScreenNum, Region, Base, Size)
-int ScreenNum;
-int Region;
-pointer Base;
-unsigned long Size;
-{
- return;
-}
-
-Bool xf86LinearVidMem()
-{
- return(FALSE);
-}
-
-/***************************************************************************/
-/* BIOS Reading section */
-/***************************************************************************/
-
-/*
- * Amoeba does not support reading the BIOS
- */
-
-/* ARGSUSED */
-int xf86ReadBIOS(Base, Offset, Buf, Len)
-unsigned long Base;
-unsigned long Offset;
-unsigned char *Buf;
-int Len;
-{
- return(-1);
-}
-
-/***************************************************************************/
-/* Interrupt Handling section */
-/***************************************************************************/
-
-Bool xf86DisableInterrupts()
-{
- extern void iop_intr_disable();
-
- iop_intr_disable(&iopcap);
- return(TRUE);
-}
-
-void xf86EnableInterrupts()
-{
- extern void iop_intr_enable();
-
- iop_intr_enable(&iopcap);
- return;
-}
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/bsd/Imakefile b/xc/programs/Xserver/hw/xfree86/os-support/bsd/Imakefile
index 424ff2cca..65642f566 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/bsd/Imakefile
+++ b/xc/programs/Xserver/hw/xfree86/os-support/bsd/Imakefile
@@ -4,7 +4,7 @@ XCOMM $XConsortium: Imakefile /main/12 1996/10/27 11:06:35 kaleb $
-XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/Imakefile,v 3.43 2000/06/23 19:51:01 dawes Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/Imakefile,v 3.45 2000/08/16 01:45:29 dawes Exp $
#include <Server.tmpl>
@@ -94,15 +94,23 @@ AXP_SRC=bsd_ev56.c
AXP_OBJ=bsd_ev56.o
#endif
+#if defined(FreeBSDArchitecture) && HasAgpGart
+AGP_SRC=lnx_agp.c
+AGP_OBJ=lnx_agp.o
+#else
+AGP_SRC=agp_noop.c
+AGP_OBJ=agp_noop.o
+#endif
+
SRCS = bsd_init.c bsd_video.c bsd_io.c bsd_VTsw.c \
libc_wrapper.c $(IOPERM_SRC) std_kbdEv.c posix_tty.c $(MOUSESRC) \
$(RES_SRC) stdPci.c vidmem.c $(JOYSTICK_SRC) sigio.c $(APMSRC) \
- $(AXP_SRC) $(KMODSRC)
+ $(AXP_SRC) $(KMODSRC) $(AGP_SRC)
OBJS = bsd_init.o bsd_video.o bsd_io.o bsd_VTsw.o \
libc_wrapper.o $(IOPERM_OBJ) std_kbdEv.o posix_tty.o $(MOUSEOBJ) \
$(RES_OBJ) stdPci.o vidmem.o $(JOYSTICK_OBJ) sigio.o $(APMOBJ) \
- $(AXP_OBJ) $(KMODOBJ)
+ $(AXP_OBJ) $(KMODOBJ) $(AGP_OBJ)
INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) -I. -I$(SERVERSRC)/include \
-I$(XINCLUDESRC) -I$(EXTINCSRC) -I$(SERVERSRC)/mi -I$(APINCLUDES) \
@@ -158,6 +166,11 @@ LinkSourceFile(stdPci.c,../shared)
LinkSourceFile(vidmem.c,../shared)
LinkSourceFile(sigio.c,../shared)
LinkSourceFile(kmod_noop.c,../shared)
+#if defined(FreeBSDArchitecture) && HasAgpGart
+LinkSourceFile(lnx_agp.c,../linux)
+#else
+LinkSourceFile(agp_noop.c,../shared)
+#endif
DependTarget()
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/Imakefile b/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/Imakefile
index 675425659..f0fa864fb 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/Imakefile
+++ b/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/Imakefile
@@ -1,4 +1,4 @@
-XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/Imakefile,v 1.1 2000/06/17 00:03:27 martin Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/Imakefile,v 1.2 2000/08/16 01:45:30 dawes Exp $
XCOMM $PI: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/Imakefile,v 1.7 1999/09/14 19:55:15 faith Exp $
#define IHaveModules
@@ -37,5 +37,14 @@ DependSubdirs($(SUBDIRS))
#endif
+#if DoLoadableServer
+LinkSourceFile(drmmodule.c,$(XF86OSSRC)/linux/drm)
+#endif
+LinkSourceFile(xf86drmHash.c,$(XF86OSSRC)/linux/drm)
+LinkSourceFile(xf86drmI810.c,$(XF86OSSRC)/linux/drm)
+LinkSourceFile(xf86drmMga.c,$(XF86OSSRC)/linux/drm)
+LinkSourceFile(xf86drmR128.c,$(XF86OSSRC)/linux/drm)
+LinkSourceFile(xf86drmRandom.c,$(XF86OSSRC)/linux/drm)
+LinkSourceFile(xf86drmSL.c,$(XF86OSSRC)/linux/drm)
InstallDriverSDKLibraryModule(drm,$(DRIVERSDKMODULEDIR),freebsd)
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/drmmodule.c b/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/drmmodule.c
deleted file mode 100644
index 5a420efc1..000000000
--- a/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/drmmodule.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/* drmmodule.c -- Module initialization
- * Created: Fri Jun 4 09:05:48 1999 by faith@precisioninsight.com
- * Revised: Fri Jun 4 09:09:22 1999 by faith@precisioninsight.com
- *
- * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * $PI: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/drmmodule.c,v 1.1 1999/06/07 13:01:42 faith Exp $
- * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/drmmodule.c,v 1.1 2000/06/17 00:03:27 martin Exp $
- *
- */
-
-#include "xf86Module.h"
-
-static MODULESETUPPROTO(drmSetup);
-
-static XF86ModuleVersionInfo VersRec =
-{
- "drm",
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XF86_VERSION_CURRENT,
- 1, 0, 0,
- ABI_CLASS_EXTENSION,
- ABI_EXTENSION_VERSION,
- MOD_CLASS_NONE,
- {0,0,0,0}
-};
-
-XF86ModuleData drmModuleData = { &VersRec, drmSetup, NULL };
-
-static pointer
-drmSetup(pointer module, pointer opts, int *errmaj, int *errmin)
-{
- return (void *)1;
-}
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/Imakefile b/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/Imakefile
index 7d33c205b..81445a7d3 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/Imakefile
+++ b/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/Imakefile
@@ -1,5 +1,4 @@
-XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/Imakefile,v 1.1 2000/06/17 00:03:28 martin Exp $
-XCOMM $PI$
+XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/Imakefile,v 1.2 2000/08/16 01:45:31 dawes Exp $
#include <Server.tmpl>
@@ -11,6 +10,17 @@ LinkSourceFile(xf86drm.h,$(XF86OSSRC))
LinkSourceFile(xf86_OSproc.h,$(XF86OSSRC))
LinkSourceFile(sigio.c,$(XF86OSSRC)/shared)
+XCOMM Try to use the Linux version of the DRM headers. This avoids skew
+XCOMM and missing headers. If there's a need to break them out, they
+XCOMM can be re-added later. If not, they can be moved to somewhere more
+XCOMM OS-independent and referenced from there.
+LinkSourceFile(drm.h,$(XF86OSSRC)/linux/drm/kernel)
+LinkSourceFile(i810_drm.h,$(XF86OSSRC)/linux/drm/kernel)
+LinkSourceFile(mga_drm.h,$(XF86OSSRC)/linux/drm/kernel)
+LinkSourceFile(r128_drm.h,$(XF86OSSRC)/linux/drm/kernel)
+LinkSourceFile(sis_drm_public.h,$(XF86OSSRC)/linux/drm/kernel)
+
+
XCOMM This is a kludge until we determine how best to build the
XCOMM kernel-specific device driver. This allows us to continue
XCOMM to maintain the single Makefile.bsd with kernel-specific
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/drm.h b/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/drm.h
deleted file mode 100644
index ddad1be7e..000000000
--- a/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/drm.h
+++ /dev/null
@@ -1,362 +0,0 @@
-/* drm.h -- Header for Direct Rendering Manager -*- c -*-
- * Created: Mon Jan 4 10:05:05 1999 by faith@precisioninsight.com
- *
- * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
- * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
- * All rights reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- * Rickard E. (Rik) Faith <faith@valinux.com>
- *
- * Acknowledgements:
- * Dec 1999, Richard Henderson <rth@twiddle.net>, move to generic cmpxchg.
- *
- */
-
-#ifndef _DRM_H_
-#define _DRM_H_
-
-#include <sys/ioccom.h> /* For _IO* macros */
-
-#define DRM_DEV_DRM "/dev/drm"
-#define DRM_DEV_MODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP)
-#define DRM_DEV_UID 0
-#define DRM_DEV_GID 0
-
-
-#define DRM_NAME "drm" /* Name in kernel, /dev */
-#define DRM_MIN_ORDER 5 /* At least 2^5 bytes = 32 bytes */
-#define DRM_MAX_ORDER 22 /* Up to 2^22 bytes = 4MB */
-#define DRM_RAM_PERCENT 10 /* How much system ram can we lock? */
-
-#define _DRM_LOCK_HELD 0x80000000 /* Hardware lock is held */
-#define _DRM_LOCK_CONT 0x40000000 /* Hardware lock is contended */
-#define _DRM_LOCK_IS_HELD(lock) ((lock) & _DRM_LOCK_HELD)
-#define _DRM_LOCK_IS_CONT(lock) ((lock) & _DRM_LOCK_CONT)
-#define _DRM_LOCKING_CONTEXT(lock) ((lock) & ~(_DRM_LOCK_HELD|_DRM_LOCK_CONT))
-
-typedef unsigned long drm_handle_t;
-typedef unsigned int drm_context_t;
-typedef unsigned int drm_drawable_t;
-typedef unsigned int drm_magic_t;
-
-/* Warning: If you change this structure, make sure you change
- * XF86DRIClipRectRec in the server as well */
-
-typedef struct drm_clip_rect {
- unsigned short x1;
- unsigned short y1;
- unsigned short x2;
- unsigned short y2;
-} drm_clip_rect_t;
-
-/* Seperate include files for the i810/mga/r128 specific structures */
-#include "mga_drm.h"
-#include "i810_drm.h"
-#include "r128_drm.h"
-
-typedef struct drm_version {
- int version_major; /* Major version */
- int version_minor; /* Minor version */
- int version_patchlevel;/* Patch level */
- size_t name_len; /* Length of name buffer */
- char *name; /* Name of driver */
- size_t date_len; /* Length of date buffer */
- char *date; /* User-space buffer to hold date */
- size_t desc_len; /* Length of desc buffer */
- char *desc; /* User-space buffer to hold desc */
-} drm_version_t;
-
-typedef struct drm_unique {
- size_t unique_len; /* Length of unique */
- char *unique; /* Unique name for driver instantiation */
-} drm_unique_t;
-
-typedef struct drm_list {
- int count; /* Length of user-space structures */
- drm_version_t *version;
-} drm_list_t;
-
-typedef struct drm_block {
- int unused;
-} drm_block_t;
-
-typedef struct drm_control {
- enum {
- DRM_ADD_COMMAND,
- DRM_RM_COMMAND,
- DRM_INST_HANDLER,
- DRM_UNINST_HANDLER
- } func;
- int irq;
-} drm_control_t;
-
-typedef enum drm_map_type {
- _DRM_FRAME_BUFFER = 0, /* WC (no caching), no core dump */
- _DRM_REGISTERS = 1, /* no caching, no core dump */
- _DRM_SHM = 2, /* shared, cached */
- _DRM_AGP = 3 /* AGP/GART */
-} drm_map_type_t;
-
-typedef enum drm_map_flags {
- _DRM_RESTRICTED = 0x01, /* Cannot be mapped to user-virtual */
- _DRM_READ_ONLY = 0x02,
- _DRM_LOCKED = 0x04, /* shared, cached, locked */
- _DRM_KERNEL = 0x08, /* kernel requires access */
- _DRM_WRITE_COMBINING = 0x10, /* use write-combining if available */
- _DRM_CONTAINS_LOCK = 0x20 /* SHM page that contains lock */
-} drm_map_flags_t;
-
-typedef struct drm_map {
- unsigned long offset; /* Requested physical address (0 for SAREA)*/
- unsigned long size; /* Requested physical size (bytes) */
- drm_map_type_t type; /* Type of memory to map */
- drm_map_flags_t flags; /* Flags */
- void *handle; /* User-space: "Handle" to pass to mmap */
- /* Kernel-space: kernel-virtual address */
- int mtrr; /* MTRR slot used */
- /* Private data */
-} drm_map_t;
-
-typedef enum drm_lock_flags {
- _DRM_LOCK_READY = 0x01, /* Wait until hardware is ready for DMA */
- _DRM_LOCK_QUIESCENT = 0x02, /* Wait until hardware quiescent */
- _DRM_LOCK_FLUSH = 0x04, /* Flush this context's DMA queue first */
- _DRM_LOCK_FLUSH_ALL = 0x08, /* Flush all DMA queues first */
- /* These *HALT* flags aren't supported yet
- -- they will be used to support the
- full-screen DGA-like mode. */
- _DRM_HALT_ALL_QUEUES = 0x10, /* Halt all current and future queues */
- _DRM_HALT_CUR_QUEUES = 0x20 /* Halt all current queues */
-} drm_lock_flags_t;
-
-typedef struct drm_lock {
- int context;
- drm_lock_flags_t flags;
-} drm_lock_t;
-
-typedef enum drm_dma_flags { /* These values *MUST* match xf86drm.h */
- /* Flags for DMA buffer dispatch */
- _DRM_DMA_BLOCK = 0x01, /* Block until buffer dispatched.
- Note, the buffer may not yet have
- been processed by the hardware --
- getting a hardware lock with the
- hardware quiescent will ensure
- that the buffer has been
- processed. */
- _DRM_DMA_WHILE_LOCKED = 0x02, /* Dispatch while lock held */
- _DRM_DMA_PRIORITY = 0x04, /* High priority dispatch */
-
- /* Flags for DMA buffer request */
- _DRM_DMA_WAIT = 0x10, /* Wait for free buffers */
- _DRM_DMA_SMALLER_OK = 0x20, /* Smaller-than-requested buffers ok */
- _DRM_DMA_LARGER_OK = 0x40 /* Larger-than-requested buffers ok */
-} drm_dma_flags_t;
-
-typedef struct drm_buf_desc {
- int count; /* Number of buffers of this size */
- int size; /* Size in bytes */
- int low_mark; /* Low water mark */
- int high_mark; /* High water mark */
- enum {
- _DRM_PAGE_ALIGN = 0x01, /* Align on page boundaries for DMA */
- _DRM_AGP_BUFFER = 0x02 /* Buffer is in agp space */
- } flags;
- unsigned long agp_start; /* Start address of where the agp buffers
- * are in the agp aperture */
-} drm_buf_desc_t;
-
-typedef struct drm_buf_info {
- int count; /* Entries in list */
- drm_buf_desc_t *list;
-} drm_buf_info_t;
-
-typedef struct drm_buf_free {
- int count;
- int *list;
-} drm_buf_free_t;
-
-typedef struct drm_buf_pub {
- int idx; /* Index into master buflist */
- int total; /* Buffer size */
- int used; /* Amount of buffer in use (for DMA) */
- void *address; /* Address of buffer */
-} drm_buf_pub_t;
-
-typedef struct drm_buf_map {
- int count; /* Length of buflist */
- void *virtual; /* Mmaped area in user-virtual */
- drm_buf_pub_t *list; /* Buffer information */
-} drm_buf_map_t;
-
-typedef struct drm_dma {
- /* Indices here refer to the offset into
- buflist in drm_buf_get_t. */
- int context; /* Context handle */
- int send_count; /* Number of buffers to send */
- int *send_indices; /* List of handles to buffers */
- int *send_sizes; /* Lengths of data to send */
- drm_dma_flags_t flags; /* Flags */
- int request_count; /* Number of buffers requested */
- int request_size; /* Desired size for buffers */
- int *request_indices; /* Buffer information */
- int *request_sizes;
- int granted_count; /* Number of buffers granted */
-} drm_dma_t;
-
-typedef enum {
- _DRM_CONTEXT_PRESERVED = 0x01,
- _DRM_CONTEXT_2DONLY = 0x02
-} drm_ctx_flags_t;
-
-typedef struct drm_ctx {
- drm_context_t handle;
- drm_ctx_flags_t flags;
-} drm_ctx_t;
-
-typedef struct drm_ctx_res {
- int count;
- drm_ctx_t *contexts;
-} drm_ctx_res_t;
-
-typedef struct drm_draw {
- drm_drawable_t handle;
-} drm_draw_t;
-
-typedef struct drm_auth {
- drm_magic_t magic;
-} drm_auth_t;
-
-typedef struct drm_irq_busid {
- int irq;
- int busnum;
- int devnum;
- int funcnum;
-} drm_irq_busid_t;
-
-typedef struct drm_agp_mode {
- unsigned long mode;
-} drm_agp_mode_t;
-
- /* For drm_agp_alloc -- allocated a buffer */
-typedef struct drm_agp_buffer {
- unsigned long size; /* In bytes -- will round to page boundary */
- unsigned long handle; /* Used for BIND/UNBIND ioctls */
- unsigned long type; /* Type of memory to allocate */
- unsigned long physical; /* Physical used by i810 */
-} drm_agp_buffer_t;
-
- /* For drm_agp_bind */
-typedef struct drm_agp_binding {
- unsigned long handle; /* From drm_agp_buffer */
- unsigned long offset; /* In bytes -- will round to page boundary */
-} drm_agp_binding_t;
-
-typedef struct drm_agp_info {
- int agp_version_major;
- int agp_version_minor;
- unsigned long mode;
- unsigned long aperture_base; /* physical address */
- unsigned long aperture_size; /* bytes */
- unsigned long memory_allowed; /* bytes */
- unsigned long memory_used;
-
- /* PCI information */
- unsigned short id_vendor;
- unsigned short id_device;
-} drm_agp_info_t;
-
-#define DRM_IOCTL_BASE 'd'
-#define DRM_IOCTL_NR(n) ((n) & 0xff)
-#define DRM_IO(nr) _IO(DRM_IOCTL_BASE,nr)
-#define DRM_IOR(nr,size) _IOR(DRM_IOCTL_BASE,nr,size)
-#define DRM_IOW(nr,size) _IOW(DRM_IOCTL_BASE,nr,size)
-#define DRM_IOWR(nr,size) _IOWR(DRM_IOCTL_BASE,nr,size)
-
-
-#define DRM_IOCTL_VERSION DRM_IOWR(0x00, drm_version_t)
-#define DRM_IOCTL_GET_UNIQUE DRM_IOWR(0x01, drm_unique_t)
-#define DRM_IOCTL_GET_MAGIC DRM_IOR( 0x02, drm_auth_t)
-#define DRM_IOCTL_IRQ_BUSID DRM_IOWR(0x03, drm_irq_busid_t)
-
-#define DRM_IOCTL_SET_UNIQUE DRM_IOW( 0x10, drm_unique_t)
-#define DRM_IOCTL_AUTH_MAGIC DRM_IOW( 0x11, drm_auth_t)
-#define DRM_IOCTL_BLOCK DRM_IOWR(0x12, drm_block_t)
-#define DRM_IOCTL_UNBLOCK DRM_IOWR(0x13, drm_block_t)
-#define DRM_IOCTL_CONTROL DRM_IOW( 0x14, drm_control_t)
-#define DRM_IOCTL_ADD_MAP DRM_IOWR(0x15, drm_map_t)
-#define DRM_IOCTL_ADD_BUFS DRM_IOWR(0x16, drm_buf_desc_t)
-#define DRM_IOCTL_MARK_BUFS DRM_IOW( 0x17, drm_buf_desc_t)
-#define DRM_IOCTL_INFO_BUFS DRM_IOWR(0x18, drm_buf_info_t)
-#define DRM_IOCTL_MAP_BUFS DRM_IOWR(0x19, drm_buf_map_t)
-#define DRM_IOCTL_FREE_BUFS DRM_IOW( 0x1a, drm_buf_free_t)
-
-#define DRM_IOCTL_ADD_CTX DRM_IOWR(0x20, drm_ctx_t)
-#define DRM_IOCTL_RM_CTX DRM_IOWR(0x21, drm_ctx_t)
-#define DRM_IOCTL_MOD_CTX DRM_IOW( 0x22, drm_ctx_t)
-#define DRM_IOCTL_GET_CTX DRM_IOWR(0x23, drm_ctx_t)
-#define DRM_IOCTL_SWITCH_CTX DRM_IOW( 0x24, drm_ctx_t)
-#define DRM_IOCTL_NEW_CTX DRM_IOW( 0x25, drm_ctx_t)
-#define DRM_IOCTL_RES_CTX DRM_IOWR(0x26, drm_ctx_res_t)
-#define DRM_IOCTL_ADD_DRAW DRM_IOWR(0x27, drm_draw_t)
-#define DRM_IOCTL_RM_DRAW DRM_IOWR(0x28, drm_draw_t)
-#define DRM_IOCTL_DMA DRM_IOWR(0x29, drm_dma_t)
-#define DRM_IOCTL_LOCK DRM_IOW( 0x2a, drm_lock_t)
-#define DRM_IOCTL_UNLOCK DRM_IOW( 0x2b, drm_lock_t)
-#define DRM_IOCTL_FINISH DRM_IOW( 0x2c, drm_lock_t)
-
-#define DRM_IOCTL_AGP_ACQUIRE DRM_IO( 0x30)
-#define DRM_IOCTL_AGP_RELEASE DRM_IO( 0x31)
-#define DRM_IOCTL_AGP_ENABLE DRM_IOW( 0x32, drm_agp_mode_t)
-#define DRM_IOCTL_AGP_INFO DRM_IOR( 0x33, drm_agp_info_t)
-#define DRM_IOCTL_AGP_ALLOC DRM_IOWR(0x34, drm_agp_buffer_t)
-#define DRM_IOCTL_AGP_FREE DRM_IOW( 0x35, drm_agp_buffer_t)
-#define DRM_IOCTL_AGP_BIND DRM_IOW( 0x36, drm_agp_binding_t)
-#define DRM_IOCTL_AGP_UNBIND DRM_IOW( 0x37, drm_agp_binding_t)
-
-/* Mga specific ioctls */
-#define DRM_IOCTL_MGA_INIT DRM_IOW( 0x40, drm_mga_init_t)
-#define DRM_IOCTL_MGA_SWAP DRM_IOW( 0x41, drm_mga_swap_t)
-#define DRM_IOCTL_MGA_CLEAR DRM_IOW( 0x42, drm_mga_clear_t)
-#define DRM_IOCTL_MGA_ILOAD DRM_IOW( 0x43, drm_mga_iload_t)
-#define DRM_IOCTL_MGA_VERTEX DRM_IOW( 0x44, drm_mga_vertex_t)
-#define DRM_IOCTL_MGA_FLUSH DRM_IOW( 0x45, drm_lock_t )
-#define DRM_IOCTL_MGA_INDICES DRM_IOW( 0x46, drm_mga_indices_t)
-
-/* I810 specific ioctls */
-#define DRM_IOCTL_I810_INIT DRM_IOW( 0x40, drm_i810_init_t)
-#define DRM_IOCTL_I810_VERTEX DRM_IOW( 0x41, drm_i810_vertex_t)
-#define DRM_IOCTL_I810_CLEAR DRM_IOW( 0x42, drm_i810_clear_t)
-#define DRM_IOCTL_I810_FLUSH DRM_IO ( 0x43)
-#define DRM_IOCTL_I810_GETAGE DRM_IO ( 0x44)
-#define DRM_IOCTL_I810_GETBUF DRM_IOWR(0x45, drm_i810_dma_t)
-#define DRM_IOCTL_I810_SWAP DRM_IO ( 0x46)
-
-/* Rage 128 specific ioctls */
-#define DRM_IOCTL_R128_INIT DRM_IOW( 0x40, drm_r128_init_t)
-#define DRM_IOCTL_R128_RESET DRM_IO( 0x41)
-#define DRM_IOCTL_R128_FLUSH DRM_IO( 0x42)
-#define DRM_IOCTL_R128_CCEIDL DRM_IO( 0x43)
-#define DRM_IOCTL_R128_PACKET DRM_IOW( 0x44, drm_r128_packet_t)
-#define DRM_IOCTL_R128_VERTEX DRM_IOW( 0x45, drm_r128_vertex_t)
-
-#endif
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/i810_drm.h b/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/i810_drm.h
deleted file mode 100644
index 4c8e09f6a..000000000
--- a/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/i810_drm.h
+++ /dev/null
@@ -1,188 +0,0 @@
-#ifndef _I810_DRM_H_
-#define _I810_DRM_H_
-
-/* WARNING: These defines must be the same as what the Xserver uses.
- * if you change them, you must change the defines in the Xserver.
- */
-
-#ifndef _I810_DEFINES_
-#define _I810_DEFINES_
-
-#define I810_DMA_BUF_ORDER 12
-#define I810_DMA_BUF_SZ (1<<I810_DMA_BUF_ORDER)
-#define I810_DMA_BUF_NR 256
-#define I810_NR_SAREA_CLIPRECTS 8
-
-/* Each region is a minimum of 64k, and there are at most 64 of them.
- */
-#define I810_NR_TEX_REGIONS 64
-#define I810_LOG_MIN_TEX_REGION_SIZE 16
-#endif
-
-#define I810_UPLOAD_TEX0IMAGE 0x1 /* handled clientside */
-#define I810_UPLOAD_TEX1IMAGE 0x2 /* handled clientside */
-#define I810_UPLOAD_CTX 0x4
-#define I810_UPLOAD_BUFFERS 0x8
-#define I810_UPLOAD_TEX0 0x10
-#define I810_UPLOAD_TEX1 0x20
-#define I810_UPLOAD_CLIPRECTS 0x40
-
-
-/* Indices into buf.Setup where various bits of state are mirrored per
- * context and per buffer. These can be fired at the card as a unit,
- * or in a piecewise fashion as required.
- */
-
-/* Destbuffer state
- * - backbuffer linear offset and pitch -- invarient in the current dri
- * - zbuffer linear offset and pitch -- also invarient
- * - drawing origin in back and depth buffers.
- *
- * Keep the depth/back buffer state here to acommodate private buffers
- * in the future.
- */
-#define I810_DESTREG_DI0 0 /* CMD_OP_DESTBUFFER_INFO (2 dwords) */
-#define I810_DESTREG_DI1 1
-#define I810_DESTREG_DV0 2 /* GFX_OP_DESTBUFFER_VARS (2 dwords) */
-#define I810_DESTREG_DV1 3
-#define I810_DESTREG_DR0 4 /* GFX_OP_DRAWRECT_INFO (4 dwords) */
-#define I810_DESTREG_DR1 5
-#define I810_DESTREG_DR2 6
-#define I810_DESTREG_DR3 7
-#define I810_DESTREG_DR4 8
-#define I810_DEST_SETUP_SIZE 10
-
-/* Context state
- */
-#define I810_CTXREG_CF0 0 /* GFX_OP_COLOR_FACTOR */
-#define I810_CTXREG_CF1 1
-#define I810_CTXREG_ST0 2 /* GFX_OP_STIPPLE */
-#define I810_CTXREG_ST1 3
-#define I810_CTXREG_VF 4 /* GFX_OP_VERTEX_FMT */
-#define I810_CTXREG_MT 5 /* GFX_OP_MAP_TEXELS */
-#define I810_CTXREG_MC0 6 /* GFX_OP_MAP_COLOR_STAGES - stage 0 */
-#define I810_CTXREG_MC1 7 /* GFX_OP_MAP_COLOR_STAGES - stage 1 */
-#define I810_CTXREG_MC2 8 /* GFX_OP_MAP_COLOR_STAGES - stage 2 */
-#define I810_CTXREG_MA0 9 /* GFX_OP_MAP_ALPHA_STAGES - stage 0 */
-#define I810_CTXREG_MA1 10 /* GFX_OP_MAP_ALPHA_STAGES - stage 1 */
-#define I810_CTXREG_MA2 11 /* GFX_OP_MAP_ALPHA_STAGES - stage 2 */
-#define I810_CTXREG_SDM 12 /* GFX_OP_SRC_DEST_MONO */
-#define I810_CTXREG_FOG 13 /* GFX_OP_FOG_COLOR */
-#define I810_CTXREG_B1 14 /* GFX_OP_BOOL_1 */
-#define I810_CTXREG_B2 15 /* GFX_OP_BOOL_2 */
-#define I810_CTXREG_LCS 16 /* GFX_OP_LINEWIDTH_CULL_SHADE_MODE */
-#define I810_CTXREG_PV 17 /* GFX_OP_PV_RULE -- Invarient! */
-#define I810_CTXREG_ZA 18 /* GFX_OP_ZBIAS_ALPHAFUNC */
-#define I810_CTXREG_AA 19 /* GFX_OP_ANTIALIAS */
-#define I810_CTX_SETUP_SIZE 20
-
-/* Texture state (per tex unit)
- */
-#define I810_TEXREG_MI0 0 /* GFX_OP_MAP_INFO (4 dwords) */
-#define I810_TEXREG_MI1 1
-#define I810_TEXREG_MI2 2
-#define I810_TEXREG_MI3 3
-#define I810_TEXREG_MF 4 /* GFX_OP_MAP_FILTER */
-#define I810_TEXREG_MLC 5 /* GFX_OP_MAP_LOD_CTL */
-#define I810_TEXREG_MLL 6 /* GFX_OP_MAP_LOD_LIMITS */
-#define I810_TEXREG_MCS 7 /* GFX_OP_MAP_COORD_SETS ??? */
-#define I810_TEX_SETUP_SIZE 8
-
-#define I810_FRONT 0x1
-#define I810_BACK 0x2
-#define I810_DEPTH 0x4
-
-
-typedef struct _drm_i810_init {
- enum {
- I810_INIT_DMA = 0x01,
- I810_CLEANUP_DMA = 0x02
- } func;
- int ring_map_idx;
- int buffer_map_idx;
- int sarea_priv_offset;
- unsigned int ring_start;
- unsigned int ring_end;
- unsigned int ring_size;
- unsigned int front_offset;
- unsigned int back_offset;
- unsigned int depth_offset;
- unsigned int w;
- unsigned int h;
- unsigned int pitch;
- unsigned int pitch_bits;
-} drm_i810_init_t;
-
-/* Warning: If you change the SAREA structure you must change the Xserver
- * structure as well */
-
-typedef struct _drm_i810_tex_region {
- unsigned char next, prev; /* indices to form a circular LRU */
- unsigned char in_use; /* owned by a client, or free? */
- int age; /* tracked by clients to update local LRU's */
-} drm_i810_tex_region_t;
-
-typedef struct _drm_i810_sarea {
- unsigned int ContextState[I810_CTX_SETUP_SIZE];
- unsigned int BufferState[I810_DEST_SETUP_SIZE];
- unsigned int TexState[2][I810_TEX_SETUP_SIZE];
- unsigned int dirty;
-
- unsigned int nbox;
- drm_clip_rect_t boxes[I810_NR_SAREA_CLIPRECTS];
-
- /* Maintain an LRU of contiguous regions of texture space. If
- * you think you own a region of texture memory, and it has an
- * age different to the one you set, then you are mistaken and
- * it has been stolen by another client. If global texAge
- * hasn't changed, there is no need to walk the list.
- *
- * These regions can be used as a proxy for the fine-grained
- * texture information of other clients - by maintaining them
- * in the same lru which is used to age their own textures,
- * clients have an approximate lru for the whole of global
- * texture space, and can make informed decisions as to which
- * areas to kick out. There is no need to choose whether to
- * kick out your own texture or someone else's - simply eject
- * them all in LRU order.
- */
-
- drm_i810_tex_region_t texList[I810_NR_TEX_REGIONS+1];
- /* Last elt is sentinal */
- int texAge; /* last time texture was uploaded */
- int last_enqueue; /* last time a buffer was enqueued */
- int last_dispatch; /* age of the most recently dispatched buffer */
- int last_quiescent; /* */
- int ctxOwner; /* last context to upload state */
-
- int vertex_prim;
-
-} drm_i810_sarea_t;
-
-typedef struct _drm_i810_clear {
- int clear_color;
- int clear_depth;
- int flags;
-} drm_i810_clear_t;
-
-
-
-/* These may be placeholders if we have more cliprects than
- * I810_NR_SAREA_CLIPRECTS. In that case, the client sets discard to
- * false, indicating that the buffer will be dispatched again with a
- * new set of cliprects.
- */
-typedef struct _drm_i810_vertex {
- int idx; /* buffer index */
- int used; /* nr bytes in use */
- int discard; /* client is finished with the buffer? */
-} drm_i810_vertex_t;
-
-typedef struct drm_i810_dma {
- void *virtual;
- int request_idx;
- int request_size;
- int granted;
-} drm_i810_dma_t;
-
-#endif /* _I810_DRM_H_ */
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/mga_drm.h b/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/mga_drm.h
deleted file mode 100644
index fe1b9b9c0..000000000
--- a/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/mga_drm.h
+++ /dev/null
@@ -1,274 +0,0 @@
-/* mga_drm.h -- Public header for the Matrox g200/g400 driver
- * Created: Tue Jan 25 01:50:01 1999 by jhartmann@precisioninsight.com
- *
- * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
- * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
- * All rights reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Authors: Jeff Hartmann <jhartmann@valinux.com>
- * Keith Whitwell <keithw@valinux.com>
- *
- */
-
-#ifndef _MGA_DRM_H_
-#define _MGA_DRM_H_
-
-/* WARNING: If you change any of these defines, make sure to change the
- * defines in the Xserver file (xf86drmMga.h)
- */
-#ifndef _MGA_DEFINES_
-#define _MGA_DEFINES_
-
-#define MGA_F 0x1 /* fog */
-#define MGA_A 0x2 /* alpha */
-#define MGA_S 0x4 /* specular */
-#define MGA_T2 0x8 /* multitexture */
-
-#define MGA_WARP_TGZ 0
-#define MGA_WARP_TGZF (MGA_F)
-#define MGA_WARP_TGZA (MGA_A)
-#define MGA_WARP_TGZAF (MGA_F|MGA_A)
-#define MGA_WARP_TGZS (MGA_S)
-#define MGA_WARP_TGZSF (MGA_S|MGA_F)
-#define MGA_WARP_TGZSA (MGA_S|MGA_A)
-#define MGA_WARP_TGZSAF (MGA_S|MGA_F|MGA_A)
-#define MGA_WARP_T2GZ (MGA_T2)
-#define MGA_WARP_T2GZF (MGA_T2|MGA_F)
-#define MGA_WARP_T2GZA (MGA_T2|MGA_A)
-#define MGA_WARP_T2GZAF (MGA_T2|MGA_A|MGA_F)
-#define MGA_WARP_T2GZS (MGA_T2|MGA_S)
-#define MGA_WARP_T2GZSF (MGA_T2|MGA_S|MGA_F)
-#define MGA_WARP_T2GZSA (MGA_T2|MGA_S|MGA_A)
-#define MGA_WARP_T2GZSAF (MGA_T2|MGA_S|MGA_F|MGA_A)
-
-#define MGA_MAX_G400_PIPES 16
-#define MGA_MAX_G200_PIPES 8 /* no multitex */
-#define MGA_MAX_WARP_PIPES MGA_MAX_G400_PIPES
-
-#define MGA_CARD_TYPE_G200 1
-#define MGA_CARD_TYPE_G400 2
-
-#define MGA_FRONT 0x1
-#define MGA_BACK 0x2
-#define MGA_DEPTH 0x4
-
-/* 3d state excluding texture units:
- */
-#define MGA_CTXREG_DSTORG 0 /* validated */
-#define MGA_CTXREG_MACCESS 1
-#define MGA_CTXREG_PLNWT 2
-#define MGA_CTXREG_DWGCTL 3
-#define MGA_CTXREG_ALPHACTRL 4
-#define MGA_CTXREG_FOGCOLOR 5
-#define MGA_CTXREG_WFLAG 6
-#define MGA_CTXREG_TDUAL0 7
-#define MGA_CTXREG_TDUAL1 8
-#define MGA_CTXREG_FCOL 9
-#define MGA_CTXREG_STENCIL 10
-#define MGA_CTXREG_STENCILCTL 11
-#define MGA_CTX_SETUP_SIZE 12
-
-/* 2d state
- */
-#define MGA_2DREG_PITCH 0
-#define MGA_2D_SETUP_SIZE 1
-
-/* Each texture unit has a state:
- */
-#define MGA_TEXREG_CTL 0
-#define MGA_TEXREG_CTL2 1
-#define MGA_TEXREG_FILTER 2
-#define MGA_TEXREG_BORDERCOL 3
-#define MGA_TEXREG_ORG 4 /* validated */
-#define MGA_TEXREG_ORG1 5
-#define MGA_TEXREG_ORG2 6
-#define MGA_TEXREG_ORG3 7
-#define MGA_TEXREG_ORG4 8
-#define MGA_TEXREG_WIDTH 9
-#define MGA_TEXREG_HEIGHT 10
-#define MGA_TEX_SETUP_SIZE 11
-
-/* What needs to be changed for the current vertex dma buffer?
- */
-#define MGA_UPLOAD_CTX 0x1
-#define MGA_UPLOAD_TEX0 0x2
-#define MGA_UPLOAD_TEX1 0x4
-#define MGA_UPLOAD_PIPE 0x8
-#define MGA_UPLOAD_TEX0IMAGE 0x10 /* handled client-side */
-#define MGA_UPLOAD_TEX1IMAGE 0x20 /* handled client-side */
-#define MGA_UPLOAD_2D 0x40
-#define MGA_WAIT_AGE 0x80 /* handled client-side */
-#define MGA_UPLOAD_CLIPRECTS 0x100 /* handled client-side */
-#define MGA_DMA_FLUSH 0x200 /* set when someone gets the lock
- quiescent */
-
-/* 32 buffers of 64k each, total 2 meg.
- */
-#define MGA_DMA_BUF_ORDER 16
-#define MGA_DMA_BUF_SZ (1<<MGA_DMA_BUF_ORDER)
-#define MGA_DMA_BUF_NR 31
-
-/* Keep these small for testing.
- */
-#define MGA_NR_SAREA_CLIPRECTS 8
-
-/* 2 heaps (1 for card, 1 for agp), each divided into upto 128
- * regions, subject to a minimum region size of (1<<16) == 64k.
- *
- * Clients may subdivide regions internally, but when sharing between
- * clients, the region size is the minimum granularity.
- */
-
-#define MGA_CARD_HEAP 0
-#define MGA_AGP_HEAP 1
-#define MGA_NR_TEX_HEAPS 2
-#define MGA_NR_TEX_REGIONS 16
-#define MGA_LOG_MIN_TEX_REGION_SIZE 16
-#endif
-
-typedef struct _drm_mga_warp_index {
- int installed;
- unsigned long phys_addr;
- int size;
-} drm_mga_warp_index_t;
-
-typedef struct drm_mga_init {
- enum {
- MGA_INIT_DMA = 0x01,
- MGA_CLEANUP_DMA = 0x02
- } func;
- int reserved_map_agpstart;
- int reserved_map_idx;
- int buffer_map_idx;
- int sarea_priv_offset;
- int primary_size;
- int warp_ucode_size;
- unsigned int frontOffset;
- unsigned int backOffset;
- unsigned int depthOffset;
- unsigned int textureOffset;
- unsigned int textureSize;
- unsigned int agpTextureOffset;
- unsigned int agpTextureSize;
- unsigned int cpp;
- unsigned int stride;
- int sgram;
- int chipset;
- drm_mga_warp_index_t WarpIndex[MGA_MAX_WARP_PIPES];
- unsigned int mAccess;
-} drm_mga_init_t;
-
-/* Warning: if you change the sarea structure, you must change the Xserver
- * structures as well */
-
-typedef struct _drm_mga_tex_region {
- unsigned char next, prev;
- unsigned char in_use;
- unsigned int age;
-} drm_mga_tex_region_t;
-
-typedef struct _drm_mga_sarea {
- /* The channel for communication of state information to the kernel
- * on firing a vertex dma buffer.
- */
- unsigned int ContextState[MGA_CTX_SETUP_SIZE];
- unsigned int ServerState[MGA_2D_SETUP_SIZE];
- unsigned int TexState[2][MGA_TEX_SETUP_SIZE];
- unsigned int WarpPipe;
- unsigned int dirty;
-
- unsigned int nbox;
- drm_clip_rect_t boxes[MGA_NR_SAREA_CLIPRECTS];
-
-
- /* Information about the most recently used 3d drawable. The
- * client fills in the req_* fields, the server fills in the
- * exported_ fields and puts the cliprects into boxes, above.
- *
- * The client clears the exported_drawable field before
- * clobbering the boxes data.
- */
- unsigned int req_drawable; /* the X drawable id */
- unsigned int req_draw_buffer; /* MGA_FRONT or MGA_BACK */
-
- unsigned int exported_drawable;
- unsigned int exported_index;
- unsigned int exported_stamp;
- unsigned int exported_buffers;
- unsigned int exported_nfront;
- unsigned int exported_nback;
- int exported_back_x, exported_front_x, exported_w;
- int exported_back_y, exported_front_y, exported_h;
- drm_clip_rect_t exported_boxes[MGA_NR_SAREA_CLIPRECTS];
-
- /* Counters for aging textures and for client-side throttling.
- */
- unsigned int last_enqueue; /* last time a buffer was enqueued */
- unsigned int last_dispatch; /* age of the most recently dispatched buffer */
- unsigned int last_quiescent; /* */
-
-
- /* LRU lists for texture memory in agp space and on the card
- */
- drm_mga_tex_region_t texList[MGA_NR_TEX_HEAPS][MGA_NR_TEX_REGIONS+1];
- unsigned int texAge[MGA_NR_TEX_HEAPS];
-
- /* Mechanism to validate card state.
- */
- int ctxOwner;
- int vertexsize;
-} drm_mga_sarea_t;
-
-/* Device specific ioctls:
- */
-typedef struct _drm_mga_clear {
- unsigned int clear_color;
- unsigned int clear_depth;
- unsigned int flags;
- unsigned int clear_depthmask;
- unsigned int clear_color_mask;
-} drm_mga_clear_t;
-
-typedef struct _drm_mga_swap {
- int dummy;
-} drm_mga_swap_t;
-
-typedef struct _drm_mga_iload {
- int idx;
- int length;
- unsigned int destOrg;
-} drm_mga_iload_t;
-
-typedef struct _drm_mga_vertex {
- int idx; /* buffer to queue */
- int used; /* bytes in use */
- int discard; /* client finished with buffer? */
-} drm_mga_vertex_t;
-
-typedef struct _drm_mga_indices {
- int idx; /* buffer to queue */
- unsigned int start;
- unsigned int end;
- int discard; /* client finished with buffer? */
-} drm_mga_indices_t;
-
-#endif
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/r128_drm.h b/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/r128_drm.h
deleted file mode 100644
index bff103c23..000000000
--- a/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/r128_drm.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/* r128_drm.h -- Public header for the r128 driver -*- linux-c -*-
- * Created: Wed Apr 5 19:24:19 2000 by kevin@precisioninsight.com
- *
- * Copyright 2000 Precision Insight, Inc., Cedar Park, Texas.
- * All rights reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Authors: Kevin E. Martin <kevin@precisioninsight.com>
- *
- * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/r128_drm.h,v 1.1 2000/06/17 00:03:29 martin Exp $
- */
-
-#ifndef _R128_DRM_H_
-#define _R128_DRM_H_
-
-/* WARNING: If you change any of these defines, make sure to change the
- * defines in the Xserver file (xf86drmR128.h)
- */
-typedef struct drm_r128_init {
- enum {
- R128_INIT_CCE = 0x01,
- R128_CLEANUP_CCE = 0x02
- } func;
- int sarea_priv_offset;
- int is_pci;
- int cce_mode;
- int cce_fifo_size;
- int cce_secure;
- int ring_size;
- int usec_timeout;
-
- int fb_offset;
- int agp_ring_offset;
- int agp_read_ptr_offset;
- int agp_vertbufs_offset;
- int agp_indbufs_offset;
- int agp_textures_offset;
- int mmio_offset;
-} drm_r128_init_t;
-
-typedef struct drm_r128_packet {
- unsigned long *buffer;
- int count;
- int flags;
-} drm_r128_packet_t;
-
-typedef enum drm_r128_prim {
- _DRM_R128_PRIM_NONE = 0x0001,
- _DRM_R128_PRIM_POINT = 0x0002,
- _DRM_R128_PRIM_LINE = 0x0004,
- _DRM_R128_PRIM_POLY_LINE = 0x0008,
- _DRM_R128_PRIM_TRI_LIST = 0x0010,
- _DRM_R128_PRIM_TRI_FAN = 0x0020,
- _DRM_R128_PRIM_TRI_STRIP = 0x0040,
- _DRM_R128_PRIM_TRI_TYPE2 = 0x0080
-} drm_r128_prim_t;
-
-typedef struct drm_r128_vertex {
- /* Indices here refer to the offset into
- buflist in drm_buf_get_t. */
- int send_count; /* Number of buffers to send */
- int *send_indices; /* List of handles to buffers */
- int *send_sizes; /* Lengths of data to send */
- drm_r128_prim_t prim; /* Primitive type */
- int request_count; /* Number of buffers requested */
- int *request_indices; /* Buffer information */
- int *request_sizes;
- int granted_count; /* Number of buffers granted */
-} drm_r128_vertex_t;
-
-/* WARNING: If you change any of these defines, make sure to change the
- * defines in the Xserver file (r128_sarea.h)
- */
-#define R128_LOCAL_TEX_HEAP 0
-#define R128_AGP_TEX_HEAP 1
-#define R128_NR_TEX_HEAPS 2
-#define R128_NR_TEX_REGIONS 64
-#define R128_LOG_TEX_GRANULARITY 16
-
-typedef struct drm_tex_region {
- unsigned char next, prev;
- unsigned char in_use;
- int age;
-} drm_tex_region_t;
-
-typedef struct drm_r128_sarea {
- drm_tex_region_t tex_list[R128_NR_TEX_HEAPS][R128_NR_TEX_REGIONS+1];
- int tex_age[R128_NR_TEX_HEAPS];
- int ctx_owner;
- int ring_write;
-} drm_r128_sarea_t;
-
-#endif
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/xf86drmHash.c b/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/xf86drmHash.c
deleted file mode 100644
index 67cd444be..000000000
--- a/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/xf86drmHash.c
+++ /dev/null
@@ -1,435 +0,0 @@
-/* xf86drmHash.c -- Small hash table support for integer -> integer mapping
- * Created: Sun Apr 18 09:35:45 1999 by faith@precisioninsight.com
- * Revised: Thu Jun 3 16:11:06 1999 by faith@precisioninsight.com
- *
- * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * $PI: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmHash.c,v 1.3 1999/06/07 13:01:42 faith Exp $
- * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/xf86drmHash.c,v 1.1 2000/06/17 00:03:27 martin Exp $
- *
- * DESCRIPTION
- *
- * This file contains a straightforward implementation of a fixed-sized
- * hash table using self-organizing linked lists [Knuth73, pp. 398-399] for
- * collision resolution. There are two potentially interesting things
- * about this implementation:
- *
- * 1) The table is power-of-two sized. Prime sized tables are more
- * traditional, but do not have a significant advantage over power-of-two
- * sized table, especially when double hashing is not used for collision
- * resolution.
- *
- * 2) The hash computation uses a table of random integers [Hanson97,
- * pp. 39-41].
- *
- * FUTURE ENHANCEMENTS
- *
- * With a table size of 512, the current implementation is sufficient for a
- * few hundred keys. Since this is well above the expected size of the
- * tables for which this implementation was designed, the implementation of
- * dynamic hash tables was postponed until the need arises. A common (and
- * naive) approach to dynamic hash table implementation simply creates a
- * new hash table when necessary, rehashes all the data into the new table,
- * and destroys the old table. The approach in [Larson88] is superior in
- * two ways: 1) only a portion of the table is expanded when needed,
- * distributing the expansion cost over several insertions, and 2) portions
- * of the table can be locked, enabling a scalable thread-safe
- * implementation.
- *
- * REFERENCES
- *
- * [Hanson97] David R. Hanson. C Interfaces and Implementations:
- * Techniques for Creating Reusable Software. Reading, Massachusetts:
- * Addison-Wesley, 1997.
- *
- * [Knuth73] Donald E. Knuth. The Art of Computer Programming. Volume 3:
- * Sorting and Searching. Reading, Massachusetts: Addison-Wesley, 1973.
- *
- * [Larson88] Per-Ake Larson. "Dynamic Hash Tables". CACM 31(4), April
- * 1988, pp. 446-457.
- *
- */
-
-#define HASH_MAIN 0
-
-#if HASH_MAIN
-# include <stdio.h>
-# include <stdlib.h>
-#else
-# include "xf86drm.h"
-# ifdef XFree86LOADER
-# include "xf86.h"
-# include "xf86_ansic.h"
-# else
-# include <stdio.h>
-# include <stdlib.h>
-# endif
-#endif
-
-#define N(x) drm##x
-
-#define HASH_MAGIC 0xdeadbeef
-#define HASH_DEBUG 0
-#define HASH_SIZE 512 /* Good for about 100 entries */
- /* If you change this value, you probably
- have to change the HashHash hashing
- function! */
-
-#if HASH_MAIN
-#define HASH_ALLOC malloc
-#define HASH_FREE free
-#define HASH_RANDOM_DECL
-#define HASH_RANDOM_INIT(seed) srandom(seed)
-#define HASH_RANDOM random()
-#else
-#define HASH_ALLOC drmMalloc
-#define HASH_FREE drmFree
-#define HASH_RANDOM_DECL void *state
-#define HASH_RANDOM_INIT(seed) state = drmRandomCreate(seed)
-#define HASH_RANDOM drmRandom(state)
-
-#endif
-
-typedef struct HashBucket {
- unsigned long key;
- void *value;
- struct HashBucket *next;
-} HashBucket, *HashBucketPtr;
-
-typedef struct HashTable {
- unsigned long magic;
- unsigned long entries;
- unsigned long hits; /* At top of linked list */
- unsigned long partials; /* Not at top of linked list */
- unsigned long misses; /* Not in table */
- HashBucketPtr buckets[HASH_SIZE];
- int p0;
- HashBucketPtr p1;
-} HashTable, *HashTablePtr;
-
-#if HASH_MAIN
-extern void *N(HashCreate)(void);
-extern int N(HashDestroy)(void *t);
-extern int N(HashLookup)(void *t, unsigned long key, unsigned long *value);
-extern int N(HashInsert)(void *t, unsigned long key, unsigned long value);
-extern int N(HashDelete)(void *t, unsigned long key);
-#endif
-
-static unsigned long HashHash(unsigned long key)
-{
- unsigned long hash = 0;
- unsigned long tmp = key;
- static int init = 0;
- static unsigned long scatter[256];
- int i;
-
- if (!init) {
- HASH_RANDOM_DECL;
- HASH_RANDOM_INIT(37);
- for (i = 0; i < 256; i++) scatter[i] = HASH_RANDOM;
- ++init;
- }
-
- while (tmp) {
- hash = (hash << 1) + scatter[tmp & 0xff];
- tmp >>= 8;
- }
-
- hash %= HASH_SIZE;
-#if HASH_DEBUG
- printf( "Hash(%d) = %d\n", key, hash);
-#endif
- return hash;
-}
-
-void *N(HashCreate)(void)
-{
- HashTablePtr table;
- int i;
-
- table = HASH_ALLOC(sizeof(*table));
- if (!table) return NULL;
- table->magic = HASH_MAGIC;
- table->entries = 0;
- table->hits = 0;
- table->partials = 0;
- table->misses = 0;
-
- for (i = 0; i < HASH_SIZE; i++) table->buckets[i] = NULL;
- return table;
-}
-
-int N(HashDestroy)(void *t)
-{
- HashTablePtr table = (HashTablePtr)t;
- HashBucketPtr bucket;
- HashBucketPtr next;
- int i;
-
- if (table->magic != HASH_MAGIC) return -1; /* Bad magic */
-
- for (i = 0; i < HASH_SIZE; i++) {
- for (bucket = table->buckets[i]; bucket;) {
- next = bucket->next;
- HASH_FREE(bucket);
- bucket = next;
- }
- }
- HASH_FREE(table);
- return 0;
-}
-
-/* Find the bucket and organize the list so that this bucket is at the
- top. */
-
-static HashBucketPtr HashFind(HashTablePtr table,
- unsigned long key, unsigned long *h)
-{
- unsigned long hash = HashHash(key);
- HashBucketPtr prev = NULL;
- HashBucketPtr bucket;
-
- if (h) *h = hash;
-
- for (bucket = table->buckets[hash]; bucket; bucket = bucket->next) {
- if (bucket->key == key) {
- if (prev) {
- /* Organize */
- prev->next = bucket->next;
- bucket->next = table->buckets[hash];
- table->buckets[hash] = bucket;
- ++table->partials;
- } else {
- ++table->hits;
- }
- return bucket;
- }
- prev = bucket;
- }
- ++table->misses;
- return NULL;
-}
-
-int N(HashLookup)(void *t, unsigned long key, void **value)
-{
- HashTablePtr table = (HashTablePtr)t;
- HashBucketPtr bucket;
-
- if (table->magic != HASH_MAGIC) return -1; /* Bad magic */
-
- bucket = HashFind(table, key, NULL);
- if (!bucket) return 1; /* Not found */
- *value = bucket->value;
- return 0; /* Found */
-}
-
-int N(HashInsert)(void *t, unsigned long key, void *value)
-{
- HashTablePtr table = (HashTablePtr)t;
- HashBucketPtr bucket;
- unsigned long hash;
-
- if (table->magic != HASH_MAGIC) return -1; /* Bad magic */
-
- if (HashFind(table, key, &hash)) return 1; /* Already in table */
-
- bucket = HASH_ALLOC(sizeof(*bucket));
- if (!bucket) return -1; /* Error */
- bucket->key = key;
- bucket->value = value;
- bucket->next = table->buckets[hash];
- table->buckets[hash] = bucket;
-#if HASH_DEBUG
- printf("Inserted %d at %d/%p\n", key, hash, bucket);
-#endif
- return 0; /* Added to table */
-}
-
-int N(HashDelete)(void *t, unsigned long key)
-{
- HashTablePtr table = (HashTablePtr)t;
- unsigned long hash;
- HashBucketPtr bucket;
-
- if (table->magic != HASH_MAGIC) return -1; /* Bad magic */
-
- bucket = HashFind(table, key, &hash);
-
- if (!bucket) return 1; /* Not found */
-
- table->buckets[hash] = bucket->next;
- HASH_FREE(bucket);
- return 0;
-}
-
-int N(HashNext)(void *t, unsigned long *key, void **value)
-{
- HashTablePtr table = (HashTablePtr)t;
-
- for (; table->p0 < HASH_SIZE;
- ++table->p0, table->p1 = table->buckets[table->p0]) {
- if (table->p1) {
- *key = table->p1->key;
- *value = table->p1->value;
- table->p1 = table->p1->next;
- return 1;
- }
- }
- return 0;
-}
-
-int N(HashFirst)(void *t, unsigned long *key, void **value)
-{
- HashTablePtr table = (HashTablePtr)t;
-
- if (table->magic != HASH_MAGIC) return -1; /* Bad magic */
-
- table->p0 = 0;
- table->p1 = table->buckets[0];
- return N(HashNext)(table, key, value);
-}
-
-#if HASH_MAIN
-#define DIST_LIMIT 10
-static int dist[DIST_LIMIT];
-
-static void clear_dist(void) {
- int i;
-
- for (i = 0; i < DIST_LIMIT; i++) dist[i] = 0;
-}
-
-static int count_entries(HashBucketPtr bucket)
-{
- int count = 0;
-
- for (; bucket; bucket = bucket->next) ++count;
- return count;
-}
-
-static void update_dist(int count)
-{
- if (count >= DIST_LIMIT) ++dist[DIST_LIMIT-1];
- else ++dist[count];
-}
-
-static void compute_dist(HashTablePtr table)
-{
- int i;
- HashBucketPtr bucket;
-
- printf("Entries = %ld, hits = %ld, partials = %ld, misses = %ld\n",
- table->entries, table->hits, table->partials, table->misses);
- clear_dist();
- for (i = 0; i < HASH_SIZE; i++) {
- bucket = table->buckets[i];
- update_dist(count_entries(bucket));
- }
- for (i = 0; i < DIST_LIMIT; i++) {
- if (i != DIST_LIMIT-1) printf("%5d %10d\n", i, dist[i]);
- else printf("other %10d\n", dist[i]);
- }
-}
-
-static void check_table(HashTablePtr table,
- unsigned long key, unsigned long value)
-{
- unsigned long retval = 0;
- int retcode = N(HashLookup)(table, key, &retval);
-
- switch (retcode) {
- case -1:
- printf("Bad magic = 0x%08lx:"
- " key = %lu, expected = %lu, returned = %lu\n",
- table->magic, key, value, retval);
- break;
- case 1:
- printf("Not found: key = %lu, expected = %lu returned = %lu\n",
- key, value, retval);
- break;
- case 0:
- if (value != retval)
- printf("Bad value: key = %lu, expected = %lu, returned = %lu\n",
- key, value, retval);
- break;
- default:
- printf("Bad retcode = %d: key = %lu, expected = %lu, returned = %lu\n",
- retcode, key, value, retval);
- break;
- }
-}
-
-int main(void)
-{
- HashTablePtr table;
- int i;
-
- printf("\n***** 256 consecutive integers ****\n");
- table = N(HashCreate)();
- for (i = 0; i < 256; i++) N(HashInsert)(table, i, i);
- for (i = 0; i < 256; i++) check_table(table, i, i);
- for (i = 256; i >= 0; i--) check_table(table, i, i);
- compute_dist(table);
- N(HashDestroy)(table);
-
- printf("\n***** 1024 consecutive integers ****\n");
- table = N(HashCreate)();
- for (i = 0; i < 1024; i++) N(HashInsert)(table, i, i);
- for (i = 0; i < 1024; i++) check_table(table, i, i);
- for (i = 1024; i >= 0; i--) check_table(table, i, i);
- compute_dist(table);
- N(HashDestroy)(table);
-
- printf("\n***** 1024 consecutive page addresses (4k pages) ****\n");
- table = N(HashCreate)();
- for (i = 0; i < 1024; i++) N(HashInsert)(table, i*4096, i);
- for (i = 0; i < 1024; i++) check_table(table, i*4096, i);
- for (i = 1024; i >= 0; i--) check_table(table, i*4096, i);
- compute_dist(table);
- N(HashDestroy)(table);
-
- printf("\n***** 1024 random integers ****\n");
- table = N(HashCreate)();
- srandom(0xbeefbeef);
- for (i = 0; i < 1024; i++) N(HashInsert)(table, random(), i);
- srandom(0xbeefbeef);
- for (i = 0; i < 1024; i++) check_table(table, random(), i);
- srandom(0xbeefbeef);
- for (i = 0; i < 1024; i++) check_table(table, random(), i);
- compute_dist(table);
- N(HashDestroy)(table);
-
- printf("\n***** 5000 random integers ****\n");
- table = N(HashCreate)();
- srandom(0xbeefbeef);
- for (i = 0; i < 5000; i++) N(HashInsert)(table, random(), i);
- srandom(0xbeefbeef);
- for (i = 0; i < 5000; i++) check_table(table, random(), i);
- srandom(0xbeefbeef);
- for (i = 0; i < 5000; i++) check_table(table, random(), i);
- compute_dist(table);
- N(HashDestroy)(table);
-
- return 0;
-}
-#endif
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/xf86drmI810.c b/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/xf86drmI810.c
deleted file mode 100644
index 067c6376e..000000000
--- a/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/xf86drmI810.c
+++ /dev/null
@@ -1,86 +0,0 @@
-#ifdef XFree86Server
-# include "xf86.h"
-# include "xf86_OSproc.h"
-# include "xf86_ansic.h"
-# include "xf86Priv.h"
-# define _DRM_MALLOC xalloc
-# define _DRM_FREE xfree
-# ifndef XFree86LOADER
-# include <sys/stat.h>
-# include <sys/mman.h>
-# endif
-#else
-# include <stdio.h>
-# include <stdlib.h>
-# include <unistd.h>
-# include <string.h>
-# include <ctype.h>
-# include <fcntl.h>
-# include <errno.h>
-# include <signal.h>
-# include <sys/types.h>
-# include <sys/stat.h>
-# include <sys/ioctl.h>
-# include <sys/mman.h>
-# include <sys/time.h>
-# ifdef DRM_USE_MALLOC
-# define _DRM_MALLOC malloc
-# define _DRM_FREE free
-extern int xf86InstallSIGIOHandler(int fd, void (*f)(int, void *), void *);
-extern int xf86RemoveSIGIOHandler(int fd);
-# else
-# include <Xlibint.h>
-# define _DRM_MALLOC Xmalloc
-# define _DRM_FREE Xfree
-# endif
-#endif
-
-/* Not all systems have MAP_FAILED defined */
-#ifndef MAP_FAILED
-#define MAP_FAILED ((void *)-1)
-#endif
-
-#include "xf86drm.h"
-#include "xf86drmI810.h"
-#include "drm.h"
-
-Bool drmI810CleanupDma(int driSubFD)
-{
- drm_i810_init_t init;
-
- memset(&init, 0, sizeof(drm_i810_init_t));
- init.func = I810_CLEANUP_DMA;
-
- if(ioctl(driSubFD, DRM_IOCTL_I810_INIT, &init)) {
- return FALSE;
- }
-
- return TRUE;
-}
-
-Bool drmI810InitDma(int driSubFD, drmI810Init *info)
-{
- drm_i810_init_t init;
-
- memset(&init, 0, sizeof(drm_i810_init_t));
-
- init.func = I810_INIT_DMA;
- init.ring_map_idx = info->ring_map_idx;
- init.buffer_map_idx = info->buffer_map_idx;
- init.ring_start = info->start;
- init.ring_end = info->end;
- init.ring_size = info->size;
- init.sarea_priv_offset = info->sarea_off;
- init.front_offset = info->front_offset;
- init.back_offset = info->back_offset;
- init.depth_offset = info->depth_offset;
- init.w = info->w;
- init.h = info->h;
- init.pitch = info->pitch;
- init.pitch_bits = info->pitch_bits;
-
- if(ioctl(driSubFD, DRM_IOCTL_I810_INIT, &init)) {
- return FALSE;
- }
- return TRUE;
-}
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/xf86drmMga.c b/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/xf86drmMga.c
deleted file mode 100644
index aa3a6c745..000000000
--- a/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/xf86drmMga.c
+++ /dev/null
@@ -1,116 +0,0 @@
-#ifdef XFree86Server
-# include "xf86.h"
-# include "xf86_OSproc.h"
-# include "xf86_ansic.h"
-# include "xf86Priv.h"
-# define _DRM_MALLOC xalloc
-# define _DRM_FREE xfree
-# ifndef XFree86LOADER
-# include <sys/stat.h>
-# include <sys/mman.h>
-# endif
-#else
-# include <stdio.h>
-# include <stdlib.h>
-# include <unistd.h>
-# include <string.h>
-# include <ctype.h>
-# include <fcntl.h>
-# include <errno.h>
-# include <signal.h>
-# include <sys/types.h>
-# include <sys/stat.h>
-# include <sys/ioctl.h>
-# include <sys/mman.h>
-# include <sys/time.h>
-# ifdef DRM_USE_MALLOC
-# define _DRM_MALLOC malloc
-# define _DRM_FREE free
-extern int xf86InstallSIGIOHandler(int fd, void (*f)(int, void *), void *);
-extern int xf86RemoveSIGIOHandler(int fd);
-# else
-# include <Xlibint.h>
-# define _DRM_MALLOC Xmalloc
-# define _DRM_FREE Xfree
-# endif
-#endif
-
-/* Not all systems have MAP_FAILED defined */
-#ifndef MAP_FAILED
-#define MAP_FAILED ((void *)-1)
-#endif
-
-#include "xf86drm.h"
-#include "xf86drmMga.h"
-#include "drm.h"
-
-Bool drmMgaCleanupDma(int driSubFD)
-{
- drm_mga_init_t init;
- memset(&init, 0, sizeof(drm_mga_init_t));
- init.func = MGA_CLEANUP_DMA;
- if(ioctl(driSubFD, DRM_IOCTL_MGA_INIT, &init)) {
- return FALSE;
- }
-
- return TRUE;
-}
-
-Bool drmMgaLockUpdate(int driSubFD, drmLockFlags flags)
-{
- drm_lock_t lock;
-
- memset(&lock, 0, sizeof(drm_lock_t));
-
- if (flags & DRM_LOCK_QUIESCENT) lock.flags |= _DRM_LOCK_QUIESCENT;
- if (flags & DRM_LOCK_FLUSH) lock.flags |= _DRM_LOCK_FLUSH;
- if (flags & DRM_LOCK_FLUSH_ALL) lock.flags |= _DRM_LOCK_FLUSH_ALL;
-
- if(ioctl(driSubFD, DRM_IOCTL_MGA_FLUSH, &lock)) {
- return FALSE;
- }
-
- return TRUE;
-}
-
-Bool drmMgaInitDma(int driSubFD, drmMgaInit *info)
-{
- drm_mga_init_t init;
- int i;
-
- memset(&init, 0, sizeof(drm_mga_init_t));
- init.func = MGA_INIT_DMA;
- init.reserved_map_agpstart = info->reserved_map_agpstart;
- init.reserved_map_idx = info->reserved_map_idx;
- init.buffer_map_idx = info->buffer_map_idx;
- init.sarea_priv_offset = info->sarea_priv_offset;
- init.primary_size = info->primary_size;
- init.warp_ucode_size = info->warp_ucode_size;
- init.frontOffset = info->frontOffset;
- init.backOffset = info->backOffset;
- init.depthOffset = info->depthOffset;
- init.textureOffset = info->textureOffset;
- init.textureSize = info->textureSize;
- init.agpTextureSize = info->agpTextureSize;
- init.agpTextureOffset = info->agpTextureOffset;
- init.cpp = info->cpp;
- init.stride = info->stride;
- init.sgram = info->sgram;
- init.chipset = info->chipset;
-
- for(i = 0; i < MGA_MAX_WARP_PIPES; i++) {
- init.WarpIndex[i].installed = info->WarpIndex[i].installed;
- init.WarpIndex[i].phys_addr = info->WarpIndex[i].phys_addr;
- init.WarpIndex[i].size = info->WarpIndex[i].size;
- }
-
- init.mAccess = info->mAccess;
-
-
-
- if(ioctl(driSubFD, DRM_IOCTL_MGA_INIT, &init)) {
- return FALSE;
- }
- return TRUE;
-}
-
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/xf86drmR128.c b/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/xf86drmR128.c
deleted file mode 100644
index 07904c754..000000000
--- a/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/xf86drmR128.c
+++ /dev/null
@@ -1,198 +0,0 @@
-/* xf86drmR128.c -- User-level interface to Rage 128 DRM device
- * Created: Sun Apr 9 18:13:54 2000 by kevin@precisioninsight.com
- *
- * Copyright 1999, 2000 Precision Insight, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Author: Kevin E. Martin <kevin@precisioninsight.com>
- *
- * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/xf86drmR128.c,v 1.1 2000/06/17 00:03:27 martin Exp $
- *
- */
-
-#ifdef XFree86Server
-# include "xf86.h"
-# include "xf86_OSproc.h"
-# include "xf86_ansic.h"
-# include "xf86Priv.h"
-# define _DRM_MALLOC xalloc
-# define _DRM_FREE xfree
-# ifndef XFree86LOADER
-# include <sys/stat.h>
-# include <sys/mman.h>
-# endif
-#else
-# include <stdio.h>
-# include <stdlib.h>
-# include <unistd.h>
-# include <string.h>
-# include <ctype.h>
-# include <fcntl.h>
-# include <errno.h>
-# include <signal.h>
-# include <sys/types.h>
-# include <sys/stat.h>
-# include <sys/ioctl.h>
-# include <sys/mman.h>
-# include <sys/time.h>
-# ifdef DRM_USE_MALLOC
-# define _DRM_MALLOC malloc
-# define _DRM_FREE free
-extern int xf86InstallSIGIOHandler(int fd, void (*f)(int, void *), void *);
-extern int xf86RemoveSIGIOHandler(int fd);
-# else
-# include <Xlibint.h>
-# define _DRM_MALLOC Xmalloc
-# define _DRM_FREE Xfree
-# endif
-#endif
-
-/* Not all systems have MAP_FAILED defined */
-#ifndef MAP_FAILED
-#define MAP_FAILED ((void *)-1)
-#endif
-
-#include "xf86drm.h"
-#include "xf86drmR128.h"
-#include "drm.h"
-
-int drmR128InitCCE(int fd, drmR128Init *info)
-{
- drm_r128_init_t init;
-
- memset(&init, 0, sizeof(drm_r128_init_t));
-
- init.func = R128_INIT_CCE;
- init.sarea_priv_offset = info->sarea_priv_offset;
- init.is_pci = info->is_pci;
- init.cce_mode = info->cce_mode;
- init.cce_fifo_size = info->cce_fifo_size;
- init.cce_secure = info->cce_secure;
- init.ring_size = info->ring_size;
- init.usec_timeout = info->usec_timeout;
-
- init.fb_offset = info->fb_offset;
- init.agp_ring_offset = info->agp_ring_offset;
- init.agp_read_ptr_offset = info->agp_read_ptr_offset;
- init.agp_vertbufs_offset = info->agp_vertbufs_offset;
- init.agp_indbufs_offset = info->agp_indbufs_offset;
- init.agp_textures_offset = info->agp_textures_offset;
- init.mmio_offset = info->mmio_offset;
-
- if (ioctl(fd, DRM_IOCTL_R128_INIT, &init)) return -errno;
-
- return 0;
-}
-
-int drmR128CleanupCCE(int fd)
-{
- drm_r128_init_t init;
-
- memset(&init, 0, sizeof(drm_r128_init_t));
-
- init.func = R128_CLEANUP_CCE;
-
- if (ioctl(fd, DRM_IOCTL_R128_INIT, &init)) return -errno;
-
- return 0;
-}
-
-int drmR128EngineReset(int fd)
-{
- if (ioctl(fd, DRM_IOCTL_R128_RESET, NULL)) return -errno;
-
- return 0;
-}
-
-int drmR128EngineFlush(int fd)
-{
- if (ioctl(fd, DRM_IOCTL_R128_FLUSH, NULL)) return -errno;
-
- return 0;
-}
-
-int drmR128CCEWaitForIdle(int fd)
-{
- if (ioctl(fd, DRM_IOCTL_R128_CCEIDL, NULL)) return -errno;
-
- return 0;
-}
-
-int drmR128SubmitPackets(int fd, CARD32 *buffer, int *count, int flags)
-{
- drm_r128_packet_t packet;
- int ret;
-
- memset(&packet, 0, sizeof(drm_r128_packet_t));
-
- packet.count = *count;
- packet.flags = flags;
-
- while (packet.count > 0) {
- packet.buffer = buffer + (*count - packet.count);
- ret = ioctl(fd, DRM_IOCTL_R128_PACKET, &packet);
- if (ret < 0 && ret != -EAGAIN) {
- *count = packet.count;
- return -errno;
- }
- }
-
- *count = 0;
- return 0;
-}
-
-int drmR128GetVertexBuffers(int fd, int count, int *indices, int *sizes)
-{
- drm_r128_vertex_t v;
-
- v.send_count = 0;
- v.send_indices = NULL;
- v.send_sizes = NULL;
- v.prim = DRM_R128_PRIM_NONE;
- v.request_count = count;
- v.request_indices = indices;
- v.request_sizes = sizes;
- v.granted_count = 0;
-
- if (ioctl(fd, DRM_IOCTL_R128_VERTEX, &v)) return -errno;
-
- return v.granted_count;
-}
-
-int drmR128FlushVertexBuffers(int fd, int count, int *indices,
- int *sizes, drmR128PrimType prim)
-{
- drm_r128_vertex_t v;
-
- v.send_count = count;
- v.send_indices = indices;
- v.send_sizes = sizes;
- v.prim = prim;
- v.request_count = 0;
- v.request_indices = NULL;
- v.request_sizes = NULL;
- v.granted_count = 0;
-
- if (ioctl(fd, DRM_IOCTL_R128_VERTEX, &v) < 0) return -errno;
-
- return 0;
-}
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/xf86drmRandom.c b/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/xf86drmRandom.c
deleted file mode 100644
index d0f49906b..000000000
--- a/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/xf86drmRandom.c
+++ /dev/null
@@ -1,219 +0,0 @@
-/* xf86drmRandom.c -- "Minimal Standard" PRNG Implementation
- * Created: Mon Apr 19 08:28:13 1999 by faith@precisioninsight.com
- * Revised: Thu Jun 24 14:53:45 1999 by faith@precisioninsight.com
- *
- * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * $PI: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmRandom.c,v 1.4 1999/06/24 18:54:55 faith Exp $
- * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/xf86drmRandom.c,v 1.1 2000/06/17 00:03:28 martin Exp $
- *
- * DESCRIPTION
- *
- * This file contains a simple, straightforward implementation of the Park
- * & Miller "Minimal Standard" PRNG [PM88, PMS93], which is a Lehmer
- * multiplicative linear congruential generator (MLCG) with a period of
- * 2^31-1.
- *
- * This implementation is intended to provide a reliable, portable PRNG
- * that is suitable for testing a hash table implementation and for
- * implementing skip lists.
- *
- * FUTURE ENHANCEMENTS
- *
- * If initial seeds are not selected randomly, two instances of the PRNG
- * can be correlated. [Knuth81, pp. 32-33] describes a shuffling technique
- * that can eliminate this problem.
- *
- * If PRNGs are used for simulation, the period of the current
- * implementation may be too short. [LE88] discusses methods of combining
- * MLCGs to produce much longer periods, and suggests some alternative
- * values for A and M. [LE90 and Sch92] also provide information on
- * long-period PRNGs.
- *
- * REFERENCES
- *
- * [Knuth81] Donald E. Knuth. The Art of Computer Programming. Volume 2:
- * Seminumerical Algorithms. Reading, Massachusetts: Addison-Wesley, 1981.
- *
- * [LE88] Pierre L'Ecuyer. "Efficient and Portable Combined Random Number
- * Generators". CACM 31(6), June 1988, pp. 742-774.
- *
- * [LE90] Pierre L'Ecuyer. "Random Numbers for Simulation". CACM 33(10,
- * October 1990, pp. 85-97.
- *
- * [PM88] Stephen K. Park and Keith W. Miller. "Random Number Generators:
- * Good Ones are Hard to Find". CACM 31(10), October 1988, pp. 1192-1201.
- *
- * [Sch92] Bruce Schneier. "Pseudo-Ransom Sequence Generator for 32-Bit
- * CPUs". Dr. Dobb's Journal 17(2), February 1992, pp. 34, 37-38, 40.
- *
- * [PMS93] Stephen K. Park, Keith W. Miller, and Paul K. Stockmeyer. In
- * "Technical Correspondence: Remarks on Choosing and Implementing Random
- * Number Generators". CACM 36(7), July 1993, pp. 105-110.
- *
- */
-
-#define RANDOM_MAIN 0
-
-#if RANDOM_MAIN
-# include <stdio.h>
-# include <stdlib.h>
-#else
-# include "xf86drm.h"
-# ifdef XFree86LOADER
-# include "xf86.h"
-# include "xf86_ansic.h"
-# else
-# include <stdio.h>
-# include <stdlib.h>
-# endif
-#endif
-
-#define N(x) drm##x
-
-#define RANDOM_MAGIC 0xfeedbeef
-#define RANDOM_DEBUG 0
-
-#if RANDOM_MAIN
-#define RANDOM_ALLOC malloc
-#define RANDOM_FREE free
-#else
-#define RANDOM_ALLOC drmMalloc
-#define RANDOM_FREE drmFree
-#endif
-
-typedef struct RandomState {
- unsigned long magic;
- unsigned long a;
- unsigned long m;
- unsigned long q; /* m div a */
- unsigned long r; /* m mod a */
- unsigned long check;
- long seed;
-} RandomState;
-
-#if RANDOM_MAIN
-extern void *N(RandomCreate)(unsigned long seed);
-extern int N(RandomDestroy)(void *state);
-extern unsigned long N(Random)(void *state);
-extern double N(RandomDouble)(void *state);
-#endif
-
-void *N(RandomCreate)(unsigned long seed)
-{
- RandomState *state;
-
- state = RANDOM_ALLOC(sizeof(*state));
- if (!state) return NULL;
- state->magic = RANDOM_MAGIC;
-#if 0
- /* Park & Miller, October 1988 */
- state->a = 16807;
- state->m = 2147483647;
- state->check = 1043618065; /* After 10000 iterations */
-#else
- /* Park, Miller, and Stockmeyer, July 1993 */
- state->a = 48271;
- state->m = 2147483647;
- state->check = 399268537; /* After 10000 iterations */
-#endif
- state->q = state->m / state->a;
- state->r = state->m % state->a;
-
- state->seed = seed;
- /* Check for illegal boundary conditions,
- and choose closest legal value. */
- if (state->seed <= 0) state->seed = 1;
- if (state->seed >= state->m) state->seed = state->m - 1;
-
- return state;
-}
-
-int N(RandomDestroy)(void *state)
-{
- RANDOM_FREE(state);
- return 0;
-}
-
-unsigned long N(Random)(void *state)
-{
- RandomState *s = (RandomState *)state;
- long hi;
- long lo;
-
- hi = s->seed / s->q;
- lo = s->seed % s->q;
- s->seed = s->a * lo - s->r * hi;
- if (s->seed <= 0) s->seed += s->m;
-
- return s->seed;
-}
-
-double N(RandomDouble)(void *state)
-{
- RandomState *s = (RandomState *)state;
-
- return (double)N(Random)(state)/(double)s->m;
-}
-
-#if RANDOM_MAIN
-static void check_period(long seed)
-{
- unsigned long count = 0;
- unsigned long initial;
- void *state;
-
- state = N(RandomCreate)(seed);
- initial = N(Random)(state);
- ++count;
- while (initial != N(Random)(state)) {
- if (!++count) break;
- }
- printf("With seed of %10ld, period = %10lu (0x%08lx)\n",
- seed, count, count);
- N(RandomDestroy)(state);
-}
-
-int main(void)
-{
- RandomState *state;
- int i;
- unsigned long rand;
-
- state = N(RandomCreate)(1);
- for (i = 0; i < 10000; i++) {
- rand = N(Random)(state);
- }
- printf("After 10000 iterations: %lu (%lu expected): %s\n",
- rand, state->check,
- rand - state->check ? "*INCORRECT*" : "CORRECT");
- N(RandomDestroy)(state);
-
- printf("Checking periods...\n");
- check_period(1);
- check_period(2);
- check_period(31415926);
-
- return 0;
-}
-#endif
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/xf86drmSL.c b/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/xf86drmSL.c
deleted file mode 100644
index 51a54f934..000000000
--- a/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/xf86drmSL.c
+++ /dev/null
@@ -1,490 +0,0 @@
-/* xf86drmSL.c -- Skip list support
- * Created: Mon May 10 09:28:13 1999 by faith@precisioninsight.com
- * Revised: Thu Jun 3 16:13:01 1999 by faith@precisioninsight.com
- *
- * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * $PI: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmSL.c,v 1.2 1999/06/07 13:01:42 faith Exp $
- * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/xf86drmSL.c,v 1.1 2000/06/17 00:03:28 martin Exp $
- *
- * DESCRIPTION
- *
- * This file contains a straightforward skip list implementation.n
- *
- * FUTURE ENHANCEMENTS
- *
- * REFERENCES
- *
- * [Pugh90] William Pugh. Skip Lists: A Probabilistic Alternative to
- * Balanced Trees. CACM 33(6), June 1990, pp. 668-676.
- *
- */
-
-#define SL_MAIN 0
-
-#if SL_MAIN
-# include <stdio.h>
-# include <stdlib.h>
-# include <sys/time.h>
-#else
-# include "xf86drm.h"
-# ifdef XFree86LOADER
-# include "xf86.h"
-# include "xf86_ansic.h"
-# else
-# include <stdio.h>
-# include <stdlib.h>
-# endif
-#endif
-
-#define N(x) drm##x
-
-#define SL_LIST_MAGIC 0xfacade00LU
-#define SL_ENTRY_MAGIC 0x00fab1edLU
-#define SL_FREED_MAGIC 0xdecea5edLU
-#define SL_MAX_LEVEL 16
-#define SL_DEBUG 0
-#define SL_RANDOM_SEED 0xc01055a1LU
-
-#if SL_MAIN
-#define SL_ALLOC malloc
-#define SL_FREE free
-#define SL_RANDOM_DECL static int state = 0;
-#define SL_RANDOM_INIT(seed) if (!state) { srandom(seed); ++state; }
-#define SL_RANDOM random()
-#else
-#define SL_ALLOC drmMalloc
-#define SL_FREE drmFree
-#define SL_RANDOM_DECL static void *state = NULL
-#define SL_RANDOM_INIT(seed) if (!state) state = drmRandomCreate(seed)
-#define SL_RANDOM drmRandom(state)
-
-#endif
-
-typedef struct SLEntry {
- unsigned long magic; /* SL_ENTRY_MAGIC */
- unsigned long key;
- void *value;
- int levels;
- struct SLEntry *forward[1]; /* variable sized array */
-} SLEntry, *SLEntryPtr;
-
-typedef struct SkipList {
- unsigned long magic; /* SL_LIST_MAGIC */
- int level;
- int count;
- SLEntryPtr head;
- SLEntryPtr p0; /* Position for iteration */
-} SkipList, *SkipListPtr;
-
-#if SL_MAIN
-extern void *N(SLCreate)(void);
-extern int N(SLDestroy)(void *l);
-extern int N(SLLookup)(void *l, unsigned long key, void **value);
-extern int N(SLInsert)(void *l, unsigned long key, void *value);
-extern int N(SLDelete)(void *l, unsigned long key);
-extern int N(SLNext)(void *l, unsigned long *key, void **value);
-extern int N(SLFirst)(void *l, unsigned long *key, void **value);
-extern void N(SLDump)(void *l);
-extern int N(SLLookupNeighbors)(void *l, unsigned long key,
- unsigned long *prev_key, void **prev_value,
- unsigned long *next_key, void **next_value);
-#endif
-
-static SLEntryPtr SLCreateEntry(int max_level, unsigned long key, void *value)
-{
- SLEntryPtr entry;
-
- if (max_level < 0 || max_level > SL_MAX_LEVEL) max_level = SL_MAX_LEVEL;
-
- entry = SL_ALLOC(sizeof(*entry)
- + (max_level + 1) * sizeof(entry->forward[0]));
- if (!entry) return NULL;
- entry->magic = SL_ENTRY_MAGIC;
- entry->key = key;
- entry->value = value;
- entry->levels = max_level + 1;
-
- return entry;
-}
-
-static int SLRandomLevel(void)
-{
- int level = 1;
- SL_RANDOM_DECL;
-
- SL_RANDOM_INIT(SL_RANDOM_SEED);
-
- while ((SL_RANDOM & 0x01) && level < SL_MAX_LEVEL) ++level;
- return level;
-}
-
-void *N(SLCreate)(void)
-{
- SkipListPtr list;
- int i;
-
- list = SL_ALLOC(sizeof(*list));
- if (!list) return NULL;
- list->magic = SL_LIST_MAGIC;
- list->level = 0;
- list->head = SLCreateEntry(SL_MAX_LEVEL, 0, NULL);
- list->count = 0;
-
- for (i = 0; i <= SL_MAX_LEVEL; i++) list->head->forward[i] = NULL;
-
- return list;
-}
-
-int N(SLDestroy)(void *l)
-{
- SkipListPtr list = (SkipListPtr)l;
- SLEntryPtr entry;
- SLEntryPtr next;
-
- if (list->magic != SL_LIST_MAGIC) return -1; /* Bad magic */
-
- for (entry = list->head; entry; entry = next) {
- if (entry->magic != SL_ENTRY_MAGIC) return -1; /* Bad magic */
- next = entry->forward[0];
- entry->magic = SL_FREED_MAGIC;
- SL_FREE(entry);
- }
-
- list->magic = SL_FREED_MAGIC;
- SL_FREE(list);
- return 0;
-}
-
-static SLEntryPtr SLLocate(void *l, unsigned long key, SLEntryPtr *update)
-{
- SkipListPtr list = (SkipListPtr)l;
- SLEntryPtr entry;
- int i;
-
- if (list->magic != SL_LIST_MAGIC) return NULL;
-
- for (i = list->level, entry = list->head; i >= 0; i--) {
- while (entry->forward[i] && entry->forward[i]->key < key)
- entry = entry->forward[i];
- update[i] = entry;
- }
-
- return entry->forward[0];
-}
-
-int N(SLInsert)(void *l, unsigned long key, void *value)
-{
- SkipListPtr list = (SkipListPtr)l;
- SLEntryPtr entry;
- SLEntryPtr update[SL_MAX_LEVEL + 1];
- int level;
- int i;
-
- if (list->magic != SL_LIST_MAGIC) return -1; /* Bad magic */
-
- entry = SLLocate(list, key, update);
-
- if (entry && entry->key == key) return 1; /* Already in list */
-
-
- level = SLRandomLevel();
- if (level > list->level) {
- level = ++list->level;
- update[level] = list->head;
- }
-
- entry = SLCreateEntry(level, key, value);
-
- /* Fix up forward pointers */
- for (i = 0; i <= level; i++) {
- entry->forward[i] = update[i]->forward[i];
- update[i]->forward[i] = entry;
- }
-
- ++list->count;
- return 0; /* Added to table */
-}
-
-int N(SLDelete)(void *l, unsigned long key)
-{
- SkipListPtr list = (SkipListPtr)l;
- SLEntryPtr update[SL_MAX_LEVEL + 1];
- SLEntryPtr entry;
- int i;
-
- if (list->magic != SL_LIST_MAGIC) return -1; /* Bad magic */
-
- entry = SLLocate(list, key, update);
-
- if (!entry || entry->key != key) return 1; /* Not found */
-
- /* Fix up forward pointers */
- for (i = 0; i <= list->level; i++) {
- if (update[i]->forward[i] == entry)
- update[i]->forward[i] = entry->forward[i];
- }
-
- entry->magic = SL_FREED_MAGIC;
- SL_FREE(entry);
-
- while (list->level && !list->head->forward[list->level]) --list->level;
- --list->count;
- return 0;
-}
-
-int N(SLLookup)(void *l, unsigned long key, void **value)
-{
- SkipListPtr list = (SkipListPtr)l;
- SLEntryPtr update[SL_MAX_LEVEL + 1];
- SLEntryPtr entry;
-
- entry = SLLocate(list, key, update);
-
- if (entry && entry->key == key) {
- *value = entry;
- return 0;
- }
- *value = NULL;
- return -1;
-}
-
-int N(SLLookupNeighbors)(void *l, unsigned long key,
- unsigned long *prev_key, void **prev_value,
- unsigned long *next_key, void **next_value)
-{
- SkipListPtr list = (SkipListPtr)l;
- SLEntryPtr update[SL_MAX_LEVEL + 1];
- SLEntryPtr entry;
- int retcode = 0;
-
- entry = SLLocate(list, key, update);
-
- *prev_key = *next_key = key;
- *prev_value = *next_value = NULL;
-
- if (update[0]) {
- *prev_key = update[0]->key;
- *prev_value = update[0]->value;
- ++retcode;
- if (update[0]->forward[0]) {
- *next_key = update[0]->forward[0]->key;
- *next_value = update[0]->forward[0]->value;
- ++retcode;
- }
- }
- return retcode;
-}
-
-int N(SLNext)(void *l, unsigned long *key, void **value)
-{
- SkipListPtr list = (SkipListPtr)l;
- SLEntryPtr entry;
-
- if (list->magic != SL_LIST_MAGIC) return -1; /* Bad magic */
-
- entry = list->p0;
-
- if (entry) {
- list->p0 = entry->forward[0];
- *key = entry->key;
- *value = entry->value;
- return 1;
- }
- list->p0 = NULL;
- return 0;
-}
-
-int N(SLFirst)(void *l, unsigned long *key, void **value)
-{
- SkipListPtr list = (SkipListPtr)l;
-
- if (list->magic != SL_LIST_MAGIC) return -1; /* Bad magic */
-
- list->p0 = list->head->forward[0];
- return N(SLNext)(list, key, value);
-}
-
-/* Dump internal data structures for debugging. */
-void N(SLDump)(void *l)
-{
- SkipListPtr list = (SkipListPtr)l;
- SLEntryPtr entry;
- int i;
-
- if (list->magic != SL_LIST_MAGIC) {
- printf("Bad magic: 0x%08lx (expected 0x%08lx)\n",
- list->magic, SL_LIST_MAGIC);
- return;
- }
-
- printf("Level = %d, count = %d\n", list->level, list->count);
- for (entry = list->head; entry; entry = entry->forward[0]) {
- if (entry->magic != SL_ENTRY_MAGIC) {
- printf("Bad magic: 0x%08lx (expected 0x%08lx)\n",
- list->magic, SL_ENTRY_MAGIC);
- }
- printf("\nEntry %p <0x%08lx, %p> has %2d levels\n",
- entry, entry->key, entry->value, entry->levels);
- for (i = 0; i < entry->levels; i++) {
- if (entry->forward[i]) {
- printf(" %2d: %p <0x%08lx, %p>\n",
- i,
- entry->forward[i],
- entry->forward[i]->key,
- entry->forward[i]->value);
- } else {
- printf(" %2d: %p\n", i, entry->forward[i]);
- }
- }
- }
-}
-
-#if SL_MAIN
-static void print(SkipListPtr list)
-{
- unsigned long key;
- void *value;
-
- if (N(SLFirst)(list, &key, &value)) {
- do {
- printf("key = %5lu, value = %p\n", key, value);
- } while (N(SLNext)(list, &key, &value));
- }
-}
-
-static double do_time(int size, int iter)
-{
- SkipListPtr list;
- int i, j;
- unsigned long keys[1000000];
- unsigned long previous;
- unsigned long key;
- void *value;
- struct timeval start, stop;
- double usec;
- SL_RANDOM_DECL;
-
- SL_RANDOM_INIT(12345);
-
- list = N(SLCreate)();
-
- for (i = 0; i < size; i++) {
- keys[i] = SL_RANDOM;
- N(SLInsert)(list, keys[i], NULL);
- }
-
- previous = 0;
- if (N(SLFirst)(list, &key, &value)) {
- do {
- if (key <= previous) {
- printf( "%lu !< %lu\n", previous, key);
- }
- previous = key;
- } while (N(SLNext)(list, &key, &value));
- }
-
- gettimeofday(&start, NULL);
- for (j = 0; j < iter; j++) {
- for (i = 0; i < size; i++) {
- if (N(SLLookup)(list, keys[i], &value))
- printf("Error %lu %d\n", keys[i], i);
- }
- }
- gettimeofday(&stop, NULL);
-
- usec = (double)(stop.tv_sec * 1000000 + stop.tv_usec
- - start.tv_sec * 1000000 - start.tv_usec) / (size * iter);
-
- printf("%0.2f microseconds for list length %d\n", usec, size);
-
- N(SLDestroy)(list);
-
- return usec;
-}
-
-static void print_neighbors(void *list, unsigned long key)
-{
- unsigned long prev_key = 0;
- unsigned long next_key = 0;
- void *prev_value;
- void *next_value;
- int retval;
-
- retval = drmSLLookupNeighbors(list, key,
- &prev_key, &prev_value,
- &next_key, &next_value);
- printf("Neighbors of %5lu: %d %5lu %5lu\n",
- key, retval, prev_key, next_key);
-}
-
-int main(void)
-{
- SkipListPtr list;
- double usec, usec2, usec3, usec4;
-
- list = N(SLCreate)();
- printf( "list at %p\n", list);
-
- print(list);
- printf("\n==============================\n\n");
-
- N(SLInsert)(list, 123, NULL);
- N(SLInsert)(list, 213, NULL);
- N(SLInsert)(list, 50, NULL);
- print(list);
- printf("\n==============================\n\n");
-
- print_neighbors(list, 0);
- print_neighbors(list, 50);
- print_neighbors(list, 51);
- print_neighbors(list, 123);
- print_neighbors(list, 200);
- print_neighbors(list, 213);
- print_neighbors(list, 256);
- printf("\n==============================\n\n");
-
- N(SLDelete)(list, 50);
- print(list);
- printf("\n==============================\n\n");
-
- N(SLDump)(list);
- N(SLDestroy)(list);
- printf("\n==============================\n\n");
-
- usec = do_time(100, 10000);
- usec2 = do_time(1000, 500);
- printf("Table size increased by %0.2f, search time increased by %0.2f\n",
- 1000.0/100.0, usec2 / usec);
-
- usec3 = do_time(10000, 50);
- printf("Table size increased by %0.2f, search time increased by %0.2f\n",
- 10000.0/100.0, usec3 / usec);
-
- usec4 = do_time(100000, 4);
- printf("Table size increased by %0.2f, search time increased by %0.2f\n",
- 100000.0/100.0, usec4 / usec);
-
- return 0;
-}
-#endif
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/bsdi/Imakefile b/xc/programs/Xserver/hw/xfree86/os-support/bsdi/Imakefile
index dff53fa05..880c9de96 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/bsdi/Imakefile
+++ b/xc/programs/Xserver/hw/xfree86/os-support/bsdi/Imakefile
@@ -1,4 +1,4 @@
-XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsdi/Imakefile,v 3.12 2000/06/27 14:27:29 tsi Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsdi/Imakefile,v 3.13 2000/08/15 16:05:37 dawes Exp $
@@ -13,12 +13,12 @@ MOUSEOBJ = bsdi_mouse.o
SRCS = bsdi_init.c bsdi_video.c bsdi_io.c bios_devmem.c \
VTsw_noop.c std_kbdEv.c posix_tty.c $(MOUSESRC) \
libc_wrapper.c stdResource.c stdPci.c sigiostubs.c pm_noop.c \
- kmod_noop.c
+ kmod_noop.c agp_noop.c
OBJS = bsdi_init.o bsdi_video.o bsdi_io.o bios_devmem.o \
VTsw_noop.o std_kbdEv.o posix_tty.o $(MOUSEOBJ) \
libc_wrapper.o stdResource.o stdPci.o sigiostubs.o pm_noop.o \
- kmod_noop.o
+ kmod_noop.o agp_noop.o
INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) -I. -I$(SERVERSRC)/include \
-I$(XINCLUDESRC) -I$(EXTINCSRC)
@@ -40,6 +40,7 @@ LinkSourceFile(stdPci.c,../shared)
LinkSourceFile(sigiostubs.c,../shared)
LinkSourceFile(pm_noop.c,../shared)
LinkSourceFile(kmod_noop.c,../shared)
+LinkSourceFile(agp_noop.c,../shared)
DependTarget()
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/cygwin/Imakefile b/xc/programs/Xserver/hw/xfree86/os-support/cygwin/Imakefile
index 8641a202d..ae2d668db 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/cygwin/Imakefile
+++ b/xc/programs/Xserver/hw/xfree86/os-support/cygwin/Imakefile
@@ -1,4 +1,4 @@
-XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/os-support/cygwin/Imakefile,v 1.1 2000/08/10 17:40:35 dawes Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/os-support/cygwin/Imakefile,v 1.2 2000/08/15 16:05:37 dawes Exp $
@@ -13,12 +13,12 @@ BIOS_MOD = bios_mmap
SRCS = cygwin_init.c ioperm_noop.c cygwin_io.c libc_wrapper.c cygwin_video.c \
posix_tty.c stdPci.c $(BIOS_MOD).c VTsw_noop.c \
stdResource.c sigiostubs.c std_kbdEv.c vidmem.c \
- stdResource.c stdPci.c sigiostubs.c pm_noop.c
+ stdResource.c stdPci.c sigiostubs.c pm_noop.c kmod_noop.c agp_noop.c
OBJS = cygwin_init.o ioperm_noop.o cygwin_io.o libc_wrapper.o cygwin_video.o \
posix_tty.o stdPci.o $(BIOS_MOD).o VTsw_noop.o \
stdResource.o sigiostubs.o std_kbdEv.o vidmem.o \
- stdResource.o stdPci.o sigiostubs.o pm_noop.o
+ stdResource.o stdPci.o sigiostubs.o pm_noop.o kmod_noop.o agp_noop.o
INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) -I. -I$(SERVERSRC)/include \
-I$(XINCLUDESRC)
@@ -30,18 +30,18 @@ SubdirLibraryRule($(OBJS))
NormalLibraryObjectRule()
NormalAsmObjectRule()
-ObjectFromSpecialSource(VTsw_noop,../shared/VTsw_noop,/**/)
-ObjectFromSpecialSource(posix_tty,../shared/posix_tty,/**?)
-ObjectFromSpecialSource(ioperm_noop,../shared/ioperm_noop,/**/)
-ObjectFromSpecialSource(stdPci,../shared/stdPci,/**/)
-ObjectFromSpecialSource(libc_wrapper,../shared/libc_wrapper,/**/)
-ObjectFromSpecialSource(sigiostubs,../shared/sigiostubs,/**/)
-ObjectFromSpecialSource(std_kbdEv,../shared/std_kbdEv,/**/)
-ObjectFromSpecialSource(vidmem,../shared/vidmem,/**/)
-ObjectFromSpecialSource(stdResource,../shared/stdResource,/**/)
-ObjectFromSpecialSource(pm_noop,../shared/pm_noop,/**/)
-
-
+LinkSourceFile(VTsw_noop.c,../shared)
+LinkSourceFile(posix_tty.c,../shared)
+LinkSourceFile(ioperm_noop.c,../shared)
+LinkSourceFile(stdPci.c,../shared)
+LinkSourceFile(libc_wrapper.c,../shared)
+LinkSourceFile(sigiostubs.c,../shared)
+LinkSourceFile(std_kbdEv.c,../shared)
+LinkSourceFile(vidmem.c,../shared)
+LinkSourceFile(stdResource.c,../shared)
+LinkSourceFile(pm_noop.c,../shared)
+LinkSourceFile(kmod_noop.c,../shared)
+LinkSourceFile(agp_noop.c,../shared)
DependTarget()
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/cygwin/cygwin_io.c b/xc/programs/Xserver/hw/xfree86/os-support/cygwin/cygwin_io.c
index 92a196522..f79d29b3c 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/cygwin/cygwin_io.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/cygwin/cygwin_io.c
@@ -24,7 +24,7 @@
* used in advertising or otherwise to promote the sale, use or other dealings
* in this Software without prior written authorization from Sebastien Marineau.
*
- * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/cygwin/cygwin_io.c,v 1.1 2000/08/10 17:40:35 dawes Exp $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/cygwin/cygwin_io.c,v 1.2 2000/08/23 21:06:21 dawes Exp $
*/
/* This module contains the qnx-specific functions to access the keyboard
@@ -45,11 +45,6 @@
#include "xf86_OSlib.h"
-void xf86KbdOn()
-{
-
- return;
-}
void
xf86SoundKbdBell(loudness, pitch, duration)
@@ -91,23 +86,12 @@ xf86KbdInit()
return;
}
-void
-xf86KbdOff()
-{
-
- return;
-}
-
void xf86MouseInit()
{
return;
}
-void OsVendorVErrorFProc()
-{
- return FALSE;
-}
void xf86ProtocolIDToName()
{
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/dgux/Imakefile b/xc/programs/Xserver/hw/xfree86/os-support/dgux/Imakefile
index 8d77cdc61..bd5c4c2de 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/dgux/Imakefile
+++ b/xc/programs/Xserver/hw/xfree86/os-support/dgux/Imakefile
@@ -1,15 +1,15 @@
-XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/os-support/dgux/Imakefile,v 1.6 2000/06/17 00:03:33 martin Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/os-support/dgux/Imakefile,v 1.7 2000/08/15 16:05:37 dawes Exp $
#include <Server.tmpl>
BIOS_MOD = bios_DGmmap
SRCS = dgux_init.c dgux_video.c IO_utils.c dgux_io.c $(BIOS_MOD).c VTsw_noop.c \
dgux_kbd.c dgux_kbdEv.c dgux_tty.c std_mouse.c std_mseEv.c \
- stdResource.c stdPci.c sigiostubs.c pm_noop.c kmod_noop.c
+ stdResource.c stdPci.c sigiostubs.c pm_noop.c kmod_noop.c agp_noop.c
OBJS = dgux_init.o dgux_video.o IO_utils.o dgux_io.o $(BIOS_MOD).o VTsw_noop.o \
dgux_kbd.o dgux_kbdEv.o dgux_tty.o std_mouse.o std_mseEv.o \
- stdResource.o stdPci.o sigiostubs.o pm_noop.o kmod_noop.o
+ stdResource.o stdPci.o sigiostubs.o pm_noop.o kmod_noop.o agp_noop.o
INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) -I. -I$(SERVERSRC)/include \
-I$(XINCLUDESRC) -I$(EXTINCSRC)
@@ -30,5 +30,6 @@ LinkSourceFile(stdPci.c,../shared)
LinkSourceFile(sigiostubs.c,../shared)
LinkSourceFile(pm_noop.c,../shared)
LinkSourceFile(kmod_noop.c,../shared)
+LinkSourceFile(agp_noop.c,../shared)
DependTarget()
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/hurd/Imakefile b/xc/programs/Xserver/hw/xfree86/os-support/hurd/Imakefile
index 8542e901f..0740c0c31 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/hurd/Imakefile
+++ b/xc/programs/Xserver/hw/xfree86/os-support/hurd/Imakefile
@@ -1,4 +1,4 @@
-XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/os-support/hurd/Imakefile,v 1.11 2000/06/27 14:27:30 tsi Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/os-support/hurd/Imakefile,v 1.12 2000/08/15 16:05:38 dawes Exp $
#include <Server.tmpl>
@@ -9,11 +9,11 @@ MOUSEOBJ = hurd_mouse.o
SRCS = hurd_init.c hurd_video.c hurd_io.c libc_wrapper.c $(BIOS_MOD).c \
VTsw_noop.c posix_tty.c std_kbdEv.c $(MOUSESRC) \
- stdResource.c stdPci.c sigiostubs.c pm_noop.c kmod_noop.c
+ stdResource.c stdPci.c sigiostubs.c pm_noop.c kmod_noop.c agp_noop.c
OBJS = hurd_init.o hurd_video.o hurd_io.o libc_wrapper.o $(BIOS_MOD).o \
VTsw_noop.o posix_tty.o std_kbdEv.o $(MOUSEOBJ) \
- stdResource.o stdPci.o sigiostubs.o pm_noop.o kmod_noop.o
+ stdResource.o stdPci.o sigiostubs.o pm_noop.o kmod_noop.o agp_noop.o
INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) -I. -I$(SERVERSRC)/include \
-I$(XINCLUDESRC) -I$(EXTINCSRC) -I$(SERVERSRC)/mi
@@ -35,6 +35,7 @@ LinkSourceFile(stdPci.c,../shared)
LinkSourceFile(sigiostubs.c,../shared)
LinkSourceFile(pm_noop.c,../shared)
LinkSourceFile(kmod_noop.c,../shared)
+LinkSourceFile(agp_noop.c,../shared)
DependTarget()
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/Imakefile b/xc/programs/Xserver/hw/xfree86/os-support/linux/Imakefile
index 122a9e374..45c93c4d6 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/Imakefile
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/Imakefile
@@ -1,5 +1,5 @@
XCOMM $XConsortium: Imakefile /main/10 1996/10/19 18:06:19 kaleb $
-XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/Imakefile,v 3.41 2000/06/27 14:27:30 tsi Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/Imakefile,v 3.42 2000/08/15 16:05:38 dawes Exp $
#include <Server.tmpl>
@@ -42,12 +42,12 @@ AXP_OBJ=lnx_ev56.o
SRCS = lnx_init.c lnx_video.c lnx_io.c libc_wrapper.c bios_mmap.c \
VTsw_usl.c std_kbdEv.c posix_tty.c $(MOUSESRC) \
lnx_pci.c vidmem.c lnx_apm.c $(JOYSTICK_SRC) $(DRI_SRC) $(RES_SRCS) \
- $(AXP_SRC) lnx_kmod.c
+ $(AXP_SRC) lnx_kmod.c lnx_agp.c
OBJS = lnx_init.o lnx_video.o lnx_io.o libc_wrapper.o bios_mmap.o \
VTsw_usl.o std_kbdEv.o posix_tty.o $(MOUSEOBJ) \
lnx_pci.o vidmem.o lnx_apm.o $(JOYSTICK_OBJ) $(DRI_OBJ) $(RES_OBJS) \
- $(AXP_OBJ) lnx_kmod.o
+ $(AXP_OBJ) lnx_kmod.o lnx_agp.o
INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) -I. -I$(SERVERSRC)/include \
-I$(XINCLUDESRC) -I$(EXTINCSRC)
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/agpgart.h b/xc/programs/Xserver/hw/xfree86/os-support/linux/agpgart.h
index a3d03d03e..b1bdac852 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/agpgart.h
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/agpgart.h
@@ -23,7 +23,7 @@
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/agpgart.h,v 1.3 2000/06/17 00:03:33 martin Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/agpgart.h,v 1.4 2000/08/26 04:30:56 dawes Exp $ */
#ifndef _AGP_H
#define _AGP_H 1
@@ -53,6 +53,7 @@
#ifndef __KERNEL__
#include <linux/types.h>
#include <asm/types.h>
+#include <sys/types.h>
typedef struct _agp_version {
__u16 major;
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/Makefile.kernel b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/Makefile.kernel
index b1b8d9768..0791af455 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/Makefile.kernel
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/Makefile.kernel
@@ -1,3 +1,4 @@
+# $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/Makefile.kernel,v 1.8 2000/08/28 02:43:14 tsi Exp $
#
# Makefile for the drm device driver. This driver provides support for
# the Direct Rendering Infrastructure (DRI) in XFree86 4.x.
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/Makefile.linux b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/Makefile.linux
index 7fe57f8e3..5f0465a43 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/Makefile.linux
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/Makefile.linux
@@ -24,7 +24,7 @@
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
#
-# $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/Makefile.linux,v 1.9 2000/08/04 03:51:47 tsi Exp $
+# $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/Makefile.linux,v 1.11 2000/09/01 02:31:38 tsi Exp $
#
# ***** NOTE NOTE NOTE NOTE NOTE *****
# To override the automatic Linux source tree determination, pass the
@@ -118,7 +118,9 @@ all:; @echo Error: Could not locate kernel tree in $A $B $C
else
SMP := $(shell gcc -E -nostdinc -I$(TREE) picker.c 2>/dev/null \
| grep -s 'SMP = ' | cut -d' ' -f3)
-MODVERSIONS := $(shell gcc -E -I $(TREE) picker.c 2>/dev/null \
+MODULES := $(shell gcc -E -nostdinc -I $(TREE) picker.c 2>/dev/null \
+ | grep -s 'MODULES = ' | cut -d' ' -f3)
+MODVERSIONS := $(shell gcc -E -nostdinc -I $(TREE) picker.c 2>/dev/null \
| grep -s 'MODVERSIONS = ' | cut -d' ' -f3)
AGP := $(shell gcc -E -nostdinc -I$(TREE) picker.c 2>/dev/null \
| grep -s 'AGP = ' | cut -d' ' -f3)
@@ -162,12 +164,20 @@ SISHEADERS= sis_drv.h sis_ds.h sis_drm.h $(DRMHEADERS)
endif
all::;@echo === KERNEL HEADERS IN $(TREE)
-all::;@echo === SMP=${SMP} MODVERSIONS=${MODVERSIONS} AGP=${AGP} SIS=${SIS}
+all::;@echo === SMP=${SMP} MODULES=${MODULES} MODVERSIONS=${MODVERSIONS} AGP=${AGP}
all::;@echo === kill_fasync has $(PARAMS) parameters
all::;@echo === Compiling for machine $(MACHINE)
+
+ifeq ($(MODULES),0)
+all::;@echo
+all::;@echo "*** Kernel modules must be configured. Build aborted."
+all::;@echo
+else
all:: $(LIBS) $(MODS) $(PROGS)
endif
+endif
+
# **** End of SMP/MODVERSIONS detection
# **** Handle SMP/MODVERSIONS
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/README.drm b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/README.drm
index 6441e01e5..97dd0d840 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/README.drm
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/README.drm
@@ -1,3 +1,5 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/README.drm,v 1.4 2000/08/28 02:43:14 tsi Exp $ */
+
************************************************************
* For the very latest on DRI development, please see: *
* http://dri.sourceforge.net/ *
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/agpsupport.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/agpsupport.c
index 24fd59cdf..c63f690c9 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/agpsupport.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/agpsupport.c
@@ -28,6 +28,8 @@
*
*/
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/agpsupport.c,v 1.4 2000/08/28 02:43:14 tsi Exp $ */
+
#define __NO_VERSION__
#include "drmP.h"
#include <linux/module.h>
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/auth.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/auth.c
index 80bb4b651..ad719cf1c 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/auth.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/auth.c
@@ -28,6 +28,7 @@
* Rickard E. (Rik) Faith <faith@valinux.com>
*
*/
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/auth.c,v 1.5 2000/08/28 02:43:14 tsi Exp $ */
#define __NO_VERSION__
#include "drmP.h"
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/bufs.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/bufs.c
index 28e0eb5f1..679a096f9 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/bufs.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/bufs.c
@@ -28,6 +28,7 @@
* Rickard E. (Rik) Faith <faith@valinux.com>
*
*/
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/bufs.c,v 1.8 2000/08/28 02:43:14 tsi Exp $ */
#define __NO_VERSION__
#include <linux/config.h>
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm.h b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm.h
index 5a979e1cb..6cfe88fa7 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm.h
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm.h
@@ -31,11 +31,16 @@
* Dec 1999, Richard Henderson <rth@twiddle.net>, move to generic cmpxchg.
*
*/
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm.h,v 1.9 2000/08/24 22:20:18 tsi Exp $ */
#ifndef _DRM_H_
#define _DRM_H_
+#if defined(__linux__)
#include <asm/ioctl.h> /* For _IO* macros */
+#elif defined(__FreeBSD__)
+#include <sys/ioccom.h>
+#endif
#define DRM_PROC_DEVICES "/proc/devices"
#define DRM_PROC_MISC "/proc/misc"
@@ -289,7 +294,11 @@ typedef struct drm_agp_info {
} drm_agp_info_t;
#define DRM_IOCTL_BASE 'd'
+#if defined(__linux__)
#define DRM_IOCTL_NR(n) _IOC_NR(n)
+#elif defined(__FreeBSD__)
+#define DRM_IOCTL_NR(n) ((n) & 0xff)
+#endif
#define DRM_IO(nr) _IO(DRM_IOCTL_BASE,nr)
#define DRM_IOR(nr,size) _IOR(DRM_IOCTL_BASE,nr,size)
#define DRM_IOW(nr,size) _IOW(DRM_IOCTL_BASE,nr,size)
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drmP.h b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drmP.h
index 2bfd4befa..bfd124dd7 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drmP.h
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drmP.h
@@ -28,6 +28,7 @@
* Rickard E. (Rik) Faith <faith@valinux.com>
*
*/
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drmP.h,v 1.9 2000/08/28 02:43:14 tsi Exp $ */
#ifndef _DRM_P_H_
#define _DRM_P_H_
@@ -152,6 +153,11 @@ typedef struct wait_queue *wait_queue_head_t;
#define module_exit(x) void cleanup_module(void) { x(); }
#endif
+ /* virt_to_page added in 2.4.0-test6 */
+#if LINUX_VERSION_CODE < 0x020400
+#define virt_to_page(kaddr) (mem_map + MAP_NR(kaddr))
+#endif
+
/* Generic cmpxchg added in 2.3.x */
#ifndef __HAVE_ARCH_CMPXCHG
/* Include this here so that driver can be
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/fops.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/fops.c
index 8e373e5ad..e6110a34f 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/fops.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/fops.c
@@ -29,6 +29,7 @@
* Daryll Strauss <daryll@valinux.com>
*
*/
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/fops.c,v 1.9 2000/08/28 02:43:14 tsi Exp $ */
#define __NO_VERSION__
#include "drmP.h"
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/gamma_drv.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/gamma_drv.c
index dba974c2b..44dded04e 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/gamma_drv.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/gamma_drv.c
@@ -28,6 +28,7 @@
* Rickard E. (Rik) Faith <faith@valinux.com>
*
*/
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/gamma_drv.c,v 1.8 2000/08/28 02:43:14 tsi Exp $ */
#include <linux/config.h>
#include "drmP.h"
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/gamma_drv.h b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/gamma_drv.h
index e9ce39589..f8bbe0779 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/gamma_drv.h
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/gamma_drv.h
@@ -28,6 +28,7 @@
* Rickard E. (Rik) Faith <faith@valinux.com>
*
*/
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/gamma_drv.h,v 1.6 2000/08/28 02:43:15 tsi Exp $ */
#ifndef _GAMMA_DRV_H_
#define _GAMMA_DRV_H_
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_context.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_context.c
index c331beed6..259c2991a 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_context.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_context.c
@@ -28,6 +28,7 @@
* Jeff Hartmann <jhartmann@valinux.com>
*
*/
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_context.c,v 1.3 2000/08/28 02:43:15 tsi Exp $ */
#define __NO_VERSION__
#include "drmP.h"
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_dma.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_dma.c
index e2a866068..8a279be8a 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_dma.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_dma.c
@@ -29,6 +29,7 @@
* Keith Whitwell <keithw@valinux.com>
*
*/
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_dma.c,v 1.6 2000/08/28 02:43:15 tsi Exp $ */
#define __NO_VERSION__
#include "drmP.h"
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_drv.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_drv.c
index 86d5e2302..a001b5440 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_drv.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_drv.c
@@ -28,6 +28,7 @@
* Jeff Hartmann <jhartmann@valinux.com>
*
*/
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_drv.c,v 1.5 2000/08/28 02:43:15 tsi Exp $ */
#include <linux/config.h>
#include "drmP.h"
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_drv.h b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_drv.h
index 1c9574017..9f46be501 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_drv.h
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_drv.h
@@ -28,6 +28,7 @@
* Jeff Hartmann <jhartmann@valinux.com>
*
*/
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_drv.h,v 1.5 2000/08/28 02:43:15 tsi Exp $ */
#ifndef _I810_DRV_H_
#define _I810_DRV_H_
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/init.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/init.c
index 8de3dac9b..81cbd8fff 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/init.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/init.c
@@ -28,6 +28,7 @@
* Rickard E. (Rik) Faith <faith@valinux.com>
*
*/
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/init.c,v 1.5 2000/08/28 02:43:15 tsi Exp $ */
#define __NO_VERSION__
#include "drmP.h"
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/lists.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/lists.c
index 5da7cc6c5..0a21a9106 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/lists.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/lists.c
@@ -28,6 +28,7 @@
* Rickard E. (Rik) Faith <faith@valinux.com>
*
*/
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/lists.c,v 1.9 2000/08/28 02:43:15 tsi Exp $ */
#define __NO_VERSION__
#include "drmP.h"
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/memory.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/memory.c
index 34d19b203..36d424fdc 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/memory.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/memory.c
@@ -28,6 +28,7 @@
* Rickard E. (Rik) Faith <faith@valinux.com>
*
*/
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/memory.c,v 1.8 2000/08/28 02:43:15 tsi Exp $ */
#define __NO_VERSION__
#include <linux/config.h>
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mga_context.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mga_context.c
index 43733c140..36f23420b 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mga_context.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mga_context.c
@@ -28,6 +28,7 @@
* Jeff Hartmann <jhartmann@valinux.com>
*
*/
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mga_context.c,v 1.4 2000/08/28 02:43:15 tsi Exp $ */
#define __NO_VERSION__
#include "drmP.h"
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mga_dma.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mga_dma.c
index 4daa03acb..a718939b8 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mga_dma.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mga_dma.c
@@ -29,6 +29,7 @@
* Keith Whitwell <keithw@valinux.com>
*
*/
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mga_dma.c,v 1.5 2000/08/28 02:43:15 tsi Exp $ */
#define __NO_VERSION__
#include "drmP.h"
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mga_drv.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mga_drv.c
index c551ba6ef..70d5d89fc 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mga_drv.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mga_drv.c
@@ -29,6 +29,7 @@
*
*
*/
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mga_drv.c,v 1.4 2000/08/28 02:43:15 tsi Exp $ */
#include <linux/config.h>
#include "drmP.h"
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mga_drv.h b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mga_drv.h
index 6feba09a6..f7f70538a 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mga_drv.h
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mga_drv.h
@@ -28,6 +28,7 @@
* Jeff Hartmann <jhartmann@valinux.com>
*
*/
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mga_drv.h,v 1.4 2000/08/28 02:43:15 tsi Exp $ */
#ifndef _MGA_DRV_H_
#define _MGA_DRV_H_
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mga_state.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mga_state.c
index 0c2f57299..5bdc0684c 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mga_state.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mga_state.c
@@ -28,6 +28,7 @@
* Keith Whitwell <keithw@valinux.com>
*
*/
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mga_state.c,v 1.5 2000/08/28 02:43:15 tsi Exp $ */
#define __NO_VERSION__
#include "drmP.h"
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/picker.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/picker.c
index 6053a9477..492e53501 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/picker.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/picker.c
@@ -1,10 +1,16 @@
-#include <linux/config.h>
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/picker.c,v 1.3 2000/09/01 02:31:40 tsi Exp $ */
+
+#include <linux/autoconf.h>
#include <linux/version.h>
#ifndef CONFIG_SMP
#define CONFIG_SMP 0
#endif
+#ifndef CONFIG_MODULES
+#define CONFIG_MODULES 0
+#endif
+
#ifndef CONFIG_MODVERSIONS
#define CONFIG_MODVERSIONS 0
#endif
@@ -22,6 +28,7 @@
#endif
SMP = CONFIG_SMP
+MODULES = CONFIG_MODULES
MODVERSIONS = CONFIG_MODVERSIONS
AGP = CONFIG_AGP
AGP_MODULE = CONFIG_AGP_MODULE
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/proc.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/proc.c
index ca062a09b..f585e9155 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/proc.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/proc.c
@@ -27,6 +27,7 @@
* Authors:
* Rickard E. (Rik) Faith <faith@valinux.com>
*/
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/proc.c,v 1.9 2000/08/28 02:43:15 tsi Exp $ */
#define __NO_VERSION__
#include "drmP.h"
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_bufs.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_bufs.c
index 7e76441ee..1712aa55b 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_bufs.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_bufs.c
@@ -29,6 +29,7 @@
* Jeff Hartmann <jhartmann@valinux.com>
*
*/
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_bufs.c,v 1.3 2000/08/28 02:43:16 tsi Exp $ */
#define __NO_VERSION__
#include <linux/config.h>
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_context.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_context.c
index 9cadadbaf..9ac4ad86b 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_context.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_context.c
@@ -27,6 +27,7 @@
* Author: Rickard E. (Rik) Faith <faith@valinux.com>
*
*/
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_context.c,v 1.3 2000/08/28 02:43:16 tsi Exp $ */
#define __NO_VERSION__
#include "drmP.h"
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_drv.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_drv.c
index b58dcf066..8d4a37055 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_drv.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_drv.c
@@ -28,6 +28,7 @@
* Kevin E. Martin <martin@valinux.com>
*
*/
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_drv.c,v 1.3 2000/08/28 02:43:16 tsi Exp $ */
#include <linux/config.h>
#include "drmP.h"
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_drv.h b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_drv.h
index da2f676d3..dbb9ddcbe 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_drv.h
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_drv.h
@@ -28,6 +28,7 @@
* Kevin E. Martin <martin@valinux.com>
*
*/
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_drv.h,v 1.4 2000/08/28 02:43:16 tsi Exp $ */
#ifndef _R128_DRV_H_
#define _R128_DRV_H_
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_context.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_context.c
index cabd3868b..e13bd8531 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_context.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_context.c
@@ -2,6 +2,7 @@
* Created: Thu Oct 7 10:50:22 1999 by faith@precisioninsight.com
*
* Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -24,12 +25,12 @@
* DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Rickard E. (Rik) Faith <faith@precisioninsight.com>
- *
+ * Rickard E. (Rik) Faith <faith@valinux.com>
+ * Daryll Strauss <daryll@valinux.com>
+ * Sung-Ching Lin <sclin@sis.com.tw>
+ *
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_context.c,v 1.2 2000/08/04 03:51:47 tsi Exp $ */
-
-#include <linux/sched.h>
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_context.c,v 1.3 2000/09/22 11:35:47 alanh Exp $ */
#define __NO_VERSION__
#include "drmP.h"
@@ -39,9 +40,7 @@ extern drm_ctx_t sis_res_ctx;
static int sis_alloc_queue(drm_device_t *dev)
{
- static int context = 0;
-
- return ++context; /* Should this reuse contexts in the future? */
+ return drm_ctxbitmap_next(dev);
}
int sis_context_switch(drm_device_t *dev, int old, int new)
@@ -138,10 +137,15 @@ int sis_addctx(struct inode *inode, struct file *filp, unsigned int cmd,
ctx.handle = sis_alloc_queue(dev);
}
DRM_DEBUG("%d\n", ctx.handle);
-
+ if (ctx.handle == -1) {
+ DRM_DEBUG("Not enough free contexts.\n");
+ /* Should this return -EBUSY instead? */
+ return -ENOMEM;
+ }
+
/* new added */
sis_init_context(ctx.handle);
-
+
copy_to_user_ret((drm_ctx_t *)arg, &ctx, sizeof(ctx), -EFAULT);
return 0;
}
@@ -198,16 +202,13 @@ int sis_newctx(struct inode *inode, struct file *filp, unsigned int cmd,
int sis_rmctx(struct inode *inode, struct file *filp, unsigned int cmd,
unsigned long arg)
{
+ drm_file_t *priv = filp->private_data;
+ drm_device_t *dev = priv->dev;
drm_ctx_t ctx;
copy_from_user_ret(&ctx, (drm_ctx_t *)arg, sizeof(ctx), -EFAULT);
DRM_DEBUG("%d\n", ctx.handle);
- /* This is currently a noop because we
- don't reuse context values. Perhaps we
- should? */
-
- /* new added */
- sis_final_context(ctx.handle);
+ drm_ctxbitmap_free(dev, ctx.handle);
return 0;
}
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_drv.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_drv.c
index 06ae79889..0b1990b0b 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_drv.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_drv.c
@@ -1,6 +1,7 @@
/* sis.c -- sis driver -*- linux-c -*-
*
- * Copyright 1999, 2000 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -23,6 +24,7 @@
* DEALINGS IN THE SOFTWARE.
*
*/
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_drv.c,v 1.5 2000/09/22 11:35:47 alanh Exp $ */
#include <linux/config.h>
#include "drmP.h"
@@ -30,16 +32,20 @@
#include "sis_drv.h"
#define SIS_NAME "sis"
-#define SIS_DESC "sis"
-#define SIS_DATE "19991009"
-#define SIS_MAJOR 0
+#define SIS_DESC "SIS 300/630/540"
+#define SIS_DATE "20000831"
+#define SIS_MAJOR 1
#define SIS_MINOR 0
-#define SIS_PATCHLEVEL 1
+#define SIS_PATCHLEVEL 0
static drm_device_t sis_device;
drm_ctx_t sis_res_ctx;
static struct file_operations sis_fops = {
+#if LINUX_VERSION_CODE >= 0x020400
+ /* This started being used during 2.4.0-test */
+ owner: THIS_MODULE,
+#endif
open: sis_open,
flush: drm_flush,
release: sis_release,
@@ -65,14 +71,14 @@ static drm_ioctl_desc_t sis_ioctls[] = {
[DRM_IOCTL_NR(DRM_IOCTL_SET_UNIQUE)] = { drm_setunique, 1, 1 },
[DRM_IOCTL_NR(DRM_IOCTL_BLOCK)] = { drm_block, 1, 1 },
[DRM_IOCTL_NR(DRM_IOCTL_UNBLOCK)] = { drm_unblock, 1, 1 },
-
[DRM_IOCTL_NR(DRM_IOCTL_AUTH_MAGIC)] = { drm_authmagic, 1, 1 },
[DRM_IOCTL_NR(DRM_IOCTL_ADD_MAP)] = { drm_addmap, 1, 1 },
+
[DRM_IOCTL_NR(DRM_IOCTL_ADD_CTX)] = { sis_addctx, 1, 1 },
[DRM_IOCTL_NR(DRM_IOCTL_RM_CTX)] = { sis_rmctx, 1, 1 },
[DRM_IOCTL_NR(DRM_IOCTL_MOD_CTX)] = { sis_modctx, 1, 1 },
[DRM_IOCTL_NR(DRM_IOCTL_GET_CTX)] = { sis_getctx, 1, 0 },
- [DRM_IOCTL_NR(DRM_IOCTL_SWITCH_CTX)] = { sis_switchctx, 1, 1 },
+ [DRM_IOCTL_NR(DRM_IOCTL_SWITCH_CTX)] = { sis_switchctx, 1, 1 },
[DRM_IOCTL_NR(DRM_IOCTL_NEW_CTX)] = { sis_newctx, 1, 1 },
[DRM_IOCTL_NR(DRM_IOCTL_RES_CTX)] = { sis_resctx, 1, 0 },
[DRM_IOCTL_NR(DRM_IOCTL_ADD_DRAW)] = { drm_adddraw, 1, 1 },
@@ -80,18 +86,16 @@ static drm_ioctl_desc_t sis_ioctls[] = {
[DRM_IOCTL_NR(DRM_IOCTL_LOCK)] = { sis_lock, 1, 0 },
[DRM_IOCTL_NR(DRM_IOCTL_UNLOCK)] = { sis_unlock, 1, 0 },
[DRM_IOCTL_NR(DRM_IOCTL_FINISH)] = { drm_finish, 1, 0 },
-
-#ifdef DRM_AGP
- [DRM_IOCTL_NR(DRM_IOCTL_AGP_ACQUIRE)] = { drm_agp_acquire, 1, 1 },
- [DRM_IOCTL_NR(DRM_IOCTL_AGP_RELEASE)] = { drm_agp_release, 1, 1 },
- [DRM_IOCTL_NR(DRM_IOCTL_AGP_ENABLE)] = { drm_agp_enable, 1, 1 },
- [DRM_IOCTL_NR(DRM_IOCTL_AGP_INFO)] = { drm_agp_info, 1, 0 },
- [DRM_IOCTL_NR(DRM_IOCTL_AGP_ALLOC)] = { drm_agp_alloc, 1, 1 },
- [DRM_IOCTL_NR(DRM_IOCTL_AGP_FREE)] = { drm_agp_free, 1, 1 },
- [DRM_IOCTL_NR(DRM_IOCTL_AGP_BIND)] = { drm_agp_bind, 1, 1 },
- [DRM_IOCTL_NR(DRM_IOCTL_AGP_UNBIND)] = { drm_agp_unbind, 1, 1 },
+#if defined(CONFIG_AGP) || defined(CONFIG_AGP_MODULE)
+ [DRM_IOCTL_NR(DRM_IOCTL_AGP_ACQUIRE)] = {drm_agp_acquire, 1, 1},
+ [DRM_IOCTL_NR(DRM_IOCTL_AGP_RELEASE)] = {drm_agp_release, 1, 1},
+ [DRM_IOCTL_NR(DRM_IOCTL_AGP_ENABLE)] = {drm_agp_enable, 1, 1},
+ [DRM_IOCTL_NR(DRM_IOCTL_AGP_INFO)] = {drm_agp_info, 1, 1},
+ [DRM_IOCTL_NR(DRM_IOCTL_AGP_ALLOC)] = {drm_agp_alloc, 1, 1},
+ [DRM_IOCTL_NR(DRM_IOCTL_AGP_FREE)] = {drm_agp_free, 1, 1},
+ [DRM_IOCTL_NR(DRM_IOCTL_AGP_BIND)] = {drm_agp_bind, 1, 1},
+ [DRM_IOCTL_NR(DRM_IOCTL_AGP_UNBIND)] = {drm_agp_unbind, 1, 1},
#endif
-
/* FB Memory Management */
[DRM_IOCTL_NR(SIS_IOCTL_FB_ALLOC)] = { sis_fb_alloc, 1, 1 },
[DRM_IOCTL_NR(SIS_IOCTL_FB_FREE)] = { sis_fb_free, 1, 1 },
@@ -114,10 +118,25 @@ static drm_ioctl_desc_t sis_ioctls[] = {
static char *sis = NULL;
#endif
-MODULE_AUTHOR("Precision Insight, Inc., Cedar Park, Texas.");
+MODULE_AUTHOR("VA Linux Systems, Inc.");
MODULE_DESCRIPTION("sis");
MODULE_PARM(sis, "s");
+#ifndef MODULE
+/* sis_options is called by the kernel to parse command-line options
+ * passed via the boot-loader (e.g., LILO). It calls the insmod option
+ * routine, drm_parse_drm.
+ */
+
+static int __init sis_options(char *str)
+{
+ drm_parse_options(str);
+ return 1;
+}
+
+__setup("sis=", sis_options);
+#endif
+
static int sis_setup(drm_device_t *dev)
{
int i;
@@ -219,30 +238,22 @@ static int sis_takedown(drm_device_t *dev)
}
dev->magiclist[i].head = dev->magiclist[i].tail = NULL;
}
-#ifdef DRM_AGP
- /* Clear AGP information */
+#if defined(CONFIG_AGP) || defined(CONFIG_AGP_MODULE)
+ /* Clear AGP information */
if (dev->agp) {
- drm_agp_mem_t *entry;
- drm_agp_mem_t *nexte;
-
- /* Remove AGP resources, but leave dev->agp
- intact until cleanup is called. */
- for (entry = dev->agp->memory; entry; entry = nexte) {
- nexte = entry->next;
- if (entry->bound) drm_unbind_agp(entry->memory);
- drm_free_agp(entry->memory, entry->pages);
- drm_free(entry, sizeof(*entry), DRM_MEM_AGPLISTS);
+ drm_agp_mem_t *temp;
+ drm_agp_mem_t *temp_next;
+
+ temp = dev->agp->memory;
+ while(temp != NULL) {
+ temp_next = temp->next;
+ drm_free_agp(temp->memory, temp->pages);
+ drm_free(temp, sizeof(*temp), DRM_MEM_AGPLISTS);
+ temp = temp_next;
}
- dev->agp->memory = NULL;
-
- if (dev->agp->acquired && drm_agp.release)
- (*drm_agp.release)();
-
- dev->agp->acquired = 0;
- dev->agp->enabled = 0;
- }
+ if (dev->agp->acquired) (*drm_agp.release)();
+ }
#endif
-
/* Clear vma list (only built for debugging) */
if (dev->vmalist) {
for (vma = dev->vmalist; vma; vma = vma_next) {
@@ -303,7 +314,7 @@ static int sis_takedown(drm_device_t *dev)
/* sis_init is called via init_module at module load time, or via
* linux/init/main.c (this is not currently supported). */
-int sis_init(void)
+static int sis_init(void)
{
int retcode;
drm_device_t *dev = &sis_device;
@@ -327,27 +338,16 @@ int sis_init(void)
drm_mem_init();
drm_proc_init(dev);
-
-#ifdef DRM_AGP
- DRM_DEBUG("doing agp init\n");
+#if defined(CONFIG_AGP) || defined(CONFIG_AGP_MODULE)
dev->agp = drm_agp_init();
- if(dev->agp == NULL) {
- /* TODO, if no agp, run MMIO mode */
- DRM_INFO("The sis drm module requires the agpgart module"
- " to function correctly\nPlease load the agpgart"
- " module before you load the mga module\n");
- drm_proc_cleanup();
- misc_deregister(&sis_misc);
- sis_takedown(dev);
- return -ENOMEM;
- }
-#ifdef CONFIG_MTRR
- dev->agp->agp_mtrr = mtrr_add(dev->agp->agp_info.aper_base,
- dev->agp->agp_info.aper_size * 1024 * 1024,
- MTRR_TYPE_WRCOMB,
- 1);
-#endif
#endif
+ if((retcode = drm_ctxbitmap_init(dev))) {
+ DRM_ERROR("Cannot allocate memory for context bitmap.\n");
+ drm_proc_cleanup();
+ misc_deregister(&sis_misc);
+ sis_takedown(dev);
+ return retcode;
+ }
DRM_INFO("Initialized %s %d.%d.%d %s on minor %d\n",
SIS_NAME,
@@ -362,7 +362,7 @@ int sis_init(void)
/* sis_cleanup is called via cleanup_module at module unload time. */
-void sis_cleanup(void)
+static void sis_cleanup(void)
{
drm_device_t *dev = &sis_device;
@@ -374,27 +374,21 @@ void sis_cleanup(void)
} else {
DRM_INFO("Module unloaded\n");
}
-#ifdef DRM_AGP
-#ifdef CONFIG_MTRR
- if(dev->agp && dev->agp->agp_mtrr) {
- int retval;
- retval = mtrr_del(dev->agp->agp_mtrr,
- dev->agp->agp_info.aper_base,
- dev->agp->agp_info.aper_size * 1024*1024);
- DRM_DEBUG("mtrr_del = %d\n", retval);
- }
-#endif
-#endif
-
+ drm_ctxbitmap_cleanup(dev);
sis_takedown(dev);
-#ifdef DRM_AGP
+#if defined(CONFIG_AGP) || defined(CONFIG_AGP_MODULE)
if (dev->agp) {
+ drm_agp_uninit();
drm_free(dev->agp, sizeof(*dev->agp), DRM_MEM_AGPLISTS);
dev->agp = NULL;
}
#endif
}
+module_init(sis_init);
+module_exit(sis_cleanup);
+
+
int sis_version(struct inode *inode, struct file *filp, unsigned int cmd,
unsigned long arg)
{
@@ -433,11 +427,12 @@ int sis_open(struct inode *inode, struct file *filp)
{
drm_device_t *dev = &sis_device;
int retcode = 0;
-
+
DRM_DEBUG("open_count = %d\n", dev->open_count);
-
if (!(retcode = drm_open_helper(inode, filp, dev))) {
- MOD_INC_USE_COUNT;
+#if LINUX_VERSION_CODE < 0x020333
+ MOD_INC_USE_COUNT; /* Needed before Linux 2.3.51 */
+#endif
atomic_inc(&dev->total_open);
spin_lock(&dev->count_lock);
if (!dev->open_count++) {
@@ -452,13 +447,17 @@ int sis_open(struct inode *inode, struct file *filp)
int sis_release(struct inode *inode, struct file *filp)
{
drm_file_t *priv = filp->private_data;
- drm_device_t *dev = priv->dev;
+ drm_device_t *dev;
int retcode = 0;
- DRM_DEBUG("open_count = %d\n", dev->open_count);
+ lock_kernel();
+ dev = priv->dev;
+ DRM_DEBUG("open_count = %d\n", dev->open_count);
if (!(retcode = drm_release(inode, filp))) {
- MOD_DEC_USE_COUNT;
+#if LINUX_VERSION_CODE < 0x020333
+ MOD_DEC_USE_COUNT; /* Needed before Linux 2.3.51 */
+#endif
atomic_inc(&dev->total_close);
spin_lock(&dev->count_lock);
if (!--dev->open_count) {
@@ -467,13 +466,17 @@ int sis_release(struct inode *inode, struct file *filp)
atomic_read(&dev->ioctl_count),
dev->blocked);
spin_unlock(&dev->count_lock);
+ unlock_kernel();
return -EBUSY;
}
spin_unlock(&dev->count_lock);
+ unlock_kernel();
return sis_takedown(dev);
}
spin_unlock(&dev->count_lock);
}
+
+ unlock_kernel();
return retcode;
}
@@ -588,7 +591,9 @@ int sis_lock(struct inode *inode, struct file *filp, unsigned int cmd,
/* Contention */
atomic_inc(&dev->total_sleeps);
current->state = TASK_INTERRUPTIBLE;
+#if 1
current->policy |= SCHED_YIELD;
+#endif
schedule();
if (signal_pending(current)) {
ret = -ERESTARTSYS;
@@ -689,21 +694,3 @@ int sis_unlock(struct inode *inode, struct file *filp, unsigned int cmd,
unblock_all_signals();
return 0;
}
-
-module_init(sis_init);
-module_exit(sis_cleanup);
-
-#ifndef MODULE
-/*
- * sis_setup is called by the kernel to parse command-line options passed
- * via the boot-loader (e.g., LILO). It calls the insmod option routine,
- * drm_parse_options.
- */
-static int __init sis_options(char *str)
-{
- drm_parse_options(str);
- return 1;
-}
-
-__setup("sis=", sis_options);
-#endif
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_drv.h b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_drv.h
index 24523b8f1..8dd25e0aa 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_drv.h
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_drv.h
@@ -1,6 +1,7 @@
/* sis_drv.h -- Private header for sis driver -*- linux-c -*-
*
* Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -23,15 +24,12 @@
* DEALINGS IN THE SOFTWARE.
*
*/
-
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_drv.h,v 1.2 2000/08/04 03:51:47 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_drv.h,v 1.3 2000/09/22 11:35:47 alanh Exp $ */
#ifndef _SIS_DRV_H_
#define _SIS_DRV_H_
/* sis_drv.c */
-extern int sis_init(void);
-extern void sis_cleanup(void);
extern int sis_version(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg);
extern int sis_open(struct inode *inode, struct file *filp);
@@ -72,7 +70,6 @@ int sis_fb_alloc(struct inode *inode, struct file *filp, unsigned int cmd,
int sis_fb_free(struct inode *inode, struct file *filp, unsigned int cmd,
unsigned long arg);
-
int sis_agp_init(struct inode *inode, struct file *filp, unsigned int cmd,
unsigned long arg);
int sis_agp_alloc(struct inode *inode, struct file *filp, unsigned int cmd,
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_ds.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_ds.c
index 592722c7d..a946a41f1 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_ds.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_ds.c
@@ -1,3 +1,34 @@
+/* sis_ds.c -- Private header for Direct Rendering Manager -*- linux-c -*-
+ * Created: Mon Jan 4 10:05:05 1999 by sclin@sis.com.tw
+ *
+ * Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan.
+ * All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Authors:
+ * Sung-Ching Lin <sclin@sis.com.tw>
+ *
+ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_ds.c,v 1.2 2000/09/22 11:35:47 alanh Exp $ */
+
#define __NO_VERSION__
#include <linux/module.h>
#include <linux/delay.h>
@@ -132,7 +163,7 @@ int setDestroy(set_t *set)
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_ds.c,v 1.1 2000/08/01 20:52:27 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_ds.c,v 1.2 2000/09/22 11:35:47 alanh Exp $ */
#define ISFREE(bptr) ((bptr)->free)
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_ds.h b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_ds.h
index 87a8b03db..59d58b8c6 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_ds.h
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_ds.h
@@ -1,4 +1,33 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_ds.h,v 1.2 2000/08/04 03:51:47 tsi Exp $ */
+/* sis_ds.h -- Private header for Direct Rendering Manager -*- linux-c -*-
+ * Created: Mon Jan 4 10:05:05 1999 by sclin@sis.com.tw
+ *
+ * Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan.
+ * All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Authors:
+ * Sung-Ching Lin <sclin@sis.com.tw>
+ *
+ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_ds.h,v 1.3 2000/09/22 11:35:47 alanh Exp $ */
#ifndef _sis_ds_h_
#define _sis_ds_h_
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_mm.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_mm.c
index 333b5196e..f60da7811 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_mm.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_mm.c
@@ -1,4 +1,33 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_mm.c,v 1.2 2000/08/04 03:51:48 tsi Exp $ */
+/* sis_mm.c -- Private header for Direct Rendering Manager -*- linux-c -*-
+ * Created: Mon Jan 4 10:05:05 1999 by sclin@sis.com.tw
+ *
+ * Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan.
+ * All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Authors:
+ * Sung-Ching Lin <sclin@sis.com.tw>
+ *
+ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_mm.c,v 1.4 2000/09/22 11:35:47 alanh Exp $ */
#define __NO_VERSION__
#include "drmP.h"
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/tdfx_context.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/tdfx_context.c
index 1fd733100..9c07ed87a 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/tdfx_context.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/tdfx_context.c
@@ -29,6 +29,7 @@
* Daryll Strauss <daryll@valinux.com>
*
*/
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/tdfx_context.c,v 1.5 2000/08/28 02:43:16 tsi Exp $ */
#define __NO_VERSION__
#include "drmP.h"
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/tdfx_drv.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/tdfx_drv.c
index 2026e9d07..689b360ac 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/tdfx_drv.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/tdfx_drv.c
@@ -29,6 +29,7 @@
* Daryll Strauss <daryll@valinux.com>
*
*/
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/tdfx_drv.c,v 1.6 2000/08/28 02:43:16 tsi Exp $ */
#include <linux/config.h>
#include "drmP.h"
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/tdfx_drv.h b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/tdfx_drv.h
index bee840e19..e6ec7aa45 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/tdfx_drv.h
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/tdfx_drv.h
@@ -29,6 +29,7 @@
* Daryll Strauss <daryll@valinux.com>
*
*/
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/tdfx_drv.h,v 1.5 2000/08/28 02:43:16 tsi Exp $ */
#ifndef _TDFX_DRV_H_
#define _TDFX_DRV_H_
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/vm.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/vm.c
index 7c5a24bc9..074e75d94 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/vm.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/vm.c
@@ -28,6 +28,7 @@
* Rickard E. (Rik) Faith <faith@valinux.com>
*
*/
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/vm.c,v 1.8 2000/08/28 02:43:16 tsi Exp $ */
#define __NO_VERSION__
#include "drmP.h"
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drm.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drm.c
index c561f01f3..c933f5935 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drm.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drm.c
@@ -27,7 +27,7 @@
* Authors: Rickard E. (Rik) Faith <faith@valinux.com>
* Kevin E. Martin <martin@valinux.com>
*
- * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drm.c,v 1.15 2000/08/09 14:44:27 alanh Exp $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drm.c,v 1.16 2000/08/28 16:55:52 dawes Exp $
*
*/
@@ -597,7 +597,15 @@ int drmMap(int fd,
drmSize size,
drmAddressPtr address)
{
+ static unsigned long pagesize_mask = 0;
+
if (fd < 0) return -EINVAL;
+
+ if (!pagesize_mask)
+ pagesize_mask = getpagesize() - 1;
+
+ size = (size + pagesize_mask) & ~pagesize_mask;
+
*address = mmap(0, size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, handle);
if (*address == MAP_FAILED) return -errno;
return 0;
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmI810.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmI810.c
index b2489eeed..d5a7e2263 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmI810.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmI810.c
@@ -1,3 +1,5 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmI810.c,v 1.3 2000/08/24 22:20:17 tsi Exp $ */
+
#ifdef XFree86Server
# include "xf86.h"
# include "xf86_OSproc.h"
@@ -40,7 +42,9 @@ extern int xf86RemoveSIGIOHandler(int fd);
#define MAP_FAILED ((void *)-1)
#endif
+#ifdef __linux__
#include <sys/sysmacros.h> /* for makedev() */
+#endif
#include "xf86drm.h"
#include "xf86drmI810.h"
#include "drm.h"
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmMga.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmMga.c
index 5957ffe33..d566b0868 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmMga.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmMga.c
@@ -1,3 +1,5 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmMga.c,v 1.3 2000/08/24 22:20:17 tsi Exp $ */
+
#ifdef XFree86Server
# include "xf86.h"
# include "xf86_OSproc.h"
@@ -40,7 +42,9 @@ extern int xf86RemoveSIGIOHandler(int fd);
#define MAP_FAILED ((void *)-1)
#endif
+#ifdef __linux__
#include <sys/sysmacros.h> /* for makedev() */
+#endif
#include "xf86drm.h"
#include "xf86drmMga.h"
#include "drm.h"
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmR128.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmR128.c
index 05b3d0d36..e7d88f11a 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmR128.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmR128.c
@@ -26,6 +26,7 @@
* Author: Kevin E. Martin <martin@valinux.com>
*
*/
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmR128.c,v 1.3 2000/08/24 22:20:18 tsi Exp $ */
#ifdef XFree86Server
# include "xf86.h"
@@ -69,7 +70,9 @@ extern int xf86RemoveSIGIOHandler(int fd);
#define MAP_FAILED ((void *)-1)
#endif
+#ifdef __linux__
#include <sys/sysmacros.h> /* for makedev() */
+#endif
#include "xf86drm.h"
#include "xf86drmR128.h"
#include "drm.h"
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/lnxResource.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/lnxResource.c
index 4e22a12cb..c1db77996 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/lnxResource.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/lnxResource.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnxResource.c,v 3.9 2000/06/13 02:28:36 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnxResource.c,v 3.10 2000/09/19 12:46:22 eich Exp $ */
/* Resource information code */
@@ -104,10 +104,10 @@ xf86PciBusAccWindowsFromOS(void)
RANGE(range,0xF9000000,0xffffffff,ResExcMemBlock);
ret = xf86AddResToList(ret, &range, -1);
} else {
- RANGE(range,0,0xffffffff,ResExcMemBlock);
+ /* Some drivers choke if a PCI base address is set to 0 */
+ RANGE(range,1,0xffffffff,ResExcMemBlock);
ret = xf86AddResToList(ret, &range, -1);
}
-
RANGE(range,0,0xffffffff,ResExcIoBlock);
ret = xf86AddResToList(ret, &range, -1);
return ret;
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/lynxos/Imakefile b/xc/programs/Xserver/hw/xfree86/os-support/lynxos/Imakefile
index 4f44b4e62..fd513e6ac 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/lynxos/Imakefile
+++ b/xc/programs/Xserver/hw/xfree86/os-support/lynxos/Imakefile
@@ -1,4 +1,4 @@
-XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/os-support/lynxos/Imakefile,v 3.20 2000/06/27 14:27:30 tsi Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/os-support/lynxos/Imakefile,v 3.21 2000/08/15 16:05:38 dawes Exp $
#include <Server.tmpl>
#if !defined(PpcArchitecture)
@@ -20,12 +20,12 @@ MOUSEOBJ = lynx_mouse.o
SRCS = lynx_init.c lynx_video.c lynx_io.c lynx_mmap.c \
VTsw_usl.c std_kbdEv.c posix_tty.c $(MOUSESRC) \
$(IOPERM_SRCS) $(PPC_SRCS) libc_wrapper.c stdResource.c stdPci.c \
- vidmem.c sigio.c pm_noop.c kmod_noop.c
+ vidmem.c sigio.c pm_noop.c kmod_noop.c agp_noop.c
OBJS = lynx_init.o lynx_video.o lynx_io.o lynx_mmap.o \
VTsw_usl.o std_kbdEv.o posix_tty.o $(MOUSEOBJ) \
$(IOPERM_OBJS) $(PPC_OBJS) libc_wrapper.o stdResource.o stdPci.o \
- vidmem.o sigio.o pm_noop.o kmod_noop.o
+ vidmem.o sigio.o pm_noop.o kmod_noop.o agp_noop.o
INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) -I. -I$(SERVERSRC)/include \
-I$(XINCLUDESRC) -I$(EXTINCSRC)
@@ -50,5 +50,6 @@ LinkSourceFile(vidmem.c,../shared)
LinkSourceFile(sigio.c,../shared)
LinkSourceFile(pm_noop.c,../shared)
LinkSourceFile(kmod_noop.c,../shared)
+LinkSourceFile(agp_noop.c,../shared)
DependTarget()
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/mach/Imakefile b/xc/programs/Xserver/hw/xfree86/os-support/mach/Imakefile
deleted file mode 100644
index 6b12f3c9c..000000000
--- a/xc/programs/Xserver/hw/xfree86/os-support/mach/Imakefile
+++ /dev/null
@@ -1,35 +0,0 @@
-XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/os-support/mach/Imakefile,v 3.3 2000/06/27 14:27:30 tsi Exp $
-
-
-
-
-XCOMM $XConsortium: Imakefile /main/4 1996/09/28 17:23:58 rws $
-
-#include <Server.tmpl>
-
-#if defined(OsfArchitecture)
-BIOS_MOD = bios_devmem
-#else
-BIOS_MOD = bios_mmap
-#endif
-
-SRCS = mach_init.c mach_video.c mach_io.c $(BIOS_MOD).c \
- VTsw_noop.c kmod_noop.c
-
-OBJS = mach_init.o mach_video.o mach_io.o $(BIOS_MOD).o \
- VTsw_noop.o kmod_noop.o
-
-INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) -I. -I$(SERVERSRC)/include \
- -I$(XINCLUDESRC)
-
-SubdirLibraryRule($(OBJS))
-NormalLibraryObjectRule()
-
-#if defined(OsfArchitecture)
-ObjectFromSpecialSource(bios_devmem,../shared/bios_devmem,/**/)
-#endif
-ObjectFromSpecialSource(VTsw_noop,../shared/VTsw_noop,/**/)
-ObjectFromSpecialSource(kmod_noop,../shared/kmod_noop,/**/)
-
-DependTarget()
-
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/mach/bios_mmap.c b/xc/programs/Xserver/hw/xfree86/os-support/mach/bios_mmap.c
deleted file mode 100644
index bc062f3e4..000000000
--- a/xc/programs/Xserver/hw/xfree86/os-support/mach/bios_mmap.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/mach/bios_mmap.c,v 3.4 1996/12/23 06:50:10 dawes Exp $ */
-/*
- * Copyright 1992 by Robert Baron <Robert.Baron@ernst.mach.cs.cmu.edu>
- * Copyright 1993 by David Wexelblat <dwex@goblin.org>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the names of Robert Baron and David Wexelblat not
- * be used in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission. Robert Baron and
- * David Wexelblat make no representations about the suitability of this
- * software for any purpose. It is provided "as is" without express or
- * implied warranty.
- *
- * ROBERT BARON AND DAVID WEXELBLAT DISCLAIMS ALL WARRANTIES WITH REGARD TO
- * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS, IN NO EVENT SHALL ROBERT BARON OR DAVID WEXELBLAT BE LIABLE FOR
- * ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
- * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
- * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/* $XConsortium: bios_mmap.c /main/4 1996/02/21 17:51:47 kaleb $ */
-
-#include "X.h"
-#include "misc.h"
-
-#define DevicePtr int
-#include "xf86_OSlib.h"
-
-#define BIOS_SIZE 0x20000
-#define KERN_SUCCESS 0
-
-int xf86ReadBIOS(Base, Offset, Buf, Len)
-unsigned long Base;
-unsigned long Offset;
-unsigned char *Buf;
-int Len;
-{
- int fd;
- int screen_addr;
- int ret;
-
- if ((fd = open("/dev/iopl", O_RDWR, 0)) < 0)
- {
- ErrorF("xf86ReadBIOS: Failed to open /dev/iopl\n");
- return(-1);
- }
- if (KERN_SUCCESS != vm_allocate(task_self(), &screen_addr,
- BIOS_SIZE, TRUE))
- {
- ErrorF("xf86ReadBIOS: Failed vmallocate %x\n", BIOS_SIZE);
- close(fd);
- return(-1);
- }
- if (mmap(screen_addr, BIOS_SIZE, 3, 1, fd, Base) < 0)
- {
- ErrorF("xf86ReadBIOS: Failed to mmap %x at %x\n",
- BIOS_SIZE, Base);
- vm_deallocate(task_self(), screen_addr, BIOS_SIZE);
- close(fd);
- return(-1);
- }
- memcpy(Buf, (unsigned char *)(screen_addr + Offset), Len);
- if (KERN_SUCCESS != vm_deallocate(task_self(), screen_addr, BIOS_SIZE))
- {
- ErrorF("xf86ReadBIOS: Failed vmdeallocate %x\n", BIOS_SIZE);
- close(fd);
- return(-1);
- }
- close(fd);
- return(Len);
-}
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/mach/mach_init.c b/xc/programs/Xserver/hw/xfree86/os-support/mach/mach_init.c
deleted file mode 100644
index 1615f7ec8..000000000
--- a/xc/programs/Xserver/hw/xfree86/os-support/mach/mach_init.c
+++ /dev/null
@@ -1,70 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/mach/mach_init.c,v 3.5 1998/07/25 16:56:46 dawes Exp $ */
-/*
- * Copyright 1992 by Robert Baron <Robert.Baron@ernst.mach.cs.cmu.edu>
- * Copyright 1993 by David Wexelblat <dwex@goblin.org>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the names of Robert Baron and David Wexelblat not
- * be used in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission. Robert Baron and
- * David Wexelblat make no representations about the suitability of this
- * software for any purpose. It is provided "as is" without express or
- * implied warranty.
- *
- * ROBERT BARON AND DAVID WEXELBLAT DISCLAIMS ALL WARRANTIES WITH REGARD TO
- * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS, IN NO EVENT SHALL ROBERT BARON OR DAVID WEXELBLAT BE LIABLE FOR
- * ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
- * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
- * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/* $XConsortium: mach_init.c /main/4 1996/02/21 17:51:50 kaleb $ */
-
-#include "X.h"
-#include "Xmd.h"
-#include "input.h"
-#include "scrnintstr.h"
-
-#include "compiler.h"
-
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-
-void xf86OpenConsole()
-{
- if (serverGeneration == 1)
- {
- if ((xf86Info.consoleFd = open("/dev/console",O_RDWR,0)) < 0)
- {
- FatalError("xf86OpenConsole: Can't open /dev/console (%s)\n",
- strerror(errno));
- }
- return;
- }
-}
-
-void xf86CloseConsole()
-{
- close(xf86Info.consoleFd);
- return;
-}
-
-/* ARGSUSED */
-int xf86ProcessArgument (argc, argv, i)
-int argc;
-char *argv[];
-int i;
-{
- return(0);
-}
-
-void xf86UseMsg()
-{
- return;
-}
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/mach/mach_io.c b/xc/programs/Xserver/hw/xfree86/os-support/mach/mach_io.c
deleted file mode 100644
index 264f6b446..000000000
--- a/xc/programs/Xserver/hw/xfree86/os-support/mach/mach_io.c
+++ /dev/null
@@ -1,289 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/mach/mach_io.c,v 3.7 1999/05/07 02:56:21 dawes Exp $ */
-/*
- * Copyright 1992 by Robert Baron <Robert.Baron@ernst.mach.cs.cmu.edu>
- * Copyright 1993 by David Dawes <dawes@xfree86.org>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the names of Robert Baron and David Dawes not
- * be used in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission. Robert Baron and
- * David Dawes make no representations about the suitability of this
- * software for any purpose. It is provided "as is" without express or
- * implied warranty.
- *
- * ROBERT BARON AND DAVID DAWES DISCLAIMS ALL WARRANTIES WITH REGARD TO
- * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS, IN NO EVENT SHALL ROBERT BARON OR DAVID DAWES BE LIABLE FOR
- * ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
- * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
- * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/* $XConsortium: mach_io.c /main/8 1996/10/19 18:06:45 kaleb $ */
-
-#define NEED_EVENTS
-#include "X.h"
-#include "Xproto.h"
-
-#include "compiler.h"
-
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-
-Bool xf86SupportedMouseTypes[] =
-{
- TRUE, /* Microsoft */
- FALSE, /* MouseSystems */
- FALSE, /* MMSeries */
- TRUE, /* Logitech */
- FALSE, /* BusMouse */
- FALSE, /* MouseMan */
- TRUE, /* PS/2 */
- FALSE, /* Hitachi Tablet */
-};
-
-int xf86NumMouseTypes = sizeof(xf86SupportedMouseTypes) /
- sizeof(xf86SupportedMouseTypes[0]);
-
-unsigned short xf86MouseCflags[] =
-{
- /*
- * MicroSoft mouse needs 7bit characters.
- * See special seven_bit_hack code in com.c:comparam()
- * in the kernel code. Basically we use the
- * special code RAW | PASS8 to mean the mythical
- * "PASS7".
- */
- -1, /* MicroSoft */
- RAW, /* MouseSystems */
- RAW, /* MMSeries */
- RAW | EVENP | ODDP, /* Logitech */
- 0, /* BusMouse */
- -1, /* ??? MouseMan [CHRIS-211092] */
- 0, /* PS/2 */
- RAW, /* Hitachi Tablet */
-};
-
-void xf86SoundKbdBell(loudness, pitch, duration)
-int loudness;
-int pitch;
-int duration;
-{
- if (loudness)
- {
-#ifdef __OSF__
- ioctl(xf86Info.consoleFd, KIOCSOUND, 1);
- usleep(duration * loudness * 20);
- ioctl(xf86Info.consoleFd, KIOCSOUND, 0);
-#else
- int i = KD_BELLON;
- ioctl(xf86Info.consoleFd, KDSETBELL, &i);
- usleep(duration * loudness * 20);
- i = KD_BELLOFF;
- ioctl(xf86Info.consoleFd, KDSETBELL, &i);
-#endif
- }
-}
-
-void xf86SetKbdLeds(leds)
-int leds;
-{
-#ifdef __OSF__
- ioctl(xf86Info.kbdFd, KDSETLED, &leds);
-#endif
-}
-
-int xf86GetKbdLeds()
-{
-#ifdef __OSF__
- int leds;
-
- ioctl(xf86Info.kbdFd, KDGETLED, &leds);
- return(leds);
-#else
- return(0);
-#endif
-}
-
-#if NeedFunctionPrototypes
-void xf86SetKbdRepeat(char rad)
-#else
-void xf86SetKbdRepeat(rad)
-char rad;
-#endif
-{
- return;
-}
-
-void xf86KbdInit()
-{
- return;
-}
-
-int xf86KbdOn()
-{
- int data = KB_EVENT;
-
- if ((xf86Info.kbdFd = open ("/dev/kbd", O_RDONLY)) < 0)
- FatalError("can't open /dev/kbd (%s)", strerror(errno));
-
- /* Set the keyboard into non-blocking event mode. */
- if (ioctl(xf86Info.kbdFd, KDSKBDMODE, &data) < 0)
- FatalError("Cannot set event mode on keyboard (%s)\n",
- strerror(errno));
- data = 1;
- if (ioctl (xf86Info.kbdFd, FIONBIO, &data) < 0)
- FatalError("Cannot keyboard non-blocking (%s)\n",
- strerror(errno));
- return(xf86Info.kbdFd);
-}
-
-int xf86KbdOff()
-{
- int data = KB_ASCII;
-
- if (ioctl(xf86Info.kbdFd, KDSKBDMODE, &data) < 0)
- FatalError("can't reset keyboard mode (%s)\n",
- strerror(errno));
- return(xf86Info.kbdFd);
-}
-
-void xf86KbdEvents()
-{
- kd_event ke;
-
- /* This loop assumes non-blocking keyboard IO. */
- while (read (xf86Info.kbdFd, &ke, sizeof(ke)) == sizeof(ke))
- {
- xf86PostKbdEvent(ke.value.sc);
- }
-}
-
-void xf86SetMouseSpeed(mouse, old, new, cflag)
-MouseDevPtr mouse;
-int old;
-int new;
-unsigned cflag;
-{
- return;
-}
-
-void xf86MouseInit(mouse)
-MouseDevPtr mouse;
-{
- return;
-}
-
-int xf86MouseOn(mouse)
-MouseDevPtr mouse;
-{
- if ((mouse->mseFd = open(mouse->mseDevice, O_RDONLY, 0)) < 0)
- {
- if (xf86Info.allowMouseOpenFail) {
- ErrorF("Cannot open mouse (%s) - Continuing...\n",
- strerror(errno));
- return(-2);
- }
- FatalError("Cannot open mouse (%s)\n", strerror(errno));
- }
- if (fcntl(mouse->mseFd, F_SETFL, FNDELAY | FASYNC) < 0)
- {
- if (xf86AllowMouseOpenFail) {
- ErrorF("Cannot set up mouse (%s) - Continuing...\n",
- strerror(errno));
- return(-2);
- }
- FatalError("Cannot set up mouse (%s)\n", strerror(errno));
- }
-
- xf86SetupMouse(mouse);
-
- {
- int data = 1;
-
- if (ioctl (mouse->mseFd, FIONBIO, &data) < 0)
- {
- if (xf86AllowMouseOpenFail) {
- ErrorF("Cannot set mouse non-blocking (%s) - Continuing...\n",
- strerror(errno));
- return(-2);
- }
- FatalError(
- "Cannot set mouse non-blocking (%s)\n",
- strerror(errno));
- }
- }
- return(mouse->mseFd);
-}
-
-int xf86MouseOff(mouse, doclose)
-MouseDevPtr mouse;
-Bool doclose;
-{
- close(mouse->mseFd);
- return(mouse->mseFd);
-}
-
-#define EVENT_LIST_SIZE 32
-
-void xf86MouseEvents(device)
-DeviceIntPtr device;
-{
- int total, buttons, dx, dy;
- static kd_event eventList[EVENT_LIST_SIZE];
- kd_event *event;
-
- total = read(mouse->mseFd, eventList, sizeof(eventList));
- if (total < 0)
- {
- if (errno != EWOULDBLOCK)
- {
- if (xf86AllowMouseOpenFail) {
- ErrorF("Cannot read from mouse (%s) - Continuing...\n",
- strerror(errno));
- return(-2);
- }
- FatalError("Cannot read from mouse (%s)\n",
- strerror(errno));
- }
- return;
- }
-
- total /= sizeof(kd_event);
- event = eventList;
- while (total--)
- {
- buttons = mouse->lastButtons;
- dx = dy = 0;
-
- switch (event->type)
- {
- case MOUSE_RIGHT:
- buttons = mouse->lastButtons & 6 |
- (event->value.up ? 0 : 1);
- break;
- case MOUSE_MIDDLE:
- buttons = mouse->lastButtons & 5 |
- (event->value.up ? 0 : 2);
- break;
- case MOUSE_LEFT:
- buttons = mouse->lastButtons & 3 |
- (event->value.up ? 0 : 4);
- break;
- case MOUSE_MOTION:
- dx = event->value.m_deltaX;
- dy = - event->value.m_deltaY;
- break;
- default:
- ErrorF("Bad mouse event\n");
- break;
- }
- xf86PostMseEvent(device, buttons, dx, dy);
- ++event;
- }
-}
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/mach/mach_video.c b/xc/programs/Xserver/hw/xfree86/os-support/mach/mach_video.c
deleted file mode 100644
index d1c8f7e94..000000000
--- a/xc/programs/Xserver/hw/xfree86/os-support/mach/mach_video.c
+++ /dev/null
@@ -1,195 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/mach/mach_video.c,v 3.2 1997/08/26 10:01:37 hohndel Exp $ */
-/*
- * Copyright 1992 by Robert Baron <Robert.Baron@ernst.mach.cs.cmu.edu>
- * Copyright 1993 by David Wexelblat <dwex@XFree86.org>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the names of Robert Baron and David Wexelblat not
- * be used in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission. Robert Baron and
- * David Wexelblat make no representations about the suitability of this
- * software for any purpose. It is provided "as is" without express or
- * implied warranty.
- *
- * ROBERT BARON AND DAVID WEXELBLAT DISCLAIMS ALL WARRANTIES WITH REGARD TO
- * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS, IN NO EVENT SHALL ROBERT BARON OR DAVID WEXELBLAT BE LIABLE FOR
- * ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
- * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
- * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/* $XConsortium: mach_video.c /main/3 1996/02/21 17:51:57 kaleb $ */
-
-#include "X.h"
-#include "input.h"
-#include "scrnintstr.h"
-
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-
-/***************************************************************************/
-/* Video Memory Mapping section */
-/***************************************************************************/
-
-#define KERN_SUCCESS 0
-
-pointer xf86MapVidMem(ScreenNum, Region, Base, Size)
-int ScreenNum;
-int Region;
-pointer Base;
-unsigned long Size;
-{
- pointer base;
- int fd;
-
- if ((fd = open("/dev/iopl", O_RDWR, 0)) < 0)
- {
- FatalError("xf86MapVidMem: Failed to get IOPL\n");
- }
- if (KERN_SUCCESS != vm_allocate(task_self(), &base, Size, TRUE))
- {
- FatalError("xf86MapVidMem: can't alloc framebuffer space\n");
- }
-
- if (mmap(base, Size, 3, 1, fd, Base) < 0)
- {
- vm_deallocate(task_self(), base, Size);
- close(fd);
- FatalError("xf86MapVidMem: Could not mmap frambuffer\n");
- }
- close(fd);
- return(base);
-}
-
-void xf86UnMapVidMem(ScreenNum, Region, Base, Size)
-int ScreenNum;
-int Region;
-pointer Base;
-unsigned long Size;
-{
- if (KERN_SUCCESS != vm_deallocate(task_self(), Base, Size))
- {
- ErrorF("xf86UnMapVidMem: can't dealloc framebuffer space\n");
- }
-}
-
-Bool xf86LinearVidMem()
-{
- return(TRUE);
-}
-
-/***************************************************************************/
-/* I/O Permissions section */
-/***************************************************************************/
-
-/*
- * Mach disables I/O permissions completely, and OSF/1 doesn't bother
- * with I/O permissions right now.
- */
-
-#ifdef MACH386
-static int ioplfd = -1;
-static Bool ScreenEnabled[MAXSCREENS];
-static Bool IOEnabled = FALSE;
-static Bool InitDone = FALSE;
-#endif
-
-
-void xf86EnableIOPorts(ScreenNum)
-int ScreenNum;
-{
-#ifdef MACH386
- int i;
-
- if (!InitDone)
- {
- for (i = 0; i < MAXSCREENS; i++)
- ScreenEnabled[i] = FALSE;
- InitDone = TRUE;
- }
- ScreenEnabled[ScreenNum] = TRUE;
-
- if (IOEnabled)
- return;
-
- if ((ioplfd = open("/dev/iopl", 0)) < 0)
- FatalError("xf86EnablePortIO: Failed to get IOPL for I/O\n");
- IOEnabled = TRUE;
-#endif /* MACH386 */
- return;
-}
-
-void xf86DisableIOPorts(ScreenNum)
-int ScreenNum;
-{
-#ifdef MACH386
- int i;
-
- ScreenEnabled[ScreenNum] = FALSE;
-
- if (!IOEnabled)
- return;
-
- for (i = 0; i < MAXSCREENS; i++)
- if (ScreenEnabled[i])
- return;
- close(ioplfd);
- ioplfd = -1;
- IOEnabled = FALSE;
-#endif /* MACH386 */
- return;
-}
-
-/***************************************************************************/
-/* Interrupt Handling section */
-/***************************************************************************/
-
-static Bool Mach30()
-{
-#ifdef MACH386
- if (syscall(-27) != 4)
- {
- return(TRUE);
- }
- else
- {
- return(FALSE);
- }
-#else /* MACH386 */
- return(FALSE);
-#endif /* MACH386 */
-}
-
-Bool xf86DisableInterrupts()
-{
- if (Mach30())
- {
- ErrorF("Mach 3.0 does not allow interrupts to be disabled\n");
- return(FALSE);
- }
-#ifdef __GNUC__
- __asm__ __volatile__("cli");
-#else
- asm("cli");
-#endif /* __GNUC__ */
-
- return(TRUE);
-}
-
-void xf86EnableInterrupts()
-{
-#ifdef __GNUC__
- __asm__ __volatile__("sti");
-#else
- asm("sti");
-#endif /* __GNUC__ */
-
- return;
-}
-
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/minix/Imakefile b/xc/programs/Xserver/hw/xfree86/os-support/minix/Imakefile
deleted file mode 100644
index aca4c717c..000000000
--- a/xc/programs/Xserver/hw/xfree86/os-support/minix/Imakefile
+++ /dev/null
@@ -1,29 +0,0 @@
-XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/os-support/minix/Imakefile,v 3.6 2000/06/27 14:27:30 tsi Exp $
-
-
-
-
-
-XCOMM $XConsortium: Imakefile /main/5 1996/09/28 17:24:04 rws $
-
-#include <Server.tmpl>
-
-SRCS = mnx_init.c mnx_video.c mnx_io.c bios_devmem.c \
- ioperm_noop.c VTsw_noop.c std_mouse.c posix_tty.c kmod_noop.c
-
-OBJS = mnx_init.o mnx_video.o mnx_io.o bios_devmem.o \
- ioperm_noop.o VTsw_noop.o posix_tty.o kmod_noop.o
-
-INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) -I. -I$(SERVERSRC)/include \
- -I$(XINCLUDESRC)
-
-SubdirLibraryRule($(OBJS))
-NormalLibraryObjectRule()
-NormalAsmObjectRule()
-
-ObjectFromSpecialSource(ioperm_noop,../shared/ioperm_noop,/**/)
-ObjectFromSpecialSource(VTsw_noop,../shared/VTsw_noop,/**/)
-ObjectFromSpecialSource(posix_tty,../shared/posix_tty,/**/)
-ObjectFromSpecialSource(kmod_noop,../shared/kmod_noop,/**/)
-
-DependTarget()
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/minix/bios_devmem.c b/xc/programs/Xserver/hw/xfree86/os-support/minix/bios_devmem.c
deleted file mode 100644
index 50f905caa..000000000
--- a/xc/programs/Xserver/hw/xfree86/os-support/minix/bios_devmem.c
+++ /dev/null
@@ -1,78 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/minix/bios_devmem.c,v 3.2 1996/12/23 06:50:16 dawes Exp $ */
-/*
- * Copyright 1993 by David Wexelblat <dwex@goblin.org>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of David Wexelblat not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. David Wexelblat makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * DAVID WEXELBLAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL DAVID WEXELBLAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/* $XConsortium: bios_devmem.c /main/4 1996/02/21 17:52:05 kaleb $ */
-
-#include "X.h"
-#include "input.h"
-#include "scrnintstr.h"
-
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-
-/*
- * Read BIOS via /dev/mem.
- */
-
-#ifndef DEV_MEM
-# define DEV_MEM "/dev/mem"
-#endif
-
-int xf86ReadBIOS(Base, Offset, Buf, Len)
-unsigned long Base;
-unsigned long Offset;
-unsigned char *Buf;
-int Len;
-{
- int fd;
- uid_t real_uid;
-
- real_uid= getuid();
-
- setuid(0);
- if ((fd = open(DEV_MEM, O_RDONLY)) < 0)
- {
- ErrorF("xf86ReadBios: Failed to open %s (%s)\n", DEV_MEM,
- strerror(errno));
- setuid(real_uid);
- return(-1);
- }
- setuid(real_uid);
- if (lseek(fd, (Base+Offset), SEEK_SET) < 0)
- {
- ErrorF("xf86ReadBios: %s seek failed (%s)\n", DEV_MEM,
- strerror(errno));
- close(fd);
- return(-1);
- }
- if (read(fd, Buf, Len) != Len)
- {
- ErrorF("xf86ReadBios: %s read failed (%s)\n", DEV_MEM,
- strerror(errno));
- close(fd);
- return(-1);
- }
- close(fd);
- return(Len);
-}
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/minix/local.h b/xc/programs/Xserver/hw/xfree86/os-support/minix/local.h
deleted file mode 100644
index 60a23ea1c..000000000
--- a/xc/programs/Xserver/hw/xfree86/os-support/minix/local.h
+++ /dev/null
@@ -1,13 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/minix/local.h,v 3.2 1996/12/23 06:50:17 dawes Exp $ */
-
-/*
-local.h
-
-Local definitions for the minix os libary
-
-Created: 19 April, 1994 by Philip Homburg <philip@cs.vu.nl>
-*/
-/* $XConsortium: local.h /main/4 1996/02/21 17:52:08 kaleb $ */
-
-extern char *xf86VideoBaseRaw;
-extern char *xf86VideoBase;
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/minix/mnx_init.c b/xc/programs/Xserver/hw/xfree86/os-support/minix/mnx_init.c
deleted file mode 100644
index 844537748..000000000
--- a/xc/programs/Xserver/hw/xfree86/os-support/minix/mnx_init.c
+++ /dev/null
@@ -1,110 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/minix/mnx_init.c,v 3.7 1998/07/25 16:56:47 dawes Exp $ */
-/*
- * Copyright 1993 by Vrije Universiteit, The Netherlands
- * Copyright 1993 by David Wexelblat <dwex@goblin.org>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the names of The Vrije Universiteit and David
- * Wexelblat not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior permission.
- * The Vrije Universiteit and David Wexelblat make no representations about
- * the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * THE VRIJE UNIVERSITEIT AND DAVID WEXELBLAT DISCLAIM ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE VRIJE UNIVERSITEIT OR
- * DAVID WEXELBLAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/* $XConsortium: mnx_init.c /main/5 1996/02/21 17:52:12 kaleb $ */
-
-#include "X.h"
-#include "Xmd.h"
-#include "input.h"
-#include "scrnintstr.h"
-
-#include "compiler.h"
-
-#include "local.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-
-#define VIDEO_SIZE 0x20000
-#define VIDEO_ALIGN 0x1000
-
-char *xf86VideoBaseRaw= NULL;
-char *xf86VideoBase= NULL;
-
-void xf86OpenConsole()
-{
- int fd, r, align_diff;
- struct mio_map mio_map;
- uid_t real_uid;
-
- if (serverGeneration == 1)
- {
- real_uid= getuid();
-
- /* check if we're run with euid==0 */
- if (setuid(0) != 0)
- {
- FatalError("xf86OpenConsole: Server must be suid root\n");
- }
- fd = open("/dev/vga", O_RDWR);
- if (fd == -1)
- {
- FatalError("xf86OpenConsole: Can't open /dev/vga: %s\n",
- strerror(errno));
- }
- setuid(real_uid);
-
- xf86VideoBaseRaw = (char *)xalloc(VIDEO_SIZE+VIDEO_ALIGN);
- if (xf86VideoBaseRaw == 0)
- {
- FatalError("xf86OpenConsole: Out of memory\n");
- }
- align_diff = (int)xf86VideoBaseRaw;
- align_diff = VIDEO_ALIGN-(((align_diff-1) & (VIDEO_ALIGN-1))+1);
- assert(align_diff >= 0 && align_diff < VIDEO_ALIGN);
- xf86VideoBase = xf86VideoBaseRaw + align_diff;
- mio_map.mm_base = (u32_t)xf86VideoBase;
- mio_map.mm_size = VIDEO_SIZE;
- r = ioctl(fd, MIOCMAP, &mio_map);
- if (r == -1)
- {
- FatalError("xf86OpenConsole: MIOCMAP failed: %s\n",
- strerror(errno));
- }
- }
- return;
-}
-
-void xf86CloseConsole()
-{
- xfree(xf86VideoBaseRaw);
- xf86VideoBaseRaw = NULL; /* not needed? */
- return;
-}
-
-/* ARGSUSED */
-int xf86ProcessArgument (argc, argv, i)
-int argc;
-char *argv[];
-int i;
-{
- return(0);
-}
-
-void xf86UseMsg()
-{
- return;
-}
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/minix/mnx_io.c b/xc/programs/Xserver/hw/xfree86/os-support/minix/mnx_io.c
deleted file mode 100644
index 89882bf10..000000000
--- a/xc/programs/Xserver/hw/xfree86/os-support/minix/mnx_io.c
+++ /dev/null
@@ -1,277 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/minix/mnx_io.c,v 3.12 1999/05/07 02:56:21 dawes Exp $ */
-/*
- * Copyright 1993 by Vrije Universiteit, The Netherlands
- * Copyright 1993 by David Dawes <dawes@xfree86.org>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the names of the Vrije Universiteit and David
- * Dawes not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior permission.
- * The Vrije Universiteit and David Dawes make no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * THE VRIJE UNIVERSITEIT AND DAVID DAWES DISCLAIM ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE VRIJE UNIVERSITEIT OR
- * DAVID DAWES BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/* $XConsortium: mnx_io.c /main/10 1996/10/19 18:07:03 kaleb $ */
-
-#define NEED_EVENTS
-#include "X.h"
-#include "Xproto.h"
-#include "inputstr.h"
-#include "scrnintstr.h"
-
-#include "compiler.h"
-
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-#include "xf86Config.h"
-
-#include <sys/nbio.h>
-
-void xf86SoundKbdBell(loudness, pitch, duration)
-int loudness;
-int pitch;
-int duration;
-{
- kio_bell_t kio_bell;
- int r;
-
- kio_bell.kb_pitch = pitch;
- kio_bell.kb_volume = 1000000 / 100 * loudness;
- kio_bell.kb_duration.tv_sec = duration / 1000;
- kio_bell.kb_duration.tv_usec = (duration % 1000) * 1000;
- r = ioctl(xf86Info.kbdFd, KIOCBELL, &kio_bell);
- if (r != 0)
- {
- ErrorF("(warning) unable to ring keyboard bell: %s\n",
- strerror(errno));
- }
-}
-
-void xf86SetKbdLeds(leds)
-int leds;
-{
- kio_leds_t kio_leds;
- int r;
-
- kio_leds.kl_bits= leds;
- r = ioctl(xf86Info.kbdFd, KIOCSLEDS, &kio_leds);
- if (r != 0)
- {
- ErrorF("(warning) unable to set keyboard leds: %s\n",
- strerror(errno));
- }
-}
-
-int xf86GetKbdLeds()
-{
- return(0);
-}
-
-#if NeedFunctionPrototypes
-void xf86SetKbdRepeat(char rad)
-#else
-void xf86SetKbdRepeat(rad)
-char rad;
-#endif
-{
- return;
-}
-
-void xf86KbdInit()
-{
- static int kbd_fd = -1;
- int flags, r;
- uid_t real_uid;
-
- real_uid= getuid();
-
- /* Open the keyboard device if not already done so */
- if (kbd_fd < 0)
- {
- setuid(0);
- kbd_fd = open("/dev/kbd", O_RDONLY);
- if (kbd_fd == -1)
- FatalError("Unable to open keyboard\n");
- else
- xf86Info.kbdFd = kbd_fd;
- setuid(real_uid);
-
- /* Mark the keyboard as asynchronous */
- flags= fcntl(xf86Info.kbdFd, F_GETFD);
- if (flags == -1)
- FatalError("Unable to get keyboard flags\n");
- r = fcntl(xf86Info.kbdFd, F_SETFD, flags | FD_ASYNCHIO);
- if (r == -1)
- FatalError("Unable to set keyboard flags\n");
-
- nbio_register(kbd_fd);
- }
-}
-
-int xf86KbdOn()
-{
- char waste[16];
- int r;
-
- /* Get rid of old data */
- for (;;)
- {
- r = nbio_read(xf86Info.kbdFd, waste, sizeof(waste));
- if (r > 0)
- continue;
- if (r == -1 && errno == EAGAIN)
- break;
- FatalError("unable to read from keyboard (%s)\n",
- strerror(errno));
- }
- return(xf86Info.kbdFd);
-}
-
-int xf86KbdOff()
-{
- /* Should RemoveEnabledDevice() be done for Minix?? */
- /* If it shouldn't be done, we should return -1 here */
- return(xf86Info.kbdFd);
-}
-
-void xf86KbdEvents()
-{
- unsigned char rBuf[64];
- int nBytes, i;
-
- while ((nBytes = nbio_read(xf86Info.kbdFd, (char *)rBuf,
- sizeof(rBuf))) > 0)
- {
- for (i = 0; i < nBytes; i++)
- xf86PostKbdEvent(rBuf[i]);
- }
- if (nBytes == 0)
- ErrorF("xf86KbdEvents: nbio_read returns EOF");
- else if (errno != EAGAIN)
- {
- ErrorF("xf86KbdEvents: nbio_read error: %s",
- strerror(errno));
- }
-}
-
-void xf86MouseInit(mouse)
-MouseDevPtr mouse;
-{
- static int mseFd= -1;
- int r, flags;
- uid_t real_uid;
-
- if (mseFd < 0)
- {
- real_uid= getuid();
-
- setuid(0);
- if ((mseFd = mouse->mseFd =
- open(mouse->mseDevice, O_RDWR)) < 0)
- {
- if (xf86Info.allowMouseOpenFail) {
- ErrorF("Cannot open mouse (%s) - Continuing...\n",
- strerror(errno));
- return;
- }
- FatalError("Cannot open mouse (%s)\n",
- strerror(errno));
- }
- setuid(real_uid);
-
- xf86SetupMouse(mouse);
-
- /* Mark the mouse as asynchronous */
- flags = fcntl(mouse->mseFd, F_GETFD);
- if (flags == -1)
- {
- if (xf86AllowMouseOpenFail) {
- ErrorF("Unable to get mouse flags (%s) - Continuing...\n",
- strerror(errno));
- return;
- }
- FatalError("Unable to get mouse flags (%s)\n",
- strerror(errno));
- }
- r = fcntl(mouse->mseFd, F_SETFD, flags | FD_ASYNCHIO);
- if (r == -1)
- {
- if (xf86AllowMouseOpenFail) {
- ErrorF("Unable to set mouse flags (%s) - Continuing...\n",
- strerror(errno));
- return;
- }
- FatalError("Unable to set mouse flags (%s)\n",
- strerror(errno));
- }
- nbio_register(mouse->mseFd);
- }
-}
-
-int xf86MouseOn(mouse)
-MouseDevPtr mouse;
-{
- char waste[16];
- int r;
-
- /* Get rid of old data */
- for (;;)
- {
- r = nbio_read(mouse->mseFd, waste, sizeof(waste));
- if (r > 0)
- continue;
- if ((r == -1 && errno == EAGAIN) || xf86AllowMouseOpenFail)
- {
- break;
- }
- if (xf86AllowMouseOpenFail) {
- ErrorF("Unable to read from mouse (%s) - Continuing...\n",
- strerror(errno));
- return -2;
- }
- FatalError("unable to read from mouse (%s)\n",
- strerror(errno));
- }
- return(mouse->mseFd);
-}
-
-void xf86MouseEvents(device)
-DeviceIntPtr device;
-{
- unsigned char rBuf[64];
- int nBytes;
-
- while ((nBytes = nbio_read(mouse->mseFd, (char *)rBuf,
- sizeof(rBuf))) > 0)
- {
- xf86MouseProtocol(device, rBuf, nBytes);
- }
- if (nBytes == 0)
- ErrorF("xf86MouseEvents: nbio_read returns EOF");
- else if (errno != EAGAIN)
- {
- ErrorF("xf86MouseEvents: nbio_read error: %s",
- strerror(errno));
- }
-}
-
-int xf86MouseOff(mouse, doclose)
-MouseDevPtr mouse;
-Bool doclose;
-{
- return(mouse->mseFd);
-}
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/minix/mnx_video.c b/xc/programs/Xserver/hw/xfree86/os-support/minix/mnx_video.c
deleted file mode 100644
index 115f1d2f3..000000000
--- a/xc/programs/Xserver/hw/xfree86/os-support/minix/mnx_video.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/minix/mnx_video.c,v 3.4 1996/12/23 06:50:20 dawes Exp $ */
-/*
- * Copyright 1993 by Vrije Universiteit, The Netherlands
- * Copyright 1993 by David Wexelblat <dwex@goblin.org>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the names of The Vrije Universiteit and David
- * Wexelblat not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior permission.
- * The Vrije Universiteit and David Wexelblat make no representations about
- * the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * THE VRIJE UNIVERSITEIT AND DAVID WEXELBLAT DISCLAIM ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE VRIJE UNIVERSITEIT OR
- * DAVID WEXELBLAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/* $XConsortium: mnx_video.c /main/5 1996/02/21 17:52:19 kaleb $ */
-
-#include "X.h"
-#include "input.h"
-#include "scrnintstr.h"
-
-#include "local.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-
-/***************************************************************************/
-/* Video Memory Mapping section */
-/***************************************************************************/
-
-/* ARGSUSED */
-pointer xf86MapVidMem(ScreenNum, Region, Base, Size)
-int ScreenNum;
-int Region;
-pointer Base;
-unsigned long Size;
-{
- ErrorF("xf86MapVidMem(ScreenNum= %d, Base= %p, Size= 0x%x\n",
- ScreenNum, Base, Size);
- return((pointer)xf86VideoBase + ((unsigned)Base-0xA0000));
-}
-
-/* ARGSUSED */
-void xf86UnMapVidMem(ScreenNum, Region, Base, Size)
-int ScreenNum;
-int Region;
-pointer Base;
-unsigned long Size;
-{
- ErrorF("(warning) xf86UnmapVidMem is not implemented\n");
- return;
-}
-
-Bool xf86LinearVidMem()
-{
- return(FALSE);
-}
-
-/***************************************************************************/
-/* Interrupt Handling section */
-/***************************************************************************/
-
-Bool xf86DisableInterrupts()
-{
-#ifdef __GNUC__
- __asm__ __volatile__("cli");
-#else
- extern void intr_disable();
-
- intr_disable();
-#endif /* __GNUC__ */
-
- return(TRUE);
-}
-
-void xf86EnableInterrupts()
-{
-#ifdef __GNUC__
- __asm__ __volatile__("sti");
-#else
- extern void intr_enable();
-
- intr_enable();
-#endif /* __GNUC__ */
-
- return;
-}
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/nto/Imakefile b/xc/programs/Xserver/hw/xfree86/os-support/nto/Imakefile
index 18bdea822..a7e2b2d4c 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/nto/Imakefile
+++ b/xc/programs/Xserver/hw/xfree86/os-support/nto/Imakefile
@@ -1,14 +1,14 @@
-XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/os-support/nto/Imakefile,v 1.4 2000/06/27 14:27:30 tsi Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/os-support/nto/Imakefile,v 1.5 2000/08/15 16:05:38 dawes Exp $
XCOMM
#include <Server.tmpl>
SRCS = nto_io.c nto_init.c nto_kbdEv.c nto_ioperm.c nto_video.c \
- VTsw_noop.c posix_tty.c std_mseEv.c std_mouse.c kmod_noop.c
+ VTsw_noop.c posix_tty.c std_mseEv.c std_mouse.c kmod_noop.c agp_noop.c
OBJS = nto_io.o nto_init.o nto_kbdEv.o nto_ioperm.o nto_video.o \
- VTsw_noop.o posix_tty.o std_mseEv.o std_mouse.o kmod_noop.o
+ VTsw_noop.o posix_tty.o std_mseEv.o std_mouse.o kmod_noop.o agp_noop.o
INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) -I. -I$(SERVERSRC)/include \
-I$(XINCLUDESRC)
@@ -17,11 +17,12 @@ SubdirLibraryRule($(OBJS))
NormalLibraryObjectRule()
-ObjectFromSpecialSource(IO_utils,../shared/IO_utils,/**/)
-ObjectFromSpecialSource(VTsw_noop,../shared/VTsw_noop,/**/)
-ObjectFromSpecialSource(posix_tty,../shared/posix_tty,/**/)
-ObjectFromSpecialSource(std_mseEv,../shared/std_mseEv,/**/)
-ObjectFromSpecialSource(std_mouse,../shared/std_mouse,/**/)
-ObjectFromSpecialSource(kmod_noop,../shared/kmod_noop,/**/)
+LinkSourceFile(IO_utils.c,../shared)
+LinkSourceFile(VTsw_noop.c,../shared)
+LinkSourceFile(posix_tty.c,../shared)
+LinkSourceFile(std_mseEv.c,../shared)
+LinkSourceFile(std_mouse.c,../shared)
+LinkSourceFile(kmod_noop.c,../shared)
+LinkSourceFile(agp_noop.c,../shared)
DependTarget()
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/os2/Imakefile b/xc/programs/Xserver/hw/xfree86/os-support/os2/Imakefile
index 1d052d344..e38c55d74 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/os2/Imakefile
+++ b/xc/programs/Xserver/hw/xfree86/os-support/os2/Imakefile
@@ -4,7 +4,7 @@ XCOMM $XConsortium: Imakefile /main/7 1996/09/28 17:24:18 rws $
-XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/os-support/os2/Imakefile,v 3.16 2000/06/27 14:27:31 tsi Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/os-support/os2/Imakefile,v 3.17 2000/08/15 16:05:38 dawes Exp $
#include <Server.tmpl>
BIOS_MOD = os2_bios
@@ -12,12 +12,12 @@ BIOS_MOD = os2_bios
SRCS = os2_init.c os2_video.c os2_io.c $(BIOS_MOD).c \
os2_ioperm.c os2_VTsw.c os2_mouse.c os2_KbdEv.c os2_stubs.c \
os2_select.c os2_diag.c libc_wrapper.c stdResource.c stdPci.c \
- vidmem.c sigiostubs.c pm_noop.c kmod_noop.c
+ vidmem.c sigiostubs.c pm_noop.c kmod_noop.c agp_noop.c
OBJS = os2_init.o os2_video.o os2_io.o $(BIOS_MOD).o \
os2_ioperm.o os2_VTsw.o os2_mouse.o os2_kbdEv.o os2_stubs.o \
os2_select.o os2_diag.o libc_wrapper.o stdResource.o stdPci.o \
- vidmem.o sigiostubs.o pm_noop.o kmod_noop.o
+ vidmem.o sigiostubs.o pm_noop.o kmod_noop.o agp_noop.o
INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) -I. -I$(SERVERSRC)/include \
-I$(XINCLUDESRC)
@@ -38,5 +38,6 @@ LinkSourceFile(vidmem.c,../shared)
LinkSourceFile(sigiostubs.c,../shared)
LinkSourceFile(pm_noop.c,../shared)
LinkSourceFile(kmod_noop.c,../shared)
+LinkSourceFile(agp_noop.c,../shared)
DependTarget()
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/pmax/Imakefile b/xc/programs/Xserver/hw/xfree86/os-support/pmax/Imakefile
index 9441ffd8a..5c81fd7fe 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/pmax/Imakefile
+++ b/xc/programs/Xserver/hw/xfree86/os-support/pmax/Imakefile
@@ -1,5 +1,5 @@
-XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/os-support/pmax/Imakefile,v 1.9 2000/06/17 00:03:41 martin Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/os-support/pmax/Imakefile,v 1.10 2000/08/15 16:05:39 dawes Exp $
#include <Server.tmpl>
@@ -10,13 +10,13 @@ SRCS = pmax_devs.c pmax_init.c pmax_map.c pmax_pci.c pmax_ppc.c \
bios_V4mmap.c VTsw_usl.c sysv_kbd.c std_kbdEv.c \
posix_tty.c $(MOUSESRC) xqueue.c ioperm_noop.c \
libc_wrapper.c stdResource.c stdPci.o sigiostubs.c pm_noop.c \
- kmod_noop.c
+ kmod_noop.c agp_noop.c
OBJS = pmax_devs.o pmax_init.o pmax_map.o pmax_pci.o pmax_ppc.o \
bios_V4mmap.o VTsw_usl.o sysv_kbd.o std_kbdEv.o \
posix_tty.o $(MOUSESRC) xqueue.o ioperm_noop.o \
libc_wrapper.o stdResource.o stdPci.o sigiostubs.o pm_noop.o \
- kmod_noop.o
+ kmod_noop.o agp_noop.o
INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) -I$(XF86OSSRC)/bus -I. \
@@ -40,6 +40,7 @@ LinkSourceFile(stdPci.c,../shared)
LinkSourceFile(sigiostubs.c,../shared)
LinkSourceFile(pm_noop.c,../shared)
LinkSourceFile(kmod_noop.c,../shared)
+LinkSourceFile(agp_noop.c,../shared)
LinkSourceFile(bios_V4mmap.c,../sysv)
LinkSourceFile(xqueue.c,../sysv)
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/qnx4/Imakefile b/xc/programs/Xserver/hw/xfree86/os-support/qnx4/Imakefile
index 58fdd559d..5099032e1 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/qnx4/Imakefile
+++ b/xc/programs/Xserver/hw/xfree86/os-support/qnx4/Imakefile
@@ -1,4 +1,4 @@
-XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/os-support/qnx4/Imakefile,v 1.5 2000/06/27 14:27:31 tsi Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/os-support/qnx4/Imakefile,v 1.6 2000/08/15 16:05:39 dawes Exp $
#include <Server.tmpl>
@@ -6,12 +6,12 @@ XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/os-support/qnx4/Imakefile,v 1.5 2
SRCS = qnx_io.c qnx_init.c qnx_utils.c ioperm_noop.c qnx_video.c \
qnx_VTsw.c qnx_kbd.c posix_tty.c qnx_mouse.c qnx_select.c \
libc_wrapper.c stdResource.c stdPci.c sigiostubs.c pm_noop.c \
- kmod_noop.c
+ kmod_noop.c agp_noop.c
OBJS = qnx_io.o qnx_init.o qnx_utils.o ioperm_noop.o qnx_video.o \
qnx_VTsw.o qnx_kbd.o posix_tty.o qnx_mouse.o qnx_select.o \
libc_wrapper.o stdResource.o stdPci.o sigiostubs.o pm_noop.o \
- kmod_noop.o
+ kmod_noop.o agp_noop.o
INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) -I. -I$(SERVERSRC)/include \
-I$(XINCLUDESRC)
@@ -32,5 +32,6 @@ LinkSourceFile(stdPci.c,../shared)
LinkSourceFile(sigiostubs.c,../shared)
LinkSourceFile(pm_noop.c,../shared)
LinkSourceFile(kmod_noop.c,../shared)
+LinkSourceFile(agp_noop.c,../shared)
DependTarget()
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/sco/Imakefile b/xc/programs/Xserver/hw/xfree86/os-support/sco/Imakefile
index ccd0290ce..8ae037e55 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/sco/Imakefile
+++ b/xc/programs/Xserver/hw/xfree86/os-support/sco/Imakefile
@@ -1,4 +1,4 @@
-XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sco/Imakefile,v 3.9 2000/06/27 14:27:31 tsi Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sco/Imakefile,v 3.10 2000/08/15 16:05:39 dawes Exp $
@@ -10,12 +10,12 @@ XCOMM $XConsortium: Imakefile /main/4 1996/09/28 17:24:25 rws $
SRCS = sco_init.c sco_video.c sco_io.c bios_devmem.c VTsw_sco.c \
sysv_kbd.c std_kbdEv.c sysv_tty.c std_mseEv.c sco_mouse.c \
libc_wrapper.c stdResource.c stdPci.o sigiostubs.c pm_noop.c \
- kmod_noop.c
+ kmod_noop.c agp_noop.c
OBJS = sco_init.o sco_video.o sco_io.o bios_devmem.o VTsw_sco.o \
sysv_kbd.o std_kbdEv.o sysv_tty.o std_mseEv.o sco_mouse.o \
libc_wrapper.o stdResource.o stdPci.o sigiostubs.o pm_noop.o \
- kmod_noop.o
+ kmod_noop.o agp_noop.o
INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) -I. -I$(SERVERSRC)/include \
-I$(XINCLUDESRC)
@@ -38,6 +38,7 @@ LinkSourceFile(stdPci.c,../shared)
LinkSourceFile(sigiostubs.c,../shared)
LinkSourceFile(pm_noop.c,../shared)
LinkSourceFile(kmod_noop.c,../shared)
+LinkSourceFile(agp_noop.c,../shared)
DependTarget()
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/drm.h b/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/drm.h
index 5a979e1cb..6cfe88fa7 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/drm.h
+++ b/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/drm.h
@@ -31,11 +31,16 @@
* Dec 1999, Richard Henderson <rth@twiddle.net>, move to generic cmpxchg.
*
*/
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm.h,v 1.9 2000/08/24 22:20:18 tsi Exp $ */
#ifndef _DRM_H_
#define _DRM_H_
+#if defined(__linux__)
#include <asm/ioctl.h> /* For _IO* macros */
+#elif defined(__FreeBSD__)
+#include <sys/ioccom.h>
+#endif
#define DRM_PROC_DEVICES "/proc/devices"
#define DRM_PROC_MISC "/proc/misc"
@@ -289,7 +294,11 @@ typedef struct drm_agp_info {
} drm_agp_info_t;
#define DRM_IOCTL_BASE 'd'
+#if defined(__linux__)
#define DRM_IOCTL_NR(n) _IOC_NR(n)
+#elif defined(__FreeBSD__)
+#define DRM_IOCTL_NR(n) ((n) & 0xff)
+#endif
#define DRM_IO(nr) _IO(DRM_IOCTL_BASE,nr)
#define DRM_IOR(nr,size) _IOR(DRM_IOCTL_BASE,nr,size)
#define DRM_IOW(nr,size) _IOW(DRM_IOCTL_BASE,nr,size)
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/shared/libc_wrapper.c b/xc/programs/Xserver/hw/xfree86/os-support/shared/libc_wrapper.c
index 1af33de8f..247125e6d 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/shared/libc_wrapper.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/shared/libc_wrapper.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/libc_wrapper.c,v 1.67 2000/08/10 17:40:36 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/libc_wrapper.c,v 1.69 2000/09/19 12:46:22 eich Exp $ */
/*
* Copyright 1997 by The XFree86 Project, Inc.
*
@@ -145,7 +145,6 @@ typedef struct dirent DIRENTRY;
/* For xf86getpagesize() */
#if defined(linux)
-#include <asm/page.h>
#define HAS_SC_PAGESIZE
#define HAS_GETPAGESIZE
#elif defined(CSRG_BASED)
@@ -162,6 +161,7 @@ typedef struct dirent DIRENTRY;
#include <sys/ipc.h>
#include <sys/shm.h>
#endif
+#include <setjmp.h>
#if 0
#define SETBUF_RETURNS_INT
@@ -1884,3 +1884,16 @@ xf86shmdt(char *addr)
return -1;
}
#endif /* HAVE_SYSV_IPC */
+
+int
+xf86setjmp(xf86jmp_buf xf86env)
+{
+ return setjmp(xf86env);
+}
+
+void
+xf86longjmp(xf86jmp_buf xf86env, int val)
+{
+ longjmp(xf86env,val);
+}
+
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/sol8_x86/Imakefile b/xc/programs/Xserver/hw/xfree86/os-support/sol8_x86/Imakefile
index 873b5deb9..c000180a5 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/sol8_x86/Imakefile
+++ b/xc/programs/Xserver/hw/xfree86/os-support/sol8_x86/Imakefile
@@ -1,4 +1,4 @@
-XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sol8_x86/Imakefile,v 1.6 2000/08/11 19:51:04 dawes Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sol8_x86/Imakefile,v 1.7 2000/08/15 16:05:40 dawes Exp $
@@ -20,13 +20,13 @@ SRCS = sol8_init.c sol8_vid.c sol8_bios.c sol8_kbd.c sol8_io.c \
VTsw_noop.c sol8_kbd.c sol8_kbdEv.c posix_tty.c $(MOUSESRC) \
libc_wrapper.c $(PROWORKS_INOUT_SRC) stdResource.c stdPci.c \
sol8_kbdgetmapping.c sol8_postkbdevents.c sigiostubs.c pm_noop.c \
- kmod_noop.c
+ kmod_noop.c agp_noop.c
OBJS = sol8_init.o sol8_vid.o sol8_bios.o sol8_kbd.o sol8_io.o \
VTsw_noop.o sol8_kbd.o sol8_kbdEv.o posix_tty.o $(MOUSEOBJ) \
libc_wrapper.o $(PROWORKS_INOUT_OBJ) stdResource.o stdPci.o \
sol8_kbdgetmapping.o sol8_postkbdevents.o sigiostubs.o pm_noop.o \
- kmod_noop.o
+ kmod_noop.o agp_noop.o
INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) -I. -I$(SERVERSRC)/include \
-I$(XINCLUDESRC) -I$(EXTINCSRC)
@@ -47,5 +47,6 @@ LinkSourceFile(stdPci.c,../shared)
LinkSourceFile(sigiostubs.c,../shared)
LinkSourceFile(pm_noop.c,../shared)
LinkSourceFile(kmod_noop.c,../shared)
+LinkSourceFile(agp_noop.c,../shared)
DependTarget()
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/solx86/Imakefile b/xc/programs/Xserver/hw/xfree86/os-support/solx86/Imakefile
index a6af01b15..66a49289d 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/solx86/Imakefile
+++ b/xc/programs/Xserver/hw/xfree86/os-support/solx86/Imakefile
@@ -1,4 +1,4 @@
-XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/os-support/solx86/Imakefile,v 3.17 2000/06/17 00:03:43 martin Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/os-support/solx86/Imakefile,v 3.18 2000/08/15 16:05:40 dawes Exp $
@@ -19,12 +19,12 @@ MOUSEOBJ = solx86_mouse.o
SRCS = solx86_init.c solx86_vid.c solx86_bios.c sysv_io.c \
VTsw_usl.c sysv_kbd.c std_kbdEv.c posix_tty.c $(MOUSESRC) \
libc_wrapper.c $(PROWORKS_INOUT_SRC) stdResource.c stdPci.c \
- sigiostubs.c pm_noop.c kmod_noop.c
+ sigiostubs.c pm_noop.c kmod_noop.c agp_noop.c
OBJS = solx86_init.o solx86_vid.o solx86_bios.o sysv_io.o \
VTsw_usl.o sysv_kbd.o std_kbdEv.o posix_tty.o $(MOUSEOBJ) \
libc_wrapper.o $(PROWORKS_INOUT_OBJ) stdResource.o stdPci.o \
- sigiostubs.o pm_noop.o kmod_noop.o
+ sigiostubs.o pm_noop.o kmod_noop.o agp_noop.o
INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) -I. -I$(SERVERSRC)/include \
-I$(XINCLUDESRC) -I$(EXTINCSRC)
@@ -48,5 +48,6 @@ LinkSourceFile(stdPci.c,../shared)
LinkSourceFile(sigiostubs.c,../shared)
LinkSourceFile(pm_noop.c,../shared)
LinkSourceFile(kmod_noop.c,../shared)
+LinkSourceFile(agp_noop.c,../shared)
DependTarget()
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/sysv/Imakefile b/xc/programs/Xserver/hw/xfree86/os-support/sysv/Imakefile
index 08e68785b..8b79bd3e4 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/sysv/Imakefile
+++ b/xc/programs/Xserver/hw/xfree86/os-support/sysv/Imakefile
@@ -1,4 +1,4 @@
-XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sysv/Imakefile,v 3.22 2000/06/17 00:03:43 martin Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sysv/Imakefile,v 3.23 2000/08/15 16:05:40 dawes Exp $
@@ -20,12 +20,12 @@ MOUSEOBJ = sysv_mouse.o
SRCS = sysv_init.c sysv_video.c sysv_io.c $(BIOS_MOD).c VTsw_usl.c \
sysv_kbd.c std_kbdEv.c posix_tty.c $(MOUSESRC) xqueue.c \
libc_wrapper.c stdResource.c stdPci.c vidmem.c sigiostubs.c pm_noop.c \
- kmod_noop.c
+ kmod_noop.c agp_noop.c
OBJS = sysv_init.o sysv_video.o sysv_io.o $(BIOS_MOD).o VTsw_usl.o \
sysv_kbd.o std_kbdEv.o posix_tty.o $(MOUSEOBJ) xqueue.o \
libc_wrapper.o stdResource.o stdPci.o vidmem.o sigiostubs.o pm_noop.o \
- kmod_noop.o
+ kmod_noop.o agp_noop.o
INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) -I. -I$(SERVERSRC)/include \
-I$(XINCLUDESRC) -I$(EXTINCSRC) -I$(SERVERSRC)/mi
@@ -53,5 +53,6 @@ LinkSourceFile(vidmem.c,../shared)
LinkSourceFile(sigiostubs.c,../shared)
LinkSourceFile(pm_noop.c,../shared)
LinkSourceFile(kmod_noop.c,../shared)
+LinkSourceFile(agp_noop.c,../shared)
DependTarget()
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/xf86_OSproc.h b/xc/programs/Xserver/hw/xfree86/os-support/xf86_OSproc.h
index 8816c4ea1..ad389070d 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/xf86_OSproc.h
+++ b/xc/programs/Xserver/hw/xfree86/os-support/xf86_OSproc.h
@@ -64,7 +64,7 @@
*
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86_OSproc.h,v 3.43 2000/08/04 16:13:39 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86_OSproc.h,v 3.46 2000/08/23 21:06:21 dawes Exp $ */
#ifndef _XF86_OSPROC_H
#define _XF86_OSPROC_H
@@ -167,6 +167,28 @@ extern int xf86SerialModemSetBits(int fd, int bits);
extern int xf86SerialModemClearBits(int fd, int bits);
extern int xf86LoadKernelModule(const char *pathname);
+/* AGP GART interface */
+
+typedef struct _AgpInfo {
+ CARD32 bridgeId;
+ CARD32 agpMode;
+ unsigned long base;
+ unsigned long size;
+ unsigned long totalPages;
+ unsigned long systemPages;
+ unsigned long usedPages;
+} AgpInfo, *AgpInfoPtr;
+
+extern Bool xf86AgpGARTSupported(void);
+extern AgpInfoPtr xf86GetAGPInfo(int screenNum);
+extern Bool xf86AcquireGART(int screenNum);
+extern Bool xf86ReleaseGART(int screenNum);
+extern int xf86AllocateGARTMemory(int screenNum, unsigned long size, int type,
+ unsigned long *physical);
+extern Bool xf86BindGARTMemory(int screenNum, int key, unsigned long offset);
+extern Bool xf86UnbindGARTMemory(int screenNum, int key);
+extern Bool xf86EnableAGP(int screenNum, CARD32 mode);
+
#if defined(__alpha__)
/* entry points for Mmio memory access routines */
extern int (*xf86ReadMmio8)(pointer, unsigned long);
@@ -215,8 +237,10 @@ extern void xf86KbdInit(void);
extern int xf86KbdOn(void);
extern int xf86KbdOff(void);
extern void xf86KbdEvents(void);
+#ifdef XQUEUE
extern int xf86XqueKbdProc(DeviceIntPtr, int);
extern void xf86XqueEvents(void);
+#endif
extern PMClose xf86OSPMOpen(void);
#ifdef NEED_OS_RAC_PROTOS
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/xf86_ansic.h b/xc/programs/Xserver/hw/xfree86/os-support/xf86_ansic.h
index 6e4956812..a129fc0cf 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/xf86_ansic.h
+++ b/xc/programs/Xserver/hw/xfree86/os-support/xf86_ansic.h
@@ -22,7 +22,7 @@
*
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86_ansic.h,v 3.40 2000/06/17 00:03:26 martin Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86_ansic.h,v 3.42 2000/09/19 12:46:21 eich Exp $ */
#ifndef _XF86_ANSIC_H
#define _XF86_ANSIC_H
@@ -62,7 +62,7 @@
#endif
#ifndef NULL
-#define NULL 0
+#define NULL ((void *)0)
#endif
#ifndef EOF
#define EOF (-1)
@@ -297,6 +297,8 @@ extern int xf86shmget(xf86key_t key, int size, int xf86shmflg);
extern char * xf86shmat(int id, char *addr, int xf86shmflg);
extern int xf86shmdt(char *addr);
extern int xf86shmctl(int id, int xf86cmd, pointer *buf);
+extern int xf86setjmp(xf86jmp_buf env);
+extern void xf86longjmp(xf86jmp_buf env, int val);
#else /* XFree86LOADER || NEED_XF86_TYPES */
#include <unistd.h>
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/xf86_libc.h b/xc/programs/Xserver/hw/xfree86/os-support/xf86_libc.h
index 763952e10..09dffe9ad 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/xf86_libc.h
+++ b/xc/programs/Xserver/hw/xfree86/os-support/xf86_libc.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86_libc.h,v 3.48 2000/06/17 00:03:26 martin Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86_libc.h,v 3.49 2000/09/19 12:46:21 eich Exp $ */
@@ -70,6 +70,9 @@ struct xf86stat {
/* sysv IPC */
typedef int xf86key_t;
+/* setjmp/longjmp */
+typedef int xf86jmp_buf[20];
+
/* for setvbuf */
#define XF86_IONBF 1
#define XF86_IOFBF 2
@@ -437,6 +440,8 @@ typedef int xf86key_t;
#define shmat(a,b,c) xf86shmat(a,b,c)
#define shmdt(a) xf86shmdt(a)
#define shmctl(a,b,c) xf86shmctl(a,b,c)
+#define setjmp(a) xf86setjmp(a)
+#define longjmp(a,b) xf86longjmp(a,b)
#undef S_ISUID
#define S_ISUID XF86_S_ISUID
@@ -492,6 +497,8 @@ typedef int xf86key_t;
#define uid_t xf86uid_t
#undef gid_t
#define gid_t xf86gid_t
+#undef jmp_buf
+#define jmp_buf xf86jmp_buf
/*
* There should be no need to #undef any of these. If they are already
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/xf86drm.h b/xc/programs/Xserver/hw/xfree86/os-support/xf86drm.h
index 19a86ac8d..563daff13 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/xf86drm.h
+++ b/xc/programs/Xserver/hw/xfree86/os-support/xf86drm.h
@@ -26,7 +26,7 @@
*
* Author: Rickard E. (Rik) Faith <faith@valinux.com>
*
- * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86drm.h,v 1.9 2000/06/20 05:08:48 dawes Exp $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86drm.h,v 1.11 2000/08/28 16:27:00 dawes Exp $
*
*/
@@ -187,7 +187,8 @@ typedef struct { unsigned int a[100]; } __drm_dummy_lock_t;
#define DRM_LOCK_HELD 0x80000000 /* Hardware lock is held */
#define DRM_LOCK_CONT 0x40000000 /* Hardware lock is contended */
-#if __GNUC__ >= 2 && defined(__i386)
+#if __GNUC__ >= 2
+# if defined(__i386)
/* Reflect changes here to drmP.h */
#define DRM_CAS(lock,old,new,__ret) \
do { \
@@ -201,9 +202,8 @@ typedef struct { unsigned int a[100]; } __drm_dummy_lock_t;
: "2" (old), \
"r" (new)); \
} while (0)
-#endif
-#if __GNUC__ >= 2 && defined(__alpha__)
+#elif defined(__alpha__)
#define DRM_CAS(lock, old, new, ret) \
do { \
@@ -228,9 +228,8 @@ typedef struct { unsigned int a[100]; } __drm_dummy_lock_t;
"r" (new)); \
} while(0)
-#endif
+#elif defined(__sparc__)
-#ifdef __sparc__
#define DRM_CAS(lock,old,new,__ret) \
do { register unsigned int __old __asm("o0"); \
register unsigned int __new __asm("o1"); \
@@ -250,7 +249,38 @@ do { register unsigned int __old __asm("o0"); \
: "memory"); \
__ret = (__new != __old); \
} while(0)
+
+#elif defined(__ia64__)
+
+#if 0
+/* this currently generates bad code (missing stop bits)... */
+#include <ia64intrin.h>
+
+#define DRM_CAS(lock,old,new,__ret) \
+ do { \
+ __ret = (__sync_val_compare_and_swap(&__drm_dummy_lock(lock), \
+ (old), (new)) \
+ != (old)); \
+ } while (0)
+
+#else
+#define DRM_CAS(lock,old,new,__ret) \
+ do { \
+ unsigned int __result, __old = (old); \
+ __asm__ __volatile__( \
+ "mf\n" \
+ "mov ar.ccv=%2\n" \
+ ";;\n" \
+ "cmpxchg4.acq %0=%1,%3,ar.ccv" \
+ : "=r" (__result), "=m" (__drm_dummy_lock(lock)) \
+ : "r" (__old), "r" (new) \
+ : "memory"); \
+ __ret = (__result) != (__old); \
+ } while (0)
+
#endif
+#endif /* architecture */
+#endif /* __GNUC__ >= 2 */
#ifndef DRM_CAS
#define DRM_CAS(lock,old,new,ret) do { ret=1; } while (0) /* FAST LOCK FAILS */