summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordawes <dawes>2001-03-19 21:38:52 +0000
committerdawes <dawes>2001-03-19 21:38:52 +0000
commitc9a3e2ae446907ec2fd7470f0a51cf2105bc0319 (patch)
tree3f034e523fa1b41f57c7b2b364073a31fd0d8a75
parent326ae10581288b55caed7c82f687000ae3693eec (diff)
Initial XFree86 4.0.99.1 merge.
-rw-r--r--xc/extras/Mesa/src/X/xmesa1.c1
-rw-r--r--xc/extras/Mesa/src/X86/common_x86_asm.S7
-rw-r--r--xc/extras/Mesa/src/texture.c1
-rw-r--r--xc/extras/rman/rman.c4
-rw-r--r--xc/include/Imakefile10
-rw-r--r--xc/include/extensions/renderproto.h3
-rw-r--r--xc/lib/GL/Imakefile2
-rw-r--r--xc/lib/GL/dri/drm/Imakefile2
-rw-r--r--xc/lib/GL/dri/xf86dristr.h2
-rw-r--r--xc/lib/GL/glx/glxext.c6
-rw-r--r--xc/lib/GL/mesa/dri/dri_mesa.c2
-rw-r--r--xc/lib/GL/mesa/src/drv/Imakefile2
-rw-r--r--xc/lib/GL/mesa/src/drv/ffb/Imakefile4
-rw-r--r--xc/lib/GL/mesa/src/drv/gamma/Imakefile8
-rw-r--r--xc/lib/GL/mesa/src/drv/gamma/gamma_gl.c888
-rw-r--r--xc/lib/GL/mesa/src/drv/gamma/gamma_gl.h7
-rw-r--r--xc/lib/GL/mesa/src/drv/gamma/gamma_init.h99
-rw-r--r--xc/lib/GL/mesa/src/drv/gamma/gamma_inithw.c6
-rw-r--r--xc/lib/GL/mesa/src/drv/gamma/gamma_regs.h11
-rw-r--r--xc/lib/GL/mesa/src/drv/gamma/gamma_xmesa.c103
-rw-r--r--xc/lib/GL/mesa/src/drv/i810/Imakefile4
-rw-r--r--xc/lib/GL/mesa/src/drv/i810/i810_xmesa.c4
-rw-r--r--xc/lib/GL/mesa/src/drv/mga/Imakefile6
-rw-r--r--xc/lib/GL/mesa/src/drv/mga/mga_xmesa.c2
-rw-r--r--xc/lib/GL/mesa/src/drv/mga/mgabuffers.c2
-rw-r--r--xc/lib/GL/mesa/src/drv/mga/mgacontext.h2
-rw-r--r--xc/lib/GL/mesa/src/drv/mga/mgadd.c2
-rw-r--r--xc/lib/GL/mesa/src/drv/mga/mgaioctl.c2
-rw-r--r--xc/lib/GL/mesa/src/drv/mga/mgaioctl.h2
-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.c17
-rw-r--r--xc/lib/GL/mesa/src/drv/mga/mgatex.h2
-rw-r--r--xc/lib/GL/mesa/src/drv/mga/mgatexmem.c2
-rw-r--r--xc/lib/GL/mesa/src/drv/mga/mgatris.c2
-rw-r--r--xc/lib/GL/mesa/src/drv/mga/mgatris.h2
-rw-r--r--xc/lib/GL/mesa/src/drv/mga/mgavb.c2
-rw-r--r--xc/lib/GL/mesa/src/drv/r128/Imakefile4
-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.c16
-rw-r--r--xc/lib/GL/mesa/src/drv/r128/r128_dd.h2
-rw-r--r--xc/lib/GL/mesa/src/drv/r128/r128_eltpath.c2
-rw-r--r--xc/lib/GL/mesa/src/drv/r128/r128_elttmp.h2
-rw-r--r--xc/lib/GL/mesa/src/drv/r128/r128_fastpath.c2
-rw-r--r--xc/lib/GL/mesa/src/drv/r128/r128_fasttmp.h2
-rw-r--r--xc/lib/GL/mesa/src/drv/r128/r128_ioctl.c2
-rw-r--r--xc/lib/GL/mesa/src/drv/r128/r128_ioctl.h2
-rw-r--r--xc/lib/GL/mesa/src/drv/r128/r128_lock.c2
-rw-r--r--xc/lib/GL/mesa/src/drv/r128/r128_lock.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_span.h2
-rw-r--r--xc/lib/GL/mesa/src/drv/r128/r128_state.c2
-rw-r--r--xc/lib/GL/mesa/src/drv/r128/r128_state.h2
-rw-r--r--xc/lib/GL/mesa/src/drv/r128/r128_tex.c2
-rw-r--r--xc/lib/GL/mesa/src/drv/r128/r128_tex.h2
-rw-r--r--xc/lib/GL/mesa/src/drv/r128/r128_texobj.h2
-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/r128/r128_xmesa.c2
-rw-r--r--xc/lib/GL/mesa/src/drv/sis/sis_alloc.c2
-rw-r--r--xc/lib/GL/mesa/src/drv/sis/sis_xmesa.c35
-rw-r--r--xc/lib/GL/mesa/src/drv/tdfx/Imakefile4
-rw-r--r--xc/lib/GL/mesa/src/drv/tdfx/tdfx_xmesa.c2
-rw-r--r--xc/lib/Xft/Imakefile8
-rw-r--r--xc/lib/Xft/Xft.h39
-rw-r--r--xc/lib/Xft/XftFreetype.h41
-rw-r--r--xc/lib/Xft/xftcfg.c42
-rw-r--r--xc/lib/Xft/xftcore.c71
-rw-r--r--xc/lib/Xft/xftdpy.c47
-rw-r--r--xc/lib/Xft/xftdraw.c50
-rw-r--r--xc/lib/Xft/xftextent.c109
-rw-r--r--xc/lib/Xft/xftfont.c54
-rw-r--r--xc/lib/Xft/xftfreetype.c406
-rw-r--r--xc/lib/Xft/xftglyphs.c133
-rw-r--r--xc/lib/Xft/xftgram.y7
-rw-r--r--xc/lib/Xft/xftint.h70
-rw-r--r--xc/lib/Xft/xftlex.l3
-rw-r--r--xc/lib/Xft/xftmatch.c107
-rw-r--r--xc/lib/Xft/xftname.c140
-rw-r--r--xc/lib/Xft/xftrender.c173
-rw-r--r--xc/lib/Xft/xftstr.c106
-rw-r--r--xc/lib/Xft/xftxlfd.c77
-rw-r--r--xc/nls/Compose/th_TH.TACTIS15
-rw-r--r--xc/nls/XLC_LOCALE/th_TH.TACTIS66
-rw-r--r--xc/programs/Imakefile32
-rw-r--r--xc/programs/Xserver/GL/dri/dri.c214
-rw-r--r--xc/programs/Xserver/GL/dri/dri.h20
-rw-r--r--xc/programs/Xserver/GL/glx/glxext.c7
-rw-r--r--xc/programs/Xserver/GL/glx/glxscreens.c19
-rw-r--r--xc/programs/Xserver/GL/glx/glxscreens.h6
-rw-r--r--xc/programs/Xserver/GL/mesa/src/X/xf86glx.c7
-rw-r--r--xc/programs/Xserver/Imakefile23
-rw-r--r--xc/programs/Xserver/Xext/panoramiX.h7
-rw-r--r--xc/programs/Xserver/Xext/panoramiXsrv.h2
-rw-r--r--xc/programs/Xserver/Xserver.man (renamed from xc/programs/Xserver/Xserver.cpp)52
-rw-r--r--xc/programs/Xserver/fb/fbpict.c175
-rw-r--r--xc/programs/Xserver/fb/fbpict.h5
-rw-r--r--xc/programs/Xserver/hw/darwin/Imakefile24
-rw-r--r--xc/programs/Xserver/hw/darwin/Xdarwin.cpp69
-rw-r--r--xc/programs/Xserver/hw/darwin/Xdarwin.man114
-rw-r--r--xc/programs/Xserver/hw/darwin/darwin.c938
-rw-r--r--xc/programs/Xserver/hw/darwin/darwinCursor.c706
-rw-r--r--xc/programs/Xserver/hw/kdrive/vesa/Xvesa.man6
-rw-r--r--xc/programs/Xserver/hw/vfb/Xvfb.man (renamed from xc/programs/Xserver/hw/vfb/Xvfb.cpp)10
-rw-r--r--xc/programs/Xserver/hw/xfree86/XF86Config.cpp1607
-rw-r--r--xc/programs/Xserver/hw/xfree86/XFree86.man (renamed from xc/programs/Xserver/hw/xfree86/XFree86.cpp)6
-rw-r--r--xc/programs/Xserver/hw/xfree86/common/xf86Config.c17
-rw-r--r--xc/programs/Xserver/hw/xfree86/common/xf86PciInfo.h22
-rw-r--r--xc/programs/Xserver/hw/xfree86/common/xf86pciBus.c192
-rw-r--r--xc/programs/Xserver/hw/xfree86/ddc/ddcProperty.c3
-rw-r--r--xc/programs/Xserver/hw/xfree86/doc/BugReport57
-rw-r--r--xc/programs/Xserver/hw/xfree86/doc/README.DRI234
-rw-r--r--xc/programs/Xserver/hw/xfree86/doc/README.DRIcomp181
-rw-r--r--xc/programs/Xserver/hw/xfree86/doc/README.trident180
-rw-r--r--xc/programs/Xserver/hw/xfree86/doc/sgml/DRI.sgml3
-rw-r--r--xc/programs/Xserver/hw/xfree86/doc/sgml/DRIcomp.sgml4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/apm/apm.cpp30
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ark/ark_driver.c27
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/Imakefile6
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/ati.cpp30
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atidga.c4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atidga.h4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64io.h18
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atimodule.h4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/r128.cpp75
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/r128.h6
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/r128_accel.c10
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/r128_cursor.c4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/r128_dri.c2
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/r128_dri.h2
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/r128_driver.c222
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/r128_probe.c10
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/r128_reg.h17
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/r128_sarea.h2
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/r128_video.c246
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/radeon.h9
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_accel.c10
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_cursor.c4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c85
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_misc.c4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_probe.c8
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_reg.h9
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_video.c10
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/chips/chips.cpp203
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/chips/ct_video.c13
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp.h10
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_dga.c81
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_driver.c334
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_xaa.c178
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_xaam.c253
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/cirrus/cir_dga.c257
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/cirrus/cirrus.cpp30
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix.cpp30
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/fbdev/fbdev.cpp56
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/glide/glide.cpp298
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/glint/Imakefile14
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/glint/README.pm311
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/glint/TIdualramdac.c133
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/glint/dualmx_accel.c1003
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/glint/dualmx_dac.c807
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/glint/glint.cpp114
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/glint/glint.h84
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/glint/glint_dga.c7
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/glint/glint_dri.c398
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/glint/glint_dri.h4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/glint/glint_driver.c1119
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/glint/glint_regs.h109
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_accel.c479
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_accel.c706
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_dac.c642
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_regs.h19
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/glint/tx_accel.c204
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/i128/Imakefile3
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/i128/i128.cpp70
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/i128/i128_driver.c18
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/i740/i740.cpp30
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/i810/Imakefile3
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/i810/i810.cpp71
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/i810/i810_dri.c2
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c28
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/i810/i810_video.c17
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/imstt/Imakefile3
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt.cpp30
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/mga/Imakefile7
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/mga/mga.cpp122
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/mga/mga.h3
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dacG.c41
-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.c183
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/mga/mga_macros.h4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/mga/mga_storm.c30
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/mga/mga_video.c6
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/neomagic/neomagic.cpp90
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/newport/Imakefile3
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/newport/newport.cpp40
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/nv/nv.cpp61
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/nv/nv_shadow.c16
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition.cpp112
-rwxr-xr-xxc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v_xv.c6
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3virge.cpp186
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/savage/savage.cpp96
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/savage/savage_accel.c101
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/savage/savage_driver.c815
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/savage/savage_driver.h53
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/savage/savage_regs.h125
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/README3
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/Release.txt42
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/siliconmotion.cpp195
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi.h4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_accel.c15
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_driver.c140
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_video.c21
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/sis/init301.c4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/sis/sis.cpp30
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.c2
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/sunbw2/sunbw2.cpp30
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/suncg14/suncg14.cpp30
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/suncg3/suncg3.cpp30
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/suncg6/suncg6.cpp30
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_dri.c15
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/sunffb/sunffb.cpp30
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/sunleo/sunleo.cpp30
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/suntcx/suntcx.cpp30
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/tdfx/Imakefile3
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx.h2
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx.man (renamed from xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx.cpp)4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_dga.c78
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_dri.c169
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_driver.c134
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_video.c1205
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfxdefs.h2
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/trident/trident.cpp81
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng.cpp30
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/v4l/v4l.cpp30
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.c1055
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.cpp53
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.h223
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/vga/vga.cpp66
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/Xinstall.sh4
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-axp/var-list3
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ix86/var-list3
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-m68k/var-list3
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-mips/var-list3
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/pcitweak.man4
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/scanpci.man4
-rw-r--r--xc/programs/Xserver/hw/xfree86/fbdevhw/fbdevhw.cpp21
-rw-r--r--xc/programs/Xserver/hw/xfree86/input/citron/citron.cpp629
-rw-r--r--xc/programs/Xserver/hw/xfree86/input/dynapro/dynapro.cpp36
-rw-r--r--xc/programs/Xserver/hw/xfree86/input/elographics/elographics.cpp40
-rw-r--r--xc/programs/Xserver/hw/xfree86/input/keyboard/keyboard.cpp97
-rw-r--r--xc/programs/Xserver/hw/xfree86/input/microtouch/microtouch.cpp36
-rw-r--r--xc/programs/Xserver/hw/xfree86/input/mouse/mouse.cpp151
-rw-r--r--xc/programs/Xserver/hw/xfree86/input/mutouch/mutouch.cpp40
-rw-r--r--xc/programs/Xserver/hw/xfree86/input/penmount/penmount.cpp37
-rw-r--r--xc/programs/Xserver/hw/xfree86/input/void/void.cpp29
-rw-r--r--xc/programs/Xserver/hw/xfree86/input/wacom/wacom.cpp116
-rw-r--r--xc/programs/Xserver/hw/xfree86/loader/xf86sym.c62
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/bsd/Imakefile11
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/bsd/bsdResource.c77
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/Imakefile25
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/Imakefile3
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/Imakefile2
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/Makefile.linux2
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mga_drm.h8
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/radeon_bufs.c298
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/radeon_context.c215
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmR128.c2
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmSiS.c2
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/int10/linux.c397
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/lnxResource.c142
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/shared/libc_wrapper.c11
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/vbe/vbe.c598
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/vbe/vbe.h245
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/xf86_OSproc.h9
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/xf86drmR128.h2
-rw-r--r--xc/programs/Xserver/hw/xfree86/xaa/xaaPict.c404
-rw-r--r--xc/programs/Xserver/hw/xfree86/xf86cfg/Imakefile5
-rw-r--r--xc/programs/Xserver/hw/xfree86/xf86cfg/XF86Cfg.ad5
-rw-r--r--xc/programs/Xserver/hw/xfree86/xf86cfg/accessx.c300
-rw-r--r--xc/programs/Xserver/hw/xfree86/xf86cfg/interface.c6
-rw-r--r--xc/programs/Xserver/hw/xfree86/xf86cfg/monitor-cfg.c3
-rw-r--r--xc/programs/Xserver/hw/xfree86/xf86cfg/xf86cfg.man (renamed from xc/programs/Xserver/hw/xfree86/xf86cfg/xf86cfg.cpp)4
-rw-r--r--xc/programs/Xserver/hw/xfree86/xf86config/xf86config.cpp16
-rw-r--r--xc/programs/Xserver/hw/xwin/InitOutput.c990
-rw-r--r--xc/programs/Xserver/os/Imakefile9
-rw-r--r--xc/programs/Xserver/render/picturestr.h12
-rw-r--r--xc/programs/Xserver/render/render.c598
295 files changed, 12435 insertions, 15981 deletions
diff --git a/xc/extras/Mesa/src/X/xmesa1.c b/xc/extras/Mesa/src/X/xmesa1.c
index 78eb21901..c3cd5cf4f 100644
--- a/xc/extras/Mesa/src/X/xmesa1.c
+++ b/xc/extras/Mesa/src/X/xmesa1.c
@@ -1,3 +1,4 @@
+/* $Id: xmesa1.c,v 1.19 2001/03/19 21:38:52 dawes Exp $ */
/*
* Mesa 3-D graphics library
diff --git a/xc/extras/Mesa/src/X86/common_x86_asm.S b/xc/extras/Mesa/src/X86/common_x86_asm.S
index 44120051a..f55e9b198 100644
--- a/xc/extras/Mesa/src/X86/common_x86_asm.S
+++ b/xc/extras/Mesa/src/X86/common_x86_asm.S
@@ -32,7 +32,7 @@
*
* Cleaned up and simplified by Gareth Hughes <gareth@valinux.com>
*/
-/* $XFree86: xc/extras/Mesa/src/X86/common_x86_asm.S,v 1.5 2000/12/12 23:52:37 dawes Exp $ */
+/* $XFree86: xc/extras/Mesa/src/X86/common_x86_asm.S,v 1.6 2001/01/17 12:50:11 alanh Exp $ */
#include "assyntax.h"
#include "common_x86_features.h"
@@ -58,10 +58,8 @@
GLNAME( found_intel ): STRING( "Genuine Intel processor found\n\0" )
GLNAME( found_amd ): STRING( "Authentic AMD processor found\n\0" )
-#ifdef USE_KATMAI_ASM
GLNAME( katmai_test_dummy ):
D_LONG 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000
-#endif
SEG_TEXT
@@ -157,7 +155,6 @@ LLBL ( cpuid_done ):
RET
-#ifdef USE_KATMAI_ASM
/* Execute an SSE instruction to see if the operating system correctly
* supports SSE. A signal handler for SIGILL should have been set
* before calling this function, otherwise this could kill the client
@@ -206,5 +203,3 @@ GLNAME( gl_test_os_katmai_exception_support ):
LEAVE
RET
-
-#endif
diff --git a/xc/extras/Mesa/src/texture.c b/xc/extras/Mesa/src/texture.c
index 6a2b2dfb1..60a5542b8 100644
--- a/xc/extras/Mesa/src/texture.c
+++ b/xc/extras/Mesa/src/texture.c
@@ -104,6 +104,7 @@ typedef void (*build_f_func)( GLfloat *f,
#define FIRST_NORMAL normals->start
#define CUR_NORMAL (void) normal
#define NEXT_NORMAL STRIDE_F(normal, normals->stride)
+#define LOCAL_VARS
#define CHECK if (cullmask[i])
#define LOCAL_VARS
#include "texgen_tmp.h"
diff --git a/xc/extras/rman/rman.c b/xc/extras/rman/rman.c
index 32a1c1f59..9d615f4fc 100644
--- a/xc/extras/rman/rman.c
+++ b/xc/extras/rman/rman.c
@@ -16,7 +16,7 @@ static char rcsid[] = "Header: /home/cs/phelps/spine/rman/RCS/rman.c,v 1.144 199
source interpretation added September 24, 1996
renamed PolyglotMan due to lawsuit by Rosetta, Inc. August 8, 1997
*/
-/* $XFree86: xc/extras/rman/rman.c,v 1.12 2000/12/01 18:48:08 dawes Exp $ */
+/* $XFree86: xc/extras/rman/rman.c,v 1.13 2000/12/21 18:55:27 dawes Exp $ */
/* TO DO ****
@@ -474,12 +474,14 @@ manrefextract(char *p)
{
char *p0;
static char *nonhref = "\">'";
+ static char *punct = ".,:;)]}?!";
while (*p==' ') p++;
if (strincmp(p,"http",4)==0) {
href="%s"; manrefname = p;
p+=4;
while (*p && !isspace(*p) && !strchr(nonhref,*p)) p++;
+ while (strchr(punct, *(p - 1))) p--;
} else {
href = manRef;
diff --git a/xc/include/Imakefile b/xc/include/Imakefile
index 98899f60f..af2d84d88 100644
--- a/xc/include/Imakefile
+++ b/xc/include/Imakefile
@@ -1,9 +1,9 @@
-XCOMM $TOG: Imakefile /main/93 1997/06/13 15:34:58 kaleb $
+XCOMM $Xorg: Imakefile,v 1.3 2000/08/18 04:05:43 coskrey Exp $
-XCOMM $XFree86: xc/include/Imakefile,v 3.25 2000/07/02 19:23:34 dawes Exp $
+XCOMM $XFree86: xc/include/Imakefile,v 3.27 2001/01/21 21:19:08 tsi Exp $
#define IHaveSubdirs
#define PassCDebugFlags /**/
@@ -52,11 +52,7 @@ BuildIncludes($(HEADERS),X11,..)
InstallMultipleFlags($(HEADERS),$(INCDIR)/X11,$(INSTINCFLAGS))
MakeSubdirs($(SUBDIRS))
-
-depend::
-
-clean::
-
+DependSubdirs($(SUBDIRS))
InstallDriverSDKNonExecFile(X.h,$(DRIVERSDKINCLUDEDIR))
InstallDriverSDKNonExecFile(Xalloca.h,$(DRIVERSDKINCLUDEDIR))
diff --git a/xc/include/extensions/renderproto.h b/xc/include/extensions/renderproto.h
index 9b7433115..f8cbafb89 100644
--- a/xc/include/extensions/renderproto.h
+++ b/xc/include/extensions/renderproto.h
@@ -1,5 +1,5 @@
/*
- * $XFree86: xc/include/extensions/renderproto.h,v 1.5 2000/11/20 07:13:09 keithp Exp $
+ * $XFree86: xc/include/extensions/renderproto.h,v 1.6 2001/01/21 21:19:08 tsi Exp $
*
* Copyright © 2000 SuSE, Inc.
*
@@ -26,6 +26,7 @@
#ifndef _XRENDERP_H_
#define _XRENDERP_H_
+#include <X11/Xmd.h>
#include "render.h"
#define Window CARD32
diff --git a/xc/lib/GL/Imakefile b/xc/lib/GL/Imakefile
index 7c604c105..1dbb7b114 100644
--- a/xc/lib/GL/Imakefile
+++ b/xc/lib/GL/Imakefile
@@ -1,4 +1,4 @@
-XCOMM $XFree86: xc/lib/GL/Imakefile,v 1.34 2000/12/12 23:24:26 dawes Exp $
+XCOMM $XFree86: xc/lib/GL/Imakefile,v 1.35 2001/01/08 01:07:16 martin Exp $
#include <Threads.tmpl>
diff --git a/xc/lib/GL/dri/drm/Imakefile b/xc/lib/GL/dri/drm/Imakefile
index db0e2bc32..dc889dc31 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.10 2000/09/24 13:51:00 alanh Exp $
+XCOMM $XFree86: xc/lib/GL/dri/drm/Imakefile,v 1.11 2001/01/08 01:07:17 martin Exp $
#define DoNormalLib NormalLibGlx
#define DoSharedLib SharedLibGlx
diff --git a/xc/lib/GL/dri/xf86dristr.h b/xc/lib/GL/dri/xf86dristr.h
index e380de8a9..a851b00a3 100644
--- a/xc/lib/GL/dri/xf86dristr.h
+++ b/xc/lib/GL/dri/xf86dristr.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/dri/xf86dristr.h,v 1.7 2000/12/07 20:26:02 dawes Exp $ */
+/* $XFree86: xc/lib/GL/dri/xf86dristr.h,v 1.8 2000/12/21 12:22:55 alanh Exp $ */
/**************************************************************************
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
diff --git a/xc/lib/GL/glx/glxext.c b/xc/lib/GL/glx/glxext.c
index 6287be5c5..efca0c713 100644
--- a/xc/lib/GL/glx/glxext.c
+++ b/xc/lib/GL/glx/glxext.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/glx/glxext.c,v 1.9 2000/12/07 20:26:03 dawes Exp $ */
+/* $XFree86: xc/lib/GL/glx/glxext.c,v 1.10 2001/01/16 05:10:55 martin Exp $ */
/*
** License Applicability. Except to the extent portions of this file are
@@ -33,8 +33,8 @@
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
-** $Date: 2001/01/11 16:20:37 $ $Revision: 1.16 $
-** $Header: /home/ajax/dri-backup/xc/xc/lib/GL/glx/glxext.c,v 1.16 2001/01/11 16:20:37 kem Exp $
+** $Date: 2001/03/19 21:38:54 $ $Revision: 1.17 $
+** $Header: /home/ajax/dri-backup/xc/xc/lib/GL/glx/glxext.c,v 1.17 2001/03/19 21:38:54 dawes Exp $
*/
/* <
diff --git a/xc/lib/GL/mesa/dri/dri_mesa.c b/xc/lib/GL/mesa/dri/dri_mesa.c
index dd9fdddc8..d4776fcf1 100644
--- a/xc/lib/GL/mesa/dri/dri_mesa.c
+++ b/xc/lib/GL/mesa/dri/dri_mesa.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/dri/dri_mesa.c,v 1.13 2000/12/07 20:26:04 dawes Exp $ */
+/* $XFree86: xc/lib/GL/mesa/dri/dri_mesa.c,v 1.14 2001/01/16 05:10:57 martin Exp $ */
/**************************************************************************
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
diff --git a/xc/lib/GL/mesa/src/drv/Imakefile b/xc/lib/GL/mesa/src/drv/Imakefile
index 0f0dcebf5..6639512c2 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.16 2000/12/04 18:54:13 dawes Exp $
+XCOMM $XFree86: xc/lib/GL/mesa/src/drv/Imakefile,v 1.17 2001/01/08 01:07:17 martin Exp $
#define DoNormalLib NormalLibGlx
#define DoSharedLib SharedLibGlx
diff --git a/xc/lib/GL/mesa/src/drv/ffb/Imakefile b/xc/lib/GL/mesa/src/drv/ffb/Imakefile
index b3ae59e4f..338faa722 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.6 2000/10/20 12:57:22 alanh Exp $
+XCOMM $XFree86: xc/lib/GL/mesa/src/drv/ffb/Imakefile,v 1.7 2001/02/16 01:26:09 dawes Exp $
#include <Threads.tmpl>
@@ -229,7 +229,7 @@ NormalLintTarget($(SRCS))
LIBNAME = ffb_dri.so
ALL_OBJS = $(OBJS)
ALL_DEPS = DONE
-SharedDepModuleTarget($(LIBNAME),$(ALL_DEPS),$(ALL_OBJS))
+SharedDriModuleTarget($(LIBNAME),$(ALL_DEPS),$(ALL_OBJS))
InstallDynamicModule($(LIBNAME),$(MODULEDIR),dri)
#endif
diff --git a/xc/lib/GL/mesa/src/drv/gamma/Imakefile b/xc/lib/GL/mesa/src/drv/gamma/Imakefile
index 48387680e..c1bb6d990 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.16 2000/12/12 23:24:27 dawes Exp $
+XCOMM $XFree86: xc/lib/GL/mesa/src/drv/gamma/Imakefile,v 1.18 2001/02/16 01:26:10 dawes Exp $
#include <Threads.tmpl>
@@ -64,7 +64,7 @@ MESA_INCLUDES = -I. -I.. -I../../include \
gamma_matrix.c \
gamma_inithw.c \
gamma_texture.c \
- /* gamma_dlist.c */
+ gamma_dlist.c
GAMMAOBJS = gamma_gl.o \
gamma_xmesa.o \
@@ -72,7 +72,7 @@ MESA_INCLUDES = -I. -I.. -I../../include \
gamma_matrix.o \
gamma_inithw.o \
gamma_texture.o \
- /* gamma_dlist.o */
+ gamma_dlist.o
MESASRCS = ../../aatriangle.c \
../../accum.c \
@@ -348,7 +348,7 @@ NormalLintTarget($(SRCS))
LIBNAME = gamma_dri.so
ALL_OBJS = $(OBJS)
ALL_DEPS = DONE
-SharedDepModuleTarget($(LIBNAME),$(ALL_DEPS),$(ALL_OBJS))
+SharedDriModuleTarget($(LIBNAME),$(ALL_DEPS),$(ALL_OBJS))
InstallDynamicModule($(LIBNAME),$(MODULEDIR),dri)
#ifdef GlxSoProf
diff --git a/xc/lib/GL/mesa/src/drv/gamma/gamma_gl.c b/xc/lib/GL/mesa/src/drv/gamma/gamma_gl.c
index 930039fa4..d859e5d50 100644
--- a/xc/lib/GL/mesa/src/drv/gamma/gamma_gl.c
+++ b/xc/lib/GL/mesa/src/drv/gamma/gamma_gl.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_gl.c,v 1.7 2000/11/27 10:59:36 alanh Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_gl.c,v 1.9 2001/02/07 13:26:16 alanh Exp $ */
/**************************************************************************
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
@@ -39,14 +39,89 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <math.h>
#include "gamma_gl.h"
#include "gamma_init.h"
+#include "gamma_dlist.h"
#include "glint_dri.h"
-#ifdef RANDOMIZE_COLORS
-#include <stdlib.h>
+
+/* Here for now, will change get.c to move them into macros.h later */
+
+#define FLOAT_TO_BOOL(X) ( (X)==0.0F ? GL_FALSE : GL_TRUE )
+#define INT_TO_BOOL(I) ( (I)==0 ? GL_FALSE : GL_TRUE )
+#define ENUM_TO_BOOL(E) ( (E)==0 ? GL_FALSE : GL_TRUE )
+
+void gamma_error( GLenum error, const char *s )
+{
+ GLboolean debug;
+
+#ifdef DEBUG
+ debug = GL_TRUE;
+#else
+ if (getenv("MESA_DEBUG")) {
+ debug = GL_TRUE;
+ }
+ else {
+ debug = GL_FALSE;
+ }
#endif
+ if (debug) {
+ char errstr[1000];
+
+ switch (error) {
+ case GL_NO_ERROR:
+ strcpy( errstr, "GL_NO_ERROR" );
+ break;
+ case GL_INVALID_VALUE:
+ strcpy( errstr, "GL_INVALID_VALUE" );
+ break;
+ case GL_INVALID_ENUM:
+ strcpy( errstr, "GL_INVALID_ENUM" );
+ break;
+ case GL_INVALID_OPERATION:
+ strcpy( errstr, "GL_INVALID_OPERATION" );
+ break;
+ case GL_STACK_OVERFLOW:
+ strcpy( errstr, "GL_STACK_OVERFLOW" );
+ break;
+ case GL_STACK_UNDERFLOW:
+ strcpy( errstr, "GL_STACK_UNDERFLOW" );
+ break;
+ case GL_OUT_OF_MEMORY:
+ strcpy( errstr, "GL_OUT_OF_MEMORY" );
+ break;
+ default:
+ strcpy( errstr, "unknown" );
+ break;
+ }
+ fprintf( stderr, "Mesa user error: %s in %s\n", errstr, s );
+ }
+
+ if (gCCPriv->ErrorValue==GL_NO_ERROR) {
+ gCCPriv->ErrorValue = error;
+ }
+
+ /* _gamma_Error( ); use hwLog or something later */
+}
+
+
void _gamma_Accum(GLenum op, GLfloat value)
{
DEBUG_GLCMDS(("Accum: %d %f\n", (int)op, value));
+
+ switch (op) {
+ case GL_ACCUM:
+ break;
+ case GL_LOAD:
+ break;
+ case GL_ADD:
+ break;
+ case GL_MULT:
+ break;
+ case GL_RETURN:
+ break;
+ default:
+ gCCPriv->ErrorValue = GL_INVALID_ENUM;
+ return;
+ }
}
void _gamma_AlphaFunc(GLenum func, GLclampf ref)
@@ -350,6 +425,7 @@ void _gamma_BlendFunc(GLenum sfactor, GLenum dfactor)
}
}
+#if 0 /* Now in dlist.c */
void _gamma_CallList(GLuint list)
{
DEBUG_GLCMDS(("CallList: %d\n", (unsigned int)list));
@@ -359,6 +435,7 @@ void _gamma_CallLists(GLsizei n, GLenum type, const GLvoid *lists)
{
DEBUG_GLCMDS(("CallLists: %d %04x\n", (int)n, (int)type));
}
+#endif
void _gamma_Clear(GLbitfield mask)
{
@@ -445,7 +522,7 @@ void _gamma_Clear(GLbitfield mask)
temp = (gCCPriv->LBReadMode & LBPartialProdMask) | LBWindowOriginBot;
/* UGH - move this later ! */
- if (gDRIPriv->numMXDevices == 2) temp |= LBScanLineInt2;
+ if (gDRIPriv->numMultiDevices == 2) temp |= LBScanLineInt2;
CHECK_DMA_BUFFER(gCC, gCCPriv, 1);
WRITE(gCCPriv->buf, LBReadMode, temp);
@@ -634,28 +711,16 @@ void _gamma_ClipPlane(GLenum plane, const GLdouble *equation)
void _gamma_Color3b(GLbyte red, GLbyte green, GLbyte blue)
{
- GLfloat r,g,b;
-
DEBUG_GLCMDS(("Color3b: %d %d %d\n", red, green, blue));
- r = BYTE_TO_FLOAT(red);
- g = BYTE_TO_FLOAT(green);
- b = BYTE_TO_FLOAT(blue);
-
- _gamma_Color3f(r,g,b);
+ _gamma_Color3f((GLfloat)red,(GLfloat)green,(GLfloat)blue);
}
void _gamma_Color3bv(const GLbyte *v)
{
- GLfloat p[3];
-
DEBUG_GLCMDS(("Color3bv: %d %d %d\n", v[0], v[1], v[2]));
- p[0] = BYTE_TO_FLOAT(v[0]);
- p[1] = BYTE_TO_FLOAT(v[1]);
- p[2] = BYTE_TO_FLOAT(v[2]);
-
- _gamma_Color3f(p[0],p[1],p[2]);
+ _gamma_Color3f((GLfloat)v[0],(GLfloat)v[1],(GLfloat)v[2]);
}
void _gamma_Color3d(GLdouble red, GLdouble green, GLdouble blue)
@@ -669,13 +734,18 @@ void _gamma_Color3dv(const GLdouble *v)
{
DEBUG_GLCMDS(("Color3dv: %f %f %f\n", v[0], v[1], v[2]));
- _gamma_Color3fv((GLfloat*)v);
+ _gamma_Color3f((GLfloat)v[0],(GLfloat)v[1],(GLfloat)v[2]);
}
void _gamma_Color3f(GLfloat red, GLfloat green, GLfloat blue)
{
DEBUG_GLCMDS(("Color3f: %f %f %f\n", red, green, blue));
+ gCCPriv->Current.Color[0] = red;
+ gCCPriv->Current.Color[1] = green;
+ gCCPriv->Current.Color[2] = blue;
+ gCCPriv->Current.Color[3] = 1.0f;
+
CHECK_DMA_BUFFER(gCC, gCCPriv, 3);
WRITEF(gCCPriv->buf, Cb, blue);
WRITEF(gCCPriv->buf, Cg, green);
@@ -686,62 +756,35 @@ void _gamma_Color3fv(const GLfloat *v)
{
DEBUG_GLCMDS(("Color3fv: %f %f %f\n", v[0], v[1], v[2]));
- CHECK_DMA_BUFFER(gCC, gCCPriv, 3);
- WRITEF(gCCPriv->buf, Cb, v[2]);
- WRITEF(gCCPriv->buf, Cg, v[1]);
- WRITEF(gCCPriv->buf, Cr3, v[0]);
+ _gamma_Color3f(v[0],v[1],v[2]);
}
void _gamma_Color3i(GLint red, GLint green, GLint blue)
{
- GLfloat r,g,b;
-
DEBUG_GLCMDS(("Color3i: %d %d %d\n", (int)red, (int)green, (int)blue));
- r = INT_TO_FLOAT(red);
- g = INT_TO_FLOAT(green);
- b = INT_TO_FLOAT(blue);
-
- _gamma_Color3f(r,g,b);
+ _gamma_Color3f((GLfloat)red,(GLfloat)green,(GLfloat)blue);
}
void _gamma_Color3iv(const GLint *v)
{
- GLfloat p[3];
-
DEBUG_GLCMDS(("Color3iv: %d %d %d\n", (int)v[0], (int)v[1], (int)v[2]));
- p[0] = INT_TO_FLOAT(v[0]);
- p[1] = INT_TO_FLOAT(v[1]);
- p[2] = INT_TO_FLOAT(v[2]);
-
- _gamma_Color3f(p[0],p[1],p[2]);
+ _gamma_Color3f((GLfloat)v[0],(GLfloat)v[1],(GLfloat)v[2]);
}
void _gamma_Color3s(GLshort red, GLshort green, GLshort blue)
{
- GLfloat r,g,b;
-
DEBUG_GLCMDS(("Color3s: %d %d %d\n", red, green, blue));
- r = SHORT_TO_FLOAT(red);
- g = SHORT_TO_FLOAT(green);
- b = SHORT_TO_FLOAT(blue);
-
- _gamma_Color3f(r,g,b);
+ _gamma_Color3f((GLfloat)red,(GLfloat)green,(GLfloat)blue);
}
void _gamma_Color3sv(const GLshort *v)
{
- GLfloat p[3];
-
DEBUG_GLCMDS(("Color3sv: %d %d %d\n", v[0], v[1], v[2]));
- p[0] = SHORT_TO_FLOAT(v[0]);
- p[1] = SHORT_TO_FLOAT(v[1]);
- p[2] = SHORT_TO_FLOAT(v[2]);
-
- _gamma_Color3f(p[0],p[1],p[2]);
+ _gamma_Color3f((GLfloat)v[0],(GLfloat)v[1],(GLfloat)v[2]);
}
void _gamma_Color3ub(GLubyte red, GLubyte green, GLubyte blue)
@@ -770,56 +813,32 @@ void _gamma_Color3ubv(const GLubyte *v)
void _gamma_Color3ui(GLuint red, GLuint green, GLuint blue)
{
- GLfloat r,g,b;
-
DEBUG_GLCMDS(("Color3ui: %d %d %d\n",
(unsigned int)red, (unsigned int)green, (unsigned int)blue));
- r = UINT_TO_FLOAT(red);
- g = UINT_TO_FLOAT(green);
- b = UINT_TO_FLOAT(blue);
-
- _gamma_Color3f(r,g,b);
+ _gamma_Color3f((GLfloat)red,(GLfloat)green,(GLfloat)blue);
}
void _gamma_Color3uiv(const GLuint *v)
{
- GLfloat p[3];
-
DEBUG_GLCMDS(("Color3uiv: %d %d %d\n",
(unsigned int)v[0], (unsigned int)v[1], (unsigned int)v[2]));
- p[0] = UINT_TO_FLOAT(v[0]);
- p[1] = UINT_TO_FLOAT(v[1]);
- p[2] = UINT_TO_FLOAT(v[2]);
-
- _gamma_Color3f(p[0],p[1],p[2]);
+ _gamma_Color3f((GLfloat)v[0],(GLfloat)v[1],(GLfloat)v[2]);
}
void _gamma_Color3us(GLushort red, GLushort green, GLushort blue)
{
- GLfloat r,g,b;
-
DEBUG_GLCMDS(("Color3us: %d %d %d\n", red, green, blue));
- r = USHORT_TO_FLOAT(red);
- g = USHORT_TO_FLOAT(green);
- b = USHORT_TO_FLOAT(blue);
-
- _gamma_Color3f(r,g,b);
+ _gamma_Color3f((GLfloat)red,(GLfloat)green,(GLfloat)blue);
}
void _gamma_Color3usv(const GLushort *v)
{
- GLfloat p[3];
-
DEBUG_GLCMDS(("Color3usv: %d %d %d\n", v[0], v[1], v[2]));
- p[0] = USHORT_TO_FLOAT(v[0]);
- p[1] = USHORT_TO_FLOAT(v[1]);
- p[2] = USHORT_TO_FLOAT(v[2]);
-
- _gamma_Color3f(p[0],p[1],p[2]);
+ _gamma_Color3f((GLfloat)v[0],(GLfloat)v[1],(GLfloat)v[2]);
}
void _gamma_Color4b(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha)
@@ -847,7 +866,7 @@ void _gamma_Color4bv(const GLbyte *v)
p[2] = BYTE_TO_FLOAT(v[2]);
p[3] = BYTE_TO_FLOAT(v[3]);
- _gamma_Color4f(p[0],p[1],p[2],p[3]);
+ _gamma_Color4fv(p);
}
void _gamma_Color4d(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha)
@@ -861,13 +880,18 @@ void _gamma_Color4dv(const GLdouble *v)
{
DEBUG_GLCMDS(("Color4dv: %f %f %f %f\n", v[0], v[1], v[2], v[3]));
- _gamma_Color4fv((GLfloat*)v);
+ _gamma_Color4f((GLfloat)v[0],(GLfloat)v[1],(GLfloat)v[2],(GLfloat)v[3]);
}
void _gamma_Color4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
{
DEBUG_GLCMDS(("Color4f: %f %f %f %f\n", red, green, blue, alpha));
+ gCCPriv->Current.Color[0] = red;
+ gCCPriv->Current.Color[1] = green;
+ gCCPriv->Current.Color[2] = blue;
+ gCCPriv->Current.Color[3] = alpha;
+
CHECK_DMA_BUFFER(gCC, gCCPriv, 4);
WRITEF(gCCPriv->buf, Ca, alpha);
WRITEF(gCCPriv->buf, Cb, blue);
@@ -879,6 +903,11 @@ void _gamma_Color4fv(const GLfloat *v)
{
DEBUG_GLCMDS(("Color4fv: %f %f %f %f\n", v[0], v[1], v[2], v[3]));
+ gCCPriv->Current.Color[0] = v[0];
+ gCCPriv->Current.Color[1] = v[1];
+ gCCPriv->Current.Color[2] = v[2];
+ gCCPriv->Current.Color[3] = v[3];
+
CHECK_DMA_BUFFER(gCC, gCCPriv, 4);
WRITEF(gCCPriv->buf, Ca, v[3]);
WRITEF(gCCPriv->buf, Cb, v[2]);
@@ -913,7 +942,7 @@ void _gamma_Color4iv(const GLint *v)
p[2] = INT_TO_FLOAT(v[2]);
p[3] = INT_TO_FLOAT(v[3]);
- _gamma_Color4f(p[0],p[1],p[2],p[3]);
+ _gamma_Color4fv(p);
}
void _gamma_Color4s(GLshort red, GLshort green, GLshort blue, GLshort alpha)
@@ -941,7 +970,7 @@ void _gamma_Color4sv(const GLshort *v)
p[2] = SHORT_TO_FLOAT(v[2]);
p[3] = SHORT_TO_FLOAT(v[3]);
- _gamma_Color4f(p[0],p[1],p[2],p[3]);
+ _gamma_Color4fv(p);
}
void _gamma_Color4ub(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)
@@ -997,7 +1026,7 @@ void _gamma_Color4uiv(const GLuint *v)
p[2] = UINT_TO_FLOAT(v[2]);
p[3] = UINT_TO_FLOAT(v[3]);
- _gamma_Color4f(p[0],p[1],p[2],p[3]);
+ _gamma_Color4fv(p);
}
void _gamma_Color4us(GLushort red, GLushort green, GLushort blue, GLushort alpha)
@@ -1025,7 +1054,7 @@ void _gamma_Color4usv(const GLushort *v)
p[2] = USHORT_TO_FLOAT(v[2]);
p[3] = USHORT_TO_FLOAT(v[3]);
- _gamma_Color4f(p[0],p[1],p[2],p[3]);
+ _gamma_Color4fv(p);
}
void _gamma_ColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
@@ -1037,8 +1066,7 @@ void _gamma_ColorMaterial(GLenum face, GLenum mode)
{
DEBUG_GLCMDS(("ColorMaterial: %04x %04x\n", (int)face, (int)mode));
- gCCPriv->MaterialMode &= ~MaterialModeEnable;
- gCCPriv->ColorMaterialMode = ColorMaterialModeDisable;
+ gCCPriv->ColorMaterialMode &= ~ColorMaterialModeMask;
switch (face) {
case GL_FRONT:
@@ -1070,15 +1098,56 @@ void _gamma_ColorMaterial(GLenum face, GLenum mode)
break;
}
- CHECK_DMA_BUFFER(gCC, gCCPriv, 2);
+ CHECK_DMA_BUFFER(gCC, gCCPriv, 1);
WRITE(gCCPriv->buf, ColorMaterialMode, gCCPriv->ColorMaterialMode);
- WRITE(gCCPriv->buf, MaterialMode, gCCPriv->MaterialMode);
}
void _gamma_ColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
{
DEBUG_GLCMDS(("ColorPointer: %d %04x %d\n",
(int)size, (int)type, (int)stride));
+
+ if (size<3 || size>4) {
+ gamma_error( GL_INVALID_VALUE, "glColorPointer(size)" );
+ return;
+ }
+ if (stride<0) {
+ gamma_error( GL_INVALID_VALUE, "glColorPointer(stride)" );
+ return;
+ }
+ switch (type) {
+ case GL_BYTE:
+ gCCPriv->Array.ColorStrideB = stride ? stride : size*sizeof(GLbyte);
+ break;
+ case GL_UNSIGNED_BYTE:
+ gCCPriv->Array.ColorStrideB = stride ? stride : size*sizeof(GLubyte);
+ break;
+ case GL_SHORT:
+ gCCPriv->Array.ColorStrideB = stride ? stride : size*sizeof(GLshort);
+ break;
+ case GL_UNSIGNED_SHORT:
+ gCCPriv->Array.ColorStrideB = stride ? stride : size*sizeof(GLushort);
+ break;
+ case GL_INT:
+ gCCPriv->Array.ColorStrideB = stride ? stride : size*sizeof(GLint);
+ break;
+ case GL_UNSIGNED_INT:
+ gCCPriv->Array.ColorStrideB = stride ? stride : size*sizeof(GLuint);
+ break;
+ case GL_FLOAT:
+ gCCPriv->Array.ColorStrideB = stride ? stride : size*sizeof(GLfloat);
+ break;
+ case GL_DOUBLE:
+ gCCPriv->Array.ColorStrideB = stride ? stride : size*sizeof(GLdouble);
+ break;
+ default:
+ gamma_error( GL_INVALID_ENUM, "glColorPointer(type)" );
+ return;
+ }
+ gCCPriv->Array.ColorSize = size;
+ gCCPriv->Array.ColorType = type;
+ gCCPriv->Array.ColorStride = stride;
+ gCCPriv->Array.ColorPtr = (void *) pointer;
}
void _gamma_CopyPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type)
@@ -1140,10 +1209,12 @@ void _gamma_CullFace(GLenum mode)
WRITE(gCCPriv->buf, GeometryMode, gCCPriv->GeometryMode);
}
+#if 0 /* Now in dlist.c */
void _gamma_DeleteLists(GLuint list, GLsizei range)
{
DEBUG_GLCMDS(("DeleteLists: %d %d\n", (unsigned int)list, (int)range));
}
+#endif
void _gamma_DeleteTextures(GLsizei n, const GLuint *textures)
{
@@ -1262,7 +1333,7 @@ void _gamma_Disable(GLenum cap)
gCCPriv->Window &= ~W_DepthFCP;
/* Turn depth mode off */
- CHECK_DMA_BUFFER(gCC, gCCPriv, 4);
+ CHECK_DMA_BUFFER(gCC, gCCPriv, 3);
WRITE(gCCPriv->buf, DepthMode, gCCPriv->DepthMode);
WRITE(gCCPriv->buf, DeltaMode, gCCPriv->DeltaMode);
WRITE(gCCPriv->buf, LBReadModeAnd, ~LBReadDstEnable);
@@ -1314,6 +1385,22 @@ void _gamma_Disable(GLenum cap)
CHECK_DMA_BUFFER(gCC, gCCPriv, 1);
WRITE(gCCPriv->buf, Light1Mode, gCCPriv->Light1Mode);
break;
+ case GL_LOGIC_OP:
+ gCCPriv->LogicalOpMode &= ~LogicalOpModeEnable;
+ CHECK_DMA_BUFFER(gCC, gCCPriv, 1);
+ WRITE(gCCPriv->buf, LogicalOpMode, gCCPriv->LogicalOpMode);
+ break;
+ case GL_NORMALIZE:
+ gCCPriv->NormalizeMode &= ~NormalizeModeEnable;
+ CHECK_DMA_BUFFER(gCC, gCCPriv, 2);
+ WRITE(gCCPriv->buf, NormalizeMode, gCCPriv->NormalizeMode);
+ WRITE(gCCPriv->buf, TransformModeOr, 0xc);
+ break;
+ case GL_SCISSOR_TEST:
+ gCCPriv->ScissorMode &= ~UserScissorEnable;
+ CHECK_DMA_BUFFER(gCC, gCCPriv, 1);
+ WRITE(gCCPriv->buf, ScissorMode, gCCPriv->ScissorMode);
+ break;
case GL_TEXTURE_2D:
gCCPriv->Texture2DEnabled = GL_FALSE;
gCCPriv->Begin &= ~B_TextureEnable;
@@ -1344,6 +1431,29 @@ void _gamma_Disable(GLenum cap)
void _gamma_DisableClientState(GLenum array)
{
DEBUG_GLCMDS(("DisableClientState: %04x\n", (int)array));
+
+ switch (array) {
+ case GL_VERTEX_ARRAY:
+ gCCPriv->Array.VertexEnabled = GL_FALSE;
+ break;
+ case GL_NORMAL_ARRAY:
+ gCCPriv->Array.NormalEnabled = GL_FALSE;
+ break;
+ case GL_COLOR_ARRAY:
+ gCCPriv->Array.ColorEnabled = GL_FALSE;
+ break;
+ case GL_INDEX_ARRAY:
+ gCCPriv->Array.IndexEnabled = GL_FALSE;
+ break;
+ case GL_TEXTURE_COORD_ARRAY:
+ gCCPriv->Array.TexCoordEnabled = GL_FALSE;
+ break;
+ case GL_EDGE_FLAG_ARRAY:
+ gCCPriv->Array.EdgeFlagEnabled = GL_FALSE;
+ break;
+ default:
+ gamma_error( GL_INVALID_ENUM, "glEnable/DisableClientState" );
+ }
}
void _gamma_DrawArrays(GLenum mode, GLint first, GLsizei count)
@@ -1406,7 +1516,7 @@ void _gamma_Enable(GLenum cap)
#endif
/* Turn depth mode on */
- CHECK_DMA_BUFFER(gCC, gCCPriv, 4);
+ CHECK_DMA_BUFFER(gCC, gCCPriv, 3);
WRITE(gCCPriv->buf, DepthMode, gCCPriv->DepthMode);
WRITE(gCCPriv->buf, DeltaMode, gCCPriv->DeltaMode);
WRITE(gCCPriv->buf, LBReadModeOr, LBReadDstEnable);
@@ -1464,6 +1574,22 @@ void _gamma_Enable(GLenum cap)
CHECK_DMA_BUFFER(gCC, gCCPriv, 1);
WRITE(gCCPriv->buf, Light1Mode, gCCPriv->Light1Mode);
break;
+ case GL_LOGIC_OP:
+ gCCPriv->LogicalOpMode |= LogicalOpModeEnable;
+ CHECK_DMA_BUFFER(gCC, gCCPriv, 1);
+ WRITE(gCCPriv->buf, LogicalOpMode, gCCPriv->LogicalOpMode);
+ break;
+ case GL_NORMALIZE:
+ gCCPriv->NormalizeMode |= NormalizeModeEnable;
+ CHECK_DMA_BUFFER(gCC, gCCPriv, 2);
+ WRITE(gCCPriv->buf, NormalizeMode, gCCPriv->NormalizeMode);
+ WRITE(gCCPriv->buf, TransformModeAnd, 0xffffff3f);
+ break;
+ case GL_SCISSOR_TEST:
+ gCCPriv->ScissorMode |= UserScissorEnable;
+ CHECK_DMA_BUFFER(gCC, gCCPriv, 1);
+ WRITE(gCCPriv->buf, ScissorMode, gCCPriv->ScissorMode);
+ break;
case GL_TEXTURE_2D:
gCCPriv->Texture2DEnabled = GL_TRUE;
#ifndef TURN_OFF_TEXTURES
@@ -1496,6 +1622,29 @@ void _gamma_Enable(GLenum cap)
void _gamma_EnableClientState(GLenum array)
{
DEBUG_GLCMDS(("EnableClientState: %04x\n", (int)array));
+
+ switch (array) {
+ case GL_VERTEX_ARRAY:
+ gCCPriv->Array.VertexEnabled = GL_TRUE;
+ break;
+ case GL_NORMAL_ARRAY:
+ gCCPriv->Array.NormalEnabled = GL_TRUE;
+ break;
+ case GL_COLOR_ARRAY:
+ gCCPriv->Array.ColorEnabled = GL_TRUE;
+ break;
+ case GL_INDEX_ARRAY:
+ gCCPriv->Array.IndexEnabled = GL_TRUE;
+ break;
+ case GL_TEXTURE_COORD_ARRAY:
+ gCCPriv->Array.TexCoordEnabled = GL_TRUE;
+ break;
+ case GL_EDGE_FLAG_ARRAY:
+ gCCPriv->Array.EdgeFlagEnabled = GL_TRUE;
+ break;
+ default:
+ gamma_error( GL_INVALID_ENUM, "glEnable/DisableClientState" );
+ }
}
void _gamma_End(void)
@@ -1519,10 +1668,12 @@ void _gamma_End(void)
#endif
}
+#if 0 /* Now in dlist.c */
void _gamma_EndList(void)
{
DEBUG_GLCMDS(("EndList\n"));
}
+#endif
void _gamma_EvalCoord1d(GLdouble u)
{
@@ -1620,8 +1771,10 @@ void _gamma_Fogfv(GLenum pname, const GLfloat *params)
switch (pname) {
case GL_FOG_COLOR:
- color = ((int)params[3]<<24) | ((int)params[2]<<16) |
- ((int)params[1]<<8) | ((int)params[0]);
+ color = (FLOAT_TO_UBYTE(params[3])<<24) |
+ (FLOAT_TO_UBYTE(params[2])<<16) |
+ (FLOAT_TO_UBYTE(params[1])<<8) |
+ (FLOAT_TO_UBYTE(params[0]));
CHECK_DMA_BUFFER(gCC, gCCPriv, 1);
WRITE(gCCPriv->buf, FogColor, color);
break;
@@ -1704,12 +1857,14 @@ void _gamma_Frustum(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top
gammaLoadHWMatrix();
}
+#if 0 /* Now in dlist.c */
GLuint _gamma_GenLists(GLsizei range)
{
DEBUG_GLCMDS(("GenLists: %d\n", (int)range));
return GL_TRUE;
}
+#endif
void _gamma_GenTextures(GLsizei n, GLuint *textures)
{
@@ -1718,7 +1873,36 @@ void _gamma_GenTextures(GLsizei n, GLuint *textures)
void _gamma_GetBooleanv(GLenum val, GLboolean *b)
{
+ int loop;
+
DEBUG_GLCMDS(("GetBooleanv: %04x\n", (int)val));
+
+ switch (val) {
+ case GL_CURRENT_COLOR:
+ b[0] = FLOAT_TO_BOOL(gCCPriv->Current.Color[0]);
+ b[1] = FLOAT_TO_BOOL(gCCPriv->Current.Color[1]);
+ b[2] = FLOAT_TO_BOOL(gCCPriv->Current.Color[2]);
+ b[3] = FLOAT_TO_BOOL(gCCPriv->Current.Color[3]);
+ break;
+ case GL_CURRENT_NORMAL:
+ b[0] = FLOAT_TO_BOOL(gCCPriv->Current.Normal[0]);
+ b[1] = FLOAT_TO_BOOL(gCCPriv->Current.Normal[1]);
+ b[2] = FLOAT_TO_BOOL(gCCPriv->Current.Normal[2]);
+ break;
+ case GL_MAX_TEXTURE_SIZE:
+ *b = FLOAT_TO_BOOL(GAMMA_MAX_TEXTURE_SIZE);
+ break;
+ case GL_MODELVIEW_MATRIX:
+ for (loop = 0; loop < 16; loop++)
+ b[loop] = FLOAT_TO_BOOL(gCCPriv->ModelView[loop]);
+ break;
+ case GL_CURRENT_TEXTURE_COORDS:
+ b[0] = FLOAT_TO_BOOL(gCCPriv->Current.TexCoord[0]);
+ b[1] = FLOAT_TO_BOOL(gCCPriv->Current.TexCoord[1]);
+ b[2] = FLOAT_TO_BOOL(gCCPriv->Current.TexCoord[2]);
+ b[3] = FLOAT_TO_BOOL(gCCPriv->Current.TexCoord[3]);
+ break;
+ }
}
void _gamma_GetClipPlane(GLenum plane, GLdouble *equation)
@@ -1729,25 +1913,75 @@ void _gamma_GetClipPlane(GLenum plane, GLdouble *equation)
void _gamma_GetDoublev(GLenum val, GLdouble *d)
{
+ int loop;
+
DEBUG_GLCMDS(("GetDoublev: %04x\n", (int)val));
+
+ switch (val) {
+ case GL_CURRENT_COLOR:
+ d[0] = (GLdouble)gCCPriv->Current.Color[0];
+ d[1] = (GLdouble)gCCPriv->Current.Color[1];
+ d[2] = (GLdouble)gCCPriv->Current.Color[2];
+ d[3] = (GLdouble)gCCPriv->Current.Color[3];
+ break;
+ case GL_CURRENT_NORMAL:
+ d[0] = (GLdouble)gCCPriv->Current.Normal[0];
+ d[1] = (GLdouble)gCCPriv->Current.Normal[1];
+ d[2] = (GLdouble)gCCPriv->Current.Normal[2];
+ break;
+ case GL_MAX_TEXTURE_SIZE:
+ *d = (GLdouble)INT_TO_FLOAT(GAMMA_MAX_TEXTURE_SIZE);
+ break;
+ case GL_MODELVIEW_MATRIX:
+ for (loop = 0; loop < 16; loop++)
+ d[loop] = (GLdouble)gCCPriv->ModelView[loop];
+ break;
+ case GL_CURRENT_TEXTURE_COORDS:
+ d[0] = (GLdouble)gCCPriv->Current.TexCoord[0];
+ d[1] = (GLdouble)gCCPriv->Current.TexCoord[1];
+ d[2] = (GLdouble)gCCPriv->Current.TexCoord[2];
+ d[3] = (GLdouble)gCCPriv->Current.TexCoord[3];
+ break;
+ }
}
GLenum _gamma_GetError(void)
{
DEBUG_GLCMDS(("GetError\n"));
- return 0;
+
+ return gCCPriv->ErrorValue;
}
void _gamma_GetFloatv(GLenum val, GLfloat *f)
{
- int i;
+ int loop;
DEBUG_GLCMDS(("GetFloatv: %04x\n", (int)val));
switch (val) {
+ case GL_CURRENT_COLOR:
+ f[0] = gCCPriv->Current.Color[0];
+ f[1] = gCCPriv->Current.Color[1];
+ f[2] = gCCPriv->Current.Color[2];
+ f[3] = gCCPriv->Current.Color[3];
+ break;
+ case GL_CURRENT_NORMAL:
+ f[0] = gCCPriv->Current.Normal[0];
+ f[1] = gCCPriv->Current.Normal[1];
+ f[2] = gCCPriv->Current.Normal[2];
+ break;
+ case GL_MAX_TEXTURE_SIZE:
+ *f = INT_TO_FLOAT(GAMMA_MAX_TEXTURE_SIZE);
+ break;
case GL_MODELVIEW_MATRIX:
- for (i = 0; i < 16; i++)
- f[i] = gCCPriv->ModelView[i];
+ for (loop = 0; loop < 16; loop++)
+ f[loop] = gCCPriv->ModelView[loop];
+ break;
+ case GL_CURRENT_TEXTURE_COORDS:
+ f[0] = gCCPriv->Current.TexCoord[0];
+ f[1] = gCCPriv->Current.TexCoord[1];
+ f[2] = gCCPriv->Current.TexCoord[2];
+ f[3] = gCCPriv->Current.TexCoord[3];
break;
default:
break;
@@ -1756,11 +1990,34 @@ void _gamma_GetFloatv(GLenum val, GLfloat *f)
void _gamma_GetIntegerv(GLenum val, GLint *i)
{
+ int loop;
+
DEBUG_GLCMDS(("GetIntegerv: %04x\n", (int)val));
switch (val) {
+ case GL_CURRENT_COLOR:
+ i[0] = FLOAT_TO_INT(gCCPriv->Current.Color[0]);
+ i[1] = FLOAT_TO_INT(gCCPriv->Current.Color[1]);
+ i[2] = FLOAT_TO_INT(gCCPriv->Current.Color[2]);
+ i[3] = FLOAT_TO_INT(gCCPriv->Current.Color[3]);
+ break;
+ case GL_CURRENT_NORMAL:
+ i[0] = FLOAT_TO_INT(gCCPriv->Current.Normal[0]);
+ i[1] = FLOAT_TO_INT(gCCPriv->Current.Normal[1]);
+ i[2] = FLOAT_TO_INT(gCCPriv->Current.Normal[2]);
+ break;
case GL_MAX_TEXTURE_SIZE:
- *i = 2048;
+ *i = GAMMA_MAX_TEXTURE_SIZE;
+ break;
+ case GL_MODELVIEW_MATRIX:
+ for (loop = 0; loop < 16; loop++)
+ i[loop] = FLOAT_TO_INT(gCCPriv->ModelView[loop]);
+ break;
+ case GL_CURRENT_TEXTURE_COORDS:
+ i[0] = FLOAT_TO_INT(gCCPriv->Current.TexCoord[0]);
+ i[1] = FLOAT_TO_INT(gCCPriv->Current.TexCoord[1]);
+ i[2] = FLOAT_TO_INT(gCCPriv->Current.TexCoord[2]);
+ i[3] = FLOAT_TO_INT(gCCPriv->Current.TexCoord[3]);
break;
}
}
@@ -1967,12 +2224,14 @@ GLboolean _gamma_IsEnabled(GLenum cap)
return GL_TRUE;
}
+#if 0 /* Now in dlist.c */
GLboolean _gamma_IsList(GLuint list)
{
DEBUG_GLCMDS(("IsList: %04x\n", (unsigned int)list));
return GL_TRUE;
}
+#endif
GLboolean _gamma_IsTexture(GLuint texture)
{
@@ -2001,7 +2260,7 @@ void _gamma_LightModelfv(GLenum pname, const GLfloat *params)
WRITEF(gCCPriv->buf, SceneAmbientColorRed, params[0]);
break;
case GL_LIGHT_MODEL_LOCAL_VIEWER:
- if ((int)params[0] != 0)
+ if (params[0] != 0.0)
gCCPriv->LightingMode |= LightingModeLocalViewer;
else
gCCPriv->LightingMode &= ~LightingModeLocalViewer;
@@ -2009,7 +2268,7 @@ void _gamma_LightModelfv(GLenum pname, const GLfloat *params)
WRITE(gCCPriv->buf, LightingMode, gCCPriv->LightingMode);
break;
case GL_LIGHT_MODEL_TWO_SIDE:
- if ((int)params[0] != 0) {
+ if (params[0] == 1.0f) {
gCCPriv->LightingMode |= LightingModeTwoSides;
gCCPriv->MaterialMode |= MaterialModeTwoSides;
} else {
@@ -2039,7 +2298,7 @@ void _gamma_Lightf(GLenum light, GLenum pname, GLfloat param)
void _gamma_Lightfv(GLenum light, GLenum pname, const GLfloat *params)
{
- GLfloat l,x,y,z;
+ GLfloat l,x,y,z,w;
DEBUG_GLCMDS(("Lightfv: %04x %04x %f\n",
(int)light, (int)pname, *params));
@@ -2069,12 +2328,13 @@ void _gamma_Lightfv(GLenum light, GLenum pname, const GLfloat *params)
break;
case GL_POSITION:
/* Normalize <x,y,z> */
- x = params[0]; y = params[1]; z = params[2];
- l = sqrt(x*x + y*y + z*z);
+ x = params[0]; y = params[1]; z = params[2]; w = params[3];
+ l = sqrt(x*x + y*y + z*z + w*w);
+ w /= l;
x /= l;
y /= l;
z /= l;
- if ((int)params[3] != 0) {
+ if (params[3] != 0.0) {
gCCPriv->Light0Mode |= Light0ModeAttenuation;
gCCPriv->Light0Mode |= Light0ModeLocal;
} else {
@@ -2083,30 +2343,30 @@ void _gamma_Lightfv(GLenum light, GLenum pname, const GLfloat *params)
}
CHECK_DMA_BUFFER(gCC, gCCPriv, 5);
WRITE(gCCPriv->buf, Light0Mode, gCCPriv->Light0Mode);
- WRITEF(gCCPriv->buf, Light0PositionW, params[3]);
+ WRITEF(gCCPriv->buf, Light0PositionW, w);
WRITEF(gCCPriv->buf, Light0PositionZ, z);
WRITEF(gCCPriv->buf, Light0PositionY, y);
WRITEF(gCCPriv->buf, Light0PositionX, x);
break;
case GL_SPOT_DIRECTION:
CHECK_DMA_BUFFER(gCC, gCCPriv, 3);
- WRITEF(gCCPriv->buf, Light0SpotlightDirectionZ, params[3]);
- WRITEF(gCCPriv->buf, Light0SpotlightDirectionY, params[2]);
- WRITEF(gCCPriv->buf, Light0SpotlightDirectionX, params[1]);
- /* WRITEF(gCCPriv->buf, Light0SpotlightDirectionW, params[0]); */
+ /* WRITEF(gCCPriv->buf, Light0SpotlightDirectionW, params[3]); */
+ WRITEF(gCCPriv->buf, Light0SpotlightDirectionZ, params[2]);
+ WRITEF(gCCPriv->buf, Light0SpotlightDirectionY, params[1]);
+ WRITEF(gCCPriv->buf, Light0SpotlightDirectionX, params[0]);
break;
case GL_SPOT_EXPONENT:
CHECK_DMA_BUFFER(gCC, gCCPriv, 1);
WRITEF(gCCPriv->buf, Light0SpotlightExponent, params[0]);
break;
case GL_SPOT_CUTOFF:
- if ((int)params[0] != -1)
+ if (params[0] != 180.0)
gCCPriv->Light0Mode |= Light0ModeSpotLight;
else
gCCPriv->Light0Mode &= ~Light0ModeSpotLight;
CHECK_DMA_BUFFER(gCC, gCCPriv, 2);
WRITE(gCCPriv->buf, Light0Mode, gCCPriv->Light0Mode);
- WRITEF(gCCPriv->buf, Light0CosSpotlightCutoffAngle, params[0]);
+ WRITEF(gCCPriv->buf, Light0CosSpotlightCutoffAngle, cos(params[0]*DEG2RAD));
break;
case GL_CONSTANT_ATTENUATION:
CHECK_DMA_BUFFER(gCC, gCCPriv, 1);
@@ -2152,7 +2412,7 @@ void _gamma_Lightfv(GLenum light, GLenum pname, const GLfloat *params)
x /= l;
y /= l;
z /= l;
- if ((int)params[3] != 0) {
+ if (params[3] != 0.0) {
gCCPriv->Light1Mode |= Light1ModeAttenuation;
gCCPriv->Light1Mode |= Light1ModeLocal;
} else {
@@ -2168,23 +2428,23 @@ void _gamma_Lightfv(GLenum light, GLenum pname, const GLfloat *params)
break;
case GL_SPOT_DIRECTION:
CHECK_DMA_BUFFER(gCC, gCCPriv, 3);
- WRITEF(gCCPriv->buf, Light1SpotlightDirectionZ, params[3]);
- WRITEF(gCCPriv->buf, Light1SpotlightDirectionY, params[2]);
- WRITEF(gCCPriv->buf, Light1SpotlightDirectionX, params[1]);
- /* WRITEF(gCCPriv->buf, Light1SpotlightDirectionW, params[0]); */
+ /* WRITEF(gCCPriv->buf, Light1SpotlightDirectionW, params[3]); */
+ WRITEF(gCCPriv->buf, Light1SpotlightDirectionZ, params[2]);
+ WRITEF(gCCPriv->buf, Light1SpotlightDirectionY, params[1]);
+ WRITEF(gCCPriv->buf, Light1SpotlightDirectionX, params[0]);
break;
case GL_SPOT_EXPONENT:
CHECK_DMA_BUFFER(gCC, gCCPriv, 1);
WRITEF(gCCPriv->buf, Light1SpotlightExponent, params[0]);
break;
case GL_SPOT_CUTOFF:
- if ((int)params[0] != -1)
+ if (params[0] != 180.0)
gCCPriv->Light1Mode |= Light1ModeSpotLight;
else
gCCPriv->Light1Mode &= ~Light1ModeSpotLight;
CHECK_DMA_BUFFER(gCC, gCCPriv, 2);
WRITE(gCCPriv->buf, Light1Mode, gCCPriv->Light1Mode);
- WRITEF(gCCPriv->buf, Light1CosSpotlightCutoffAngle, params[0]);
+ WRITEF(gCCPriv->buf, Light1CosSpotlightCutoffAngle, cos(params[0]*DEG2RAD));
break;
case GL_CONSTANT_ATTENUATION:
CHECK_DMA_BUFFER(gCC, gCCPriv, 1);
@@ -2220,10 +2480,12 @@ void _gamma_LineWidth(GLfloat width)
DEBUG_GLCMDS(("LineWidth: %f\n", width));
}
+#if 0 /* Now in dlist.c */
void _gamma_ListBase(GLuint base)
{
DEBUG_GLCMDS(("ListBase: %d\n", (unsigned int)base));
}
+#endif
void _gamma_LoadIdentity(void)
{
@@ -2261,6 +2523,13 @@ void _gamma_LoadName(GLuint name)
void _gamma_LogicOp(GLenum opcode)
{
DEBUG_GLCMDS(("LogicOp: %04x\n", (int)opcode));
+
+ gCCPriv->LogicalOpMode &= ~LogicalOpModeMask;
+
+ gCCPriv->LogicalOpMode |= (opcode & 0x0f) << 1;
+
+ CHECK_DMA_BUFFER(gCC, gCCPriv, 1);
+ WRITE(gCCPriv->buf, LogicalOpMode, gCCPriv->LogicalOpMode);
}
void _gamma_Map1d(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *pnts)
@@ -2318,6 +2587,8 @@ void _gamma_MapGrid2f(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GL
void _gamma_Materialf(GLenum face, GLenum pname, GLfloat param)
{
DEBUG_GLCMDS(("Materialf: %04x %04x %f\n", (int)face, (int)pname, param));
+
+ _gamma_Materialfv(face, pname, &param);
}
void _gamma_Materialfv(GLenum face, GLenum pname, const GLfloat *params)
@@ -2453,7 +2724,6 @@ void _gamma_MatrixMode(GLenum mode)
/* ERROR!!! */
break;
}
-
}
void _gamma_MultMatrixd(const GLdouble *m)
@@ -2476,15 +2746,15 @@ void _gamma_MultMatrixf(const GLfloat *m)
gammaLoadHWMatrix();
}
+#if 0 /* Now in dlist.c */
void _gamma_NewList(GLuint list, GLenum mode)
{
DEBUG_GLCMDS(("NewList: %d %04x\n", (unsigned int)list, (int)mode));
}
+#endif
void _gamma_Normal3b(GLbyte nx, GLbyte ny, GLbyte nz)
{
- GLfloat x,y,z;
-
DEBUG_GLCMDS(("Normal3b: %d %d %d\n", nx, ny, nz));
_gamma_Normal3f((GLfloat)nx,(GLfloat)ny,(GLfloat)nz);
@@ -2492,8 +2762,6 @@ void _gamma_Normal3b(GLbyte nx, GLbyte ny, GLbyte nz)
void _gamma_Normal3bv(const GLbyte *v)
{
- GLfloat p[3];
-
DEBUG_GLCMDS(("Normal3bv: %d %d %d\n", v[0], v[1], v[2]));
_gamma_Normal3f((GLfloat)v[0],(GLfloat)v[1],(GLfloat)v[2]);
@@ -2517,6 +2785,10 @@ void _gamma_Normal3f(GLfloat nx, GLfloat ny, GLfloat nz)
{
DEBUG_GLCMDS(("Normal3f: %f %f %f\n", nx, ny, nz));
+ gCCPriv->Current.Normal[0] = nx;
+ gCCPriv->Current.Normal[1] = ny;
+ gCCPriv->Current.Normal[2] = nz;
+
CHECK_DMA_BUFFER(gCC, gCCPriv, 3);
WRITEF(gCCPriv->buf, Nz, nz);
WRITEF(gCCPriv->buf, Ny, ny);
@@ -2532,8 +2804,6 @@ void _gamma_Normal3fv(const GLfloat *v)
void _gamma_Normal3i(GLint nx, GLint ny, GLint nz)
{
- GLfloat x,y,z;
-
DEBUG_GLCMDS(("Normal3i: %d %d %d\n", (int)nx, (int)ny, (int)nz));
_gamma_Normal3f((GLfloat)nx,(GLfloat)ny,(GLfloat)nz);
@@ -2541,8 +2811,6 @@ void _gamma_Normal3i(GLint nx, GLint ny, GLint nz)
void _gamma_Normal3iv(const GLint *v)
{
- GLfloat p[3];
-
DEBUG_GLCMDS(("Normal3iv: %d %d %d\n", (int)v[0], (int)v[1], (int)v[2]));
_gamma_Normal3f((GLfloat)v[0],(GLfloat)v[1],(GLfloat)v[2]);
@@ -2550,8 +2818,6 @@ void _gamma_Normal3iv(const GLint *v)
void _gamma_Normal3s(GLshort nx, GLshort ny, GLshort nz)
{
- GLfloat x,y,z;
-
DEBUG_GLCMDS(("Normal3s: %d %d %d\n", nx, ny, nz));
_gamma_Normal3f((GLfloat)nx,(GLfloat)ny,(GLfloat)nz);
@@ -2559,8 +2825,6 @@ void _gamma_Normal3s(GLshort nx, GLshort ny, GLshort nz)
void _gamma_Normal3sv(const GLshort *v)
{
- GLfloat p[3];
-
DEBUG_GLCMDS(("Normal3sv: %d %d %d\n", v[0], v[1], v[2]));
_gamma_Normal3f((GLfloat)v[0],(GLfloat)v[1],(GLfloat)v[2]);
@@ -2569,6 +2833,34 @@ void _gamma_Normal3sv(const GLshort *v)
void _gamma_NormalPointer(GLenum type, GLsizei stride, const GLvoid *pointer)
{
DEBUG_GLCMDS(("NormalPointer: %04x %d\n", (int)type, (int)stride));
+
+ if (stride<0) {
+ gamma_error( GL_INVALID_VALUE, "glNormalPointer(stride)" );
+ return;
+ }
+ switch (type) {
+ case GL_BYTE:
+ gCCPriv->Array.NormalStrideB = stride ? stride : 3*sizeof(GLbyte);
+ break;
+ case GL_SHORT:
+ gCCPriv->Array.NormalStrideB = stride ? stride : 3*sizeof(GLshort);
+ break;
+ case GL_INT:
+ gCCPriv->Array.NormalStrideB = stride ? stride : 3*sizeof(GLint);
+ break;
+ case GL_FLOAT:
+ gCCPriv->Array.NormalStrideB = stride ? stride : 3*sizeof(GLfloat);
+ break;
+ case GL_DOUBLE:
+ gCCPriv->Array.NormalStrideB = stride ? stride : 3*sizeof(GLdouble);
+ break;
+ default:
+ gamma_error( GL_INVALID_ENUM, "glNormalPointer(type)" );
+ return;
+ }
+ gCCPriv->Array.NormalType = type;
+ gCCPriv->Array.NormalStride = stride;
+ gCCPriv->Array.NormalPtr = (void *) pointer;
}
void _gamma_Ortho(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar)
@@ -2844,22 +3136,38 @@ void _gamma_PushName(GLuint name)
void _gamma_RasterPos2d(GLdouble x, GLdouble y)
{
+ DEBUG_GLCMDS(("RasterPos2d: %f %f\n", x, y));
+
+ _gamma_RasterPos2f((GLfloat)x,(GLfloat)y);
}
void _gamma_RasterPos2dv(const GLdouble *v)
{
+ _gamma_RasterPos2f((GLfloat)v[0],(GLfloat)v[1]);
}
void _gamma_RasterPos2f(GLfloat x, GLfloat y)
{
+ DEBUG_GLCMDS(("RasterPos2f: %f %f\n", x, y));
+
+ gCCPriv->Current.RasterPos[0] = x;
+ gCCPriv->Current.RasterPos[1] = y;
+ gCCPriv->Current.RasterPos[2] = 0.0f;
+ gCCPriv->Current.RasterPos[3] = 1.0f;
+
+ CHECK_DMA_BUFFER(gCC, gCCPriv, 2);
+ WRITEF(gCCPriv->buf, RPy, y);
+ WRITEF(gCCPriv->buf, RPx2, x);
}
void _gamma_RasterPos2fv(const GLfloat *v)
{
+ _gamma_RasterPos2f(v[0],v[1]);
}
void _gamma_RasterPos2i(GLint x, GLint y)
{
+ _gamma_RasterPos2f((GLfloat)x,(GLfloat)y);
}
void _gamma_RasterPos2iv(const GLint *v)
@@ -3118,8 +3426,21 @@ void _gamma_Scalef(GLfloat x, GLfloat y, GLfloat z)
void _gamma_Scissor(GLint x, GLint y, GLsizei width, GLsizei height)
{
+ GLint x1, y1, x2, y2;
+
DEBUG_GLCMDS(("Scissor: %d %d %d %d\n",
(int)x, (int)y, (int)width, (int)height));
+
+ x1 = gCC->driDrawablePriv->x + x;
+ y1 = gCC->driScreenPriv->fbHeight -
+ (gCC->driDrawablePriv->y +
+ gCC->driDrawablePriv->h) + y;
+ x2 = x1 + width;
+ y2 = y1 + height;
+
+ CHECK_DMA_BUFFER(gCC, gCCPriv, 2);
+ WRITE(gCCPriv->buf, ScissorMinXY, (y1&0xffff)<<16 | (x1&0xffff));
+ WRITE(gCCPriv->buf, ScissorMaxXY, (y2&0xffff)<<16 | (x2&0xffff));
}
void _gamma_SelectBuffer(GLsizei numnames, GLuint *buffer)
@@ -3188,6 +3509,11 @@ void _gamma_TexCoord1f(GLfloat s)
{
DEBUG_GLCMDS(("TexCoord1f: %f\n", s));
+ gCCPriv->Current.TexCoord[0] = s;
+ gCCPriv->Current.TexCoord[1] = 0.0f;
+ gCCPriv->Current.TexCoord[2] = 0.0f;
+ gCCPriv->Current.TexCoord[3] = 1.0f;
+
WRITEF(gCCPriv->buf, Ts1, s);
}
@@ -3195,6 +3521,11 @@ void _gamma_TexCoord1fv(const GLfloat *v)
{
DEBUG_GLCMDS(("TexCoord1fv: %f\n", *v));
+ gCCPriv->Current.TexCoord[0] = v[0];
+ gCCPriv->Current.TexCoord[1] = 0.0f;
+ gCCPriv->Current.TexCoord[2] = 0.0f;
+ gCCPriv->Current.TexCoord[3] = 1.0f;
+
WRITEF(gCCPriv->buf, Ts1, v[0]);
}
@@ -3260,6 +3591,11 @@ void _gamma_TexCoord2f(GLfloat s, GLfloat t)
{
DEBUG_GLCMDS(("TexCoord2f: %f %f\n", s, t));
+ gCCPriv->Current.TexCoord[0] = s;
+ gCCPriv->Current.TexCoord[1] = t;
+ gCCPriv->Current.TexCoord[2] = 0.0f;
+ gCCPriv->Current.TexCoord[3] = 1.0f;
+
CHECK_DMA_BUFFER(gCC, gCCPriv, 2);
WRITEF(gCCPriv->buf, Tt2, t);
WRITEF(gCCPriv->buf, Ts2, s);
@@ -3269,6 +3605,11 @@ void _gamma_TexCoord2fv(const GLfloat *v)
{
DEBUG_GLCMDS(("TexCoord2fv: %f %f\n", v[0], v[1]));
+ gCCPriv->Current.TexCoord[0] = v[0];
+ gCCPriv->Current.TexCoord[1] = v[1];
+ gCCPriv->Current.TexCoord[2] = 0.0f;
+ gCCPriv->Current.TexCoord[3] = 1.0f;
+
CHECK_DMA_BUFFER(gCC, gCCPriv, 2);
WRITEF(gCCPriv->buf, Tt2, v[1]);
WRITEF(gCCPriv->buf, Ts2, v[0]);
@@ -3429,6 +3770,11 @@ void _gamma_TexCoord4f(GLfloat s, GLfloat t, GLfloat r, GLfloat q)
{
DEBUG_GLCMDS(("TexCoord4f: %f %f %f %f\n", s, t, r, q));
+ gCCPriv->Current.TexCoord[0] = s;
+ gCCPriv->Current.TexCoord[1] = t;
+ gCCPriv->Current.TexCoord[2] = t;
+ gCCPriv->Current.TexCoord[3] = q;
+
CHECK_DMA_BUFFER(gCC, gCCPriv, 4);
WRITEF(gCCPriv->buf, Tq4, q);
WRITEF(gCCPriv->buf, Tr4, r);
@@ -3440,6 +3786,11 @@ void _gamma_TexCoord4fv(const GLfloat *v)
{
DEBUG_GLCMDS(("TexCoord4fv: %f %f %f %f\n", v[0], v[1], v[2], v[3]));
+ gCCPriv->Current.TexCoord[0] = v[0];
+ gCCPriv->Current.TexCoord[1] = v[1];
+ gCCPriv->Current.TexCoord[2] = v[2];
+ gCCPriv->Current.TexCoord[3] = v[3];
+
CHECK_DMA_BUFFER(gCC, gCCPriv, 4);
WRITEF(gCCPriv->buf, Tq4, v[3]);
WRITEF(gCCPriv->buf, Tr4, v[2]);
@@ -3508,6 +3859,36 @@ void _gamma_TexCoordPointer(GLint size, GLenum type, GLsizei stride, const GLvoi
{
DEBUG_GLCMDS(("TexCoordPointer: %d %04x %d\n",
(int)size, (int)type, (int)stride));
+
+ if (size<1 || size>4) {
+ gamma_error( GL_INVALID_VALUE, "glTexCoordPointer(size)" );
+ return;
+ }
+ if (stride<0) {
+ gamma_error( GL_INVALID_VALUE, "glTexCoordPointer(stride)" );
+ return;
+ }
+ switch (type) {
+ case GL_SHORT:
+ gCCPriv->Array.TexCoordStrideB = stride ? stride : size*sizeof(GLshort);
+ break;
+ case GL_INT:
+ gCCPriv->Array.TexCoordStrideB = stride ? stride : size*sizeof(GLint);
+ break;
+ case GL_FLOAT:
+ gCCPriv->Array.TexCoordStrideB = stride ? stride : size*sizeof(GLfloat);
+ break;
+ case GL_DOUBLE:
+ gCCPriv->Array.TexCoordStrideB = stride ? stride : size*sizeof(GLdouble);
+ break;
+ default:
+ gamma_error( GL_INVALID_ENUM, "glTexCoordPointer(type)" );
+ return;
+ }
+ gCCPriv->Array.TexCoordSize = size;
+ gCCPriv->Array.TexCoordType = type;
+ gCCPriv->Array.TexCoordStride = stride;
+ gCCPriv->Array.TexCoordPtr = (void *) pointer;
}
void _gamma_TexEnvf(GLenum target, GLenum pname, GLfloat param)
@@ -4158,8 +4539,6 @@ void _gamma_Vertex2fv(const GLfloat *v)
void _gamma_Vertex2i(GLint x, GLint y)
{
- GLfloat a,b;
-
DEBUG_GLCMDS(("Vertex2i: %d %d\n", (int)x, (int)y));
_gamma_Vertex2f((GLfloat)x,(GLfloat)y);
@@ -4167,8 +4546,6 @@ void _gamma_Vertex2i(GLint x, GLint y)
void _gamma_Vertex2iv(const GLint *v)
{
- GLfloat p[2];
-
DEBUG_GLCMDS(("Vertex2iv: %d %d\n", (int)v[0], (int)v[1]));
_gamma_Vertex2f((GLfloat)v[0],(GLfloat)v[1]);
@@ -4176,8 +4553,6 @@ void _gamma_Vertex2iv(const GLint *v)
void _gamma_Vertex2s(GLshort x, GLshort y)
{
- GLfloat a,b;
-
DEBUG_GLCMDS(("Vertex2s: %d %d\n", x, y));
_gamma_Vertex2f((GLfloat)x,(GLfloat)y);
@@ -4185,8 +4560,6 @@ void _gamma_Vertex2s(GLshort x, GLshort y)
void _gamma_Vertex2sv(const GLshort *v)
{
- GLfloat p[2];
-
DEBUG_GLCMDS(("Vertex2sv: %d %d\n", v[0], v[1]));
_gamma_Vertex2f((GLfloat)v[0],(GLfloat)v[1]);
@@ -4225,8 +4598,6 @@ void _gamma_Vertex3fv(const GLfloat *v)
void _gamma_Vertex3i(GLint x, GLint y, GLint z)
{
- GLfloat a,b,c;
-
DEBUG_GLCMDS(("Vertex3i: %d %d %d\n", (int)x, (int)y, (int)z));
_gamma_Vertex3f((GLfloat)x,(GLfloat)y,(GLfloat)z);
@@ -4234,8 +4605,6 @@ void _gamma_Vertex3i(GLint x, GLint y, GLint z)
void _gamma_Vertex3iv(const GLint *v)
{
- GLfloat p[3];
-
DEBUG_GLCMDS(("Vertex3iv: %d %d %d\n", (int)v[0], (int)v[1], (int)v[2]));
_gamma_Vertex3f((GLfloat)v[0],(GLfloat)v[1],(GLfloat)v[2]);
@@ -4243,8 +4612,6 @@ void _gamma_Vertex3iv(const GLint *v)
void _gamma_Vertex3s(GLshort x, GLshort y, GLshort z)
{
- GLfloat a,b,c;
-
DEBUG_GLCMDS(("Vertex3s: %d %d %d\n", x, y, z));
_gamma_Vertex3f((GLfloat)x,(GLfloat)y,(GLfloat)z);
@@ -4252,8 +4619,6 @@ void _gamma_Vertex3s(GLshort x, GLshort y, GLshort z)
void _gamma_Vertex3sv(const GLshort *v)
{
- GLfloat p[3];
-
DEBUG_GLCMDS(("Vertex3sv: %d %d %d\n", v[0], v[1], v[2]));
_gamma_Vertex3f((GLfloat)v[0],(GLfloat)v[1],(GLfloat)v[2]);
@@ -4293,8 +4658,6 @@ void _gamma_Vertex4fv(const GLfloat *v)
void _gamma_Vertex4i(GLint x, GLint y, GLint z, GLint w)
{
- GLfloat a,b,c,d;
-
DEBUG_GLCMDS(("Vertex4i: %d %d %d %d\n", (int)x, (int)y, (int)z, (int)w));
_gamma_Vertex4f((GLfloat)x,(GLfloat)y,(GLfloat)z,(GLfloat)w);
@@ -4302,8 +4665,6 @@ void _gamma_Vertex4i(GLint x, GLint y, GLint z, GLint w)
void _gamma_Vertex4iv(const GLint *v)
{
- GLfloat p[4];
-
DEBUG_GLCMDS(("Vertex4iv: %d %d %d %d\n",
(int)v[0], (int)v[1], (int)v[2], (int)v[3]));
@@ -4312,8 +4673,6 @@ void _gamma_Vertex4iv(const GLint *v)
void _gamma_Vertex4s(GLshort x, GLshort y, GLshort z, GLshort w)
{
- GLfloat a,b,c,d;
-
DEBUG_GLCMDS(("Vertex4s: %d %d %d %d\n", x, y, z, w));
_gamma_Vertex4f((GLfloat)x,(GLfloat)y,(GLfloat)z,(GLfloat)w);
@@ -4321,8 +4680,6 @@ void _gamma_Vertex4s(GLshort x, GLshort y, GLshort z, GLshort w)
void _gamma_Vertex4sv(const GLshort *v)
{
- GLfloat p[4];
-
DEBUG_GLCMDS(("Vertex4sv: %d %d %d %d\n", v[0], v[1], v[2], v[3]));
_gamma_Vertex4f((GLfloat)v[0],(GLfloat)v[1],(GLfloat)v[2],(GLfloat)v[3]);
@@ -4332,6 +4689,36 @@ void _gamma_VertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid
{
DEBUG_GLCMDS(("VertexPointer: %d %04x %d\n",
(int)size, (int)type, (int)stride));
+
+ if (size<2 || size>4) {
+ gamma_error( GL_INVALID_VALUE, "glVertexPointer(size)" );
+ return;
+ }
+ if (stride<0) {
+ gamma_error( GL_INVALID_VALUE, "glVertexPointer(stride)" );
+ return;
+ }
+ switch (type) {
+ case GL_SHORT:
+ gCCPriv->Array.VertexStrideB = stride ? stride : size*sizeof(GLshort);
+ break;
+ case GL_INT:
+ gCCPriv->Array.VertexStrideB = stride ? stride : size*sizeof(GLint);
+ break;
+ case GL_FLOAT:
+ gCCPriv->Array.VertexStrideB = stride ? stride : size*sizeof(GLfloat);
+ break;
+ case GL_DOUBLE:
+ gCCPriv->Array.VertexStrideB = stride ? stride : size*sizeof(GLdouble);
+ break;
+ default:
+ gamma_error( GL_INVALID_ENUM, "glVertexPointer(type)" );
+ return;
+ }
+ gCCPriv->Array.VertexSize = size;
+ gCCPriv->Array.VertexType = type;
+ gCCPriv->Array.VertexStride = stride;
+ gCCPriv->Array.VertexPtr = (void *) pointer;
}
void _gamma_Viewport(GLint x, GLint y, GLsizei width, GLsizei height)
@@ -4357,10 +4744,10 @@ void _gamma_Viewport(GLint x, GLint y, GLsizei width, GLsizei height)
oy = y + sy;
CHECK_DMA_BUFFER(gCC, gCCPriv, 4);
- WRITEF(gCCPriv->buf, ViewPortScaleX, sx);
- WRITEF(gCCPriv->buf, ViewPortScaleY, sy);
WRITEF(gCCPriv->buf, ViewPortOffsetX, ox);
WRITEF(gCCPriv->buf, ViewPortOffsetY, oy);
+ WRITEF(gCCPriv->buf, ViewPortScaleX, sx);
+ WRITEF(gCCPriv->buf, ViewPortScaleY, sy);
#if 1 /* Err - this shouldn't be needed, but something isn't flushing */
FLUSH_DMA_BUFFER(gCC,gCCPriv);
#endif
@@ -4395,7 +4782,7 @@ init_no_op_table(struct _glapi_table *table)
void
-_gamma_init_dispatch(struct _glapi_table *dispatch)
+_gamma_init_exec(struct _glapi_table *dispatch)
{
init_no_op_table(dispatch);
@@ -4710,7 +5097,7 @@ _gamma_init_dispatch(struct _glapi_table *dispatch)
/* 1.1 */
dispatch->AreTexturesResident = _gamma_AreTexturesResident;
- dispatch->ArrayElement = _gamma_ArrayElement;
+ dispatch->ArrayElement = gl_save_ArrayElement; /*_gamma_ArrayElement;*/
dispatch->BindTexture = _gamma_BindTexture;
dispatch->ColorPointer = _gamma_ColorPointer;
dispatch->CopyTexImage1D = _gamma_CopyTexImage1D;
@@ -4740,5 +5127,186 @@ _gamma_init_dispatch(struct _glapi_table *dispatch)
dispatch->VertexPointer = _gamma_VertexPointer;
}
-
+void
+_gamma_init_save(struct _glapi_table *table)
+{
+ init_no_op_table(table);
+
+ table->Accum = gl_save_Accum;
+ table->AlphaFunc = gl_save_AlphaFunc;
+ table->AreTexturesResident = _gamma_AreTexturesResident; /* NOT SAVED */
+ table->ArrayElement = gl_save_ArrayElement;
+ table->Begin = gl_save_Begin;
+ table->BindTexture = gl_save_BindTexture;
+ table->Bitmap = gl_save_Bitmap;
+ table->BlendFunc = gl_save_BlendFunc;
+ table->CallList = gl_save_CallList;
+ table->CallLists = gl_save_CallLists;
+ table->Clear = gl_save_Clear;
+ table->ClearAccum = gl_save_ClearAccum;
+ table->ClearColor = gl_save_ClearColor;
+ table->ClearDepth = gl_save_ClearDepth;
+ table->ClearIndex = gl_save_ClearIndex;
+ table->ClearStencil = gl_save_ClearStencil;
+ table->ClipPlane = gl_save_ClipPlane;
+ table->Color3f = gl_save_Color3f;
+ table->Color3fv = gl_save_Color3fv;
+ table->Color4f = gl_save_Color4f;
+ table->Color4fv = gl_save_Color4fv;
+ table->Color4ub = gl_save_Color4ub;
+ table->Color4ubv = gl_save_Color4ubv;
+ table->ColorMask = gl_save_ColorMask;
+ table->ColorMaterial = gl_save_ColorMaterial;
+ table->ColorPointer = _gamma_ColorPointer; /* NOT SAVED */
+ table->CopyPixels = gl_save_CopyPixels;
+ table->CopyTexImage1D = gl_save_CopyTexImage1D;
+ table->CopyTexImage2D = gl_save_CopyTexImage2D;
+ table->CopyTexSubImage1D = gl_save_CopyTexSubImage1D;
+ table->CopyTexSubImage2D = gl_save_CopyTexSubImage2D;
+ table->CullFace = gl_save_CullFace;
+ table->DeleteLists = _gamma_DeleteLists; /* NOT SAVED */
+ table->DeleteTextures = _gamma_DeleteTextures; /* NOT SAVED */
+ table->DepthFunc = gl_save_DepthFunc;
+ table->DepthMask = gl_save_DepthMask;
+ table->DepthRange = gl_save_DepthRange;
+ table->Disable = gl_save_Disable;
+ table->DisableClientState = _gamma_DisableClientState; /* NOT SAVED */
+ table->DrawArrays = gl_save_DrawArrays;
+ table->DrawBuffer = gl_save_DrawBuffer;
+ table->DrawElements = gl_save_DrawElements;
+ table->DrawPixels = gl_save_DrawPixels;
+ table->EdgeFlag = gl_save_EdgeFlag;
+ table->EdgeFlagPointer = _gamma_EdgeFlagPointer; /* NOT SAVED */
+ table->Enable = gl_save_Enable;
+ table->EnableClientState = _gamma_EnableClientState; /* NOT SAVED */
+ table->End = gl_save_End;
+ table->EndList = _gamma_EndList; /* NOT SAVED */
+ table->EvalCoord1f = gl_save_EvalCoord1f;
+ table->EvalCoord2f = gl_save_EvalCoord2f;
+ table->EvalMesh1 = gl_save_EvalMesh1;
+ table->EvalMesh2 = gl_save_EvalMesh2;
+ table->EvalPoint1 = gl_save_EvalPoint1;
+ table->EvalPoint2 = gl_save_EvalPoint2;
+ table->FeedbackBuffer = _gamma_FeedbackBuffer; /* NOT SAVED */
+ table->Finish = _gamma_Finish; /* NOT SAVED */
+ table->Flush = _gamma_Flush; /* NOT SAVED */
+ table->Fogfv = gl_save_Fogfv;
+ table->FrontFace = gl_save_FrontFace;
+ table->Frustum = gl_save_Frustum;
+ table->GenLists = _gamma_GenLists; /* NOT SAVED */
+ table->GenTextures = _gamma_GenTextures; /* NOT SAVED */
+
+ /* NONE OF THESE COMMANDS ARE COMPILED INTO DISPLAY LISTS */
+ table->GetBooleanv = _gamma_GetBooleanv;
+ table->GetClipPlane = _gamma_GetClipPlane;
+ table->GetDoublev = _gamma_GetDoublev;
+ table->GetError = _gamma_GetError;
+ table->GetFloatv = _gamma_GetFloatv;
+ table->GetIntegerv = _gamma_GetIntegerv;
+ table->GetString = _gamma_GetString;
+ table->GetLightfv = _gamma_GetLightfv;
+ table->GetLightiv = _gamma_GetLightiv;
+ table->GetMapdv = _gamma_GetMapdv;
+ table->GetMapfv = _gamma_GetMapfv;
+ table->GetMapiv = _gamma_GetMapiv;
+ table->GetMaterialfv = _gamma_GetMaterialfv;
+ table->GetMaterialiv = _gamma_GetMaterialiv;
+ table->GetPixelMapfv = _gamma_GetPixelMapfv;
+ table->GetPixelMapuiv = _gamma_GetPixelMapuiv;
+ table->GetPixelMapusv = _gamma_GetPixelMapusv;
+ table->GetPointerv = _gamma_GetPointerv;
+ table->GetPolygonStipple = _gamma_GetPolygonStipple;
+ table->GetTexEnvfv = _gamma_GetTexEnvfv;
+ table->GetTexEnviv = _gamma_GetTexEnviv;
+ table->GetTexGendv = _gamma_GetTexGendv;
+ table->GetTexGenfv = _gamma_GetTexGenfv;
+ table->GetTexGeniv = _gamma_GetTexGeniv;
+ table->GetTexImage = _gamma_GetTexImage;
+ table->GetTexLevelParameterfv = _gamma_GetTexLevelParameterfv;
+ table->GetTexLevelParameteriv = _gamma_GetTexLevelParameteriv;
+ table->GetTexParameterfv = _gamma_GetTexParameterfv;
+ table->GetTexParameteriv = _gamma_GetTexParameteriv;
+
+ table->Hint = gl_save_Hint;
+ table->IndexMask = gl_save_IndexMask;
+ table->Indexf = gl_save_Indexf;
+ table->Indexi = gl_save_Indexi;
+ table->IndexPointer = _gamma_IndexPointer; /* NOT SAVED */
+ table->InitNames = gl_save_InitNames;
+ table->InterleavedArrays = _gamma_InterleavedArrays; /* NOT SAVED */
+ table->IsEnabled = _gamma_IsEnabled; /* NOT SAVED */
+ table->IsTexture = _gamma_IsTexture; /* NOT SAVED */
+ table->IsList = _gamma_IsList; /* NOT SAVED */
+ table->LightModelfv = gl_save_LightModelfv;
+ table->Lightfv = gl_save_Lightfv;
+ table->LineStipple = gl_save_LineStipple;
+ table->LineWidth = gl_save_LineWidth;
+ table->ListBase = gl_save_ListBase;
+ table->LoadIdentity = gl_save_LoadIdentity;
+ table->LoadMatrixf = gl_save_LoadMatrixf;
+ table->LoadName = gl_save_LoadName;
+ table->LogicOp = gl_save_LogicOp;
+ table->Map1f = gl_save_Map1f;
+ table->Map2f = gl_save_Map2f;
+ table->MapGrid1f = gl_save_MapGrid1f;
+ table->MapGrid2f = gl_save_MapGrid2f;
+ table->Materialfv = gl_save_Materialfv;
+ table->MatrixMode = gl_save_MatrixMode;
+ table->MultMatrixf = gl_save_MultMatrixf;
+ table->NewList = gl_save_NewList;
+ table->Normal3f = gl_save_Normal3f;
+ table->Normal3fv = gl_save_Normal3fv;
+ table->NormalPointer = _gamma_NormalPointer; /* NOT SAVED */
+ table->Ortho = gl_save_Ortho;
+ table->PassThrough = gl_save_PassThrough;
+ table->PixelMapfv = gl_save_PixelMapfv;
+ table->PixelStorei = _gamma_PixelStorei; /* NOT SAVED */
+ table->PixelTransferf = gl_save_PixelTransferf;
+ table->PixelZoom = gl_save_PixelZoom;
+ table->PointSize = gl_save_PointSize;
+ table->PolygonMode = gl_save_PolygonMode;
+ table->PolygonOffset = gl_save_PolygonOffset;
+ table->PolygonStipple = gl_save_PolygonStipple;
+ table->PopAttrib = gl_save_PopAttrib;
+ table->PopClientAttrib = _gamma_PopClientAttrib; /* NOT SAVED */
+ table->PopMatrix = gl_save_PopMatrix;
+ table->PopName = gl_save_PopName;
+ table->PrioritizeTextures = gl_save_PrioritizeTextures;
+ table->PushAttrib = gl_save_PushAttrib;
+ table->PushClientAttrib = _gamma_PushClientAttrib; /* NOT SAVED */
+ table->PushMatrix = gl_save_PushMatrix;
+ table->PushName = gl_save_PushName;
+ table->RasterPos4f = gl_save_RasterPos4f;
+ table->ReadBuffer = gl_save_ReadBuffer;
+ table->ReadPixels = _gamma_ReadPixels; /* NOT SAVED */
+ table->Rectf = gl_save_Rectf;
+ table->RenderMode = _gamma_RenderMode; /* NOT SAVED */
+ table->Rotatef = gl_save_Rotatef;
+ table->Scalef = gl_save_Scalef;
+ table->Scissor = gl_save_Scissor;
+ table->SelectBuffer = _gamma_SelectBuffer; /* NOT SAVED */
+ table->ShadeModel = gl_save_ShadeModel;
+ table->StencilFunc = gl_save_StencilFunc;
+ table->StencilMask = gl_save_StencilMask;
+ table->StencilOp = gl_save_StencilOp;
+ table->TexCoord2f = gl_save_TexCoord2f;
+ table->TexCoord2fv = gl_save_TexCoord2fv;
+ table->TexCoord3fv = gl_save_TexCoord3fv;
+ table->TexCoord4f = gl_save_TexCoord4f;
+ table->TexCoordPointer = _gamma_TexCoordPointer; /* NOT SAVED */
+ table->TexEnvfv = gl_save_TexEnvfv;
+ table->TexGenfv = gl_save_TexGenfv;
+ table->TexImage1D = gl_save_TexImage1D;
+ table->TexImage2D = gl_save_TexImage2D;
+ table->TexSubImage1D = gl_save_TexSubImage1D;
+ table->TexSubImage2D = gl_save_TexSubImage2D;
+ table->TexParameterfv = gl_save_TexParameterfv;
+ table->Translatef = gl_save_Translatef;
+ table->Vertex2f = gl_save_Vertex2f;
+ table->Vertex3f = gl_save_Vertex3f;
+ table->Vertex4f = gl_save_Vertex4f;
+ table->Vertex3fv = gl_save_Vertex3fv;
+ table->VertexPointer = _gamma_VertexPointer; /* NOT SAVED */
+ table->Viewport = gl_save_Viewport;
+}
#endif
diff --git a/xc/lib/GL/mesa/src/drv/gamma/gamma_gl.h b/xc/lib/GL/mesa/src/drv/gamma/gamma_gl.h
index 37fd75eca..212f91895 100644
--- a/xc/lib/GL/mesa/src/drv/gamma/gamma_gl.h
+++ b/xc/lib/GL/mesa/src/drv/gamma/gamma_gl.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_gl.h,v 1.4 2000/03/02 16:07:36 martin Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_gl.h,v 1.5 2001/02/07 13:26:16 alanh Exp $ */
/**************************************************************************
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
@@ -38,6 +38,8 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "GL/gl.h"
#include "glapi.h"
+extern void gamma_error(GLenum error, const char *s);
+
extern void _gamma_Accum(GLenum op, GLfloat value);
extern void _gamma_AlphaFunc(GLenum func, GLclampf ref);
extern GLboolean _gamma_AreTexturesResident(GLsizei n, const GLuint *textures, GLboolean *residences);
@@ -376,6 +378,7 @@ extern void _gamma_VertexPointer(GLint size, GLenum type, GLsizei stride, const
extern void _gamma_Viewport(GLint x, GLint y, GLsizei width, GLsizei height);
-extern void _gamma_init_dispatch(struct _glapi_table *dispatch);
+extern void _gamma_init_exec(struct _glapi_table *dispatch);
+extern void _gamma_init_save(struct _glapi_table *dispatch);
#endif /* _GAMMA_GL_H_ */
diff --git a/xc/lib/GL/mesa/src/drv/gamma/gamma_init.h b/xc/lib/GL/mesa/src/drv/gamma/gamma_init.h
index 6714bbc26..ecf33b959 100644
--- a/xc/lib/GL/mesa/src/drv/gamma/gamma_init.h
+++ b/xc/lib/GL/mesa/src/drv/gamma/gamma_init.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_init.h,v 1.3 2000/06/17 00:02:56 martin Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_init.h,v 1.4 2001/02/07 13:26:16 alanh Exp $ */
/**************************************************************************
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
@@ -63,11 +63,69 @@ typedef union {
#define GAMMA_STENCIL_BUFFER 0x00000008
#define GAMMA_ACCUM_BUFFER 0x00000010
+#define GAMMA_MAX_TEXTURE_SIZE 2048
+
/* These are the minimum requirements and should probably be increased */
#define MAX_MODELVIEW_STACK 16
#define MAX_PROJECTION_STACK 2
#define MAX_TEXTURE_STACK 2
+struct gamma_current_attrib {
+/* GLubyte ByteColor[4]; old */ /* Current RGBA color */
+ GLuint Index; /* Current color index */
+ GLfloat Color[4]; /* Current RGBA color */
+ GLfloat Normal[3]; /* Current normal vector */
+ GLfloat TexCoord[4]; /* points into MultiTexCoord */
+ GLfloat RasterPos[4]; /* Current raster position */
+ GLfloat RasterDistance; /* Current raster distance */
+ GLfloat RasterColor[4]; /* Current raster color */
+ GLuint RasterIndex; /* Current raster index */
+ GLfloat *RasterTexCoord; /* Current raster texcoord*/
+ GLboolean RasterPosValid; /* Raster po valid flag */
+ GLboolean EdgeFlag; /* Current edge flag */
+};
+
+struct gamma_array_attrib {
+ GLint VertexSize;
+ GLenum VertexType;
+ GLsizei VertexStride; /* user-specified stride */
+ GLsizei VertexStrideB; /* actual stride in bytes */
+ void *VertexPtr;
+ GLboolean VertexEnabled;
+
+ GLenum NormalType;
+ GLsizei NormalStride; /* user-specified stride */
+ GLsizei NormalStrideB; /* actual stride in bytes */
+ void *NormalPtr;
+ GLboolean NormalEnabled;
+
+ GLint ColorSize;
+ GLenum ColorType;
+ GLsizei ColorStride; /* user-specified stride */
+ GLsizei ColorStrideB; /* actual stride in bytes */
+ void *ColorPtr;
+ GLboolean ColorEnabled;
+
+ GLenum IndexType;
+ GLsizei IndexStride; /* user-specified stride */
+ GLsizei IndexStrideB; /* actual stride in bytes */
+ void *IndexPtr;
+ GLboolean IndexEnabled;
+
+ GLsizei EdgeFlagStride; /* user-specified stride */
+ GLsizei EdgeFlagStrideB; /* actual stride in bytes */
+ GLboolean *EdgeFlagPtr;
+ GLboolean EdgeFlagEnabled;
+
+ GLint TexCoordSize;
+ GLenum TexCoordType;
+ GLsizei TexCoordStride; /* user-specified stride */
+ GLsizei TexCoordStrideB; /* actual stride in bytes */
+ void *TexCoordPtr;
+ GLboolean TexCoordEnabled;
+ GLint TexCoordInterleaveFactor;
+};
+
typedef struct {
drmContext hHWContext;
@@ -91,11 +149,34 @@ typedef struct {
int EnabledFlags;
int DepthSize;
int Begin;
+ GLenum ErrorValue;
+
+ struct _glapi_table *Exec;
+ struct _glapi_table *Save;
+ struct _glapi_table *API;
+
+ struct _mesa_HashTable *DisplayList;
+
+ struct gl_list_attrib List;
+ struct gl_pixelstore_attrib Unpack; /* Pixel unpacking */
+
+ struct gamma_array_attrib Array; /* From Mesa v3.0 */
+ struct gamma_current_attrib Current; /* From Mesa v3.0 */
+
+ /* Display lists */
+ GLuint CallDepth; /* Current recursion calling depth */
+ GLboolean ExecuteFlag; /* Execute GL commands? */
+ GLboolean CompileFlag; /* Compile GL commands into display list? */
+ Node *CurrentListPtr; /* Head of list being compiled */
+ GLuint CurrentListNum; /* Number of the list being compiled */
+ Node *CurrentBlock; /* Pointer to current block of nodes */
+ GLuint CurrentPos; /* Index into current block of nodes */
float ClearColor[4];
float ClearDepth;
int MatrixMode;
int DepthMode;
+ int TransformMode;
float zNear, zFar;
int LBReadMode;
int FBReadMode;
@@ -110,9 +191,25 @@ typedef struct {
int DeltaMode;
int ColorMaterialMode;
int MaterialMode;
+ int NormalizeMode;
int LightingMode;
int Light0Mode;
int Light1Mode;
+ int Light2Mode;
+ int Light3Mode;
+ int Light4Mode;
+ int Light5Mode;
+ int Light6Mode;
+ int Light7Mode;
+ int Light8Mode;
+ int Light9Mode;
+ int Light10Mode;
+ int Light11Mode;
+ int Light12Mode;
+ int Light13Mode;
+ int Light14Mode;
+ int Light15Mode;
+ int LogicalOpMode;
int ScissorMode;
int Window; /* GID part probably should be in draw priv */
diff --git a/xc/lib/GL/mesa/src/drv/gamma/gamma_inithw.c b/xc/lib/GL/mesa/src/drv/gamma/gamma_inithw.c
index 83cec4bcb..6c87559bf 100644
--- a/xc/lib/GL/mesa/src/drv/gamma/gamma_inithw.c
+++ b/xc/lib/GL/mesa/src/drv/gamma/gamma_inithw.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_inithw.c,v 1.6 2000/11/27 10:59:37 alanh Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_inithw.c,v 1.7 2001/01/31 16:15:37 alanh Exp $ */
/**************************************************************************
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
@@ -43,7 +43,7 @@ void gammaInitHW(gammaContextPrivate *gcp)
__DRIscreenPrivate *driScrnPriv = gcp->gammaScrnPriv->driScrnPriv;
GLINTDRIPtr gDRIPriv = (GLINTDRIPtr)driScrnPriv->pDevPriv;
- if (gDRIPriv->numMXDevices == 2) {
+ if (gDRIPriv->numMultiDevices == 2) {
/* Set up each MX's ScanLineOwnership for OpenGL */
CHECK_DMA_BUFFER(nullCC, gcp, 4);
WRITE(gcp->buf, BroadcastMask, 1);
@@ -142,7 +142,7 @@ void gammaInitHW(gammaContextPrivate *gcp)
WRITE(gcp->buf, AlphaTestMode, gcp->AlphaTestMode);
WRITE(gcp->buf, AlphaBlendMode, gcp->AlphaBlendMode);
WRITE(gcp->buf, DitherMode, DitherModeEnable | DM_ColorOrder_RGB);
- if (gDRIPriv->numMXDevices == 2)
+ if (gDRIPriv->numMultiDevices == 2)
WRITE(gcp->buf, RasterizerMode, RM_MultiGLINT | RM_BiasCoordNearHalf);
else
WRITE(gcp->buf, RasterizerMode, RM_BiasCoordNearHalf);
diff --git a/xc/lib/GL/mesa/src/drv/gamma/gamma_regs.h b/xc/lib/GL/mesa/src/drv/gamma/gamma_regs.h
index 85c2b925a..613385909 100644
--- a/xc/lib/GL/mesa/src/drv/gamma/gamma_regs.h
+++ b/xc/lib/GL/mesa/src/drv/gamma/gamma_regs.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_regs.h,v 1.3 2000/06/17 00:02:56 martin Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_regs.h,v 1.4 2001/02/07 13:26:17 alanh Exp $ */
/**************************************************************************
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
@@ -487,8 +487,9 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
/* LightingMode */
#define LightingModeDisable 0x00000000
#define LightingModeEnable 0x00000001
-#define LightingModeTwoSides 0x00000002
+#define LightingModeTwoSides 0x00000004
#define LightingModeLocalViewer 0x00000008
+#define LightingModeSpecularEnable 0x00008000
/* Light0Mode */
#define Light0ModeDisable 0x00000000
@@ -552,6 +553,11 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define PM_AntialiasQuality_4x4 0x00000000
#define PM_AntialiasQuality_8x8 0x00000002
+/* LogicalOpMode */
+#define LogicalOpModeDisable 0x00000000
+#define LogicalOpModeEnable 0x00000001
+#define LogicalOpModeMask 0x0000001e
+
/* LineMode */
#define LM_StippleDisable 0x00000000
#define LM_StippleEnable 0x00000001
@@ -577,6 +583,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define XM_XformNormals 0x00000004
#define XM_XformFaceNormals 0x00000008
#define XM_XformTexture 0x00000010
+#define XM_XMask 0x00000013
#define XM_TexGenModeS_None 0x00000000
#define XM_TexGenModeS_ObjLinear 0x00000020
#define XM_TexGenModeS_EyeLinear 0x00000040
diff --git a/xc/lib/GL/mesa/src/drv/gamma/gamma_xmesa.c b/xc/lib/GL/mesa/src/drv/gamma/gamma_xmesa.c
index 81fbc4c97..27b346707 100644
--- a/xc/lib/GL/mesa/src/drv/gamma/gamma_xmesa.c
+++ b/xc/lib/GL/mesa/src/drv/gamma/gamma_xmesa.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_xmesa.c,v 1.8 2000/12/07 20:26:05 dawes Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_xmesa.c,v 1.11 2001/02/07 13:26:17 alanh Exp $ */
/**************************************************************************
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
@@ -40,26 +40,26 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "gamma_gl.h"
#include "glapi.h"
#include "glint_dri.h"
+#include "gamma_dlist.h"
#include "context.h"
#include "mmath.h"
+#include "hash.h"
__DRIcontextPrivate *nullCC = NULL;
__DRIcontextPrivate *gCC = NULL;
gammaContextPrivate *gCCPriv = NULL;
-static struct _glapi_table *Dispatch = NULL;
-
-
GLboolean XMesaInitDriver(__DRIscreenPrivate *sPriv)
{
gammaScreenPrivate *gsp;
+#if 0
/* Check the DRI version */
{
int major, minor, patch;
if (XF86DRIQueryVersion(sPriv->display, &major, &minor, &patch)) {
- if (major != 3 || minor < 0) {
+ if (major != 4 || minor < 0) {
char msg[1000];
sprintf(msg, "gamma DRI driver expected DRI version 4.0.x but got version %d.%d.%d", major, minor, patch);
__driMesaMessage(msg);
@@ -85,6 +85,7 @@ GLboolean XMesaInitDriver(__DRIscreenPrivate *sPriv)
__driMesaMessage(msg);
return GL_FALSE;
}
+#endif
/* Allocate the private area */
gsp = (gammaScreenPrivate *)Xmalloc(sizeof(gammaScreenPrivate));
@@ -146,17 +147,25 @@ GLboolean XMesaCreateContext( Display *dpy,
gammaScreenPrivate *gPriv = (gammaScreenPrivate *)driScrnPriv->private;
GLINTDRIPtr gDRIPriv = (GLINTDRIPtr)driScrnPriv->pDevPriv;
- if (!Dispatch) {
- GLuint size = _glapi_get_dispatch_table_size() * sizeof(GLvoid *);
- Dispatch = (struct _glapi_table *) malloc(size);
- _gamma_init_dispatch(Dispatch);
- }
-
cPriv = (gammaContextPrivate *)Xmalloc(sizeof(gammaContextPrivate));
if (!cPriv) {
return GL_FALSE;
}
+ if (!cPriv->Exec) {
+ GLuint size = _glapi_get_dispatch_table_size() * sizeof(GLvoid *);
+ cPriv->Exec = (struct _glapi_table *) malloc(size);
+ _gamma_init_exec(cPriv->Exec);
+ }
+
+ cPriv->API = cPriv->Exec;
+
+ if (!cPriv->Save) {
+ GLuint size = _glapi_get_dispatch_table_size() * sizeof(GLvoid *);
+ cPriv->Save = (struct _glapi_table *) malloc(size);
+ _gamma_init_save(cPriv->Save);
+ }
+
cPriv->hHWContext = driContextPriv->hHWContext;
GET_FIRST_DMA(driScrnPriv->fd, cPriv->hHWContext,
1, &cPriv->bufIndex, &cPriv->bufSize,
@@ -168,6 +177,54 @@ GLboolean XMesaCreateContext( Display *dpy,
&cPriv->WCbuf, &cPriv->WCbufCount, gPriv);
#endif
+ gamma_init_lists();
+
+ /* Display List stuff */
+ cPriv->DisplayList = _mesa_NewHashTable();
+ cPriv->List.ListBase = 0;
+ cPriv->CallDepth = 0;
+ cPriv->ExecuteFlag = GL_TRUE;
+ cPriv->CompileFlag = GL_FALSE;
+ cPriv->CurrentListPtr = NULL;
+ cPriv->CurrentBlock = NULL;
+ cPriv->CurrentListNum = 0;
+ cPriv->CurrentPos = 0;
+
+ /* Vertex arrays */
+ cPriv->Array.VertexSize = 4;
+ cPriv->Array.VertexType = GL_FLOAT;
+ cPriv->Array.VertexStride = 0;
+ cPriv->Array.VertexStrideB = 0;
+ cPriv->Array.VertexPtr = NULL;
+ cPriv->Array.VertexEnabled = GL_FALSE;
+ cPriv->Array.NormalType = GL_FLOAT;
+ cPriv->Array.NormalStride = 0;
+ cPriv->Array.NormalStrideB = 0;
+ cPriv->Array.NormalPtr = NULL;
+ cPriv->Array.NormalEnabled = GL_FALSE;
+ cPriv->Array.ColorSize = 4;
+ cPriv->Array.ColorType = GL_FLOAT;
+ cPriv->Array.ColorStride = 0;
+ cPriv->Array.ColorStrideB = 0;
+ cPriv->Array.ColorPtr = NULL;
+ cPriv->Array.ColorEnabled = GL_FALSE;
+ cPriv->Array.IndexType = GL_FLOAT;
+ cPriv->Array.IndexStride = 0;
+ cPriv->Array.IndexStrideB = 0;
+ cPriv->Array.IndexPtr = NULL;
+ cPriv->Array.IndexEnabled = GL_FALSE;
+ cPriv->Array.EdgeFlagStride = 0;
+ cPriv->Array.EdgeFlagStrideB = 0;
+ cPriv->Array.EdgeFlagPtr = NULL;
+ cPriv->Array.EdgeFlagEnabled = GL_FALSE;
+
+ cPriv->Unpack.Alignment = 4;
+ cPriv->Unpack.RowLength = 0;
+ cPriv->Unpack.SkipPixels = 0;
+ cPriv->Unpack.SkipRows = 0;
+ cPriv->Unpack.SwapBytes = GL_FALSE;
+ cPriv->Unpack.LsbFirst = GL_FALSE;
+
cPriv->ClearColor[0] = 0.0;
cPriv->ClearColor[1] = 0.0;
cPriv->ClearColor[2] = 0.0;
@@ -206,7 +263,7 @@ GLboolean XMesaCreateContext( Display *dpy,
FBWindowOriginBot |
gDRIPriv->pprod);
- if (gDRIPriv->numMXDevices == 2) {
+ if (gDRIPriv->numMultiDevices == 2) {
cPriv->LBReadMode |= LBScanLineInt2;
cPriv->FBReadMode |= FBScanLineInt2;
cPriv->FBWindowBase =driScrnPriv->fbWidth*(driScrnPriv->fbHeight/2 - 1);
@@ -352,14 +409,32 @@ GLboolean XMesaCreateContext( Display *dpy,
cPriv->gammaScrnPriv = gPriv;
- cPriv->LightingMode = LightingModeDisable;
+ cPriv->LightingMode = LightingModeDisable | LightingModeSpecularEnable;
cPriv->Light0Mode = LNM_Off;
cPriv->Light1Mode = LNM_Off;
+ cPriv->Light2Mode = LNM_Off;
+ cPriv->Light3Mode = LNM_Off;
+ cPriv->Light4Mode = LNM_Off;
+ cPriv->Light5Mode = LNM_Off;
+ cPriv->Light6Mode = LNM_Off;
+ cPriv->Light7Mode = LNM_Off;
+ cPriv->Light8Mode = LNM_Off;
+ cPriv->Light9Mode = LNM_Off;
+ cPriv->Light10Mode = LNM_Off;
+ cPriv->Light11Mode = LNM_Off;
+ cPriv->Light12Mode = LNM_Off;
+ cPriv->Light13Mode = LNM_Off;
+ cPriv->Light14Mode = LNM_Off;
+ cPriv->Light15Mode = LNM_Off;
+
+ cPriv->LogicalOpMode = LogicalOpModeDisable;
cPriv->MaterialMode = MaterialModeDisable;
cPriv->ScissorMode = UserScissorDisable | ScreenScissorDisable;
+ cPriv->TransformMode = XM_UseModelViewProjMatrix;
+
driContextPriv->driverPrivate = cPriv;
/* Initialize the HW to a known state */
@@ -509,7 +584,7 @@ GLboolean XMesaMakeCurrent(__DRIcontextPrivate *driContextPriv,
CHECK_DMA_BUFFER(gCC, gCCPriv, 1);
WRITE(gCCPriv->buf, GLINTWindow, gCCPriv->Window);
- _glapi_set_dispatch(Dispatch);
+ _glapi_set_dispatch(gCCPriv->API);
_gamma_Viewport(0, 0, driDrawPriv->w, driDrawPriv->h);
} else {
diff --git a/xc/lib/GL/mesa/src/drv/i810/Imakefile b/xc/lib/GL/mesa/src/drv/i810/Imakefile
index 1353d4273..298472656 100644
--- a/xc/lib/GL/mesa/src/drv/i810/Imakefile
+++ b/xc/lib/GL/mesa/src/drv/i810/Imakefile
@@ -1,4 +1,4 @@
-XCOMM $XFree86: xc/lib/GL/mesa/src/drv/i810/Imakefile,v 1.13 2000/12/12 23:24:27 dawes Exp $
+XCOMM $XFree86: xc/lib/GL/mesa/src/drv/i810/Imakefile,v 1.14 2001/02/16 01:26:10 dawes Exp $
#include <Threads.tmpl>
@@ -356,7 +356,7 @@ NormalLintTarget($(SRCS))
LIBNAME = i810_dri.so
ALL_OBJS = $(OBJS)
ALL_DEPS = DONE
-SharedDepModuleTarget($(LIBNAME),$(ALL_DEPS),$(ALL_OBJS))
+SharedDriModuleTarget($(LIBNAME),$(ALL_DEPS),$(ALL_OBJS))
InstallDynamicModule($(LIBNAME),$(MODULEDIR),dri)
#ifdef GlxSoProf
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 2208de78a..57699162c 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.9 2000/12/07 20:26:06 dawes Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810_xmesa.c,v 1.11 2000/12/21 14:06:56 alanh Exp $ */
/*
* Authors:
@@ -157,7 +157,7 @@ GLboolean XMesaInitDriver(__DRIscreenPrivate *sPriv)
if (sPriv->drmMajor != 1 ||
sPriv->drmMinor < 1) {
char msg[1000];
- sprintf(msg, "i810 DRI driver expected DRM driver version 1.0.x but got version %d.%d.%d", sPriv->drmMajor, sPriv->drmMinor, sPriv->drmPatch);
+ sprintf(msg, "i810 DRI driver expected DRM driver version 1.1.x but got version %d.%d.%d", sPriv->drmMajor, sPriv->drmMinor, sPriv->drmPatch);
__driMesaMessage(msg);
return GL_FALSE;
}
diff --git a/xc/lib/GL/mesa/src/drv/mga/Imakefile b/xc/lib/GL/mesa/src/drv/mga/Imakefile
index e4c73ddc0..2d173bf11 100644
--- a/xc/lib/GL/mesa/src/drv/mga/Imakefile
+++ b/xc/lib/GL/mesa/src/drv/mga/Imakefile
@@ -1,4 +1,4 @@
-XCOMM $XFree86: xc/lib/GL/mesa/src/drv/mga/Imakefile,v 1.13 2000/12/12 23:24:28 dawes Exp $
+XCOMM $XFree86: xc/lib/GL/mesa/src/drv/mga/Imakefile,v 1.15 2001/02/16 01:26:11 dawes Exp $
#include <Threads.tmpl>
@@ -72,6 +72,7 @@ MESA_INCLUDES = -I. -I.. -I../../include \
mgafastpath.c \
mgaioctl.c \
mgapipeline.c \
+ mgapixel.c \
mgaspan.c \
mgastate.c \
mgatex.c \
@@ -87,6 +88,7 @@ MESA_INCLUDES = -I. -I.. -I../../include \
mgafastpath.o \
mgaioctl.o \
mgapipeline.o \
+ mgapixel.o \
mgaspan.o \
mgastate.o \
mgatex.o \
@@ -373,7 +375,7 @@ NormalLintTarget($(SRCS))
LIBNAME = mga_dri.so
ALL_OBJS = $(OBJS)
ALL_DEPS = DONE
-SharedDepModuleTarget($(LIBNAME),$(ALL_DEPS),$(ALL_OBJS))
+SharedDriModuleTarget($(LIBNAME),$(ALL_DEPS),$(ALL_OBJS))
InstallDynamicModule($(LIBNAME),$(MODULEDIR),dri)
#ifdef GlxSoProf
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 d10969df4..ad5bb0f8d 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.8 2000/12/07 20:26:06 dawes Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mga_xmesa.c,v 1.10 2001/01/08 01:07:18 martin Exp $ */
/**************************************************************************
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
diff --git a/xc/lib/GL/mesa/src/drv/mga/mgabuffers.c b/xc/lib/GL/mesa/src/drv/mga/mgabuffers.c
index fc021873c..37c7f9acb 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.4 2000/09/24 13:51:05 alanh Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgabuffers.c,v 1.5 2001/01/08 01:07:18 martin Exp $ */
/*
* Authors:
diff --git a/xc/lib/GL/mesa/src/drv/mga/mgacontext.h b/xc/lib/GL/mesa/src/drv/mga/mgacontext.h
index c82b70cc8..ff97d8e24 100644
--- a/xc/lib/GL/mesa/src/drv/mga/mgacontext.h
+++ b/xc/lib/GL/mesa/src/drv/mga/mgacontext.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgacontext.h,v 1.1 2000/09/24 13:51:06 alanh Exp $*/
+/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgacontext.h,v 1.2 2001/01/08 01:07:18 martin Exp $*/
/*
* GLX Hardware Device Driver for Matrox Millenium G200
* Copyright (C) 1999 Wittawat Yamwong
diff --git a/xc/lib/GL/mesa/src/drv/mga/mgadd.c b/xc/lib/GL/mesa/src/drv/mga/mgadd.c
index f7244b353..5e33dd85d 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.6 2000/11/08 05:02:45 dawes Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgadd.c,v 1.7 2001/01/08 01:07:18 martin Exp $ */
diff --git a/xc/lib/GL/mesa/src/drv/mga/mgaioctl.c b/xc/lib/GL/mesa/src/drv/mga/mgaioctl.c
index 4624cee1e..48dfde9dc 100644
--- a/xc/lib/GL/mesa/src/drv/mga/mgaioctl.c
+++ b/xc/lib/GL/mesa/src/drv/mga/mgaioctl.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgaioctl.c,v 1.8 2000/11/08 05:02:45 dawes Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgaioctl.c,v 1.9 2001/01/08 01:07:18 martin Exp $ */
#include <stdio.h>
diff --git a/xc/lib/GL/mesa/src/drv/mga/mgaioctl.h b/xc/lib/GL/mesa/src/drv/mga/mgaioctl.h
index b8207e540..5dd50b1a3 100644
--- a/xc/lib/GL/mesa/src/drv/mga/mgaioctl.h
+++ b/xc/lib/GL/mesa/src/drv/mga/mgaioctl.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgaioctl.h,v 1.5 2000/09/24 13:51:07 alanh Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgaioctl.h,v 1.6 2001/01/08 01:07:18 martin Exp $ */
#ifndef MGA_IOCTL_H
#define MGA_IOCTL_H
diff --git a/xc/lib/GL/mesa/src/drv/mga/mgaspan.c b/xc/lib/GL/mesa/src/drv/mga/mgaspan.c
index dae4f0953..0a82af79d 100644
--- a/xc/lib/GL/mesa/src/drv/mga/mgaspan.c
+++ b/xc/lib/GL/mesa/src/drv/mga/mgaspan.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgaspan.c,v 1.5 2000/09/24 13:51:07 alanh Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgaspan.c,v 1.6 2001/01/08 01:07:18 martin Exp $ */
#include "types.h"
#include "mgadd.h"
diff --git a/xc/lib/GL/mesa/src/drv/mga/mgastate.c b/xc/lib/GL/mesa/src/drv/mga/mgastate.c
index 8e60f00d3..2b824343a 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.6 2000/11/08 05:02:46 dawes Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgastate.c,v 1.7 2001/01/08 01:07:18 martin 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 35945224a..a97e1f3e0 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.7 2000/11/08 05:02:46 dawes Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgatex.c,v 1.8 2001/01/08 01:07:18 martin Exp $ */
#include <stdlib.h>
#include <stdio.h>
@@ -853,17 +853,12 @@ static void mgaDDTexSubImage( GLcontext *ctx, GLenum target,
t = (mgaTextureObjectPtr) tObj->DriverData;
if ( t ) {
if (t->bound) FLUSH_BATCH(mmesa);
- /* if this is the current object, it will force an update */
- mgaDestroyTexObj( mmesa, t );
- mmesa->new_state |= MGA_NEW_TEXTURE;
+ LOCK_HARDWARE( mmesa );
+ /* the texture currently exists, so directly update it */
+ mgaUploadSubImageLocked( mmesa, t, level,
+ xoffset, yoffset, width, height );
+ UNLOCK_HARDWARE( mmesa );
}
-
-
-
-#if 0
- /* the texture currently exists, so directly update it */
- mgaUploadSubImage( t, level, xoffset, yoffset, width, height );
-#endif
}
diff --git a/xc/lib/GL/mesa/src/drv/mga/mgatex.h b/xc/lib/GL/mesa/src/drv/mga/mgatex.h
index bae170829..bd977f1e8 100644
--- a/xc/lib/GL/mesa/src/drv/mga/mgatex.h
+++ b/xc/lib/GL/mesa/src/drv/mga/mgatex.h
@@ -24,7 +24,7 @@
* John Carmack <johnc@idsoftware.com>
* Keith Whitwell <keithw@precisioninsight.com>
*/
-/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgatex.h,v 1.4 2000/09/24 13:51:07 alanh Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgatex.h,v 1.5 2001/01/08 01:07:19 martin Exp $ */
#ifndef MGATEX_INC
#define MGATEX_INC
diff --git a/xc/lib/GL/mesa/src/drv/mga/mgatexmem.c b/xc/lib/GL/mesa/src/drv/mga/mgatexmem.c
index 1161ab580..27f38c296 100644
--- a/xc/lib/GL/mesa/src/drv/mga/mgatexmem.c
+++ b/xc/lib/GL/mesa/src/drv/mga/mgatexmem.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgatexmem.c,v 1.1 2000/09/24 13:51:08 alanh Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgatexmem.c,v 1.2 2001/01/08 01:07:19 martin 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 4caa1bfa4..36e51ce28 100644
--- a/xc/lib/GL/mesa/src/drv/mga/mgatris.c
+++ b/xc/lib/GL/mesa/src/drv/mga/mgatris.c
@@ -23,7 +23,7 @@
*
* Wittawat Yamwong <Wittawat.Yamwong@stud.uni-hannover.de>
*/
-/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgatris.c,v 1.5 2000/09/24 13:51:08 alanh Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgatris.c,v 1.6 2001/01/08 01:07:19 martin Exp $ */
#include <stdio.h>
#include <math.h>
diff --git a/xc/lib/GL/mesa/src/drv/mga/mgatris.h b/xc/lib/GL/mesa/src/drv/mga/mgatris.h
index 9880bbdf1..2711d43d1 100644
--- a/xc/lib/GL/mesa/src/drv/mga/mgatris.h
+++ b/xc/lib/GL/mesa/src/drv/mga/mgatris.h
@@ -23,7 +23,7 @@
*
* Wittawat Yamwong <Wittawat.Yamwong@stud.uni-hannover.de>
*/
-/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgatris.h,v 1.5 2000/09/24 13:51:08 alanh Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgatris.h,v 1.6 2001/01/08 01:07:19 martin Exp $ */
#ifndef MGATIS_INC
#define MGATIS_INC
diff --git a/xc/lib/GL/mesa/src/drv/mga/mgavb.c b/xc/lib/GL/mesa/src/drv/mga/mgavb.c
index 1dfc89d2b..ffa5025a5 100644
--- a/xc/lib/GL/mesa/src/drv/mga/mgavb.c
+++ b/xc/lib/GL/mesa/src/drv/mga/mgavb.c
@@ -23,7 +23,7 @@
*
* Wittawat Yamwong <Wittawat.Yamwong@stud.uni-hannover.de>
*/
-/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgavb.c,v 1.7 2000/11/08 05:02:46 dawes Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgavb.c,v 1.8 2001/01/08 01:07:19 martin Exp $ */
#include "mgacontext.h"
#include "mgavb.h"
diff --git a/xc/lib/GL/mesa/src/drv/r128/Imakefile b/xc/lib/GL/mesa/src/drv/r128/Imakefile
index 3330a991b..de16045ff 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.11 2000/12/12 23:24:28 dawes Exp $
+XCOMM $XFree86: xc/lib/GL/mesa/src/drv/r128/Imakefile,v 1.12 2001/02/16 01:26:11 dawes Exp $
#include <Threads.tmpl>
@@ -376,7 +376,7 @@ NormalLintTarget($(SRCS))
LIBNAME = r128_dri.so
ALL_OBJS = $(OBJS)
ALL_DEPS = DONE
-SharedDepModuleTarget($(LIBNAME),$(ALL_DEPS),$(ALL_OBJS))
+SharedDriModuleTarget($(LIBNAME),$(ALL_DEPS),$(ALL_OBJS))
InstallDynamicModule($(LIBNAME),$(MODULEDIR),dri)
#ifdef GlxSoProf
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 7c6afa8c0..c8926249c 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.4 2000/12/12 17:17:06 dawes Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_context.c,v 1.5 2001/01/08 01:07:20 martin 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 39fdcdb70..a2400c199 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.4 2000/12/12 17:17:06 dawes Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_context.h,v 1.5 2001/01/08 01:07:20 martin 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 69bbc600c..e5825eb89 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.6 2000/12/15 22:48:38 dawes Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_dd.c,v 1.9 2001/01/11 03:36:54 tsi Exp $ */
/**************************************************************************
Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc.,
@@ -70,7 +70,7 @@ static const GLubyte *r128DDGetString( GLcontext *ctx, GLenum name )
switch ( name ) {
case GL_VENDOR:
- return (const GLubyte *)"VA Linux Systems, Inc.";
+ return (GLubyte *)"VA Linux Systems, Inc.";
case GL_RENDERER:
sprintf( (void *)buffer, "Mesa DRI Rage128 " R128_DATE );
@@ -88,13 +88,13 @@ static const GLubyte *r128DDGetString( GLcontext *ctx, GLenum name )
*/
switch ( rmesa->r128Screen->AGPMode ) {
case 1:
- strncat( buffer, " AGP 1x", 7 );
+ strncat( (pointer)buffer, " AGP 1x", 7 );
break;
case 2:
- strncat( buffer, " AGP 2x", 7 );
+ strncat( (pointer)buffer, " AGP 2x", 7 );
break;
case 4:
- strncat( buffer, " AGP 4x", 7 );
+ strncat( (pointer)buffer, " AGP 4x", 7 );
break;
}
@@ -102,7 +102,7 @@ static const GLubyte *r128DDGetString( GLcontext *ctx, GLenum name )
*/
#ifdef USE_X86_ASM
if ( gl_x86_cpu_features ) {
- strncat( buffer, " x86", 4 );
+ strncat( (pointer)buffer, " x86", 4 );
}
#endif
#ifdef USE_MMX_ASM
@@ -112,12 +112,12 @@ static const GLubyte *r128DDGetString( GLcontext *ctx, GLenum name )
#endif
#ifdef USE_3DNOW_ASM
if ( cpu_has_3dnow ) {
- strncat( buffer, "/3DNow!", 7 );
+ strncat( (pointer)buffer, "/3DNow!", 7 );
}
#endif
#ifdef USE_KATMAI_ASM
if ( cpu_has_xmm ) {
- strncat( buffer, "/SSE", 4 );
+ strncat( (pointer)buffer, "/SSE", 4 );
}
#endif
return buffer;
diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_dd.h b/xc/lib/GL/mesa/src/drv/r128/r128_dd.h
index 005949053..17061f332 100644
--- a/xc/lib/GL/mesa/src/drv/r128/r128_dd.h
+++ b/xc/lib/GL/mesa/src/drv/r128/r128_dd.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_dd.h,v 1.2 2000/12/04 19:21:45 dawes Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_dd.h,v 1.3 2001/01/08 01:07:20 martin Exp $ */
/**************************************************************************
Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc.,
diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_eltpath.c b/xc/lib/GL/mesa/src/drv/r128/r128_eltpath.c
index 74c29812f..25548c649 100644
--- a/xc/lib/GL/mesa/src/drv/r128/r128_eltpath.c
+++ b/xc/lib/GL/mesa/src/drv/r128/r128_eltpath.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_eltpath.c,v 1.2 2000/12/07 20:26:08 dawes Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_eltpath.c,v 1.3 2001/01/08 01:07:20 martin Exp $ */
/**************************************************************************
Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc.,
diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_elttmp.h b/xc/lib/GL/mesa/src/drv/r128/r128_elttmp.h
index e477bd7b9..11e30fbfe 100644
--- a/xc/lib/GL/mesa/src/drv/r128/r128_elttmp.h
+++ b/xc/lib/GL/mesa/src/drv/r128/r128_elttmp.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_elttmp.h,v 1.1 2000/12/04 19:21:46 dawes Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_elttmp.h,v 1.2 2001/01/08 01:07:20 martin 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 df382c641..44c996125 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.4 2000/12/04 19:21:46 dawes Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_fastpath.c,v 1.5 2001/01/08 01:07:20 martin Exp $ */
/**************************************************************************
Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc.,
diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_fasttmp.h b/xc/lib/GL/mesa/src/drv/r128/r128_fasttmp.h
index 8a7cef504..4370a553c 100644
--- a/xc/lib/GL/mesa/src/drv/r128/r128_fasttmp.h
+++ b/xc/lib/GL/mesa/src/drv/r128/r128_fasttmp.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_fasttmp.h,v 1.2 2000/12/04 19:21:46 dawes Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_fasttmp.h,v 1.3 2001/01/08 01:07:20 martin Exp $ */
/**************************************************************************
Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc.,
diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_ioctl.c b/xc/lib/GL/mesa/src/drv/r128/r128_ioctl.c
index e886d0f45..78a3b2c6e 100644
--- a/xc/lib/GL/mesa/src/drv/r128/r128_ioctl.c
+++ b/xc/lib/GL/mesa/src/drv/r128/r128_ioctl.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_ioctl.c,v 1.2 2000/12/12 17:17:07 dawes Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_ioctl.c,v 1.3 2001/01/08 01:07:21 martin Exp $ */
/**************************************************************************
Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc.,
diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_ioctl.h b/xc/lib/GL/mesa/src/drv/r128/r128_ioctl.h
index aafd0859b..76f777912 100644
--- a/xc/lib/GL/mesa/src/drv/r128/r128_ioctl.h
+++ b/xc/lib/GL/mesa/src/drv/r128/r128_ioctl.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_ioctl.h,v 1.1 2000/12/04 19:21:46 dawes Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_ioctl.h,v 1.2 2001/01/08 01:07:21 martin Exp $ */
/**************************************************************************
Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc.,
diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_lock.c b/xc/lib/GL/mesa/src/drv/r128/r128_lock.c
index 6cf285b7f..b655b6d97 100644
--- a/xc/lib/GL/mesa/src/drv/r128/r128_lock.c
+++ b/xc/lib/GL/mesa/src/drv/r128/r128_lock.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_lock.c,v 1.1 2000/12/04 19:21:46 dawes Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_lock.c,v 1.2 2001/01/08 01:07:21 martin Exp $ */
/**************************************************************************
Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc.,
diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_lock.h b/xc/lib/GL/mesa/src/drv/r128/r128_lock.h
index 2da57bb44..e734ba29d 100644
--- a/xc/lib/GL/mesa/src/drv/r128/r128_lock.h
+++ b/xc/lib/GL/mesa/src/drv/r128/r128_lock.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_lock.h,v 1.3 2000/12/07 15:43:37 tsi Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_lock.h,v 1.4 2001/01/08 01:07:21 martin 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 e42fa4075..7c85141be 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.3 2000/12/04 19:21:46 dawes Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_pipeline.c,v 1.4 2001/01/08 01:07:21 martin 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 5e40bd6f6..1cfb27d44 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.3 2000/12/04 19:21:46 dawes Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_pipeline.h,v 1.4 2001/01/08 01:07:21 martin 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 7c010519e..f93fec973 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.3 2000/12/04 19:21:46 dawes Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_screen.c,v 1.4 2001/01/08 01:07:21 martin 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 8f88e5cb8..15ae1fd8c 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.3 2000/12/04 19:21:47 dawes Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_screen.h,v 1.4 2001/01/08 01:07:21 martin 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 5ea23c010..003b8eeb6 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.4 2000/12/12 17:17:07 dawes Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_span.c,v 1.5 2001/01/08 01:07:21 martin Exp $ */
/**************************************************************************
Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc.,
diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_span.h b/xc/lib/GL/mesa/src/drv/r128/r128_span.h
index fefa5bd67..44356c5b2 100644
--- a/xc/lib/GL/mesa/src/drv/r128/r128_span.h
+++ b/xc/lib/GL/mesa/src/drv/r128/r128_span.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_span.h,v 1.2 2000/12/04 19:21:47 dawes Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_span.h,v 1.3 2001/01/08 01:07:21 martin 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 82df63edc..0d12e8ce9 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.6 2000/12/12 17:17:07 dawes Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_state.c,v 1.7 2001/01/08 01:07:21 martin Exp $ */
/**************************************************************************
Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc.,
diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_state.h b/xc/lib/GL/mesa/src/drv/r128/r128_state.h
index 97b01c7fa..c51ac2394 100644
--- a/xc/lib/GL/mesa/src/drv/r128/r128_state.h
+++ b/xc/lib/GL/mesa/src/drv/r128/r128_state.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_state.h,v 1.2 2000/12/04 19:21:47 dawes Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_state.h,v 1.3 2001/01/08 01:07:21 martin 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 c6bef883b..8bd2c23f9 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.6 2000/12/04 19:21:47 dawes Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_tex.c,v 1.7 2001/01/08 01:07:21 martin Exp $ */
/**************************************************************************
Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc.,
diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_tex.h b/xc/lib/GL/mesa/src/drv/r128/r128_tex.h
index 92d4c4e3f..e1f67a56d 100644
--- a/xc/lib/GL/mesa/src/drv/r128/r128_tex.h
+++ b/xc/lib/GL/mesa/src/drv/r128/r128_tex.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_tex.h,v 1.3 2000/12/12 17:17:08 dawes Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_tex.h,v 1.4 2001/01/08 01:07:23 martin Exp $ */
/**************************************************************************
Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc.,
diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_texobj.h b/xc/lib/GL/mesa/src/drv/r128/r128_texobj.h
index b1611468a..9939c219b 100644
--- a/xc/lib/GL/mesa/src/drv/r128/r128_texobj.h
+++ b/xc/lib/GL/mesa/src/drv/r128/r128_texobj.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_texobj.h,v 1.3 2000/12/04 19:21:47 dawes Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_texobj.h,v 1.4 2001/01/08 01:07:24 martin 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 aeddb8f95..4d83e27e0 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.3 2000/12/04 19:21:47 dawes Exp $ */ /* -*- c-basic-offset: 3 -*- */
+/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_tris.c,v 1.4 2001/01/08 01:07:24 martin Exp $ */ /* -*- c-basic-offset: 3 -*- */
/**************************************************************************
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 18a051db3..99c816dec 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.3 2000/12/04 19:21:47 dawes Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_tris.h,v 1.4 2001/01/08 01:07:24 martin 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 52a63e628..a9ca8d1bc 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.4 2000/12/04 22:46:01 dawes Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_tritmp.h,v 1.5 2001/01/08 01:07:24 martin 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 3ebacd027..06a63e152 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.10 2000/12/12 17:17:08 dawes Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_vb.c,v 1.11 2001/01/08 01:07:24 martin 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 2e33dcc1b..1a00d9eea 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.3 2000/12/04 19:21:48 dawes Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_vb.h,v 1.4 2001/01/08 01:07:24 martin Exp $ */
/**************************************************************************
Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc.,
diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_xmesa.c b/xc/lib/GL/mesa/src/drv/r128/r128_xmesa.c
index 8fe81d7ac..7654180b8 100644
--- a/xc/lib/GL/mesa/src/drv/r128/r128_xmesa.c
+++ b/xc/lib/GL/mesa/src/drv/r128/r128_xmesa.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_xmesa.c,v 1.4 2000/12/12 17:17:08 dawes Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_xmesa.c,v 1.7 2001/01/23 18:14:38 alanh Exp $ */
/**************************************************************************
Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc.,
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 e166aa96f..b2badf3f9 100644
--- a/xc/lib/GL/mesa/src/drv/sis/sis_alloc.c
+++ b/xc/lib/GL/mesa/src/drv/sis/sis_alloc.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/sis/sis_alloc.c,v 1.6 2000/09/26 15:56:48 tsi Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_alloc.c,v 1.7 2001/01/08 01:07:29 martin Exp $ */
/*
* Authors:
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 24a7e84b9..9e1eb105c 100644
--- a/xc/lib/GL/mesa/src/drv/sis/sis_xmesa.c
+++ b/xc/lib/GL/mesa/src/drv/sis/sis_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/sis/sis_xmesa.c,v 1.6 2000/12/07 20:26:10 dawes Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_xmesa.c,v 1.9 2000/12/22 09:20:04 alanh Exp $ */
/*
* Authors:
@@ -76,6 +76,39 @@ GLboolean XMesaInitDriver (__DRIscreenPrivate * driScrnPriv)
{
SISDRIPtr priv = (SISDRIPtr) driScrnPriv->pDevPriv;
+ /* Check the DRI version */
+ {
+ int major, minor, patch;
+ if (XF86DRIQueryVersion(driScrnPriv->display, &major, &minor, &patch)) {
+ if (major != 3 || minor != 1 || patch < 0) {
+ char msg[1000];
+ sprintf(msg, "sis DRI driver expected DRI version 3.1.x but got version %d.%d.%d", major, minor, patch);
+ __driMesaMessage(msg);
+ return GL_FALSE;
+ }
+ }
+ }
+
+ /* Check that the DDX driver version is compatible */
+ if (driScrnPriv->ddxMajor != 1 ||
+ driScrnPriv->ddxMinor != 0 ||
+ driScrnPriv->ddxPatch < 0) {
+ char msg[1000];
+ sprintf(msg, "sis DRI driver expected DDX driver version 1.0.x but got version %d.%d.%d", driScrnPriv->ddxMajor, driScrnPriv->ddxMinor, driScrnPriv->ddxPatch);
+ __driMesaMessage(msg);
+ return GL_FALSE;
+ }
+
+ /* Check that the DRM driver version is compatible */
+ if (driScrnPriv->drmMajor != 1 ||
+ driScrnPriv->drmMinor != 0 ||
+ driScrnPriv->drmPatch < 0) {
+ char msg[1000];
+ sprintf(msg, "sis DRI driver expected DRM driver version 1.0.x but got version %d.%d.%d", driScrnPriv->drmMajor, driScrnPriv->drmMinor, driScrnPriv->drmPatch);
+ __driMesaMessage(msg);
+ return GL_FALSE;
+ }
+
assert (driScrnPriv->devPrivSize == sizeof (SISDRIRec));
/* Fixme: in quake3, when context changed, XMesaInitDriver is called
diff --git a/xc/lib/GL/mesa/src/drv/tdfx/Imakefile b/xc/lib/GL/mesa/src/drv/tdfx/Imakefile
index 9f45df60d..26251e6f2 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.19 2000/12/12 23:24:28 dawes Exp $
+XCOMM $XFree86: xc/lib/GL/mesa/src/drv/tdfx/Imakefile,v 1.20 2001/02/16 01:26:11 dawes Exp $
#include <Threads.tmpl>
@@ -368,7 +368,7 @@ NormalLintTarget($(SRCS))
LIBNAME = tdfx_dri.so
ALL_OBJS = $(OBJS)
ALL_DEPS = DONE
-SharedDepModuleTarget($(LIBNAME),$(ALL_DEPS),$(ALL_OBJS))
+SharedDriModuleTarget($(LIBNAME),$(ALL_DEPS),$(ALL_OBJS))
InstallDynamicModule($(LIBNAME),$(MODULEDIR),dri)
#ifdef GlxSoProf
diff --git a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_xmesa.c b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_xmesa.c
index 00935e2de..2973d3e60 100644
--- a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_xmesa.c
+++ b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_xmesa.c
@@ -23,7 +23,7 @@
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
-/* $XFree86$ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_xmesa.c,v 1.11 2000/12/21 13:58:56 alanh Exp $ */
/*
* Original rewrite:
diff --git a/xc/lib/Xft/Imakefile b/xc/lib/Xft/Imakefile
index 32396b324..68135d7aa 100644
--- a/xc/lib/Xft/Imakefile
+++ b/xc/lib/Xft/Imakefile
@@ -1,4 +1,4 @@
-XCOMM $XFree86: xc/lib/Xft/Imakefile,v 1.8 2000/12/15 17:12:52 keithp Exp $
+XCOMM $XFree86: xc/lib/Xft/Imakefile,v 1.10 2001/02/09 00:35:03 keithp Exp $
#define DoNormalLib NormalLibXft
#define DoSharedLib SharedLibXft
@@ -31,10 +31,10 @@ INCLUDES=$(FREETYPE2INCLUDES)
DEFINES=-DXFT_DEFAULT_PATH=\"$(XFTCONFIG)\" $(FREETYPE2DEFINES) $(RENDERDEFINES)
REQUIREDLIBS=$(LDPRELIBS) $(XRENDERLIB) $(XLIB) $(FREETYPE2LIB)
-#ifdef Freetype2Dir
+#if HasFreetype2
FT_HEADERS = XftFreetype.h
- FT_SRCS = xftdir.c xftfreetype.c xftglyphs.c xftrender.c
- FT_OBJS = xftdir.o xftfreetype.o xftglyphs.o xftrender.o
+ FT_SRCS = xftcache.c xftdir.c xftfreetype.c xftglyphs.c xftrender.c
+ FT_OBJS = xftcache.o xftdir.o xftfreetype.o xftglyphs.o xftrender.o
#endif
HEADERS = Xft.h $(FT_HEADERS)
diff --git a/xc/lib/Xft/Xft.h b/xc/lib/Xft/Xft.h
index f72a4b2c0..6304c633b 100644
--- a/xc/lib/Xft/Xft.h
+++ b/xc/lib/Xft/Xft.h
@@ -1,5 +1,5 @@
/*
- * $XFree86: xc/lib/Xft/Xft.h,v 1.13 2000/12/08 07:51:26 keithp Exp $
+ * $XFree86: xc/lib/Xft/Xft.h,v 1.17 2001/01/26 20:51:14 keithp Exp $
*
* Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
*
@@ -57,6 +57,7 @@ typedef unsigned int XftChar32;
/* defaults from resources */
#define XFT_SCALE "scale" /* double */
#define XFT_RENDER "render" /* Bool */
+#define XFT_MINSPACE "minspace" /* Bool use minimum line spacing */
/* specific to FreeType rasterizer */
#define XFT_CHAR_WIDTH "charwidth" /* Int */
@@ -79,6 +80,8 @@ typedef unsigned int XftChar32;
#define XFT_RGBA_NONE 0
#define XFT_RGBA_RGB 1
#define XFT_RGBA_BGR 2
+#define XFT_RGBA_VRGB 3
+#define XFT_RGBA_VBGR 4
typedef enum _XftType {
XftTypeVoid,
@@ -254,6 +257,16 @@ XftDrawString32 (XftDraw *draw,
int y,
XftChar32 *string,
int len);
+
+void
+XftDrawStringUtf8 (XftDraw *d,
+ XftColor *color,
+ XftFont *font,
+ int x,
+ int y,
+ XftChar8 *string,
+ int len);
+
void
XftDrawRect (XftDraw *d,
XftColor *color,
@@ -290,6 +303,13 @@ XftTextExtents32 (Display *dpy,
int len,
XGlyphInfo *extents);
+void
+XftTextExtentsUtf8 (Display *dpy,
+ XftFont *font,
+ XftChar8 *string,
+ int len,
+ XGlyphInfo *extents);
+
/* xftfont.c */
XftPattern *
XftFontMatch (Display *dpy, int screen, XftPattern *pattern, XftResult *result);
@@ -379,6 +399,9 @@ XftFontSetMatch (XftFontSet **sets,
XftPattern *
XftNameParse (const char *name);
+Bool
+XftNameUnparse (XftPattern *pat, char *dest, int len);
+
/* xftpat.c */
XftPattern *
XftPatternCreate (void);
@@ -442,6 +465,17 @@ XftPatternBuild (XftPattern *orig, ...);
/* xftstr.c */
+int
+XftUtf8ToUcs4 (XftChar8 *src_orig,
+ XftChar32 *dst,
+ int len);
+
+Bool
+XftUtf8Len (XftChar8 *string,
+ int len,
+ int *nchar,
+ int *wchar);
+
/* xftxlfd.c */
XftPattern *
XftXlfdParse (const char *xlfd_orig, Bool ignore_scalable, Bool complete);
@@ -449,6 +483,9 @@ XftXlfdParse (const char *xlfd_orig, Bool ignore_scalable, Bool complete);
XFontStruct *
XftCoreOpen (Display *dpy, XftPattern *pattern);
+void
+XftCoreClose (Display *dpy, XFontStruct *font);
+
_XFUNCPROTOEND
#endif /* _XFT_H_ */
diff --git a/xc/lib/Xft/XftFreetype.h b/xc/lib/Xft/XftFreetype.h
index 164a2be1f..a8b6fb360 100644
--- a/xc/lib/Xft/XftFreetype.h
+++ b/xc/lib/Xft/XftFreetype.h
@@ -1,5 +1,5 @@
/*
- * $XFree86: xc/lib/Xft/XftFreetype.h,v 1.7 2000/12/15 17:12:52 keithp Exp $
+ * $XFree86: xc/lib/Xft/XftFreetype.h,v 1.12 2001/01/02 02:46:50 keithp Exp $
*
* Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
*
@@ -38,15 +38,15 @@ struct _XftFontStruct {
GlyphSet glyphset;
int min_char;
int max_char;
- int size;
+ FT_F26Dot6 size;
int ascent;
int descent;
int height;
int max_advance_width;
- Bool monospace;
+ int spacing;
int rgba;
Bool antialias;
- Bool encoded; /* use charmap */
+ int charmap; /* -1 for unencoded */
XRenderPictFormat *format;
XGlyphInfo **realized;
int nrealized;
@@ -54,13 +54,32 @@ struct _XftFontStruct {
_XFUNCPROTOBEGIN
+/* xftdir.c */
+Bool
+XftDirScan (XftFontSet *set, const char *dir, Bool force);
+
+Bool
+XftDirSave (XftFontSet *set, const char *dir);
+
/* xftfreetype.c */
+XftPattern *
+XftFreeTypeQuery (const char *file, int id, int *count);
+
+Bool
+XftFreeTypeSetFace (FT_Face face, FT_F26Dot6 size, int charmap);
+
XftFontStruct *
XftFreeTypeOpen (Display *dpy, XftPattern *pattern);
void
XftFreeTypeClose (Display *dpy, XftFontStruct *font);
+XftFontStruct *
+XftFreeTypeGet (XftFont *font);
+
+Bool
+XftInitFtLibrary(void);
+
/* xftglyphs.c */
void
XftGlyphLoad (Display *dpy,
@@ -104,6 +123,13 @@ XftRenderString32 (Display *dpy, Picture src,
XftChar32 *string, int len);
void
+XftRenderStringUtf8 (Display *dpy, Picture src,
+ XftFontStruct *font, Picture dst,
+ int srcx, int srcy,
+ int x, int y,
+ XftChar8 *string, int len);
+
+void
XftRenderExtents8 (Display *dpy,
XftFontStruct *font,
XftChar8 *string,
@@ -124,6 +150,13 @@ XftRenderExtents32 (Display *dpy,
int len,
XGlyphInfo *extents);
+void
+XftRenderExtentsUtf8 (Display *dpy,
+ XftFontStruct *font,
+ XftChar8 *string,
+ int len,
+ XGlyphInfo *extents);
+
XftFontStruct *
XftFreeTypeGet (XftFont *font);
diff --git a/xc/lib/Xft/xftcfg.c b/xc/lib/Xft/xftcfg.c
index 62881ae87..972d2502c 100644
--- a/xc/lib/Xft/xftcfg.c
+++ b/xc/lib/Xft/xftcfg.c
@@ -1,5 +1,5 @@
/*
- * $XFree86: xc/lib/Xft/xftcfg.c,v 1.7 2000/12/17 09:11:37 keithp Exp $
+ * $XFree86: xc/lib/Xft/xftcfg.c,v 1.8 2001/01/02 02:46:51 keithp Exp $
*
* Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
*
@@ -35,6 +35,9 @@ static char *XftConfigDefaultDirs[] = {
char **XftConfigDirs = XftConfigDefaultDirs;
static int XftConfigNdirs;
+char XftConfigDefaultCache[] = "~/.xftcache";
+char *XftConfigCache = 0;
+
static XftSubst *XftSubsts;
/* #define XFT_DEBUG_EDIT */
@@ -51,6 +54,8 @@ XftConfigAddDir (char *d)
if (!h)
return False;
dir = (char *) malloc (strlen (h) + strlen (d));
+ if (!dir)
+ return False;
strcpy (dir, h);
strcat (dir, d+1);
}
@@ -80,6 +85,41 @@ XftConfigAddDir (char *d)
return True;
}
+Bool
+XftConfigSetCache (char *c)
+{
+ char *new;
+ char *h;
+
+ if (*c == '~')
+ {
+ h = getenv ("HOME");
+ if (!h)
+ return False;
+ new = (char *) malloc (strlen (h) + strlen (c));
+ if (!new)
+ return False;
+ strcpy (new, h);
+ strcat (new, c+1);
+ }
+ else
+ {
+ new = _XftSaveString (c);
+ }
+ if (XftConfigCache)
+ free (XftConfigCache);
+ XftConfigCache = new;
+ return True;
+}
+
+char *
+XftConfigGetCache (void)
+{
+ if (!XftConfigCache)
+ XftConfigSetCache (XftConfigDefaultCache);
+ return XftConfigCache;
+}
+
static int XftSubstsMaxObjects;
Bool
diff --git a/xc/lib/Xft/xftcore.c b/xc/lib/Xft/xftcore.c
index ca9139ae7..114533c69 100644
--- a/xc/lib/Xft/xftcore.c
+++ b/xc/lib/Xft/xftcore.c
@@ -1,5 +1,5 @@
/*
- * $XFree86: xc/lib/Xft/xftcore.c,v 1.4 2000/12/08 07:51:27 keithp Exp $
+ * $XFree86: xc/lib/Xft/xftcore.c,v 1.5 2000/12/20 00:28:44 keithp Exp $
*
* Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
*
@@ -65,6 +65,37 @@ XftCoreConvert32 (XftChar32 *string,
return xc;
}
+XChar2b *
+XftCoreConvertUtf8 (XftChar8 *string,
+ int len,
+ XChar2b xcloc[XFT_CORE_N16LOCAL],
+ int *nchar)
+{
+ XChar2b *xc;
+ XftChar32 c;
+ int i;
+ int n, width;
+ int clen;
+
+ if (!XftUtf8Len (string, len, &n, &width))
+ return 0;
+
+ if (n < XFT_CORE_N16LOCAL)
+ xc = xcloc;
+ else
+ xc = (XChar2b *) malloc (n * sizeof (XChar2b));
+ for (i = 0; i < n; i++)
+ {
+ clen = XftUtf8ToUcs4 (string, &c, len);
+ xc[i].byte1 = c & 0xff;
+ xc[i].byte2 = (c >> 8) & 0xff;
+ string += clen;
+ len -= clen;
+ }
+ *nchar = n;
+ return xc;
+}
+
void
XftCoreExtents8 (Display *dpy,
XFontStruct *fs,
@@ -109,6 +140,8 @@ XftCoreExtents16 (Display *dpy,
xc = XftCoreConvert16 (string, len, xcloc);
XTextExtents16 (fs, xc, len, &direction,
&ascent, &descent, &overall);
+ if (xc != xcloc)
+ free (xc);
if (overall.lbearing < overall.rbearing)
{
extents->x = overall.lbearing;
@@ -140,6 +173,42 @@ XftCoreExtents32 (Display *dpy,
xc = XftCoreConvert32 (string, len, xcloc);
XTextExtents16 (fs, xc, len, &direction,
&ascent, &descent, &overall);
+ if (xc != xcloc)
+ free (xc);
+ if (overall.lbearing < overall.rbearing)
+ {
+ extents->x = overall.lbearing;
+ extents->width = overall.rbearing - overall.lbearing;
+ }
+ else
+ {
+ extents->x = overall.rbearing;
+ extents->width = overall.lbearing - overall.rbearing;
+ }
+ extents->y = -overall.ascent;
+ extents->height = overall.ascent + overall.descent;
+ extents->xOff = overall.width;
+ extents->yOff = 0;
+}
+
+void
+XftCoreExtentsUtf8 (Display *dpy,
+ XFontStruct *fs,
+ XftChar8 *string,
+ int len,
+ XGlyphInfo *extents)
+{
+ int direction;
+ int ascent, descent;
+ XCharStruct overall;
+ XChar2b *xc, xcloc[XFT_CORE_N16LOCAL];
+ int n;
+
+ xc = XftCoreConvertUtf8 (string, len, xcloc, &n);
+ XTextExtents16 (fs, xc, n, &direction,
+ &ascent, &descent, &overall);
+ if (xc != xcloc)
+ free (xc);
if (overall.lbearing < overall.rbearing)
{
extents->x = overall.lbearing;
diff --git a/xc/lib/Xft/xftdpy.c b/xc/lib/Xft/xftdpy.c
index 94136fd64..94d7928c1 100644
--- a/xc/lib/Xft/xftdpy.c
+++ b/xc/lib/Xft/xftdpy.c
@@ -1,5 +1,5 @@
/*
- * $XFree86: xc/lib/Xft/xftdpy.c,v 1.4 2000/12/17 08:30:45 keithp Exp $
+ * $XFree86: xc/lib/Xft/xftdpy.c,v 1.6 2001/01/26 20:51:15 keithp Exp $
*
* Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
*
@@ -22,6 +22,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
+#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <X11/Xlibint.h>
@@ -81,6 +82,34 @@ _XftDisplayInfoGet (Display *dpy)
info->defaults = 0;
info->coreFonts = 0;
info->hasRender = XRenderFindVisualFormat (dpy, DefaultVisual (dpy, DefaultScreen (dpy))) != 0;
+ if (_XftFontDebug () & XFT_DBG_RENDER)
+ {
+ Visual *visual = DefaultVisual (dpy, DefaultScreen (dpy));
+ XRenderPictFormat *format = XRenderFindVisualFormat (dpy, visual);
+
+ printf ("XftDisplayInfoGet Default visual 0x%x ",
+ (int) visual->visualid);
+ if (format)
+ {
+ if (format->type == PictTypeDirect)
+ {
+ printf ("format %d,%d,%d,%d\n",
+ format->direct.alpha,
+ format->direct.red,
+ format->direct.green,
+ format->direct.blue);
+ }
+ else
+ {
+ printf ("format indexed\n");
+ }
+ }
+ else
+ printf ("No Render format for default visual\n");
+
+ printf ("XftDisplayInfoGet initialized, hasRender set to \"%s\"\n",
+ info->hasRender ? "True" : "False");
+ }
info->next = _XftDisplayInfo;
_XftDisplayInfo = info;
@@ -89,6 +118,10 @@ _XftDisplayInfoGet (Display *dpy)
bail1:
free (info);
bail0:
+ if (_XftFontDebug () & XFT_DBG_RENDER)
+ {
+ printf ("XftDisplayInfoGet failed to initialize, Xft unhappy\n");
+ }
return 0;
}
@@ -209,6 +242,8 @@ _XftDefaultInit (Display *dpy)
goto bail1;
if (!_XftDefaultInitBool (dpy, pat, XFT_ANTIALIAS))
goto bail1;
+ if (!_XftDefaultInitBool (dpy, pat, XFT_MINSPACE))
+ goto bail1;
return pat;
@@ -344,6 +379,12 @@ XftDefaultSubstitute (Display *dpy, int screen, XftPattern *pattern)
XftDefaultGetInteger (dpy, XFT_RGBA, screen,
XFT_RGBA_NONE));
}
+ if (XftPatternGet (pattern, XFT_MINSPACE, 0, &v) == XftResultNoMatch)
+ {
+ XftPatternAddBool (pattern, XFT_MINSPACE,
+ XftDefaultGetBool (dpy, XFT_MINSPACE, screen,
+ False));
+ }
if (XftPatternGet (pattern, XFT_PIXEL_SIZE, 0, &v) == XftResultNoMatch)
{
int pixels, mm;
@@ -369,8 +410,8 @@ XftDefaultSubstitute (Display *dpy, int screen, XftPattern *pattern)
}
scale = XftDefaultGetDouble (dpy, XFT_SCALE, screen, 1.0);
size *= scale;
- pixels = DisplayHeight (dpy, DefaultScreen (dpy));
- mm = DisplayHeightMM (dpy, DefaultScreen (dpy));
+ pixels = DisplayHeight (dpy, screen);
+ mm = DisplayHeightMM (dpy, screen);
size = size / 72.0;
size = size * 25.4;
size = size * pixels / mm;
diff --git a/xc/lib/Xft/xftdraw.c b/xc/lib/Xft/xftdraw.c
index 7ec5290f1..d8f2c9835 100644
--- a/xc/lib/Xft/xftdraw.c
+++ b/xc/lib/Xft/xftdraw.c
@@ -1,5 +1,5 @@
/*
- * $XFree86: xc/lib/Xft/xftdraw.c,v 1.10 2000/12/15 17:12:52 keithp Exp $
+ * $XFree86: xc/lib/Xft/xftdraw.c,v 1.12 2000/12/20 00:28:44 keithp Exp $
*
* Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
*
@@ -22,6 +22,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
+#include <stdio.h>
#include <stdlib.h>
#include "xftint.h"
#include <X11/Xutil.h>
@@ -200,6 +201,14 @@ XftDrawRenderPrepare (XftDraw *draw,
return False;
if (memcmp (&color->color, &draw->render.fg_color, sizeof (XRenderColor)))
{
+ if (_XftFontDebug () & XFT_DBG_DRAW)
+ {
+ printf ("Switching to color %04x,%04x,%04x,%04x\n",
+ color->color.alpha,
+ color->color.red,
+ color->color.green,
+ color->color.blue);
+ }
XRenderFillRectangle (draw->dpy, PictOpSrc, draw->render.fg_pict,
&color->color, 0, 0, 1, 1);
draw->render.fg_color = color->color;
@@ -255,6 +264,10 @@ XftDrawString8 (XftDraw *draw,
XftChar8 *string,
int len)
{
+ if (_XftFontDebug () & XFT_DBG_DRAW)
+ {
+ printf ("DrawString \"%*.*s\"\n", len, len, string);
+ }
if (font->core)
{
XftDrawCorePrepare (draw, color, font);
@@ -333,6 +346,41 @@ XftDrawString32 (XftDraw *draw,
}
void
+XftDrawStringUtf8 (XftDraw *draw,
+ XftColor *color,
+ XftFont *font,
+ int x,
+ int y,
+ XftChar8 *string,
+ int len)
+{
+ if (font->core)
+ {
+ XChar2b *xc;
+ XChar2b xcloc[XFT_CORE_N16LOCAL];
+ int n;
+
+ XftDrawCorePrepare (draw, color, font);
+ xc = XftCoreConvertUtf8 (string, len, xcloc, &n);
+ if (xc)
+ {
+ XDrawString16 (draw->dpy, draw->drawable, draw->core.draw_gc, x, y,
+ xc, n);
+ }
+ if (xc != xcloc)
+ free (xc);
+ }
+#ifdef FREETYPE2
+ else if (XftDrawRenderPrepare (draw, color, font))
+ {
+ XftRenderStringUtf8 (draw->dpy, draw->render.fg_pict, font->u.ft.font,
+ draw->render.pict, 0, 0, x, y, string, len);
+ }
+#endif
+}
+
+
+void
XftDrawRect (XftDraw *draw,
XftColor *color,
int x,
diff --git a/xc/lib/Xft/xftextent.c b/xc/lib/Xft/xftextent.c
index 0270e82c7..3bff6d535 100644
--- a/xc/lib/Xft/xftextent.c
+++ b/xc/lib/Xft/xftextent.c
@@ -1,5 +1,5 @@
/*
- * $XFree86: xc/lib/Xft/xftextent.c,v 1.4 2000/12/15 17:12:52 keithp Exp $
+ * $XFree86: xc/lib/Xft/xftextent.c,v 1.5 2000/12/20 00:28:44 keithp Exp $
*
* Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
*
@@ -22,6 +22,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
+#include <stdlib.h>
#include "xftint.h"
void
@@ -80,3 +81,109 @@ XftTextExtents32 (Display *dpy,
}
#endif
}
+
+void
+XftTextExtentsUtf8 (Display *dpy,
+ XftFont *font,
+ XftChar8 *string,
+ int len,
+ XGlyphInfo *extents)
+{
+ XftChar8 *src;
+ XftChar32 c;
+ XftChar32 lbuf[4096];
+ XftChar32 *dst;
+ XftChar8 *dst8;
+ XftChar16 *dst16;
+ XftChar32 *dst32;
+ int rlen, clen;
+ int width = 1;
+ int n;
+
+ /* compute needed width */
+ src = string;
+ rlen = len;
+ n = 0;
+ while (rlen)
+ {
+ clen = XftUtf8ToUcs4 (src, &c, rlen);
+ if (clen <= 0) /* malformed UTF8 string */
+ {
+ memset (extents, 0, sizeof (XGlyphInfo));
+ return;
+ }
+ if (c >= 0x10000)
+ width = 4;
+ else if (c >= 0x100)
+ {
+ if (width == 1)
+ width = 2;
+ }
+ src += clen;
+ rlen -= clen;
+ n++;
+ }
+ dst = lbuf;
+ if (n * width > sizeof (lbuf))
+ {
+ dst = (XftChar32 *) malloc (n * width);
+ if (!dst)
+ {
+ memset (extents, 0, sizeof (XGlyphInfo));
+ return;
+ }
+ }
+
+ switch (width) {
+ case 4:
+ src = string;
+ rlen = len;
+ dst32 = dst;
+ while (rlen)
+ {
+ clen = XftUtf8ToUcs4 (src, &c, rlen);
+ if (clen <= 0) /* malformed UTF8 string */
+ return;
+ *dst32++ = c;
+ src += clen;
+ rlen -= clen;
+ }
+ dst32 = dst;
+ XftTextExtents32 (dpy, font, dst32, n, extents);
+ break;
+ case 2:
+ src = string;
+ rlen = len;
+ dst16 = (XftChar16 *) dst;
+ while (rlen)
+ {
+ clen = XftUtf8ToUcs4 (src, &c, rlen);
+ if (clen <= 0) /* malformed UTF8 string */
+ return;
+ *dst16++ = c;
+ src += clen;
+ rlen -= clen;
+ }
+ dst16 = (XftChar16 *) dst;
+ XftTextExtents16 (dpy, font, dst16, n, extents);
+ break;
+ case 1:
+ src = string;
+ rlen = len;
+ dst8 = (XftChar8 *) dst;
+ while (rlen)
+ {
+ clen = XftUtf8ToUcs4 (src, &c, rlen);
+ if (clen <= 0) /* malformed UTF8 string */
+ return;
+ *dst8++ = c;
+ src += clen;
+ rlen -= clen;
+ }
+ dst8 = (XftChar8 *) dst;
+ XftTextExtents8 (dpy, font, dst8, n, extents);
+ break;
+ }
+ if (dst != lbuf)
+ free (dst);
+}
diff --git a/xc/lib/Xft/xftfont.c b/xc/lib/Xft/xftfont.c
index c0100f5e0..9c3f071d3 100644
--- a/xc/lib/Xft/xftfont.c
+++ b/xc/lib/Xft/xftfont.c
@@ -1,5 +1,5 @@
/*
- * $XFree86: xc/lib/Xft/xftfont.c,v 1.7 2000/12/15 17:12:53 keithp Exp $
+ * $XFree86: xc/lib/Xft/xftfont.c,v 1.8 2000/12/20 00:20:48 keithp Exp $
*
* Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
*
@@ -22,9 +22,9 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
+#include <stdio.h>
#include <stdlib.h>
#include "xftint.h"
-#include <stdio.h>
XftPattern *
XftFontMatch (Display *dpy, int screen, XftPattern *pattern, XftResult *result)
@@ -43,8 +43,24 @@ XftFontMatch (Display *dpy, int screen, XftPattern *pattern, XftResult *result)
new = XftPatternDuplicate (pattern);
if (!new)
return 0;
+
+ if (_XftFontDebug () & XFT_DBG_OPENV)
+ {
+ printf ("XftFontMatch pattern ");
+ XftPatternPrint (new);
+ }
XftConfigSubstitute (new);
+ if (_XftFontDebug () & XFT_DBG_OPENV)
+ {
+ printf ("XftFontMatch after XftConfig substitutions ");
+ XftPatternPrint (new);
+ }
XftDefaultSubstitute (dpy, screen, new);
+ if (_XftFontDebug () & XFT_DBG_OPENV)
+ {
+ printf ("XftFontMatch after X resource substitutions ");
+ XftPatternPrint (new);
+ }
nsets = 0;
#ifdef FREETYPE2
@@ -52,6 +68,11 @@ XftFontMatch (Display *dpy, int screen, XftPattern *pattern, XftResult *result)
core = True;
(void) XftPatternGetBool (new, XFT_RENDER, 0, &render);
(void) XftPatternGetBool (new, XFT_CORE, 0, &core);
+ if (_XftFontDebug () & XFT_DBG_OPENV)
+ {
+ printf ("XftFontMatch: use core fonts \"%s\", use render fonts \"%s\"\n",
+ core ? "True" : "False", render ? "True" : "False");
+ }
if (render)
{
@@ -133,10 +154,17 @@ _XftFontDebug (void)
if (!initialized)
{
+ char *e;
+
initialized = 1;
- debug = getenv ("XFT_DEBUG") != 0;
- if (debug)
- printf ("XFT_DEBUG found\n");
+ e = getenv ("XFT_DEBUG");
+ if (e)
+ {
+ printf ("XFT_DEBUG=%s\n", e);
+ debug = atoi (e);
+ if (debug <= 0)
+ debug = 1;
+ }
}
return debug;
}
@@ -155,12 +183,12 @@ XftFontOpen (Display *dpy, int screen, ...)
va_end (va);
if (!pat)
{
- if (_XftFontDebug ())
+ if (_XftFontDebug () & XFT_DBG_OPEN)
printf ("XftFontOpen: Invalid pattern argument\n");
return 0;
}
match = XftFontMatch (dpy, screen, pat, &result);
- if (_XftFontDebug ())
+ if (_XftFontDebug () & XFT_DBG_OPEN)
{
printf ("Pattern ");
XftPatternPrint (pat);
@@ -179,7 +207,7 @@ XftFontOpen (Display *dpy, int screen, ...)
font = XftFontOpenPattern (dpy, match);
if (!font)
{
- if (_XftFontDebug ())
+ if (_XftFontDebug () & XFT_DBG_OPEN)
printf ("No Font\n");
XftPatternDestroy (match);
}
@@ -196,7 +224,7 @@ XftFontOpenName (Display *dpy, int screen, const char *name)
XftFont *font;
pat = XftNameParse (name);
- if (_XftFontDebug ())
+ if (_XftFontDebug () & XFT_DBG_OPEN)
{
printf ("XftFontOpenName \"%s\": ", name);
if (pat)
@@ -208,7 +236,7 @@ XftFontOpenName (Display *dpy, int screen, const char *name)
if (!pat)
return 0;
match = XftFontMatch (dpy, screen, pat, &result);
- if (_XftFontDebug ())
+ if (_XftFontDebug () & XFT_DBG_OPEN)
{
if (match)
{
@@ -238,7 +266,7 @@ XftFontOpenXlfd (Display *dpy, int screen, const char *xlfd)
XftFont *font;
pat = XftXlfdParse (xlfd, False, False);
- if (_XftFontDebug ())
+ if (_XftFontDebug () & XFT_DBG_OPEN)
{
printf ("XftFontOpenXlfd \"%s\": ", xlfd);
if (pat)
@@ -250,7 +278,7 @@ XftFontOpenXlfd (Display *dpy, int screen, const char *xlfd)
if (!pat)
return 0;
match = XftFontMatch (dpy, screen, pat, &result);
- if (_XftFontDebug ())
+ if (_XftFontDebug () & XFT_DBG_OPEN)
{
if (match)
{
@@ -275,7 +303,7 @@ void
XftFontClose (Display *dpy, XftFont *font)
{
if (font->core)
- XFreeFont (dpy, font->u.core.font);
+ XftCoreClose (dpy, font->u.core.font);
#ifdef FREETYPE2
else
XftFreeTypeClose (dpy, font->u.ft.font);
diff --git a/xc/lib/Xft/xftfreetype.c b/xc/lib/Xft/xftfreetype.c
index 04a0584c9..e891e0577 100644
--- a/xc/lib/Xft/xftfreetype.c
+++ b/xc/lib/Xft/xftfreetype.c
@@ -1,5 +1,5 @@
/*
- * $XFree86: xc/lib/Xft/xftfreetype.c,v 1.5 2000/12/15 17:12:53 keithp Exp $
+ * $XFree86: xc/lib/Xft/xftfreetype.c,v 1.10 2001/01/26 20:51:15 keithp Exp $
*
* Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
*
@@ -23,6 +23,7 @@
*/
#include <stdlib.h>
+#include <stdio.h>
#include "xftint.h"
FT_Library _XftFTlibrary;
@@ -32,9 +33,10 @@ typedef struct _XftFtEncoding {
FT_Encoding encoding;
} XftFtEncoding;
-XftFtEncoding xftFtEncoding[] = {
+static XftFtEncoding xftFtEncoding[] = {
{ "iso10646-1", ft_encoding_unicode, },
{ "iso8859-1", ft_encoding_unicode, },
+ { "apple-roman", ft_encoding_apple_roman },
{ "adobe-fontspecific", ft_encoding_symbol, },
{ "glyphs-fontspecific",ft_encoding_none, },
};
@@ -74,7 +76,7 @@ XftFreeTypeQuery (const char *file, int id, int *count)
slant = XFT_SLANT_ROMAN;
if (face->style_flags & FT_STYLE_FLAG_ITALIC)
- slant = (XFT_SLANT_ITALIC + XFT_SLANT_OBLIQUE) / 2;
+ slant = XFT_SLANT_ITALIC;
if (!XftPatternAddInteger (pat, XFT_SLANT, slant))
goto bail1;
@@ -98,6 +100,10 @@ XftFreeTypeQuery (const char *file, int id, int *count)
if (!XftPatternAddInteger (pat, XFT_INDEX, id))
goto bail1;
+ if ((face->face_flags & FT_FACE_FLAG_FIXED_WIDTH) != 0)
+ if (!XftPatternAddInteger (pat, XFT_SPACING, XFT_MONO))
+ goto bail1;
+
if (!(face->face_flags & FT_FACE_FLAG_SCALABLE))
{
for (i = 0; i < face->num_fixed_sizes; i++)
@@ -142,41 +148,185 @@ bail0:
return 0;
}
+/*
+ * List of all open files (each face in a file is managed separately)
+ */
+typedef struct _XftFtFile {
+ struct _XftFtFile *next;
+ int ref;
+
+ char *file;
+ int id;
+
+ FT_Face face;
+ FT_F26Dot6 size;
+ int charmap;
+} XftFtFile;
+
+static XftFtFile *_XftFtFiles;
+
+static XftFtFile *
+_XftFreeTypeOpenFile (char *file, int id)
+{
+ XftFtFile *f;
+ FT_Face face;
+
+ for (f = _XftFtFiles; f; f = f->next)
+ {
+ if (!strcmp (f->file, file) && f->id == id)
+ {
+ ++f->ref;
+ if (_XftFontDebug () & XFT_DBG_REF)
+ printf ("FontFile %s/%d matches existing (%d)\n",
+ file, id, f->ref);
+ return f;
+ }
+ }
+ if (FT_New_Face (_XftFTlibrary, file, id, &face))
+ return 0;
+
+ f = malloc (sizeof (XftFtFile) + strlen (file) + 1);
+ if (!f)
+ return 0;
+
+ if (_XftFontDebug () & XFT_DBG_REF)
+ printf ("FontFile %s/%d matches new\n",
+ file, id);
+ f->next = _XftFtFiles;
+ _XftFtFiles = f;
+ f->ref = 1;
+
+ f->file = (char *) (f+1);
+ strcpy (f->file, file);
+ f->id = id;
+
+ f->face = face;
+ f->size = 0;
+ f->charmap = -1;
+ return f;
+}
+
+Bool
+XftFreeTypeSetFace (FT_Face face, FT_F26Dot6 size, int charmap)
+{
+ XftFtFile *f, **prev;
+
+ for (prev = &_XftFtFiles; (f = *prev); prev = &f->next)
+ {
+ if (f->face == face)
+ {
+ /* LRU */
+ if (prev != &_XftFtFiles)
+ {
+ *prev = f->next;
+ f->next = _XftFtFiles;
+ _XftFtFiles = f;
+ }
+ if (f->size != size)
+ {
+ if (_XftFontDebug() & XFT_DBG_GLYPH)
+ printf ("Set face size to %d (%d)\n",
+ (int) (size >> 6), (int) size);
+ if (FT_Set_Char_Size (face, size, size, 0, 0))
+ return False;
+ f->size = size;
+ }
+ if (f->charmap != charmap && charmap != -1)
+ {
+ if (_XftFontDebug() & XFT_DBG_GLYPH)
+ printf ("Set face charmap to %d\n", charmap);
+ if (FT_Set_Charmap (face, face->charmaps[charmap]))
+ return False;
+ f->charmap = charmap;
+ }
+ break;
+ }
+ }
+ return True;
+}
+
+static void
+_XftFreeTypeCloseFile (XftFtFile *f)
+{
+ XftFtFile **prev;
+
+ if (--f->ref != 0)
+ return;
+ for (prev = &_XftFtFiles; *prev; prev = &(*prev)->next)
+ {
+ if (*prev == f)
+ {
+ *prev = f->next;
+ break;
+ }
+ }
+ FT_Done_Face (f->face);
+ free (f);
+}
+
+/*
+ * Cache of all glyphsets
+ */
+typedef struct _XftFtGlyphSet {
+ struct _XftFtGlyphSet *next;
+ int ref;
+
+ XftFtFile *file;
+ Bool minspace;
+ int char_width;
+
+ XftFontStruct font;
+} XftFtGlyphSet;
+
+static XftFtGlyphSet *_XftFtGlyphSets;
+
XftFontStruct *
XftFreeTypeOpen (Display *dpy, XftPattern *pattern)
{
- char *file;
+ XftFtFile *file;
+ FT_Face face;
+ XftFtGlyphSet *gs;
+ char *filename;
int id;
- double size;
+ double dsize;
+ FT_F26Dot6 size;
int rgba;
int spacing;
int char_width;
Bool antialias;
- Bool encoded;
+ Bool minspace;
char *encoding_name;
- FT_Face face;
XftFontStruct *font;
int j;
FT_Encoding encoding;
int charmap;
- int error;
- int height, ascent, descent;
int extra;
- int div;
-
+ int height, ascent, descent;
XRenderPictFormat pf, *format;
- if (XftPatternGetString (pattern, XFT_FILE, 0, &file) != XftResultMatch)
+ /*
+ * Open the file
+ */
+ if (XftPatternGetString (pattern, XFT_FILE, 0, &filename) != XftResultMatch)
goto bail0;
if (XftPatternGetInteger (pattern, XFT_INDEX, 0, &id) != XftResultMatch)
goto bail0;
+ file = _XftFreeTypeOpenFile (filename, id);
+ if (!file)
+ goto bail0;
+
+ face = file->face;
+
+ /*
+ * Extract the glyphset information from the pattern
+ */
if (XftPatternGetString (pattern, XFT_ENCODING, 0, &encoding_name) != XftResultMatch)
goto bail0;
- if (XftPatternGetDouble (pattern, XFT_PIXEL_SIZE, 0, &size) != XftResultMatch)
+ if (XftPatternGetDouble (pattern, XFT_PIXEL_SIZE, 0, &dsize) != XftResultMatch)
goto bail0;
switch (XftPatternGetInteger (pattern, XFT_RGBA, 0, &rgba)) {
@@ -199,11 +349,101 @@ XftFreeTypeOpen (Display *dpy, XftPattern *pattern)
goto bail0;
}
+ switch (XftPatternGetBool (pattern, XFT_MINSPACE, 0, &minspace)) {
+ case XftResultNoMatch:
+ minspace = False;
+ break;
+ case XftResultMatch:
+ break;
+ default:
+ goto bail0;
+ }
+
+ switch (XftPatternGetInteger (pattern, XFT_SPACING, 0, &spacing)) {
+ case XftResultNoMatch:
+ spacing = XFT_PROPORTIONAL;
+ break;
+ case XftResultMatch:
+ break;
+ default:
+ goto bail1;
+ }
+
if (XftPatternGetInteger (pattern, XFT_CHAR_WIDTH,
0, &char_width) != XftResultMatch)
{
char_width = 0;
}
+ else if (char_width)
+ spacing = XFT_MONO;
+
+ encoding = face->charmaps[0]->encoding;
+
+ for (j = 0; j < NUM_FT_ENCODINGS; j++)
+ if (!strcmp (encoding_name, xftFtEncoding[j].name))
+ {
+ encoding = xftFtEncoding[j].encoding;
+ break;
+ }
+
+ size = (FT_F26Dot6) (dsize * 64.0);
+
+ if (encoding == ft_encoding_none)
+ charmap = -1;
+ else
+ {
+ for (charmap = 0; charmap < face->num_charmaps; charmap++)
+ if (face->charmaps[charmap]->encoding == encoding)
+ break;
+
+ if (charmap == face->num_charmaps)
+ goto bail1;
+ }
+
+
+ /*
+ * Match an existing glyphset
+ */
+ for (gs = _XftFtGlyphSets; gs; gs = gs->next)
+ {
+ if (gs->file == file &&
+ gs->minspace == minspace &&
+ gs->char_width == char_width &&
+ gs->font.size == size &&
+ gs->font.spacing == spacing &&
+ gs->font.charmap == charmap &&
+ gs->font.rgba == rgba &&
+ gs->font.antialias == antialias)
+ {
+ ++gs->ref;
+ if (_XftFontDebug () & XFT_DBG_REF)
+ {
+ printf ("Face size %g matches existing (%d)\n",
+ dsize, gs->ref);
+ }
+ return &gs->font;
+ }
+ }
+
+ if (_XftFontDebug () & XFT_DBG_REF)
+ {
+ printf ("Face size %g matches new\n",
+ dsize);
+ }
+ /*
+ * No existing glyphset, create another
+ */
+ gs = malloc (sizeof (XftFtGlyphSet));
+ if (!gs)
+ goto bail1;
+
+ gs->ref = 1;
+
+ gs->file = file;
+ gs->minspace = minspace;
+ gs->char_width = char_width;
+
+ font = &gs->font;
if (antialias)
{
@@ -261,106 +501,60 @@ XftFreeTypeOpen (Display *dpy, XftPattern *pattern)
}
if (!format)
- goto bail0;
+ goto bail2;
- if (FT_New_Face (_XftFTlibrary, file, id, &face))
- goto bail0;
+ font->size = size;
- font = (XftFontStruct *) malloc (sizeof (XftFontStruct));
- if (!font)
- goto bail1;
-
- font->size = (FT_F26Dot6) (size * 64.0);
-
- if ( FT_Set_Char_Size (face, font->size, font->size, 0, 0) )
+ if (!XftFreeTypeSetFace (face, size, charmap))
goto bail2;
- encoding = face->charmaps[0]->encoding;
-
- for (j = 0; j < NUM_FT_ENCODINGS; j++)
- if (!strcmp (encoding_name, xftFtEncoding[j].name))
- {
- encoding = xftFtEncoding[j].encoding;
- break;
- }
-
- if (encoding == ft_encoding_none)
- encoded = False;
- else
+ descent = -(face->size->metrics.descender >> 6);
+ ascent = face->size->metrics.ascender >> 6;
+ if (minspace)
{
- encoded = True;
- for (charmap = 0; charmap < face->num_charmaps; charmap++)
- if (face->charmaps[charmap]->encoding == encoding)
- break;
-
- if (charmap == face->num_charmaps)
- goto bail2;
-
- error = FT_Set_Charmap(face,
- face->charmaps[charmap]);
-
- if (error)
- goto bail2;
+ height = ascent + descent;
}
-
- height = face->height;
- ascent = face->ascender;
- descent = face->descender;
- if (descent < 0) descent = - descent;
- extra = (height - (ascent + descent));
- if (extra > 0)
+ else
{
- ascent = ascent + extra / 2;
- descent = height - ascent;
+ height = face->size->metrics.height >> 6;
+ extra = (height - (ascent + descent));
+ if (extra > 0)
+ {
+ ascent = ascent + extra / 2;
+ descent = height - ascent;
+ }
+ else if (extra < 0)
+ height = ascent + descent;
}
- else if (extra < 0)
- height = ascent + descent;
- div = face->units_per_EM;
- if (height > div * 5)
- div *= 10;
-
- div = face->units_per_EM;
- if (height > div * 5)
- div *= 10;
+ font->ascent = ascent;
+ font->descent = descent;
+ font->height = height;
- font->descent = descent * font->size / (64 * div);
- font->ascent = ascent * font->size / (64 * div);
- font->height = height * font->size / (64 * div);
- font->max_advance_width = face->max_advance_width * font->size / (64 * div);
-
- font->monospace = (face->face_flags & FT_FACE_FLAG_FIXED_WIDTH) != 0;
if (char_width)
- {
font->max_advance_width = char_width;
- font->monospace = True;
- }
- switch (XftPatternGetInteger (pattern, XFT_SPACING, 0, &spacing)) {
- case XftResultNoMatch:
- break;
- case XftResultMatch:
- if (spacing != XFT_PROPORTIONAL)
- font->monospace = True;
- break;
- default:
- goto bail2;
- }
+ else
+ font->max_advance_width = face->size->metrics.max_advance >> 6;
+
+ gs->next = _XftFtGlyphSets;
+ _XftFtGlyphSets = gs;
font->glyphset = XRenderCreateGlyphSet (dpy, format);
+ font->spacing = spacing;
font->format = format;
font->realized =0;
font->nrealized = 0;
font->rgba = rgba;
font->antialias = antialias;
- font->encoded = encoded;
+ font->charmap = charmap;
font->face = face;
return font;
bail2:
- free (font);
+ free (gs);
bail1:
- FT_Done_Face (font->face);
+ _XftFreeTypeCloseFile (file);
bail0:
return 0;
}
@@ -368,10 +562,26 @@ bail0:
void
XftFreeTypeClose (Display *dpy, XftFontStruct *font)
{
- XRenderFreeGlyphSet (dpy, font->glyphset);
- if (font->realized)
- free (font->realized);
- FT_Done_Face (font->face);
+ XftFtGlyphSet *gs, **prev;
+
+ for (prev = &_XftFtGlyphSets; (gs = *prev); prev = &gs->next)
+ {
+ if (&gs->font == font)
+ {
+ if (--gs->ref == 0)
+ {
+ XRenderFreeGlyphSet (dpy, font->glyphset);
+ if (font->realized)
+ free (font->realized);
+
+ _XftFreeTypeCloseFile (gs->file);
+
+ *prev = gs->next;
+ free (gs);
+ }
+ break;
+ }
+ }
}
XftFontStruct *
@@ -388,6 +598,7 @@ Bool
XftInitFtLibrary (void)
{
char **d;
+ char *cache;
if (_XftFTlibrary)
return True;
@@ -396,16 +607,21 @@ XftInitFtLibrary (void)
_XftFontSet = XftFontSetCreate ();
if (!_XftFontSet)
return False;
+ cache = XftConfigGetCache ();
+ if (cache)
+ XftFileCacheLoad (cache);
for (d = XftConfigDirs; d && *d; d++)
{
#ifdef XFT_DEBUG_FONTSET
printf ("scan dir %s\n", *d);
#endif
- XftDirScan (_XftFontSet, *d);
+ XftDirScan (_XftFontSet, *d, False);
}
#ifdef XFT_DEBUG_FONTSET
- XftPrintFontSet (_XftFontSet);
+ XftFontSetPrint (_XftFontSet);
#endif
+ if (cache)
+ XftFileCacheSave (cache);
+ XftFileCacheDispose ();
return True;
}
-
diff --git a/xc/lib/Xft/xftglyphs.c b/xc/lib/Xft/xftglyphs.c
index e773ebc8e..6a6f2c274 100644
--- a/xc/lib/Xft/xftglyphs.c
+++ b/xc/lib/Xft/xftglyphs.c
@@ -1,5 +1,5 @@
/*
- * $XFree86: xc/lib/Xft/xftglyphs.c,v 1.6 2000/12/15 17:12:53 keithp Exp $
+ * $XFree86: xc/lib/Xft/xftglyphs.c,v 1.9 2001/01/26 20:51:16 keithp Exp $
*
* Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
*
@@ -22,6 +22,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
+#include <stdio.h>
#include <stdlib.h>
#include "xftint.h"
#include <freetype/ftoutln.h>
@@ -69,16 +70,32 @@ XftGlyphLoad (Display *dpy,
int height;
int i;
int left, right, top, bottom;
- int mul = 1;
+ int hmul = 1;
+ int vmul = 1;
FT_Bitmap ftbit;
FT_Matrix matrix;
- if (font->antialias && font->rgba)
+ if (!XftFreeTypeSetFace (font->face, font->size, font->charmap))
+ return ;
+
+ if (font->antialias)
{
- matrix.xx = 0x30000L;
- matrix.yy = 0x10000L;
- matrix.xy = matrix.yx = 0;
- mul = 3;
+ switch (font->rgba) {
+ case XFT_RGBA_RGB:
+ case XFT_RGBA_BGR:
+ matrix.xx = 0x30000L;
+ matrix.yy = 0x10000L;
+ matrix.xy = matrix.yx = 0;
+ hmul = 3;
+ break;
+ case XFT_RGBA_VRGB:
+ case XFT_RGBA_VBGR:
+ matrix.xx = 0x10000L;
+ matrix.yy = 0x30000L;
+ matrix.xy = matrix.yx = 0;
+ vmul = 3;
+ break;
+ }
}
while (nglyph--)
{
@@ -87,11 +104,16 @@ XftGlyphLoad (Display *dpy,
if (!gi)
continue;
- if (font->encoded)
+ if (font->charmap != -1)
{
glyphindex = FT_Get_Char_Index (font->face, charcode);
if (!glyphindex)
+ {
+ if (_XftFontDebug() & XFT_DBG_GLYPH)
+ printf ("glyph (%c) %d missing\n",
+ (int) charcode, (int) charcode);
continue;
+ }
}
else
glyphindex = (FT_UInt) charcode;
@@ -112,7 +134,7 @@ XftGlyphLoad (Display *dpy,
/*
* Try to keep monospace fonts ink-inside
*/
- if (font->monospace)
+ if (font->spacing != XFT_PROPORTIONAL)
{
if (TRUNC(right) > font->max_advance_width)
{
@@ -134,11 +156,11 @@ XftGlyphLoad (Display *dpy,
if ( glyph->format == ft_glyph_format_outline )
{
if (font->antialias)
- pitch = (width * mul + 3) & ~3;
+ pitch = (width * hmul + 3) & ~3;
else
pitch = ((width + 31) & ~31) >> 3;
- size = pitch * height;
+ size = pitch * height * vmul;
if (size > bufSize)
{
@@ -151,8 +173,8 @@ XftGlyphLoad (Display *dpy,
}
memset (bufBitmap, 0, size);
- ftbit.width = width * mul;
- ftbit.rows = height;
+ ftbit.width = width * hmul;
+ ftbit.rows = height * vmul;
ftbit.pitch = pitch;
if (font->antialias)
ftbit.pixel_mode = ft_pixel_mode_grays;
@@ -161,10 +183,10 @@ XftGlyphLoad (Display *dpy,
ftbit.buffer = bufBitmap;
- if (font->antialias && font->rgba)
+ if (font->antialias && font->rgba != XFT_RGBA_NONE)
FT_Outline_Transform (&glyph->outline, &matrix);
- FT_Outline_Translate ( &glyph->outline, -left*mul, -bottom );
+ FT_Outline_Translate ( &glyph->outline, -left*hmul, -bottom*vmul );
FT_Outline_Get_Bitmap( _XftFTlibrary, &glyph->outline, &ftbit );
i = size;
@@ -192,39 +214,42 @@ XftGlyphLoad (Display *dpy,
}
}
}
-#if 0
+ if (_XftFontDebug() & XFT_DBG_GLYPH)
{
- int x, y;
- unsigned char *line;
-
- line = bufBitmap;
- printf ("\nchar 0x%x (%c):\n", (int) charcode, (char) charcode);
- for (y = 0; y < height; y++)
+ printf ("char 0x%x (%c):\n", (int) charcode, (char) charcode);
+ if (_XftFontDebug() & XFT_DBG_GLYPHV)
{
- if (font->antialias)
- {
- static char den[] = { " .:;=+*#" };
- for (x = 0; x < pitch; x++)
- printf ("%c", den[line[x] >> 5]);
- }
- else
+ int x, y;
+ unsigned char *line;
+
+ line = bufBitmap;
+ for (y = 0; y < height * vmul; y++)
{
- for (x = 0; x < pitch * 8; x++)
+ if (font->antialias)
+ {
+ static char den[] = { " .:;=+*#" };
+ for (x = 0; x < pitch; x++)
+ printf ("%c", den[line[x] >> 5]);
+ }
+ else
{
- printf ("%c", line[x>>3] & (1 << (x & 7)) ? '#' : ' ');
+ for (x = 0; x < pitch * 8; x++)
+ {
+ printf ("%c", line[x>>3] & (1 << (x & 7)) ? '#' : ' ');
+ }
}
+ printf ("\n");
+ line += pitch;
}
printf ("\n");
- line += pitch;
}
}
-#endif
}
else
{
-#if 0
- printf ("glyph (%c) %d missing\n", (int) charcode, (int) charcode);
-#endif
+ if (_XftFontDebug() & XFT_DBG_GLYPH)
+ printf ("glyph (%c) %d no outline\n",
+ (int) charcode, (int) charcode);
continue;
}
@@ -232,11 +257,16 @@ XftGlyphLoad (Display *dpy,
gi->height = height;
gi->x = -TRUNC(left);
gi->y = TRUNC(top);
- if (font->monospace)
+ if (font->spacing != XFT_PROPORTIONAL)
+ {
gi->xOff = font->max_advance_width;
+ gi->yOff = 0;
+ }
else
- gi->xOff = TRUNC(ROUND(glyph->metrics.horiAdvance));
- gi->yOff = 0;
+ {
+ gi->xOff = TRUNC(ROUND(glyph->advance.x));
+ gi->yOff = TRUNC(ROUND(glyph->advance.y));
+ }
g = charcode;
if (font->antialias && font->rgba != XFT_RGBA_NONE)
@@ -247,18 +277,24 @@ XftGlyphLoad (Display *dpy,
unsigned int red, green, blue;
int rf, gf, bf;
int s;
+ int o, os;
widthrgba = width;
pitchrgba = (widthrgba * 4 + 3) & ~3;
sizergba = pitchrgba * height;
+ os = 1;
switch (font->rgba) {
+ case XFT_RGBA_VRGB:
+ os = pitch;
case XFT_RGBA_RGB:
default:
rf = 0;
gf = 1;
bf = 2;
break;
+ case XFT_RGBA_VBGR:
+ os = pitch;
case XFT_RGBA_BGR:
bf = 0;
gf = 1;
@@ -281,21 +317,23 @@ XftGlyphLoad (Display *dpy,
{
in = in_line;
out = (unsigned int *) out_line;
- in_line += pitch;
+ in_line += pitch * vmul;
out_line += pitchrgba;
- for (x = 0; x < width * mul; x += 3)
+ for (x = 0; x < width * hmul; x += hmul)
{
red = green = blue = 0;
+ o = 0;
for (s = 0; s < 3; s++)
{
- red += filters[rf][s]*in[x+s];
- green += filters[gf][s]*in[x+s];
- blue += filters[bf][s]*in[x+s];
+ red += filters[rf][s]*in[x+o];
+ green += filters[gf][s]*in[x+o];
+ blue += filters[bf][s]*in[x+o];
+ o += os;
}
red = red / 65536;
green = green / 65536;
blue = blue / 65536;
- out[x/3] = (green << 24) | (red << 16) | (green << 8) | blue;
+ *out++ = (green << 24) | (red << 16) | (green << 8) | blue;
}
}
@@ -368,7 +406,10 @@ XftFreeTypeGlyphExists (Display *dpy,
XftFontStruct *font,
XftChar32 glyph)
{
- if (font->encoded)
+ if (font->charmap != -1)
+ {
+ FT_Set_Charmap (font->face, font->face->charmaps[font->charmap]);
glyph = (XftChar32) FT_Get_Char_Index (font->face, (FT_ULong) glyph);
+ }
return glyph && glyph <= font->face->num_glyphs;
}
diff --git a/xc/lib/Xft/xftgram.y b/xc/lib/Xft/xftgram.y
index bcf399a2a..a6cb6ef4b 100644
--- a/xc/lib/Xft/xftgram.y
+++ b/xc/lib/Xft/xftgram.y
@@ -1,5 +1,5 @@
/*
- * $XFree86: xc/lib/Xft/xftgram.y,v 1.2 2000/11/30 23:30:00 dawes Exp $
+ * $XFree86: xc/lib/Xft/xftgram.y,v 1.3 2001/01/02 02:46:51 keithp Exp $
*
* Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
*
@@ -47,7 +47,8 @@
%token <dval> DOUBLE
%token <sval> STRING NAME
%token <ival> ANY ALL
-%token <ival> DIR INCLUDE INCLUDEIF MATCH EDIT TOK_TRUE TOK_FALSE TOK_NIL
+%token <ival> DIR CACHE INCLUDE INCLUDEIF MATCH EDIT
+%token <ival> TOK_TRUE TOK_FALSE TOK_NIL
%token <ival> EQUAL SEMI
%type <eval> expr
@@ -75,6 +76,8 @@ configs : configs config
;
config : DIR STRING
{ XftConfigAddDir ($2); }
+ | CACHE STRING
+ { XftConfigSetCache ($2); }
| INCLUDE STRING
{ XftConfigPushInput ($2, True); }
| INCLUDEIF STRING
diff --git a/xc/lib/Xft/xftint.h b/xc/lib/Xft/xftint.h
index 6abc0bcea..53b95facc 100644
--- a/xc/lib/Xft/xftint.h
+++ b/xc/lib/Xft/xftint.h
@@ -1,5 +1,5 @@
/*
- * $XFree86: xc/lib/Xft/xftint.h,v 1.15 2000/12/15 17:12:53 keithp Exp $
+ * $XFree86: xc/lib/Xft/xftint.h,v 1.21 2001/01/26 20:51:16 keithp Exp $
*
* Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
*
@@ -84,6 +84,18 @@ extern XftFontSet *_XftFontSet;
#define XFT_DEFAULT_PATH "/usr/X11R6/lib/X11/XftConfig"
#endif
+#define XFT_DBG_OPEN 1
+#define XFT_DBG_OPENV 2
+#define XFT_DBG_RENDER 4
+#define XFT_DBG_DRAW 8
+#define XFT_DBG_REF 16
+#define XFT_DBG_GLYPH 32
+#define XFT_DBG_GLYPHV 64
+#define XFT_DBG_CACHE 128
+#define XFT_DBG_CACHEV 256
+#define XFT_DBG_MATCH 512
+#define XFT_DBG_MATCHV 1024
+
typedef enum _XftOp {
XftOpInteger, XftOpDouble, XftOpString, XftOpBool, XftOpNil,
XftOpField,
@@ -191,11 +203,40 @@ _XftPatternVapBuild_return: \
}
+/* xftcache.c */
+
+char *
+XftFileCacheFind (char *file, int id, int *count);
+
+void
+XftFileCacheDispose (void);
+
+void
+XftFileCacheLoad (char *cache);
+
+Bool
+XftFileCacheUpdate (char *file, int id, char *name);
+
+Bool
+XftFileCacheSave (char *cache);
+
+Bool
+XftFileCacheReadDir (XftFontSet *set, const char *cache_file);
+
+Bool
+XftFileCacheWriteDir (XftFontSet *set, const char *cache_file);
+
/* xftcfg.c */
Bool
XftConfigAddDir (char *d);
Bool
+XftConfigSetCache (char *c);
+
+char *
+XftConfigGetCache (void);
+
+Bool
XftConfigAddEdit (XftTest *test, XftEdit *edit);
Bool
@@ -217,6 +258,12 @@ XftCoreConvert32 (unsigned int *string,
int len,
XChar2b xcloc[XFT_CORE_N16LOCAL]);
+XChar2b *
+XftCoreConvertUtf8 (XftChar8 *string,
+ int len,
+ XChar2b xcloc[XFT_CORE_N16LOCAL],
+ int *nchar);
+
void
XftCoreExtents8 (Display *dpy,
XFontStruct *fs,
@@ -238,6 +285,13 @@ XftCoreExtents32 (Display *dpy,
int len,
XGlyphInfo *extents);
+void
+XftCoreExtentsUtf8 (Display *dpy,
+ XFontStruct *fs,
+ XftChar8 *string,
+ int len,
+ XGlyphInfo *extents);
+
Bool
XftCoreGlyphExists (Display *dpy,
XFontStruct *fs,
@@ -259,10 +313,6 @@ XftEditPrint (XftEdit *edit);
void
XftSubstPrint (XftSubst *subst);
-/* xftdir.c */
-Bool
-XftDirScan (XftFontSet *set, const char *dir);
-
/* xftdpy.c */
int
XftDefaultParseBool (char *v);
@@ -295,12 +345,7 @@ XftDrawCorePrepare (XftDraw *draw,
int
_XftFontDebug (void);
-/* xftfreetype.c */
-XftPattern *
-XftFreeTypeQuery (const char *file, int id, int *count);
-
/* xftfs.c */
-/* xftglyphs.c */
/* xftgram.y */
int
XftConfigparse (void);
@@ -349,7 +394,7 @@ XftEditDestroy (XftEdit *e);
/* xftinit.c */
Bool
-XftInitFtLibrary (void);
+XftInit (char *config);
/* xftlex.l */
extern int XftConfigLineno;
@@ -365,9 +410,6 @@ Bool
XftConfigPushInput (char *s, Bool complain);
/* xftlist.c */
-XftObjectSet *
-_XftObjectSetVapBuild (const char *first, va_list *vap);
-
Bool
XftListValueCompare (XftValue v1,
XftValue v2);
diff --git a/xc/lib/Xft/xftlex.l b/xc/lib/Xft/xftlex.l
index f668ae6ff..14773789b 100644
--- a/xc/lib/Xft/xftlex.l
+++ b/xc/lib/Xft/xftlex.l
@@ -1,6 +1,6 @@
%{
/*
- * $XFree86: xc/lib/Xft/xftlex.l,v 1.3 2000/12/15 22:48:39 dawes Exp $
+ * $XFree86: xc/lib/Xft/xftlex.l,v 1.4 2001/01/02 02:46:51 keithp Exp $
*
* Copyright (c) 2000 Keith Packard, member of The XFree86 Project, Inc.
*
@@ -97,6 +97,7 @@ static void unput (char c)
"/\052" _XftConfigSkipComment();
^# _XftConfigSkipLine();
dir return DIR;
+cache return CACHE;
include return INCLUDE;
includeif return INCLUDEIF;
match return MATCH;
diff --git a/xc/lib/Xft/xftmatch.c b/xc/lib/Xft/xftmatch.c
index 45bde6b4c..2f274c302 100644
--- a/xc/lib/Xft/xftmatch.c
+++ b/xc/lib/Xft/xftmatch.c
@@ -1,5 +1,5 @@
/*
- * $XFree86: xc/lib/Xft/xftmatch.c,v 1.3 2000/12/14 23:03:55 keithp Exp $
+ * $XFree86: xc/lib/Xft/xftmatch.c,v 1.4 2001/01/26 20:51:17 keithp Exp $
*
* Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
*
@@ -27,8 +27,6 @@
#include "xftint.h"
#include <stdio.h>
-/* #define XFT_DEBUG_MATCH */
-
static double
_XftCompareInteger (char *object, XftValue value1, XftValue value2)
{
@@ -151,9 +149,8 @@ _XftCompareValueList (const char *object,
*result = XftResultTypeMismatch;
return False;
}
-#ifdef XFT_DEBUG_MATCH
- printf (" v %g j %d ", v, j);
-#endif
+ if (_XftFontDebug () & XFT_DBG_MATCHV)
+ printf (" v %g j %d ", v, j);
v = v * 100 + j;
if (v < best)
{
@@ -164,13 +161,14 @@ _XftCompareValueList (const char *object,
}
j++;
}
-#ifdef XFT_DEBUG_MATCH
- printf (" %s: %g ", object, best);
- XftValueListPrint (v1orig);
- printf (", ");
- XftValueListPrint (v2orig);
- printf ("\n");
-#endif
+ if (_XftFontDebug () & XFT_DBG_MATCHV)
+ {
+ printf (" %s: %g ", object, best);
+ XftValueListPrint (v1orig);
+ printf (", ");
+ XftValueListPrint (v2orig);
+ printf ("\n");
+ }
value[i] += best;
return True;
}
@@ -181,22 +179,26 @@ _XftCompareValueList (const char *object,
*/
static Bool
-_XftCompare (XftPattern *p1, XftPattern *p2, double *value, XftResult *result)
+_XftCompare (XftPattern *pat,
+ XftPattern *fnt,
+ double *value,
+ XftResult *result)
{
int i, i1, i2;
for (i = 0; i < NUM_MATCHER; i++)
value[i] = 0.0;
- for (i1 = 0; i1 < p1->num; i1++)
- for (i2 = 0; i2 < p2->num; i2++)
+ for (i1 = 0; i1 < pat->num; i1++)
+ {
+ for (i2 = 0; i2 < fnt->num; i2++)
{
- if (!_XftStrCmpIgnoreCase (p1->elts[i1].object,
- p2->elts[i2].object))
+ if (!_XftStrCmpIgnoreCase (pat->elts[i1].object,
+ fnt->elts[i2].object))
{
- if (!_XftCompareValueList (p1->elts[i1].object,
- p1->elts[i1].values,
- p2->elts[i2].values,
+ if (!_XftCompareValueList (pat->elts[i1].object,
+ pat->elts[i1].values,
+ fnt->elts[i2].values,
0,
value,
result))
@@ -204,6 +206,25 @@ _XftCompare (XftPattern *p1, XftPattern *p2, double *value, XftResult *result)
break;
}
}
+#if 0
+ /*
+ * Overspecified patterns are slightly penalized in
+ * case some other font includes the requested field
+ */
+ if (i2 == fnt->num)
+ {
+ for (i2 = 0; i2 < NUM_MATCHER; i2++)
+ {
+ if (!_XftStrCmpIgnoreCase (_XftMatchers[i2].object,
+ pat->elts[i1].object))
+ {
+ value[i2] = 1.0;
+ break;
+ }
+ }
+ }
+#endif
+ }
return True;
}
@@ -226,29 +247,32 @@ XftFontSetMatch (XftFontSet **sets,
for (i = 0; i < NUM_MATCHER; i++)
bestscore[i] = 0;
best = 0;
-#ifdef XFT_DEBUG_MATCH
- printf ("Match ");
- XftPatternPrint (p);
-#endif
+ if (_XftFontDebug () & XFT_DBG_MATCH)
+ {
+ printf ("Match ");
+ XftPatternPrint (p);
+ }
for (set = 0; set < nsets; set++)
{
s = sets[set];
for (f = 0; f < s->nfont; f++)
{
-#ifdef XFT_DEBUG_MATCH
- printf ("Font %d ", f);
- XftPatternPrint (s->fonts[f]);
-#endif
+ if (_XftFontDebug () & XFT_DBG_MATCH)
+ {
+ printf ("Font %d ", f);
+ XftPatternPrint (s->fonts[f]);
+ }
if (!_XftCompare (p, s->fonts[f], score, result))
return 0;
-#ifdef XFT_DEBUG_MATCH
- printf ("Score");
- for (i = 0; i < NUM_MATCHER; i++)
+ if (_XftFontDebug () & XFT_DBG_MATCH)
{
- printf (" %g", score[i]);
+ printf ("Score");
+ for (i = 0; i < NUM_MATCHER; i++)
+ {
+ printf (" %g", score[i]);
+ }
+ printf ("\n");
}
- printf ("\n");
-#endif
for (i = 0; i < NUM_MATCHER; i++)
{
if (best && bestscore[i] < score[i])
@@ -263,12 +287,13 @@ XftFontSetMatch (XftFontSet **sets,
}
}
}
-#ifdef XFT_DEBUG_MATCH
- printf ("Best score");
- for (i = 0; i < NUM_MATCHER; i++)
- printf (" %g", bestscore[i]);
- XftPatternPrint (best);
-#endif
+ if (_XftFontDebug () & XFT_DBG_MATCH)
+ {
+ printf ("Best score");
+ for (i = 0; i < NUM_MATCHER; i++)
+ printf (" %g", bestscore[i]);
+ XftPatternPrint (best);
+ }
if (!best)
{
*result = XftResultNoMatch;
diff --git a/xc/lib/Xft/xftname.c b/xc/lib/Xft/xftname.c
index 675b6fb00..39e40e0b5 100644
--- a/xc/lib/Xft/xftname.c
+++ b/xc/lib/Xft/xftname.c
@@ -1,5 +1,5 @@
/*
- * $XFree86: xc/lib/Xft/xftname.c,v 1.5 2000/12/14 23:03:56 keithp Exp $
+ * $XFree86: xc/lib/Xft/xftname.c,v 1.9 2001/01/26 20:51:17 keithp Exp $
*
* Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
*
@@ -26,13 +26,14 @@
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
+#include <stdio.h>
typedef struct _XftObjectType {
const char *object;
XftType type;
} XftObjectType;
-const XftObjectType _XftObjectTypes[] = {
+static const XftObjectType _XftObjectTypes[] = {
{ XFT_FAMILY, XftTypeString, },
{ XFT_STYLE, XftTypeString, },
{ XFT_SLANT, XftTypeInteger, },
@@ -53,6 +54,9 @@ const XftObjectType _XftObjectTypes[] = {
{ XFT_RGBA, XftTypeInteger, },
{ XFT_SCALE, XftTypeDouble, },
{ XFT_RENDER, XftTypeBool, },
+ { XFT_MINSPACE, XftTypeBool, },
+ { XFT_CHAR_WIDTH, XftTypeInteger },
+ { XFT_CHAR_HEIGHT, XftTypeInteger },
};
#define NUM_OBJECT_TYPES (sizeof _XftObjectTypes / sizeof _XftObjectTypes[0])
@@ -93,6 +97,8 @@ static XftConstant XftConstants[] = {
{ "rgb", "rgba", XFT_RGBA_RGB, },
{ "bgr", "rgba", XFT_RGBA_BGR, },
+ { "vrgb", "rgba", XFT_RGBA_VRGB },
+ { "vbgr", "rgba", XFT_RGBA_VBGR },
};
#define NUM_XFT_CONSTANTS (sizeof XftConstants/sizeof XftConstants[0])
@@ -152,9 +158,17 @@ _XftNameFindNext (const char *cur, const char *delim, char *save, char *last)
{
char c;
- while (*cur && !strchr (delim, *cur))
+ while ((c = *cur))
{
- c = *cur++;
+ if (c == '\\')
+ {
+ ++cur;
+ if (!(c = *cur))
+ break;
+ }
+ else if (strchr (delim, c))
+ break;
+ ++cur;
*save++ = c;
}
*save = 0;
@@ -211,10 +225,10 @@ XftNameParse (const char *name)
}
while (delim == ':')
{
- name = _XftNameFindNext (name, "=-:", save, &delim);
+ name = _XftNameFindNext (name, "=_:", save, &delim);
if (save[0])
{
- if (delim == '=' || delim == '-')
+ if (delim == '=' || delim == '_')
{
t = XftNameGetType (save);
for (;;)
@@ -251,3 +265,117 @@ bail1:
bail0:
return 0;
}
+
+static Bool
+_XftNameUnparseString (const char *string, char *escape, char **destp, int *lenp)
+{
+ int len = *lenp;
+ char *dest = *destp;
+ char c;
+
+ while ((c = *string++))
+ {
+ if (escape && strchr (escape, c))
+ {
+ if (len-- == 0)
+ return False;
+ *dest++ = escape[0];
+ }
+ if (len-- == 0)
+ return False;
+ *dest++ = c;
+ }
+ *destp = dest;
+ *lenp = len;
+ return True;
+}
+
+static Bool
+_XftNameUnparseValue (XftValue v, char *escape, char **destp, int *lenp)
+{
+ char temp[1024];
+
+ switch (v.type) {
+ case XftTypeVoid:
+ return True;
+ case XftTypeInteger:
+ sprintf (temp, "%d", v.u.i);
+ return _XftNameUnparseString (temp, 0, destp, lenp);
+ case XftTypeDouble:
+ sprintf (temp, "%g", v.u.d);
+ return _XftNameUnparseString (temp, 0, destp, lenp);
+ case XftTypeString:
+ return _XftNameUnparseString (v.u.s, escape, destp, lenp);
+ case XftTypeBool:
+ return _XftNameUnparseString (v.u.b ? "True" : "False", 0, destp, lenp);
+ }
+ return False;
+}
+
+static Bool
+_XftNameUnparseValueList (XftValueList *v, char *escape, char **destp, int *lenp)
+{
+ while (v)
+ {
+ if (!_XftNameUnparseValue (v->value, escape, destp, lenp))
+ return False;
+ if ((v = v->next))
+ if (!_XftNameUnparseString (",", 0, destp, lenp))
+ return False;
+ }
+ return True;
+}
+
+#define XFT_ESCAPE_FIXED "\\-:,"
+#define XFT_ESCAPE_VARIABLE "\\=_:,"
+
+Bool
+XftNameUnparse (XftPattern *pat, char *dest, int len)
+{
+ int i;
+ XftPatternElt *e;
+ const XftObjectType *o;
+
+ e = XftPatternFind (pat, XFT_FAMILY, False);
+ if (e)
+ {
+ if (!_XftNameUnparseValueList (e->values, XFT_ESCAPE_FIXED,
+ &dest, &len))
+ return False;
+ }
+ e = XftPatternFind (pat, XFT_SIZE, False);
+ if (e)
+ {
+ if (!_XftNameUnparseString ("-", 0, &dest, &len))
+ return False;
+ if (!_XftNameUnparseValueList (e->values, XFT_ESCAPE_FIXED, &dest, &len))
+ return False;
+ }
+ for (i = 0; i < NUM_OBJECT_TYPES; i++)
+ {
+ o = &_XftObjectTypes[i];
+ if (!strcmp (o->object, XFT_FAMILY) ||
+ !strcmp (o->object, XFT_SIZE) ||
+ !strcmp (o->object, XFT_FILE))
+ continue;
+
+ e = XftPatternFind (pat, o->object, False);
+ if (e)
+ {
+ if (!_XftNameUnparseString (":", 0, &dest, &len))
+ return False;
+ if (!_XftNameUnparseString (o->object, XFT_ESCAPE_VARIABLE,
+ &dest, &len))
+ return False;
+ if (!_XftNameUnparseString ("=", 0, &dest, &len))
+ return False;
+ if (!_XftNameUnparseValueList (e->values, XFT_ESCAPE_VARIABLE,
+ &dest, &len))
+ return False;
+ }
+ }
+ if (len == 0)
+ return False;
+ *dest = '\0';
+ return True;
+}
diff --git a/xc/lib/Xft/xftrender.c b/xc/lib/Xft/xftrender.c
index 87b051eb1..d9233c57e 100644
--- a/xc/lib/Xft/xftrender.c
+++ b/xc/lib/Xft/xftrender.c
@@ -1,5 +1,5 @@
/*
- * $XFree86: xc/lib/Xft/xftrender.c,v 1.5 2000/12/08 07:51:28 keithp Exp $
+ * $XFree86: xc/lib/Xft/xftrender.c,v 1.6 2000/12/20 00:28:45 keithp Exp $
*
* Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
*
@@ -22,6 +22,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
+#include <stdlib.h>
#include "xftint.h"
void
@@ -97,6 +98,93 @@ XftRenderString32 (Display *dpy, Picture src,
}
void
+XftRenderStringUtf8 (Display *dpy, Picture src,
+ XftFontStruct *font, Picture dst,
+ int srcx, int srcy,
+ int x, int y,
+ XftChar8 *string, int len)
+{
+ XftChar8 *s;
+ XftChar32 c;
+ XftChar32 lbuf[4096];
+ XftChar32 *d;
+ XftChar8 *dst8;
+ XftChar16 *dst16;
+ XftChar32 *dst32;
+ int rlen, clen;
+ int width = 1;
+ int n;
+
+ /* compute needed width */
+ if (!XftUtf8Len (string, len, &n, &width))
+ return;
+
+ d = lbuf;
+ if (n * width > sizeof (lbuf))
+ {
+ d = (XftChar32 *) malloc (n * width);
+ if (!d)
+ return;
+ }
+
+ switch (width) {
+ case 4:
+ s = string;
+ rlen = len;
+ dst32 = d;
+ while (rlen)
+ {
+ clen = XftUtf8ToUcs4 (s, &c, rlen);
+ if (clen <= 0) /* malformed UTF8 string */
+ return;
+ *dst32++ = c;
+ s += clen;
+ rlen -= clen;
+ }
+ dst32 = d;
+ XftRenderString32 (dpy, src, font, dst, srcx, srcy, x, y,
+ dst32, n);
+ break;
+ case 2:
+ s = string;
+ rlen = len;
+ dst16 = (XftChar16 *) d;
+ while (rlen)
+ {
+ clen = XftUtf8ToUcs4 (s, &c, rlen);
+ if (clen <= 0) /* malformed UTF8 string */
+ return;
+ *dst16++ = c;
+ s += clen;
+ rlen -= clen;
+ }
+ dst16 = (XftChar16 *) d;
+ XftRenderString16 (dpy, src, font, dst, srcx, srcy, x, y,
+ dst16, n);
+ break;
+ case 1:
+ s = string;
+ rlen = len;
+ dst8 = (XftChar8 *) d;
+ while (rlen)
+ {
+ clen = XftUtf8ToUcs4 (s, &c, rlen);
+ if (clen <= 0) /* malformed UTF8 string */
+ return;
+ *dst8++ = c;
+ s += clen;
+ rlen -= clen;
+ }
+ dst8 = (XftChar8 *) d;
+ XftRenderString8 (dpy, src, font, dst, srcx, srcy, x, y,
+ dst8, n);
+ break;
+ }
+ if (d != lbuf)
+ free (d);
+}
+
+void
XftRenderExtents8 (Display *dpy,
XftFontStruct *font,
XftChar8 *string,
@@ -290,3 +378,86 @@ XftRenderExtents32 (Display *dpy,
extents->xOff = x;
extents->yOff = y;
}
+
+void
+XftRenderExtentsUtf8 (Display *dpy,
+ XftFontStruct *font,
+ XftChar8 *string,
+ int len,
+ XGlyphInfo *extents)
+{
+ unsigned int missing[XFT_NMISSING];
+ int nmissing;
+ XftChar8 *s;
+ XftChar32 c;
+ int l, clen;
+ XGlyphInfo *gi;
+ int x, y;
+
+ s = string;
+ l = len;
+ nmissing = 0;
+ while (l)
+ {
+ clen = XftUtf8ToUcs4 (s, &c, l);
+ if (clen < 0)
+ break;
+ XftGlyphCheck (dpy, font, c, missing, &nmissing);
+ s += clen;
+ l -= clen;
+ }
+ if (nmissing)
+ XftGlyphLoad (dpy, font, missing, nmissing);
+
+ gi = 0;
+ while (len)
+ {
+ clen = XftUtf8ToUcs4 (string, &c, len);
+ if (clen < 0)
+ {
+ len = 0;
+ break;
+ }
+ len -= clen;
+ string += clen;
+ gi = c < font->nrealized ? font->realized[c] : 0;
+ if (gi)
+ break;
+ }
+ if (len == 0 && !gi)
+ {
+ extents->width = 0;
+ extents->height = 0;
+ extents->x = 0;
+ extents->y = 0;
+ extents->yOff = 0;
+ extents->xOff = 0;
+ return;
+ }
+ *extents = *gi;
+ x = gi->xOff;
+ y = gi->yOff;
+ while (len)
+ {
+ clen = XftUtf8ToUcs4 (string, &c, len);
+ if (clen < 0)
+ break;
+ len -= clen;
+ string += clen;
+ gi = c < font->nrealized ? font->realized[c] : 0;
+ if (!gi)
+ continue;
+ if (gi->x + x < extents->x)
+ extents->x = gi->x + x;
+ if (gi->y + y < extents->y)
+ extents->y = gi->y + y;
+ if (gi->width + x > extents->width)
+ extents->width = gi->width + x;
+ if (gi->height + y > extents->height)
+ extents->height = gi->height + y;
+ x += gi->xOff;
+ y += gi->yOff;
+ }
+ extents->xOff = x;
+ extents->yOff = y;
+}
diff --git a/xc/lib/Xft/xftstr.c b/xc/lib/Xft/xftstr.c
index 8d23621ec..e17c0fb40 100644
--- a/xc/lib/Xft/xftstr.c
+++ b/xc/lib/Xft/xftstr.c
@@ -1,5 +1,5 @@
/*
- * $XFree86: xc/lib/Xft/xftstr.c,v 1.2 2000/12/14 23:03:57 keithp Exp $
+ * $XFree86: xc/lib/Xft/xftstr.c,v 1.4 2000/12/20 10:24:27 keithp Exp $
*
* Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
*
@@ -150,3 +150,107 @@ _XftStrCmpIgnoreCase (const char *s1, const char *s2)
}
return (int) c2 - (int) c1;
}
+
+int
+XftUtf8ToUcs4 (XftChar8 *src_orig,
+ XftChar32 *dst,
+ int len)
+{
+ XftChar8 *src = src_orig;
+ XftChar8 s;
+ int extra;
+ XftChar32 result;
+
+ if (len == 0)
+ return 0;
+
+ s = *src++;
+ len--;
+
+ if (!(s & 0x80))
+ {
+ result = s;
+ extra = 0;
+ }
+ else if (!(s & 0x40))
+ {
+ return -1;
+ }
+ else if (!(s & 0x20))
+ {
+ result = s & 0x1f;
+ extra = 1;
+ }
+ else if (!(s & 0x10))
+ {
+ result = s & 0xf;
+ extra = 2;
+ }
+ else if (!(s & 0x08))
+ {
+ result = s & 0x07;
+ extra = 3;
+ }
+ else if (!(s & 0x04))
+ {
+ result = s & 0x03;
+ extra = 4;
+ }
+ else if ( ! (s & 0x02))
+ {
+ result = s & 0x01;
+ extra = 5;
+ }
+ else
+ {
+ return -1;
+ }
+ if (extra > len)
+ return -1;
+
+ while (extra--)
+ {
+ result <<= 6;
+ s = *src++;
+
+ if ((s & 0xc0) != 0x80)
+ return -1;
+
+ result |= s & 0x3f;
+ }
+ *dst = result;
+ return src - src_orig;
+}
+
+Bool
+XftUtf8Len (XftChar8 *string,
+ int len,
+ int *nchar,
+ int *wchar)
+{
+ int n;
+ int clen;
+ int width = 1;
+ XftChar32 c;
+
+ n = 0;
+ while (len)
+ {
+ clen = XftUtf8ToUcs4 (string, &c, len);
+ if (clen <= 0) /* malformed UTF8 string */
+ return False;
+ if (c >= 0x10000)
+ width = 4;
+ else if (c >= 0x100)
+ {
+ if (width == 1)
+ width = 2;
+ }
+ string += clen;
+ len -= clen;
+ n++;
+ }
+ *nchar = n;
+ *wchar = width;
+ return True;
+}
diff --git a/xc/lib/Xft/xftxlfd.c b/xc/lib/Xft/xftxlfd.c
index 23c2d74bf..cd7b7b7fb 100644
--- a/xc/lib/Xft/xftxlfd.c
+++ b/xc/lib/Xft/xftxlfd.c
@@ -1,5 +1,5 @@
/*
- * $XFree86: xc/lib/Xft/xftxlfd.c,v 1.5 2000/12/14 23:03:57 keithp Exp $
+ * $XFree86: xc/lib/Xft/xftxlfd.c,v 1.7 2000/12/22 05:05:16 tsi Exp $
*
* Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
*
@@ -208,9 +208,21 @@ XftCoreAddFonts (XftFontSet *set, Display *dpy, Bool ignore_scalable)
return ret;
}
-XFontStruct *
+typedef struct _XftCoreFont {
+ struct _XftCoreFont *next;
+ int ref;
+
+ XFontStruct *font;
+ Display *display;
+ char *xlfd;
+} XftCoreFont;
+
+static XftCoreFont *_XftCoreFonts;
+
+XFontStruct*
XftCoreOpen (Display *dpy, XftPattern *pattern)
{
+ XftCoreFont *cf;
char *xlfd;
char *xlfd_pixel = 0;
char *i, *o;
@@ -258,9 +270,66 @@ XftCoreOpen (Display *dpy, XftPattern *pattern)
xlfd = xlfd_pixel;
}
}
- ret = XLoadQueryFont (dpy, xlfd);
+ for (cf = _XftCoreFonts; cf; cf = cf->next)
+ {
+ if (cf->display == dpy &&
+ !_XftStrCmpIgnoreCase (cf->xlfd, xlfd))
+ {
+ cf->ref++;
+ if (_XftFontDebug () & XFT_DBG_REF)
+ {
+ printf ("Xlfd \"%s\" matches existing font (%d)\n",
+ xlfd, cf->ref);
+ }
+ break;
+ }
+ }
+ if (!cf)
+ {
+ ret = XLoadQueryFont (dpy, xlfd);
+ if (!ret)
+ return 0;
+
+ cf = (XftCoreFont *) malloc (sizeof (XftCoreFont) +
+ strlen (xlfd) + 1);
+ if (!cf)
+ {
+ XFreeFont (dpy, ret);
+ return 0;
+ }
+
+ if (_XftFontDebug () & XFT_DBG_REF)
+ printf ("Xlfd \"%s\" matches new font\n", xlfd);
+
+ cf->next = _XftCoreFonts;
+ _XftCoreFonts = cf;
+ cf->ref = 1;
+
+ cf->font = ret;
+ cf->xlfd = (char *) (cf + 1);
+ strcpy (cf->xlfd, xlfd);
+ }
if (xlfd_pixel)
free (xlfd_pixel);
- return ret;
+ return cf->font;
}
+void
+XftCoreClose (Display *dpy, XFontStruct *font)
+{
+ XftCoreFont *cf, **prev;
+
+ for (prev = &_XftCoreFonts; (cf = *prev); prev = &cf->next)
+ {
+ if (cf->display == dpy && cf->font == font)
+ {
+ if (--cf->ref == 0)
+ {
+ XFreeFont (dpy, cf->font);
+ *prev = cf->next;
+ free (cf);
+ }
+ break;
+ }
+ }
+}
diff --git a/xc/nls/Compose/th_TH.TACTIS b/xc/nls/Compose/th_TH.TACTIS
deleted file mode 100644
index 6cde8283f..000000000
--- a/xc/nls/Compose/th_TH.TACTIS
+++ /dev/null
@@ -1,15 +0,0 @@
-#
-# th_TH.TACTIS Compose Sequence
-#
-# Sequence Definition
-#
-# $XFree86: xc/nls/Compose/th_TH.TACTIS,v 1.1 1999/08/28 09:00:39 dawes Exp $
-#
-# This file currently has no entries. It appears that a compose file (even
-# just an empty one) is required for the appropriate keysyms to work for
-# this encoding.
-#
-# <Multi_key> Means <Compose>
-# Special Character
-
-# End of Sequence Definition
diff --git a/xc/nls/XLC_LOCALE/th_TH.TACTIS b/xc/nls/XLC_LOCALE/th_TH.TACTIS
deleted file mode 100644
index 6b343f64f..000000000
--- a/xc/nls/XLC_LOCALE/th_TH.TACTIS
+++ /dev/null
@@ -1,66 +0,0 @@
-XCOMM $XConsortium: th_TH.TACTIS /main/7 1996/09/28 16:52:32 rws $
-XCOMM XLocale Database Sample for th_TH.TACTIS
-XCOMM
-XCOMM $XFree86: xc/nls/XLC_LOCALE/th_TH.TACTIS,v 1.2 1999/06/06 14:06:02 dawes Exp $
-XCOMM
-
-XCOMM
-XCOMM XLC_FONTSET category
-XCOMM
-XLC_FONTSET
-XCOMM fs0 class (7 bit ASCII)
-fs0 {
- charset ISO8859-1:GL
- font ISO8859-1:GL
-}
-XCOMM fs1 class (Thai)
-fs1 {
- charset TIS620.2533-1:GR
- font TIS620.2533-1:GR
-}
-END XLC_FONTSET
-
-XCOMM
-XCOMM XLC_XLOCALE category
-XCOMM
-XLC_XLOCALE
-
-encoding_name TACTIS
-mb_cur_max 1
-state_depend_encoding False
-
-#if WCHAR32
-wc_encoding_mask \x30000000
-wc_shift_bits 7
-#else
-wc_encoding_mask \x00008080
-wc_shift_bits 8
-#endif
-
-#ifndef X_LOCALE
-use_stdc_env True
-force_convert_to_mb True
-#endif
-
-XCOMM cs0 class
-cs0 {
- side GL:Default
- length 1
- wc_encoding \x00000000
- ct_encoding ISO8859-1:GL
-}
-
-
-XCOMM cs1 class
-cs1 {
- side GR:Default
- length 1
-#if WCHAR32
- wc_encoding \x30000000
-#else
- wc_encoding \x00008080
-#endif
- ct_encoding TIS620.2533-1:GR
-}
-
-END XLC_XLOCALE
diff --git a/xc/programs/Imakefile b/xc/programs/Imakefile
index 32a0d35df..ffa6039b7 100644
--- a/xc/programs/Imakefile
+++ b/xc/programs/Imakefile
@@ -1,13 +1,16 @@
-XCOMM $TOG: Imakefile /main/85 1998/02/26 17:14:44 kaleb $
-XCOMM
-XCOMM
-XCOMM
-XCOMM $XFree86: xc/programs/Imakefile,v 3.31 2000/09/22 11:35:41 alanh Exp $
+XCOMM $Xorg: Imakefile,v 1.4 2000/08/17 19:47:01 cpqbld Exp $
+
+
+
+XCOMM $XFree86: xc/programs/Imakefile,v 3.37 2001/02/13 19:19:12 dawes Exp $
+
#define IHaveSubdirs
#define PassCDebugFlags CDEBUGFLAGS="$(CDEBUGFLAGS)"
-#if BuildServer
+#if BuildServer || UseRgbTxt
RGBSRCDIR = rgb
+#endif
+#if BuildServer
XSSRCDIR = Xserver
#endif
#ifndef Win32Architecture
@@ -18,7 +21,7 @@ XCOMM $XFree86: xc/programs/Imakefile,v 3.31 2000/09/22 11:35:41 alanh Exp $
XFSSRCDIR = xfs
#endif
#if BuildXKBlib
- XKBSRCDIRS = xkbcomp xkbevd xkbprint xkbutils
+ XKBSRCDIRS = setxkbmap xkbcomp xkbevd xkbprint xkbutils
#endif
#if BuildScreenSaverExt
SCREENSAVESRCDIR = beforelight
@@ -66,21 +69,28 @@ XFINDPROXYSRCDIR = xfindproxy
#endif
XPMCLIENTDIRS = cxpm sxpm
+#ifdef Freetype2Dir
+ XFTCACHEDIR = xftcache
+#endif
+
+#if BuildGLXLibrary
+ GLXINFODIR = glxinfo
+#endif
#if BuildServersOnly
SUBDIRS = $(XSSRCDIR)
#else
SUBDIRS = \
appres bdftopcf bitmap \
- $(SCREENSAVESRCDIR) editres fsinfo fslsfonts fstobdf iceauth \
+ $(SCREENSAVESRCDIR) editres fslsfonts fstobdf iceauth \
ico listres \
$(MAKEPSRESDIR) $(MKCFMSRCDIR) \
mkfontdir oclock $(PROXYMGRSRCDIR) $(RGBSRCDIR) $(RSTARTSRCDIR) \
- setxkbmap showfont \
+ showfont \
$(SMPROXYSRCDIR) $(TWMSRCDIR) viewres x11perf xauth xbiff xcalc \
xclipboard xclock \
xcmsdb $(XCONSOLESRCDIR) xditview $(XDMSRCDIR) xdpyinfo \
- $(XF86DGASRCDIR) xedit xev xeyes xfd xfontsel $(XFSSRCDIR) \
+ $(XF86DGASRCDIR) xedit xev xeyes xfd xfontsel $(XFSSRCDIR) xfsinfo \
$(XFINDPROXYSRCDIR) $(XFWPSRCDIR) $(XGAMMASRCDIR) xgc $(XHOSTSRCDIR) \
xieperf $(XINITSRCDIR) $(XKBSRCDIRS) xkill xload xlogo xlsatoms \
xlsclients xlsfonts xmag xman xmessage xmodmap xprop xrdb \
@@ -89,7 +99,7 @@ SUBDIRS = \
$(XTERMSRCDIR) $(XVIDTUNESRCDIR) xwd xwininfo xwud \
$(XPMCLIENTDIRS) $(XVINFOSRCDIR) \
$(XSSRCDIR) $(XASSRCDIR) $(LBXPROXYSRCDIR) $(SCRIPTSDIR) \
- glxinfo
+ $(GLXINFODIR) $(XFTCACHEDIR)
#endif
MakeSubdirs($(SUBDIRS))
diff --git a/xc/programs/Xserver/GL/dri/dri.c b/xc/programs/Xserver/GL/dri/dri.c
index 7ad699bc7..ceacfb3ee 100644
--- a/xc/programs/Xserver/GL/dri/dri.c
+++ b/xc/programs/Xserver/GL/dri/dri.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/GL/dri/dri.c,v 1.24 2000/12/07 20:26:13 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/GL/dri/dri.c,v 1.29 2000/12/22 02:40:00 mvojkovi Exp $ */
/**************************************************************************
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
@@ -358,24 +358,18 @@ DRIFinishScreenInit(ScreenPtr pScreen)
pDRIPriv->wrap.PostValidateTree = pScreen->PostValidateTree;
pScreen->PostValidateTree = pDRIInfo->wrap.PostValidateTree;
}
-
- /* Potentential optimization: don't wrap the following routines if
- pDRIInfo->bufferRequests == DRI_NO_WINDOWS */
- if (pDRIInfo->wrap.PaintWindowBackground) {
- pDRIPriv->wrap.PaintWindowBackground = pScreen->PaintWindowBackground;
- pScreen->PaintWindowBackground = pDRIInfo->wrap.PaintWindowBackground;
- }
- if (pDRIInfo->wrap.PaintWindowBorder) {
- pDRIPriv->wrap.PaintWindowBorder = pScreen->PaintWindowBorder;
- pScreen->PaintWindowBorder = pDRIInfo->wrap.PaintWindowBorder;
+ if (pDRIInfo->wrap.WindowExposures) {
+ pDRIPriv->wrap.WindowExposures = pScreen->WindowExposures;
+ pScreen->WindowExposures = pDRIInfo->wrap.WindowExposures;
}
if (pDRIInfo->wrap.CopyWindow) {
pDRIPriv->wrap.CopyWindow = pScreen->CopyWindow;
pScreen->CopyWindow = pDRIInfo->wrap.CopyWindow;
}
- if (pDRIInfo->wrap.ClipNotify)
- miClipNotify(pDRIInfo->wrap.ClipNotify);
-
+ if (pDRIInfo->wrap.ClipNotify) {
+ pDRIPriv->wrap.ClipNotify = pScreen->ClipNotify;
+ pScreen->ClipNotify = pDRIInfo->wrap.ClipNotify;
+ }
if (pDRIInfo->wrap.AdjustFrame) {
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
pDRIPriv->wrap.AdjustFrame = pScrn->AdjustFrame;
@@ -1172,8 +1166,7 @@ DRICreateInfoRec(void)
/* Wrapped function defaults */
inforec->wrap.WakeupHandler = DRIDoWakeupHandler;
inforec->wrap.BlockHandler = DRIDoBlockHandler;
- inforec->wrap.PaintWindowBackground = DRIPaintWindow;
- inforec->wrap.PaintWindowBorder = DRIPaintWindow;
+ inforec->wrap.WindowExposures = DRIWindowExposures;
inforec->wrap.CopyWindow = DRICopyWindow;
inforec->wrap.ValidateTree = DRIValidateTree;
inforec->wrap.PostValidateTree = DRIPostValidateTree;
@@ -1456,30 +1449,23 @@ DRIPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
/* unwrap */
pScreen->PaintWindowBackground = pDRIPriv->wrap.PaintWindowBackground;
- /* call lower layers */
- (*pScreen->PaintWindowBackground)(pWin, prgn, what);
- /* rewrap */
- pDRIPriv->wrap.PaintWindowBackground = pScreen->PaintWindowBackground;
- pScreen->PaintWindowBackground = DRIPaintWindow;
- }
- else {
- if (pDRIPriv->pDriverInfo->bufferRequests == DRI_ALL_WINDOWS) {
- /* call DDX driver's DRI specific InitBuffer */
- (*pDRIPriv->pDriverInfo->InitBuffers)(pWin, prgn,
- pDRIPriv->pDriverInfo->ddxDrawableTableEntry);
- }
+static int
+DRITreeTraversal(WindowPtr pWin, pointer data)
+{
+ DRIDrawablePrivPtr pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin);
- /* unwrap */
- pScreen->PaintWindowBorder = pDRIPriv->wrap.PaintWindowBorder;
+ if(pDRIDrawablePriv) {
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ RegionPtr reg = (RegionPtr)data;
- /* call lower layers */
- (*pScreen->PaintWindowBorder)(pWin, prgn, what);
+ REGION_UNION(pScreen, reg, reg, &(pWin->clipList));
- /* rewrap */
- pDRIPriv->wrap.PaintWindowBorder = pScreen->PaintWindowBorder;
- pScreen->PaintWindowBorder = DRIPaintWindow;
+ if(pDRIPriv->nrWindows == 1)
+ return WT_STOPWALKING;
}
+ return WT_WALKCHILDREN;
}
void
@@ -1487,26 +1473,24 @@ DRICopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
{
ScreenPtr pScreen = pWin->drawable.pScreen;
DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
- DRIDrawablePrivPtr pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin);
- /* HACK until we have newly transitioned 3D->2D windows repainted */
- if ((pDRIPriv->pDriverInfo->bufferRequests == DRI_3D_WINDOWS_ONLY) &&
- (pDRIDrawablePriv)) {
+ if(pDRIPriv->nrWindows > 0) {
+ RegionRec reg;
- (*pDRIPriv->pDriverInfo->MoveBuffers)(pWin, ptOldOrg, prgnSrc,
- pDRIDrawablePriv->drawableIndex);
- }
- else if (pDRIPriv->pDriverInfo->bufferRequests == DRI_ALL_WINDOWS) {
- if (pDRIDrawablePriv) {
+ REGION_INIT(pScreen, &reg, NullBox, 0);
+ TraverseTree(pWin, DRITreeTraversal, (pointer)(&reg));
- (*pDRIPriv->pDriverInfo->MoveBuffers)(pWin, ptOldOrg, prgnSrc,
- pDRIDrawablePriv->drawableIndex);
- }
- else {
- /* call DDX driver's DRI specific InitBuffer */
- (*pDRIPriv->pDriverInfo->MoveBuffers)(pWin, ptOldOrg, prgnSrc,
+ if(REGION_NOTEMPTY(pScreen, &reg)) {
+ REGION_TRANSLATE(pScreen, &reg, ptOldOrg.x - pWin->drawable.x,
+ ptOldOrg.y - pWin->drawable.y);
+ REGION_INTERSECT(pScreen, &reg, &reg, prgnSrc);
+
+ /* The MoveBuffers interface is not ideal */
+ (*pDRIPriv->pDriverInfo->MoveBuffers)(pWin, ptOldOrg, &reg,
pDRIPriv->pDriverInfo->ddxDrawableTableEntry);
- }
+ }
+
+ REGION_UNINIT(pScreen, &reg);
}
/* unwrap */
@@ -1580,10 +1564,9 @@ DRISpinLockTimeout(drmLock *lock, int val, unsigned long timeout /* in mS */)
DRM_SPINLOCK_TAKE(lock, val);
}
-int
-DRIValidateTree(WindowPtr pParent, WindowPtr pChild, VTKind kind)
+static void
+DRILockTree(ScreenPtr pScreen)
{
- ScreenPtr pScreen = pParent->drawable.pScreen;
DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
int returnValue;
@@ -1621,6 +1604,30 @@ DRIValidateTree(WindowPtr pParent, WindowPtr pChild, VTKind kind)
DRI_2D_CONTEXT,
pDRIPriv->hiddenContextStore);
}
+}
+
+/* It appears that somebody is relying on the lock being set even
+ if we aren't touching 3D windows */
+
+#define DRI_BROKEN
+
+static Bool DRIWindowsTouched = FALSE;
+
+int
+DRIValidateTree(WindowPtr pParent, WindowPtr pChild, VTKind kind)
+{
+ ScreenPtr pScreen = pParent->drawable.pScreen;
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ int returnValue;
+
+ DRIWindowsTouched = FALSE;
+
+#ifdef DRI_BROKEN
+ if(!DRIWindowsTouched) {
+ DRILockTree(pScreen);
+ DRIWindowsTouched = TRUE;
+ }
+#endif
/* unwrap */
pScreen->ValidateTree = pDRIPriv->wrap.ValidateTree;
@@ -1660,23 +1667,41 @@ DRIPostValidateTree(WindowPtr pParent, WindowPtr pChild, VTKind kind)
pScreen->PostValidateTree = DRIPostValidateTree;
}
- if (pParent) {
+ if (DRIWindowsTouched) {
/* Release spin lock */
DRM_SPINUNLOCK(&pDRIPriv->pSAREA->drawable_lock, 1);
+ DRIWindowsTouched = FALSE;
}
}
void
DRIClipNotify(WindowPtr pWin, int dx, int dy)
{
- DRIScreenPrivPtr pDRIPriv;
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
DRIDrawablePrivPtr pDRIDrawablePriv;
if ((pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin))) {
- pDRIPriv = DRI_SCREEN_PRIV(pWin->drawable.pScreen);
+
+#ifndef DRI_BROKEN
+ if(!DRIWindowsTouched) {
+ DRILockTree(pScreen);
+ DRIWindowsTouched = TRUE;
+ }
+#endif
+
pDRIPriv->pSAREA->drawableTable[pDRIDrawablePriv->drawableIndex].stamp
= DRIDrawableValidationStamp++;
}
+
+ if(pDRIPriv->wrap.ClipNotify) {
+ pScreen->ClipNotify = pDRIPriv->wrap.ClipNotify;
+
+ (*pScreen->ClipNotify)(pWin, dx, dy);
+
+ pDRIPriv->wrap.ClipNotify = pScreen->ClipNotify;
+ pScreen->ClipNotify = DRIClipNotify;
+ }
}
CARD32
@@ -1918,3 +1943,78 @@ DRICloseFullScreen(ScreenPtr pScreen, DrawablePtr pDrawable)
FreeResourceByType(pDrawable->id, DRIFullScreenResType, FALSE);
return TRUE;
}
+
+
+/*
+ * DRIMoveBuffersHelper swaps the regions rects in place leaving you
+ * a region with the rects in the order that you need to blit them,
+ * but it is possibly (likely) an invalid region afterwards. If you
+ * need to use the region again for anything you have to call
+ * REGION_VALIDATE on it, or better yet, save a copy first.
+ */
+
+void
+DRIMoveBuffersHelper(
+ ScreenPtr pScreen,
+ int dx,
+ int dy,
+ int *xdir,
+ int *ydir,
+ RegionPtr reg
+)
+{
+ BoxPtr extents, pbox, firstBox, lastBox;
+ BoxRec tmpBox;
+ int y, nbox;
+
+ extents = REGION_EXTENTS(pScreen, reg);
+ nbox = REGION_NUM_RECTS(reg);
+ pbox = REGION_RECTS(reg);
+
+ if((dy > 0) && (dy < (extents->y2 - extents->y1))) {
+ *ydir = -1;
+ if(nbox > 1) {
+ firstBox = pbox;
+ lastBox = pbox + nbox - 1;
+ while((unsigned long)firstBox < (unsigned long)lastBox) {
+ tmpBox = *firstBox;
+ *firstBox = *lastBox;
+ *lastBox = tmpBox;
+ firstBox++;
+ lastBox--;
+ }
+ }
+ } else *ydir = 1;
+
+ if((dx > 0) && (dx < (extents->x2 - extents->x1))) {
+ *xdir = -1;
+ if(nbox > 1) {
+ firstBox = lastBox = pbox;
+ y = pbox->y1;
+ while(--nbox) {
+ pbox++;
+ if(pbox->y1 == y) lastBox++;
+ else {
+ while((unsigned long)firstBox < (unsigned long)lastBox) {
+ tmpBox = *firstBox;
+ *firstBox = *lastBox;
+ *lastBox = tmpBox;
+ firstBox++;
+ lastBox--;
+ }
+
+ firstBox = lastBox = pbox;
+ y = pbox->y1;
+ }
+ }
+ while((unsigned long)firstBox < (unsigned long)lastBox) {
+ tmpBox = *firstBox;
+ *firstBox = *lastBox;
+ *lastBox = tmpBox;
+ firstBox++;
+ lastBox--;
+ }
+ }
+ } else *xdir = 1;
+
+}
diff --git a/xc/programs/Xserver/GL/dri/dri.h b/xc/programs/Xserver/GL/dri/dri.h
index bb0f811aa..e53724386 100644
--- a/xc/programs/Xserver/GL/dri/dri.h
+++ b/xc/programs/Xserver/GL/dri/dri.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/GL/dri/dri.h,v 1.15 2000/12/07 20:26:14 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/GL/dri/dri.h,v 1.17 2000/12/20 19:48:44 mvojkovi Exp $ */
/**************************************************************************
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
@@ -85,12 +85,11 @@ typedef void (*AdjustFramePtr)(int scrnIndex, int x, int y, int flags);
typedef struct {
ScreenWakeupHandlerProcPtr WakeupHandler;
ScreenBlockHandlerProcPtr BlockHandler;
- PaintWindowBackgroundProcPtr PaintWindowBackground;
- PaintWindowBorderProcPtr PaintWindowBorder;
+ WindowExposuresProcPtr WindowExposures;
CopyWindowProcPtr CopyWindow;
ValidateTreeProcPtr ValidateTree;
PostValidateTreeProcPtr PostValidateTree;
- ClipNotifyPtr ClipNotify;
+ ClipNotifyProcPtr ClipNotify;
AdjustFramePtr AdjustFrame;
} DRIWrappedFuncsRec, *DRIWrappedFuncsPtr;
@@ -253,9 +252,9 @@ extern void DRISwapContext(int drmFD,
extern void *DRIGetContextStore(DRIContextPrivPtr context);
-extern void DRIPaintWindow(WindowPtr pWin,
- RegionPtr prgn,
- int what);
+extern void DRIWindowExposures(WindowPtr pWin,
+ RegionPtr prgn,
+ RegionPtr bsreg);
extern void DRICopyWindow(WindowPtr pWin,
DDXPointRec ptOldOrg,
@@ -309,6 +308,13 @@ extern void DRIAdjustFrame(int scrnIndex, int x, int y, int flags);
extern int DRIOpenFullScreen(ScreenPtr pScreen, DrawablePtr pDrawable);
extern int DRICloseFullScreen(ScreenPtr pScreen, DrawablePtr pDrawable);
+extern void DRIMoveBuffersHelper(ScreenPtr pScreen,
+ int dx,
+ int dy,
+ int *xdir,
+ int *ydir,
+ RegionPtr reg);
+
#define _DRI_H_
#endif
diff --git a/xc/programs/Xserver/GL/glx/glxext.c b/xc/programs/Xserver/GL/glx/glxext.c
index b46c8c4d0..6910603b8 100644
--- a/xc/programs/Xserver/GL/glx/glxext.c
+++ b/xc/programs/Xserver/GL/glx/glxext.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/GL/glx/glxext.c,v 1.5 2000/09/26 15:57:02 tsi Exp $
+/* $XFree86: xc/programs/Xserver/GL/glx/glxext.c,v 1.6 2001/02/16 13:24:05 eich 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
** License. You may obtain a copy of the License at Silicon Graphics, Inc.,
@@ -16,8 +16,8 @@
** Those portions of the Subject Software created by Silicon Graphics, Inc.
** are Copyright (c) 1991-9 Silicon Graphics, Inc. All Rights Reserved.
**
-** $Date: 2001/01/08 16:21:41 $ $Revision: 1.2 $
-** $Header: /home/ajax/dri-backup/xc/xc/programs/Xserver/GL/glx/glxext.c,v 1.2 2001/01/08 16:21:41 nathanh Exp $
+** $Date: 2001/03/19 21:39:05 $ $Revision: 1.3 $
+** $Header: /home/ajax/dri-backup/xc/xc/programs/Xserver/GL/glx/glxext.c,v 1.3 2001/03/19 21:39:05 dawes Exp $
*/
#define NEED_REPLIES
@@ -49,6 +49,7 @@ static void ResetExtension(ExtensionEntry* extEntry)
{
__glXFlushContextCache();
(*__glXExt->resetExtension)();
+ __glXScreenReset();
}
/*
diff --git a/xc/programs/Xserver/GL/glx/glxscreens.c b/xc/programs/Xserver/GL/glx/glxscreens.c
index 25d8ce478..7d88565b2 100644
--- a/xc/programs/Xserver/GL/glx/glxscreens.c
+++ b/xc/programs/Xserver/GL/glx/glxscreens.c
@@ -1,3 +1,4 @@
+/* $XFree86: xc/programs/Xserver/GL/glx/glxscreens.c,v 1.5 2001/02/16 13:24:05 eich Exp $ */
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
@@ -31,8 +32,8 @@
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
-** $Date: 2001/01/08 16:21:41 $ $Revision: 1.4 $
-** $Header: /home/ajax/dri-backup/xc/xc/programs/Xserver/GL/glx/glxscreens.c,v 1.4 2001/01/08 16:21:41 nathanh Exp $
+** $Date: 2001/03/19 21:39:05 $ $Revision: 1.5 $
+** $Header: /home/ajax/dri-backup/xc/xc/programs/Xserver/GL/glx/glxscreens.c,v 1.5 2001/03/19 21:39:05 dawes Exp $
*/
#ifdef IN_MODULE
@@ -300,3 +301,17 @@ void __glXScreenInit(GLint numscreens)
}
__glXNumActiveScreens = numscreens;
}
+
+void __glXScreenReset(void)
+{
+ int i;
+
+ for (i = 0; i < __glXNumActiveScreens; i++) {
+ __glXFree(__glXActiveScreens[i].GLXvendor);
+ __glXFree(__glXActiveScreens[i].GLXversion);
+ __glXFree(__glXActiveScreens[i].GLXextensions);
+ }
+ xfree(__glXActiveScreens);
+ __glXActiveScreens = NULL;
+ __glXNumActiveScreens = 0;
+}
diff --git a/xc/programs/Xserver/GL/glx/glxscreens.h b/xc/programs/Xserver/GL/glx/glxscreens.h
index 624bbd98a..ea3183b73 100644
--- a/xc/programs/Xserver/GL/glx/glxscreens.h
+++ b/xc/programs/Xserver/GL/glx/glxscreens.h
@@ -1,6 +1,7 @@
#ifndef _GLX_screens_h_
#define _GLX_screens_h_
+/* $XFree86: xc/programs/Xserver/GL/glx/glxscreens.h,v 1.3 2001/02/16 13:24:05 eich Exp $ */
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
@@ -34,8 +35,8 @@
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
-** $Date: 2001/01/08 16:21:41 $ $Revision: 1.2 $
-** $Header: /home/ajax/dri-backup/xc/xc/programs/Xserver/GL/glx/glxscreens.h,v 1.2 2001/01/08 16:21:41 nathanh Exp $
+** $Date: 2001/03/19 21:39:05 $ $Revision: 1.3 $
+** $Header: /home/ajax/dri-backup/xc/xc/programs/Xserver/GL/glx/glxscreens.h,v 1.3 2001/03/19 21:39:05 dawes Exp $
*/
#include "GL/internal/glcore.h"
@@ -90,5 +91,6 @@ typedef struct {
extern void __glXScreenInit(GLint);
+extern void __glXScreenReset(void);
#endif /* !__GLX_screens_h__ */
diff --git a/xc/programs/Xserver/GL/mesa/src/X/xf86glx.c b/xc/programs/Xserver/GL/mesa/src/X/xf86glx.c
index 00e151147..b7ff0f97d 100644
--- a/xc/programs/Xserver/GL/mesa/src/X/xf86glx.c
+++ b/xc/programs/Xserver/GL/mesa/src/X/xf86glx.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/GL/mesa/src/X/xf86glx.c,v 1.9 2000/06/17 00:03:13 martin Exp $ */
+/* $XFree86: xc/programs/Xserver/GL/mesa/src/X/xf86glx.c,v 1.10 2001/02/16 13:24:06 eich Exp $ */
/**************************************************************************
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
@@ -580,13 +580,16 @@ extern void __MESA_resetExtension(void)
for (i = 0; i < screenInfo.numScreens; i++) {
for (j = 0; j < MESAScreens[i].num_vis; j++) {
- if (MESAScreens[i].xm_vis[j])
+ if (MESAScreens[i].xm_vis[j]) {
XMesaDestroyVisual(MESAScreens[i].xm_vis[j]);
+ MESAScreens[i].xm_vis[j] = NULL;
+ }
}
__glXFree(MESAScreens[i].glx_vis);
MESAScreens[i].glx_vis = NULL;
MESAScreens[i].num_vis = 0;
}
+ __glDDXScreenInfo.pGlxVisual = NULL;
MESA_CC = NULL;
}
diff --git a/xc/programs/Xserver/Imakefile b/xc/programs/Xserver/Imakefile
index ecf3dbdb1..2344ff5af 100644
--- a/xc/programs/Xserver/Imakefile
+++ b/xc/programs/Xserver/Imakefile
@@ -1,8 +1,8 @@
-XCOMM $TOG: Imakefile /main/249 1997/12/11 11:18:14 kaleb $
+XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:47:01 cpqbld Exp $
/*
* Server Master Makefile
*/
-XCOMM $XFree86: xc/programs/Xserver/Imakefile,v 3.205 2000/12/11 20:29:31 dawes Exp $
+XCOMM $XFree86: xc/programs/Xserver/Imakefile,v 3.211 2001/02/16 13:24:05 eich Exp $
#ifndef InstallXserverSetUID
#define InstallXserverSetUID NO
@@ -635,6 +635,9 @@ XF86INT10LIB = $(XF86OSSRC)/LibraryTargetName(int10)
#else
XF86INT10LIB = $(XF86SRC)/int10/LibraryTargetName(int10)
#endif
+#if UseMemLeak
+MEMDEBUGLIB = $(TOP)/util/memleak/LibraryTargetName(memleak)
+#endif
XF86IDRIVERLIB = $(XF86SRC)/input/LibraryTargetName(idriver)
#if !DoLoadableServer
XF86DRVOBJS = $(XF86SRC)/drivers/drvConf.o
@@ -646,10 +649,10 @@ XF86DRVLIBS = $(XF86DRIVERLIB) $(XF86RAMDACLIB) $(XF86DDCLIB) $(XF86I2CLIB) \
XF86IDRVOBJS = $(XF86SRC)/input/drvConf.o
XF86IDRVLIBS = $(XF86IDRIVERLIB)
XF86SCANLIB = $(XF86SRC)/scanpci/LibraryTargetName(scanpci)
-XF86LIBS = $(XF86INIT) $(XF86COMLIB) $(XF86RACLIB) $(XF86PARSLIB) \
- $(XF86OSLIB) $(XF86INT10LIB)
+XF86LIBS = $(MEMDEBUGLIB) $(XF86INIT) $(XF86COMLIB) $(XF86RACLIB) $(XF86PARSLIB) \
+ $(XF86OSLIB) $(XF86INT10LIB)
#else
-XF86LIBS = $(XF86INIT) $(XF86COMLIB) $(XF86PARSLIB) $(XF86OSLIB)
+XF86LIBS = $(MEMDEBUGLIB) $(XF86INIT) $(XF86COMLIB) $(XF86PARSLIB) $(XF86OSLIB)
#endif
#if DoLoadableServer
XF86LOADERLIB = $(XF86SRC)/loader/LibraryTargetName(loader)
@@ -1121,8 +1124,15 @@ DARWINDIRS = $(STDDIRS) $(MFBDIR) $(CFB8DIR) $(CFB16DIR) $(CFB32DIR) $(DDXDIR1)
DARWINOBJS =
DARWINLIBS = PreFbLibs hw/darwin/libdarwin.a $(CFB16) $(CFB32) $(CFB8) PostFbLibs ../../lib/font/libXfont.a ../../lib/font/stubs/libfntstubs.a
-XCOMM we need extra link flags for IOKit stuff
+XCOMM We need extra link flags for IOKit. For Quartz support, we also need
+XCOMM CoreGraphics in ApplicationServices and HIToolbox in Carbon.
+#if DarwinQuartzSupport
+EXTRA_LOAD_FLAGS = -framework IOKit -framework ApplicationServices \
+ -framework Carbon
+#else
EXTRA_LOAD_FLAGS = -framework IOKit
+#endif /* DarwinQuartzSupport */
+
SetUIDServerTarget(Xdarwin,$(DARWINDIRS),$(DARWINOBJS),$(DARWINLIBS),$(SYSLIBS))
#define ServerToInstall Xdarwin
@@ -1150,5 +1160,4 @@ LintSubdirs($(SUBDIRS))
ForceSubdirs($(DEPDIRS) $(SUBDIRS))
-CppManTarget(Xserver,)
InstallManPage(Xserver,$(MANDIR))
diff --git a/xc/programs/Xserver/Xext/panoramiX.h b/xc/programs/Xserver/Xext/panoramiX.h
index 063eda3bf..670a45364 100644
--- a/xc/programs/Xserver/Xext/panoramiX.h
+++ b/xc/programs/Xserver/Xext/panoramiX.h
@@ -19,7 +19,7 @@
* or in FAR 52.227-19, as applicable. *
* *
*****************************************************************/
-/* $XFree86: xc/programs/Xserver/Xext/panoramiX.h,v 1.4 2000/01/22 01:59:03 mvojkovi Exp $ */
+/* $XFree86: xc/programs/Xserver/Xext/panoramiX.h,v 1.5 2001/01/03 02:54:17 keithp Exp $ */
/* THIS IS NOT AN X PROJECT TEAM SPECIFICATION */
@@ -56,6 +56,11 @@ typedef struct {
struct {
Bool shared;
} pix;
+#ifdef RENDER
+ struct {
+ Bool root;
+ } pict;
+#endif
char raw_data[4];
} u;
} PanoramiXRes;
diff --git a/xc/programs/Xserver/Xext/panoramiXsrv.h b/xc/programs/Xserver/Xext/panoramiXsrv.h
index afdc4055f..44228b57e 100644
--- a/xc/programs/Xserver/Xext/panoramiXsrv.h
+++ b/xc/programs/Xserver/Xext/panoramiXsrv.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/Xext/panoramiXsrv.h,v 1.6 2000/03/30 18:20:35 mvojkovi Exp $ */
+/* $XFree86: xc/programs/Xserver/Xext/panoramiXsrv.h,v 1.7 2001/01/03 02:54:17 keithp Exp $ */
#ifndef _PANORAMIXSRV_H_
#define _PANORAMIXSRV_H_
diff --git a/xc/programs/Xserver/Xserver.cpp b/xc/programs/Xserver/Xserver.man
index d363ac131..e04f5e21c 100644
--- a/xc/programs/Xserver/Xserver.cpp
+++ b/xc/programs/Xserver/Xserver.man
@@ -1,4 +1,4 @@
-.\" $TOG: Xserver.man /main/68 1998/02/09 14:12:35 kaleb $
+.\" $Xorg: Xserver.man,v 1.3 2000/08/17 19:47:01 cpqbld Exp $
.\" Copyright 1984 - 1991, 1993, 1994, 1998 The Open Group
.\"
.\" All Rights Reserved.
@@ -18,8 +18,8 @@
.\" not be used in advertising or otherwise to promote the sale, use or
.\" other dealings in this Software without prior written authorization
.\" from The Open Group.
-.\" $XFree86: xc/programs/Xserver/Xserver.cpp,v 1.1 2000/12/11 20:29:32 dawes Exp $
-.TH XSERVER 1 "Release 6.4" "X Version 11"
+.\" $XFree86: xc/programs/Xserver/Xserver.man,v 3.15 2001/01/27 18:20:39 dawes Exp $
+.TH XSERVER 1 __xorgversion__
.SH NAME
Xserver \- X Window System display server
.SH SYNOPSIS
@@ -58,7 +58,7 @@ All of the X servers accept the following command line options:
the X server runs as the given \fIdisplaynumber\fP, which by default is 0.
If multiple X servers are to run simultaneously on a host, each must have
a unique display number. See the DISPLAY
-NAMES section of the \fIX(1)\fP manual page to learn how to specify
+NAMES section of the \fIX(__miscmansuffix__)\fP manual page to learn how to specify
which display number clients should try to use.
.TP 8
.B \-a \fInumber\fP
@@ -463,12 +463,12 @@ Here is an example security policy file.
.nf
version-1
-# Allow reading of application resources, but not writing.
+XCOMM Allow reading of application resources, but not writing.
property RESOURCE_MANAGER root ar iw
property SCREEN_RESOURCES root ar iw
-# Ignore attempts to use cut buffers. Giving errors causes apps to crash,
-# and allowing access may give away too much information.
+XCOMM Ignore attempts to use cut buffers. Giving errors causes apps to crash,
+XCOMM and allowing access may give away too much information.
property CUT_BUFFER0 root irw
property CUT_BUFFER1 root irw
property CUT_BUFFER2 root irw
@@ -478,31 +478,31 @@ property CUT_BUFFER5 root irw
property CUT_BUFFER6 root irw
property CUT_BUFFER7 root irw
-# If you are using Motif, you probably want these.
+XCOMM If you are using Motif, you probably want these.
property _MOTIF_DEFAULT_BINDINGS root ar iw
property _MOTIF_DRAG_WINDOW root ar iw
property _MOTIF_DRAG_TARGETS any ar iw
property _MOTIF_DRAG_ATOMS any ar iw
property _MOTIF_DRAG_ATOM_PAIRS any ar iw
-# The next two rules let xwininfo -tree work when untrusted.
+XCOMM The next two rules let xwininfo -tree work when untrusted.
property WM_NAME any ar
-# Allow read of WM_CLASS, but only for windows with WM_NAME.
-# This might be more restrictive than necessary, but demonstrates
-# the <required property> facility, and is also an attempt to
-# say "top level windows only."
+XCOMM Allow read of WM_CLASS, but only for windows with WM_NAME.
+XCOMM This might be more restrictive than necessary, but demonstrates
+XCOMM the <required property> facility, and is also an attempt to
+XCOMM say "top level windows only."
property WM_CLASS WM_NAME ar
-# These next three let xlsclients work untrusted. Think carefully
-# before including these; giving away the client machine name and command
-# may be exposing too much.
+XCOMM These next three let xlsclients work untrusted. Think carefully
+XCOMM before including these; giving away the client machine name and command
+XCOMM may be exposing too much.
property WM_STATE WM_NAME ar
property WM_CLIENT_MACHINE WM_NAME ar
property WM_COMMAND WM_NAME ar
-# To let untrusted clients use the standard colormaps created by
-# xstdcmap, include these lines.
+XCOMM To let untrusted clients use the standard colormaps created by
+XCOMM xstdcmap, include these lines.
property RGB_DEFAULT_MAP root ar
property RGB_BEST_MAP root ar
property RGB_RED_MAP root ar
@@ -510,24 +510,24 @@ property RGB_GREEN_MAP root ar
property RGB_BLUE_MAP root ar
property RGB_GRAY_MAP root ar
-# To let untrusted clients use the color management database created
-# by xcmsdb, include these lines.
+XCOMM To let untrusted clients use the color management database created
+XCOMM by xcmsdb, include these lines.
property XDCCC_LINEAR_RGB_CORRECTION root ar
property XDCCC_LINEAR_RGB_MATRICES root ar
property XDCCC_GRAY_SCREENWHITEPOINT root ar
property XDCCC_GRAY_CORRECTION root ar
-# To let untrusted clients use the overlay visuals that many vendors
-# support, include this line.
+XCOMM To let untrusted clients use the overlay visuals that many vendors
+XCOMM support, include this line.
property SERVER_OVERLAY_VISUALS root ar
-# Dumb examples to show other capabilities.
+XCOMM Dumb examples to show other capabilities.
-# oddball property names and explicit specification of error conditions
+XCOMM oddball property names and explicit specification of error conditions
property "property with spaces" 'property with "' aw er ed
-# Allow deletion of Woo-Hoo if window also has property OhBoy with value
-# ending in "son". Reads and writes will cause an error.
+XCOMM Allow deletion of Woo-Hoo if window also has property OhBoy with value
+XCOMM ending in "son". Reads and writes will cause an error.
property Woo-Hoo OhBoy = "*son" ad
.fi
diff --git a/xc/programs/Xserver/fb/fbpict.c b/xc/programs/Xserver/fb/fbpict.c
index 964e5a1ab..70545995d 100644
--- a/xc/programs/Xserver/fb/fbpict.c
+++ b/xc/programs/Xserver/fb/fbpict.c
@@ -1,5 +1,5 @@
/*
- * $XFree86: xc/programs/Xserver/fb/fbpict.c,v 1.5 2000/11/29 08:43:08 keithp Exp $
+ * $XFree86: xc/programs/Xserver/fb/fbpict.c,v 1.8 2001/02/09 02:12:17 keithp Exp $
*
* Copyright © 2000 SuSE, Inc.
*
@@ -24,6 +24,9 @@
*/
#include "fb.h"
+
+#ifdef RENDER
+
#include "picturestr.h"
#include "mipict.h"
#include "fbpict.h"
@@ -70,6 +73,19 @@ fbOver (CARD32 x, CARD32 y)
}
CARD32
+fbOver24 (CARD32 x, CARD32 y)
+{
+ CARD16 a = ~x >> 24;
+ CARD16 t;
+ CARD32 m,n,o;
+
+ m = FbOverU(x,y,0,a,t);
+ n = FbOverU(x,y,8,a,t);
+ o = FbOverU(x,y,16,a,t);
+ return m|n|o;
+}
+
+CARD32
fbIn (CARD32 x, CARD8 y)
{
CARD16 a = y;
@@ -123,13 +139,15 @@ fbCompositeSolidMask_nx8x8888 (CARD8 op,
src = *(CARD16 *) srcBits;
src = cvt0565to8888(src);
break;
+ default:
+ return;
}
/* manage missing src alpha */
if (pSrc->pFormat->direct.alphaMask == 0)
src |= 0xff000000;
dstMask = FbFullMask (pDst->pDrawable->depth);
srca = src >> 24;
- if (srca == 0)
+ if (src == 0)
return;
fbGetDrawable(pDst->pDrawable, dstBits, dstStride, dstBpp);
@@ -211,7 +229,7 @@ fbCompositeSolidMask_nx8888x8888C (CARD8 op,
src |= 0xff000000;
dstMask = FbFullMask (pDst->pDrawable->depth);
srca = src >> 24;
- if (srca == 0)
+ if (src == 0)
return;
fbGetDrawable(pDst->pDrawable, dstBits, dstStride, dstBpp);
@@ -306,7 +324,7 @@ fbCompositeSolidMask_nx8x0888 (CARD8 op,
if (pSrc->pFormat->direct.alphaMask == 0)
src |= 0xff000000;
srca = src >> 24;
- if (srca == 0)
+ if (src == 0)
return;
fbGetDrawable(pDst->pDrawable, dstBits, dstStride, dstBpp);
@@ -337,13 +355,13 @@ fbCompositeSolidMask_nx8x0888 (CARD8 op,
else
{
d = Fetch24(dst);
- d = fbOver (src, d);
+ d = fbOver24 (src, d);
}
Store24(dst,d);
}
else if (m)
{
- d = fbOver (fbIn(src,m), Fetch24(dst));
+ d = fbOver24 (fbIn(src,m), Fetch24(dst));
Store24(dst,d);
}
dst += 3;
@@ -391,7 +409,7 @@ fbCompositeSolidMask_nx8x0565 (CARD8 op,
if (pSrc->pFormat->direct.alphaMask == 0)
src |= 0xff000000;
srca = src >> 24;
- if (srca == 0)
+ if (src == 0)
return;
fbGetDrawable(pDst->pDrawable, dstBits, dstStride, dstBpp);
@@ -422,14 +440,14 @@ fbCompositeSolidMask_nx8x0565 (CARD8 op,
else
{
d = *dst;
- d = fbOver (src, cvt0565to8888(d));
+ d = fbOver24 (src, cvt0565to8888(d));
}
*dst = cvt8888to0565(d);
}
else if (m)
{
d = *dst;
- d = fbOver (fbIn(src,m), cvt0565to8888(d));
+ d = fbOver24 (fbIn(src,m), cvt0565to8888(d));
*dst = cvt8888to0565(d);
}
dst++;
@@ -541,7 +559,7 @@ fbCompositeSrc_8888x0888 (CARD8 op,
if (a == 0xff)
d = s;
else
- d = fbOver (s, Fetch24(dst));
+ d = fbOver24 (s, Fetch24(dst));
Store24(dst,d);
}
dst += 3;
@@ -601,7 +619,7 @@ fbCompositeSrc_8888x0565 (CARD8 op,
else
{
d = *dst;
- d = fbOver (s, cvt0565to8888(d));
+ d = fbOver24 (s, cvt0565to8888(d));
}
*dst = cvt8888to0565(d);
}
@@ -709,6 +727,114 @@ fbCompositeSrcAdd_8000x8000 (CARD8 op,
}
}
+void
+fbCompositeSrcAdd_1000x1000 (CARD8 op,
+ PicturePtr pSrc,
+ PicturePtr pMask,
+ PicturePtr pDst,
+ INT16 xSrc,
+ INT16 ySrc,
+ INT16 xMask,
+ INT16 yMask,
+ INT16 xDst,
+ INT16 yDst,
+ CARD16 width,
+ CARD16 height)
+{
+ FbBits *dstBits, *srcBits;
+ FbStride dstStride, srcStride;
+ int dstBpp, srcBpp;
+
+ fbGetDrawable(pSrc->pDrawable, srcBits, srcStride, srcBpp);
+
+ fbGetDrawable(pDst->pDrawable, dstBits, dstStride, dstBpp);
+
+ fbBlt (srcBits + srcStride * ySrc,
+ srcStride,
+ xSrc,
+
+ dstBits + dstStride * yDst,
+ dstStride,
+ xDst,
+
+ width,
+ height,
+
+ GXor,
+ FB_ALLONES,
+ srcBpp,
+
+ FALSE,
+ FALSE);
+}
+
+void
+fbCompositeSolidMask_nx1xn (CARD8 op,
+ PicturePtr pSrc,
+ PicturePtr pMask,
+ PicturePtr pDst,
+ INT16 xSrc,
+ INT16 ySrc,
+ INT16 xMask,
+ INT16 yMask,
+ INT16 xDst,
+ INT16 yDst,
+ CARD16 width,
+ CARD16 height)
+{
+ FbBits *dstBits, *srcBits;
+ FbStip *maskBits;
+ FbStride dstStride, maskStride, srcStride;
+ int dstBpp, maskBpp, srcBpp;
+ FbBits src;
+
+ fbGetDrawable(pSrc->pDrawable, srcBits, srcStride, srcBpp);
+ switch (srcBpp) {
+ case 32:
+ src = *(CARD32 *) srcBits;
+ break;
+ case 24:
+ src = Fetch24 ((CARD8 *) srcBits);
+ break;
+ case 16:
+ src = *(CARD16 *) srcBits;
+ src = cvt0565to8888(src);
+ break;
+ }
+
+ fbGetStipDrawable (pMask->pDrawable, maskBits, maskStride, maskBpp);
+ fbGetDrawable (pDst->pDrawable, dstBits, dstStride, dstBpp);
+
+ switch (dstBpp) {
+ case 32:
+ break;
+ case 24:
+ break;
+ case 16:
+ src = cvt8888to0565(src);
+ break;
+ }
+
+ src = fbReplicatePixel (src, dstBpp);
+
+ fbBltOne (maskBits + maskStride * yMask,
+ maskStride,
+ xMask,
+
+ dstBits + dstStride * yDst,
+ dstStride,
+ xDst * dstBpp,
+ dstBpp,
+
+ width * dstBpp,
+ height,
+
+ 0x0,
+ src,
+ FB_ALLONES,
+ 0x0);
+}
+
# define mod(a,b) ((b) == 1 ? 0 : (a) >= 0 ? (a) % (b) : (b) - (-a) % (b))
void
@@ -809,6 +935,19 @@ fbComposite (CARD8 op,
}
}
break;
+ case PICT_a1:
+ switch (pDst->format) {
+ case PICT_r5g6b5:
+ case PICT_b5g6r5:
+ case PICT_r8g8b8:
+ case PICT_b8g8r8:
+ case PICT_a8r8g8b8:
+ case PICT_x8r8g8b8:
+ case PICT_a8b8g8r8:
+ case PICT_x8b8g8r8:
+ func = fbCompositeSolidMask_nx1xn;
+ break;
+ }
}
}
}
@@ -873,6 +1012,12 @@ fbComposite (CARD8 op,
func = fbCompositeSrcAdd_8000x8000;
break;
}
+ case PICT_a1:
+ switch (pDst->format) {
+ case PICT_a1:
+ func = fbCompositeSrcAdd_1000x1000;
+ break;
+ }
}
}
break;
@@ -937,9 +1082,14 @@ fbComposite (CARD8 op,
REGION_UNINIT (pDst->pDrawable->pScreen, &region);
}
+#endif /* RENDER */
+
Bool
fbPictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats)
{
+
+#ifdef RENDER
+
PictureScreenPtr ps;
if (!miPictureInit (pScreen, formats, nformats))
@@ -948,5 +1098,8 @@ fbPictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats)
ps->Composite = fbComposite;
ps->Glyphs = miGlyphs;
ps->CompositeRects = miCompositeRects;
+
+#endif /* RENDER */
+
return TRUE;
}
diff --git a/xc/programs/Xserver/fb/fbpict.h b/xc/programs/Xserver/fb/fbpict.h
index b68cd91f5..0eaaeec26 100644
--- a/xc/programs/Xserver/fb/fbpict.h
+++ b/xc/programs/Xserver/fb/fbpict.h
@@ -1,5 +1,5 @@
/*
- * $XFree86: xc/programs/Xserver/fb/fbpict.h,v 1.2 2000/11/20 07:13:07 keithp Exp $
+ * $XFree86: xc/programs/Xserver/fb/fbpict.h,v 1.3 2001/01/21 21:19:09 tsi Exp $
*
* Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
*
@@ -461,7 +461,4 @@ fbComposite (CARD8 op,
CARD16 width,
CARD16 height);
-Bool
-fbPictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats);
-
#endif /* _FBPICT_H_ */
diff --git a/xc/programs/Xserver/hw/darwin/Imakefile b/xc/programs/Xserver/hw/darwin/Imakefile
index 38ccefbdf..b87053f66 100644
--- a/xc/programs/Xserver/hw/darwin/Imakefile
+++ b/xc/programs/Xserver/hw/darwin/Imakefile
@@ -1,17 +1,23 @@
-XCOMM $XFree86: xc/programs/Xserver/hw/darwin/Imakefile,v 1.4 2000/12/11 20:29:38 dawes Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/darwin/Imakefile,v 1.8 2001/02/02 21:37:59 herrb Exp $
#include <Server.tmpl>
#define IHaveSubdirs
+XCOMM LinkSourceFile(xf86Helper.c,../xfree86/common)
+
SUBDIRS = utils
SRCS = darwin.c \
- darwinCursor.c \
- darwinKeyboard.c
+ darwinKeyboard.c \
+ xfIOKit.c \
+ xfIOKitCursor.c \
+ quartz.c
OBJS = darwin.o \
- darwinCursor.o \
- darwinKeyboard.o
+ darwinKeyboard.o \
+ xfIOKit.o \
+ xfIOKitCursor.o \
+ quartz.o
INCLUDES = -I. -I$(SERVERSRC)/mi -I$(SERVERSRC)/mfb -I$(SERVERSRC)/cfb \
-I$(SERVERSRC)/include -I$(XINCLUDESRC) -I$(SERVERSRC)/os \
@@ -22,12 +28,16 @@ CUSTOMVERSION = XFree86CustomVersion
CUSTOMVERDEF = -DXF86_CUSTOM_VERSION='$(CUSTOMVERSION)'
#endif
-DEFINES = $(CUSTOMVERDEF)
+#if DarwinQuartzSupport
+QUARTZDEF = -DDARWIN_WITH_QUARTZ
+#endif
+
+DEFINES = $(CUSTOMVERDEF) $(QUARTZDEF)
+EXTRAMANDEFS = $(QUARTZDEF)
NormalLibraryObjectRule()
NormalLibraryTarget(darwin,$(OBJS))
-CppManTarget(Xdarwin,)
InstallManPage(Xdarwin,$(MANDIR))
DependTarget()
diff --git a/xc/programs/Xserver/hw/darwin/Xdarwin.cpp b/xc/programs/Xserver/hw/darwin/Xdarwin.cpp
deleted file mode 100644
index 2bdec2187..000000000
--- a/xc/programs/Xserver/hw/darwin/Xdarwin.cpp
+++ /dev/null
@@ -1,69 +0,0 @@
-.\" $XFree86: xc/programs/Xserver/hw/darwin/Xdarwin.cpp,v 1.1 2000/12/11 20:29:39 dawes Exp $
-.\"
-.TH XDARWIN 1 "Release 4.0.2" "XFree86"
-.SH NAME
-Xdarwin \- X window system server for Darwin operating system
-.SH SYNOPSIS
-.B Xdarwin
-[ options ] ...
-.SH DESCRIPTION
-.I Xdarwin
-is the window server for Version 11 of the X window system on the Darwin
-operating system. It uses IOKit services to accesss the display framebuffer,
-mouse and keyboard and to provide a layer of hardware abstraction.
-.I Xdarwin
-will normally be started by the \fIxdm(1)\fP display manager or by a script
-that runs the program \fIxinit(1)\fP.
-.SH OPTIONS
-.PP
-In addition to the normal server options described in the \fIXserver(1)\fP
-manual page, \fIXdarwin\fP accepts the following command line switches:
-.TP 8
-.B \-fakebuttons
-Emulates a 3 button mouse using the Command and Option keys. Clicking the
-first mouse button while holding down Command will act like clicking
-button 2. Holding down Option will simulate button 3.
-.TP 8
-.B \-nofakebuttons
-Do not emulate a 3 button mouse. This is the default.
-.TP 8
-.B "\-size \fIwidth\fP \fIheight\fP"
-Sets the screeen resolution for the X server to use.
-.TP 8
-.B "\-depth \fIdepth\fP"
-Specifies the color bit depth to use. Currently only 8, 15, and 24 color bits
-per pixel are supported.
-.TP 8
-.B "\-refresh \fIrate\fP"
-Gives the refresh rate to use in Hz. For LCD displays this should be 0.
-.TP 8
-.B \-showconfig
-Print out the server version and patchlevel.
-.TP 8
-.B \-version
-Same as \fB\-showconfig\fP.
-.SH "SEE ALSO"
-.PP
-X(__miscmansuffix__), Xserver(1), xdm(1), xinit(1)
-.SH BUGS
-.I Xdarwin
-and this man page still have many limitations. Some of the more obvious
-ones are:
-.br
-- Only one display is supported.
-.br
-- The display mode can not be changed once the X server has started.
-.br
-- A screen saver is not supported.
-.br
-- The X server does not wake from sleep correctly.
-.br
-- The key repeat rate can not be changed.
-.PP
-.SH AUTHORS
-Original Port to Mac OS X Server - John Carmack
-.br
-Port to Darwin 1.0 - Dave Zarzycki
-.br
-Improvements and bug fixes - Torrey T. Lyons
-
diff --git a/xc/programs/Xserver/hw/darwin/Xdarwin.man b/xc/programs/Xserver/hw/darwin/Xdarwin.man
new file mode 100644
index 000000000..7b59879e6
--- /dev/null
+++ b/xc/programs/Xserver/hw/darwin/Xdarwin.man
@@ -0,0 +1,114 @@
+.\" $XFree86: xc/programs/Xserver/hw/darwin/Xdarwin.man,v 1.5 2001/01/27 18:20:39 dawes Exp $
+.\"
+.TH XDARWIN 1 __vendorversion__
+.SH NAME
+Xdarwin \- X window system server for Darwin operating system
+.SH SYNOPSIS
+.B Xdarwin
+[ options ] ...
+.SH DESCRIPTION
+#ifdef DARWIN_WITH_QUARTZ
+.I Xdarwin
+is the window server for Version 11 of the X window system on the Darwin
+operating system.
+.I Xdarwin
+can be started from the Darwin text console, or while running the Mac OS X
+Quartz window server.
+.PP
+When running from the console,
+.I Xdarwin
+acts as the window server and uses IOKit services to accesss the display framebuffer,
+mouse and keyboard and to provide a layer of hardware abstraction. In console mode,
+.I Xdarwin
+will normally be started by the \fIxdm(1)\fP display manager or by a script
+that runs the program \fIxinit(1)\fP.
+.PP
+When running with the Mac OS X Quartz window server,
+.I Xdarwin
+will normally be started with the Xmaster application. This application acts an
+agent for
+.I Xdarwin
+to receive events and allows easy switching between the Mac OS X and X window
+desktops. In this mode, CoreGraphics is used to capture and draw to the screen.
+#else
+.I Xdarwin
+is the window server for Version 11 of the X window system on the Darwin
+operating system. This version of
+.I Xdarwin
+can only be started from the Darwin text console. The Mac OS X Quartz window
+server, if present, must be shut down. It uses IOKit services to accesss the display
+framebuffer, mouse and keyboard and to provide a layer of hardware abstraction.
+.I Xdarwin
+will normally be started by the \fIxdm(1)\fP display manager or by a script
+that runs the program \fIxinit(1)\fP.
+#endif
+.SH OPTIONS
+.PP
+In addition to the normal server options described in the \fIXserver(1)\fP
+manual page, \fIXdarwin\fP accepts the following command line switches:
+.TP 8
+.B \-fakebuttons
+Emulates a 3 button mouse using the Command and Option keys. Clicking the
+first mouse button while holding down Command will act like clicking
+button 2. Holding down Option will simulate button 3.
+.TP 8
+.B \-nofakebuttons
+Do not emulate a 3 button mouse. This is the default.
+#ifdef DARWIN_WITH_QUARTZ
+.TP 8
+.B "\-size \fIwidth\fP \fIheight\fP"
+Sets the screeen resolution for the X server to use.
+This option is ignored if \fB\-quartz\fP is specified.
+.TP 8
+.B "\-depth \fIdepth\fP"
+Specifies the color bit depth to use. Currently only 8, 15, and 24 color bits
+per pixel are supported.
+This option is ignored if \fB\-quartz\fP is specified.
+.TP 8
+.B "\-refresh \fIrate\fP"
+Gives the refresh rate to use in Hz. For LCD displays this should be 0.
+This option is ignored if \fB\-quartz\fP is specified.
+.TP 8
+.B \-quartz
+Run in parallel with the Mac OS X Quartz window server.
+#else
+.TP 8
+.B "\-size \fIwidth\fP \fIheight\fP"
+Sets the screeen resolution for the X server to use.
+.TP 8
+.B "\-depth \fIdepth\fP"
+Specifies the color bit depth to use. Currently only 8, 15, and 24 color bits
+per pixel are supported.
+.TP 8
+.B "\-refresh \fIrate\fP"
+Gives the refresh rate to use in Hz. For LCD displays this should be 0.
+#endif
+.TP 8
+.B \-showconfig
+Print out the server version and patchlevel.
+.TP 8
+.B \-version
+Same as \fB\-showconfig\fP.
+.SH "SEE ALSO"
+.PP
+X(__miscmansuffix__), Xserver(1), xdm(1), xinit(1)
+.SH BUGS
+.I Xdarwin
+and this man page still have many limitations. Some of the more obvious
+ones are:
+.br
+- Only one display is supported.
+.br
+- The display mode can not be changed once the X server has started.
+.br
+- A screen saver is not supported.
+.br
+- The key repeat rate can not be changed.
+.PP
+.SH AUTHORS
+Original Port to Mac OS X Server - John Carmack
+.br
+Port to Darwin 1.0 - Dave Zarzycki
+.br
+Improvements and bug fixes - Torrey T. Lyons
+
diff --git a/xc/programs/Xserver/hw/darwin/darwin.c b/xc/programs/Xserver/hw/darwin/darwin.c
index a62405f72..45cf36ef5 100644
--- a/xc/programs/Xserver/hw/darwin/darwin.c
+++ b/xc/programs/Xserver/hw/darwin/darwin.c
@@ -1,16 +1,10 @@
/**************************************************************
*
- * IOKit support for the Darwin X Server
- *
- * HISTORY:
- * Original port to Mac OS X Server by John Carmack
- * Port to Darwin 1.0 by Dave Zarzycki
- * Significantly rewritten for XFree86 4.0.1 by Torrey Lyons
+ * Shared code for the Darwin X Server
+ * running with Quartz or the IOKit
*
**************************************************************/
-/* $XFree86: xc/programs/Xserver/hw/darwin/darwin.c,v 1.2 2000/12/01 19:47:38 dawes Exp $ */
-
-#define NDEBUG 1
+/* $XFree86: xc/programs/Xserver/hw/darwin/darwin.c,v 1.8 2001/02/08 23:36:23 dawes Exp $ */
#include "X.h"
#include "Xproto.h"
@@ -27,39 +21,36 @@
#include <sys/types.h>
#include <sys/time.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <pthread.h>
-
-#include <mach/mach_interface.h>
#define NO_CFPLUGIN
#include <IOKit/IOKitLib.h>
-#include <IOKit/hidsystem/IOHIDShared.h>
-#include <IOKit/graphics/IOGraphicsLib.h>
-#include <drivers/event_status_driver.h>
-
-// Define this to work around bugs in the display drivers for
-// older PowerBook G3's. If the X server starts without this
-// #define, you don't need it.
-#undef OLD_POWERBOOK_G3
+#include <IOKit/hidsystem/IOHIDLib.h>
+#include <IOKit/hidsystem/ev_keymap.h>
#include "darwin.h"
+#include "quartz.h"
+#include "xfIOKit.h"
+// Shared global variables
DarwinFramebufferRec dfb;
-unsigned char darwinKeyCommandL = 0, darwinKeyOptionL = 0;
+int darwinEventFD;
+Bool quartz = FALSE;
+UInt32 darwinDesiredWidth = 0, darwinDesiredHeight = 0;
+IOIndex darwinDesiredDepth = -1;
+SInt32 darwinDesiredRefresh = -1;
+
+// Quit after this many seconds if no quartz event poster is found.
+// Leave undefined for no safety quit.
+#define QUARTZ_SAFETY_DELAY 10
/* Fake button press/release for scroll wheel move. */
#define SCROLLWHEELUPFAKE 4
#define SCROLLWHEELDOWNFAKE 5
-static int darwinEventFD;
-static Bool fake3Buttons = FALSE;
-static DeviceIntPtr darwinPointer;
-static DeviceIntPtr darwinKeyboard;
-static UInt32 darwinDesiredWidth = 0, darwinDesiredHeight = 0;
-static IOIndex darwinDesiredDepth = -1;
-static SInt32 darwinDesiredRefresh = -1;
+static DeviceIntPtr darwinPointer;
+static DeviceIntPtr darwinKeyboard;
+static Bool fake3Buttons = FALSE;
+static unsigned char darwinKeyCommandL = 0, darwinKeyOptionL = 0;
// Common pixmap formats
static PixmapFormatRec formats[] = {
@@ -79,7 +70,7 @@ const int NUMFORMATS = sizeof(formats)/sizeof(formats[0]);
#define OSVENDOR ""
#endif
#ifndef PRE_RELEASE
-#define PRE_RELEASE (XF86_VERSION_BETA || XF86_VERSION_ALPHA)
+#define PRE_RELEASE XF86_VERSION_SNAP
#endif
static void
@@ -93,11 +84,15 @@ DarwinPrintBanner()
"please check the latest version in the XFree86 CVS repository\n"
"(http://www.XFree86.Org/cvs)\n");
#endif
- ErrorF("\nXFree86 Version%s", XF86_VERSION);
+ ErrorF("\nXFree86 Version %d.%d.%d", XF86_VERSION_MAJOR, XF86_VERSION_MINOR,
+ XF86_VERSION_PATCH);
+#if XF86_VERSION_SNAP > 0
+ ErrorF(".%d", XF86_VERSION_SNAP);
+#endif
#ifdef XF86_CUSTOM_VERSION
- ErrorF("(%s) ", XF86_CUSTOM_VERSION);
+ ErrorF(" (%s)", XF86_CUSTOM_VERSION);
#endif
- ErrorF("/ X Window System\n");
+ ErrorF(" / X Window System\n");
ErrorF("(protocol Version %d, revision %d, vendor release %d)\n",
X_PROTOCOL, X_PROTOCOL_REVISION, VENDOR_RELEASE );
ErrorF("Release Date: %s\n", XF86_DATE);
@@ -108,54 +103,28 @@ DarwinPrintBanner()
#if defined(BUILDERSTRING)
ErrorF("%s \n",BUILDERSTRING);
#endif
-}
-
-static Bool DarwinSaveScreen(ScreenPtr pScreen, int on)
-{ // FIXME
- if (on == SCREEN_SAVER_FORCER) {
- } else if (on == SCREEN_SAVER_ON) {
- } else {
- }
- return TRUE;
+#if defined(DARWIN_WITH_QUARTZ)
+ ErrorF("Mac OS X Quartz support available.\n");
+#endif
}
/*
- * DarwinStoreColors
- * This is a callback from X to change the hardware colormap
- * when using PsuedoColor
+ * DarwinSaveScreen
+ * X screensaver support. Not implemented.
*/
-static void DarwinStoreColors(
- ColormapPtr pmap,
- int numEntries,
- xColorItem *pdefs)
+static Bool DarwinSaveScreen(ScreenPtr pScreen, int on)
{
- kern_return_t kr;
- int i;
- IOColorEntry *newColors;
-
- assert( newColors = (IOColorEntry *)
- xalloc( numEntries*sizeof(IOColorEntry) ));
-
- // Convert xColorItem values to IOColorEntry
- // assume the colormap is PsuedoColor
- // as we do not support DirectColor
- for (i = 0; i < numEntries; i++) {
- newColors[i].index = pdefs[i].pixel;
- newColors[i].red = pdefs[i].red;
- newColors[i].green = pdefs[i].green;
- newColors[i].blue = pdefs[i].blue;
+ // FIXME
+ if (on == SCREEN_SAVER_FORCER) {
+ } else if (on == SCREEN_SAVER_ON) {
+ } else {
}
-
- kr = IOFBSetCLUT( dfb.fbService, 0, numEntries,
- kSetCLUTByValue, newColors );
- kern_assert( kr );
-
- xfree( newColors );
+ return TRUE;
}
/*
* DarwinAddScreen
- * This is a callback from X during AddScreen() from InitOutput()
+ * This is a callback from X during AddScreen() from InitOutput()
*/
static Bool DarwinAddScreen(
int index,
@@ -232,7 +201,7 @@ static Bool DarwinAddScreen(
visual->offsetRed = bitsPerRGB * 2;
visual->offsetGreen = bitsPerRGB;
visual->offsetBlue = 0;
-#if FALSE
+#if TRUE
visual->redMask = ((1<<bitsPerRGB)-1) << visual->offsetRed;
visual->greenMask = ((1<<bitsPerRGB)-1) << visual->offsetGreen;
visual->blueMask = ((1<<bitsPerRGB)-1) << visual->offsetBlue;
@@ -249,17 +218,18 @@ static Bool DarwinAddScreen(
ShmRegisterFbFuncs(pScreen);
#endif
- // setup cursor support, use hardware if possible
- if (!DarwinInitCursor(pScreen)) {
- return FALSE;
- }
-
// this must be initialized (why doesn't X have a default?)
pScreen->SaveScreen = DarwinSaveScreen;
-
- // initialize colormap handling as needed
- if (dfb.pixelInfo.pixelType == kIOCLUTPixels) {
- pScreen->StoreColors = DarwinStoreColors;
+
+ // Perform operations specific to the screen interface
+ if (quartz) {
+ if (! QuartzAddScreen(pScreen)) {
+ return FALSE;
+ }
+ } else {
+ if (! XFIOKitAddScreen(pScreen)) {
+ return FALSE;
+ }
}
// create and install the default colormap and
@@ -267,22 +237,8 @@ static Bool DarwinAddScreen(
if (!miCreateDefColormap( pScreen )) {
return FALSE;
}
-
- return TRUE;
-}
-/*
- * DarwinShutdownScreen
- */
-void DarwinShutdownScreen( void )
-{
-#if 0
- // we must close the HID System first
- // because it is a client of the framebuffer
- NXCloseEventStatus( dfb.hidParam );
- IOServiceClose( dfb.hidService );
- IOServiceClose( dfb.fbService );
-#endif
+ return TRUE;
}
/*
@@ -294,8 +250,9 @@ void DarwinShutdownScreen( void )
*/
/*
- * Set mouse acceleration and thresholding
- * FIXME: We currently ignore the threshold in ctrl->threshold.
+ * DarwinChangePointerControl
+ * Set mouse acceleration and thresholding
+ * FIXME: We currently ignore the threshold in ctrl->threshold.
*/
static void DarwinChangePointerControl(
DeviceIntPtr device,
@@ -312,66 +269,60 @@ static void DarwinChangePointerControl(
/*
- * Motion history between events is not required to be supported.
+ * DarwinMouseProc
+ * Handle the initialization, etc. of a mouse
*/
-static int DarwinGetMotionEvents( DeviceIntPtr pDevice, xTimecoord *buff,
- unsigned long start, unsigned long stop, ScreenPtr pScr)
-{
- return 0;
-}
+static int DarwinMouseProc(
+ DeviceIntPtr pPointer,
+ int what )
+{
+ char map[6];
+
+ switch (what) {
+
+ case DEVICE_INIT:
+ pPointer->public.on = FALSE;
+
+ map[1] = 1;
+ map[2] = 2;
+ map[3] = 3;
+ map[4] = 4;
+ map[5] = 5;
+ InitPointerDeviceStruct( (DevicePtr)pPointer,
+ map,
+ 5, // numbuttons (4 & 5 are scroll wheel)
+ miPointerGetMotionEvents,
+ DarwinChangePointerControl,
+ 0 );
+ break;
-/*
- * DarwinMouseProc --
- * Handle the initialization, etc. of a mouse
- */
-
-static int DarwinMouseProc( DeviceIntPtr pPointer, int what ) {
-
- char map[6];
-
- switch (what) {
-
- case DEVICE_INIT:
- pPointer->public.on = FALSE;
-
- map[1] = 1;
- map[2] = 2;
- map[3] = 3;
- map[4] = 4;
- map[5] = 5;
- InitPointerDeviceStruct( (DevicePtr)pPointer,
- map,
- 5, // numbuttons (4 & 5 are scroll wheel)
- DarwinGetMotionEvents, // miPointerGetMotionEvents ??
- DarwinChangePointerControl,
- 0 );
- break;
+ case DEVICE_ON:
+ pPointer->public.on = TRUE;
+ AddEnabledDevice( darwinEventFD );
+ return Success;
- case DEVICE_ON:
- pPointer->public.on = TRUE;
- AddEnabledDevice( darwinEventFD );
- return Success;
+ case DEVICE_CLOSE:
+ case DEVICE_OFF:
+ pPointer->public.on = FALSE;
+ RemoveEnabledDevice( darwinEventFD );
+ return Success;
+ }
- case DEVICE_CLOSE:
- case DEVICE_OFF:
- pPointer->public.on = FALSE;
- RemoveEnabledDevice( darwinEventFD );
return Success;
- }
-
- return Success;
}
/*
* DarwinKeybdProc
- * callback from X
+ * Callback from X
*/
static int DarwinKeybdProc( DeviceIntPtr pDev, int onoff )
{
switch ( onoff ) {
case DEVICE_INIT:
DarwinKeyboardInit( pDev );
+ darwinKeyCommandL = DarwinModifierKeycode(NX_MODIFIERKEY_COMMAND, 0);
+ darwinKeyOptionL = DarwinModifierKeycode(NX_MODIFIERKEY_ALTERNATE, 0);
break;
case DEVICE_ON:
pDev->public.on = TRUE;
@@ -389,6 +340,86 @@ static int DarwinKeybdProc( DeviceIntPtr pDev, int onoff )
}
/*
+ * DarwinSimulateMouseClick
+ * Send a mouse click to X when multiple mouse buttons are simulated
+ * with modifier-clicks, such as command-click for button 2. The dix
+ * layer is told that the previously pressed modifier key(s) are
+ * released, the simulated click event is sent, and the modifier keys
+ * are reverted to their actual (pressed) state. This is usually
+ * closest to what the user wants. Ie. the user typically wants to
+ * simulate a button 2 press instead of Command-button 2.
+ */
+void DarwinSimulateMouseClick(
+ xEvent xe, // event template with time and
+ // mouse position filled in
+ int whichButton, // mouse button to be pressed
+ int whichEvent, // ButtonPress or ButtonRelease
+ int keycodesUsed[], // list of keycodes of the modifiers used
+ // to create the fake click + MIN_KEYCODE
+ int numKeycodes ) // number of keycodes in list
+{
+ int i;
+
+ // first fool X into forgetting about the keys
+ for (i = 0; i < numKeycodes; i++) {
+ xe.u.u.type = KeyRelease;
+ xe.u.u.detail = keycodesUsed[i];
+ (darwinKeyboard->public.processInputProc)
+ ( &xe, darwinKeyboard, 1 );
+ }
+
+ // push the mouse button
+ xe.u.u.type = whichEvent;
+ xe.u.u.detail = whichButton;
+ (darwinPointer->public.processInputProc)
+ ( &xe, darwinPointer, 1 );
+
+ // reset the keys
+ for (i = 0; i < numKeycodes; i++) {
+ xe.u.u.type = KeyPress;
+ xe.u.u.detail = keycodesUsed[i];
+ (darwinKeyboard->public.processInputProc)
+ ( &xe, darwinKeyboard, 1 );
+ }
+}
+
+/*
+ * DarwinUpdateModifiers
+ * Send events to update the modifier state.
+ */
+void DarwinUpdateModifiers(
+ xEvent xe, // event template with time, mouse position,
+ // and KeyPress or KeyRelease filled in
+ int flags ) // modifier flags that have changed
+{
+ if (flags & NX_ALPHASHIFTMASK) {
+ xe.u.u.detail = DarwinModifierKeycode(NX_MODIFIERKEY_ALPHALOCK, 0);
+ (darwinKeyboard->public.processInputProc)
+ (&xe, darwinKeyboard, 1);
+ }
+ if (flags & NX_COMMANDMASK) {
+ xe.u.u.detail = DarwinModifierKeycode(NX_MODIFIERKEY_COMMAND, 0);
+ (darwinKeyboard->public.processInputProc)
+ (&xe, darwinKeyboard, 1);
+ }
+ if (flags & NX_CONTROLMASK) {
+ xe.u.u.detail = DarwinModifierKeycode(NX_MODIFIERKEY_CONTROL, 0);
+ (darwinKeyboard->public.processInputProc)
+ (&xe, darwinKeyboard, 1);
+ }
+ if (flags & NX_ALTERNATEMASK) {
+ xe.u.u.detail = DarwinModifierKeycode(NX_MODIFIERKEY_ALTERNATE, 0);
+ (darwinKeyboard->public.processInputProc)
+ (&xe, darwinKeyboard, 1);
+ }
+ if (flags & NX_SHIFTMASK) {
+ xe.u.u.detail = DarwinModifierKeycode(NX_MODIFIERKEY_SHIFT, 0);
+ (darwinKeyboard->public.processInputProc)
+ (&xe, darwinKeyboard, 1);
+ }
+}
+
+/*
===========================================================================
Functions needed to link against device independent X
@@ -398,7 +429,7 @@ static int DarwinKeybdProc( DeviceIntPtr pDev, int onoff )
/*
* ProcessInputEvents
- * Read events from the event queue
+ * Read events from the event queue
*/
void ProcessInputEvents(void)
{
@@ -407,8 +438,26 @@ void ProcessInputEvents(void)
int r;
struct timeval tv;
struct timezone tz;
+ static int startsec = 0;
+ static Bool gotread = false;
+ static int old_state = 0;
+
+#if defined(DARWIN_WITH_QUARTZ) && defined(QUARTZ_SAFETY_DELAY)
+ // Quartz safety quit. Bail if we don't get any events from the event pipe.
+ // If the event writer fails to find us, we will have captured the screen
+ // but not be seeing any events and be unkillable from the console.
+ if (quartz && ! gotread) {
+ gettimeofday(&tv, &tz);
+ if (startsec == 0) startsec = tv.tv_sec;
+ if (startsec + QUARTZ_SAFETY_DELAY< tv.tv_sec) {
+ QuartzGiveUp();
+ FatalError("%d second safety quit\n", QUARTZ_SAFETY_DELAY);
+ }
+ }
+#endif
// try to read from our pipe
+ // FIXME: safely handle SIGPIPE in quartz mode
r = read( darwinEventFD, &ev, sizeof(ev));
if ((r == -1) && (errno != EAGAIN)) {
ErrorF("read(darwinEventFD) failed, errno=%d: %s\n", errno, strerror(errno));
@@ -416,10 +465,11 @@ void ProcessInputEvents(void)
} else if ((r == -1) && (errno == EAGAIN)) {
return;
} else if ( r != sizeof( ev ) ) {
- ErrorF( "Only read %i bytes from darwinPipe!", r );
+ ErrorF( "Only read %i bytes from darwinPipe!\n", r );
return;
}
+ gotread = true;
gettimeofday(&tv, &tz);
// translate it to an X event and post it
@@ -443,39 +493,16 @@ void ProcessInputEvents(void)
case NX_LMOUSEDOWN:
// Mimic multi-button mouse with Command and Option
if (fake3Buttons && ev.flags & (NX_COMMANDMASK | NX_ALTERNATEMASK)) {
+ int button;
+ int keycode;
if (ev.flags & NX_COMMANDMASK) {
- // first fool X into forgetting about Command key
- xe.u.u.type = KeyRelease;
- xe.u.u.detail = darwinKeyCommandL;
- (darwinKeyboard->public.processInputProc)
- ( &xe, darwinKeyboard, 1 );
- // push button 2
- xe.u.u.type = ButtonPress;
- xe.u.u.detail = 2; // de.key = button 2
- (darwinPointer->public.processInputProc)
- ( &xe, darwinPointer, 1 );
- // reset Command key down
- xe.u.u.type = KeyPress;
- xe.u.u.detail = darwinKeyCommandL;
- (darwinKeyboard->public.processInputProc)
- ( &xe, darwinKeyboard, 1 );
+ button = 2;
+ keycode = darwinKeyCommandL;
} else {
- // first fool X into forgetting about Option key
- xe.u.u.type = KeyRelease;
- xe.u.u.detail = darwinKeyOptionL;
- (darwinKeyboard->public.processInputProc)
- ( &xe, darwinKeyboard, 1 );
- // push button 3
- xe.u.u.type = ButtonPress;
- xe.u.u.detail = 3; // de.key = button 3
- (darwinPointer->public.processInputProc)
- ( &xe, darwinPointer, 1 );
- // reset Option key down
- xe.u.u.type = KeyPress;
- xe.u.u.detail = darwinKeyOptionL;
- (darwinKeyboard->public.processInputProc)
- ( &xe, darwinKeyboard, 1 );
+ button = 3;
+ keycode = darwinKeyOptionL;
}
+ DarwinSimulateMouseClick(xe, button, ButtonPress, &keycode, 1);
} else {
xe.u.u.detail = 1; //de.key = button 1;
xe.u.u.type = ButtonPress;
@@ -487,39 +514,16 @@ void ProcessInputEvents(void)
case NX_LMOUSEUP:
// Mimic multi-button mouse with Command and Option
if (fake3Buttons && ev.flags & (NX_COMMANDMASK | NX_ALTERNATEMASK)) {
+ int button;
+ int keycode;
if (ev.flags & NX_COMMANDMASK) {
- // first fool X into forgetting about Command key
- xe.u.u.type = KeyRelease;
- xe.u.u.detail = darwinKeyCommandL;
- (darwinKeyboard->public.processInputProc)
- ( &xe, darwinKeyboard, 1 );
- // push button 2
- xe.u.u.type = ButtonRelease;
- xe.u.u.detail = 2; // de.key = button 2
- (darwinPointer->public.processInputProc)
- ( &xe, darwinPointer, 1 );
- // reset Command key down
- xe.u.u.type = KeyPress;
- xe.u.u.detail = darwinKeyCommandL;
- (darwinKeyboard->public.processInputProc)
- ( &xe, darwinKeyboard, 1 );
+ button = 2;
+ keycode = darwinKeyCommandL;
} else {
- // first fool X into forgetting about Option key
- xe.u.u.type = KeyRelease;
- xe.u.u.detail = darwinKeyOptionL;
- (darwinKeyboard->public.processInputProc)
- ( &xe, darwinKeyboard, 1 );
- // push button 3
- xe.u.u.type = ButtonRelease;
- xe.u.u.detail = 3; // de.key = button 3
- (darwinPointer->public.processInputProc)
- ( &xe, darwinPointer, 1 );
- // reset Option key down
- xe.u.u.type = KeyPress;
- xe.u.u.detail = darwinKeyOptionL;
- (darwinKeyboard->public.processInputProc)
- ( &xe, darwinKeyboard, 1 );
+ button = 3;
+ keycode = darwinKeyOptionL;
}
+ DarwinSimulateMouseClick(xe, button, ButtonRelease, &keycode, 1);
} else {
xe.u.u.detail = 1; //de.key = button 1;
xe.u.u.type = ButtonRelease;
@@ -560,7 +564,8 @@ void ProcessInputEvents(void)
case NX_FLAGSCHANGED:
{
- static int old_state = 0;
+ // Assumes only one flag has changed. In quartz mode,
+ // this restriction must be enforced by the quartz event feeder.
int new_on_flags = ~old_state & ev.flags;
int new_off_flags = old_state & ~ev.flags;
old_state = ev.flags;
@@ -633,8 +638,42 @@ void ProcessInputEvents(void)
break;
}
+ // Special events for Quartz support
+ case NX_APPDEFINED:
+ if (quartz) {
+ switch (ev.data.compound.subType) {
+
+ // Update modifier state. As opposed to NX_FLAGSCHANGED,
+ // in this case any amount of modifiers may have changed.
+ case kXServerUpdateModifiers:
+ xe.u.u.type = KeyRelease;
+ DarwinUpdateModifiers(xe, old_state & ~ev.flags);
+ xe.u.u.type = KeyPress;
+ DarwinUpdateModifiers(xe, ~old_state & ev.flags);
+ old_state = ev.flags;
+ break;
+
+ case kXServerShow:
+ QuartzShow();
+ break;
+
+ case kXServerHide:
+ QuartzHide();
+ break;
+
+ case kXServerQuit:
+ // FIXME: is there a better way to quit?
+ FatalError("Terminated by Xmaster.\n");
+ break;
+
+ default:
+ ErrorF("Unknown event from Xmaster.\n");
+ } // switch (ev.data.compound.subType)
+ } // if (quartz)
+ break;
+
default:
- ErrorF("unknown event caught: %d\n", ev.type);
+ ErrorF("Unknown event caught: %d\n", ev.type);
ErrorF("\tev.type = %d\n", ev.type);
ErrorF("\tev.location.x,y = %d,%d\n", ev.location.x, ev.location.y);
ErrorF("\tev.time = %ld\n", ev.time);
@@ -656,272 +695,21 @@ void ProcessInputEvents(void)
}
-static void *DarwinHIDThread(void *arg);
-
/*
* InitInput
- * Register the keyboard and mouse devices
+ * Register the keyboard and mouse devices
*/
void InitInput( int argc, char **argv )
{
- if (serverGeneration == 1) {
- int fd[2];
-
- assert( pipe(fd) == 0 );
- darwinEventFD = fd[0];
- fcntl(darwinEventFD, F_SETFL, O_NONBLOCK);
- pthread_create(&dfb.hidThread, NULL, DarwinHIDThread, (void *) fd[1]);
-
- darwinPointer = AddInputDevice(DarwinMouseProc, TRUE);
- RegisterPointerDevice( darwinPointer );
-
- darwinKeyboard = AddInputDevice(DarwinKeybdProc, TRUE);
- RegisterKeyboardDevice( darwinKeyboard );
- }
-}
-
-EvGlobals * evg;
-mach_port_t masterPort;
-mach_port_t notificationPort;
-IONotificationPortRef NotificationPortRef;
-
-static void ClearEvent(NXEvent * ep)
-{
- static NXEvent nullEvent = {NX_NULLEVENT, {0, 0 }, 0, -1, 0 };
+ if (serverGeneration == 1) {
+ darwinPointer = AddInputDevice(DarwinMouseProc, TRUE);
+ RegisterPointerDevice( darwinPointer );
- *ep = nullEvent;
- ep->data.compound.subType = ep->data.compound.misc.L[0] =
- ep->data.compound.misc.L[1] = 0;
-}
-
-static void *DarwinHIDThread(void *arg)
-{
- int darwinEventWriteFD = (int)arg;
-
- for (;;) {
- IOReturn kr;
- NXEvent ev;
- NXEQElement *oldHead;
- struct {
- mach_msg_header_t header;
- mach_msg_trailer_t trailer;
- } msg;
-
- kr = mach_msg((mach_msg_header_t*) &msg, MACH_RCV_MSG, 0,
- sizeof(msg), notificationPort, 0, MACH_PORT_NULL);
- assert(KERN_SUCCESS == kr);
-
- while (evg->LLEHead != evg->LLETail) {
- oldHead = (NXEQElement*)&evg->lleq[evg->LLEHead];
- ev_lock(&oldHead->sema);
- ev = oldHead->event;
- ClearEvent(&oldHead->event);
- evg->LLEHead = oldHead->next;
- ev_unlock(&oldHead->sema);
-
- write(darwinEventWriteFD, &ev, sizeof(ev));
- }
+ darwinKeyboard = AddInputDevice(DarwinKeybdProc, TRUE);
+ RegisterKeyboardDevice( darwinKeyboard );
}
- return NULL;
}
-void SetupFBandHID(void)
-{
- kern_return_t kr;
- io_service_t service;
- io_iterator_t iter;
- io_name_t name;
- vm_address_t shmem, vram;
- vm_size_t shmemSize;
- int i;
- UInt32 numModes;
- IODisplayModeInformation modeInfo;
- IODisplayModeID displayMode, *allModes;
- IOIndex displayDepth;
- IOFramebufferInformation fbInfo;
- StdFBShmem_t *cshmem;
-
- dfb.fbService = 0;
- dfb.hidService = 0;
-
- // find and open the IOFrameBuffer service
- kr = IOServiceGetMatchingServices( masterPort,
- IOServiceMatching( IOFRAMEBUFFER_CONFORMSTO ),
- &iter );
- kern_assert( kr );
-
- assert(service = IOIteratorNext(iter));
-
- kr = IOServiceOpen( service, mach_task_self(),
- kIOFBServerConnectType, &dfb.fbService );
- if (kr != KERN_SUCCESS)
- FatalError("failed to connect as window server!\nMake sure you have quit the Mac OS X window server.\n");
-
- IOObjectRelease( service );
- IOObjectRelease( iter );
-
- // create the slice of shared memory containing cursor state data
- kr = IOFBCreateSharedCursor( dfb.fbService, kIOFBCurrentShmemVersion,
- 32, 32 );
- kern_assert( kr );
-
- // SET THE SCREEN PARAMETERS
- // get the current screen resolution, refresh rate and depth
- kr = IOFBGetCurrentDisplayModeAndDepth( dfb.fbService, &displayMode,
- &displayDepth );
- kern_assert( kr );
-
- // use the current screen resolution if the user
- // only wants to change the refresh rate
- if (darwinDesiredRefresh != -1 && darwinDesiredWidth == 0) {
- kr = IOFBGetDisplayModeInformation( dfb.fbService, displayMode,
- &modeInfo );
- kern_assert( kr );
- darwinDesiredWidth = modeInfo.nominalWidth;
- darwinDesiredHeight = modeInfo.nominalHeight;
- }
-
- // use the current resolution and refresh rate
- // if the user doesn't have a preference
- if (darwinDesiredWidth == 0) {
-
- // change the pixel depth if desired
- if (darwinDesiredDepth != -1) {
- kr = IOFBGetDisplayModeInformation( dfb.fbService, displayMode,
- &modeInfo );
- kern_assert( kr );
- if (modeInfo.maxDepthIndex < darwinDesiredDepth)
- FatalError("Current screen resolution does not support desired pixel depth!\n");
-
- displayDepth = darwinDesiredDepth;
- kr = IOFBSetDisplayModeAndDepth( dfb.fbService, displayMode,
- displayDepth );
- kern_assert( kr );
- }
-
- // look for display mode with correct resolution and refresh rate
- } else {
-
- // get an array of all supported display modes
- kr = IOFBGetDisplayModeCount( dfb.fbService, &numModes );
- kern_assert( kr );
- assert(allModes = (IODisplayModeID *)
- xalloc( numModes * sizeof(IODisplayModeID) ));
- kr = IOFBGetDisplayModes( dfb.fbService, numModes, allModes );
- kern_assert( kr );
-
- for (i = 0; i < numModes; i++) {
- kr = IOFBGetDisplayModeInformation( dfb.fbService, allModes[i],
- &modeInfo );
- kern_assert( kr );
-
- if (modeInfo.flags & kDisplayModeValidFlag &&
- modeInfo.nominalWidth == darwinDesiredWidth &&
- modeInfo.nominalHeight == darwinDesiredHeight) {
-
- if (darwinDesiredDepth == -1)
- darwinDesiredDepth = modeInfo.maxDepthIndex;
- if (modeInfo.maxDepthIndex < darwinDesiredDepth)
- FatalError("Desired screen resolution does not support desired pixel depth!\n");
- if ((darwinDesiredRefresh == -1 ||
- (darwinDesiredRefresh << 16) == modeInfo.refreshRate)) {
- displayMode = allModes[i];
- displayDepth = darwinDesiredDepth;
- kr = IOFBSetDisplayModeAndDepth( dfb.fbService, displayMode,
- displayDepth );
- kern_assert( kr );
- break;
- }
- }
- }
-
- xfree( allModes );
- if (i >= numModes)
- FatalError("Desired screen resolution or refresh rate is not supported!\n");
- }
-
- kr = IOFBGetPixelInformation( dfb.fbService, displayMode, displayDepth,
- kIOFBSystemAperture, &dfb.pixelInfo );
- kern_assert( kr );
-
-#ifdef OLD_POWERBOOK_G3
- if (dfb.pixelInfo.pixelType == kIOCLUTPixels)
- dfb.pixelInfo.pixelType = kIOFixedCLUTPixels;
-#endif
-
- kr = IOFBGetFramebufferInformationForAperture( dfb.fbService, kIOFBSystemAperture,
- &fbInfo );
- kern_assert( kr );
-
- kr = IOConnectMapMemory( dfb.fbService, kIOFBCursorMemory,
- mach_task_self(), (vm_address_t *) &cshmem,
- &shmemSize, kIOMapAnywhere );
- kern_assert( kr );
- dfb.cursorShmem = cshmem;
-
- kr = IOConnectMapMemory( dfb.fbService, kIOFBSystemAperture, mach_task_self(),
- &vram, &shmemSize, kIOMapAnywhere );
- kern_assert( kr );
-
- dfb.framebuffer = (void*)vram;
- dfb.width = fbInfo.activeWidth;
- dfb.height = fbInfo.activeHeight;
- dfb.pitch = fbInfo.bytesPerRow;
- dfb.bitsPerPixel = fbInfo.bitsPerPixel;
- dfb.colorBitsPerPixel = dfb.pixelInfo.componentCount *
- dfb.pixelInfo.bitsPerComponent;
-
- // find and open the HID System Service
- kr = IOServiceGetMatchingServices( masterPort,
- IOServiceMatching( kIOHIDSystemClass ),
- &iter );
- kern_assert( kr );
-
- assert( service = IOIteratorNext( iter ) );
-
- kr = IORegistryEntryGetName( service, name );
- kern_assert( kr );
-
- kr = IOServiceOpen( service, mach_task_self(), kIOHIDServerConnectType,
- &dfb.hidService );
- kern_assert( kr );
-
- IOObjectRelease( service );
- IOObjectRelease( iter );
-
- kr = IOHIDCreateSharedMemory( dfb.hidService, kIOHIDCurrentShmemVersion );
- kern_assert( kr );
-
- kr = IOHIDSetEventsEnable(dfb.hidService, TRUE);
- kern_assert( kr );
-
- // Inform the HID system that the framebuffer is also connected to it
- kr = IOConnectAddClient( dfb.hidService, dfb.fbService );
- kern_assert( kr );
-
- kr = IOHIDSetCursorEnable(dfb.hidService, TRUE);
- kern_assert( kr );
-
- kr = IOConnectMapMemory( dfb.hidService, kIOHIDGlobalMemory, mach_task_self(),
- &shmem, &shmemSize, kIOMapAnywhere );
- kern_assert( kr );
-
- evg = (EvGlobals *)(shmem + ((EvOffsets *)shmem)->evGlobalsOffset);
-
- assert(sizeof(EvGlobals) == evg->structSize);
-
- NotificationPortRef = IONotificationPortCreate( masterPort );
-
- notificationPort = IONotificationPortGetMachPort(NotificationPortRef);
-
- kr = IOConnectSetNotificationPort( dfb.hidService, kIOHIDEventNotification,
- notificationPort, 0 );
- kern_assert( kr );
-
- evg->movedMask |= NX_MOUSEMOVEDMASK;
-}
-
-
/*
* InitOutput
* Initialize screenInfo for all actually accessible framebuffers.
@@ -943,24 +731,28 @@ void InitOutput( ScreenInfo *pScreenInfo, int argc, char **argv )
AddScreen( DarwinAddScreen, argc, argv );
}
+/*
+ * OsVendorFataError
+ */
void OsVendorFatalError( void )
-{ ErrorF( " OsVendorFatalError\n" );
+{
+ ErrorF( " OsVendorFatalError\n" );
}
/*
- * OSVendorInit
+ * OsVendorInit
* One-time initialization of Darwin support.
- * Connect to framebuffer and HID system.
+ * Initialize display and event handling.
*/
void OsVendorInit(void)
{
- kern_return_t kr;
-
- kr = IOMasterPort(bootstrap_port, &masterPort);
- kern_assert( kr );
-
DarwinPrintBanner();
- SetupFBandHID();
+
+ if (quartz) {
+ QuartzOsVendorInit();
+ } else {
+ XFIOKitOsVendorInit();
+ }
}
/*
@@ -974,32 +766,44 @@ int ddxProcessArgument( int argc, char *argv[], int i )
#if 0
if ( !strcmp( argv[i], "-screen" ) ) {
if ( i == argc-1 ) {
- FatalError( "-screen must be followed by a number" );
+ FatalError( "-screen must be followed by a number\n" );
}
darwinScreenNumber = atoi( argv[i+1] );
ErrorF( "Attempting to use screen number %i\n", darwinScreenNumber );
- return 2;
+ return 2;
}
#endif
if ( !strcmp( argv[i], "-fakebuttons" ) ) {
fake3Buttons = TRUE;
ErrorF( "Faking a three button mouse\n" );
- return 1;
+ return 1;
}
if ( !strcmp( argv[i], "-nofakebuttons" ) ) {
fake3Buttons = FALSE;
ErrorF( "Not faking a three button mouse\n" );
- return 1;
+ return 1;
}
+#ifdef DARWIN_WITH_QUARTZ
+ if ( !strcmp( argv[i], "-quartz" ) ) {
+ quartz = TRUE;
+ ErrorF( "Running in parallel with Mac OS X Quartz window server.\n" );
+#ifdef QUARTZ_SAFETY_DELAY
+ ErrorF( "Quitting in %d seconds if no controller application is found.\n",
+ QUARTZ_SAFETY_DELAY );
+#endif
+ return 1;
+ }
+#endif
+
if ( !strcmp( argv[i], "-size" ) ) {
if ( i >= argc-2 ) {
- FatalError( "-size must be followed by two numbers" );
+ FatalError( "-size must be followed by two numbers\n" );
}
#ifdef OLD_POWERBOOK_G3
- ErrorF( "Ignoring unsupported -size option on old PowerBook G3\n");
+ ErrorF( "Ignoring unsupported -size option on old PowerBook G3\n" );
#else
darwinDesiredWidth = atoi( argv[i+1] );
darwinDesiredHeight = atoi( argv[i+2] );
@@ -1012,7 +816,7 @@ int ddxProcessArgument( int argc, char *argv[], int i )
if ( !strcmp( argv[i], "-depth" ) ) {
int bitDepth;
if ( i == argc-1 ) {
- FatalError( "-depth must be followed by a number" );
+ FatalError( "-depth must be followed by a number\n" );
}
#ifdef OLD_POWERBOOK_G3
ErrorF( "Ignoring unsupported -depth option on old PowerBook G3\n");
@@ -1025,7 +829,7 @@ int ddxProcessArgument( int argc, char *argv[], int i )
else if (bitDepth == 24)
darwinDesiredDepth = 2;
else
- FatalError( "Unsupported pixel depth. Use 8, 15, or 24 bits" );
+ FatalError( "Unsupported pixel depth. Use 8, 15, or 24 bits\n" );
ErrorF( "Attempting to use pixel depth of %i\n", bitDepth );
#endif
return 2;
@@ -1033,7 +837,7 @@ int ddxProcessArgument( int argc, char *argv[], int i )
if ( !strcmp( argv[i], "-refresh" ) ) {
if ( i == argc-1 ) {
- FatalError( "-refresh must be followed by a number" );
+ FatalError( "-refresh must be followed by a number\n" );
}
#ifdef OLD_POWERBOOK_G3
ErrorF( "Ignoring unsupported -refresh option on old PowerBook G3\n");
@@ -1068,10 +872,15 @@ void ddxUseMsg( void )
#endif
ErrorF("-fakebuttons : fake a three button mouse with Command and Option keys.\n");
ErrorF("-nofakebuttons : don't fake a three button mouse.\n");
+ ErrorF("-version : show the server version\n");
+#ifdef DARWIN_WITH_QUARTZ
+ ErrorF("-quartz : run in parallel with Mac OS X Quartz window server.\n");
+ ErrorF("\n");
+ ErrorF("IOKit specific options (ignored with -quartz):\n");
+#endif
ErrorF("-size <height> <width> : use a screen resolution of <height> x <width>.\n");
ErrorF("-depth <8,15,24> : use this bit depth.\n");
ErrorF("-refresh <rate> : use a monitor refresh rate of <rate> Hz.\n");
- ErrorF("-version : show the server version\n");
ErrorF("\n");
}
@@ -1079,8 +888,15 @@ void ddxUseMsg( void )
* ddxGiveUp --
* Device dependent cleanup. Called by dix before normal server death.
*/
-void ddxGiveUp( void ) {
+void ddxGiveUp( void )
+{
ErrorF( " ddxGiveUp\n" );
+
+ if (quartz) {
+ QuartzGiveUp();
+ } else {
+ XFIOKitGiveUp();
+ }
}
/*
@@ -1089,15 +905,14 @@ void ddxGiveUp( void ) {
* made to restore all original setting of the displays. Also all devices
* are closed.
*/
-void AbortDDX( void ) {
-#if TRUE
- ErrorF( " AbortDDX\n" );
+void AbortDDX( void )
+{
+ ErrorF( " AbortDDX\n" );
/*
* This is needed for a abnormal server exit, since the normal exit stuff
* MUST also be performed (i.e. the vt must be left in a defined state)
*/
ddxGiveUp();
-#endif
}
Bool DPMSSupported(void)
@@ -1107,3 +922,150 @@ Bool DPMSSupported(void)
void DPMSSet(void)
{ return;
}
+
+
+#include "mivalidate.h" // for union _Validate used by windowstr.h
+#include "windowstr.h" // for struct _Window
+#include "scrnintstr.h" // for struct _Screen
+
+// This is copied from Xserver/hw/xfree86/common/xf86Helper.c.
+// Quartz mode uses this when switching in and out of Quartz.
+// Quartz or IOKit can use this when waking from sleep.
+// Copyright (c) 1997-1998 by The XFree86 Project, Inc.
+
+/*
+ * xf86SetRootClip --
+ * Enable or disable rendering to the screen by
+ * setting the root clip list and revalidating
+ * all of the windows
+ */
+
+void
+xf86SetRootClip (ScreenPtr pScreen, BOOL enable)
+{
+ WindowPtr pWin = WindowTable[pScreen->myNum];
+ WindowPtr pChild;
+ Bool WasViewable = (Bool)(pWin->viewable);
+ Bool anyMarked;
+ RegionPtr pOldClip, bsExposed;
+#ifdef DO_SAVE_UNDERS
+ Bool dosave = FALSE;
+#endif
+ WindowPtr pLayerWin;
+ BoxRec box;
+
+ if (WasViewable)
+ {
+ for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib)
+ {
+ (void) (*pScreen->MarkOverlappedWindows)(pChild,
+ pChild,
+ &pLayerWin);
+ }
+ (*pScreen->MarkWindow) (pWin);
+ anyMarked = TRUE;
+ if (pWin->valdata)
+ {
+ if (HasBorder (pWin))
+ {
+ RegionPtr borderVisible;
+
+ borderVisible = REGION_CREATE(pScreen, NullBox, 1);
+ REGION_SUBTRACT(pScreen, borderVisible,
+ &pWin->borderClip, &pWin->winSize);
+ pWin->valdata->before.borderVisible = borderVisible;
+ }
+ pWin->valdata->before.resized = TRUE;
+ }
+ }
+
+ /*
+ * Use REGION_BREAK to avoid optimizations in ValidateTree
+ * that assume the root borderClip can't change well, normally
+ * it doesn't...)
+ */
+ if (enable)
+ {
+ box.x1 = 0;
+ box.y1 = 0;
+ box.x2 = pScreen->width;
+ box.y2 = pScreen->height;
+ REGION_RESET(pScreen, &pWin->borderClip, &box);
+ REGION_BREAK (pWin->drawable.pScreen, &pWin->clipList);
+ }
+ else
+ {
+ REGION_EMPTY(pScreen, &pWin->borderClip);
+ REGION_BREAK (pWin->drawable.pScreen, &pWin->clipList);
+ }
+
+ ResizeChildrenWinSize (pWin, 0, 0, 0, 0);
+
+ if (WasViewable)
+ {
+ if (pWin->backStorage)
+ {
+ pOldClip = REGION_CREATE(pScreen, NullBox, 1);
+ REGION_COPY(pScreen, pOldClip, &pWin->clipList);
+ }
+
+ if (pWin->firstChild)
+ {
+ anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin->firstChild,
+ pWin->firstChild,
+ (WindowPtr *)NULL);
+ }
+ else
+ {
+ (*pScreen->MarkWindow) (pWin);
+ anyMarked = TRUE;
+ }
+
+#ifdef DO_SAVE_UNDERS
+ if (DO_SAVE_UNDERS(pWin))
+ {
+ dosave = (*pScreen->ChangeSaveUnder)(pLayerWin, pLayerWin);
+ }
+#endif /* DO_SAVE_UNDERS */
+
+ if (anyMarked)
+ (*pScreen->ValidateTree)(pWin, NullWindow, VTOther);
+ }
+
+ if (pWin->backStorage &&
+ ((pWin->backingStore == Always) || WasViewable))
+ {
+ if (!WasViewable)
+ pOldClip = &pWin->clipList; /* a convenient empty region */
+ bsExposed = (*pScreen->TranslateBackingStore)
+ (pWin, 0, 0, pOldClip,
+ pWin->drawable.x, pWin->drawable.y);
+ if (WasViewable)
+ REGION_DESTROY(pScreen, pOldClip);
+ if (bsExposed)
+ {
+ RegionPtr valExposed = NullRegion;
+
+ if (pWin->valdata)
+ valExposed = &pWin->valdata->after.exposed;
+ (*pScreen->WindowExposures) (pWin, valExposed, bsExposed);
+ if (valExposed)
+ REGION_EMPTY(pScreen, valExposed);
+ REGION_DESTROY(pScreen, bsExposed);
+ }
+ }
+ if (WasViewable)
+ {
+ if (anyMarked)
+ (*pScreen->HandleExposures)(pWin);
+#ifdef DO_SAVE_UNDERS
+ if (dosave)
+ (*pScreen->PostChangeSaveUnder)(pLayerWin, pLayerWin);
+#endif /* DO_SAVE_UNDERS */
+ if (anyMarked && pScreen->PostValidateTree)
+ (*pScreen->PostValidateTree)(pWin, NullWindow, VTOther);
+ }
+ if (pWin->realized)
+ WindowsRestructured ();
+ FlushAllOutput ();
+}
diff --git a/xc/programs/Xserver/hw/darwin/darwinCursor.c b/xc/programs/Xserver/hw/darwin/darwinCursor.c
deleted file mode 100644
index 95b1dcd3b..000000000
--- a/xc/programs/Xserver/hw/darwin/darwinCursor.c
+++ /dev/null
@@ -1,706 +0,0 @@
-/**************************************************************
- *
- * Cursor support for Darwin X Server
- *
- * Three different cursor modes are possible:
- * X (0) - tracking via Darwin kernel,
- * display via X machine independent
- * Kernel (1) - tracking and display via Darwin kernel
- * (not currently supported)
- * Hardware (2) - tracking and display via hardware
- *
- * The X software cursor uses the Darwin software cursor
- * routines in IOFramebuffer.cpp to track the cursor, but
- * displays the cursor image using the X machine
- * independent display cursor routines in midispcur.c.
- *
- * The kernel cursor uses IOFramebuffer.cpp routines to
- * track and display the cursor. This gives better
- * performance as the display calls don't have to cross
- * the kernel boundary. Unfortunately, this mode has
- * synchronization issues with the user land X server
- * and isn't currently used.
- *
- * Hardware cursor support lets the hardware handle these
- * details.
- *
- * Kernel and hardware cursor mode only work for cursors
- * up to a certain size, currently 16x16 pixels. If a
- * bigger cursor is set, we fallback to X cursor mode.
- *
- * HISTORY:
- * 1.0 by Torrey T. Lyons, October 30, 2000
- *
- **************************************************************/
-/* $XFree86: xc/programs/Xserver/hw/darwin/darwinCursor.c,v 1.2 2000/11/28 17:25:10 dawes Exp $ */
-
-#include "scrnintstr.h"
-#include "cursorstr.h"
-#include "micmap.h"
-#define NO_CFPLUGIN
-#include <IOKit/graphics/IOGraphicsLib.h>
-#include <IOKit/hidsystem/IOHIDLib.h>
-#include "darwin.h"
-#include "mipointrst.h"
-
-#define DUMP_DARWIN_CURSOR FALSE
-
-// The cursors format are documented in IOFramebufferShared.h.
-#define RGBto34WithGamma(red, green, blue) \
- ( 0x000F \
- | (((red) & 0xF) << 12) \
- | (((green) & 0xF) << 8) \
- | (((blue) & 0xF) << 4) )
-#define RGBto38WithGamma(red, green, blue) \
- ( 0xFF << 24 \
- | (((red) & 0xFF) << 16) \
- | (((green) & 0xFF) << 8) \
- | (((blue) & 0xFF)) )
-#define HighBitOf32 0x80000000
-
-typedef struct {
- Bool canHWCursor;
- short cursorMode;
- RecolorCursorProcPtr RecolorCursor;
- InstallColormapProcPtr InstallColormap;
- QueryBestSizeProcPtr QueryBestSize;
- miPointerSpriteFuncPtr spriteFuncs;
- ColormapPtr pInstalledMap;
-} DarwinCursorScreenRec, *DarwinCursorScreenPtr;
-
-extern DarwinFramebufferRec dfb;
-static int darwinCursorScreenIndex = -1;
-static unsigned long darwinCursorGeneration = 0;
-
-/*
-===========================================================================
-
- Pointer sprite functions
-
-===========================================================================
-*/
-
-/*
- Realizing the Darwin hardware cursor (ie. converting from the
- X representation to the Darwin representation) is complicated
- by the fact that we have three different potential cursor
- formats to go to, one for each bit depth (8, 15, or 24).
- The Darwin formats are documented in IOFramebufferShared.h.
- X cursors are represented as two pieces, a source and a mask.
- The mask is a bitmap indicating which parts of the cursor are
- transparent and which parts are drawn. The source is a bitmap
- indicating which parts of the non-transparent portion of the the
- cursor should be painted in the foreground color and which should
- be painted in the background color. The bitmaps are given in
- 32-bit format with least significant byte and bit first.
- (This is opposite PowerPC Darwin.)
-*/
-
-typedef struct {
- unsigned char image[CURSORWIDTH*CURSORHEIGHT];
- unsigned char mask[CURSORWIDTH*CURSORHEIGHT];
-} cursorPrivRec, *cursorPrivPtr;
-
-/*
- * DarwinRealizeCursor8
- * Convert the X cursor representation to an 8-bit depth
- * format for Darwin. This function assumes the maximum cursor
- * width is a multiple of 8.
- */
-static Bool
-DarwinRealizeCursor8(
- ScreenPtr pScreen,
- CursorPtr pCursor)
-{
- cursorPrivPtr newCursor;
- unsigned char *newSourceP, *newMaskP;
- CARD32 *oldSourceP, *oldMaskP;
- xColorItem fgColor, bgColor;
- int index, x, y, rowPad;
- int cursorWidth, cursorHeight;
- ColormapPtr pmap;
-
- // check cursor size just to be sure
- cursorWidth = pCursor->bits->width;
- cursorHeight = pCursor->bits->height;
- if (cursorHeight > CURSORHEIGHT || cursorWidth > CURSORWIDTH)
- return FALSE;
-
- // get cursor colors in colormap
- index = pScreen->myNum;
- pmap = miInstalledMaps[index];
- if (!pmap) return FALSE;
-
- fgColor.red = pCursor->foreRed;
- fgColor.green = pCursor->foreGreen;
- fgColor.blue = pCursor->foreBlue;
- FakeAllocColor(pmap, &fgColor);
- bgColor.red = pCursor->backRed;
- bgColor.green = pCursor->backGreen;
- bgColor.blue = pCursor->backBlue;
- FakeAllocColor(pmap, &bgColor);
- FakeFreeColor(pmap, fgColor.pixel);
- FakeFreeColor(pmap, bgColor.pixel);
-
- // allocate memory for new cursor image
- newCursor = xalloc( sizeof(cursorPrivRec) );
- if (!newCursor)
- return FALSE;
- memset( newCursor->image, pScreen->blackPixel, CURSORWIDTH*CURSORHEIGHT );
- memset( newCursor->mask, 0, CURSORWIDTH*CURSORHEIGHT );
-
- // convert to 8-bit Darwin cursor format
- oldSourceP = (CARD32 *) pCursor->bits->source;
- oldMaskP = (CARD32 *) pCursor->bits->mask;
- newSourceP = newCursor->image;
- newMaskP = newCursor->mask;
- rowPad = CURSORWIDTH - cursorWidth;
-
- for (y = 0; y < cursorHeight; y++) {
- for (x = 0; x < cursorWidth; x++) {
- if (*oldSourceP & (HighBitOf32 >> x))
- *newSourceP = fgColor.pixel;
- else
- *newSourceP = bgColor.pixel;
- if (*oldMaskP & (HighBitOf32 >> x))
- *newMaskP = 255;
- else
- *newSourceP = pScreen->blackPixel;
- newSourceP++; newMaskP++;
- }
- oldSourceP++; oldMaskP++;
- newSourceP += rowPad; newMaskP += rowPad;
- }
-
- // save the result
- pCursor->devPriv[pScreen->myNum] = (pointer) newCursor;
- return TRUE;
-}
-
-
-/*
- * DarwinRealizeCursor15
- * Convert the X cursor representation to an 15-bit depth
- * format for Darwin.
- */
-static Bool
-DarwinRealizeCursor15(
- ScreenPtr pScreen,
- CursorPtr pCursor)
-{
- unsigned short *newCursor;
- unsigned short fgPixel, bgPixel;
- unsigned short *newSourceP;
- CARD32 *oldSourceP, *oldMaskP;
- int x, y, rowPad;
- int cursorWidth, cursorHeight;
-
- // check cursor size just to be sure
- cursorWidth = pCursor->bits->width;
- cursorHeight = pCursor->bits->height;
- if (cursorHeight > CURSORHEIGHT || cursorWidth > CURSORWIDTH)
- return FALSE;
-
- // allocate memory for new cursor image
- newCursor = xalloc( CURSORWIDTH*CURSORHEIGHT*sizeof(short) );
- if (!newCursor)
- return FALSE;
- memset( newCursor, 0, CURSORWIDTH*CURSORHEIGHT*sizeof(short) );
-
- // calculate pixel values
- fgPixel = RGBto34WithGamma( pCursor->foreRed, pCursor->foreGreen,
- pCursor->foreBlue );
- bgPixel = RGBto34WithGamma( pCursor->backRed, pCursor->backGreen,
- pCursor->backBlue );
-
- // convert to 15-bit Darwin cursor format
- oldSourceP = (CARD32 *) pCursor->bits->source;
- oldMaskP = (CARD32 *) pCursor->bits->mask;
- newSourceP = newCursor;
- rowPad = CURSORWIDTH - cursorWidth;
-
- for (y = 0; y < cursorHeight; y++) {
- for (x = 0; x < cursorWidth; x++) {
- if (*oldMaskP & (HighBitOf32 >> x)) {
- if (*oldSourceP & (HighBitOf32 >> x))
- *newSourceP = fgPixel;
- else
- *newSourceP = bgPixel;
- } else {
- *newSourceP = 0;
- }
- newSourceP++;
- }
- oldSourceP++; oldMaskP++;
- newSourceP += rowPad;
- }
-
-#if DUMP_DARWIN_CURSOR
- // Write out the cursor
- ErrorF("Cursor: 0x%x\n", pCursor);
- ErrorF("Width = %i, Height = %i, RowPad = %i\n", cursorWidth,
- cursorHeight, rowPad);
- for (y = 0; y < cursorHeight; y++) {
- newSourceP = newCursor + y*CURSORWIDTH;
- for (x = 0; x < cursorWidth; x++) {
- if (*newSourceP == fgPixel)
- ErrorF("x");
- else if (*newSourceP == bgPixel)
- ErrorF("o");
- else
- ErrorF(" ");
- newSourceP++;
- }
- ErrorF("\n");
- }
-#endif
-
- // save the result
- pCursor->devPriv[pScreen->myNum] = (pointer) newCursor;
- return TRUE;
-}
-
-
-/*
- * DarwinRealizeCursor24
- * Convert the X cursor representation to an 24-bit depth
- * format for Darwin. This function assumes the maximum cursor
- * width is a multiple of 8.
- */
-static Bool
-DarwinRealizeCursor24(
- ScreenPtr pScreen,
- CursorPtr pCursor)
-{
- unsigned int *newCursor;
- unsigned int fgPixel, bgPixel;
- unsigned int *newSourceP;
- CARD32 *oldSourceP, *oldMaskP;
- int x, y, rowPad;
- int cursorWidth, cursorHeight;
-
- // check cursor size just to be sure
- cursorWidth = pCursor->bits->width;
- cursorHeight = pCursor->bits->height;
- if (cursorHeight > CURSORHEIGHT || cursorWidth > CURSORWIDTH)
- return FALSE;
-
- // allocate memory for new cursor image
- newCursor = xalloc( CURSORWIDTH*CURSORHEIGHT*sizeof(int) );
- if (!newCursor)
- return FALSE;
- memset( newCursor, 0, CURSORWIDTH*CURSORHEIGHT*sizeof(int) );
-
- // calculate pixel values
- fgPixel = RGBto38WithGamma( pCursor->foreRed, pCursor->foreGreen,
- pCursor->foreBlue );
- bgPixel = RGBto38WithGamma( pCursor->backRed, pCursor->backGreen,
- pCursor->backBlue );
-
- // convert to 24-bit Darwin cursor format
- oldSourceP = (CARD32 *) pCursor->bits->source;
- oldMaskP = (CARD32 *) pCursor->bits->mask;
- newSourceP = newCursor;
- rowPad = CURSORWIDTH - cursorWidth;
-
- for (y = 0; y < cursorHeight; y++) {
- for (x = 0; x < cursorWidth; x++) {
- if (*oldMaskP & (HighBitOf32 >> x)) {
- if (*oldSourceP & (HighBitOf32 >> x))
- *newSourceP = fgPixel;
- else
- *newSourceP = bgPixel;
- } else {
- *newSourceP = 0;
- }
- newSourceP++;
- }
- oldSourceP++; oldMaskP++;
- newSourceP += rowPad;
- }
-
-#if DUMP_DARWIN_CURSOR
- // Write out the cursor
- ErrorF("Cursor: 0x%x\n", pCursor);
- ErrorF("Width = %i, Height = %i, RowPad = %i\n", cursorWidth,
- cursorHeight, rowPad);
- for (y = 0; y < cursorHeight; y++) {
- newSourceP = newCursor + y*CURSORWIDTH;
- for (x = 0; x < cursorWidth; x++) {
- if (*newSourceP == fgPixel)
- ErrorF("x");
- else if (*newSourceP == bgPixel)
- ErrorF("o");
- else
- ErrorF(" ");
- newSourceP++;
- }
- ErrorF("\n");
- }
-#endif
-
- // save the result
- pCursor->devPriv[pScreen->myNum] = (pointer) newCursor;
- return TRUE;
-}
-
-
-/*
- * DarwinRealizeCursor
- *
- */
-static Bool
-DarwinRealizeCursor(
- ScreenPtr pScreen,
- CursorPtr pCursor)
-{
- Bool result;
- DarwinCursorScreenPtr ScreenPriv = (DarwinCursorScreenPtr)
- pScreen->devPrivates[darwinCursorScreenIndex].ptr;
-
- if ((pCursor->bits->height > CURSORHEIGHT) ||
- (pCursor->bits->width > CURSORWIDTH) ||
- // FIXME: this condition is not needed after kernel cursor works
- !ScreenPriv->canHWCursor) {
- result = (*ScreenPriv->spriteFuncs->RealizeCursor)(pScreen, pCursor);
- } else if (dfb.bitsPerPixel == 8) {
- result = DarwinRealizeCursor8(pScreen, pCursor);
- } else if (dfb.bitsPerPixel == 16) {
- result = DarwinRealizeCursor15(pScreen, pCursor);
- } else {
- result = DarwinRealizeCursor24(pScreen, pCursor);
- }
-
- return result;
-}
-
-
-/*
- * DarwinUnrealizeCursor
- *
- */
-static Bool
-DarwinUnrealizeCursor(
- ScreenPtr pScreen,
- CursorPtr pCursor)
-{
- Bool result;
- DarwinCursorScreenPtr ScreenPriv = (DarwinCursorScreenPtr)
- pScreen->devPrivates[darwinCursorScreenIndex].ptr;
-
- if ((pCursor->bits->height > CURSORHEIGHT) ||
- (pCursor->bits->width > CURSORWIDTH) ||
- // FIXME: this condition is not needed after kernel cursor works
- !ScreenPriv->canHWCursor) {
- result = (*ScreenPriv->spriteFuncs->UnrealizeCursor)(pScreen, pCursor);
- } else {
- xfree( pCursor->devPriv[pScreen->myNum] );
- result = TRUE;
- }
-
- return result;
-}
-
-
-/*
- * DarwinSetCursor
- * Set the cursor sprite and position
- * Use hardware cursor if possible
- */
-static void
-DarwinSetCursor(
- ScreenPtr pScreen,
- CursorPtr pCursor,
- int x,
- int y)
-{
- kern_return_t kr;
- StdFBShmem_t *cshmem = dfb.cursorShmem;
- DarwinCursorScreenPtr ScreenPriv = (DarwinCursorScreenPtr)
- pScreen->devPrivates[darwinCursorScreenIndex].ptr;
-
- // are we supposed to remove the cursor?
- if (!pCursor) {
- if (ScreenPriv->cursorMode == 0)
- (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, 0, x, y);
- else {
- if (!cshmem->cursorShow) {
- cshmem->cursorShow++;
- if (cshmem->hardwareCursorActive) {
- kr = IOFBSetCursorVisible(dfb.fbService, FALSE);
- kern_assert( kr );
- }
- }
- }
- return;
- }
-
- // can we use the kernel or hardware cursor?
- if ((pCursor->bits->height <= CURSORHEIGHT) &&
- (pCursor->bits->width <= CURSORWIDTH) &&
- // FIXME: condition not needed when kernel cursor works
- ScreenPriv->canHWCursor) {
-
- if (ScreenPriv->cursorMode == 0) // remove the X cursor
- (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, 0, x, y);
- ScreenPriv->cursorMode = 1; // kernel cursor
-
- // change the cursor image in shared memory
- if (dfb.bitsPerPixel == 8) {
- cursorPrivPtr newCursor =
- (cursorPrivPtr) pCursor->devPriv[pScreen->myNum];
- memcpy(cshmem->cursor.bw8.image[0], newCursor->image,
- CURSORWIDTH*CURSORHEIGHT);
- memcpy(cshmem->cursor.bw8.mask[0], newCursor->mask,
- CURSORWIDTH*CURSORHEIGHT);
- } else if (dfb.bitsPerPixel == 16) {
- unsigned short *newCursor =
- (unsigned short *) pCursor->devPriv[pScreen->myNum];
- memcpy(cshmem->cursor.rgb.image[0], newCursor,
- 2*CURSORWIDTH*CURSORHEIGHT);
- } else {
- unsigned int *newCursor =
- (unsigned int *) pCursor->devPriv[pScreen->myNum];
- memcpy(cshmem->cursor.rgb24.image[0], newCursor,
- 4*CURSORWIDTH*CURSORHEIGHT);
- }
-
- // FIXME: We always use a full size cursor, even if the image
- // is smaller because I couldn't get the padding to come out
- // right otherwise.
- cshmem->cursorSize[0].width = CURSORWIDTH;
- cshmem->cursorSize[0].height = CURSORHEIGHT;
- cshmem->hotSpot[0].x = pCursor->bits->xhot;
- cshmem->hotSpot[0].y = pCursor->bits->yhot;
-
- // try to use a hardware cursor
- if (ScreenPriv->canHWCursor) {
- kr = IOFBSetNewCursor(dfb.fbService, 0, 0, 0);
- // FIXME: this is a fatal error without the kernel cursor
- kern_assert( kr );
-#if 0
- if (kr != KERN_SUCCESS) {
- ErrorF("Could not set new cursor with kernel return 0x%x.\n", kr);
- ScreenPriv->canHWCursor = FALSE;
- }
-#endif
- }
-
- // make the new cursor visible
- if (cshmem->cursorShow)
- cshmem->cursorShow--;
-
- if (!cshmem->cursorShow && ScreenPriv->canHWCursor) {
- kr = IOFBSetCursorVisible(dfb.fbService, TRUE);
- // FIXME: this is a fatal error without the kernel cursor
- kern_assert( kr );
-#if 0
- if (kr != KERN_SUCCESS) {
- ErrorF("Couldn't set hardware cursor visible with kernel return 0x%x.\n", kr);
- ScreenPriv->canHWCursor = FALSE;
- } else
-#endif
- ScreenPriv->cursorMode = 2; // hardware cursor
- }
-
- return;
- }
-
- // otherwise we use a software cursor
- if (ScreenPriv->cursorMode) {
- /* remove the kernel or hardware cursor */
- DarwinSetCursor(pScreen, 0, x, y);
- }
-
- ScreenPriv->cursorMode = 0;
- (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, pCursor, x, y);
-}
-
-
-/*
- * DarwinMoveCursor
- * Move the cursor. This is a noop for a kernel or hardware cursor.
- */
-static void
-DarwinMoveCursor(
- ScreenPtr pScreen,
- int x,
- int y)
-{
- DarwinCursorScreenPtr ScreenPriv = (DarwinCursorScreenPtr)
- pScreen->devPrivates[darwinCursorScreenIndex].ptr;
-
- // only the X cursor needs to be explicitly moved
- if (!ScreenPriv->cursorMode)
- (*ScreenPriv->spriteFuncs->MoveCursor)(pScreen, x, y);
-}
-
-static miPointerSpriteFuncRec darwinSpriteFuncsRec = {
- DarwinRealizeCursor,
- DarwinUnrealizeCursor,
- DarwinSetCursor,
- DarwinMoveCursor
-};
-
-
-/*
-===========================================================================
-
- Pointer screen functions
-
-===========================================================================
-*/
-
-/*
- * DarwinCursorOffScreen
- */
-static Bool DarwinCursorOffScreen(ScreenPtr *pScreen, int *x, int *y)
-{ return FALSE;
-}
-
-
-/*
- * DarwinCrossScreen
- */
-static void DarwinCrossScreen(ScreenPtr pScreen, Bool entering)
-{ return;
-}
-
-
-/*
- * DarwinWarpCursor
- * Change the cursor position without generating an event or motion history
- */
-static void
-DarwinWarpCursor(
- ScreenPtr pScreen,
- int x,
- int y)
-{
- kern_return_t kr;
-
- kr = IOHIDSetMouseLocation( dfb.hidService, x, y );
- if (kr != KERN_SUCCESS) {
- ErrorF("Could not set cursor position with kernel return 0x%x.\n", kr);
- }
- miPointerWarpCursor(pScreen, x, y);
-}
-
-static miPointerScreenFuncRec darwinScreenFuncsRec = {
- DarwinCursorOffScreen,
- DarwinCrossScreen,
- DarwinWarpCursor,
-};
-
-
-/*
-===========================================================================
-
- Other screen functions
-
-===========================================================================
-*/
-
-/*
- * DarwinCursorQueryBestSize
- * Handle queries for best cursor size
- */
-static void
-DarwinCursorQueryBestSize(
- int class,
- unsigned short *width,
- unsigned short *height,
- ScreenPtr pScreen)
-{
- DarwinCursorScreenPtr ScreenPriv = (DarwinCursorScreenPtr)
- pScreen->devPrivates[darwinCursorScreenIndex].ptr;
-
- if (class == CursorShape) {
- *width = CURSORWIDTH;
- *height = CURSORHEIGHT;
- } else
- (*ScreenPriv->QueryBestSize)(class, width, height, pScreen);
-}
-
-
-/*
- * DarwinInitCursor
- * Initialize cursor support
- */
-Bool
-DarwinInitCursor(
- ScreenPtr pScreen)
-{
- DarwinCursorScreenPtr ScreenPriv;
- miPointerScreenPtr PointPriv;
- kern_return_t kr;
-
- // start with no cursor displayed
- if (!dfb.cursorShmem->cursorShow++) {
- if (dfb.cursorShmem->hardwareCursorActive) {
- kr = IOFBSetCursorVisible(dfb.fbService, FALSE);
- kern_assert( kr );
- }
- }
-
- // initialize software cursor handling (always needed as backup)
- if (!miDCInitialize(pScreen, &darwinScreenFuncsRec)) {
- return FALSE;
- }
-
- // allocate private storage for this screen's hardware cursor info
- if (darwinCursorGeneration != serverGeneration) {
- if ((darwinCursorScreenIndex = AllocateScreenPrivateIndex()) < 0)
- return FALSE;
- darwinCursorGeneration = serverGeneration;
- }
-
- ScreenPriv = xcalloc( 1, sizeof(DarwinCursorScreenRec) );
- if (!ScreenPriv) return FALSE;
-
- pScreen->devPrivates[darwinCursorScreenIndex].ptr = (pointer) ScreenPriv;
-
- // check if a hardware cursor is supported
- if (!dfb.cursorShmem->hardwareCursorCapable) {
- ScreenPriv->canHWCursor = FALSE;
- ErrorF("Hardware cursor not supported.\n");
- } else {
- // we need to make sure that the hardware cursor really works
- ScreenPriv->canHWCursor = TRUE;
- kr = IOFBSetNewCursor(dfb.fbService, 0, 0, 0);
- if (kr != KERN_SUCCESS) {
- ErrorF("Could not set hardware cursor with kernel return 0x%x.\n", kr);
- ScreenPriv->canHWCursor = FALSE;
- }
- kr = IOFBSetCursorVisible(dfb.fbService, TRUE);
- if (kr != KERN_SUCCESS) {
- ErrorF("Couldn't set hardware cursor visible with kernel return 0x%x.\n", kr);
- ScreenPriv->canHWCursor = FALSE;
- }
- IOFBSetCursorVisible(dfb.fbService, FALSE);
- }
-
- ScreenPriv->cursorMode = 0;
- ScreenPriv->pInstalledMap = NULL;
-
- // override some screen procedures
- ScreenPriv->QueryBestSize = pScreen->QueryBestSize;
- pScreen->QueryBestSize = DarwinCursorQueryBestSize;
-// ScreenPriv->ConstrainCursor = pScreen->ConstrainCursor;
-// pScreen->ConstrainCursor = DarwinConstrainCursor;
-
- // initialize hardware cursor handling
- PointPriv = (miPointerScreenPtr)
- pScreen->devPrivates[miPointerScreenIndex].ptr;
-
- ScreenPriv->spriteFuncs = PointPriv->spriteFuncs;
- PointPriv->spriteFuncs = &darwinSpriteFuncsRec;
-
- /* Other routines that might be overridden */
-/*
- CursorLimitsProcPtr CursorLimits;
- RecolorCursorProcPtr RecolorCursor;
-*/
-
- return TRUE;
-}
diff --git a/xc/programs/Xserver/hw/kdrive/vesa/Xvesa.man b/xc/programs/Xserver/hw/kdrive/vesa/Xvesa.man
index 7c046733e..0c1b95215 100644
--- a/xc/programs/Xserver/hw/kdrive/vesa/Xvesa.man
+++ b/xc/programs/Xserver/hw/kdrive/vesa/Xvesa.man
@@ -1,5 +1,5 @@
-.\" $XFree86: xc/programs/Xserver/hw/kdrive/vesa/Xvesa.man,v 1.4 2000/12/01 00:01:32 keithp Exp $
-.TH Xvesa 1
+.\" $XFree86: xc/programs/Xserver/hw/kdrive/vesa/Xvesa.man,v 1.6 2001/01/27 18:20:40 dawes Exp $
+.TH Xvesa 1 __vendorversion__
.SH NAME
Xvesa \- VESA Bios Extensions tiny X server
.SH SYNOPSIS
@@ -78,7 +78,7 @@ the display will almost certainly be trashed. The alternative of saving and
restoring the complete video card state has proven unreliable on most video
cards.
.SH SEE ALSO
-X(1), Xserver(1), Xkdrive(1), xdm(1), xinit(1).
+X(__miscmansuffix__), Xserver(1), Xkdrive(1), xdm(1), xinit(1).
.SH AUTHORS
The VESA driver was written by Juliusz Chroboczek who didn't realise
what he was doing until it was too late. Keith Packard then added
diff --git a/xc/programs/Xserver/hw/vfb/Xvfb.cpp b/xc/programs/Xserver/hw/vfb/Xvfb.man
index a9e27560b..ec35a8932 100644
--- a/xc/programs/Xserver/hw/vfb/Xvfb.cpp
+++ b/xc/programs/Xserver/hw/vfb/Xvfb.man
@@ -1,4 +1,4 @@
-.\" $TOG: Xvfb.man /main/12 1998/02/10 13:24:06 kaleb $
+.\" $Xorg: Xvfb.man,v 1.3 2000/08/17 19:48:39 cpqbld Exp $
.\" Copyright 1993, 1998 The Open Group
.\"
.\" All Rights Reserved.
@@ -19,9 +19,9 @@
.\" other dealings in this Software without prior written authorization
.\" from The Open Group.
.\"
-.\" $XFree86: xc/programs/Xserver/hw/vfb/Xvfb.cpp,v 1.2 2000/12/12 18:06:51 dawes Exp $
+.\" $XFree86: xc/programs/Xserver/hw/vfb/Xvfb.man,v 1.8 2001/02/07 23:25:55 dawes Exp $
.\"
-.TH XVFB 1 "Release 6.4" "X Version 11"
+.TH XVFB 1 __xorgversion__
.SH NAME
Xvfb \- virtual framebuffer X server for X Version 11
.SH SYNOPSIS
@@ -45,9 +45,9 @@ that don't really need an X server but insist on having one anyway.
.SH BUILDING
To build \fIXvfb\fP, put the following in your host.def and remake.
.PP
-#define BuildServer YES /* if you aren't already building other servers */
+\&#define BuildServer YES /* if you aren't already building other servers */
.br
-#define XVirtualFramebufferServer YES
+\&#define XVirtualFramebufferServer YES
.SH OPTIONS
.PP
diff --git a/xc/programs/Xserver/hw/xfree86/XF86Config.cpp b/xc/programs/Xserver/hw/xfree86/XF86Config.cpp
deleted file mode 100644
index 68415366f..000000000
--- a/xc/programs/Xserver/hw/xfree86/XF86Config.cpp
+++ /dev/null
@@ -1,1607 +0,0 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/XF86Config.cpp,v 1.13 2000/12/11 20:18:01 dawes Exp $
-.\" shorthand for double quote that works everywhere.
-.ds q \N'34'
-.TH XF86Config __filemansuffix__ "Version 4.0.2" "XFree86"
-.SH NAME
-XF86Config - Configuration File for XFree86
-.SH DESCRIPTION
-.I XFree86
-uses a configuration file called
-.B XF86Config
-for its initial setup. This configuration file is searched for in the
-following places when the server is started as a normal user:
-.PP
-.RS 4
-.nf
-.RI /etc/X11/ <cmdline>
-.RI __projectroot__/etc/X11/ <cmdline>
-.RB /etc/X11/ $XF86CONFIG
-.RB __projectroot__/etc/X11/ $XF86CONFIG
-/etc/X11/XF86Config-4
-/etc/X11/XF86Config
-/etc/XF86Config
-.RI __projectroot__/etc/X11/XF86Config. <hostname>
-__projectroot__/etc/X11/XF86Config-4
-__projectroot__/etc/X11/XF86Config
-.RI __projectroot__/lib/X11/XF86Config. <hostname>
-__projectroot__/lib/X11/XF86Config-4
-__projectroot__/lib/X11/XF86Config
-.fi
-.RE
-.PP
-where
-.I <cmdline>
-is a relative path (with no ".." components) specified with the
-.B \-xf86config
-command line option,
-.B $XF86CONFIG
-is the relative path (with no ".." components) specified by that
-environment variable, and
-.I <hostname>
-is the machines hostname as reported by gethostname(3).
-.PP
-When the X server is started by the "root" user, the config file search
-locations are as follows:
-.PP
-.RS 4
-.nf
-.I <cmdline>
-.RI /etc/X11/ <cmdline>
-.RI __projectroot__/etc/X11/ <cmdline>
-.B $XF86CONFIG
-.RB /etc/X11/ $XF86CONFIG
-.RB __projectroot__/etc/X11/ $XF86CONFIG
-.BR $HOME /XF86Config
-/etc/X11/XF86Config-4
-/etc/X11/XF86Config
-/etc/XF86Config
-.RI __projectroot__/etc/X11/XF86Config. <hostname>
-__projectroot__/etc/X11/XF86Config-4
-__projectroot__/etc/X11/XF86Config
-.RI __projectroot__/lib/X11/XF86Config. <hostname>
-__projectroot__/lib/X11/XF86Config-4
-__projectroot__/lib/X11/XF86Config
-.fi
-.RE
-.PP
-where
-.I <cmdline>
-is the path specified with the
-.B \-xf86config
-command line option (which may be absolute or relative),
-.B $XF86CONFIG
-is the path specified by that
-environment variable (absolute or relative),
-.B $HOME
-is the path specified by that environment variable (usually the home
-directory), and
-.I <hostname>
-is the machines hostname as reported by gethostname(3).
-.PP
-The
-.B XF86Config
-file is composed of a number of sections which may be present in any
-order. Each section has
-the form:
-.PP
-.RS 4
-.nf
-.\" Some man macros don't handle quotes in .BI, etc very well
-.\" \fBSection "\fP\fISectionName\fP\fB"\fP
-.BI "Section \*q" SectionName \*q
-.RI " " SectionEntry
- ...
-.B EndSection
-.fi
-.RE
-.PP
-The section names are:
-.PP
-.RS 4
-.nf
-.BR "Files " "File pathnames"
-.BR "ServerFlags " "Server flags"
-.BR "Module " "Dynamic module loading"
-.BR "InputDevice " "Input device description"
-.BR "Device " "Graphics device description"
-.BR "VideoAdaptor " "Xv video adaptor description"
-.BR "Monitor " "Monitor description"
-.BR "Modes " "Video modes descriptions"
-.BR "Screen " "Screen configuration"
-.BR "ServerLayout " "Overall layout"
-.BR "DRI " "DRI-specific configuration"
-.BR "Vendor " "Vendor-specific configuration"
-.fi
-.RE
-.PP
-The following obsolete section names are still recognised for compatibility
-purposes. In new config files, the
-.B InputDevice
-section should be used instead.
-.PP
-.RS 4
-.nf
-.BR "Keyboard " "Keyboard configuration"
-.BR "Pointer " "Pointer/mouse configuration"
-.fi
-.RE
-.PP
-The old
-.B XInput
-section is no longer recognised.
-.PP
-The
-.B ServerLayout
-sections are at the highest level. They bind together the input and
-output devices that will be used in a session. The input devices
-are described in the
-.B InputDevice
-sections. Output devices usually consist of multiple independent
-components (e.g., and graphics board and a monitor). These multiple
-components are bound together in the
-.B Screen
-sections, and it is these that are referenced by the
-.B ServerLayout
-section. Each
-.B Screen
-section binds together a graphics board and a monitor. The graphics
-boards are described in the
-.B Device
-sections, and the monitors are described in the
-.B Monitor
-sections.
-.PP
-Config file keywords are case-insensitive, and "_" characters are
-ignored. Most strings (including
-.B Option
-names) are also case-insensitive, and insensitive to white space and
-"_" characters.
-.PP
-Each config file entry usually take up a single line in the file.
-They consist of a keyword, which is possibly followed by one or
-more arguments, with the number and types of the arguments depending
-on the keyword. The argument types are:
-.PP
-.RS 4
-.nf
-.BR "Integer " "an integer number in decimal, hex or octal"
-.BR "Real " "a floating point number"
-.BR "String " "a string enclosed in double quote marks (\*q)"
-.fi
-.RE
-.PP
-Note: hex integer values must be prefixed with "0x", and octal values
-with "0".
-.PP
-A special keyword called
-.B Option
-may be used to provide free-form data to various components of the server.
-The
-.B Option
-keyword takes either one or two string arguments. The first is the option
-name, and the optional second argument is the option value. Some commonly
-used option value types include:
-.PP
-.RS 4
-.nf
-.BR "Integer " "an integer number in decimal, hex or octal"
-.BR "Real " "a floating point number"
-.BR "String " "a sequence of characters"
-.BR "Boolean " "a boolean value (see below)"
-.BR "Frequency " "a frequency value (see below)"
-.fi
-.RE
-.PP
-Note that
-.I all
-.B Option
-values, not just strings, must be enclosed in quotes.
-.PP
-Boolean options may optionally have a value specified. When no value
-is specified, the option's value is
-.BR TRUE .
-The following boolean option values are recognised as
-.BR TRUE :
-.PP
-.RS 4
-.BR 1 ,
-.BR on ,
-.BR true ,
-.B yes
-.RE
-.PP
-and the following boolean option values are recognised as
-.BR FALSE :
-.PP
-.RS 4
-.BR 0 ,
-.BR off ,
-.BR false ,
-.B no
-.RE
-.PP
-If an option name is prefixed with
-.RB \*q No \*q,
-then the option value is negated.
-.PP
-Example: the following option entries are equivalent:
-.PP
-.RS 4
-.nf
-.B "Option \*qAccel\*q \*qOff\*q"
-.B "Option \*qNoAccel\*q"
-.B "Option \*qNoAccel\*q \*qOn\*q"
-.B "Option \*qAccel\*q \*qfalse\*q"
-.B "Option \*qAccel\*q \*qno\*q"
-.fi
-.RE
-.PP
-Frequency option values consist of a real number that is optionally
-followed by one of the following frequency units:
-.PP
-.RS 4
-.BR Hz ,
-.BR k ,
-.BR kHz ,
-.BR M ,
-.B MHz
-.RE
-.PP
-When the unit name is omitted, the correct units will be determined from
-the value and the expectations of the appropriate range of the value.
-It is recommended that the units always be specified when using frequency
-option values to avoid any errors in determining the value.
-.SH FILES SECTION
-The
-.B Files
-section is used to specify some path names required by the server.
-Some of these paths can also be set from the command line (see
-.I Xserver(1)
-and
-.IR XFree86(1) ).
-The command line settings override the values specified in the config
-file.
-The entries that can appear in this section are:
-.TP 7
-.BI "FontPath \*q" path \*q
-sets the search path for fonts. This path is a comma separated
-list of font path elements which the X server searches for font databases.
-Multiple
-.B FontPath
-entries may be specified, and they will be
-concatenated to build up the fontpath used by the server.
-Font path elements may be either absolute directory paths, or
-a font server identifier. Font server identifiers have the form:
-.PP
-.RS 11
-.IR <trans> / <hostname> : <port-number>
-.RE
-.PP
-.RS 7
-where
-.I <trans>
-is the transport type to use to connect to the font server (e.g.,
-.B unix
-for UNIX-domain sockets or
-.B tcp
-for a TCP/IP connection),
-.I <hostname>
-is the hostname of the machine running the font server, and
-.I <port-number>
-is the port number that the font server is listening on (usually 7100).
-.PP
-When this entry is not specified in the config file, the server falls back
-to the compiled-in default font path, which contains the following
-font path elements:
-.PP
-.RS 4
-.nf
-__projectroot__/lib/X11/fonts/misc/
-__projectroot__/lib/X11/fonts/Speedo/
-__projectroot__/lib/X11/fonts/Type1/
-__projectroot__/lib/X11/fonts/CID/
-__projectroot__/lib/X11/fonts/75dpi/
-__projectroot__/lib/X11/fonts/100dpi/
-.fi
-.RE
-.PP
-The recommended font path contains the following font path elements:
-.PP
-.RS 4
-.nf
-__projectroot__/lib/X11/fonts/local/
-__projectroot__/lib/X11/fonts/misc/
-__projectroot__/lib/X11/fonts/75dpi/:unscaled
-__projectroot__/lib/X11/fonts/100dpi/:unscaled
-__projectroot__/lib/X11/fonts/Type1/
-__projectroot__/lib/X11/fonts/CID/
-__projectroot__/lib/X11/fonts/Speedo/
-__projectroot__/lib/X11/fonts/75dpi/
-__projectroot__/lib/X11/fonts/100dpi/
-.fi
-.RE
-.PP
-Font path elements that are found to be invalid are removed from the
-font path when the server starts up.
-.RE
-.TP 7
-.BI "RGBPath \*q" path \*q
-sets the path name for the RGB color database.
-When this entry is not specified in the config file, the server falls back
-to the compiled-in default RGB path, which is:
-.PP
-.RS 11
-__projectroot__/lib/X11/rgb
-.RE
-.TP 7
-.BI "ModulePath \*q" path \*q
-sets the search path for loadable X server modules. This path is a
-comma separated list of directories which the X server searches for
-loadable modules loading in the order specified. Multiple
-.B ModulePath
-entries may be specified, and they will be concatenated to build the
-module search path used by the server.
-.\" The LogFile keyword is not currently implemented
-.ig
-.TP 7
-.BI "LogFile \*q" path \*q
-sets the name of the X server log file. The default log file name is
-.PP
-.RS 11
-.RI __logdir__/XFree86. <n> .log
-.RE
-.PP
-.RS 7
-where
-.I <n>
-is the display number for the X server.
-..
-.SH SERVERFLAGS SECTION
-The
-.B ServerFlags
-section is used to specify some global
-X server options. All of the entries in this section are
-.BR Options ,
-although for compatibility purposes some of the old style entries are
-still recognised. Those old style entries are not documented here, and
-using them is discouraged.
-.PP
-.B Options
-specified in this section may be overridden by
-.B Options
-specified in the active
-.B ServerLayout
-section. Options with command line equivalents are overridden when their
-command line equivalent is used. The options recognised by this section
-are:
-.TP 7
-.BI "Option \*qNoTrapSignals\*q \*q" boolean \*q
-This prevents the X server from trapping a range of unexpected
-fatal signals and exiting cleanly. Instead, the X server will die
-and drop core where the fault occurred. The default behaviour is
-for the X server exit cleanly, but still drop a core file. In
-general you never want to use this option unless you are debugging
-an X server problem and know how to deal with the consequences.
-.TP 7
-.BI "Option \*qDontZap\*q \*q" boolean \*q
-This disallows the use of the
-.B Ctrl+Alt+Backspace
-sequence. That sequence is normally used to terminate the X server.
-When this option is enabled, that key sequence has no special meaning
-and is passed to clients. Default: off.
-.TP 7
-.BI "Option \*qDontZoom\*q \*q" boolean \*q
-This disallows the use of the
-.B Ctrl+Alt+Keypad-Plus
-and
-.B Ctrl+Alt+Keypad-Minus
-sequences. These sequences allows you to switch between video modes.
-When this option is enabled, those key sequences have no special meaning
-and are passed to clients. Default: off.
-.TP 7
-.BI "Option \*qDisableVidModeExtension\*q \*q" boolean \*q
-This disables the parts of the VidMode extension used by the xvidtune client
-that can be used to change the video modes. Default: the VidMode extension
-is enabled.
-.TP 7
-.BI "Option \*qAllowNonLocalXvidtune\*q \*q" boolean \*q
-This allows the xvidtune client (and other clients that use the VidMode
-extension) to connect from another host. Default: off.
-.TP 7
-.BI "Option \*qDisableModInDev\*q \*q" boolean \*q
-This disables the parts of the XFree86-Misc extension that can be used to
-modify the input device settings dynamically. Default: that functionality
-is enabled.
-.TP 7
-.BI "Option \*qAllowNonLocalModInDev\*q \*q" boolean \*q
-This allows a client to connect from another host and change keyboard
-and mouse settings in the running server. Default: off.
-.TP 7
-.BI "Option \*qAllowMouseOpenFail\*q \*q" boolean \*q
-This allows the server to start up even if the mouse device can't be
-opened/initialised. Default: false.
-.TP 7
-.BI "Option \*qVTInit\*q \*q" command \*q
-Runs
-.I command
-after the VT used by the server has been opened.
-The command string is passed to "/bin/sh -c", and is run with the
-real user's id with stdin and stdout set to the VT. The purpose
-of this option is to allow system dependent VT initialisation
-commands to be run. This option should rarely be needed. Default: not set.
-.TP 7
-.BI "Option \*qVTSysReq\*q \*q" boolean \*q
-enables the SYSV-style VT switch sequence for non-SYSV systems
-which support VT switching. This sequence is
-.B Alt-SysRq
-followed
-by a function key
-.RB ( Fn ).
-This prevents the X server trapping the
-keys used for the default VT switch sequence, which means that clients can
-access them. Default: off.
-.\" The following four options are "undocumented".
-.ig
-.TP 7
-.BI "Option \*qPciProbe1\*q"
-Use PCI probe method 1. Default: set.
-.TP 7
-.BI "Option \*qPciProbe2\*q"
-Use PCI probe method 2. Default: not set.
-.TP 7
-.BI "Option \*qPciForceConfig1\*q"
-Force the use PCI config type 1. Default: not set.
-.TP 7
-.BI "Option \*qPciForceConfig2\*q"
-Force the use PCI config type 2. Default: not set.
-..
-.TP 7
-.BI "Option \*qBlankTime\*q \*q" time \*q
-sets the inactivity timeout for the blanking phase of the screensaver.
-.I time
-is in minutes. This is equivalent to the Xserver's `-s' flag, and the
-value can be changed at run-time with \fIxset(1)\fP. Default: 10 minutes.
-.TP 7
-.BI "Option \*qStandbyTime\*q \*q" time \*q
-sets the inactivity timeout for the "standby" phase of DPMS mode.
-.I time
-is in minutes, and the value can be changed at run-time with \fIxset(1)\fP.
-Default: 20 minutes.
-This is only suitable for VESA DPMS compatible monitors, and may not be
-supported by all video drivers. It is only enabled for screens that
-have the
-.B \*qDPMS\*q
-option set (see the MONITOR section below).
-.TP 7
-.BI "Option \*qSuspendTime\*q \*q" time \*q
-sets the inactivity timeout for the "suspend" phase of DPMS mode.
-.I time
-is in minutes, and the value can be changed at run-time with \fIxset(1)\fP.
-Default: 30 minutes.
-This is only suitable for VESA DPMS compatible monitors, and may not be
-supported by all video drivers. It is only enabled for screens that
-have the
-.B \*qDPMS\*q
-option set (see the MONITOR section below).
-.TP 7
-.BI "Option \*qOffTime\*q \*q" time \*q
-sets the inactivity timeout for the "off" phase of DPMS mode.
-.I time
-is in minutes, and the value can be changed at run-time with \fIxset(1)\fP.
-Default: 40 minutes.
-This is only suitable for VESA DPMS compatible monitors, and may not be
-supported by all video drivers. It is only enabled for screens that
-have the
-.B \*qDPMS\*q
-option set (see the MONITOR section below).
-.TP 7
-.BI "Option \*qPixmap\*q \*q" bpp \*q
-This sets the pixmap format to use for depth 24. Allowed values for
-.I bpp
-are 24 and 32. Default: 32 unless driver constraints don't allow this
-(which is rare). Note: some clients don't behave well when
-this value is set to 24.
-.TP 7
-.BI "Option \*qPC98\*q \*q" boolean \*q
-Specify that the machine is a Japanese PC-98 machine. This should not
-be enabled for anything other than the Japanese-specific PC-98
-architecture. Default: auto-detected.
-.\" Doubt this should be documented.
-.ig
-.TP 7
-.BI "Option \*qEstimateSizesAggressively\*q \*q" value \*q
-This option affects the way that bus resource sizes are estimated. Default: 0.
-..
-.TP 7
-.BI "Option \*qNoPM\*q \*q" boolean \*q
-Disables something to do with power management events. Default: PM enabled
-on platforms that support it.
-.TP 7
-.BI "Option \*qXinerama\*q \*q" boolean \*q
-enable or disable XINERAMA extension. Default is disabled.
-.SH MODULE SECTION
-The
-.B Module
-section is used to specify which X server modules should be loaded.
-This section is ignored when the X server is built in static form.
-The types of modules normally loaded in this section are X server
-extension modules, and font rasteriser modules. Most other module types
-are loaded automatically when they are needed via other mechanisms.
-.PP
-Entries in this section may be in two forms. The first and most commonly
-used form is an entry that uses the
-.B Load
-keyword, as described here:
-.TP 7
-.BI "Load \*q" modulename \*q
-This instructs the server to load the module called
-.IR modulename .
-The module name given should be the module's standard name, not the
-module file name. The standard name is case-sensitive, and does not
-include the "lib" prefix, or the ".a", ".o", or ".so" suffixes.
-.PP
-.RS 7
-Example: the Type 1 font rasteriser can be loaded with the following entry:
-.PP
-.RS 4
-.B "Load \*qtype1\*q"
-.RE
-.RE
-.PP
-The second form of entry is a
-.BR SubSection,
-with the subsection name being the module name, and the contents of the
-.B SubSection
-being
-.B Options
-that are passed to the module when it is loaded.
-.PP
-Example: the extmod module (which contains a miscellaneous group of
-server extensions) can be loaded, with the XFree86-DGA extension
-disabled by using the following entry:
-.PP
-.RS 4
-.nf
-.B "SubSection \*qextmod\*q"
-.B " Option \*qomit XFree86-DGA\*q"
-.B EndSubSection
-.fi
-.RE
-.PP
-Modules are searched for in each directory specified in the
-.B ModulePath
-search path, and in the drivers, input, extensions, fonts, and
-internal subdirectories of each of those directories.
-In addition to this, operating system specific subdirectories of all
-the above are searched first if they exist.
-.PP
-To see what font and extension modules are available, check the contents
-of the following directories:
-.PP
-.RS 4
-.nf
-__projectroot__/lib/modules/fonts
-__projectroot__/lib/modules/extensions
-.fi
-.RE
-.PP
-The "bitmap" font modules is loaded automatically. It is recommended
-that at very least the "extmod" extension module be loaded. If it isn't
-some commonly used server extensions (like the SHAPE extension) will not be
-available.
-.SH INPUTDEVICE SECTION
-The config file may have multiple
-.B InputDevice
-sections. There will normally be at least two: one for the core (primary)
-keyboard, and one of the core pointer.
-.PP
-.B InputDevice
-sections have the following format:
-.PP
-.RS 4
-.nf
-.B "Section \*qInputDevice\*q"
-.BI " Identifier \*q" name \*q
-.BI " Driver \*q" inputdriver \*q
-.I " options"
-.I " ..."
-.B "EndSection"
-.fi
-.RE
-.PP
-The
-.B Identifier
-entry specifies the unique name for this input device. The
-.B Driver
-entry specifies the name of the driver to use for this input device.
-When using the loadable server, the input driver module
-.RI \*q inputdriver \*q
-will be loaded for each active
-.B InputDevice
-section. An
-.B InputDevice
-section is considered active if it is referenced by an active
-.B ServerLayout
-section, or if it is referenced by the
-.B \-keyboard
-or
-.B \-pointer
-command line options.
-The most commonly used input drivers are "keyboard" and "mouse".
-.PP
-.B InputDevice
-sections recognise some driver-independent
-.BR Options ,
-which are described here. See the individual input driver manual pages
-for a description of the device-specific options.
-.TP 7
-.BI "Option \*qCorePointer\*q"
-When this is set, the input device is installed as the core (primary)
-pointer device. There must be exactly one core pointer. If this option
-is not set here, or in the
-.B ServerLayout
-section, or from the
-.B \-pointer
-command line option, then the first input device that is capable of
-being used as a core pointer will be selected as the core pointer.
-This option is implicitly set when the obsolete
-.B Pointer
-section is used.
-.TP 7
-.BI "Option \*qCoreKeyboard\*q"
-When this is set, the input device is to be installed as the core
-(primary) keyboard device. There must be exactly one core keyboard. If
-this option is not set here, in the
-.B ServerLayout
-section, or from the
-.B \-keyboard
-command line option, then the first input device that is capable of
-being used as a core keyboard will be selected as the core keyboard.
-This option is implicitly set when the obsolete
-.B Keyboard
-section is used.
-.TP 7
-.BI "Option \*qAlwaysCore\*q \*q" boolean \*q
-.TP 7
-.BI "Option \*qSendCoreEvents\*q \*q" boolean \*q
-Both of these options are equivalent, and when enabled cause the
-input device to always report core events. This can be used, for
-example, to allow an additional pointer device to generate core
-pointer events (like moving the cursor, etc).
-.TP 4
-.BI "Option \*qHistorySize\*q \*q" number \*q
-Sets the motion history size. Default: 0.
-.TP 7
-.BI "Option \*qSendDragEvents\*q \*q" boolean \*q
-???
-.SH DEVICE SECTION
-The config file may have multiple
-.B Device
-sections. There must be at least one, for the video card being used.
-.PP
-.B Device
-sections have the following format:
-.PP
-.RS 4
-.nf
-.B "Section \*qDevice\*q"
-.BI " Identifier \*q" name \*q
-.BI " Driver \*q" driver \*q
-.I " entries"
-.I " ..."
-.B "EndSection"
-.fi
-.RE
-.PP
-The
-.B Identifier
-entry specifies the unique name for this graphics device. The
-.B Driver
-entry specifies the name of the driver to use for this graphics device.
-When using the loadable server, the driver module
-.RI \*q driver \*q
-will be loaded for each active
-.B Device
-section. A
-.B Device
-section is considered active if it is referenced by an active
-.B Screen
-section.
-.PP
-.B Device
-sections recognise some driver-independent entries and
-.BR Options ,
-which are described here. Not all drivers make use of these
-driver-independent entries, and many of those that do don't require them
-to be specified because the information is auto-detected. See the
-individual graphics driver manual pages for further information about
-this, and for a description of the device-specific options.
-Note that most of the
-.B Options
-listed here (but not the other entries) may be specified in the
-.B Screen
-section instead of here in the
-.B Device
-section.
-.TP 7
-.BI "BusID \*q" bus-id \*q
-This specifies the bus location of the graphics card. For PCI/AGP cards,
-the
-.I bus-id
-string has the form
-.BI PCI: bus : device : function
-(e.g., "PCI:1:0:0" might be appropriate for an AGP card).
-This field is usually optional in single-head configurations when using
-the primary graphics card. In multi-head configurations, or when using
-a secondary graphics card in a single-head configuration, this entry is
-mandatory. Its main purpose is to make an unambiguous connection between
-the device section and the hardware it is representing. This information
-can usually be found by running the X server with the
-.B \-scanpci
-command line option.
-.TP 7
-.BI "Screen " number
-This option is mandatory for cards where a single PCI entity can drive more
-than one display (i.e., multiple CRTCs sharing a single graphics accelerator
-and video memory). One
-.B Device
-section is required for each head, and this
-parameter determines which head each of the
-.B Device
-sections applies to. The legal values of
-.I number
-range from 0 to one less than the total number of heads per entity.
-Most drivers require that the primary screen (0) be present.
-.TP 7
-.BI "Chipset \*q" chipset \*q
-This usually optional entry specifies the chipset used on the graphics
-board. In most cases this entry is not required because the drivers
-will probe the hardware to determine the chipset type. Don't
-specify it unless the driver-specific documentation recommends that you
-do.
-.TP 7
-.BI "Ramdac \*q" ramdac-type \*q
-This optional entry specifies the type of RAMDAC used on the graphics
-board. This is only used by a few of the drivers, and in most cases it
-is not required because the drivers will probe the hardware to determine
-the RAMDAC type where possible. Don't specify it unless the
-driver-specific documentation recommends that you do.
-.TP 7
-.BI "DacSpeed " speed
-.TP 7
-.BI "DacSpeed " "speed-8 speed-16 speed-24 speed-32"
-This optional entry specifies the RAMDAC speed rating (which is usually
-printed on the RAMDAC chip). The speed is in MHz. When one value is
-given, it applies to all framebuffer pixel sizes. When multiple values
-are give, they apply to the framebuffer pixel sizes 8, 16, 24 and 32
-respectively. This is not used by many drivers, and only needs to be
-specified when the speed rating of the RAMDAC is different from the
-defaults built in to driver, or when the driver can't auto-detect the
-correct defaults. Don't specify it unless the driver-specific
-documentation recommends that you do.
-.TP 7
-.BI "Clocks " "clock ..."
-specifies the pixel that are on your graphics board. The clocks are in
-MHz, and may be specified as a floating point number. The value is
-stored internally to the nearest kHz. The ordering of the clocks is
-important. It must match the order in which they are selected on the
-graphics board. Multiple
-.B Clocks
-lines may be specified, and each is concatenated to form the list. Most
-drivers do not use this entry, and it is only required for some older
-boards with non-programmable clocks. Don't specify this entry unless
-the driver-specific documentation explicitly recommends that you do.
-.TP
-.BI "ClockChip \*q" clockchip-type \*q
-This optional entry is used to specify the clock chip type on
-graphics boards which have a programmable clock generator. Only
-a few X servers support programmable clock chips. For details,
-see the appropriate X server manual page.
-.TP 7
-.BI "VideoRam " "mem"
-This optional entry specifies the amount of video ram that is installed
-on the graphics board. This is measured in kBytes. In most cases this
-is not required because the X server probes the graphics board to
-determine this quantity. The driver-specific documentation should
-indicate when it might be needed.
-.TP 7
-.BI "BiosBase " "baseaddress"
-This optional entry specifies the base address of the video BIOS
-for the VGA board. This address is normally auto-detected, and should
-only be specified if the driver-specific documentation recommends it.
-.TP 7
-.BI "MemBase " "baseaddress"
-This optional entry specifies the memory base address of a graphics
-board's linear frame buffer. This entry is not used by many drivers,
-and it should only be specified if the driver-specific documentation
-recommends it.
-.TP 7
-.BI "IOBase " "baseaddress"
-This optional entry specifies the IO base address. This entry is not
-used by many drivers, and it should only be specified if the
-driver-specific documentation recommends it.
-.TP 7
-.BI "ChipID " "id"
-This optional entry specifies a numerical ID representing the chip type.
-For PCI cards, it is usually the device ID. This can be used to override
-the auto-detection, but that should only be done when the driver-specific
-documentation recommends it.
-.TP 7
-.BI "ChipRev " "rev"
-This optional entry specifies the chip revision number. This can be
-used to override the auto-detection, but that should only be done when
-the driver-specific documentation recommends it.
-.TP 7
-.BI "TextClockFreq " "freq"
-This optional entry specifies the pixel clock frequency that is used
-for the regular text mode. The frequency is specified in MHz. This is
-rarely used.
-.ig
-.TP 7
-This optional entry allows an IRQ number to be specified.
-..
-.TP 7
-.B Options
-Option flags may be specified in the
-.B Device
-sections. These include driver-specific options and driver-independent
-options. The former are described in the driver-specific documentation.
-Some of the latter are described below in the section about the
-.B Screen
-section, and they may also be included here.
-
-.SH VIDEOADAPTOR SECTION
-Nobody wants to say how this works. Maybe nobody knows ...
-
-.SH MONITOR SECTION
-The config file may have multiple
-.B Monitor
-sections. There must be at least one, for the monitor being used.
-.PP
-.B Monitor
-sections have the following format:
-.PP
-.RS 4
-.nf
-.B "Section \*qMonitor\*q"
-.BI " Identifier \*q" name \*q
-.I " entries"
-.I " ..."
-.B "EndSection"
-.fi
-.RE
-.PP
-The
-.B Identifier
-entry specifies the unique name for this monitor. The
-.B Monitor
-section provides information about the specifications of the monitor,
-monitor-specific
-.BR Options ,
-and information about the video modes to use with the monitor. Specifying
-video modes is optional because the server now has a built-in list of
-VESA standard modes. When modes are specified explicitly in the
-.B Monitor
-section (with the
-.BR Modes ,
-.BR ModeLine ,
-or
-.B UseModes
-keywords), built-in modes with the same names are not included. Built-in
-modes with different names are, however, still implicitly included.
-.PP
-The entries that may be used in
-.B Monitor
-sections are described below.
-.TP 7
-.BI "VendorName \*q" vendor \*q
-This optional entry specifies the monitor's manufacturer.
-.TP 7
-.BI "ModelName \*q" model \*q
-This optional entry specifies the monitor's model.
-.TP 7
-.BI "HorizSync " "horizsync-range"
-gives the range(s) of horizontal sync frequencies supported by the
-monitor.
-.I horizsync-range
-may be a comma separated list of either discrete values or ranges of
-values. A range of values is two values separated by a dash. By default
-the values are in units of kHz. They may be specified in MHz or Hz if
-.B MHz
-or
-.B Hz
-is added to the end of the line. The data given here is used by the X
-server to determine if video modes are within the specifications of the
-monitor. This information should be available in the monitor's handbook.
-If this entry is omitted, a default range of 28\-33kHz is used.
-.TP 7
-.BI "VertRefresh " "vertrefresh-range"
-gives the range(s) of vertical refresh frequencies supported by the
-monitor.
-.I vertrefresh-range
-may be a comma separated list of either discrete values or ranges of
-values. A range of values is two values separated by a dash. By default
-the values are in units of Hz. They may be specified in MHz or kHz if
-.B MHz
-or
-.B kHz
-is added to the end of the line. The data given here is used by the X
-server to determine if video modes are within the specifications of the
-monitor. This information should be available in the monitor's handbook.
-If this entry is omitted, a default range of 43-72Hz is used.
-.TP 7
-.BI "Gamma " "gamma-value"
-.TP 7
-.BI "Gamma " "red-gamma green-gamma blue-gamma"
-This is an optional entry that can be used to specify the gamma
-correction for the monitor. It may be specified as either a single
-value or as three separate RGB values. The values should be in the range
-0.1 to 10.0, and the default is 1.0. Not all drivers are capable
-of using this information.
-.TP 7
-.BI "UseModes \*q" modesection-id \*q
-Include the set of modes listed in the
-.B Modes
-section called
-.IR modesection-id.
-This make all of the modes defined in that section available for use
-by this monitor.
-.TP 7
-.B Mode \fI"name"\fP
-This is an optional multi-line entry that can be used to provide
-definitions for video modes for the monitor. In most cases this isn't
-necessary because the built-in set of VESA standard modes will be
-sufficient. The
-.B Mode
-keyword indicates the start of a multi-line video mode description.
-The mode description is terminated with the
-.B EndMode
-keyword. The mode description consists of the following entries:
-.RS 7
-.TP 4
-.BI "DotClock " clock
-is the dot (pixel) clock rate to be used for the mode.
-.TP 4
-.BI "HTimings " "hdisp hsyncstart hsyncend htotal"
-specifies the horizontal timings for the mode.
-.TP 4
-.BI "VTimings " "vdisp vsyncstart vsyncend vtotal"
-specifies the vertical timings for the mode.
-.TP 4
-.BI "Flags \*q" flag \*q " ..."
-specifies an optional set of mode flags, each of which is a separate
-string in double quotes.
-.B \*qInterlace\*q
-indicates that the mode is interlaced.
-.B \*qDoubleScan\*q
-indicates a mode where each scanline is doubled.
-.B \*q+HSync\*q
-and
-.B \*q\-HSync\*q
-can be used to select the polarity of the HSync signal.
-.B \*q+VSync\*q
-and
-.B \*q\-VSync\*q
-can be used to select the polarity of the VSync signal.
-.B \*qComposite\*q
-can be used to specify composite sync on hardware where this is supported.
-Additionally, on some hardware,
-.B \*q+CSync\*q
-and
-.B \*q\-CSync\*q
-may be used to select the composite sync polarity.
-.TP 4
-.BI "HSkew " hskew
-specifies the number of pixels (towards the right edge of the screen)
-by which the display enable signal is to be skewed. Not all drivers
-use this information. This option might become necessary to override
-the default value supplied by the server (if any). "Roving" horizontal
-lines indicate this value needs to be increased. If the last few pixels
-on a scan line appear on the left of the screen, this value should be
-decreased.
-.TP 4
-.BI "VScan " vscan
-specifies the number of times each scanline is painted on the screen.
-Not all drivers use this information. Values less than 1 are treated
-as 1, which is the default. Generally, the
-.B \*qDoubleScan\*q
-.B Flag
-mentioned above doubles this value.
-.RE
-.TP 7
-.BI "ModeLine \*q" name \*q " mode-description"
-This entry is a more compact version of the
-.B Mode
-entry, and it also can be used to specify video modes for the monitor.
-is a single line format for specifying video modes. In most cases this
-isn't necessary because the built-in set of VESA standard modes will be
-sufficient.
-.PP
-.RS 7
-The
-.I mode-description
-is in four sections, the first three of which are mandatory. The first
-is the dot (pixel) clock. This is a single number specifying the pixel
-clock rate for the mode in MHz. The second section is a list of four
-numbers specifying the horizontal timings. These numbers are the
-.IR hdisp ,
-.IR hsyncstart ,
-.IR hsyncend ,
-and
-.I htotal
-values. The third section is a list of four numbers specifying the
-vertical timings. These numbers are the
-.IR vdisp ,
-.IR vsyncstart ,
-.IR vsyncend ,
-and
-.I vtotal
-values. The final section is a list of flags specifying other
-characteristics of the mode.
-.B Interlace
-indicates that the mode is interlaced.
-.B DoubleScan
-indicates a mode where each scanline is doubled.
-.B +HSync
-and
-.B \-HSync
-can be used to select the polarity of the HSync signal.
-.B +VSync
-and
-.B \-VSync
-can be used to select the polarity of the VSync signal.
-.B Composite
-can be used to specify composite sync on hardware where this is supported.
-Additionally, on some hardware,
-.B +CSync
-and
-.B \-CSync
-may be used to select the composite sync polarity. The
-.B HSkew
-and
-.B VScan
-options mentioned above in the
-.B Modes
-entry description can also be used here.
-.RE
-.TP 7
-.B Options
-Some
-.B Option
-flags that may be useful to include in
-.B Monitor
-sections (when needed) include
-.BR \*qDPMS\*q ,
-and
-.BR \*qSyncOnGreen\*q .
-
-.SH MODES SECTION
-The config file may have multiple
-.B Modes
-sections, or none. These sections provide a way of defining sets of
-video modes independently of the
-.B Monitor
-sections.
-.B Monitor
-sections may include the definitions provided in these sections by
-using the
-.B UseModes
-keyword. In most cases the
-.B Modes
-sections are not necessary because the built-in set of VESA standard modes
-will be sufficient.
-.PP
-.B Modes
-sections have the following format:
-.PP
-.RS 4
-.nf
-.B "Section \*qModes\*q"
-.BI " Identifier \*q" name \*q
-.I " entries"
-.I " ..."
-.B "EndSection"
-.fi
-.RE
-.PP
-The
-.B Identifier
-entry specifies the unique name for this set of mode descriptions.
-The other entries permitted in
-.B Modes
-sections are the
-.B Mode
-and
-.B ModeLine
-entries that are described above in the
-.B Monitor
-section.
-.SH SCREEN SECTION
-The config file may have multiple
-.B Screen
-sections. There must be at least one, for the "screen" being used.
-A "screen" represents the binding of a graphics device
-.RB ( Device
-section) and a monitor
-.RB ( Monitor
-section). A
-.B Screen
-section is considered "active" if it is referenced by an active
-.B ServerLayout
-section or by the
-.B \-screen
-command line option. If neither of those is present, the first
-.B Screen
-section found in the config file is considered the active one.
-.PP
-.B Screen
-sections have the following format:
-.PP
-.RS 4
-.nf
-.B "Section \*qScreen\*q"
-.BI " Identifier \*q" name \*q
-.BI " Device \*q" devid \*q
-.BI " Monitor \*q" monid \*q
-.I " entries"
-.I " ..."
-.BI " SubSection \*qDisplay\*q"
-.I " entries"
-.I " ...
-.B " EndSubSection"
-.I " ..."
-.B "EndSection"
-.fi
-.RE
-.PP
-The
-.B Identifier
-entry specifies the unique name for this screen. The
-.B Screen
-section provides information specific to the whole screen, including
-screen-specific
-.BR Options .
-In multi-head configurations, there will be multiple active
-.B Screen
-sections, one for each head.
-The entries available
-for this section are:
-.TP 7
-.BI "Device \*q" device-id \*q
-This specifies the
-.B Device
-section to be used for this screen. This is what ties a specific
-graphics card to a screen. The
-.I device-id
-must match the
-.B Identifier
-of a
-.B Device
-section in the config file.
-.TP 7
-.BI "Monitor \*q" monitor-id \*q
-specifies which monitor description is to be used for this screen.
-.TP 7
-.BI "VideoAdaptor \*q" xv-id \*q
-specifies an optional Xv video adaptor description to be used with this
-screen.
-.TP 7
-.BI "DefaultDepth " depth
-specifies which color depth the server should use by default. The
-.B \-depth
-command line option can be used to override this. If neither is specified,
-the default depth is driver-specific, but in most cases is 8.
-.TP 7
-.BI "DefaultFbBpp " bpp
-specifies which framebuffer layout to use by default. The
-.B \-fbbpp
-command line option can be used to override this. In most cases the
-driver will chose the best default value for this. The only case where
-there is even a choice in this value is for depth 24, where some hardware
-supports both a packed 24 bit framebuffer layout and a sparse 32 bit
-framebuffer layout.
-.TP 7
-.B Options
-Various
-.B Option
-flags may be specified in the
-.B Screen
-section. Some are driver-specific and are described in the driver
-documentation. Others are driver-independent, and will eventually be
-described here.
-.PP
-Each
-.B Screen
-section must contain one or more
-.B Display
-subsections. Those subsections provide depth/fbbpp specific configuration
-information, and the one chosen depends on the depth and/or fbbpp that
-is being used for the screen. The
-.B Display
-subsection format is described in the section below.
-
-.SH DISPLAY SUBSECTION
-Each
-.B Screen
-section may have multiple
-.B Display
-subsections. There must be at least one, which matches the depth
-and/or fbbpp values that are being used for the screen. The "active"
-.B Display
-subsection is the first that matches the depth and/or fbbpp values being
-used.
-.PP
-.B Display
-subsections have the following format:
-.PP
-.RS 4
-.nf
-.B " SubSection \*qDisplay\*q"
-.BI " Depth " depth
-.I " entries"
-.I " ..."
-.B " EndSubSection"
-.fi
-.RE
-.PP
-.TP 7
-.BI "Depth " depth
-This entry specifies what colour depth the
-.B Display
-subsection is to be used for. This entry is usually mandatory,
-but it may be omitted in some cases providing an
-.B FbBpp
-entry is present. The range of
-.I depth
-values that are allowed depends on the driver. Most driver support
-8, 15, 16 and 24. Some also support 1 and/or 4, and some may support
-other values (like 30). Note:
-.I depth
-means the number of bits in a pixel that are actually used to determine
-the pixel colour. 32 is not a valid
-.I depth
-value. Most hardware that uses 32 bits per pixel only uses 24 of them
-to hold the colour information, which means that the colour depth is
-24, not 32.
-.TP 7
-.BI "FbBpp " bpp
-This entry specifies the framebuffer format this
-.B Display
-subsection is to be used for. This entry is only needed when providing
-depth 24 configurations that allow a choice between a 24 bpp packed
-framebuffer format and a 32bpp sparse framebuffer format. In most cases
-this entry should not be used.
-.TP 7
-.BI "Weight " "red-weight green-weight blue-weight"
-This optional entry specifies the relative RGB weighting to be used
-for a screen is being used at depth 16 for drivers that allow multiple
-formats. This may also be specified from the command line with the
-.B \-weight
-option (see
-.IR XFree86(1) ).
-.TP 7
-.BI "Virtual " "xdim ydim"
-This optional entry specifies the virtual screen resolution to be used.
-.I xdim
-must be a multiple of either 8 or 16 for most drivers, and a multiple
-of 32 when running in monochrome mode. The given value will be rounded
-down if this is not the case. Video modes which are too large for the
-specified virtual size will be rejected. If this entry is not present,
-the virtual screen resolution will be set to accommodate all the valid
-video modes given in the
-.B Modes
-entry. Some drivers/hardware combinations do not support virtual screens.
-Refer to the appropriate driver-specific documentation for details.
-.TP 7
-.BI "ViewPort " "x0 y0"
-This optional entry sets the upper left corner of the initial display.
-This is only relevant when the virtual screen resolution is different
-from the resolution of the initial video mode. If this entry is not
-given, then the initial display will be centered in the virtual display
-area.
-.TP 7
-.BI "Modes \*q" mode-name \*q " ..."
-This entry is highly desirable for most drivers, and it specifies the list
-of video modes to use. Each
-.I mode-name
-specified must be in double quotes. They must correspond to those
-specified or referenced in the appropriate
-.B Monitor
-section (including implicitly referenced built-in VESA standard modes).
-The server will delete modes from this list which don't satisfy various
-requirements. The first valid mode in this list will be the default
-display mode for startup. The list of valid modes is converted internally
-into a circular list. It is possible to switch to the next mode with
-.B Ctrl+Alt+Keypad-Plus
-and to the previous mode with
-.BR Ctrl+Alt+Keypad-Minus .
-When this entry is omitted, the largest valid mode referenced by the
-appropriate
-.B Monitor
-section will be used.
-.TP 7
-.BI "Visual \*q" visual-name \*q
-This optional entry sets the default root visual type. This may also
-be specified from the command line (see the
-.I Xserver(1)
-man page). The visual types available for depth 8 are (default is
-.BR PseudoColor ):
-.PP
-.RS 11
-.nf
-.B StaticGray
-.B GrayScale
-.B StaticColor
-.B PseudoColor
-.B TrueColor
-.B DirectColor
-.fi
-.RE
-.PP
-.RS 7
-The visual type available for the depths 15, 16 and 24 are (default is
-.BR TrueColor ):
-.PP
-.RS 4
-.nf
-.B TrueColor
-.B DirectColor
-.fi
-.RE
-.PP
-Not all drivers support
-.B DirectColor
-at these depths.
-.PP
-The visual types available for the depth 4 are (default is
-.BR StaticColor ):
-.PP
-.RS 4
-.nf
-.B StaticGray
-.B GrayScale
-.B StaticColor
-.B PseudoColor
-.fi
-.RE
-.PP
-The visual type available for the depth 1 (monochrome) is
-.BR StaticGray .
-.RE
-.TP 7
-.BI "Black " "red green blue"
-This optional entry allows the "black" colour to be specified. This
-.TP 7
-.BI "White " "red green blue"
-This optional entry allows the "white" colour to be specified. This
-is only supported at depth 1. The default is white.
-.TP 7
-.B Options
-Option flags may be specified in the
-.B Display
-subsections. These may include driver-specific options and
-driver-independent options. The former are described in the
-driver-specific documentation. Some of the latter are described above
-in the section about the
-.B Screen
-section, and they may also be included here.
-.SH SERVERLAYOUT SECTION
-The config file may have multiple
-.B ServerLayout
-sections.
-A "server layout" represents the binding of one or more screens
-.RB ( Screen
-sections) and one or more input devices
-.RB ( InputDevice
-sections) to form a complete configuration. In multi-head configurations,
-it also specifies the relative layout of the heads. A
-.B ServerLayout
-section is considered "active" if it is referenced by the
-.B \-layout
-command line option. If that option is not used, the first
-.B ServerLayout
-section found in the config file is considered the active one. If no
-.B ServerLayout
-sections are present, the single active screen and two active (core)
-input devices are selected as described in the relevant sections above.
-.PP
-.B ServerLayout
-sections have the following format:
-.PP
-.RS 4
-.nf
-.B "Section \*qServerLayout\*q"
-.BI " Identifier \*q" name \*q
-.BI " Screen \*q" screen-id \*q
-.I " ..."
-.BI " InputDevice \*q" idev-id \*q
-.I " ..."
-.I " options"
-.I " ..."
-.B "EndSection"
-.fi
-.RE
-.PP
-The
-.B Identifier
-entry specifies the unique name for this server layout. The
-.B ServerLayout
-section provides information specific to the whole session, including
-session-specific
-.BR Options .
-The
-.B ServerFlags
-options (described above) may be specified here, and ones given here
-override those given in the
-.B ServerFlags
-section.
-.PP
-The entries that may be used in this section are described here.
-.TP 7
-.BI "Screen " "screen-num" " \*qscreen-id\*q " "position-information"
-One of these entries must be given for each screen being used in
-a session. The
-.I screen-id
-field is mandatory, and specifies the
-.B Screen
-section being referenced. The
-.I screen-num
-field is optional, and may be used to specify the screen number
-in multi-head configurations. When this field is omitted, the
-screens will be numbered in the order that they are listed in.
-The numbering starts from 0, and must be consecutive. The
-.I position-information
-field describes the way multiple screens are positioned. There are
-a number of different ways that this information can be provided:
-.RS 7
-.TP 4
-.BI "Absolute " "x y"
-This says that the upper left corner's coordinates are
-.RI ( x , y ).
-If the coordinates are omitted or if no positioning information
-is given, (0,0) is assumed.
-.TP 4
-.BI "RightOf \*q" screen-id \*q
-.TP 4
-.BI "LeftOf \*q" screen-id \*q
-.TP 4
-.BI "Above \*q" screen-id \*q
-.TP 4
-.BI "Below \*q" screen-id \*q
-.TP 4
-.BI "Relative \*q" screen-id \*q " x y"
-These give the screen's location relative to another screen.
-.RE
-.TP 7
-.BI "InputDevice \*q" idev-id "\*q \*q" option \*q " ..."
-One of these entries must be given for each input device being used in
-a session. Normally at least two are required, one each for the core
-pointer and keyboard devices. The
-.I idev-id
-field is mandatory, and specifies the name of the
-.B InputDevice
-section being referenced. Multiple
-.I option
-fields may be specified, each in double quotes. The options permitted
-here are any that may also be given in the
-.B InputDevice
-sections. Normally only session-specific input device options would
-be used here. The most commonly used options are:
-.PP
-.RS 11
-.nf
-.B \*qCorePointer\*q
-.B \*qCoreKeyboard\*q
-.B \*qSendCoreEvents\*q
-.fi
-.RE
-.PP
-.RS 7
-and the first two should normally be used to indicate the core pointer
-and core keyboard devices respectively.
-.RE
-.TP 7
-.B Options
-Any option permitted in the
-.B ServerFlags
-section may also be specified here. When the same option appears in both
-places, the value given here overrides the one given in the
-.B ServerFlags
-section.
-.PP
-Here is an example of a
-.B ServerLayout
-section for a dual headed configuration with two mice:
-.PP
-.RS 4
-.nf
-.B "Section \*qServerLayout\*q"
-.B " Identifier \*qLayout 1\*q"
-.B " Screen \*qMGA 1\*q"
-.B " Screen \*qMGA 2\*q RightOf \*qMGA 1\*q"
-.B " InputDevice \*qKeyboard 1\*q \*qCoreKeyboard\*q"
-.B " InputDevice \*qMouse 1\*q \*qCorePointer\*q"
-.B " InputDevice \*qMouse 2\*q \*qSendCoreEvents\*q"
-.B " Option \*qBlankTime\*q \*q5\*q"
-.B "EndSection"
-.fi
-.RE
-.SH DRI SECTION
-This optional section is used to provide some information for the
-Direct Rendering Infrastructure. Details about the format of this section
-can be found in the README.DRI document, which is also available on-line
-at
-.IR <http://www.xfree86.org/current/DRI.html> .
-.SH VENDOR SECTION
-The optional
-.B Vendor
-section may be used to provide vendor-specific configuration information.
-Multiple
-.B Vendor
-sections may be present, and they may contain an
-.B Identifier
-entry and multiple
-.B Option
-flags. The data therein is not used in this release.
-.PP
-.SH FILES
-For an example of an XF86Config file, see the file installed as
-__projectroot__/lib/X11/XF86Config.eg.
-.fi
-.SH "SEE ALSO"
-X(__miscmansuffix__), Xserver(1), XFree86(1),
-apm(__drivermansuffix__),
-ati(__drivermansuffix__),
-chips(__drivermansuffix__),
-cirrus(__drivermansuffix__),
-cyrix(__drivermansuffix__),
-fbdev(__drivermansuffix__),
-glide(__drivermansuffix__),
-glint(__drivermansuffix__),
-i128(__drivermansuffix__),
-i740(__drivermansuffix__),
-i810(__drivermansuffix__),
-imstt(__drivermansuffix__),
-mga(__drivermansuffix__),
-neomagic(__drivermansuffix__),
-nv(__drivermansuffix__),
-r128(__drivermansuffix__),
-rendition(__drivermansuffix__),
-s3virge(__drivermansuffix__),
-siliconmotion(__drivermansuffix__),
-sis(__drivermansuffix__),
-sunbw2(__drivermansuffix__),
-suncg14(__drivermansuffix__),
-suncg3(__drivermansuffix__),
-suncg6(__drivermansuffix__),
-sunffb(__drivermansuffix__),
-sunleo(__drivermansuffix__),
-suntcx(__drivermansuffix__),
-tdfx(__drivermansuffix__),
-tga(__drivermansuffix__),
-trident(__drivermansuffix__),
-tseng(__drivermansuffix__),
-v4l(__drivermansuffix__),
-vesa(__drivermansuffix__),
-vga(__drivermansuffix__),
-.br
-README
-.IR <http://www.xfree86.org/current/README.html> ,
-.br
-RELNOTES
-.IR <http://www.xfree86.org/current/RELNOTES.html> ,
-.br
-README.mouse
-.IR <http://www.xfree86.org/current/mouse.html> ,
-.br
-README.DRI
-.IR <http://www.xfree86.org/current/DRI.html> ,
-.br
-Status
-.IR <http://www.xfree86.org/current/Status.html> ,
-.br
-Install
-.IR <http://www.xfree86.org/current/Install.html> .
-.SH AUTHORS
-This manual page was largely rewritten for XFree86 4.0 by David Dawes
-.IR <dawes@xfree86.org> .
diff --git a/xc/programs/Xserver/hw/xfree86/XFree86.cpp b/xc/programs/Xserver/hw/xfree86/XFree86.man
index 6590f3e4d..b6b43af69 100644
--- a/xc/programs/Xserver/hw/xfree86/XFree86.cpp
+++ b/xc/programs/Xserver/hw/xfree86/XFree86.man
@@ -1,5 +1,5 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/XFree86.cpp,v 1.4 2000/12/11 20:29:50 dawes Exp $
-.TH XFree86 1 "Version 4.0.2" "XFree86"
+.\" $XFree86: xc/programs/Xserver/hw/xfree86/XFree86.man,v 3.48 2001/01/27 18:20:44 dawes Exp $
+.TH XFree86 1 __vendorversion__
.SH NAME
XFree86 - X11R6 X server
.SH SYNOPSIS
@@ -484,7 +484,7 @@ WD 90C24A support.
Alan Hourihane, \fIalanh@fairlite.demon.co.uk\fP
Trident SVGA driver, SiS SVGA driver and DEC 21030 server.
.TP 8
-Marc Aurele La France, \fItsi@ualberta.ca\fP
+Marc Aurele La France, \fItsi@xfree86.org\fP
ATI SVGA driver
.TP 8
Steve Goldman, \fIsgoldman@encore.com\fP
diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86Config.c b/xc/programs/Xserver/hw/xfree86/common/xf86Config.c
index a6a42682e..676190b55 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.236 2000/12/06 15:35:07 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Config.c,v 3.239 2001/02/15 20:31:46 eich Exp $ */
/*
@@ -23,7 +23,6 @@
#include "xf86Parser.h"
#include "xf86tokens.h"
#include "xf86Config.h"
-#define NO_COMPILER_H_EXTRAS
#include "xf86Priv.h"
#include "xf86_OSlib.h"
@@ -986,28 +985,34 @@ configInputKbd(IDevPtr inputp)
#else
xf86Info.kbdEvents = xf86KbdEvents;
#endif
+ xfree(s);
} else if (xf86NameCmp(s, "xqueue") == 0) {
#ifdef XQUEUE
xf86Info.kbdProc = xf86XqueKbdProc;
xf86Info.kbdEvents = xf86XqueEvents;
xf86Msg(X_CONFIG, "Xqueue selected for keyboard input\n");
#endif
+ xfree(s);
#ifdef WSCONS_SUPPORT
} else if (xf86NameCmp(s, "wskbd") == 0) {
int xf86WSKbdProc(DeviceIntPtr, int);
xf86Info.kbdProc = xf86WSKbdProc;
xf86Info.kbdEvents = xf86KbdEvents;
+ xfree(s);
s = xf86SetStrOption(inputp->commonOptions, "Device", NULL);
xf86Msg(X_CONFIG, "Keyboard: Protocol: wskbd\n");
xf86Info.kbdFd = open(s, O_RDONLY | O_NONBLOCK | O_EXCL);
if (xf86Info.kbdFd == -1) {
xf86ConfigError("cannot open \"%s\"", s);
+ xfree(s);
return FALSE;
}
+ xfree(s);
#endif
} else {
xf86ConfigError("\"%s\" is not a valid keyboard protocol name", s);
+ xfree(s);
return FALSE;
}
@@ -1015,9 +1020,12 @@ configInputKbd(IDevPtr inputp)
if (s) {
if (sscanf(s, "%d %d", &xf86Info.kbdDelay, &xf86Info.kbdRate) != 2) {
xf86ConfigError("\"%s\" is not a valid AutoRepeat value", s);
+ xfree(s);
return FALSE;
}
+ xfree(s);
}
+
s = xf86SetStrOption(inputp->commonOptions, "XLeds", NULL);
if (s) {
char *l, *end;
@@ -1029,10 +1037,12 @@ configInputKbd(IDevPtr inputp)
xf86Info.xleds |= 1L << (i - 1);
else {
xf86ConfigError("\"%s\" is not a valid XLeds value", l);
+ xfree(s);
return FALSE;
}
l = strtok(NULL, " \t\n");
}
+ xfree(s);
}
#ifdef XKB
@@ -1047,7 +1057,7 @@ configInputKbd(IDevPtr inputp)
if (noXkbExtension)
xf86Msg(from, "XKB: disabled\n");
-#define NULL_IF_EMPTY(s) (s[0] ? s : NULL)
+#define NULL_IF_EMPTY(s) (s[0] ? s : (xfree(s), NULL))
if (!noXkbExtension && !XkbInitialMap) {
if ((s = xf86SetStrOption(inputp->commonOptions, "XkbKeymap", NULL))) {
@@ -2060,6 +2070,7 @@ xf86HandleConfigFile(void)
X_INFO_STRING " informational,\n"
" " X_WARNING_STRING " warning, "
X_ERROR_STRING " error, "
+ X_NOT_IMPLEMENTED_STRING " not implemented, "
X_UNKNOWN_STRING " unknown.\n");
/*
diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86PciInfo.h b/xc/programs/Xserver/hw/xfree86/common/xf86PciInfo.h
index 26c4e6f20..048a6d887 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.83 2000/12/07 21:34:20 mvojkovi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86PciInfo.h,v 1.88 2001/02/17 23:19:51 mvojkovi Exp $ */
/*
* PCI Probe
*
@@ -231,6 +231,7 @@
#define PCI_CHIP_MACH64LS 0x4C53
#define PCI_CHIP_RAGE128MF 0x4D46
#define PCI_CHIP_RAGE128ML 0x4D4C
+#define PCI_CHIP_RAGE128PD 0x5044
#define PCI_CHIP_RAGE128PF 0x5046
#define PCI_CHIP_RAGE128PR 0x5052
#define PCI_CHIP_RADEON_QD 0x5144
@@ -258,6 +259,7 @@
/* Avance Logic */
#define PCI_CHIP_ALG2064 0x2064
#define PCI_CHIP_ALG2301 0x2301
+#define PCI_CHIP_ALG2501 0x2501
/* NS */
#define PCI_CHIP_87415 0x0002
@@ -473,6 +475,8 @@
#define PCI_CHIP_UTNT2 0x0029
#define PCI_CHIP_VTNT2 0x002C
#define PCI_CHIP_UVTNT2 0x002D
+#define PCI_CHIP_TNT2_A 0x002E
+#define PCI_CHIP_TNT2_B 0x002F
#define PCI_CHIP_ITNT2 0x00A0
#define PCI_CHIP_GEFORCE256 0x0100
#define PCI_CHIP_GEFORCEDDR 0x0101
@@ -485,6 +489,10 @@
#define PCI_CHIP_GEFORCE2GTS_1 0x0151
#define PCI_CHIP_GEFORCE2ULTRA 0x0152
#define PCI_CHIP_QUADRO2PRO 0x0153
+#define PCI_CHIP_0200 0x0200
+#define PCI_CHIP_0201 0x0201
+#define PCI_CHIP_0202 0x0202
+#define PCI_CHIP_0203 0x0203
/* NVIDIA & SGS */
#define PCI_CHIP_RIVA128 0x0018
@@ -796,6 +804,7 @@ static pciVendorDeviceInfo xf86PCIVendorInfoData[] = {
{PCI_CHIP_MACH64LS, "Mach64 LS",0},
{PCI_CHIP_RAGE128MF, "Rage 128 Mobility MF",0},
{PCI_CHIP_RAGE128ML, "Rage 128 Mobility ML",0},
+ {PCI_CHIP_RAGE128PD, "Rage 128 Pro PD",0},
{PCI_CHIP_RAGE128PF, "Rage 128 Pro PF",0},
{PCI_CHIP_RAGE128PR, "Rage 128 Pro PR",0},
{PCI_CHIP_RADEON_QD, "Radeon QD",0},
@@ -1206,6 +1215,8 @@ static pciVendorDeviceInfo xf86PCIVendorInfoData[] = {
{PCI_CHIP_UTNT2, "Riva Ultra TNT2",0},
{PCI_CHIP_VTNT2, "Riva Vanta",0},
{PCI_CHIP_UVTNT2, "Riva Ultra 64",0},
+ {PCI_CHIP_TNT2_A, "Riva TNT2 (A)",0},
+ {PCI_CHIP_TNT2_B, "Riva TNT2 (B)",0},
{PCI_CHIP_ITNT2, "Riva Integrated",0},
{PCI_CHIP_GEFORCE256, "GeForce 256",0},
{PCI_CHIP_GEFORCEDDR, "GeForce DDR",0},
@@ -1380,6 +1391,7 @@ static pciVendorDeviceInfo xf86PCIVendorInfoData[] = {
{0x0000, NULL,0}}},
{PCI_VENDOR_AVANCE_2, {
{PCI_CHIP_ALG2064, "ALG2064",0},
+ {PCI_CHIP_ALG2501, "ALG2501",0},
{0x0000, NULL,0}}},
{PCI_VENDOR_S3, {
{PCI_CHIP_PLATO, "PLATO/PX",0},
@@ -1592,6 +1604,14 @@ static pciVendorCardInfo xf86PCICardInfoData[] = {
{ 0x8760, "Fireport 40 Dual",0, NF },
{ 0x8a10, "Stealth 3D 4000",0, NF },
{ 0x0000, (char *)NULL,0, NF } } },
+ { PCI_VENDOR_APPIAN, {
+ { 0x3d32, "Jeronimo 2000",0, NF },
+ { 0x3db3, "Jeronimo Pro",0, NF },
+ { 0x0000, (char *)NULL,0, NF } } },
+ { PCI_VENDOR_3DLABS, {
+ { 0x0106, "GMX2000",0, NF },
+ { 0x0116, "GVX1",0, NF },
+ { 0x0000, (char *)NULL,0, NF } } },
{ PCI_VENDOR_ELSA, {
{ 0x0914, "Winner 1000",0, NF },
{ 0x0930, "Winner 1000PRO 864",0, NF },
diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86pciBus.c b/xc/programs/Xserver/hw/xfree86/common/xf86pciBus.c
index fbaa4f391..d6d869656 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.28 2000/12/08 20:13:35 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86pciBus.c,v 3.34 2001/02/16 21:38:38 tsi Exp $ */
/*
* Copyright (c) 1997-1999 by The XFree86 Project, Inc.
@@ -175,45 +175,63 @@ FindPCIVideoInfo(void)
if ((PCISHAREDIOCLASSES(baseclass, subclass))
&& (pcrp->pci_command & PCI_CMD_IO_ENABLE) &&
(pcrp->pci_prog_if == 0)) {
- /* assumption: primary bus is always VGA */
- primaryBus.type = BUS_PCI;
- primaryBus.id.pci.bus = pcrp->busnum;
- primaryBus.id.pci.device = pcrp->devnum;
- primaryBus.id.pci.func = pcrp->funcnum;
+
+ /*
+ * Attempt to ensure that VGA is actually routed to this
+ * adapter on entry. This needs to be fixed when we finally
+ * grok host bridges (and multiple bus trees).
+ */
+ j = info->bus;
+ while (j > 0) {
+ PciBusPtr pBus = xf86PciBus;
+ while (pBus && j != pBus->secondary)
+ pBus = pBus->next;
+ if (!pBus || !(pBus->brcontrol & PCI_PCI_BRIDGE_VGA_EN))
+ break;
+ j = pBus->brbus;
+ }
+ if (j <= 0) {
+ if (primaryBus.type == BUS_NONE) {
+ /* assumption: primary bus is always VGA */
+ primaryBus.type = BUS_PCI;
+ primaryBus.id.pci.bus = pcrp->busnum;
+ primaryBus.id.pci.device = pcrp->devnum;
+ primaryBus.id.pci.func = pcrp->funcnum;
+ } else if (primaryBus.type < BUS_last) {
+ xf86Msg(X_NOTICE,
+ "More than one primary device found\n");
+ primaryBus.type ^= (BusType)(-1);
+ }
+ }
}
for (j = 0; j < 6; j++) {
info->memBase[j] = 0;
info->ioBase[j] = 0;
- if (PCINONSYSTEMCLASSES(info->class, info->subclass)) {
- info->size[j] = pciGetBaseSize(pcrp->tag, j, TRUE,
- &info->validSize);
+ if (PCINONSYSTEMCLASSES(baseclass, subclass)) {
+ info->size[j] =
+ pciGetBaseSize(pcrp->tag, j, TRUE, &info->validSize);
} else {
info->size[j] = pcrp->basesize[j];
info->validSize = pcrp->minBasesize;
}
- /* pciGetBaseSize(pcrp->tag, j, FALSE, NULL) */
info->type[j] = 0;
}
- if (!(pcrp->pci_base0) && info->size[0]
- && PCINONSYSTEMCLASSES(info->class, info->subclass))
- pcrp->pci_base0 = pciCheckForBrokenBase(pcrp->tag,0);
- if (!(pcrp->pci_base1) && info->size[1]
- && PCINONSYSTEMCLASSES(info->class, info->subclass))
- pcrp->pci_base1 = pciCheckForBrokenBase(pcrp->tag,1);
- if (!(pcrp->pci_base2) && info->size[2]
- && PCINONSYSTEMCLASSES(info->class, info->subclass))
- pcrp->pci_base2 = pciCheckForBrokenBase(pcrp->tag,2);
- if (!(pcrp->pci_base3) && info->size[3]
- && PCINONSYSTEMCLASSES(info->class, info->subclass))
- pcrp->pci_base3 = pciCheckForBrokenBase(pcrp->tag,3);
- if (!(pcrp->pci_base4) && info->size[4]
- && PCINONSYSTEMCLASSES(info->class, info->subclass))
- pcrp->pci_base4 = pciCheckForBrokenBase(pcrp->tag,4);
- if (!(pcrp->pci_base5) && info->size[5]
- && PCINONSYSTEMCLASSES(info->class, info->subclass))
- pcrp->pci_base5 = pciCheckForBrokenBase(pcrp->tag,5);
+ if (PCINONSYSTEMCLASSES(baseclass, subclass)) {
+ if (!pcrp->pci_base0 && info->size[0])
+ pcrp->pci_base0 = pciCheckForBrokenBase(pcrp->tag, 0);
+ if (!pcrp->pci_base1 && info->size[1])
+ pcrp->pci_base1 = pciCheckForBrokenBase(pcrp->tag, 1);
+ if (!pcrp->pci_base2 && info->size[2])
+ pcrp->pci_base2 = pciCheckForBrokenBase(pcrp->tag, 2);
+ if (!pcrp->pci_base3 && info->size[3])
+ pcrp->pci_base3 = pciCheckForBrokenBase(pcrp->tag, 3);
+ if (!pcrp->pci_base4 && info->size[4])
+ pcrp->pci_base4 = pciCheckForBrokenBase(pcrp->tag, 4);
+ if (!pcrp->pci_base5 && info->size[5])
+ pcrp->pci_base5 = pciCheckForBrokenBase(pcrp->tag, 5);
+ }
/*
* 64-bit base addresses are checked for and avoided.
@@ -752,7 +770,7 @@ removeOverlapsWithBridges(int busIndex, resPtr target)
}
}
- RemoveOverlaps(target,bridgeRes,TRUE);
+ RemoveOverlaps(target, bridgeRes, TRUE, TRUE);
if (range.rEnd > target->block_end) {
correctPciSize(range.rBegin,range.rEnd - range.rBegin,
target->block_end - target->block_begin,
@@ -902,9 +920,9 @@ xf86GetPciRes(resPtr *activeRes, resPtr *inactiveRes)
if (ResIsEstimated(&pRes->val)) {
range = pRes->val;
- RemoveOverlaps(pRes, *activeRes, TRUE);
- if (xf86Info.estimateSizesAggressively > 0)
- RemoveOverlaps(pRes, *inactiveRes, TRUE);
+ RemoveOverlaps(pRes, *activeRes, TRUE, TRUE);
+ RemoveOverlaps(pRes, *inactiveRes, TRUE,
+ (xf86Info.estimateSizesAggressively > 0));
if (range.rEnd > pRes->block_end) {
correctPciSize(range.rBegin,range.rEnd - range.rBegin,
@@ -923,14 +941,16 @@ xf86GetPciRes(resPtr *activeRes, resPtr *inactiveRes)
xf86PrintResList(3, *activeRes);
}
- if (*inactiveRes && (xf86Info.estimateSizesAggressively > 1)) {
+ if (*inactiveRes) {
/* Check for overlaps */
for (pRes = *inactiveRes; pRes; pRes = pRes->next) {
if (ResIsEstimated(&pRes->val)) {
range = pRes->val;
- RemoveOverlaps(pRes, *activeRes, TRUE);
- RemoveOverlaps(pRes, *inactiveRes, TRUE);
+ RemoveOverlaps(pRes, *activeRes, TRUE,
+ (xf86Info.estimateSizesAggressively > 1));
+ RemoveOverlaps(pRes, *inactiveRes, TRUE,
+ (xf86Info.estimateSizesAggressively > 1));
if (range.rEnd > pRes->block_end) {
correctPciSize(range.rBegin,range.rEnd - range.rBegin,
@@ -946,7 +966,7 @@ xf86GetPciRes(resPtr *activeRes, resPtr *inactiveRes)
}
}
xf86MsgVerb(X_INFO, 3,
- "Ative PCI resource ranges after removing overlaps:\n");
+ "Inactive PCI resource ranges after removing overlaps:\n");
xf86PrintResList(3, *inactiveRes);
}
}
@@ -968,7 +988,7 @@ ResourceBrokerInitPci(resPtr *osRes)
*/
for (tmp = *osRes; tmp; tmp = tmp->next)
- RemoveOverlaps(tmp, activeRes, FALSE);
+ RemoveOverlaps(tmp, activeRes, FALSE, TRUE);
xf86MsgVerb(X_INFO, 3, "OS-reported resource ranges after removing"
" overlaps with PCI:\n");
@@ -976,7 +996,7 @@ ResourceBrokerInitPci(resPtr *osRes)
pciAvoidRes = xf86AddRangesToList(pciAvoidRes,PciAvoid,-1);
for (tmp = pciAvoidRes; tmp; tmp = tmp->next)
- RemoveOverlaps(tmp, activeRes, FALSE);
+ RemoveOverlaps(tmp, activeRes, FALSE, TRUE);
tmp = xf86DupResList(*osRes);
pciAvoidRes = xf86JoinResLists(pciAvoidRes,tmp);
@@ -1424,40 +1444,54 @@ getValidBIOSBase(PCITAG tag, int *num)
if ((*num < 0) || (*num > 5) ||
!pvp->memBase[*num] || (pvp->size[*num] < biosSize)) {
*num = -1;
+ } else {
+ P_M_RANGE(range, TAG(pvp), pvp->memBase[*num], biosSize,
+ ResExcMemBlock);
+ if (!xf86IsSubsetOf(range, m) || ChkConflict(&range, avoid, SETUP))
+ *num = -1;
+ }
+
+ if (*num < 0) {
for (n = 0; n <= 5; n++) {
if (pvp->memBase[n] && (pvp->size[n] >= biosSize)) {
- *num = n;
- break;
+ /* keep bios size ! */
+ P_M_RANGE(range, TAG(pvp), pvp->memBase[*num],
+ biosSize, ResExcMemBlock);
+ if (xf86IsSubsetOf(range, m) &&
+ !ChkConflict(&range, avoid, SETUP)) {
+ *num = n;
+ break;
+ }
}
}
}
- if (*num >= 0) {
- /* then try suggested memBase */
- /* keep bios size ! */
- P_M_RANGE(range,TAG(pvp),pvp->memBase[*num],biosSize,ResExcMemBlock);
- if (xf86IsSubsetOf(range,m) && !ChkConflict(&range,avoid,SETUP)) {
- xf86FreeResList(avoid);
- xf86FreeResList(m);
- return pvp->memBase[*num];
- }
- }
+ /*
+ * Return a possible window. Note that this doesn't deal with host bridges
+ * yet. But the fix for that belongs elsewhere.
+ */
while (m) {
range = xf86GetBlock(ResExcMemBlock,
- PCI_SIZE(ResMem,TAG(pvp),(1 << biosSize)),
+ PCI_SIZE(ResMem, TAG(pvp), 1 << biosSize),
m->block_begin, m->block_end,
- PCI_SIZE(ResMem,TAG(pvp),alignment), avoid);
- if (range.type != ResEnd)
- break;
+ PCI_SIZE(ResMem, TAG(pvp), alignment), avoid);
+ if (range.type != ResEnd) {
+ xf86FreeResList(avoid);
+ xf86FreeResList(m);
+ return M2B(TAG(pvp), range.rBase);
+ }
m = m->next;
}
-
+
xf86FreeResList(avoid);
xf86FreeResList(m);
- xf86MsgVerb(X_INFO,5,"GetVaildBIOSBase for %x:%x:%x: BIOSbase 0x%lx\n",
- pvp->bus,pvp->device,pvp->func,
- (memType)M2B(TAG(pvp),range.rBase));
- return M2B(TAG(pvp),range.rBase);
+
+ if (*num >= 0) {
+ /* then try suggested memBase */
+ return pvp->memBase[*num];
+ }
+
+ return 0;
}
/*
@@ -1561,7 +1595,9 @@ xf86GetPciBridgeInfo(const pciConfigPtr *pciInfo)
int MaxBus = 0;
int i;
memType base, limit;
-
+
+ resPtr pciBusAccWindows = xf86PciBusAccWindowsFromOS();
+
if (pciInfo == NULL) return NULL;
/* Add each PCI-PCI bridge */
@@ -1674,6 +1710,7 @@ xf86GetPciBridgeInfo(const pciConfigPtr *pciInfo)
PciBus->brdev = pcrp->devnum;
PciBus->brfunc = pcrp->funcnum;
PciBus->subclass = sub_class;
+ PciBus->brcontrol = PCI_PCI_BRIDGE_VGA_EN;
xf86MsgVerb(X_INFO,3,"PCI-to-ISA bridge:\n");
break;
case PCI_SUBCLASS_BRIDGE_HOST:
@@ -1682,12 +1719,13 @@ xf86GetPciBridgeInfo(const pciConfigPtr *pciInfo)
PciBus->primary = -1;
PciBus->secondary = -1; /* to be set below */
PciBus->subclass = sub_class;
+ PciBus->brcontrol = PCI_PCI_BRIDGE_VGA_EN;
PciBus->preferred_io = xf86ExtractTypeFromList(
- xf86PciBusAccWindowsFromOS(),ResIo);
+ pciBusAccWindows,ResIo);
PciBus->preferred_mem = xf86ExtractTypeFromList(
- xf86PciBusAccWindowsFromOS(),ResMem);
+ pciBusAccWindows,ResMem);
PciBus->preferred_pmem = xf86ExtractTypeFromList(
- xf86PciBusAccWindowsFromOS(),ResMem);
+ pciBusAccWindows,ResMem);
xf86MsgVerb(X_INFO,3,"Host-to-PCI bridge:\n");
break;
default:
@@ -1719,11 +1757,11 @@ xf86GetPciBridgeInfo(const pciConfigPtr *pciInfo)
PciBus->secondary = i;
PciBus->subclass = PCI_SUBCLASS_BRIDGE_HOST;
PciBus->preferred_io = xf86ExtractTypeFromList(
- xf86PciBusAccWindowsFromOS(),ResIo);
+ pciBusAccWindows,ResIo);
PciBus->preferred_mem = xf86ExtractTypeFromList(
- xf86PciBusAccWindowsFromOS(),ResMem);
+ pciBusAccWindows,ResMem);
PciBus->preferred_pmem = xf86ExtractTypeFromList(
- xf86PciBusAccWindowsFromOS(),ResMem);
+ pciBusAccWindows,ResMem);
xf86MsgVerb(X_INFO,3,"Host-to-PCI bridge:\n");
}
}
@@ -1754,6 +1792,7 @@ xf86GetPciBridgeInfo(const pciConfigPtr *pciInfo)
printBridgeInfo(PciBus);
}
+ xf86FreeResList(pciBusAccWindows);
return PciBusBase;
}
@@ -1803,7 +1842,7 @@ ValidatePci(void)
* Mark all pciInfoRecs that need to be validated. These are
* the ones which have been assigned to a screen.
*/
- Sys = NULL;
+ Sys = xf86DupResList(osRes);
for (i=0; i<xf86NumScreens; i++) {
for (m = 0; m < xf86Screens[i]->numEntities; m++)
if ((pvp = xf86GetPciInfoForEntity(xf86Screens[i]->entityList[m])))
@@ -1890,7 +1929,7 @@ ValidatePci(void)
*/
while ((pvp = xf86PciVideoInfo[n++])) {
resPtr res_mp = NULL, res_m_io = NULL;
- resPtr NonSys = NULL;
+ resPtr NonSys;
resPtr tmp, avoid = NULL;
if (!pvp->validate) continue;
@@ -1987,8 +2026,10 @@ ValidatePci(void)
if (xf86IsSubsetOf(range,res_m_io)
&& ! ChkConflict(&range,own,SETUP)
&& ! ChkConflict(&range,avoid,SETUP)
- && ! ChkConflict(&range,NonSys,SETUP))
+ && ! ChkConflict(&range,NonSys,SETUP)) {
+ xf86FreeResList(own);
continue;
+ }
xf86MsgVerb(X_WARNING, 0,
"****INVALID IO ALLOCATION**** b: 0x%lx e: 0x%lx "
"correcting\a\n", range.rBegin,range.rEnd);
@@ -2002,14 +2043,18 @@ ValidatePci(void)
if (xf86IsSubsetOf(range,res_mp)
&& ! ChkConflict(&range,own,SETUP)
&& ! ChkConflict(&range,avoid,SETUP)
- && ! ChkConflict(&range,NonSys,SETUP))
+ && ! ChkConflict(&range,NonSys,SETUP)) {
+ xf86FreeResList(own);
continue;
+ }
}
if (xf86IsSubsetOf(range,res_m_io)
&& ! ChkConflict(&range,own,SETUP)
&& ! ChkConflict(&range,avoid,SETUP)
- && ! ChkConflict(&range,NonSys,SETUP))
+ && ! ChkConflict(&range,NonSys,SETUP)) {
+ xf86FreeResList(own);
continue;
+ }
xf86MsgVerb(X_WARNING, 0,
"****INVALID MEM ALLOCATION**** b: 0x%lx e: 0x%lx "
"correcting\a\n", range.rBegin,range.rEnd);
@@ -2343,7 +2388,8 @@ xf86ClaimPciSlot(int bus, int device, int func, DriverPtr drvp,
p->pciBusId.func = func;
p->active = active;
p->inUse = FALSE;
- xf86AddDevToEntity(num, dev);
+ if (dev)
+ xf86AddDevToEntity(num, dev);
/* Here we initialize the access structure */
p->access = xnfcalloc(1,sizeof(EntityAccessRec));
while (ppaccp && *ppaccp) {
@@ -2755,7 +2801,7 @@ getPciClassFlags(pciConfigPtr *pcrpp)
/*
* xf86FindPciVendorDevice() xf86FindPciClass(): These functions
- * are ment to be used by the pci bios emulation. Some bioses
+ * are meant to be used by the pci bios emulation. Some bioses
* need to see if there are _other_ chips of the same type around
* so by setting pvp_exclude one pci device can be explicitely
* _excluded if required.
diff --git a/xc/programs/Xserver/hw/xfree86/ddc/ddcProperty.c b/xc/programs/Xserver/hw/xfree86/ddc/ddcProperty.c
index e7026fec6..2d6ea31ca 100644
--- a/xc/programs/Xserver/hw/xfree86/ddc/ddcProperty.c
+++ b/xc/programs/Xserver/hw/xfree86/ddc/ddcProperty.c
@@ -3,7 +3,7 @@
*
* Copyright 1999 by Andrew C Aitchison <A.C.Aitchison@dpmms.cam.ac.uk>
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/ddcProperty.c,v 1.4 2000/11/06 19:24:07 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/ddcProperty.c,v 1.5 2001/02/15 17:31:45 eich Exp $ */
#include "misc.h"
#include "xf86.h"
@@ -74,7 +74,6 @@ xf86SetDDCproperties(ScrnInfoPtr pScrnInfo, xf86MonPtr DDC)
} else if (DDC->ver.version == 2) {
if ( (EDID2rawdata = xalloc(256*sizeof(CARD8)))==NULL ) {
- xfree(EDID2rawdata);
return FALSE;
}
for (i=0; i<256; i++) {
diff --git a/xc/programs/Xserver/hw/xfree86/doc/BugReport b/xc/programs/Xserver/hw/xfree86/doc/BugReport
deleted file mode 100644
index 4f7d0bc4e..000000000
--- a/xc/programs/Xserver/hw/xfree86/doc/BugReport
+++ /dev/null
@@ -1,57 +0,0 @@
- XFree86 Bug/Test Report Form
-
-Please fill in as many of the fields a possible, and return this form to
-XFree86@XFree86.org. Replace the comments in [] with your own text.
-
-VERSION:
-
-4.0.1a
-
-VIDEO DRIVER:
-
-[e.g. mga]
-
-OPERATING SYSTEM:
-
-[e.g. Linux]
-
-VIDEO CARD:
-
- [Fill out each relevant entry. If you don't know some of the details,
- just leave them blank.]
-
- MODEL:
-
- [Include a precise description of the model. There are often subtle
- differences in card model names.]
-
- GRAPHICS CHIPSET:
-
- [e.g. Matrox G200]
-
- RAMDAC:
-
- [Usually only relevant for old cards]
-
- CLOCKCHIP:
-
- [Usually only relevant for old cards]
-
- VIDEO MEMORY:
-
- [e.g. 2MB DRAM Include both the amount, and type (if known)]
-
- BUS TYPE:
-
- [e.g. PCI]
-
-REPORT:
-
- [Include details of any problems you encountered. If you didn't have
- any problems, just say "no problems". Indicate what modes and colour
- depths you tested. If you found a bug, give a description of how to
- reproduce it.]
-
-
-
-$XFree86: xc/programs/Xserver/hw/xfree86/doc/BugReport,v 1.3 2000/08/03 12:24:02 dawes Exp $
diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.DRI b/xc/programs/Xserver/hw/xfree86/doc/README.DRI
index b5e78abc9..36586b74d 100644
--- a/xc/programs/Xserver/hw/xfree86/doc/README.DRI
+++ b/xc/programs/Xserver/hw/xfree86/doc/README.DRI
@@ -2,13 +2,13 @@
VA Linux Systems, Inc. Professional Services - Graphics.
- 20 November 2000
+ 5 January 2001
1. Preamble
1.1 Copyright
-Copyright © 2000 by VA Linux Systems, Inc. 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
@@ -24,8 +24,9 @@ Intel is a registered trademark of Intel Corporation. 3Dlabs, GLINT, and
Oxygen are either registered trademarks or trademarks of 3Dlabs Inc. Ltd.
3dfx, Voodoo3, Voodoo4, and Voodoo5 are registered trademarks of 3dfx Inter-
active, Incorporated. Matrox is a registered trademark of Matrox Electronic
-Systems Ltd. ATI Rage is a registered trademark of ATI Technologies, Inc.
-All other trademarks mentioned are the property of their respective owners.
+Systems Ltd. ATI Rage and Radeon are registered trademarks of ATI Technolo-
+gies, Inc. All other trademarks mentioned are the property of their respec-
+tive owners.
2. Introduction
@@ -51,13 +52,24 @@ inux.com.
"
-3.1 Architectures
+3.1 CPU Architectures
"
-The Architectures currently supported by the DRI have grown from the initial
-Intel i386 based machines to now include, the Alpha Processor and the Sun
-SPARC machines.
+The architectures currently supported by the DRI have grown from the initial
+Intel i386 systems to now include the Alpha Processor and the Sun SPARC
+machines.
+
+Intel's SSE (a.k.a. Katmai) instructions are used in optimized vertex trans-
+formation functions in Mesa-based drivers. This requires a recent Linux ker-
+nel both at compile and runtime. See the DRI Compile Guide for compile-time
+requirements. At runtime a check is made to determine if the CPU can execute
+SSE instructions. They're disabled otherwise.
+
+AMD's 3DNow! instructions are also used in optimized vertex transformation
+functions in the Mesa-based DRI drivers. 3DNow! is supported in most ver-
+sions of Linux. Like the SSE optimizations, a runtime check is made to
+determine if the CPU can execute 3DNow! instructions.
The build environment for both of these new architectures have a pre-build
environment that will correctly build the DRI drivers and Mesa meaning no
@@ -83,10 +95,8 @@ Compaq's Math Libraries (CPML) which can be obtained from the following URL.
http://www.support.compaq.com/alpha-tools/software/index.html
-Once installed, you can set this option in your host.def to build against the
-CPML libraries.
-
-#define UseCompaqMathLibrary YES
+Alpha systems can benefit from several compile-time optimizations which are
+described in the DRI Compile Guide.
3.2 Graphics Hardware
@@ -95,13 +105,12 @@ CPML libraries.
XFree86 4.0 (or later versions) includes 3D acceleration for the following
graphics hardware:
-NOTE: This is a complete list of graphics hardware supported. It may not be
-supported on your platform.
-
- o 3dfx:
+ o 3dfx, supported on Intel x86, AMD and Alpha:
o Voodoo5 5500
+ o Voodoo4 4500
+
o Voodoo3 3500 TV
o Voodoo3 3000 AGP
@@ -119,13 +128,13 @@ supported on your platform.
There are many configurations of 3dfx cards on the market. Not all have
been tested.
- o Matrox:
+ o Matrox, supported on Intel x86 and AMD:
o Matrox G200
o Matrox G400
- o Intel i810
+ o Intel i810 (motherboard chipset)
o i810
@@ -133,7 +142,7 @@ supported on your platform.
o i810e
- o ATI Rage 128
+ o ATI Rage 128, supported on Intel x86 and AMD:
o Rage Fury AGP
@@ -148,12 +157,24 @@ supported on your platform.
o All-in-Wonder 128 AGP
The PCI versions of these cards also have minimal support. Note that
- there are also Rage 128 Pro based boards on the market, and these are
- not yet supported.
+ there are Rage 128 Pro boards on the market but they're not yet sup-
+ ported.
+
+ o ATI Radeon, supported on Intel x86 and AMD:
+
+ o Radeon SDR AGP
- o 3Dlabs Oxygen GMX 2000 (MX/Gamma based)
+ o Radeon DDR AGP
-Support for other hardware is underway.
+ o 3Dlabs, supported on Intel x86 and AMD:
+
+ o Oxygen GMX 2000 (MX/Gamma based). Note: this driver is no longer
+ being actively developed.
+
+Support for other hardware is underway. Most of the DRI development work is
+funded by contracts with IHVs. These contracts often prevent us from
+announcing drivers before they're released. Queries about upcoming drivers
+may not be answerable.
4. Prerequisite Software
@@ -342,15 +363,15 @@ as well as which DRI-based driver. Simply type glxinfo and examine the
OpenGL vendor, renderer, and version lines. Among the output you should see
something like this:
- OpenGL vendor string: Precision Insight, Inc.
+ OpenGL vendor string: VA Linux Systems, Inc.
OpenGL renderer string: Mesa DRI Voodoo3 20000224
- OpenGL version string: 1.2 Mesa 3.3 beta
+ OpenGL version string: 1.2 Mesa 3.4
or this:
- OpenGL vendor string: Precision Insight, Inc.
+ OpenGL vendor string: VA Linux Systems, Inc.
OpenGL renderer string: Mesa GLX Indirect
- OpenGL version string: 1.2 Mesa 3.3 beta
+ OpenGL version string: 1.2 Mesa 3.4
The first example indicates that the 3dfx driver is using Voodoo3 hardware.
The second example indicates that no hardware driver was found and indirect,
@@ -521,16 +542,18 @@ cific to your graphics card.
This section presents hardware-specific information for normal use and trou-
bleshooting.
-10.1 3dfx Voodoo3 Series
+10.1 3dfx Banshee, Voodoo3, Voodoo4 and Voodoo5 Series
10.1.1 Dependencies
-The Voodoo3 DRI driver requires a special versions of the 3dfx Glide library.
-It can be downloaded from the DRI website.
+The 3dfx DRI driver requires special versions of the 3dfx Glide library.
+Different versions of Glide are needed for Banshee/Voodoo3 than for
+Voodoo4/5. The Glide libraries can be downloaded from the DRI website.
10.1.2 Configuration
-Your XF86Config file's device section must specify the tdfx device:
+Your XF86Config file's device section must specify the tdfx device. For
+example:
Section "Device"
Identifier "Voodoo3"
@@ -538,7 +561,15 @@ Your XF86Config file's device section must specify the tdfx device:
Driver "tdfx"
EndSection
-The Screen section should then reference the Voodoo3 device:
+Or,
+
+ Section "Device"
+ Identifier "Voodoo5"
+ VendorName "3dfx"
+ Driver "tdfx"
+ EndSection
+
+The Screen section should then reference the Voodoo device:
Section "Screen"
Identifier "Screen 1"
@@ -552,6 +583,25 @@ The Screen section should then reference the Voodoo3 device:
EndSubsection
EndSection
+Or,
+
+ Section "Screen"
+ Identifier "Screen 1"
+ Device "Voodoo5"
+ Monitor "High Res Monitor"
+ DefaultDepth 24
+ Subsection "Display"
+ Depth 16
+ Modes "1280x1024" "1024x768" "800x600" "640x480"
+ ViewPort 0 0
+ EndSubsection
+ Subsection "Display"
+ Depth 24
+ Modes "1280x1024" "1024x768" "800x600" "640x480"
+ ViewPort 0 0
+ EndSubsection
+ EndSection
+
The kernel module for the Voodoo3 is named tdfx.o and should be installed in
/lib/modules/2.4.x/kernel/driver/char/drm/. It will be automatically loaded
by the Xserver if needed.
@@ -569,9 +619,9 @@ ules/dri/tdfx_dri.so. This will be automatically loaded by libGL.so.
it means that you have the wrong version of the Glide library for your
hardware.
- o 3D acceleration for Voodoo3 is only supported in the 16 bit/pixel screen
- mode. Use xdpyinfo to verify that all your visuals are depth 16. Edit
- your XF86Config file if needed.
+ o 3D acceleration for Banshee and Voodoo3 is only supported in the 16
+ bit/pixel screen mode. Use xdpyinfo to verify that all your visuals are
+ depth 16. Edit your XF86Config file if needed.
o The /dev/3dfx device is not used for DRI; it's only for Glide on older
3dfx hardware.
@@ -584,6 +634,11 @@ ules/dri/tdfx_dri.so. This will be automatically loaded by libGL.so.
variable indicates the maximum number of swap buffer commands can be
buffered. Zero allows maximum frame rate.
+ o On Voodoo4/5, rendering with 16-bits/texel textures is faster than using
+ 32-bit per texel textures. The internalFormat parameter to glTexImage2D
+ can be used to control texel size. Quake3 and other games let you con-
+ trol this as well.
+
o The glTexEnv mode GL_BLEND is not directly supported by the Voodoo3
hardware. It can be accomplished with a multipass algorithm but it's
not implemented at this time. Applications which use that mode, such as
@@ -622,14 +677,6 @@ ules/dri/tdfx_dri.so. This will be automatically loaded by libGL.so.
o Using glColorMask(r, g, b, a) when r!=g or g!=b.
-10.1.5 Known Problems
-
- o The Glide library cannot be used directly; it's only meant to be used
- via the tdfx DRI driver.
-
- o SSystem has problems because of poorly set near and far clipping planes.
- The office.unc Performer model also suffers from this problem.
-
o The lowest mipmap level is sometimes miscolored in trilinear- sampled
polygons.
@@ -713,17 +760,30 @@ A software-based accumulation buffer is available in both 16 and 32bpp modes.
10.2.5 Known Problems
- o The Glide library cannot be used directly; it's only meant to be used
- via the tdfx DRI driver.
+ o The lowest mipmap level is sometimes miscolored in trilinear- sampled
+ polygons (Voodoo3/Banshee).
+
+ o Voodoo4/5 may be run at 24bpp (instead of 32bpp, the default) but 3D
+ acceleration is not supported in that mode. 32bpp mode is fully 3D
+ accelerated.
- o 24bpp screen modes are supported by the hardware but not by the current
- driver. 32bpp is fully supported.
+ o Fog doesn't work with orthographic projections.
+
+ o The accuracy of blending operations on Voodoo4/5 isn't always very good.
+ If you run Glean, you'll find some test failures.
o As of October, 2000 the second VSA-100 chip on the Voodoo5 is not yet
operational. Therefore, the board isn't being used to its full capac-
ity. The second VSA-100 chip will allow Scan-Line Interleave (SLI) mode
for full-screen applications and games, potentially doubling the sys-
- tem's fill rate.
+ tem's fill rate. When the second VSA-100 chip is activated glGet-
+ String(GL_RENDERER) will report Voodoo5 instead of Voodoo4.
+
+ o The Glide library cannot be used directly; it's only meant to be used
+ via the tdfx DRI driver.
+
+ o SSystem has problems because of poorly set near and far clipping planes.
+ The office.unc Performer model also suffers from this problem.
10.3 Intel i810
@@ -937,12 +997,12 @@ needed.
"
-Your XF86Config file's device section must specify the r128 device:
+Your XF86Config file's device section must specify the ati device:
Section "Device"
Identifier "Rage128"
VendorName "ATI"
- Driver "r128"
+ Driver "ati"
EndSection
The Screen section should then reference the Rage 128 device:
@@ -980,10 +1040,70 @@ GART, so they will not perform as well as their AGP counterparts.
10.5.4 Known Problems
-DGA is not yet supported in the ATI Rage 128 X server. This feature will be
-added in a future release.
+None.
+
+10.6 ATI Radeon
+
+ "
+
+10.6.1 Dependencies
+
+ "
+
+A Linux kernel with AGP GART support (such as the 2.4.x test kernels) is
+needed.
+
+10.6.2 Configuration
+
+ "
+
+Your XF86Config file's device section must specify the ati device:
+
+ Section "Device"
+ Identifier "Radeon"
+ VendorName "ATI"
+ Driver "ati"
+ EndSection
+
+The Screen section should then reference the Radeon device:
+
+ Section "Screen"
+ Identifier "Screen 1"
+ Device "Radeon"
+ Monitor "High Res Monitor"
+ DefaultDepth 16
+ Subsection "Display"
+ Depth 16
+ Modes "1280x1024" "1024x768" "800x600" "640x480"
+ ViewPort 0 0
+ EndSubsection
+ Subsection "Display"
+ Depth 32
+ Modes "1280x1024" "1024x768" "800x600" "640x480"
+ ViewPort 0 0
+ EndSubsection
+ EndSection
+
+The kernel module for the Radeon is named radeon.o and should be installed in
+/lib/modules/2.4.x/kernel/driver/char/drm/. It will be automatically loaded
+by the Xserver if needed.
+
+The DRI 3D driver for the Radeon should be in /usr/X11R6/lib/mod-
+ules/dri/radeon_dri.so. This will be automatically loaded by libGL.so.
+
+You may also set your screen depth to 32 for 32bpp mode.
+
+10.6.3 Performance
+
+While this driver supports many of the features of ATI Radeon cards, we do
+not yet fully support the card's TCL features. This work is progressing, but
+is not yet ready.
+
+10.6.4 Known Problems
+
+None.
-10.6 3DLabs Oxygen GMX 2000
+10.7 3DLabs Oxygen GMX 2000
The driver for this hardware was experimental and is no longer being devel-
oped or supported.
@@ -995,8 +1115,8 @@ oped or supported.
The following OpenGL features are not supported at this time: overlays,
stereo, hardware-accelerated indirect rendering.
-OpenGL-like functionality is provided with the Mesa library. XFree86 4.0.1
-uses Mesa 3.3. Subsequent releases of XFree86 will use newer versions of
+OpenGL-like functionality is provided with the Mesa library. XFree86 4.0.2
+uses Mesa 3.4. Subsequent releases of XFree86 will use newer versions of
Mesa. When newer versions of Mesa are available, the 3D drivers can be
updated without reinstalling XFree86 or libGL.so.
@@ -1096,7 +1216,7 @@ forge.net/resources/resources.html
o In the future there may be IHV and Linux vendor support resources for
the DRI.
- Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DRI.sgml,v 1.15 2000/12/12 18:54:29 dawes Exp $
+ Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DRI.sgml,v 1.16 2001/01/08 01:07:33 martin Exp $
-$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.DRI,v 1.12 2000/12/12 19:04:02 dawes Exp $
+$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.DRI,v 1.13 2001/01/21 21:19:14 tsi Exp $
diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.DRIcomp b/xc/programs/Xserver/hw/xfree86/doc/README.DRIcomp
index 66c216950..e2f847291 100644
--- a/xc/programs/Xserver/hw/xfree86/doc/README.DRIcomp
+++ b/xc/programs/Xserver/hw/xfree86/doc/README.DRIcomp
@@ -2,13 +2,13 @@
VA Linux Systems, Inc. Professional Services - Graphics.
- 29 October 2000
+ 5 January 2001
1. Preamble
1.1 Copyright
-Copyright © 2000 by VA Linux Systems, Inc. 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
@@ -24,12 +24,14 @@ Intel is a registered trademark of Intel Corporation. 3Dlabs, GLINT, and
Oxygen are either registered trademarks or trademarks of 3Dlabs Inc. Ltd.
3dfx, Voodoo3, Voodoo4, and Voodoo5 are registered trademarks of 3dfx Inter-
active, Incorporated. Matrox is a registered trademark of Matrox Electronic
-Systems Ltd. ATI Rage is a registered trademark of ATI Technologies, Inc.
-All other trademarks mentioned are the property of their respective owners.
+Systems Ltd. ATI Rage and Radeon is a registered trademark of ATI Technolo-
+gies, Inc. All other trademarks mentioned are the property of their respec-
+tive owners.
2. Introduction
This document describes how to download, compile and install the DRI project.
+The DRI provides 3D graphics hardware acceleration for the XFree86 project.
This information is intended for experienced Linux developers. Beginners are
probably better off installing precompiled packages.
@@ -40,11 +42,8 @@ inux.com.
You'll need the following:
- o At least 400MB of free disk space. More is needed if you want to build
- with debugging information or keep several build trees.
-
- o A fast system. Using a PIII-550 it takes about 1/2 hour to build every-
- thing.
+ o At least 200MB of free disk space. If you compile for debugging (the -g
+ option) then you'll need about 600MB.
o GCC compiler and related tools.
@@ -55,9 +54,12 @@ You'll need the following:
o FreeBSD support is not currently being maintained and may not work.
+The DRI 3D drivers generally work on systems with Intel or AMD CPUs. How-
+ever, there is limited support for Alpha and Sparc.
+
For 3dfx Voodoo3 hardware, you'll also need:
- o Glide3x headers and runtime library if you want to use the 3dfx driver.
+ o Glide3 headers and runtime library if you want to use the 3dfx driver.
These can be obtained from linux.3dfx.com.
o A recent Linux 2.4.x kernel. AGP support is not required.
@@ -70,20 +72,23 @@ For Intel i810 hardware, you'll also need:
o A recent Linux 2.4.x kernel with AGP support.
-For ATI Rage hardware, you'll also need:
+For ATI Rage 128 and Radeon hardware, you'll also need:
o A recent Linux 2.4.x kernel with AGP support.
4. Linux Kernel Preparation
The DRI project closely tracks Linux kernel development. Since the internal
-Linux data structures change frequently in the 2.4 development branch it's
-important to have use the most recent Linux kernel. As of this writing (Nov
-2000), 2.4.0-test11-pre5 is the most recent version of Linux which the DRI is
-synchronized to.
+Linux data structures might change in the 2.4 Linux kernel, it's important to
+have use the most recent Linux kernel. As of this writing (Jan 2001), 2.4.0
+is the most recent version of Linux which the DRI is synchronized to.
Most of the DRI drivers require AGP support and using Intel Pentium III SSE
-optimizations also requires an up-to-date Linux kernel.
+optimizations also requires an up-to-date Linux kernel. Configuring your
+kernel correctly is very important, as features such as SSE optimizations
+will be disabled if your kernel does not support them. Thus, if you have a
+Pentium III processor, you must configure your kernel for the Pentium III
+processor family.
Building a new Linux kernel can be difficult for beginners but there are
resources on the Internet to help. This document assumes experience with
@@ -102,6 +107,17 @@ Here are the basic steps for kernel setup.
ln -s linux-2.4.x linux
bzcat linux-2.4.x.tar.bz2 | tar xf -
+ It is critical that /usr/src/linux point to your new kernel sources,
+ otherwise the kernel headers will not be used when building the DRI.
+ This will almost certainly cause compilation problems.
+
+ o Read /usr/src/linux/Documentation/Changes. This file lists the minimum
+ requirements for all software packages required to build the kernel.
+ You must upgrage at least gcc, make, binutils and modutils to at least
+ the versions specified in this file. The other packages may not be
+ needed. If you are upgrading from Linux 2.2.x you must upgrade your
+ modutils package for Linux 2.4.x.
+
o Configure your kernel. You might, for example, use make menuconfig and
do the following:
@@ -111,6 +127,12 @@ Here are the basic steps for kernel setup.
o hit ESC to return to the top-level menu
+ o Go to Processor type and features
+
+ o Select your processor type from Processor Family
+
+ o hit ESC to return to the top-level menu
+
o Go to Character devices
o Disable Direct Rendering Manager (XFree86 DRI support) since we'll
@@ -153,12 +175,59 @@ Here are the basic steps for kernel setup.
Note that last make command will automatically run lilo for you.
- o Upgrade your modutils package for Linux 2.4.x if you're upgrading from
- Linux 2.2.x.
-
o Now reboot to use the new kernel.
-5. Downloading the XFree86/DRI CVS Sources
+5. CPU Architectures
+
+In general, nothing special has to be done to use the DRI on different CPU
+architectures. There are, however, a few optimizations that are CPU-depen-
+dent. Mesa will determine at runtime which CPU-dependent optimizations
+should be used and enable them where appropriate.
+
+5.1 Intel Pentium III Features
+
+ "
+
+The Pentium III SSE (Katmai) instructions are used in optimized vertex trans-
+formation functions in the Mesa-based DRI drivers. On Linux, SSE requires a
+recent kernel (such as 2.4.0-test11 or later) both at compile time and run-
+time.
+
+5.2 AMD 3DNow! Features
+
+ "
+
+AMD's 3DNow! instructions are used in optimized vertex transformation func-
+tions in the Mesa-based DRI drivers. 3DNow! is supported in most versions of
+Linux.
+
+5.3 Alpha Features
+
+ "
+
+On newer Alpha processors a significant performance increase can be seen with
+the addition of the -mcpu= option to GCC. This option is dependent on the
+architecture of the processor. For example, -mcpu=ev6 will build specifi-
+cally for the EV6 based AXP's, giving both byte and word alignment access to
+the DRI/Mesa drivers.
+
+To enable this optimization edit your xc/config/host.def file and add the
+line:
+
+#define DefaultCCOptions -ansi GccWarningOptions -pipe -mcpu=ev6
+
+Additional speed improvements to 3D rendering can be achieved by installing
+Compaq's Math Libraries (CPML) which can be obtained from http://www.sup-
+port.compaq.com/alpha-tools/software/index.html
+
+Once installed, you can add this line to your host.def to build with the CPML
+libraries:
+
+#define UseCompaqMathLibrary YES
+
+The host.def file is explained below.
+
+6. Downloading the XFree86/DRI CVS Sources
The DRI project is hosted by VA Linux Systems' SourceForge. The DRI source
code, which is a subset of the XFree86 source tree, is kept in a CVS reposi-
@@ -169,7 +238,7 @@ SourceForge user. It's recommended that you become a registered SourceForge
user so that you may submit non-anonymous bug reports and can participate in
the mailing lists.
-5.1 Anonymous CVS download:
+6.1 Anonymous CVS download:
1. Create a directory to store the CVS files:
@@ -189,7 +258,7 @@ the mailing lists.
The -z3 flag causes compression to be used in order to reduce the down-
load time.
-5.2 Registered CVS download:
+6.2 Registered CVS download:
1. Create a directory to store the CVS files:
@@ -215,7 +284,7 @@ the mailing lists.
The -z3 flag causes compression to be used in order to reduce the down-
load time.
-5.3 Updating your CVS sources
+6.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:
@@ -226,7 +295,7 @@ source code to get the latest changes. This can be done with:
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
+7. 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
@@ -239,9 +308,9 @@ 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
+8. Compiling the XFree86/DRI tree
-7.1 Make a build tree
+8.1 Make a build tree
Rather than placing object files and library files right in the source tree,
they're instead put into a parallel build tree. The build tree is made with
@@ -259,7 +328,7 @@ the CVS source tree.
Advanced users may have several build trees for compiling and testing with
different options.
-7.2 Edit the host.def file
+8.2 Edit the host.def file
The ~/DRI-CVS/build/xc/config/cf/host.def file is used to configure the
XFree86 build process. You can change it to customize your build options or
@@ -272,7 +341,7 @@ The default host.def file will look something like this:
(Alpha) #define DefaultGcc2AxpOpt -O2 -mcpu=ev6 (or similar)
#define LibraryCDebugFlags -O2
#define BuildServersOnly YES
- #define XF86CardDrivers vga tdfx mga r128 i810
+ #define XF86CardDrivers vga tdfx mga ati i810
#define LinuxDistribution LinuxRedHat
#define DefaultCCOptions -ansi GccWarningOptions -pipe
#define BuildXF86DRI YES
@@ -281,6 +350,7 @@ The default host.def file will look something like this:
/* #define GlxBuiltInTdfx YES */
/* #define GlxBuiltInMga YES */
/* #define GlxBuiltInR128 YES */
+ /* #define GlxBuiltInRadeon YES */
/* #define DoLoadableServer NO */
#define SharedLibFont NO
@@ -294,11 +364,26 @@ Especially note the XF86CardDrivers line to be sure your driver is listed.
If you have 3dfx hardware be sure that the Glide 3x headers are installed in
/usr/include/glide3/ and that the Glide 3x library is installed at
-/usr/lib/libglide3x.so.
+/usr/lib/libglide3.so.
If you do not have 3dfx hardware comment out the HasGlide3 line in host.def.
-7.3 Compilation
+If you want to enable 3DNow! optimizations in Mesa and the DRI drivers, you
+should add the following:
+
+ #define MesaUse3DNow YES
+
+If you want to enable SSE optimizations in Mesa and the DRI drivers, you must
+upgrade to a Linux 2.4.x kernel. Mesa will verify that SSE is supported by
+both your processor and your operating system, but to build Mesa inside the
+DRI you need to have the Linux 2.4.x kernel headers in /usr/src/linux. If
+you enable SSE optimizations with an earlier version of the Linux kernel in
+/usr/src/linux, Mesa will not compile. You have been warned. If you do have
+a 2.4.x kernel, you should add the following:
+
+ #define MesaUseKatmai YES
+
+8.3 Compilation
To compile the complete DRI tree:
@@ -320,7 +405,7 @@ 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
+8.4 Check for compilation errors
Using your text editor, examine World.LOG for errors by searching for the
pattern ***.
@@ -331,8 +416,8 @@ Verify that the DRI kernel module(s) for your system were built:
ls
For the 3dfx Voodoo, you should see tdfx.o. For the Matrox G200/G400, you
-should see mga.o. For the ATI Rage 128, you should see r128.o. For the
-Intel i810, you should see i810.o.
+should see mga.o. For the ATI Rage 128, you should see r128.o. For the ATI
+Radeon, you should see radeon.o. For the Intel i810, you should see i810.o.
If the DRI kernel module(s) failed to build you should verify that you're
using the right version of the Linux kernel. The most recent kernels are not
@@ -352,7 +437,7 @@ 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.
-7.5 DRI kernel module installation
+8.5 DRI kernel module installation
The DRI kernel modules are in ~/DRI-CVS/build/xc/pro-
grams/Xserver/hw/xfree86/os-support/linux/drm/kernel/.
@@ -364,7 +449,7 @@ ules/2.4.x/kernel/driver/char/drm/ then run depmod and restart your X server.
Make sure you first unload any older DRI kernel modules that might be already
loaded.
-8. Normal Installation and Configuration
+9. 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
@@ -374,7 +459,7 @@ 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
+9.1 X Installation
You'll need to run as root to do the following commands:
@@ -388,7 +473,7 @@ already exist, then run the install commands:
cd ~/DRI-CVS/build/xc
make install
-8.2 Linker configuration
+9.2 Linker configuration
Edit your /etc/ld.so.conf file and put /usr/X11R6-DRI/lib as the first line.
Then run:
@@ -397,7 +482,7 @@ Then run:
This will ensure that you use the new X libraries when you run X programs.
-8.3 Update Locale Information
+9.3 Update Locale Information
To update your X locale information do the following:
@@ -409,7 +494,7 @@ To update your X locale information do the following:
This will prevent a locale error message from being printed when you run Xlib
programs.
-8.4 Setup Miscellaneous Files
+9.4 Setup Miscellaneous Files
Issue the following commands:
@@ -421,7 +506,7 @@ Issue the following commands:
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
+9.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.
@@ -435,7 +520,7 @@ Issue the following commands:
This will cause the new X server to be used instead of the original one.
-8.6 Create the XF86Config File
+9.6 Create the XF86Config File
Configuration files for XFree86 3.3.x will not work with XFree86 4.0.x.
@@ -460,20 +545,20 @@ 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
+9.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
+10. 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
+10.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-
@@ -481,7 +566,7 @@ CVS/build/xc/programs/Xserver directory.
Be sure the ModulePath option is set correctly.
-9.2 A Startup Script
+10.2 A Startup Script
A simple shell script can be used to start the X server. Here's an example.
@@ -508,13 +593,13 @@ server in a file. If you're using the C-shell:
./start-dri >& log
-10. Where To Go From Here
+11. 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 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.9 2000/12/12 17:48:10 alanh Exp $
+ Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DRIcomp.sgml,v 1.10 2001/01/08 01:07:34 martin Exp $
-$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.DRIcomp,v 3.6 2000/12/12 19:04:02 dawes Exp $
+$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.DRIcomp,v 3.7 2001/01/21 21:19:14 tsi Exp $
diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.trident b/xc/programs/Xserver/hw/xfree86/doc/README.trident
deleted file mode 100644
index b123ae2a8..000000000
--- a/xc/programs/Xserver/hw/xfree86/doc/README.trident
+++ /dev/null
@@ -1,180 +0,0 @@
- Information for Trident Chipset Users
-
- The XFree86 Project, Inc.
-
- June 25 1999
-
-1. Supported chipsets
-
-The Trident driver has undergone some slight work for XFree86 3.3.3. Because
-of this work, all of the Trident SVGA chipsets, except the very first one,
-are supported by both the color and monochrome servers.
-
- 8800CS 8200LX 8900B 8900C 8900CL/D 9000 9000i 9100B 9200CXr 9320LCD
- 9400CXi 9420 9420DGi 9430DGi 9440AGi 9660XGi 9680 ProVidia9682 Pro-
- Vidia9685 Cyber9382 Cyber9385 Cyber9385-1 Cyber9388 Cyber9397
- Cyber9520 Cyber9525 3DImage975(PCI) 3DImage975(AGP) 3DImage985(AGP)
- Blade3D CyberBlade
-
-It must be noted that the 9000i chipset is treated as a 9000 by the server.
-Additionally the 9100B is treated as a Trident 8900CL. Therefore it is equiv-
-alent to putting `Chipset "tvga8900cl"' or `Chipset "tvga9000"' in the
-XF86Config file. Also, note that the 9000i, 9100B have not been tested with
-the server, but should work in this way according to the chipset documenta-
-tion.
-
- NOTES:
-
- o The chipset keyword changed in XFree86 v3.3.2 and now you no longer
- specify 'tgui96xx' as the generic keyword, but you actually specify your
- chip. i.e. Chipset 'tgui9685' will set a ProVidia9685 chip.
-
- o The Cyber9388/9397, 3DImage975 and 3DImage985 cards are fixed in
- XFree86 v3.3.3, these chipsets have some acceleration now too. This
- acceleration has been disabled by default for the Cyber9388/9397 because
- there have been problems, but it can be re-enabled with the "accel"
- option (see below).
-
- o 24bpp is all drivers remains unaccelerated, this will change in a
- future version, although 32bpp acceleration is supported for all TGUI
- based chipset except the 9440 which doesn't have the capability.
-
- o 16bpp is now supported for the Cyber9320 chipset.
-
- Option "nolinear"
- Turn off linear mapping
-
- Option "linear"
- Force linear mapping. Use this if you have a non-PCI card
- and require 16bpp support. Note: ISA cards can only access
- up to 16MB of memory, so be sure you have less than this or
- it could cause a system hang.
-
- MemBase 0x???????
- This option may be used to specify the start address of the
- linear frame buffer. By default for VLBus/EISA cards it is
- at 60MB. For the 8900CL/D, it is at 15MB.
-
- Option "no_mmio"
- This option turns off Memory Mapped IO support. MMIO is
- enabled by default when acceleration is enabled. Accelera-
- tion doesn't work well when MMIO is disabled.
-
- Option "tgui_pci_read_on"
- Turn on PCI burst read mode.
-
- Option "tgui_pci_write_on"
- Turn on PCI burst write mode.
-
- Option "pci_burst_on"
- Turn on PCI burst (read and write)
-
- Option "pci_burst_off"
- Turn off PCI burst (read and write)
-
- NOTE: PCI burst modes are now OFF by default for TGUI9440
- cards because it often upsets its Graphics Accelerator. It
- can be turned it back on as may improve performance. PCI
- burst modes are ON by default for all other PCI/AGP cards.
-
- ClockChip "tgui"
- Turn on programmable clocks. This is the default for TGUIs.
-
- Option "no_program_clocks"
- Turn off programmable clock. Use fixed VGA clocks only.
- Useful for fixed frequency monitors - usually used for VGA
- monitors - not SVGA.
-
- Option "noaccel"
- Turn off XAA acceleration.
-
- Option "accel"
- Enable acceleration for the Cyber9388/9397.
-
- Option "xaa_no_color_exp"
- Disable color expansion.
-
- Option "no_stretch"
- Disable LCD stretching on Cyber 938x based chips.
-
- Option "lcd_center"
- Enable LCD centering on Cyber 938x based chips.
-
- Option "cyber_shadow"
- Enable Shadow registers, might be needed for some Cyber
- chipsets. (laptop machines)
-
- Option "tgui_mclk_66"
- Pushes the Memory Clock from its default value to 66MHz.
- Increases graphics speed dramatically, but use entirely at
- your own risk, as it may damage the video card. If snow
- appears, disable. Only tested on the 9440.
-
-The original Trident chipset, 8800BR, cannot be supported as an SVGA chipset
-by either the color or monochrome servers. The chip is supported, however,
-by the ``generic'' driver for the monochrome server.
-
-2. Special considerations for 512k boards
-
-There are no longer any special considerations for 512k Trident boards. The
-driver is now configured so that they can use modes with normal timings. The
-available pixel clocks are halved compared with those specified on the Clocks
-line
-
-Be aware that older Trident chipsets support a maximum clock of 65Mhz. Hence
-the best actual clock available to the color server is 32.5Mhz. This means,
-in broad terms, that the color server will require an interlaced mode to be
-defined for resolutions above 640x480. Newer chipsets (8900CL, 9000, 9000i,
-9100B, 9200CX and 9420) support up to 16 clocks, and can support much higher
-clocks, which will allow 800x600 modes, non-interlaced.
-
-3. Additional Notes
-
-We have had reports of the server failing to detect the amount of installed
-memory and the correct dot-clocks on older TVGA8900 boards. If the server
-fails to detect the correct amount of memory, use the "Videoram" keyword in
-your XF86Config file to specify it. (e.g. Videoram 512 or Videoram 1024).
-If the server has problems detecting the dot-clocks, try adding the following
-line to your XF86Config file:
-
- Clocks 25 28 45 36 57 65 50 40
-
-This line gives the clock values provided by older Trident clock synthesizer
-chipsets. This also appears to be the standard first 8 clocks for the newer
-clock synthesizers, but you should have no problems on newer boards.
-
-Some newer Trident 8900B/C boards are apparently being built with the clock
-synthesizers used on the 9000 and 8900CL boards. If your board has a chip
-labeled "Trident TCK900x" ("x" has been seen as 2 or 4; there may be others),
-your board may actually have a 4th clock select bit. The 9002 has twelve
-distinct clocks (the other 4 are duplicates); the 9004 has 16 clocks (the
-same 12 as the 9002 + 4 others). If you see such a chip on a board with an
-8900B or 8900C, put the following line in the Device section of your XF86Con-
-fig file:
-
- Option "16clocks"
-
-This will cause the same clock selection code as is used for the 8900CL to be
-used for the board.
-
-While developing the Trident driver, an interesting and perturbing hardware
-phenomenon was discovered. When using the default board jumper configura-
-tion, dot-clocks above 57Mhz would frequently lock up the machine. There
-appear to be jumpers on all of the Trident boards that determine whether the
-board will operate in zero-wait-state mode on the ISA bus. Disabling the
-zero-wait-state mode via jumpers cured the lockups, but at the expense of
-performance. Whether or not a given system will experience this problem is
-likely a combination of (a) bus speed, (b) video memory speed, and (c) dot
-clock speed. So be prepared for this phenomenon to occur, and have the board
-documentation handy.
-
-NOTE: VLBus cards are also subject to the above. By specifying the Clocks in
-the XF86Config file, these lockups are overcome. But it may be worth checking
-wait states etc. on the card and in the BIOS setup.
-
- Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/trident.sgml,v 3.24 1999/08/23 06:38:54 dawes Exp $
-
- $XConsortium: trident.sgml /main/11 1996/10/28 04:24:08 kaleb $
-
-
-$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.trident,v 3.36 1999/08/23 07:03:53 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 3265a170d..db7f14955 100644
--- a/xc/programs/Xserver/hw/xfree86/doc/sgml/DRI.sgml
+++ b/xc/programs/Xserver/hw/xfree86/doc/sgml/DRI.sgml
@@ -12,9 +12,8 @@
name="VA Linux Systems, Inc."> Professional Services - Graphics.
<date>15 March 2001
-<p>
<ident>
- $XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DRI.sgml,v 1.15 2000/12/12 18:54:29 dawes Exp $
+ $XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DRI.sgml,v 1.16 2001/01/08 01:07:33 martin 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 2fbbfef25..750da12d2 100644
--- a/xc/programs/Xserver/hw/xfree86/doc/sgml/DRIcomp.sgml
+++ b/xc/programs/Xserver/hw/xfree86/doc/sgml/DRIcomp.sgml
@@ -12,10 +12,8 @@
name="VA Linux Systems, Inc."> Professional Services - Graphics.
<date>15 March 2001
-<p>
-
<ident>
- $XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DRIcomp.sgml,v 1.9 2000/12/12 17:48:10 alanh Exp $
+ $XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DRIcomp.sgml,v 1.10 2001/01/08 01:07:34 martin Exp $
</ident>
<toc>
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/apm/apm.cpp b/xc/programs/Xserver/hw/xfree86/drivers/apm/apm.cpp
deleted file mode 100644
index a38fed3b9..000000000
--- a/xc/programs/Xserver/hw/xfree86/drivers/apm/apm.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/apm/apm.cpp,v 1.5 2000/12/11 20:18:05 dawes Exp $
-.\" shorthand for double quote that works everywhere.
-.ds q \N'34'
-.TH APM __drivermansuffix__ "Version 4.0.2" "XFree86"
-.SH NAME
-apm \- Alliance ProMotion video driver
-.SH SYNOPSIS
-.nf
-.B "Section \*qDevice\*q"
-.BI " Identifier \*q" devname \*q
-.B " Driver \*qapm\*q"
-\ \ ...
-.B EndSection
-.fi
-.SH DESCRIPTION
-.B apm
-is an XFree86 driver for Alliance ProMotion video cards.
-THIS MAN PAGE NEEDS TO BE FILLED IN.
-.SH SUPPORTED HARDWARE
-The
-.B apm
-driver supports...
-.SH CONFIGURATION DETAILS
-Please refer to XF86Config(__filemansuffix__) for general configuration
-details. This section only covers configuration details specific to this
-driver.
-.SH "SEE ALSO"
-XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__)
-.SH AUTHORS
-Authors include: ...
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ark/ark_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/ark/ark_driver.c
index ed7dbc03c..15e4eedbe 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ark/ark_driver.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ark/ark_driver.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ark/ark_driver.c,v 1.9 2000/12/02 15:30:31 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ark/ark_driver.c,v 1.11 2001/01/29 15:15:44 keithp Exp $ */
/*
* Copyright 2000 Ani Joshi <ajoshi@unixbox.com>
*
@@ -28,7 +28,7 @@
*
*/
-
+#define COMPILER_H_EXTRAS
#include "xf86.h"
#include "xf86_OSproc.h"
#include "xf86_ansic.h"
@@ -43,7 +43,7 @@
#include "mipointer.h"
#include "micmap.h"
#include "mibstore.h"
-
+#include "fb.h"
#include "ark.h"
@@ -73,7 +73,7 @@ static void ARKLoadPalette(ScrnInfoPtr pScrn, int numColors,
static void ARKWriteMode(ScrnInfoPtr pScrn, vgaRegPtr pVga, ARKRegPtr new);
/* helpers */
-static unsigned char get_daccomm();
+static unsigned char get_daccomm(void);
static unsigned char set_daccom(unsigned char comm);
@@ -262,11 +262,8 @@ static Bool ARKPreInit(ScrnInfoPtr pScrn, int flags)
EntityInfoPtr pEnt;
ARKPtr pARK;
vgaHWPtr hwp;
- MessageType from = X_DEFAULT;
int i;
ClockRangePtr clockRanges;
- char *mod = NULL;
- const char *reqSym = NULL;
rgb zeros = {0, 0, 0};
Gamma gzeros = {0.0, 0.0, 0.0};
unsigned char tmp;
@@ -414,10 +411,11 @@ static Bool ARKPreInit(ScrnInfoPtr pScrn, int flags)
pScrn->videoRam = 2048;
else
pScrn->videoRam = 4096;
- }
+ }
- xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Detected %d bytes video ram\n",
- pScrn->videoRam);
+ xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Detected %d bytes video ram\n",
+ pScrn->videoRam);
+ }
/* try to detect the RAMDAC */
{
@@ -491,15 +489,12 @@ static Bool ARKPreInit(ScrnInfoPtr pScrn, int flags)
return TRUE;
}
-}
static Bool ARKScreenInit(int scrnIndex, ScreenPtr pScreen, int argc,
char **argv)
{
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
ARKPtr pARK = ARKPTR(pScrn);
- BoxRec MemBox;
- int i;
pScrn->fbOffset = 0;
@@ -530,11 +525,15 @@ static Bool ARKScreenInit(int scrnIndex, ScreenPtr pScreen, int argc,
return FALSE;
}
+ miSetPixmapDepths ();
+
if (!fbScreenInit(pScreen, pARK->FBBase, pScrn->virtualX,
pScrn->virtualY, pScrn->xDpi, pScrn->yDpi,
pScrn->displayWidth, pScrn->bitsPerPixel))
return FALSE;
+ fbPictureInit (pScreen, 0, 0);
+
xf86SetBlackWhitePixels(pScreen);
if (pScrn->bitsPerPixel > 8) {
@@ -1131,7 +1130,7 @@ static void ARKFreeScreen(int scrnIndex, int flags)
}
-static unsigned char get_daccomm()
+static unsigned char get_daccomm(void)
{
unsigned char tmp;
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/Imakefile b/xc/programs/Xserver/hw/xfree86/drivers/ati/Imakefile
index 342e7f8cf..236e025cc 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/Imakefile
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/Imakefile
@@ -1,6 +1,6 @@
-XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/Imakefile,v 1.25 2000/11/02 16:55:26 tsi Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/Imakefile,v 1.28 2001/01/24 00:06:15 dawes Exp $
XCOMM
-XCOMM Copyright 1997 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+XCOMM Copyright 1997 through 2001 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
XCOMM
XCOMM Permission to use, copy, modify, distribute, and sell this software and
XCOMM its documentation for any purpose is hereby granted without fee, provided
@@ -162,11 +162,9 @@ InstallObjectModule(r128,$(MODULEDIR),drivers)
InstallObjectModule(radeon,$(MODULEDIR),drivers)
#if 0
-CppManTarget(ati,)
InstallModuleManPage(ati)
#endif
-CppManTarget(r128,)
InstallModuleManPage(r128)
DependTarget()
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/ati.cpp b/xc/programs/Xserver/hw/xfree86/drivers/ati/ati.cpp
deleted file mode 100644
index 7d7de05f0..000000000
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/ati.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/ati.cpp,v 1.6 2000/12/11 20:18:06 dawes Exp $
-.\" shorthand for double quote that works everywhere.
-.ds q \N'34'
-.TH ATI __drivermansuffix__ "Version 4.0.2" "XFree86"
-.SH NAME
-ati \- ATI video driver
-.SH SYNOPSIS
-.nf
-.B "Section \*qDevice\*q"
-.BI " Identifier \*q" devname \*q
-.B " Driver \*qati\*q"
-\ \ ...
-.B EndSection
-.fi
-.SH DESCRIPTION
-.B ati
-is an XFree86 driver for ATI video cards.
-THIS MAN PAGE NEEDS TO BE FILLED IN.
-.SH SUPPORTED HARDWARE
-The
-.B ati
-driver supports...
-.SH CONFIGURATION DETAILS
-Please refer to XF86Config(__filemansuffix__) for general configuration
-details. This section only covers configuration details specific to this
-driver.
-.SH "SEE ALSO"
-XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__)
-.SH AUTHORS
-Authors include: ...
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atidga.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/atidga.c
index 6a8147fcd..42d52a061 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atidga.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atidga.c
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atidga.c,v 1.4 2000/10/11 22:52:55 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atidga.c,v 1.5 2001/01/06 20:58:05 tsi Exp $ */
/*
- * Copyright 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 2000 through 2001 by Marc Aurele La France (TSI @ UQV), tsi@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
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atidga.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/atidga.h
index 7340def10..19bb85f49 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atidga.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atidga.h
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atidga.h,v 1.2 2000/08/04 21:07:13 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atidga.h,v 1.3 2001/01/06 20:58:05 tsi Exp $ */
/*
- * Copyright 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 2000 through 2001 by Marc Aurele La France (TSI @ UQV), tsi@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
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64io.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64io.h
index e19c4019f..3ca64947a 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64io.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64io.h
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64io.h,v 1.4 2000/10/11 22:52:56 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64io.h,v 1.7 2001/02/12 03:31:05 tsi Exp $ */
/*
- * Copyright 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 2000 through 2001 by Marc Aurele La France (TSI @ UQV), tsi@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
@@ -46,10 +46,12 @@
* inm/outm 32-bit R/W through MMIO space. The register is specified as
* the actual MMIO offset (with Block 1 following Block 0), which,
* in this case, is equivalent to the register's IOPortTag from
- * atiregs.h. Can only be used for those few non-FIFO'ed
- * registers outside of Block 0's first 256 bytes. pATI->pBlock
- * array elements must have been previously set up by
- * ATIMapApertures().
+ * atiregs.h. Can be used for those few non-FIFO'ed registers
+ * outside of Block 0's first 256 bytes. inm() can also be used
+ * for FIFO'ed registers if, and only if, it can be guaranteed to
+ * not have been previously FIFO'ed (e.g. when the engine is
+ * idle). pATI->pBlock array elements must have been previously
+ * set up by ATIMapApertures().
*
* outf 32-bit write through MMIO cache. Identical to outm() but
* intended for FIFO'ed registers. There is no inf() provided.
@@ -166,11 +168,11 @@ extern void ATIMach64PollEngineStatus FunctionPrototype((ATIPtr));
*/
#define ATIMach64WaitForFIFO(_pATI, _n) \
while (pATI->nAvailableFIFOEntries < (_n)) \
- ATIMach64PollEngineStatus(pATI);
+ ATIMach64PollEngineStatus(pATI)
#define ATIMach64WaitForIdle(_pATI) \
while (pATI->EngineIsBusy) \
- ATIMach64PollEngineStatus(pATI);
+ ATIMach64PollEngineStatus(pATI)
extern void ATIAccessMach64PLLReg FunctionPrototype((ATIPtr, const CARD8,
const Bool));
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atimodule.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/atimodule.h
index 8197d9c69..7dcbc079c 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atimodule.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atimodule.h
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimodule.h,v 1.6 2000/11/02 16:55:28 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimodule.h,v 1.7 2001/01/06 20:58:06 tsi Exp $ */
/*
- * Copyright 1997 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1997 through 2001 by Marc Aurele La France (TSI @ UQV), tsi@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
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128.cpp b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128.cpp
deleted file mode 100644
index da732b0bd..000000000
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128.cpp
+++ /dev/null
@@ -1,75 +0,0 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128.cpp,v 1.3 2000/12/11 20:18:07 dawes Exp $
-.\" shorthand for double quote that works everywhere.
-.ds q \N'34'
-.TH R128 __drivermansuffix__ "Version 4.0.2" "XFree86"
-.SH NAME
-r128 \- ATI Rage 128 video driver
-.SH SYNOPSIS
-.nf
-.B "Section \*qDevice\*q"
-.BI " Identifier \*q" devname \*q
-.B " Driver \*qr128\*q"
-\ \ ...
-.B EndSection
-.fi
-.SH DESCRIPTION
-.B r128
-is an XFree86 driver for ATI Rage 128 based video cards. It contains
-full support for 8, 15, 16 and 24 bit pixel depths, hardware
-acceleration of drawing primitives, hardware cursor, video modes up to
-1800x1440 @ 70Hz, doublescan modes (e.g., 320x200 and 320x240), gamma
-correction at all pixel depths, a fully programming dot clock and robust
-text mode restoration for VT switching.
-.SH SUPPORTED HARDWARE
-The
-.B r128
-driver supports all ATI Rage 128 based video cards including the Rage
-Fury AGP 32MB, the XPERT 128 AGP 16MB and the XPERT 99 AGP 8MB.
-.SH CONFIGURATION DETAILS
-Please refer to XF86Config(__filemansuffix__) for general configuration
-details. This section only covers configuration details specific to this
-driver.
-.PP
-The driver auto-detects all device information necessary to initialize
-the card. However, if you have problems with auto-detection, you can
-specify:
-.PP
-.RS 4
-VideoRam - in kilobytes
-.br
-MemBase - physical address of the linear framebuffer
-.br
-IOBase - physical address of the MMIO registers
-.br
-ChipID - PCI DEVICE ID
-.RE
-.PP
-In addition, the following driver
-.B Options
-are supported:
-.TP
-.BI "Option \*qSWcursor\*q \*q" boolean \*q
-Selects software cursor. The default is
-.B off.
-.TP
-.BI "Option \*qNoAccel\*q \*q" boolean \*q
-Enables or disables all hardware acceleration. The default is to
-.B enable
-hardware acceleration.
-.TP
-.BI "Option \*qDac6Bit\*q \*q" boolean \*q
-Enables or disables the use of 6 bits per color component when in 8 bpp
-mode (emulates VGA mode). By default, all 8 bits per color component
-are used. The default is
-.B off.
-.TP
-.BI "Option \*qVideoKey\*q \*q" integer \*q
-This overrides the default pixel value for the YUV video overlay key.
-The default value is
-.B undefined.
-.SH "SEE ALSO"
-XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__)
-.SH AUTHORS
-.nf
-Rickard E. (Rik) Faith \fIfaith@precisioninsight.com\fP
-Kevin E. Martin \fIkevin@precisioninsight.com\fP
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128.h
index 75d3e855c..003b9aa2e 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128.h,v 1.8 2000/12/08 19:15:33 martin Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128.h,v 1.10 2001/01/16 05:11:06 martin Exp $ */
/*
* Copyright 1999, 2000 ATI Technologies Inc., Markham, Ontario,
* Precision Insight, Inc., Cedar Park, Texas, and
@@ -193,7 +193,6 @@ 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 */
@@ -203,8 +202,9 @@ typedef struct {
unsigned long FbMapSize; /* Size of frame buffer, in bytes */
int Flags; /* Saved copy of mode flags */
+ CARD8 BIOSDisplay; /* Device the BIOS is set to display to */
+
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 */
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_accel.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_accel.c
index 6a2d75aef..6cc71a9ce 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_accel.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_accel.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_accel.c,v 1.4 2000/12/04 19:21:52 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_accel.c,v 1.6 2000/12/22 05:27:45 tsi Exp $ */
/*
* Copyright 1999, 2000 ATI Technologies Inc., Markham, Ontario,
* Precision Insight, Inc., Cedar Park, Texas, and
@@ -77,7 +77,6 @@
*
*/
-#define R128_IMAGEWRITE 0 /* Disable ImageWrites - faster in software */
#define R128_TRAPEZOIDS 0 /* Trapezoids don't work */
/* Driver data structures */
@@ -149,7 +148,8 @@ void R128EngineReset(ScrnInfoPtr pScrn)
OUTREG(R128_GEN_RESET_CNTL, gen_reset_cntl | R128_SOFT_RESET_GUI);
INREG(R128_GEN_RESET_CNTL);
- OUTREG(R128_GEN_RESET_CNTL, gen_reset_cntl & ~R128_SOFT_RESET_GUI);
+ OUTREG(R128_GEN_RESET_CNTL,
+ gen_reset_cntl & (CARD32)(~R128_SOFT_RESET_GUI));
INREG(R128_GEN_RESET_CNTL);
OUTPLL(R128_MCLK_CNTL, mclk_cntl);
@@ -870,7 +870,6 @@ static void R128SubsequentColorExpandScanline(ScrnInfoPtr pScrn, int bufno)
x11perf -putimage100 2150.0/sec 1170.0/sec
x11perf -putimage500 108.0/sec 49.8/sec
*/
-#if R128_IMAGEWRITE
static void R128SetupForScanlineImageWrite(ScrnInfoPtr pScrn,
int rop,
unsigned int planemask,
@@ -1003,7 +1002,6 @@ static void R128SubsequentImageWriteScanline(ScrnInfoPtr pScrn, int bufno)
}
}
}
-#endif
/* Initialize the acceleration hardware. */
void R128EngineInit(ScrnInfoPtr pScrn)
@@ -1155,7 +1153,6 @@ static void R128MMIOAccelInit(ScrnInfoPtr pScrn, XAAInfoRecPtr a)
| LINE_PATTERN_POWER_OF_2_ONLY);
/* ImageWrite */
-#if R128_IMAGEWRITE
a->NumScanlineImageWriteBuffers = 1;
a->ScanlineImageWriteBuffers = info->scratch_buffer;
info->scratch_buffer[0] = info->scratch_save;
@@ -1169,7 +1166,6 @@ static void R128MMIOAccelInit(ScrnInfoPtr pScrn, XAAInfoRecPtr a)
| LEFT_EDGE_CLIPPING
| LEFT_EDGE_CLIPPING_NEGATIVE_X
| SCANLINE_PAD_DWORD;
-#endif
}
/* Initialize XAA for supported acceleration and also initialize the
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_cursor.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_cursor.c
index e7bbd37ec..44b90300e 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_cursor.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_cursor.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_cursor.c,v 1.3 2000/11/18 19:37:10 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_cursor.c,v 1.4 2000/12/22 05:27:45 tsi Exp $ */
/*
* Copyright 1999, 2000 ATI Technologies Inc., Markham, Ontario,
* Precision Insight, Inc., Cedar Park, Texas, and
@@ -113,7 +113,7 @@ static void R128LoadCursorImage(ScrnInfoPtr pScrn, unsigned char *image)
CARD32 save;
save = INREG(R128_CRTC_GEN_CNTL);
- OUTREG(R128_CRTC_GEN_CNTL, save & ~R128_CRTC_CUR_EN);
+ OUTREG(R128_CRTC_GEN_CNTL, save & (CARD32)~R128_CRTC_CUR_EN);
#if X_BYTE_ORDER == X_BIG_ENDIAN
switch(info->CurrentLayout.pixel_bytes) {
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_dri.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_dri.c
index 5d55ad114..e33168311 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_dri.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_dri.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_dri.c,v 1.7 2000/12/12 17:17:12 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_dri.c,v 1.9 2001/01/08 01:07:34 martin Exp $ */
/*
* Copyright 1999, 2000 ATI Technologies Inc., Markham, Ontario,
* Precision Insight, Inc., Cedar Park, Texas, and
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_dri.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_dri.h
index 01857a0e3..070a3751d 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_dri.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_dri.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_dri.h,v 1.4 2000/12/04 19:21:52 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_dri.h,v 1.5 2001/01/08 01:07:34 martin Exp $ */
/*
* Copyright 1999, 2000 ATI Technologies Inc., Markham, Ontario,
* Precision Insight, Inc., Cedar Park, Texas, and
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_driver.c
index b879ae9c5..5b86c33d3 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_driver.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_driver.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_driver.c,v 1.13 2000/12/08 19:15:33 martin Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_driver.c,v 1.22 2001/02/15 11:03:56 alanh Exp $ */
/*
* Copyright 1999, 2000 ATI Technologies Inc., Markham, Ontario,
* Precision Insight, Inc., Cedar Park, Texas, and
@@ -140,6 +140,7 @@ typedef enum {
/* FIXME: Disable CRTOnly until it is tested */
OPTION_CRT,
#endif
+ OPTION_BIOS_DISPLAY,
OPTION_PANEL_WIDTH,
OPTION_PANEL_HEIGHT,
OPTION_PROG_FP_REGS,
@@ -164,10 +165,7 @@ OptionInfoRec R128Options[] = {
{ OPTION_BUFFER_SIZE, "BufferSize", OPTV_INTEGER, {0}, FALSE },
{ OPTION_USE_CCE_2D, "UseCCEfor2D", OPTV_BOOLEAN, {0}, FALSE },
#endif
-#if USE_CRT_ONLY
- /* FIXME: Disable CRTOnly until it is tested */
- { OPTION_CRT, "CRTOnly", OPTV_BOOLEAN, {0}, FALSE },
-#endif
+ { OPTION_BIOS_DISPLAY, "UseBIOSDisplay", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_PANEL_WIDTH, "PanelWidth", OPTV_INTEGER, {0}, FALSE },
{ OPTION_PANEL_HEIGHT, "PanelHeight", OPTV_INTEGER, {0}, FALSE },
{ OPTION_PROG_FP_REGS, "ProgramFPRegs", OPTV_BOOLEAN, {0}, FALSE },
@@ -297,6 +295,10 @@ static const char *drmSymbols[] = {
"drmMarkBufs",
"drmR128CleanupCCE",
"drmR128InitCCE",
+ "drmR128ResetCCE",
+ "drmR128StartCCE",
+ "drmR128StopCCE",
+ "drmR128WaitForIdleCCE",
"drmUnmap",
"drmUnmapBufs",
NULL
@@ -501,17 +503,12 @@ static int R128Div(int n, int d)
}
/* Read the Video BIOS block and the FP registers (if applicable). */
-static Bool R128GetBIOSParameters(ScrnInfoPtr pScrn)
+static Bool R128GetBIOSParameters(ScrnInfoPtr pScrn, xf86Int10InfoPtr pInt10)
{
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) (info->VBIOS[v])
#define R128_BIOS16(v) (info->VBIOS[v] | \
(info->VBIOS[(v) + 1] << 8))
@@ -526,16 +523,20 @@ static Bool R128GetBIOSParameters(ScrnInfoPtr pScrn)
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 (pInt10) {
+ info->BIOSAddr = pInt10->BIOSseg << 4;
+ (void)memcpy(info->VBIOS, xf86int10Addr(pInt10, info->BIOSAddr),
+ R128_VBIOS_SIZE);
+ } else {
+ xf86ReadPciBIOS(0, info->PciTag, 0, 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->BIOSAddr = 0x000c0000;
+ xf86ReadBIOS(info->BIOSAddr, 0, info->VBIOS, R128_VBIOS_SIZE);
+ }
}
if (info->VBIOS[0] != 0x55 || info->VBIOS[1] != 0xaa) {
info->BIOSAddr = 0x00000000;
@@ -893,23 +894,41 @@ static Bool R128PreInitConfig(ScrnInfoPtr pScrn)
case PCI_CHIP_RAGE128RG:
case PCI_CHIP_RAGE128RK:
case PCI_CHIP_RAGE128RL:
+ case PCI_CHIP_RAGE128PD:
case PCI_CHIP_RAGE128PF:
default: info->HasPanelRegs = FALSE; break;
}
}
/* Read registers used to determine options */
- from = X_PROBED;
+ from = X_PROBED;
R128MapMMIO(pScrn);
- R128MMIO = info->MMIO;
+ R128MMIO = info->MMIO;
+
if (info->FBDev)
- pScrn->videoRam = fbdevHWGetVidmem(pScrn) / 1024;
+ pScrn->videoRam = fbdevHWGetVidmem(pScrn) / 1024;
else
- pScrn->videoRam = INREG(R128_CONFIG_MEMSIZE) / 1024;
- info->MemCntl = INREG(R128_MEM_CNTL);
+ pScrn->videoRam = INREG(R128_CONFIG_MEMSIZE) / 1024;
- info->BusCntl = INREG(R128_BUS_CNTL);
- R128MMIO = NULL;
+ info->MemCntl = INREG(R128_MEM_CNTL);
+ info->BusCntl = INREG(R128_BUS_CNTL);
+
+ /* On non-flat panel systems, the default is to display to the CRT,
+ and on flat panel systems, the default is to display to the flat
+ panel unless the user explicity enables displaying to the device
+ initialized in the BIOS via the "UseBIOSDisplay" config file
+ setting. BIOS_5_SCRATCH holds the display device on flat panel
+ systems only. */
+ if (info->HasPanelRegs) {
+ if (xf86ReturnOptValBool(R128Options, OPTION_BIOS_DISPLAY, FALSE))
+ info->BIOSDisplay = INREG8(R128_BIOS_5_SCRATCH);
+ else
+ info->BIOSDisplay = R128_BIOS_DISPLAY_FP;
+ } else {
+ info->BIOSDisplay = R128_BIOS_DISPLAY_CRT;
+ }
+
+ R128MMIO = NULL;
R128UnmapMMIO(pScrn);
/* RAM */
@@ -949,22 +968,21 @@ static Bool R128PreInitConfig(ScrnInfoPtr pScrn)
/* Flat panel (part 2) */
if (info->HasPanelRegs) {
-#if !USE_CRT_ONLY
- info->CRTOnly = FALSE;
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "Using flat panel for display\n");
-#else
- /* Panel CRT mode override */
- if ((info->CRTOnly = xf86ReturnOptValBool(R128Options,
- OPTION_CRT, FALSE))) {
+ switch (info->BIOSDisplay) {
+ case R128_BIOS_DISPLAY_FP:
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
- "Using external CRT instead of "
- "flat panel for display\n");
- } else {
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"Using flat panel for display\n");
+ break;
+ case R128_BIOS_DISPLAY_CRT:
+ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
+ "Using external CRT for display\n");
+ break;
+ case R128_BIOS_DISPLAY_FP_CRT:
+ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
+ "Using both flat panel and external CRT "
+ "for display\n");
+ break;
}
-#endif
/* Panel width/height overrides */
info->PanelXRes = 0;
@@ -979,8 +997,6 @@ static Bool R128PreInitConfig(ScrnInfoPtr pScrn)
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
"Flat panel height: %d\n", info->PanelYRes);
}
- } else {
- info->CRTOnly = FALSE;
}
#ifdef XF86DRI
@@ -992,7 +1008,8 @@ static Bool R128PreInitConfig(ScrnInfoPtr pScrn)
switch (info->Chipset) {
case PCI_CHIP_RAGE128LE:
case PCI_CHIP_RAGE128RE:
- case PCI_CHIP_RAGE128RK: info->IsPCI = TRUE; break;
+ case PCI_CHIP_RAGE128RK:
+ case PCI_CHIP_RAGE128PD: info->IsPCI = TRUE; break;
case PCI_CHIP_RAGE128LF:
case PCI_CHIP_RAGE128MF:
case PCI_CHIP_RAGE128ML:
@@ -1008,7 +1025,7 @@ static Bool R128PreInitConfig(ScrnInfoPtr pScrn)
return TRUE;
}
-static Bool R128PreInitDDC(ScrnInfoPtr pScrn)
+static Bool R128PreInitDDC(ScrnInfoPtr pScrn, xf86Int10InfoPtr pInt10)
{
R128InfoPtr info = R128PTR(pScrn);
vbeInfoPtr pVbe;
@@ -1016,15 +1033,15 @@ static Bool R128PreInitDDC(ScrnInfoPtr pScrn)
if (!xf86LoadSubModule(pScrn, "ddc")) return FALSE;
xf86LoaderReqSymLists(ddcSymbols, NULL);
-#if defined(__powerpc__)
- /* Int10 is broken on PPC */
+#if defined(__powerpc__) || defined(__alpha__)
+ /* Int10 is broken on PPC and some Alphas */
return TRUE;
#else
if (xf86LoadSubModule(pScrn, "vbe")) {
#ifdef XFree86LOADER
xf86LoaderReqSymLists(vbeSymbols,NULL);
#endif
- pVbe = VBEInit(NULL,info->pEnt->index);
+ pVbe = VBEInit(pInt10,info->pEnt->index);
if (!pVbe) return FALSE;
xf86SetDDCproperties(pScrn,xf86PrintEDID(vbeDoEDID(pVbe,NULL)));
@@ -1124,10 +1141,8 @@ static Bool R128PreInitModes(ScrnInfoPtr pScrn)
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;
@@ -1153,15 +1168,14 @@ static Bool R128PreInitAccel(ScrnInfoPtr pScrn)
return TRUE;
}
-static Bool R128PreInitInt10(ScrnInfoPtr pScrn)
+static Bool R128PreInitInt10(ScrnInfoPtr pScrn, xf86Int10InfoPtr *ppInt10)
{
R128InfoPtr info = R128PTR(pScrn);
-#if 1
+#if 1 && !defined(__alpha__)
+ /* int10 is broken on some Alphas */
if (xf86LoadSubModule(pScrn, "int10")) {
- xf86Int10InfoPtr pInt;
xf86DrvMsg(pScrn->scrnIndex,X_INFO,"initializing int10\n");
- pInt = xf86InitInt10(info->pEnt->index);
- xf86FreeInt10(pInt);
+ *ppInt10 = xf86InitInt10(info->pEnt->index);
}
#endif
return TRUE;
@@ -1294,7 +1308,8 @@ R128ProbeDDC(ScrnInfoPtr pScrn, int indx)
/* R128PreInit is called once at server startup. */
Bool R128PreInit(ScrnInfoPtr pScrn, int flags)
{
- R128InfoPtr info;
+ R128InfoPtr info;
+ xf86Int10InfoPtr pInt10 = NULL;
R128TRACE(("R128PreInit\n"));
@@ -1358,7 +1373,7 @@ Bool R128PreInit(ScrnInfoPtr pScrn, int flags)
if (xf86RegisterResources(info->pEnt->index, 0, ResNone)) goto fail;
- pScrn->racMemFlags = RAC_FB | RAC_COLORMAP;
+ pScrn->racMemFlags = RAC_FB | RAC_COLORMAP | RAC_CURSOR;
pScrn->monitor = pScrn->confScreen->monitor;
if (!R128PreInitVisual(pScrn)) goto fail;
@@ -1401,26 +1416,26 @@ Bool R128PreInit(ScrnInfoPtr pScrn, int flags)
}
if (!info->FBDev)
- if (!R128PreInitInt10(pScrn)) goto fail;
+ if (!R128PreInitInt10(pScrn, &pInt10)) goto fail;
- if (!R128PreInitConfig(pScrn)) goto fail;
+ if (!R128PreInitConfig(pScrn)) goto fail;
- if (!R128GetBIOSParameters(pScrn)) goto fail;
+ if (!R128GetBIOSParameters(pScrn, pInt10)) goto fail;
- if (!R128GetPLLParameters(pScrn)) goto fail;
+ if (!R128GetPLLParameters(pScrn)) goto fail;
- if (!R128PreInitDDC(pScrn)) goto fail;
+ if (!R128PreInitDDC(pScrn, pInt10)) goto fail;
- if (!R128PreInitGamma(pScrn)) goto fail;
+ if (!R128PreInitGamma(pScrn)) goto fail;
- if (!R128PreInitModes(pScrn)) goto fail;
+ if (!R128PreInitModes(pScrn)) goto fail;
- if (!R128PreInitCursor(pScrn)) goto fail;
+ if (!R128PreInitCursor(pScrn)) goto fail;
- if (!R128PreInitAccel(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) */
@@ -1429,6 +1444,10 @@ Bool R128PreInit(ScrnInfoPtr pScrn, int flags)
info->VBIOS = NULL;
}
+ /* Free int10 info */
+ if (pInt10)
+ xf86FreeInt10(pInt10);
+
return TRUE;
fail:
@@ -1440,6 +1459,10 @@ Bool R128PreInit(ScrnInfoPtr pScrn, int flags)
info->VBIOS = NULL;
}
+ /* Free int10 info */
+ if (pInt10)
+ xf86FreeInt10(pInt10);
+
vgaHWFreeHWRec(pScrn);
R128FreeRec(pScrn);
return FALSE;
@@ -1591,9 +1614,7 @@ Bool R128ScreenInit(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
#else
switch (pScrn->bitsPerPixel) {
case 8:
@@ -1928,10 +1949,8 @@ Bool R128ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
)) return FALSE;
/* DPMS setup */
-#ifdef DPMSExtension
- if (!info->HasPanelRegs || info->CRTOnly)
+ if (!info->HasPanelRegs || info->BIOSDisplay == R128_BIOS_DISPLAY_CRT)
xf86DPMSInit(pScreen, R128DisplayPowerManagementSet, 0);
-#endif
R128InitVideo(pScreen);
@@ -2036,7 +2055,8 @@ static void R128RestoreFPRegisters(ScrnInfoPtr pScrn, R128SavePtr restore)
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);
+ OUTREG(R128_LVDS_GEN_CNTL,
+ restore->lvds_gen_cntl & (CARD32)~R128_LVDS_BLON);
usleep(R128PTR(pScrn)->PanelPwrDly * 1000);
OUTREG(R128_LVDS_GEN_CNTL, restore->lvds_gen_cntl);
} else {
@@ -2141,7 +2161,7 @@ static void R128RestoreMode(ScrnInfoPtr pScrn, R128SavePtr restore)
R128RestoreCrtcRegisters(pScrn, restore);
if (info->HasPanelRegs)
R128RestoreFPRegisters(pScrn, restore);
- if (!info->HasPanelRegs || info->CRTOnly)
+ if (!info->HasPanelRegs || info->BIOSDisplay == R128_BIOS_DISPLAY_CRT)
R128RestorePLLRegisters(pScrn, restore);
R128RestoreDDARegisters(pScrn, restore);
R128RestorePalette(pScrn, restore);
@@ -2366,15 +2386,24 @@ static Bool R128InitCrtcRegisters(ScrnInfoPtr pScrn, R128SavePtr save,
case 32: format = 6; bytpp = 4; break; /* xRGB */
default:
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "Unsupported pixel depth (%d)\n", info->CurrentLayout.bitsPerPixel);
+ "Unsupported pixel depth (%d)\n",
+ info->CurrentLayout.bitsPerPixel);
return FALSE;
}
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];
+ switch (info->BIOSDisplay) {
+ case R128_BIOS_DISPLAY_FP:
+ hsync_fudge = hsync_fudge_fp[format-1];
+ break;
+ case R128_BIOS_DISPLAY_FP_CRT:
+ hsync_fudge = hsync_fudge_fp_crt[format-1];
+ break;
+ case R128_BIOS_DISPLAY_CRT:
+ default:
+ hsync_fudge = hsync_fudge_default[format-1];
+ break;
+ }
save->crtc_gen_cntl = (R128_CRTC_EXT_DISP_EN
| R128_CRTC_EN
@@ -2456,7 +2485,7 @@ static void R128InitFPRegisters(R128SavePtr orig, R128SavePtr save,
int yres = mode->CrtcVDisplay;
float Hratio, Vratio;
- if (info->CRTOnly) {
+ if (info->BIOSDisplay == R128_BIOS_DISPLAY_CRT) {
save->crtc_ext_cntl |= R128_CRTC_CRT_ON;
save->crtc2_gen_cntl = 0;
save->fp_gen_cntl = orig->fp_gen_cntl;
@@ -2467,9 +2496,9 @@ static void R128InitFPRegisters(R128SavePtr orig, R128SavePtr save,
R128_FP_USE_SHADOW_EN);
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 |
- R128_LVDS_BLON);
+ save->fp_panel_cntl = orig->fp_panel_cntl & (CARD32)~R128_FP_DIGON;
+ save->lvds_gen_cntl = orig->lvds_gen_cntl &
+ (CARD32)~(R128_LVDS_ON | R128_LVDS_BLON);
return;
}
@@ -2502,11 +2531,12 @@ static void R128InitFPRegisters(R128SavePtr orig, R128SavePtr save,
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));
+ save->fp_gen_cntl = (orig->fp_gen_cntl &
+ (CARD32)~(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);
@@ -2522,9 +2552,13 @@ static void R128InitFPRegisters(R128SavePtr orig, R128SavePtr save,
want to use the dual CRTC capabilities of the R128 to allow both
the flat panel and external CRT to either simultaneously display
the same image or display two different images. */
- save->crtc_ext_cntl &= ~R128_CRTC_CRT_ON;
- save->dac_cntl |= R128_DAC_CRT_SEL_CRTC2;
- save->crtc2_gen_cntl = 0;
+ if (info->BIOSDisplay == R128_BIOS_DISPLAY_FP_CRT) {
+ save->crtc_ext_cntl |= R128_CRTC_CRT_ON;
+ } else {
+ save->crtc_ext_cntl &= ~R128_CRTC_CRT_ON;
+ save->dac_cntl |= R128_DAC_CRT_SEL_CRTC2;
+ save->crtc2_gen_cntl = 0;
+ }
/* WARNING: Be careful about turning on the flat panel */
#if 1
@@ -2782,7 +2816,9 @@ int R128ValidMode(int scrnIndex, DisplayModePtr mode,
if (mode->Flags & V_DBLSCAN) return MODE_NO_DBLESCAN;
}
- if (info->HasPanelRegs && !info->CRTOnly && info->VBIOS) {
+ if (info->HasPanelRegs &&
+ info->BIOSDisplay != R128_BIOS_DISPLAY_CRT &&
+ info->VBIOS) {
int i;
for (i = info->FPBIOSstart+64; R128_BIOS16(i) != 0; i += 2) {
int j = R128_BIOS16(i);
@@ -2974,7 +3010,6 @@ void R128FreeScreen(int scrnIndex, int flags)
R128FreeRec(pScrn);
}
-#ifdef DPMSExtension
/* Sets VESA Display Power Management Signaling (DPMS) Mode. */
static void R128DisplayPowerManagementSet(ScrnInfoPtr pScrn,
int PowerManagementMode, int flags)
@@ -3006,4 +3041,3 @@ static void R128DisplayPowerManagementSet(ScrnInfoPtr pScrn,
break;
}
}
-#endif
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_probe.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_probe.c
index 23a618bd1..520ec36d9 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_probe.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_probe.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_probe.c,v 1.6 2000/12/13 02:45:00 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_probe.c,v 1.8 2001/02/12 04:24:24 tsi Exp $ */
/*
* Copyright 1999, 2000 ATI Technologies Inc., Markham, Ontario,
* Precision Insight, Inc., Cedar Park, Texas, and
@@ -54,6 +54,7 @@ SymTabRec R128Chipsets[] = {
{ PCI_CHIP_RAGE128RG, "ATI Rage 128 RG (AGP)" },
{ PCI_CHIP_RAGE128RK, "ATI Rage 128 RK (PCI)" },
{ PCI_CHIP_RAGE128RL, "ATI Rage 128 RL (AGP)" },
+ { PCI_CHIP_RAGE128PD, "ATI Rage 128 Pro PD (PCI)" },
{ 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)" },
@@ -68,6 +69,7 @@ PciChipsets R128PciChipsets[] = {
{ PCI_CHIP_RAGE128RG, PCI_CHIP_RAGE128RG, RES_SHARED_VGA },
{ PCI_CHIP_RAGE128RK, PCI_CHIP_RAGE128RK, RES_SHARED_VGA },
{ PCI_CHIP_RAGE128RL, PCI_CHIP_RAGE128RL, RES_SHARED_VGA },
+ { PCI_CHIP_RAGE128PD, PCI_CHIP_RAGE128PD, RES_SHARED_VGA },
{ 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 },
@@ -86,6 +88,8 @@ R128AvailableOptions(int chipid, int busid)
* Return options defined in the r128 submodule which will have been
* loaded by this point.
*/
+ if ((chipid >> 16) == PCI_VENDOR_ATI)
+ chipid -= PCI_VENDOR_ATI << 16;
for (i = 0; R128PciChipsets[i].PCIid > 0; i++) {
if (chipid == R128PciChipsets[i].PCIid)
return R128Options;
@@ -159,7 +163,7 @@ R128Probe(DriverPtr drv, int flags)
pEnt = xf86GetEntityInfo(usedChips[i]);
if (pEnt->active) {
- ScrnInfoPtr pScrn = xf86AllocateScreen(drv, 0);
+ ScrnInfoPtr pScrn = xf86AllocateScreen(drv, 0);
#ifdef XFree86LOADER
if (!xf86LoadSubModule(pScrn, "r128")) {
@@ -171,6 +175,7 @@ R128Probe(DriverPtr drv, int flags)
xf86LoaderReqSymLists(R128Symbols, NULL);
+#ifndef ELFDEBUG
/* Workaround for possible loader bug */
# define R128PreInit \
(xf86PreInitProc*) LoaderSymbol("R128PreInit")
@@ -188,6 +193,7 @@ R128Probe(DriverPtr drv, int flags)
(xf86FreeScreenProc*) LoaderSymbol("R128FreeScreen")
# define R128ValidMode \
(xf86ValidModeProc*) LoaderSymbol("R128ValidMode")
+#endif
#endif
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_reg.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_reg.h
index 98aea68b6..e9d584ab9 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_reg.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_reg.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_reg.h,v 1.6 2000/12/12 17:17:13 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_reg.h,v 1.9 2001/01/16 05:11:07 martin Exp $ */
/*
* Copyright 1999, 2000 ATI Technologies Inc., Markham, Ontario,
* Precision Insight, Inc., Cedar Park, Texas, and
@@ -116,12 +116,12 @@
#define PAL_SELECT(idx) \
do { \
+ CARD32 tmp = INREG(R128_DAC_CNTL); \
if (idx) { \
- OUTREG(R128_DAC_CNTL, INREG(R128_DAC_CNTL) | \
- R128_DAC_PALETTE_ACC_CTL); \
+ OUTREG(R128_DAC_CNTL, tmp | R128_DAC_PALETTE_ACC_CTL); \
} else { \
- OUTREG(R128_DAC_CNTL, INREG(R128_DAC_CNTL) & \
- ~R128_DAC_PALETTE_ACC_CTL); \
+ OUTREG(R128_DAC_CNTL, tmp & \
+ (CARD32)~R128_DAC_PALETTE_ACC_CTL); \
} \
} while (0)
@@ -182,6 +182,13 @@
#define R128_BIOS_1_SCRATCH 0x0014
#define R128_BIOS_2_SCRATCH 0x0018
#define R128_BIOS_3_SCRATCH 0x001c
+#define R128_BIOS_4_SCRATCH 0x0020
+#define R128_BIOS_5_SCRATCH 0x0024
+# define R128_BIOS_DISPLAY_FP (1 << 0)
+# define R128_BIOS_DISPLAY_CRT (2 << 0)
+# define R128_BIOS_DISPLAY_FP_CRT (3 << 0)
+#define R128_BIOS_6_SCRATCH 0x0028
+#define R128_BIOS_7_SCRATCH 0x002c
#define R128_BIOS_ROM 0x0f30 /* PCI */
#define R128_BIST 0x0f0f /* PCI */
#define R128_BRUSH_DATA0 0x1480
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_sarea.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_sarea.h
index 54bfa3673..b4ffaf8f9 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_sarea.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_sarea.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_sarea.h,v 1.5 2000/12/15 22:48:43 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_sarea.h,v 1.6 2001/01/08 01:07:35 martin Exp $ */
/*
* Copyright 1999, 2000 ATI Technologies Inc., Markham, Ontario,
* Precision Insight, Inc., Cedar Park, Texas, and
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_video.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_video.c
index 16a446bc7..f532e15cd 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_video.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_video.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_video.c,v 1.14 2000/12/07 20:42:52 mvojkovi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_video.c,v 1.17 2001/01/25 02:26:00 mvojkovi Exp $ */
#include "r128.h"
#include "r128_reg.h"
@@ -398,6 +398,7 @@ R128SetPortAttribute(
if((value < -64) || (value > 63))
return BadValue;
pPriv->brightness = value;
+
OUTREG(R128_OV0_COLOUR_CNTL, (pPriv->brightness & 0x7f) |
(pPriv->saturation << 8) |
(pPriv->saturation << 16));
@@ -406,6 +407,7 @@ R128SetPortAttribute(
if((value < 0) || (value > 31))
return BadValue;
pPriv->saturation = value;
+
OUTREG(R128_OV0_COLOUR_CNTL, (pPriv->brightness & 0x7f) |
(pPriv->saturation << 8) |
(pPriv->saturation << 16));
@@ -460,13 +462,18 @@ R128QueryBestSize(
unsigned int *p_w, unsigned int *p_h,
pointer data
){
+ if(vid_w > (drw_w << 4))
+ drw_w = vid_w >> 4;
+ if(vid_h > (drw_h << 4))
+ drw_h = vid_h >> 4;
+
*p_w = drw_w;
*p_h = drw_h;
}
static void
-R128CopyData(
+R128CopyData422(
unsigned char *src,
unsigned char *dst,
int srcPitch,
@@ -483,47 +490,44 @@ R128CopyData(
}
static void
-R128CopyMungedData(
+R128CopyData420(
unsigned char *src1,
unsigned char *src2,
unsigned char *src3,
unsigned char *dst1,
+ unsigned char *dst2,
+ unsigned char *dst3,
int srcPitch,
int srcPitch2,
int dstPitch,
int h,
int w
){
- CARD32 *dst;
- CARD8 *s1, *s2, *s3;
- int i, j;
+ int count;
- w >>= 1;
+ count = h;
+ while(count--) {
+ memcpy(dst1, src1, w);
+ src1 += srcPitch;
+ dst1 += dstPitch;
+ }
- for(j = 0; j < h; j++) {
- dst = (CARD32*)dst1;
- s1 = src1; s2 = src2; s3 = src3;
- i = w;
- while(i > 4) {
- dst[0] = s1[0] | (s1[1] << 16) | (s3[0] << 8) | (s2[0] << 24);
- dst[1] = s1[2] | (s1[3] << 16) | (s3[1] << 8) | (s2[1] << 24);
- dst[2] = s1[4] | (s1[5] << 16) | (s3[2] << 8) | (s2[2] << 24);
- dst[3] = s1[6] | (s1[7] << 16) | (s3[3] << 8) | (s2[3] << 24);
- dst += 4; s2 += 4; s3 += 4; s1 += 8;
- i -= 4;
- }
- while(i--) {
- dst[0] = s1[0] | (s1[1] << 16) | (s3[0] << 8) | (s2[0] << 24);
- dst++; s2++; s3++;
- s1 += 2;
- }
+ w >>= 1;
+ h >>= 1;
+ dstPitch >>= 1;
+
+ count = h;
+ while(count--) {
+ memcpy(dst2, src2, w);
+ src2 += srcPitch2;
+ dst2 += dstPitch;
+ }
- dst1 += dstPitch;
- src1 += srcPitch;
- if(j & 1) {
- src2 += srcPitch2;
- src3 += srcPitch2;
- }
+ count = h;
+ while(count--) {
+ memcpy(dst3, src3, w);
+ src3 += srcPitch2;
+ dst3 += dstPitch;
}
}
@@ -570,7 +574,7 @@ R128AllocateMemory(
}
static void
-R128DisplayVideo(
+R128DisplayVideo422(
ScrnInfoPtr pScrn,
int id,
int offset,
@@ -613,7 +617,6 @@ R128DisplayVideo(
left = (left >> 16) & 7;
-
OUTREG(R128_OV0_REG_LOAD_CNTL, 1);
while(!(INREG(R128_OV0_REG_LOAD_CNTL) & (1 << 3)));
@@ -624,23 +627,103 @@ R128DisplayVideo(
OUTREG(R128_OV0_V_INC, v_inc);
OUTREG(R128_OV0_P1_BLANK_LINES_AT_TOP, 0x00000fff | ((src_h - 1) << 16));
OUTREG(R128_OV0_VID_BUF_PITCH0_VALUE, pitch);
- OUTREG(R128_OV0_P1_X_START_END, (src_w + left - 1) | (left << 16));
- left >>= 1; src_w >>= 1;
- OUTREG(R128_OV0_P2_X_START_END, (src_w + left - 1) | (left << 16));
- OUTREG(R128_OV0_P3_X_START_END, (src_w + left - 1) | (left << 16));
+ OUTREG(R128_OV0_P1_X_START_END, (width - 1) | (left << 16));
+ left >>= 1; width >>= 1;
+ OUTREG(R128_OV0_P2_X_START_END, (width - 1) | (left << 16));
+ OUTREG(R128_OV0_P3_X_START_END, (width - 1) | (left << 16));
OUTREG(R128_OV0_VID_BUF0_BASE_ADRS, offset & 0xfffffff0);
OUTREG(R128_OV0_P1_V_ACCUM_INIT, p1_v_accum_init);
+ OUTREG(R128_OV0_P23_V_ACCUM_INIT, 0);
OUTREG(R128_OV0_P1_H_ACCUM_INIT, p1_h_accum_init);
OUTREG(R128_OV0_P23_H_ACCUM_INIT, p23_h_accum_init);
if(id == FOURCC_UYVY)
- OUTREG(R128_OV0_SCALE_CNTL, 0x41008C03);
+ OUTREG(R128_OV0_SCALE_CNTL, 0x41FF8C03);
else
- OUTREG(R128_OV0_SCALE_CNTL, 0x41008B03);
+ OUTREG(R128_OV0_SCALE_CNTL, 0x41FF8B03);
OUTREG(R128_OV0_REG_LOAD_CNTL, 0);
}
+static void
+R128DisplayVideo420(
+ ScrnInfoPtr pScrn,
+ short width, short height,
+ int pitch,
+ int offset1, int offset2, int offset3,
+ int left, int right, int top,
+ BoxPtr dstBox,
+ short src_w, short src_h,
+ short drw_w, short drw_h
+){
+ R128InfoPtr info = R128PTR(pScrn);
+ unsigned char *R128MMIO = info->MMIO;
+ int v_inc, h_inc, step_by, tmp, leftUV;
+ int p1_h_accum_init, p23_h_accum_init;
+ int p1_v_accum_init, p23_v_accum_init;
+
+ v_inc = (src_h << 20) / drw_h;
+ h_inc = (src_w << 12) / drw_w;
+ step_by = 1;
+
+ while(h_inc >= (2 << 12)) {
+ step_by++;
+ h_inc >>= 1;
+ }
+
+ /* keep everything in 16.16 */
+
+ offset1 += (left >> 16) & ~15;
+ offset2 += (left >> 17) & ~15;
+ offset3 += (left >> 17) & ~15;
+
+ tmp = (left & 0x0003ffff) + 0x00028000 + (h_inc << 3);
+ p1_h_accum_init = ((tmp << 4) & 0x000f8000) |
+ ((tmp << 12) & 0xf0000000);
+
+ tmp = ((left >> 1) & 0x0001ffff) + 0x00028000 + (h_inc << 2);
+ p23_h_accum_init = ((tmp << 4) & 0x000f8000) |
+ ((tmp << 12) & 0x70000000);
+
+ tmp = (top & 0x0000ffff) + 0x00018000;
+ p1_v_accum_init = ((tmp << 4) & 0x03ff8000) | 0x00000001;
+
+ tmp = ((top >> 1) & 0x0000ffff) + 0x00018000;
+ p23_v_accum_init = ((tmp << 4) & 0x01ff8000) | 0x00000001;
+
+ leftUV = (left >> 17) & 15;
+ left = (left >> 16) & 15;
+
+ OUTREG(R128_OV0_REG_LOAD_CNTL, 1);
+ while(!(INREG(R128_OV0_REG_LOAD_CNTL) & (1 << 3)));
+
+ OUTREG(R128_OV0_H_INC, h_inc | ((h_inc >> 1) << 16));
+ OUTREG(R128_OV0_STEP_BY, step_by | (step_by << 8));
+ OUTREG(R128_OV0_Y_X_START, dstBox->x1 | (dstBox->y1 << 16));
+ OUTREG(R128_OV0_Y_X_END, dstBox->x2 | (dstBox->y2 << 16));
+ OUTREG(R128_OV0_V_INC, v_inc);
+ OUTREG(R128_OV0_P1_BLANK_LINES_AT_TOP, 0x00000fff | ((src_h - 1) << 16));
+ src_h = (src_h + 1) >> 1;
+ OUTREG(R128_OV0_P23_BLANK_LINES_AT_TOP, 0x000007ff | ((src_h - 1) << 16));
+ OUTREG(R128_OV0_VID_BUF_PITCH0_VALUE, pitch);
+ OUTREG(R128_OV0_VID_BUF_PITCH1_VALUE, pitch >> 1);
+ OUTREG(R128_OV0_P1_X_START_END, (width - 1) | (left << 16));
+ width >>= 1;
+ OUTREG(R128_OV0_P2_X_START_END, (width - 1) | (leftUV << 16));
+ OUTREG(R128_OV0_P3_X_START_END, (width - 1) | (leftUV << 16));
+ OUTREG(R128_OV0_VID_BUF0_BASE_ADRS, offset1 & 0xfffffff0);
+ OUTREG(R128_OV0_VID_BUF1_BASE_ADRS, (offset2 & 0xfffffff0) | 0x00000001);
+ OUTREG(R128_OV0_VID_BUF2_BASE_ADRS, (offset3 & 0xfffffff0) | 0x00000001);
+ OUTREG(R128_OV0_P1_V_ACCUM_INIT, p1_v_accum_init);
+ OUTREG(R128_OV0_P23_V_ACCUM_INIT, p23_v_accum_init);
+ OUTREG(R128_OV0_P1_H_ACCUM_INIT, p1_h_accum_init);
+ OUTREG(R128_OV0_P23_H_ACCUM_INIT, p23_h_accum_init);
+ OUTREG(R128_OV0_SCALE_CNTL, 0x41FF8A03);
+
+ OUTREG(R128_OV0_REG_LOAD_CNTL, 0);
+}
+
+
static int
R128PutImage(
@@ -657,27 +740,28 @@ R128PutImage(
R128InfoPtr info = R128PTR(pScrn);
R128PortPrivPtr pPriv = (R128PortPrivPtr)data;
INT32 xa, xb, ya, yb;
- unsigned char *dst_start;
- int pitch, new_size, offset, s2offset, s3offset;
+ int pitch, new_size, offset, s1offset, s2offset, s3offset;
int srcPitch, srcPitch2, dstPitch;
+ int d1line, d2line, d3line, d1offset, d2offset, d3offset;
int top, left, npixels, nlines, bpp;
BoxRec dstBox;
CARD32 tmp;
/*
- * s2offset, s3offset - byte offsets into U and V plane of the
- * source where copying starts. Y plane is
- * done by editing "buf".
+ * s1offset, s2offset, s3offset - byte offsets to the Y, U and V planes
+ * of the source.
+ *
+ * d1offset, d2offset, d3offset - byte offsets to the Y, U and V planes
+ * of the destination.
*
- * offset - byte offset to the first line of the destination.
+ * offset - byte offset within the framebuffer to where the destination
+ * is stored.
*
- * dst_start - byte address to the first displayed pel.
+ * d1line, d2line, d3line - byte offsets within the destination to the
+ * first displayed scanline in each plane.
*
*/
- /* make the compiler happy */
- s2offset = s3offset = srcPitch2 = 0;
-
if(src_w > (drw_w << 4))
drw_w = src_w >> 4;
if(src_h > (drw_h << 4))
@@ -708,19 +792,24 @@ R128PutImage(
switch(id) {
case FOURCC_YV12:
case FOURCC_I420:
- dstPitch = ((width << 1) + 15) & ~15;
- new_size = ((dstPitch * height) + bpp - 1) / bpp;
srcPitch = (width + 3) & ~3;
- s2offset = srcPitch * height;
srcPitch2 = ((width >> 1) + 3) & ~3;
+ dstPitch = (width + 31) & ~31; /* of luma */
+ new_size = ((dstPitch * (height + (height >> 1))) + bpp - 1) / bpp;
+ s1offset = 0;
+ s2offset = srcPitch * height;
s3offset = (srcPitch2 * (height >> 1)) + s2offset;
break;
case FOURCC_UYVY:
case FOURCC_YUY2:
default:
+ srcPitch = width << 1;
+ srcPitch2 = 0;
dstPitch = ((width << 1) + 15) & ~15;
new_size = ((dstPitch * height) + bpp - 1) / bpp;
- srcPitch = (width << 1);
+ s1offset = 0;
+ s2offset = 0;
+ s3offset = 0;
break;
}
@@ -737,37 +826,52 @@ R128PutImage(
left = (xa >> 16) & ~1;
npixels = ((((xb + 0xffff) >> 16) + 1) & ~1) - left;
- offset = (pPriv->linear->offset * bpp) + (top * dstPitch);
+ offset = pPriv->linear->offset * bpp;
if(pPriv->doubleBuffer)
offset += pPriv->currentBuffer * new_size * bpp;
- dst_start = info->FB + offset;
switch(id) {
case FOURCC_YV12:
case FOURCC_I420:
+ d1line = top * dstPitch;
+ d2line = (height * dstPitch) + ((top >> 1) * (dstPitch >> 1));
+ d3line = d2line + ((height >> 1) * (dstPitch >> 1));
+
top &= ~1;
- dst_start += left << 1;
+
+ d1offset = (top * dstPitch) + left + offset;
+ d2offset = d2line + (left >> 1) + offset;
+ d3offset = d3line + (left >> 1) + offset;
+
+ s1offset += (top * srcPitch) + left;
tmp = ((top >> 1) * srcPitch2) + (left >> 1);
s2offset += tmp;
s3offset += tmp;
- if(id == FOURCC_I420) {
+ if(id == FOURCC_YV12) {
tmp = s2offset;
s2offset = s3offset;
s3offset = tmp;
}
+
nlines = ((((yb + 0xffff) >> 16) + 1) & ~1) - top;
- R128CopyMungedData(buf + (top * srcPitch) + left, buf + s2offset,
- buf + s3offset, dst_start, srcPitch, srcPitch2,
- dstPitch, nlines, npixels);
+ R128CopyData420(buf + s1offset, buf + s2offset, buf + s3offset,
+ info->FB+d1offset, info->FB+d2offset, info->FB+d3offset,
+ srcPitch, srcPitch2, dstPitch, nlines, npixels);
break;
case FOURCC_UYVY:
case FOURCC_YUY2:
default:
left <<= 1;
- buf += (top * srcPitch) + left;
+ d1line = top * dstPitch;
+ d2line = 0;
+ d3line = 0;
+ d1offset = d1line + left + offset;
+ d2offset = 0;
+ d3offset = 0;
+ s1offset += (top * srcPitch) + left;
nlines = ((yb + 0xffff) >> 16) - top;
- dst_start += left;
- R128CopyData(buf, dst_start, srcPitch, dstPitch, nlines, npixels);
+ R128CopyData422(buf + s1offset, info->FB + d1offset,
+ srcPitch, dstPitch, nlines, npixels);
break;
}
@@ -776,13 +880,27 @@ R128PutImage(
if(!RegionsEqual(&pPriv->clip, clipBoxes)) {
REGION_COPY(pScreen, &pPriv->clip, clipBoxes);
/* draw these */
- (*info->accel->FillSolidRects)(pScrn, pPriv->colorKey, GXcopy, ~0,
+ (*info->accel->FillSolidRects)(pScrn, pPriv->colorKey, GXcopy,
+ (CARD32)~0,
REGION_NUM_RECTS(clipBoxes),
REGION_RECTS(clipBoxes));
}
- R128DisplayVideo(pScrn, id, offset, width, height, dstPitch,
+
+ switch(id) {
+ case FOURCC_YV12:
+ case FOURCC_I420:
+ R128DisplayVideo420(pScrn, width, height, dstPitch,
+ offset + d1line, offset + d2line, offset + d3line,
+ xa, xb, ya, &dstBox, src_w, src_h, drw_w, drw_h);
+ break;
+ case FOURCC_UYVY:
+ case FOURCC_YUY2:
+ default:
+ R128DisplayVideo422(pScrn, id, offset + d1line, width, height, dstPitch,
xa, xb, ya, &dstBox, src_w, src_h, drw_w, drw_h);
+ break;
+ }
pPriv->videoStatus = CLIENT_VIDEO_ON;
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon.h
index 911122b21..6916a0c13 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon.h,v 1.8 2000/12/08 14:41:16 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon.h,v 1.13 2001/01/21 21:19:19 tsi Exp $ */
/*
* Copyright 2000 ATI Technologies Inc., Markham, Ontario, and
* VA Linux Systems Inc., Fremont, California.
@@ -66,10 +66,6 @@
#define RADEON_DEBUG 0 /* Turn off debugging output */
#define RADEON_TIMEOUT 2000000 /* Fall out of wait loops after this count */
#define RADEON_MMIOSIZE 0x80000
-/* Atomic updates of PLL clock don't seem to always work and stick, thus
- * the bit never resets. Here - we use our own check by reading back the
- * register we've just wrote to make sure it's got the Right! value */
-#define RADEON_ATOMIC_UPDATE 0 /* Use PLL Atomic updates (seems broken) */
#define RADEON_VBIOS_SIZE 0x00010000
@@ -201,7 +197,6 @@ 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 */
@@ -293,6 +288,8 @@ typedef struct {
unsigned char *AGP; /* Map */
int agpMode;
+ CARD32 pciCommand;
+
Bool CPInUse; /* CP has been used by X server */
int CPMode; /* CP mode that server/clients use */
int CPFifoSize; /* Size of the CP command FIFO */
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_accel.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_accel.c
index 0f8042853..b6b20af54 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_accel.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_accel.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_accel.c,v 1.4 2000/11/18 19:37:12 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_accel.c,v 1.9 2001/01/21 21:19:20 tsi Exp $ */
/*
* Copyright 2000 ATI Technologies Inc., Markham, Ontario, and
* VA Linux Systems Inc., Fremont, California.
@@ -70,8 +70,6 @@
*
*/
-#define RADEON_IMAGEWRITE 0 /* Turned off by default - slower in accel */
-
/* Driver data structures */
#include "radeon.h"
#include "radeon_reg.h"
@@ -255,7 +253,7 @@ void RADEONEngineReset(ScrnInfoPtr pScrn)
RADEON_SOFT_RESET_RB |
RADEON_SOFT_RESET_HDP);
INREG(RADEON_RBBM_SOFT_RESET);
- OUTREG(RADEON_RBBM_SOFT_RESET, rbbm_soft_reset &
+ OUTREG(RADEON_RBBM_SOFT_RESET, rbbm_soft_reset & (CARD32)
~(RADEON_SOFT_RESET_CP |
RADEON_SOFT_RESET_HI |
RADEON_SOFT_RESET_SE |
@@ -785,7 +783,6 @@ static void RADEONSubsequentColorExpandScanline(ScrnInfoPtr pScrn, int bufno)
}
}
-#if RADEON_IMAGEWRITE
/* Setup for XAA indirect image write. */
static void RADEONSetupForScanlineImageWrite(ScrnInfoPtr pScrn,
int rop,
@@ -898,7 +895,6 @@ static void RADEONSubsequentImageWriteScanline(ScrnInfoPtr pScrn, int bufno)
}
}
}
-#endif
/* ================================================================
@@ -1256,7 +1252,6 @@ static void RADEONMMIOAccelInit(ScrnInfoPtr pScrn, XAAInfoRecPtr a)
a->DashedLineFlags = (LINE_PATTERN_LSBFIRST_LSBJUSTIFIED
| LINE_PATTERN_POWER_OF_2_ONLY);
-#if RADEON_IMAGEWRITE
/* ImageWrite */
a->NumScanlineImageWriteBuffers = 1;
a->ScanlineImageWriteBuffers = info->scratch_buffer;
@@ -1275,7 +1270,6 @@ static void RADEONMMIOAccelInit(ScrnInfoPtr pScrn, XAAInfoRecPtr a)
| SCANLINE_PAD_DWORD
| LEFT_EDGE_CLIPPING
| LEFT_EDGE_CLIPPING_NEGATIVE_X;
-#endif
#if 0
/* Color 8x8 Pattern Fill */
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_cursor.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_cursor.c
index 0847b46f8..fe218e760 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_cursor.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_cursor.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_cursor.c,v 1.3 2000/11/18 19:37:12 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_cursor.c,v 1.4 2000/12/22 05:27:47 tsi Exp $ */
/*
* Copyright 2000 ATI Technologies Inc., Markham, Ontario, and
* VA Linux Systems Inc., Fremont, California.
@@ -115,7 +115,7 @@ static void RADEONLoadCursorImage(ScrnInfoPtr pScrn, unsigned char *image)
CARD32 save;
save = INREG(RADEON_CRTC_GEN_CNTL);
- OUTREG(RADEON_CRTC_GEN_CNTL, save & ~RADEON_CRTC_CUR_EN);
+ OUTREG(RADEON_CRTC_GEN_CNTL, save & (CARD32)~RADEON_CRTC_CUR_EN);
#if X_BYTE_ORDER == X_BIG_ENDIAN
switch(info->CurrentLayout.pixel_bytes) {
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c
index dae4d873c..cc4c1d3bf 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c,v 1.8 2000/12/08 14:40:01 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c,v 1.15 2001/01/22 02:16:49 tsi Exp $ */
/*
* Copyright 2000 ATI Technologies Inc., Markham, Ontario, and
* VA Linux Systems Inc., Fremont, California.
@@ -493,7 +493,7 @@ static int RADEONDiv(int n, int d)
}
/* Read the Video BIOS block and the FP registers (if applicable). */
-static Bool RADEONGetBIOSParameters(ScrnInfoPtr pScrn)
+static Bool RADEONGetBIOSParameters(ScrnInfoPtr pScrn, xf86Int10InfoPtr pInt10)
{
RADEONInfoPtr info = RADEONPTR(pScrn);
#ifdef ENABLE_FLAT_PANEL
@@ -520,16 +520,20 @@ static Bool RADEONGetBIOSParameters(ScrnInfoPtr pScrn)
return FALSE;
}
- info->BIOSFromPCI = TRUE;
- RADEONReadBIOS(0x0000, info->VBIOS, RADEON_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;
- RADEONReadBIOS(0x0000, info->VBIOS, RADEON_VBIOS_SIZE);
+ if (pInt10) {
+ info->BIOSAddr = pInt10->BIOSseg << 4;
+ (void)memcpy(info->VBIOS, xf86int10Addr(pInt10, info->BIOSAddr),
+ RADEON_VBIOS_SIZE);
+ } else {
+ xf86ReadPciBIOS(0, info->PciTag, 0, info->VBIOS, RADEON_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->BIOSAddr = 0x000c0000;
+ xf86ReadBIOS(info->BIOSAddr, 0, info->VBIOS, RADEON_VBIOS_SIZE);
+ }
}
if (info->VBIOS[0] != 0x55 || info->VBIOS[1] != 0xaa) {
info->BIOSAddr = 0x00000000;
@@ -950,7 +954,7 @@ static Bool RADEONPreInitConfig(ScrnInfoPtr pScrn)
return TRUE;
}
-static Bool RADEONPreInitDDC(ScrnInfoPtr pScrn)
+static Bool RADEONPreInitDDC(ScrnInfoPtr pScrn, xf86Int10InfoPtr pInt10)
{
RADEONInfoPtr info = RADEONPTR(pScrn);
vbeInfoPtr pVbe;
@@ -958,7 +962,7 @@ static Bool RADEONPreInitDDC(ScrnInfoPtr pScrn)
if (!xf86LoadSubModule(pScrn, "ddc")) return FALSE;
xf86LoaderReqSymLists(ddcSymbols, NULL);
if (xf86LoadSubModule(pScrn, "vbe")) {
- pVbe = VBEInit(NULL,info->pEnt->index);
+ pVbe = VBEInit(pInt10, info->pEnt->index);
if (!pVbe) return FALSE;
xf86SetDDCproperties(pScrn,xf86PrintEDID(vbeDoEDID(pVbe,NULL)));
@@ -1056,10 +1060,8 @@ static Bool RADEONPreInitModes(ScrnInfoPtr pScrn)
xf86LoaderReqSymbols(Sym, NULL);
#ifdef USE_FB
-#ifdef RENDER
xf86LoaderReqSymbols("fbPictureInit", NULL);
#endif
-#endif
info->CurrentLayout.displayWidth = pScrn->displayWidth;
info->CurrentLayout.mode = pScrn->currentMode;
@@ -1085,15 +1087,13 @@ static Bool RADEONPreInitAccel(ScrnInfoPtr pScrn)
return TRUE;
}
-static Bool RADEONPreInitInt10(ScrnInfoPtr pScrn)
+static Bool RADEONPreInitInt10(ScrnInfoPtr pScrn, xf86Int10InfoPtr *ppInt10)
{
RADEONInfoPtr info = RADEONPTR(pScrn);
if (xf86LoadSubModule(pScrn, "int10")) {
- xf86Int10InfoPtr pInt;
xf86DrvMsg(pScrn->scrnIndex,X_INFO,"initializing int10\n");
- pInt = xf86InitInt10(info->pEnt->index);
- xf86FreeInt10(pInt);
+ *ppInt10 = xf86InitInt10(info->pEnt->index);
}
return TRUE;
}
@@ -1152,7 +1152,7 @@ static Bool RADEONPreInitDRI(ScrnInfoPtr pScrn)
if (xf86GetOptValInteger(RADEONOptions,
OPTION_RING_SIZE, &(info->ringSize))) {
- if (info->ringSize < 1 || info->ringSize >= info->agpSize) {
+ if (info->ringSize < 1 || info->ringSize >= (int)info->agpSize) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Illegal ring buffer size: %d MB\n",
info->ringSize);
@@ -1179,7 +1179,7 @@ static Bool RADEONPreInitDRI(ScrnInfoPtr pScrn)
}
if (info->ringSize + info->bufSize + info->agpTexSize >
- info->agpSize) {
+ (int)info->agpSize) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Buffers are too big for requested AGP space\n");
return FALSE;
@@ -1219,7 +1219,8 @@ RADEONProbeDDC(ScrnInfoPtr pScrn, int indx)
/* RADEONPreInit is called once at server startup. */
Bool RADEONPreInit(ScrnInfoPtr pScrn, int flags)
{
- RADEONInfoPtr info;
+ RADEONInfoPtr info;
+ xf86Int10InfoPtr pInt10 = NULL;
#ifdef XFree86LOADER
/*
@@ -1313,26 +1314,26 @@ Bool RADEONPreInit(ScrnInfoPtr pScrn, int flags)
}
if (!info->FBDev)
- if (!RADEONPreInitInt10(pScrn)) goto fail;
+ if (!RADEONPreInitInt10(pScrn, &pInt10)) goto fail;
- if (!RADEONPreInitConfig(pScrn)) goto fail;
+ if (!RADEONPreInitConfig(pScrn)) goto fail;
- if (!RADEONGetBIOSParameters(pScrn)) goto fail;
+ if (!RADEONGetBIOSParameters(pScrn, pInt10)) goto fail;
- if (!RADEONGetPLLParameters(pScrn)) goto fail;
+ if (!RADEONGetPLLParameters(pScrn)) goto fail;
- if (!RADEONPreInitDDC(pScrn)) goto fail;
+ if (!RADEONPreInitDDC(pScrn, pInt10)) goto fail;
- if (!RADEONPreInitGamma(pScrn)) goto fail;
+ if (!RADEONPreInitGamma(pScrn)) goto fail;
- if (!RADEONPreInitModes(pScrn)) goto fail;
+ if (!RADEONPreInitModes(pScrn)) goto fail;
- if (!RADEONPreInitCursor(pScrn)) goto fail;
+ if (!RADEONPreInitCursor(pScrn)) goto fail;
- if (!RADEONPreInitAccel(pScrn)) goto fail;
+ if (!RADEONPreInitAccel(pScrn)) goto fail;
#ifdef XF86DRI
- if (!RADEONPreInitDRI(pScrn)) goto fail;
+ if (!RADEONPreInitDRI(pScrn)) goto fail;
#endif
/* Free the video bios (if applicable) */
@@ -1341,6 +1342,10 @@ Bool RADEONPreInit(ScrnInfoPtr pScrn, int flags)
info->VBIOS = NULL;
}
+ /* Free int10 info */
+ if (pInt10)
+ xf86FreeInt10(pInt10);
+
return TRUE;
fail:
@@ -1352,6 +1357,10 @@ Bool RADEONPreInit(ScrnInfoPtr pScrn, int flags)
info->VBIOS = NULL;
}
+ /* Free int10 info */
+ if (pInt10)
+ xf86FreeInt10(pInt10);
+
vgaHWFreeHWRec(pScrn);
RADEONFreeRec(pScrn);
return FALSE;
@@ -1520,9 +1529,7 @@ Bool RADEONScreenInit(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
#else
switch (pScrn->bitsPerPixel) {
case 8:
@@ -1832,14 +1839,10 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
)) return FALSE;
/* DPMS setup */
-#ifdef DPMSExtension
#ifdef ENABLE_FLAT_PANEL
if (!info->HasPanelRegs || info->CRTOnly)
- xf86DPMSInit(pScreen, RADEONDisplayPowerManagementSet, 0);
-#else
- xf86DPMSInit(pScreen, RADEONDisplayPowerManagementSet, 0);
-#endif
#endif
+ xf86DPMSInit(pScreen, RADEONDisplayPowerManagementSet, 0);
RADEONInitVideo(pScreen);
@@ -2965,7 +2968,6 @@ void RADEONFreeScreen(int scrnIndex, int flags)
RADEONFreeRec(pScrn);
}
-#ifdef DPMSExtension
/* Sets VESA Display Power Management Signaling (DPMS) Mode. */
static void RADEONDisplayPowerManagementSet(ScrnInfoPtr pScrn,
int PowerManagementMode, int flags)
@@ -2997,4 +2999,3 @@ static void RADEONDisplayPowerManagementSet(ScrnInfoPtr pScrn,
break;
}
}
-#endif
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_misc.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_misc.c
index 25b639d33..9ccf8a6c2 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_misc.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_misc.c
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_misc.c,v 1.2 2000/11/18 19:37:12 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_misc.c,v 1.3 2001/01/06 20:58:08 tsi Exp $ */
/*
- * Copyright 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 2000 through 2001 by Marc Aurele La France (TSI @ UQV), tsi@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
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_probe.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_probe.c
index e37dbe066..1c0549d5e 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_probe.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_probe.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_probe.c,v 1.5 2000/12/13 02:45:00 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_probe.c,v 1.6 2001/01/06 20:19:11 tsi Exp $ */
/*
* Copyright 2000 ATI Technologies Inc., Markham, Ontario, and
* VA Linux Systems Inc., Fremont, California.
@@ -73,6 +73,8 @@ RADEONAvailableOptions(int chipid, int busid)
* Return options defined in the radeon submodule which will have been
* loaded by this point.
*/
+ if ((chipid >> 16) == PCI_VENDOR_ATI)
+ chipid -= PCI_VENDOR_ATI << 16;
for (i = 0; RADEONPciChipsets[i].PCIid > 0; i++) {
if (chipid == RADEONPciChipsets[i].PCIid)
return RADEONOptions;
@@ -146,7 +148,7 @@ RADEONProbe(DriverPtr drv, int flags)
pEnt = xf86GetEntityInfo(usedChips[i]);
if (pEnt->active) {
- ScrnInfoPtr pScrn = xf86AllocateScreen(drv, 0);
+ ScrnInfoPtr pScrn = xf86AllocateScreen(drv, 0);
#ifdef XFree86LOADER
if (!xf86LoadSubModule(pScrn, "radeon")) {
@@ -158,6 +160,7 @@ RADEONProbe(DriverPtr drv, int flags)
xf86LoaderReqSymLists(RADEONSymbols, NULL);
+#ifndef ELFDEBUG
/* Workaround for possible loader bug */
# define RADEONPreInit \
(xf86PreInitProc*) LoaderSymbol("RADEONPreInit")
@@ -175,6 +178,7 @@ RADEONProbe(DriverPtr drv, int flags)
(xf86FreeScreenProc*) LoaderSymbol("RADEONFreeScreen")
# define RADEONValidMode \
(xf86ValidModeProc*) LoaderSymbol("RADEONValidMode")
+#endif
#endif
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_reg.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_reg.h
index 20ad35cbc..6f59b40ee 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_reg.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_reg.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_reg.h,v 1.4 2000/11/18 19:37:12 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_reg.h,v 1.6 2001/01/11 03:36:58 tsi Exp $ */
/*
* Copyright 2000 ATI Technologies Inc., Markham, Ontario, and
* VA Linux Systems Inc., Fremont, California.
@@ -56,6 +56,11 @@
#include "xf86_ansic.h"
#include "compiler.h"
+/* Atomic updates of PLL clock don't seem to always work and stick, thus
+ * the bit never resets. Here - we use our own check by reading back the
+ * register we've just wrote to make sure it's got the Right! value */
+#define RADEON_ATOMIC_UPDATE 0 /* Use PLL Atomic updates (seems broken) */
+
/* Memory mapped register access macros */
#define INREG8(addr) MMIO_IN8(RADEONMMIO, addr)
#define INREG16(addr) MMIO_IN16(RADEONMMIO, addr)
@@ -139,7 +144,7 @@
RADEON_DAC_PALETTE_ACC_CTL); \
} else { \
OUTREG(RADEON_DAC_CNTL, INREG(RADEON_DAC_CNTL) & \
- ~RADEON_DAC_PALETTE_ACC_CTL); \
+ (CARD32)~RADEON_DAC_PALETTE_ACC_CTL); \
} \
} while (0)
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_video.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_video.c
index 873726ede..f18762c72 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_video.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_video.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_video.c,v 1.8 2000/12/13 12:58:19 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_video.c,v 1.10 2001/01/25 02:27:50 mvojkovi Exp $ */
#include "radeon.h"
#include "radeon_reg.h"
@@ -460,6 +460,11 @@ RADEONQueryBestSize(
unsigned int *p_w, unsigned int *p_h,
pointer data
){
+ if(vid_w > (drw_w << 4))
+ drw_w = vid_w >> 4;
+ if(vid_h > (drw_h << 4))
+ drw_h = vid_h >> 4;
+
*p_w = drw_w;
*p_h = drw_h;
}
@@ -776,7 +781,8 @@ RADEONPutImage(
if(!RegionsEqual(&pPriv->clip, clipBoxes)) {
REGION_COPY(pScreen, &pPriv->clip, clipBoxes);
/* draw these */
- (*info->accel->FillSolidRects)(pScrn, pPriv->colorKey, GXcopy, ~0,
+ (*info->accel->FillSolidRects)(pScrn, pPriv->colorKey, GXcopy,
+ (CARD32)~0,
REGION_NUM_RECTS(clipBoxes),
REGION_RECTS(clipBoxes));
}
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/chips/chips.cpp b/xc/programs/Xserver/hw/xfree86/drivers/chips/chips.cpp
deleted file mode 100644
index 281ea82f6..000000000
--- a/xc/programs/Xserver/hw/xfree86/drivers/chips/chips.cpp
+++ /dev/null
@@ -1,203 +0,0 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/chips.cpp,v 1.9 2000/12/12 18:54:30 dawes Exp $
-.\" shorthand for double quote that works everywhere.
-.ds q \N'34'
-.TH CHIPS __drivermansuffix__ "Version 4.0.2" "XFree86"
-.SH NAME
-chips \- Chips and Technologies video driver
-.SH SYNOPSIS
-.nf
-.B "Section \*qDevice\*q"
-.BI " Identifier \*q" devname \*q
-.B " Driver \*qchips\*q"
-\ \ ...
-.B EndSection
-.fi
-.SH DESCRIPTION
-.B chips
-is an XFree86 driver for Chips and Technologies video processors. The majority
-of the Chips and Technologies chipsets are supported by this driver. In general
-the limitation on the capabilities of this driver are determined by the
-chipset on which it is run. Where possible, this driver provides full
-acceleration and supports the following depths: 1, 4, 8, 15, 16, 24 and on
-the latest chipsets an 8+16 overlay mode. All visual types are supported for
-depth 1, 4 and 8 and both TrueColor and DirectColor visuals are supported
-where possible. Multi-head configurations are supported on PCI or AGP buses.
-.SH SUPPORTED HARDWARE
-The
-.B chips
-driver supports video processors on most of the bus types currently available.
-The chipsets supported fall into one of three architectural classes. A
-.B basic
-architecture, the
-.B WinGine
-architecture and the newer
-.B HiQV
-architecture.
-.PP
-.B Basic Architecture
-.PP
-The supported chipsets are
-.B ct65520, ct65525, ct65530, ct65535, ct65540, ct65545, ct65546
-and
-.B ct65548
-.PP
-Color depths 1, 4 and 8 are supported on all chipsets, while depths 15, 16
-and 24 are supported only on the
-.B 65540, 65545, 65546
-and
-.B 65548
-chipsets. The driver is accelerated when used with the
-.B 65545, 65546
-or
-.B 65548
-chipsets, however the DirectColor visual is not available.
-.PP
-.B Wingine Architecture
-.PP
-The supported chipsets are
-.B ct64200
-and
-.B ct64300
-.PP
-Color depths 1, 4 and 8 are supported on both chipsets, while depths 15, 16
-and 24 are supported only on the
-.B 64300
-chipsets. The driver is accelerated when used with the
-.B 64300
-chipsets, however the DirectColor visual is not available.
-.PP
-.B HiQV Architecture
-.PP
-The supported chipsets are
-.B ct65550, ct65554, ct65555, ct68554, ct69000
-and
-.B ct69030
-.PP
-Color depths 1, 4, 8, 15, 16, 24 and 8+16 are supported on all chipsets.
-The DirectColor visual is supported on all color depths except the 8+16
-overlay mode. Full acceleration is supplied for all 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 driver auto-detects the chipset type, but the following
-.B ChipSet
-names may optionally be specified in the config file
-.B \*qDevice\*q
-section, and will override the auto-detection:
-.PP
-.RS 4
-"ct65520", "ct65525", "ct65530", "ct65535", "ct65540", "ct65545", "ct65546",
-"ct65548", "ct65550", "ct65554", "ct65555", "ct68554", "ct69000", "ct69030",
-"ct64200", "ct64300".
-.RE
-.PP
-The driver will auto-detect the amount of video memory present for all
-chipsets. But maybe overridden with the
-.B VideoRam
-entry in the config file
-.B \*qDevice\*q
-section.
-.PP
-The following driver
-.B Options
-are supported, on one or more of the supported chipsets:
-.TP
-.BI "Option \*qNoAccel\*q \*q" boolean \*q
-Disable or enable acceleration. Default: acceleration is enabled.
-.TP
-.BI "Option \*qNoLinear\*q \*q" boolean \*q
-Disables linear addressing in cases where it is enabled by default.
-Default: off
-.TP
-.BI "Option \*qLinear\*q \*q" boolean \*q
-Enables linear addressing in cases where it is disabled by default.
-Default: off
-.TP
-.BI "Option \*qHWCursor\*q \*q" boolean \*q
-Enable or disable the HW cursor. Default: on.
-.TP
-.BI "Option \*qSWCursor\*q \*q" boolean \*q
-Enable or disable the HW cursor. Default: off.
-.TP
-.BI "Option \*qSTN\*q \*q" boolean \*q
-Force detection of STN screen type. Default: off.
-.TP
-.BI "Option \*qUseModeline\*q \*q" boolean \*q
-Reprogram flat panel timings with values from the modeline. Default: off
-.TP
-.BI "Option \*qFixPanelSize\*q \*q" boolean \*q
-Reprogram flat panel size with values from the modeline. Default: off
-.TP
-.BI "Option \*qNoStretch\*q \*q" boolean \*q
-This option disables the stretching on a mode on a flat panel to fill the
-screen. Default: off
-.TP
-.BI "Option \*qLcdCenter\*q \*q" boolean \*q
-Center the mode displayed on the flat panel on the screen. Default: off
-.TP
-.BI "Option \*qHWclocks\*q \*q" boolean \*q
-Force the use of fixed hardware clocks on chips that support both fixed
-and programmable clocks. Default: off
-.TP
-.BI "Option \*qUseVclk1\*q \*q" boolean \*q
-Use the Vclk1 programable clock on
-.B HiQV
-chipsets instead of Vclk2. Default: off
-.TP
-.BI "Option \*qFPClock8\*q \*q" float \*q
-.TP
-.BI "Option \*qFPClock16\*q \*q" float \*q
-.TP
-.BI "Option \*qFPClock24\*q \*q" float \*q
-.TP
-.BI "Option \*qFPClock32\*q \*q" float \*q
-Force the use of a particular video clock speed for use with the
-flat panel at a specified depth
-.TP
-.BI "Option \*qMMIO\*q \*q" boolean \*q
-Force the use of memory mapped IO where it can be used. Default: off
-.TP
-.BI "Option \*qSuspendHack\*q \*q" boolean \*q
-Force driver to leave centering and stretching registers alone. This
-can fix some laptop suspend/resume problems. Default: off
-.TP
-.BI "Option \*qOverlay\*q"
-Enable 8+24 overlay mode. Only appropriate for depth 24. Default: off.
-.TP
-.BI "Option \*qColorKey\*q \*q" integer \*q
-Set the colormap index used for the transparency key for the depth 8 plane
-when operating in 8+16 overlay mode. The value must be in the range
-2\-255. Default: 255.
-.TP
-.BI "Option \*qVideoKey\*q \*q" integer \*q
-This sets the default pixel value for the YUV video overlay key.
-Default: undefined.
-.TP
-.BI "Option \*qShadowFB\*q \*q" boolean \*q
-Enable or disable use of the shadow framebuffer layer. See
-shadowfb(__drivermansuffix__) for further information. Default: off.
-.TP
-.BI "Option \*qSyncOnGreen\*q \*q" boolean \*q
-Enable or disable combining the sync signals with the green signal.
-Default: off.
-.TP
-.BI "Option \*qShowCache\*q \*q" boolean \*q
-Enable or disable viewing offscreen memory. Used for debugging only
-Default: off.
-.TP
-.BI "Option \*q18bitBus\*q \*q" boolean \*q
-Force the driver to assume that the flat panel has an 18bit data bus.
-Default: off.
-.SH "SEE ALSO"
-XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__)
-.PP
-You are also recommended to read the README.chips file that comes with all
-XFree86 distributions, which discusses the
-.B chips
-driver in more detail.
-.SH AUTHORS
-Authors include: Jon Block, Mike Hollick, Regis Cridlig, Nozomi Ytow,
-Egbert Eich, David Bateman and Xavier Ducoin
-
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 fc0fbffb3..864b7843b 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.5 2000/09/22 11:35:48 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_video.c,v 1.6 2001/02/15 18:36:11 eich Exp $ */
#include "xf86.h"
#include "xf86_OSproc.h"
@@ -58,8 +58,9 @@ void CHIPSInitVideo(ScreenPtr pScreen)
CHIPSPtr cPtr = CHIPSPTR(pScrn);
int num_adaptors;
- if(!(cPtr->Flags & ChipsOverlay8plus16) &&
- (cPtr->Flags & ChipsVideoSupport)) {
+ if (!(cPtr->Flags & ChipsOverlay8plus16) &&
+ (cPtr->Flags & ChipsVideoSupport)
+ && (cPtr->Flags & ChipsAccelSupport)) {
newAdaptor = CHIPSSetupImageVideo(pScreen);
CHIPSInitOffscreenImages(pScreen);
}
@@ -390,12 +391,10 @@ CHIPSStopVideo(ScrnInfoPtr pScrn, pointer data, Bool exit)
CHIPSPtr cPtr = CHIPSPTR(pScrn);
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);
@@ -610,7 +609,6 @@ CHIPSDisplayVideo(
CHIPSHiQVSync(pScrn);
- ErrorF("DisplayVideo\n");
tmp = cPtr->readXR(cPtr, 0xD0);
cPtr->writeXR(cPtr, 0xD0, (tmp | 0x10));
@@ -629,7 +627,8 @@ CHIPSDisplayVideo(
tmp |= 0x08;
break;
case FOURCC_YV12: /* YV12 */
- tmp |= 0x03;
+ /* tmp |= 0x03 */
+ tmp |= 0x00;
break;
case FOURCC_YUY2: /* YUY2 */
default:
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp.h b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp.h
index ca26b8fe9..4373eabba 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp.h,v 1.4 2000/12/06 15:35:15 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp.h,v 1.6 2001/02/15 17:39:28 eich Exp $ */
/* (c) Itai Nahshon */
@@ -35,6 +35,8 @@ enum {
CIR_NSAVED
};
+typedef enum {LCD_NONE, LCD_DUAL_MONO, LCD_UNKNOWN, LCD_DSTN, LCD_TFT} LCDType;
+
typedef struct {
unsigned char ExtVga[CIR_NSAVED];
} AlpRegRec, *AlpRegPtr;
@@ -54,6 +56,8 @@ typedef struct alpRec {
AlpRegRec SavedReg;
AlpRegRec ModeReg;
+ LCDType lcdType;
+ int lcdWidth, lcdHeight;
int CursorWidth;
int CursorHeight;
int waitMsk;
@@ -69,6 +73,10 @@ typedef struct alpRec {
CARD32 monoPattern8x8;
Bool autoStart;
+
+ /* MMIO Base for BitBLT operation. This is
+ IOBase for 5446 and 7548, IOBase+0x100 for 5480 */
+ unsigned char * BLTBase;
/* XXX For XF86Config based mem configuration */
CARD32 sr0f, sr17;
} AlpRec, *AlpPtr;
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_dga.c b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_dga.c
deleted file mode 100644
index 544a3aa77..000000000
--- a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_dga.c
+++ /dev/null
@@ -1,81 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_dga.c,v 1.2 2000/02/08 13:13:14 eich Exp $ */
-
-/* (c) Itai Nahshon */
-
-#include "xf86.h"
-#include "xf86_OSproc.h"
-#include "xf86_ansic.h"
-#include "compiler.h"
-
-#include "xf86Pci.h"
-#include "xf86PciInfo.h"
-
-#include "vgaHW.h"
-
-#include "cir.h"
-
-static Bool
-CirDGAGetParams(int scrnIndex, unsigned long *offset, int *banksize,
- int *memsize)
-{
- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
- CIRPtr pCir = &CIRPTR(pScrn)->CirRec;
-
- *offset = pCir->FbAddress;
- *banksize = pScrn->videoRam * 1024;
- *memsize = pScrn->videoRam * 1024;
-
-#ifdef CIR_DEBUG
- ErrorF("CirDGAGetParams %d = 0x%08x, %d, %d\n",
- scrnIndex, *banksize, *memsize);
-#endif
- return TRUE;
-}
-
-static Bool
-CirDGASetDirect(int scrnIndex, Bool enable)
-{
- return TRUE;
-}
-
-static Bool
-CirDGASetBank(int scrnIndex, int bank, int flags)
-{
- return TRUE;
-}
-
-static Bool
-CirDGASetViewport(int scrnIndex, int x, int y, int flags)
-{
- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
- (*pScrn->AdjustFrame)(scrnIndex, x, y, 0);
- return TRUE;
-}
-
-static Bool
-CirDGAViewportChanged(int scrnIndex, int n, int flags)
-{
- return TRUE;
-}
-
-Bool
-CirDGAInit(ScreenPtr pScreen)
-{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- CIRPtr pCir = &CIRPTR(pScrn)->CirRec;
- DGAInfoPtr pDGAInfo;
-
- pDGAInfo = DGACreateInfoRec();
- if(pDGAInfo == NULL)
- return FALSE;
-
- pCir->DGAInfo = pDGAInfo;
-
- pDGAInfo->GetParams = CirDGAGetParams;
- pDGAInfo->SetDirectMode = CirDGASetDirect;
- pDGAInfo->SetBank = CirDGASetBank;
- pDGAInfo->SetViewport = CirDGASetViewport;
- pDGAInfo->ViewportChanged = CirDGAViewportChanged;;
-
- return DGAInit(pScreen, pDGAInfo, 0);
-}
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 1eec31b39..9d68f0767 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_driver.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_driver.c
@@ -11,7 +11,7 @@
* Guy DESBIEF
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_driver.c,v 1.17 2000/12/07 15:43:44 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_driver.c,v 1.19 2001/02/15 17:39:27 eich Exp $ */
/* All drivers should typically include these */
#include "xf86.h"
@@ -57,13 +57,6 @@
#include "xf1bpp.h"
#include "fb.h"
-/* These need to be checked */
-#if 0
-#ifdef XFreeXDGA
-#define _XF86DGA_SERVER_
-#include "extensions/xf86dgastr.h"
-#endif
-#endif
#include "xf86DDC.h"
#include "xf86int10.h"
@@ -112,10 +105,10 @@ static void AlpProbeLCD(ScrnInfoPtr pScrn);
static void AlpSetClock(CirPtr pCir, vgaHWPtr hwp, int freq);
-#ifdef DPMSExtension
+static void AlpOffscreenAccelInit(ScrnInfoPtr pScrn);
+
static void AlpDisplayPowerManagementSet(ScrnInfoPtr pScrn,
int PowerManagementMode, int flags);
-#endif
/*
* This is intentionally screen-independent. It indicates the binding
@@ -176,13 +169,18 @@ static const char *vgahwSymbols[] = {
NULL
};
+#ifdef XFree86LOADER
+
static const char *fbSymbols[] = {
"xf1bppScreenInit",
"xf4bppScreenInit",
"fbScreenInit",
+ "fbPictureInit",
NULL
};
+#endif
+
static const char *xaaSymbols[] = {
"XAADestroyInfoRec",
"XAACreateInfoRec",
@@ -510,10 +508,11 @@ AlpPreInit(ScrnInfoPtr pScrn, int flags)
{
CirPtr pCir;
vgaHWPtr hwp;
- MessageType from;
+ MessageType from, from1;
int i;
ClockRangePtr clockRanges;
char *s;
+ xf86Int10InfoPtr pInt = NULL;
if (flags & PROBE_DETECT) {
cirProbeDDC( pScrn, xf86GetEntityInfo(pScrn->entityList[0])->index );
@@ -560,11 +559,8 @@ AlpPreInit(ScrnInfoPtr pScrn, int flags)
pCir->PciInfo->device,
pCir->PciInfo->func);
-#if 1
if (xf86LoadSubModule(pScrn, "int10")) {
- xf86Int10InfoPtr pInt;
xf86LoaderReqSymLists(int10Symbols,NULL);
-#if 1
xf86DrvMsg(pScrn->scrnIndex,X_INFO,"initializing int10\n");
pInt = xf86InitInt10(pCir->pEnt->index);
xf86FreeInt10(pInt);
@@ -575,9 +571,7 @@ AlpPreInit(ScrnInfoPtr pScrn, int flags)
pciWriteLong(pCir->PciTag,0x10,pCir->PciInfo->memBase[0]);
pciWriteLong(pCir->PciTag,0x14,pCir->PciInfo->memBase[1]);
-#endif
}
-#endif
/* Set pScrn->monitor */
pScrn->monitor = pScrn->confScreen->monitor;
@@ -639,6 +633,11 @@ AlpPreInit(ScrnInfoPtr pScrn, int flags)
/* Process the options */
xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, CirOptions);
+ if (!xf86IsPrimaryPci(pCir->PciInfo)
+ && !(pInt || (xf86IsOptionSet(CirOptions,OPTION_MEMCFG1)
+ && xf86IsOptionSet(CirOptions,OPTION_MEMCFG2))))
+ return FALSE;
+
if (pScrn->depth == 8)
pScrn->rgbBits = 6;
@@ -718,14 +717,6 @@ AlpPreInit(ScrnInfoPtr pScrn, int flags)
/* We do not really need that YET. */
}
}
- if(pCir->IOAddress != 0) {
- xf86DrvMsg(pScrn->scrnIndex, from, "MMIO registers at 0x%lX\n",
- (unsigned long)pCir->IOAddress);
- /* Default to MMIO if we have a separate IOAddress and
- not in monochrome mode (IO 0x3Bx is not relocated!) */
- if (pScrn->bitsPerPixel != 1)
- pCir->UseMMIO = TRUE;
- }
/* User options can override the MMIO default */
#if 0
@@ -737,10 +728,28 @@ AlpPreInit(ScrnInfoPtr pScrn, int flags)
#endif
if (!xf86ReturnOptValBool(CirOptions, OPTION_MMIO, TRUE)) {
pCir->UseMMIO = FALSE;
- from = X_CONFIG;
- }
- if (pCir->UseMMIO)
- xf86DrvMsg(pScrn->scrnIndex, from, "Using MMIO\n");
+ from1 = X_CONFIG;
+ } else if (pCir->IOAddress) {
+ /* Default to MMIO if we have a separate IOAddress and
+ not in monochrome mode (IO 0x3Bx is not relocated!) */
+ if (pScrn->bitsPerPixel != 1) {
+ pCir->UseMMIO = TRUE;
+ from1 = X_PROBED;
+ } else {
+ pCir->UseMMIO = FALSE;
+ from1 = X_PROBED;
+ }
+ } else {
+ pCir->UseMMIO = FALSE;
+ from1 = X_PROBED;
+ }
+
+ if (pCir->UseMMIO) {
+ xf86DrvMsg(pScrn->scrnIndex, from1, "Using MMIO\n");
+ xf86DrvMsg(pScrn->scrnIndex, from, "MMIO registers at 0x%lX\n",
+ (unsigned long)pCir->IOAddress);
+ } else
+ xf86DrvMsg(pScrn->scrnIndex, from1, "Not Using MMIO\n");
/*
* XXX Check if this is correct
@@ -1078,10 +1087,7 @@ AlpPreInit(ScrnInfoPtr pScrn, int flags)
AlpFreeRec(pScrn);
return FALSE;
}
- xf86LoaderReqSymbols("fbScreenInit",NULL);
-#ifdef RENDER
- xf86LoaderReqSymbols("fbPictureInit", NULL);
-#endif
+ xf86LoaderReqSymbols("fbScreenInit", "fbPictureInit", NULL);
break;
}
@@ -1458,6 +1464,7 @@ AlpScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
VisualPtr visual;
int displayWidth,width,height;
unsigned char * FbBase = NULL;
+ int cursor_size = 0;
#ifdef ALP_DEBUG
ErrorF("AlpScreenInit\n");
@@ -1582,9 +1589,7 @@ AlpScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
}
if (!ret)
return FALSE;
-#ifdef RENDER
fbPictureInit (pScreen, 0, 0);
-#endif
#ifdef ALP_DEBUG
ErrorF("AlpScreenInit after depth dependent init\n");
@@ -1612,83 +1617,64 @@ AlpScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
*/
xf86SetBlackWhitePixels(pScreen);
- xf86SetSilkenMouse(pScreen);
-
- /* Initialise cursor functions */
- miDCInitialize(pScreen, xf86GetPointerScreenFuncs());
-
- /* Allocation of off-screen memory to various stuff
+ /*
+ 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;
+ *must* be in the last videoram locations
+ */
+ pCir->offscreen_offset = pScrn->videoRam*1024;
+ pCir->offscreen_size = pScrn->videoRam * 1024 - pScrn->virtualY *
+ (BitmapBytePad(pScrn->displayWidth * pScrn->bitsPerPixel));
#ifdef ALP_DEBUG
- ErrorF("offscreen_offset=%d, offscreen_size=%d\n",
- offscreen_offset, offscreen_size);
+ ErrorF("offscreen_offset=%d, offscreen_size=%d\n",
+ pCir->offscreen_offset, pCir->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");
+ if (pCir->HWCursor) { /* Initialize HW cursor layer */
+
+ if ((pCir->properties & HWCUR64)
+ && (pCir->offscreen_size >= 64*8*2)) {
+ cursor_size = 64;
+ pCir->offscreen_size -= 64*8*2;
+ pCir->offscreen_offset -= 64*8*2;
+ } else if (pCir->offscreen_size >= 32*4*2) {
+ cursor_size = 32;
+ pCir->offscreen_size -= 32*8*2;
+ pCir->offscreen_offset -= 32*8*2;
}
-#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");
+ AlpOffscreenAccelInit(pScrn);
+ 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");
+#if 1
+ pCir->DGAModeInit = AlpModeInit;
+ if (!CirDGAInit(pScreen))
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "DGA initialization failed\n");
#endif
+ xf86SetSilkenMouse(pScreen);
+
+ /* Initialise cursor functions */
+ miDCInitialize(pScreen, xf86GetPointerScreenFuncs());
+
+ if (pCir->HWCursor) {
+ if (!AlpHWCursorInit(pScreen, cursor_size))
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "Hardware cursor initialization failed\n");
+#ifdef ALP_DEBUG
+ ErrorF("AlpHWCursorInit() complete\n");
+#endif
+ }
+
if (pCir->shadowFB) {
RefreshAreaFuncPtr refreshArea = cirRefreshArea;
@@ -1716,9 +1702,7 @@ AlpScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
if (pScrn->bitsPerPixel > 1 && pScrn->bitsPerPixel <= 8)
vgaHWHandleColormaps(pScreen);
-#ifdef DPMSExtension
xf86DPMSInit(pScreen, AlpDisplayPowerManagementSet, 0);
-#endif
pScrn->memPhysBase = pCir->FbAddress;
pScrn->fbOffset = 0;
@@ -1811,12 +1795,20 @@ Bool
AlpEnterVT(int scrnIndex, int flags)
{
ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+ CirPtr pCir = CIRPTR(pScrn);
+ Bool ret;
+
#ifdef ALP_DEBUG
ErrorF("AlpEnterVT\n");
#endif
/* Should we re-save the text mode on each VT enter? */
- return AlpModeInit(pScrn, pScrn->currentMode);
+ if (!(ret = AlpModeInit(pScrn, pScrn->currentMode)))
+ return FALSE;
+
+ pCir->InitAccel(pScrn);
+
+ return ret;
}
@@ -1869,11 +1861,10 @@ AlpCloseScreen(int scrnIndex, ScreenPtr pScreen)
if (pCir->CursorInfoRec)
xf86DestroyCursorInfoRec(pCir->CursorInfoRec);
pCir->CursorInfoRec = NULL;
-#if 0
- if (pCir->DGAInfo)
- DGADestroyInfoRec(pCir->DGAInfo);
- pCir->DGAInfo = NULL;
-#endif
+ if (pCir->DGAModes)
+ xfree(pCir->DGAModes);
+ pCir->DGAnumModes = 0;
+ pCir->DGAModes = NULL;
pScrn->vtSema = FALSE;
@@ -1983,7 +1974,6 @@ AlpSetClock(CirPtr pCir, vgaHWPtr hwp, int freq)
*
* Sets VESA Display Power Management Signaling (DPMS) Mode.
*/
-#ifdef DPMSExtension
static void
AlpDisplayPowerManagementSet(ScrnInfoPtr pScrn, int PowerManagementMode,
int flags)
@@ -2031,7 +2021,6 @@ AlpDisplayPowerManagementSet(ScrnInfoPtr pScrn, int PowerManagementMode,
gr0e |= hwp->readGr(hwp, 0x0E) & ~0x06;
hwp->writeGr(hwp, 0x0E, gr0e);
}
-#endif
#ifdef ALPPROBEI2C
static void AlpProbeI2C(int scrnIndex)
@@ -2061,69 +2050,96 @@ static void AlpProbeI2C(int scrnIndex)
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)"
- };
+ CirPtr pCir = CIRPTR(pScrn);
+ AlpPtr pAlp = ALPPTR(pCir);
+ vgaHWPtr hwp = VGAHWPTR(pScrn);
+ CARD8 lcdCrtl;
- pCir -> lcdType = LCD_NONE;
+ static const char* lcd_type_names[] =
+ {
+ "none",
+ "dual-scan monochrome",
+ "unknown",
+ "DSTN (dual scan color)",
+ "TFT (active matrix)"
+ };
- 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)
- {
+
+ pAlp->lcdType = LCD_NONE;
+
+ switch (pCir->Chipset) {
+ case PCI_CHIP_GD7548:
+ switch (hwp->readCrtc(hwp, 0x2C) >> 6) {
+ case 0: pAlp->lcdType = LCD_DUAL_MONO; break;
+ case 1: pAlp->lcdType = LCD_UNKNOWN; break;
+ case 2: pAlp->lcdType = LCD_DSTN; break;
+ case 3: pAlp->lcdType = LCD_TFT; break;
+ }
+
+ /* Enable LCD control registers instead of normal CRTC registers */
+ lcdCrtl = hwp->readCrtc(hwp, 0x2D);
+ hwp->writeCrtc(hwp, 0x2D, lcdCrtl | 0x80);
+
+ switch ((hwp->readCrtc(hwp, 0x9) >> 2) & 3) {
case 0:
- pCir->lcdWidth = 640;
- pCir->lcdHeight = 480;
- break;
+ pAlp->lcdWidth = 640;
+ pAlp->lcdHeight = 480;
+ break;
- case 1:
- pCir->lcdWidth = 800;
- pCir->lcdHeight = 600;
- break;
+ case 1:
+ pAlp->lcdWidth = 800;
+ pAlp->lcdHeight = 600;
+ break;
case 2:
- pCir->lcdWidth = 1024;
- pCir->lcdHeight = 768;
- break;
+ pAlp->lcdWidth = 1024;
+ pAlp->lcdHeight = 768;
+ break;
case 3:
- pCir->lcdWidth = 0;
- pCir->lcdHeight = 0;
- break;
- }
+ pAlp->lcdWidth = 0;
+ pAlp->lcdHeight = 0;
+ break;
+ }
- /* Disable LCD control registers */
- hwp->writeCrtc(hwp, 0x2D, hwp->readCrtc(hwp, 0x2D) & ~0x80);
- break;
- }
+ /* Disable LCD control registers */
+ hwp->writeCrtc(hwp, 0x2D, lcdCrtl);
+ 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]);
- }
+ if (pAlp->lcdType != LCD_NONE) {
+ xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
+ "LCD display: %dx%d %s\n",
+ pAlp->lcdWidth, pAlp->lcdHeight,
+ lcd_type_names[pAlp->lcdType]);
+ }
}
+static void
+AlpOffscreenAccelInit(ScrnInfoPtr pScrn)
+{
+ CirPtr pCir = CIRPTR(pScrn);
+ AlpPtr pAlp = ALPPTR(pCir);
+ if (pCir->offscreen_size >= 8 && pCir->Chipset == PCI_CHIP_GD7548) {
+ pCir->offscreen_offset -= 8;
+ pCir->offscreen_size -= 8;
+ pAlp->monoPattern8x8 = pCir->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= pCir->offscreen_offset / pCir->pitch;
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "Using %d lines for offscreen memory\n",
+ box.y2 - pScrn->virtualY);
+ }
+}
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 77b8920f4..5872a905a 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.5 2000/12/06 15:35:15 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_xaa.c,v 1.6 2001/02/15 17:39:27 eich Exp $ */
#include "xf86.h"
#include "xf86_OSproc.h"
@@ -565,120 +565,120 @@ AlpSubsequentColorExpandScanline(
}
#endif
+static void
+AlpAccelEngineInit(ScrnInfoPtr pScrn)
+{
+ CirPtr pCir = CIRPTR(pScrn);
+
+ outw(0x3CE, 0x200E); /* enable writes to gr33 */
+ /* Setup things for autostart */
+ if (pCir->properties & ACCEL_AUTOSTART) {
+ outw(0x3CE, 0x8031); /* enable autostart */
+ pCir->chip.alp->waitMsk = 0x10;
+ pCir->chip.alp->autoStart = TRUE;
+ } else {
+ pCir->chip.alp->waitMsk = 0x1;
+ pCir->chip.alp->autoStart = FALSE;
+ }
+}
+
Bool
AlpXAAInit(ScreenPtr pScreen)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- CirPtr pCir = CIRPTR(pScrn);
- AlpPtr pAlp = ALPPTR(pCir);
- XAAInfoRecPtr XAAPtr;
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ CirPtr pCir = CIRPTR(pScrn);
+ AlpPtr pAlp = ALPPTR(pCir);
+ XAAInfoRecPtr XAAPtr;
+ pCir->InitAccel = AlpAccelEngineInit;
#ifdef ALP_DEBUG
- ErrorF("AlpXAAInit\n");
+ ErrorF("AlpXAAInit\n");
#endif
- XAAPtr = XAACreateInfoRec();
- if (!XAAPtr) return FALSE;
-
- XAAPtr->SetupForScreenToScreenCopy = AlpSetupForScreenToScreenCopy;
- XAAPtr->SubsequentScreenToScreenCopy = AlpSubsequentScreenToScreenCopy;
- XAAPtr->ScreenToScreenCopyFlags =
- 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 = NO_PLANEMASK;
-
- XAAPtr->SetupForMono8x8PatternFill = AlpSetupForMono8x8PatternFill;
- XAAPtr->SubsequentMono8x8PatternFillRect =
- AlpSubsequentMono8x8PatternFillRect;
- XAAPtr->SubsequentMono8x8PatternFillTrap = NULL;
- XAAPtr->Mono8x8PatternFillFlags =
- 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 =
- NO_PLANEMASK | BIT_ORDER_IN_BYTE_MSBFIRST |
- SCANLINE_PAD_DWORD | ROP_NEEDS_SOURCE |
- CPU_TRANSFER_PAD_DWORD | CPU_TRANSFER_BASE_FIXED;
-#endif
+ XAAPtr = XAACreateInfoRec();
+ if (!XAAPtr) return FALSE;
+
+ /* Pixmap cache */
+ XAAPtr->Flags |= LINEAR_FRAMEBUFFER;
+ XAAPtr->Sync = AlpSync;
+
+ XAAPtr->SetupForScreenToScreenCopy = AlpSetupForScreenToScreenCopy;
+ XAAPtr->SubsequentScreenToScreenCopy = AlpSubsequentScreenToScreenCopy;
+ XAAPtr->ScreenToScreenCopyFlags =
+ NO_TRANSPARENCY | NO_PLANEMASK;
+
+ XAAPtr->SetupForSolidFill = AlpSetupForSolidFill;
+ XAAPtr->SubsequentSolidFillRect = AlpSubsequentSolidFillRect;
+ XAAPtr->SubsequentSolidFillTrap = NULL;
+ XAAPtr->SolidFillFlags = NO_PLANEMASK;
+
+ if (pCir->Chipset == PCI_CHIP_GD7548) {
+ if (pAlp->monoPattern8x8) {
+ XAAPtr->SetupForMono8x8PatternFill
+ = AlpSetupForMono8x8PatternFill;
+ XAAPtr->SubsequentMono8x8PatternFillRect
+ = AlpSubsequentMono8x8PatternFillRect;
+ XAAPtr->SubsequentMono8x8PatternFillTrap = NULL;
+ XAAPtr->Mono8x8PatternFillFlags =
+ NO_PLANEMASK |
+ HARDWARE_PATTERN_PROGRAMMED_BITS | BIT_ORDER_IN_BYTE_MSBFIRST;
+ }
#if 1
- /* kludge: since XF86 does not support byte-padded
- mono bitmaps (only dword-padded), use the
- scanline version */
- XAAPtr->SetupForScanlineCPUToScreenColorExpandFill =
+ /* kludge: since XF86 does not support byte-padded
+ mono bitmaps (only dword-padded), use the
+ scanline version */
+ XAAPtr->SetupForScanlineCPUToScreenColorExpandFill =
AlpSetupForScanlineCPUToScreenColorExpandFill;
- XAAPtr->SubsequentScanlineCPUToScreenColorExpandFill =
+ XAAPtr->SubsequentScanlineCPUToScreenColorExpandFill =
AlpSubsequentScanlineCPUToScreenColorExpandFill;
- XAAPtr->SubsequentColorExpandScanline =
+ XAAPtr->SubsequentColorExpandScanline =
AlpSubsequentColorExpandScanline;
- {
- const int NumScanlineColorExpandBuffers = 2;
- int i;
- int buffer_size = (pCir->pScrn->virtualX + 31) & ~31;
+ {
+ 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);
+ ErrorF("Computing buffers for %d pixel lines\n",
+ pCir->pScrn->virtualX);
#endif
- XAAPtr->NumScanlineColorExpandBuffers =
+ XAAPtr->NumScanlineColorExpandBuffers =
NumScanlineColorExpandBuffers;
- XAAPtr->ScanlineColorExpandBuffers =
+ XAAPtr->ScanlineColorExpandBuffers =
pCir->ScanlineColorExpandBuffers = (unsigned char **)
(malloc(sizeof(unsigned char *) *
NumScanlineColorExpandBuffers));
/* TODO: are those mallocs to be freed ? */
- for(i=0; i<NumScanlineColorExpandBuffers; i++)
+ for(i=0; i<NumScanlineColorExpandBuffers; i++)
pCir->ScanlineColorExpandBuffers[i] = (unsigned char *)
malloc(buffer_size);
- }
- XAAPtr->ScanlineCPUToScreenColorExpandFillFlags =
+ }
+ XAAPtr->ScanlineCPUToScreenColorExpandFillFlags =
NO_PLANEMASK | BIT_ORDER_IN_BYTE_MSBFIRST |
SCANLINE_PAD_DWORD | ROP_NEEDS_SOURCE;
#endif
- break;
-
- case PCI_CHIP_GD5446:
- case PCI_CHIP_GD5480:
- XAAPtr->SetupForSolidFill = AlpSetupForSolidFill;
- XAAPtr->SubsequentSolidFillRect = AlpSubsequentSolidFillRect;
- XAAPtr->SubsequentSolidFillTrap = NULL;
- XAAPtr->SolidFillFlags = NO_TRANSPARENCY|NO_PLANEMASK;
- outw(0x3CE, 0x200E); /* enable writes to gr33 */
- break;
- }
-
- /* TODO: probably too limited */
+#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 =
+ NO_PLANEMASK | BIT_ORDER_IN_BYTE_MSBFIRST |
+ SCANLINE_PAD_DWORD | ROP_NEEDS_SOURCE |
+ CPU_TRANSFER_PAD_DWORD | CPU_TRANSFER_BASE_FIXED;
+#endif
+ }
- XAAPtr->Sync = AlpSync;
+ AlpAccelEngineInit(pScrn);
- /* Pixmap cache */
- XAAPtr -> Flags |= LINEAR_FRAMEBUFFER;
+ pCir->AccelInfoRec = XAAPtr;
- /* Setup things for autostart */
- if (pCir->properties & ACCEL_AUTOSTART) {
- outw(0x3CE, 0x8031); /* enable autostart */
- pCir->chip.alp->waitMsk = 0x10;
- pCir->chip.alp->autoStart = TRUE;
- } else {
- pCir->chip.alp->waitMsk = 0x1;
- pCir->chip.alp->autoStart = FALSE;
- }
- if (!XAAInit(pScreen, XAAPtr))
- return FALSE;
+ if (!XAAInit(pScreen, XAAPtr))
+ return FALSE;
- return TRUE;
+ return TRUE;
}
+
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 105c9d444..e77926899 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.4 2000/12/06 15:35:15 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_xaam.c,v 1.6 2001/02/15 17:39:27 eich Exp $ */
#include "xf86.h"
#include "xf86_OSproc.h"
@@ -19,25 +19,55 @@
#ifdef DEBUG
#define minb(p) \
ErrorF("minb(%X)\n", p),\
- MMIO_IN8(pCir->IOBase, (p))
+ MMIO_IN8(pCir->chip.alp->BLTBase, (p))
#define moutb(p,v) \
ErrorF("moutb(%X)\n", p),\
- MMIO_OUT8(pCir->IOBase, (p),(v))
+ MMIO_OUT8(pCir->chip.alp->BLTBase, (p),(v))
+#define vga_minb(p) \
+ ErrorF("minb(%X)\n", p),\
+ MMIO_IN8(hwp->MMIOBase, (hwp->MMIOOffset + (p)))
+#define vga_moutb(p,v) \
+ ErrorF("moutb(%X)\n", p),\
+ MMIO_OUT8(pCir->MMIOBase, (hwp->MMIOOffset + (p)),(v))
#define minl(p) \
ErrorF("minl(%X)\n", p),\
- MMIO_IN32(pCir->IOBase, (p))
+ MMIO_IN32(pCir->chip.alp->BLTBase, (p))
#define moutl(p,v) \
ErrorF("moutl(%X)\n", p),\
- MMIO_OUT32(pCir->IOBase, (p),(v))
+ MMIO_OUT32(pCir->chip.alp->BLTBase, (p),(v))
#else
-#define minb(p) MMIO_IN8(pCir->IOBase, (p))
-#define moutb(p,v) MMIO_OUT8(pCir->IOBase, (p),(v))
-#define minl(p) MMIO_IN32(pCir->IOBase, (p))
-#define moutl(p,v) MMIO_OUT32(pCir->IOBase, (p),(v))
+#define minb(p) MMIO_IN8(pCir->chip.alp->BLTBase, (p))
+#define moutb(p,v) MMIO_OUT8(pCir->chip.alp->BLTBase, (p),(v))
+#define vga_minb(p) MMIO_IN8(hwp->MMIIOBase, (hwp->MMIOOffset + (p)))
+#define vga_moutb(p,v) MMIO_OUT8(hwp->MMIOBase, (hwp->MMIOOffset + (p)),(v))
+#define minl(p) MMIO_IN32(pCir->chip.alp->BLTBase, (p))
+#define moutl(p,v) MMIO_OUT32(pCir->chip.alp->BLTBase, (p),(v))
#endif
-#define WAIT while(minb(0x40) & pCir->chip.alp->waitMsk){};
-#define WAIT_1 while(minb(0x40) & 0x1){};
+static const CARD8 translated_rop[] =
+{
+ /* GXclear */ 0x00U,
+ /* GXand */ 0x05U,
+ /* GXandreverse */ 0x09U,
+ /* GXcopy */ 0x0DU,
+ /* GXandinversted */ 0x50U,
+ /* GXnoop */ 0x06U,
+ /* GXxor */ 0x59U,
+ /* GXor */ 0x6DU,
+ /* GXnor */ 0x90U,
+ /* GXequiv */ 0x95U,
+ /* GXinvert */ 0x0BU,
+ /* GXorReverse */ 0xADU,
+ /* GXcopyInverted */ 0xD0U,
+ /* GXorInverted */ 0xD6U,
+ /* GXnand */ 0xDAU,
+ /* GXset */ 0x0EU
+};
+
+#define WAIT while(minl(0x40) & pCir->chip.alp->waitMsk){};
+#define WAIT_1 while(minl(0x40) & 0x1){};
+
+#define SetupForRop(rop) moutb(0x1A, translated_rop[rop])
static void AlpSync(ScrnInfoPtr pScrn)
{
@@ -58,6 +88,8 @@ AlpSetupForScreenToScreenCopy(ScrnInfoPtr pScrn, int xdir, int ydir, int rop,
WAIT;
+ SetupForRop(rop);
+
#ifdef ALP_DEBUG
ErrorF("AlpSetupForScreenToScreenCopy xdir=%d ydir=%d rop=%x planemask=%x trans_color=%x\n",
xdir, ydir, rop, planemask, trans_color);
@@ -70,43 +102,45 @@ static void
AlpSubsequentScreenToScreenCopy(ScrnInfoPtr pScrn, int x1, int y1, int x2,
int y2, int w, int h)
{
- CirPtr pCir = CIRPTR(pScrn);
- int source, dest;
- int hh, ww;
- int decrement = 0;
- int pitch = pCir->pitch;
-
- ww = ((w * pScrn->bitsPerPixel / 8) - 1) & 0x1fff;
- hh = (h - 1) & 0x1fff;
- dest = y2 * pitch + x2 * pScrn->bitsPerPixel / 8;
- source = y1 * pitch + x1 * pScrn->bitsPerPixel / 8;
- if (dest > source) {
- decrement = 1;
- dest += hh * pitch + ww;
- source += hh * pitch + ww;
- }
-
- WAIT;
-
- /* Width / Height */
- moutl(0x08, (hh << 16) | ww);
- /* source */
- moutl(0x14, source & 0x3fffff);
- moutl(0x18, 0x0d0000 | decrement);
-
- /* dest */
- write_mem_barrier();
- moutl(0x10, dest & 0x3fffff);
-
+ CirPtr pCir = CIRPTR(pScrn);
+ int source, dest;
+ int hh, ww;
+ int decrement = 0;
+ int pitch = pCir->pitch;
+
+ ww = ((w * pScrn->bitsPerPixel / 8) - 1) & 0x1fff;
+ hh = (h - 1) & 0x1fff;
+ dest = y2 * pitch + x2 * pScrn->bitsPerPixel / 8;
+ source = y1 * pitch + x1 * pScrn->bitsPerPixel / 8;
+ if (dest > source) {
+ decrement = 1;
+ dest += hh * pitch + ww;
+ source += hh * pitch + ww;
+ }
+
+ WAIT;
+
+ /* Width / Height */
+ moutl(0x08, (hh << 16) | ww);
+ /* source */
+ moutl(0x14, source & 0x3fffff);
+ moutl(0x18, 0x0d0000 | decrement);
+
+ /* dest */
+ write_mem_barrier();
+ moutl(0x10, dest & 0x3fffff);
+
#ifdef ALP_DEBUG
- ErrorF("AlpSubsequentScreenToScreenCopy x1=%d y1=%d x2=%d y2=%d w=%d h=%d\n",
- x1, y1, x2, y2, w, h);
- ErrorF("AlpSubsequentScreenToScreenCopy s=%d d=%d ww=%d hh=%d\n",
- source, dest, ww, hh);
+ ErrorF("AlpSubsequentScreenToScreenCopy x1=%d y1=%d x2=%d y2=%d w=%d h=%d\n",
+ x1, y1, x2, y2, w, h);
+ ErrorF("AlpSubsequentScreenToScreenCopy s=%d d=%d ww=%d hh=%d\n",
+ source, dest, ww, hh);
#endif
- if (!pCir->chip.alp->autoStart)
- moutb(0x40,0x02);
- write_mem_barrier();
+ if (!pCir->chip.alp->autoStart) {
+ CARD32 val = minl(0x40);
+ moutl(0x40,val | 0x02);
+ }
+ write_mem_barrier();
}
@@ -114,51 +148,75 @@ static void
AlpSetupForSolidFill(ScrnInfoPtr pScrn, int color, int rop,
unsigned int planemask)
{
- CirPtr pCir = CIRPTR(pScrn);
- int pitch = pCir->pitch;
+ CirPtr pCir = CIRPTR(pScrn);
+ int pitch = pCir->pitch;
- WAIT;
+ WAIT;
+
+ SetupForRop(rop);
#ifdef ALP_DEBUG
- ErrorF("AlpSetupForSolidFill color=%x rop=%x planemask=%x\n",
- color, rop, planemask);
+ ErrorF("AlpSetupForSolidFill color=%x rop=%x planemask=%x\n",
+ color, rop, planemask);
#endif
- moutl(0x04, color & 0xffffff);
+ moutl(0x04, color & 0xffffff);
- /* Set dest pitch */
- moutl(0x0C, pitch & 0x1fff);
- moutl(0x18, (0xC0|((pScrn->bitsPerPixel - 8) << 1)) | 0x040d0000);
+ /* Set dest pitch */
+ moutl(0x0C, pitch & 0x1fff);
+ moutl(0x18, (0xC0|((pScrn->bitsPerPixel - 8) << 1)) | 0x040d0000);
}
static void
AlpSubsequentSolidFillRect(ScrnInfoPtr pScrn, int x, int y, int w, int h)
{
- int dest;
- int hh, ww;
- CirPtr pCir = CIRPTR(pScrn);
- int pitch = pCir->pitch;
+ int dest;
+ int hh, ww;
+ CirPtr pCir = CIRPTR(pScrn);
+ int pitch = pCir->pitch;
- ww = ((w * pScrn->bitsPerPixel / 8) - 1) & 0x1fff;
- hh = (h - 1) & 0x7ff;
- dest = y * pitch + x * pScrn->bitsPerPixel / 8;
+ ww = ((w * pScrn->bitsPerPixel / 8) - 1) & 0x1fff;
+ hh = (h - 1) & 0x7ff;
+ dest = y * pitch + x * pScrn->bitsPerPixel / 8;
- WAIT;
-
- /* Width / Height */
- write_mem_barrier();
- moutl(0x08, (hh << 16) | ww);
+ WAIT;
+
+ /* Width / Height */
+ write_mem_barrier();
+ moutl(0x08, (hh << 16) | ww);
#ifdef ALP_DEBUG
- ErrorF("AlpSubsequentSolidFillRect x=%d y=%d w=%d h=%d\n",
- x, y, w, h);
+ ErrorF("AlpSubsequentSolidFillRect x=%d y=%d w=%d h=%d\n",
+ x, y, w, h);
#endif
- /* dest */
- moutl(0x10, (dest & 0x3fffff));
+ /* dest */
+ moutl(0x10, (dest & 0x3fffff));
+
+ if (!pCir->chip.alp->autoStart) {
+ CARD32 val = minl(0x40);
+ moutl(0x40, val | 0x02);
+ }
+ write_mem_barrier();
+}
- if (!pCir->chip.alp->autoStart)
- moutb(0x40,0x02);
- write_mem_barrier();
+static void
+AlpAccelEngineInit(ScrnInfoPtr pScrn)
+{
+ vgaHWPtr hwp = VGAHWPTR(pScrn);
+ CirPtr pCir = CIRPTR(pScrn);
+
+ if (pCir->Chipset != PCI_CHIP_GD7548) {
+ vga_moutb(0x3CE, 0x0E); /* enable writes to gr33 */
+ vga_moutb(0x3CF, 0x20); /* enable writes to gr33 */
+ }
+ if (pCir->properties & ACCEL_AUTOSTART) {
+ moutl(0x40, 0x80); /* enable autostart */
+ pCir->chip.alp->waitMsk = 0x10;
+ pCir->chip.alp->autoStart = TRUE;
+ } else {
+ pCir->chip.alp->waitMsk = 0x1;
+ pCir->chip.alp->autoStart = FALSE;
+ }
}
Bool
@@ -167,43 +225,48 @@ AlpXAAInitMMIO(ScreenPtr pScreen)
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
CirPtr pCir = CIRPTR(pScrn);
XAAInfoRecPtr XAAPtr;
-
+
+ pCir->InitAccel = AlpAccelEngineInit;
#ifdef ALP_DEBUG
- ErrorF("AlpXAAInit mm\n");
+ ErrorF("AlpXAAInitMM\n");
#endif
XAAPtr = XAACreateInfoRec();
if (!XAAPtr) return FALSE;
+
+ XAAPtr->Flags |= LINEAR_FRAMEBUFFER;
+ XAAPtr->Sync = AlpSync;
XAAPtr->SetupForScreenToScreenCopy = AlpSetupForScreenToScreenCopy;
XAAPtr->SubsequentScreenToScreenCopy = AlpSubsequentScreenToScreenCopy;
- XAAPtr->ScreenToScreenCopyFlags = GXCOPY_ONLY|NO_TRANSPARENCY|NO_PLANEMASK;
+ XAAPtr->ScreenToScreenCopyFlags =
+ (NO_TRANSPARENCY | NO_PLANEMASK);
XAAPtr->SetupForSolidFill = AlpSetupForSolidFill;
XAAPtr->SubsequentSolidFillRect = AlpSubsequentSolidFillRect;
XAAPtr->SubsequentSolidFillTrap = NULL;
- XAAPtr->SolidFillFlags = GXCOPY_ONLY|NO_TRANSPARENCY|NO_PLANEMASK;
-
- XAAPtr->Sync = AlpSync;
-
- 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) {
- moutb(0x40, 0x80); /* enable autostart */
- pCir->chip.alp->waitMsk = 0x10;
- pCir->chip.alp->autoStart = TRUE;
- } else {
- pCir->chip.alp->waitMsk = 0x1;
- pCir->chip.alp->autoStart = FALSE;
+ XAAPtr->SolidFillFlags = NO_PLANEMASK;
+
+ switch (pCir->Chipset) {
+ case PCI_CHIP_GD5480:
+ pCir->chip.alp->BLTBase = pCir->IOBase + 0x100;
+ break;
+ default:
+ pCir->chip.alp->BLTBase = pCir->IOBase;
+ break;
}
+ AlpAccelEngineInit(pScrn);
+
+ pCir->AccelInfoRec = XAAPtr;
+
if (!XAAInit(pScreen, XAAPtr))
- return FALSE;
+ return FALSE;
return TRUE;
}
+
+
+
+
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/cir_dga.c b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/cir_dga.c
new file mode 100644
index 000000000..3e25a53d8
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/cir_dga.c
@@ -0,0 +1,257 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/cir_dga.c,v 1.5 2001/02/15 17:39:27 eich Exp $ */
+/*
+ * Copyright 2000 by Egbert Eich
+ *
+ * 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 Alan Hourihane not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Alan Hourihane makes no representations
+ * about the suitability of this software for any purpose. It is provided
+ * "as is" without express or implied warranty.
+ *
+ * EGBERT EICH DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL ALAN HOURIHANE 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.
+ *
+ * Authors: Adapted from: Alan Hourihane, <alanh@fairlite.demon.co.uk>
+ * by: Egbert Eich
+ */
+
+#include "xf86.h"
+#include "xf86_OSproc.h"
+#include "xf86_ansic.h"
+#include "xf86Pci.h"
+#include "xf86PciInfo.h"
+#include "xaa.h"
+#include "xaalocal.h"
+#include "vgaHW.h"
+#include "cir.h"
+#include "dgaproc.h"
+
+static Bool Cir_OpenFramebuffer(ScrnInfoPtr, char **, unsigned char **,
+ int *, int *, int *);
+static Bool Cir_SetMode(ScrnInfoPtr, DGAModePtr);
+static void Cir_Sync(ScrnInfoPtr);
+static int Cir_GetViewport(ScrnInfoPtr);
+static void Cir_SetViewport(ScrnInfoPtr, int, int, int);
+static void Cir_FillRect(ScrnInfoPtr, int, int, int, int, unsigned long);
+static void Cir_BlitRect(ScrnInfoPtr, int, int, int, int, int, int);
+/*
+static void Cir_BlitTransRect(ScrnInfoPtr, int, int, int, int, int, int,
+ unsigned long);
+*/
+
+static
+DGAFunctionRec CirDGAFuncs = {
+ Cir_OpenFramebuffer,
+ NULL, /* Cir_CloseFramebuffer */
+ Cir_SetMode,
+ Cir_SetViewport,
+ Cir_GetViewport,
+ Cir_Sync,
+ Cir_FillRect,
+ Cir_BlitRect,
+ NULL /* Cir_BlitTransRect */
+};
+
+
+
+
+Bool
+CirDGAInit(ScreenPtr pScreen)
+{
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ CirPtr pCir = CIRPTR(pScrn);
+ DGAModePtr modes = NULL, newmodes = NULL, currentMode;
+ DisplayModePtr pMode, firstMode;
+ int Bpp = pScrn->bitsPerPixel >> 3;
+ int num = 0;
+ int imlines = (pScrn->videoRam * 1024) /
+ (pScrn->displayWidth * (pScrn->bitsPerPixel >> 3));
+
+
+ if (!pCir->DGAnumModes) {
+ ErrorF("DGAINIT\n");
+ pMode = firstMode = pScrn->modes;
+ while (pMode) {
+ newmodes = xrealloc(modes, (num + 1) * sizeof (DGAModeRec));
+ if (!newmodes) {
+ xfree(modes);
+ return FALSE;
+ }
+ modes = newmodes;
+ currentMode = modes + num;
+ num++;
+ (void)memset(currentMode, 1, sizeof(DGAModeRec));
+ currentMode->mode = pMode;
+ currentMode->flags = DGA_PIXMAP_AVAILABLE
+ | ((!pCir->NoAccel) ? (DGA_FILL_RECT | DGA_BLIT_RECT) : 0);
+ if (pMode->Flags & V_DBLSCAN)
+ currentMode->flags |= DGA_DOUBLESCAN;
+ if(pMode->Flags & V_INTERLACE)
+ currentMode->flags |= DGA_INTERLACED;
+ currentMode->byteOrder = pScrn->imageByteOrder;
+ currentMode->depth = pScrn->depth;
+ currentMode->bitsPerPixel = pScrn->bitsPerPixel;
+ currentMode->red_mask = pScrn->mask.red;
+ currentMode->green_mask = pScrn->mask.green;
+ currentMode->blue_mask = pScrn->mask.blue;
+ currentMode->visualClass = (Bpp == 1) ? PseudoColor : TrueColor;
+ currentMode->viewportWidth = pMode->HDisplay;
+ currentMode->viewportHeight = pMode->VDisplay;
+ currentMode->xViewportStep = 1; /* The granularity of x and y pos. */
+ currentMode->yViewportStep = 1;
+ currentMode->viewportFlags = 0 /*DGA_FLIP_RETRACE*/;
+ currentMode->offset = 0;
+ currentMode->address = pCir->FbBase;
+ currentMode->bytesPerScanline = ((pScrn->displayWidth * Bpp) + 3) & ~3L;
+ currentMode->pixmapWidth = currentMode->imageWidth
+ = pScrn->displayWidth;
+ currentMode->pixmapHeight = currentMode->imageHeight = imlines;
+ currentMode->maxViewportX = currentMode->imageWidth -
+ currentMode->viewportWidth;
+ /* this might need to get clamped to some maximum */
+ currentMode->maxViewportY = currentMode->imageHeight -
+ currentMode->viewportHeight;
+
+ pMode = pMode->next;
+ if(pMode == firstMode)
+ break;
+ }
+ pCir->DGAnumModes = num;
+ pCir->DGAModes = modes;
+ }
+ return DGAInit(pScreen, &CirDGAFuncs, pCir->DGAModes, pCir->DGAnumModes);
+}
+
+static Bool
+Cir_OpenFramebuffer(
+ ScrnInfoPtr pScrn,
+ char **name,
+ unsigned char **mem,
+ int *size,
+ int *offset,
+ int *flags
+){
+ CirPtr pCir = CIRPTR(pScrn);
+
+ *name = NULL; /* no special device */
+ *mem = (unsigned char*)pCir->FbAddress;
+ *size = pCir->FbMapSize;
+ *offset = 0; /* Always */
+ *flags = 0; /* Root permissions OS-dependent */
+
+ return TRUE;
+}
+
+
+static Bool
+Cir_SetMode(
+ ScrnInfoPtr pScrn,
+ DGAModePtr pMode
+){
+ CirPtr pCir = CIRPTR(pScrn);
+ static int OldDisplayWidth[MAXSCREENS];
+ int index = pScrn->pScreen->myNum;
+ Bool ret = FALSE;
+
+ if(!pMode) { /* restore the original mode */
+ /* put the ScreenParameters back */
+ pScrn->displayWidth = OldDisplayWidth[index];
+ ret = pCir->DGAModeInit(xf86Screens[index], pScrn->currentMode);
+ pCir->DGAactive = FALSE;
+ } else {
+ if(!pCir->DGAactive) { /* save the old parameters */
+ OldDisplayWidth[index] = pScrn->displayWidth;
+
+ pCir->DGAactive = TRUE;
+ }
+ pScrn->displayWidth = pMode->bytesPerScanline /
+ (pMode->bitsPerPixel >> 3);
+
+ ret = pCir->DGAModeInit(xf86Screens[index], pMode->mode);
+ }
+ return ret;
+}
+
+static void
+Cir_SetViewport(
+ ScrnInfoPtr pScrn,
+ int x, int y,
+ int flags
+){
+ CirPtr pCir = CIRPTR(pScrn);
+ vgaHWPtr hwp = VGAHWPTR(pScrn);
+
+ pScrn->AdjustFrame(pScrn->pScreen->myNum, x, y, flags);
+
+ while((hwp->readST01(hwp) & 0x08));
+ while(!(hwp->readST01(hwp) & 0x08));
+
+ pCir->DGAViewportStatus = 0; /* AdjustFrame loops until finished */
+}
+
+static int
+Cir_GetViewport(
+ ScrnInfoPtr pScrn
+){
+ CirPtr pCir = CIRPTR(pScrn);
+
+ return pCir->DGAViewportStatus;
+}
+
+
+
+static void
+Cir_Sync(
+ ScrnInfoPtr pScrn
+){
+ CirPtr pCir = CIRPTR(pScrn);
+
+ if(pCir->AccelInfoRec) {
+ (*pCir->AccelInfoRec->Sync)(pScrn);
+ }
+}
+
+static void
+Cir_FillRect (
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h,
+ unsigned long color
+){
+ CirPtr pCir = CIRPTR(pScrn);
+
+ if(pCir->AccelInfoRec) {
+ (*pCir->AccelInfoRec->SetupForSolidFill)(pScrn, color, GXcopy, ~0);
+ (*pCir->AccelInfoRec->SubsequentSolidFillRect)(pScrn, x, y, w, h);
+ SET_SYNC_FLAG(pCir->AccelInfoRec);
+ }
+}
+
+static void
+Cir_BlitRect(
+ ScrnInfoPtr pScrn,
+ int srcx, int srcy,
+ int w, int h,
+ int dstx, int dsty
+){
+ CirPtr pCir = CIRPTR(pScrn);
+
+ if(pCir->AccelInfoRec) {
+ int xdir = ((srcx < dstx) && (srcy == dsty)) ? -1 : 1;
+ int ydir = (srcy < dsty) ? -1 : 1;
+
+ (*pCir->AccelInfoRec->SetupForScreenToScreenCopy)(
+ pScrn, xdir, ydir, GXcopy, ~0, -1);
+ (*pCir->AccelInfoRec->SubsequentScreenToScreenCopy)(
+ pScrn, srcx, srcy, dstx, dsty, w, h);
+ SET_SYNC_FLAG(pCir->AccelInfoRec);
+ }
+}
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/cirrus.cpp b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/cirrus.cpp
deleted file mode 100644
index a115c5106..000000000
--- a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/cirrus.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/cirrus.cpp,v 1.5 2000/12/11 20:18:09 dawes Exp $
-.\" shorthand for double quote that works everywhere.
-.ds q \N'34'
-.TH CIRRUS __drivermansuffix__ "Version 4.0.2" "XFree86"
-.SH NAME
-cirrus \- Cirrus Logic video driver
-.SH SYNOPSIS
-.nf
-.B "Section \*qDevice\*q"
-.BI " Identifier \*q" devname \*q
-.B " Driver \*qcirrus\*q"
-\ \ ...
-.B EndSection
-.fi
-.SH DESCRIPTION
-.B cirrus
-is an XFree86 driver for Cirrus Logic video chips.
-THIS MAN PAGE NEEDS TO BE FILLED IN.
-.SH SUPPORTED HARDWARE
-The
-.B cirrus
-driver supports...
-.SH CONFIGURATION DETAILS
-Please refer to XF86Config(__filemansuffix__) for general configuration
-details. This section only covers configuration details specific to this
-driver.
-.SH "SEE ALSO"
-XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__)
-.SH AUTHORS
-Authors include: ...
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix.cpp b/xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix.cpp
deleted file mode 100644
index 78bc29bfe..000000000
--- a/xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix.cpp,v 1.5 2000/12/11 20:18:10 dawes Exp $
-.\" shorthand for double quote that works everywhere.
-.ds q \N'34'
-.TH CYRIX __drivermansuffix__ "Version 4.0.2" "XFree86"
-.SH NAME
-cyrix \- Cyrix video driver
-.SH SYNOPSIS
-.nf
-.B "Section \*qDevice\*q"
-.BI " Identifier \*q" devname \*q
-.B " Driver \*qcyrix\*q"
-\ \ ...
-.B EndSection
-.fi
-.SH DESCRIPTION
-.B cyrix
-is an XFree86 driver for Cyrix video chips.
-THIS MAN PAGE NEEDS TO BE FILLED IN.
-.SH SUPPORTED HARDWARE
-The
-.B cyrix
-driver supports...
-.SH CONFIGURATION DETAILS
-Please refer to XF86Config(__filemansuffix__) for general configuration
-details. This section only covers configuration details specific to this
-driver.
-.SH "SEE ALSO"
-XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__)
-.SH AUTHORS
-Authors include: ...
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/fbdev/fbdev.cpp b/xc/programs/Xserver/hw/xfree86/drivers/fbdev/fbdev.cpp
deleted file mode 100644
index d64701b92..000000000
--- a/xc/programs/Xserver/hw/xfree86/drivers/fbdev/fbdev.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/fbdev/fbdev.cpp,v 1.4 1999/08/22 13:04:25 dawes Exp $
-.TH FBDEV __drivermansuffix__ "Version 3.9.16" "XFree86"
-.SH NAME
-fbdev \- video driver for framebuffer device
-.SH SYNOPSIS
-.B "Section ""Device"""
-.br
-.BI " Identifier """ devname """"
-.br
-.B " Driver ""fbdev"""
-.br
-.BI " BusID ""pci:" bus : dev : func """
-.br
-\ \ ...
-.br
-.B EndSection
-.SH DESCRIPTION
-.B fbdev
-is an XFree86 driver for framebuffer devices. This is a non-accelerated
-driver, the following framebuffer depths are supported: 8, 15, 16, 24.
-All visual types are supported for depth 8, and TrueColor visual is
-supported for the other depths. Multi-head configurations are supported.
-.SH SUPPORTED HARDWARE
-The
-.B fbdev
-driver supports all hardware where a framebuffer driver is available.
-fbdev uses the os-specific submodule fbdevhw(__drivermansuffix__) to talk
-to the kernel
-device driver. Currently a fbdevhw module is available for linux.
-.SH CONFIGURATION DETAILS
-Please refer to XF86Config(__filemansuffix__) for general configuration
-details. This section only covers configuration details specific to
-this driver.
-.PP
-For this driver it is not required to specify modes in the screen
-section of the config file. The
-.B fbdev
-driver can pick up the currently used video mode from the framebuffer
-driver and will use it if there are no video modes configured.
-.PP
-For PCI boards you might have to add a BusID line to the Device
-section. See above for a sample line. You can use "XFree86 -scanpci"
-to figure out the correct values.
-.PP
-The following driver
-.B Options
-are supported:
-.TP
-.BI "Option ""ShadowFB"" """ boolean """
-Enable or disable use of the shadow framebuffer layer. See
-shadowfb(__drivermansuffix__) for further information. Default: on.
-.SH "SEE ALSO"
-XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1),
-X(1), fbdevhw(__drivermansuffix__)
-.SH AUTHORS
-Authors include: Gerd Knorr
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glide/glide.cpp b/xc/programs/Xserver/hw/xfree86/drivers/glide/glide.cpp
deleted file mode 100644
index 6213314be..000000000
--- a/xc/programs/Xserver/hw/xfree86/drivers/glide/glide.cpp
+++ /dev/null
@@ -1,298 +0,0 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glide/glide.cpp,v 1.6 1999/08/28 10:43:35 dawes Exp $
-.TH GLIDE __drivermansuffix__ "Version 3.9.16" "XFree86"
-.SH NAME
-glide \- Glide video driver
-.SH SYNOPSIS
-.B "Section ""Device"""
-.br
-.BI " Identifier """ devname """"
-.br
-.B " Driver ""glide"""
-.br
-\ \ ...
-.br
-.B EndSection
-.SH READ THIS IF NOTHING ELSE
-This driver has a special requirement that needs to be fulfilled
-before it will work: You need Glide installed and you need to make a link for the libglide2x.so
-file. Read the second paragraph in the description below to find out how.
-.SH DESCRIPTION
-.B glide
-is an XFree86 driver for Glide capable video boards (such as 3Dfx
-Voodoo boards). This driver is mainly for Voodoo 1 and Voodoo 2 boards, later
-boards from 3Dfx have 2D built-in and you should preferably use a driver separate for
-those boards or the fbdev(__drivermansuffix__) driver.
-This driver is a bit special because Voodoo 1 and 2 boards are
-very much NOT made for running 2D graphics. Therefore, this driver
-uses no hardware acceleration (since there is no acceleration for 2D,
-only 3D). Instead it is implemented with the help of a "shadow"
-framebuffer that resides entirely in RAM. Selected portions of this
-shadow framebuffer are then copied out to the Voodoo board at the right
-time. Because of this, the speed of the driver is very dependent on
-the CPU. But since the CPU is nowadays actually rather fast at moving
-data, we get very good speed anyway, especially since the whole shadow
-framebuffer is in cached RAM.
-.PP
-This driver requires that you have installed Glide. (Which can, at the
-time of this writing, be found at
-http://glide.xxedgexx.com/3DfxRPMS.html). Also, you need to tell
-XFree86 where the libglide2x.so file is placed by making a soft link
-in the /usr/X11R6/lib/modules directory that points to the libglide2x.so
-file. For example (if your libglide2x.so file is in /usr/lib):
-.PP
- # ln -s /usr/lib/libglide2x.so /usr/X11R6/lib/modules
-.PP
-If you have installed /dev/3dfx, the driver will be able to turn on
-the MTRR registers (through the glide library) if you have a CPU with
-such registers (see http://glide.xxedgexx.com/MTRR.html). This will
-speed up copying data to the Voodoo board by as much as 2.7 times and
-is very noticeable since this driver copies a lot of
-data... Highly recommended.
-.PP
-This driver supports 16 and 24 bit color modes. The 24 bit color mode
-uses a 32 bit framebuffer (it has no support for 24 bit packed-pixel
-framebuffers). Notice that the Voodoo boards can only display 16 bit
-color, but the shadow framebuffer can be run in 24 bit color. The
-point of supporting 24 bit mode is that this enables you to run in a
-multihead configuration with Xinerama together with another board that
-runs in real 24 bit color mode. (All boards must run the same color
-depth when you use Xinerama).
-.PP
-Resolutions supported are: 640x480, 800x600, 960x720, 1024x768,
-1280x1024 and 1600x1200. Note that not all modes will work on all
-Voodoo boards. It seems that Voodoo 2 boards support no higher than
-1024x768 and Voodoo 1 boards can go to 800x600. If you see a message like this in the output from the server:
-.PP
- (EE) GLIDE(0): grSstWinOpen returned ...
-.PP
-Then you are probably trying to use a resolution that is supported by
-the driver but not supported by the hardware.
-.PP
-Refresh rates supported are: 60Hz, 75Hz and 85Hz. The refresh rate
-used is derived from the normal mode line according
-to the following table:
-.TP 28
-Mode-line refresh rate
-Used refresh rate
-.TP 28
- 0-74 Hz
- 60 Hz
-.TP 28
- 74-84 Hz
- 75 Hz
-.TP 28
- 84- Hz
- 85 Hz
-.PP
-Thus, if you use a modeline that for example has a 70Hz refresh rate
-you will only get a 60Hz refresh rate in actuality.
-.PP
-Selecting which Voodoo board to use with the driver is done by using
-an option called "GlideDevice" in the "Device" section. (If you don't
-have this option present then the first board found will be selected for that Device section). For
-example: To use the first Voodoo board, use a "Device" section like
-this, for example:
-.PP
-Section "Device"
-.br
- Identifier "Voodoo"
-.br
- Driver "glide"
-.br
- Option "dpms" "on"
-.br
- Option "GlideDevice" "0"
-.br
-EndSection
-.PP
-And if you have more than one Voodoo board, add another "Device"
-section with a GlideDevice option with value 1, and so on. (You can use more than one
-Voodoo board, but SLI configured boards will be treated as a single board.)
-.PP
-Multihead and Xinerama configurations are supported.
-.PP
-Limited support for DPMS screen saving is available. The "standby" and
-"suspend" modes are just painting the screen black. The "off" mode turns
-the Voodoo board off and thus works correctly.
-.PP
-This driver does not support a virtual screen size different from the display size.
-.SH SUPPORTED HARDWARE
-The
-.B glide
-driver supports any board that can be used with Glide (such as 3Dfx Voodoo boards)
-.SH CONFIGURATION DETAILS
-Please refer to XF86Config(__filemansuffix__) for general configuration
-details. This section only covers configuration details specific to this
-driver.
-.PP
-The following driver
-.B Options
-are supported:
-.TP
-.BI "Option ""OnAtExit"" """ boolean """
-If true, will leave the Voodoo board on when the server exits. Useful in a multihead setup when
-only the Voodoo board is connected to a second monitor and you don't want that monitor to lose
-signal when you quit the server. Put this option in the Device section.
-Default: off.
-.TP
-.BI "Option ""GlideDevice"" """ integer """
-Selects which Voodoo board to use. (Or boards, in an SLI configuration).
-The value should be 0 for the first board, 1 for the second and so on.
-If it is not present, the first Voodoo board found will be selected.
-Put this option in the Device section.
-.SH "EXAMPLE"
-Here is an example of a part of an XF86Config file that uses a multihead
-configuration with two monitors. The first monitor is driven by the
-fbdev video driver and the second monitor is driven by the glide
-driver.
-.PP
-.br
-Section "Monitor"
-.br
- Identifier "Monitor 1"
-.br
- VendorName "Unknown"
-.br
- ModelName "Unknown"
-.br
- HorizSync 30-70
-.br
- VertRefresh 50-80
-.br
-
-.br
- # 1024x768 @ 76 Hz, 62.5 kHz hsync
-.br
- Modeline "1024x768" 85 1024 1032 1152 1360 768 784 787 823
-.br
-EndSection
-.br
-
-.br
-Section "Monitor"
-.br
- Identifier "Monitor 2"
-.br
- VendorName "Unknown"
-.br
- ModelName "Unknown"
-.br
- HorizSync 30-70
-.br
- VertRefresh 50-80
-.br
-
-.br
- # 1024x768 @ 76 Hz, 62.5 kHz hsync
-.br
- Modeline "1024x768" 85 1024 1032 1152 1360 768 784 787 823
-.br
-EndSection
-.br
-
-.br
-Section "Device"
-.br
- Identifier "fb"
-.br
- Driver "fbdev"
-.br
- Option "shadowfb"
-.br
- Option "dpms" "on"
-.br
- # My video card is on the AGP bus which is usually
-.br
- # located as PCI bus 1, device 0, function 0.
-.br
- BusID "PCI:1:0:0"
-.br
-EndSection
-.br
-
-.br
-Section "Device"
-.br
- # I have a Voodoo 2 board
-.br
- Identifier "Voodoo"
-.br
- Driver "glide"
-.br
- Option "dpms" "on"
-.br
- # The next line says I want to use the first board.
-.br
- Option "GlideDevice" "0"
-.br
-EndSection
-.br
-
-.br
-Section "Screen"
-.br
- Identifier "Screen 1"
-.br
- Device "fb"
-.br
- Monitor "Monitor 1"
-.br
- DefaultDepth 16
-.br
- Subsection "Display"
-.br
- Depth 16
-.br
- Modes "1024x768"
-.br
- EndSubSection
-.br
-EndSection
-.br
-
-.br
-Section "Screen"
-.br
- Identifier "Screen 2"
-.br
- Device "Voodoo"
-.br
- Monitor "Monitor 2"
-.br
- DefaultDepth 16
-.br
- Subsection "Display"
-.br
- Depth 16
-.br
- Modes "1024x768"
-.br
- EndSubSection
-.br
-EndSection
-.br
-
-.br
-Section "ServerLayout"
-.br
- Identifier "Main Layout"
-.br
- # Screen 1 is to the right and screen 2 is to the left
-.br
- Screen "Screen 2"
-.br
- Screen "Screen 1" "" "" "Screen 2" ""
-.br
-EndSection
-.PP
-If you use this configuration file and start the server with the
-+xinerama command line option, the two monitors will be showing a
-single large area where windows can be moved between monitors and
-overlap from one monitor to the other. Starting the X server with the
-Xinerama extension can be done for example like this:
-.PP
-$ xinit -- +xinerama
-.SH "SEE ALSO"
-XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(1)
-.SH AUTHORS
-Author: Henrik Harmsen.
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/Imakefile b/xc/programs/Xserver/hw/xfree86/drivers/glint/Imakefile
index d4978cc14..9583be466 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.29 2000/09/20 00:09:21 keithp Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/Imakefile,v 1.31 2001/01/31 16:14:51 alanh Exp $
XCOMM
XCOMM This is an Imakefile for the GLINT driver.
XCOMM
@@ -14,12 +14,12 @@ DRIINCLUDES=-I$(SERVERSRC)/GL/dri -I$(LIBSRC)/GL/dri
SRCS = glint_driver.c pm2_dac.c pm2ramdac.c pm2_accel.c pm_dac.c IBMramdac.c \
pm_accel.c tx_dac.c tx_accel.c pm2v_dac.c pm2vramdac.c pm2_video.c \
- pm3_dac.c pm3_accel.c TIramdac.c dualmx_dac.c dualmx_accel.c \
- glint_shadow.c $(DRISRC) sx_accel.c TIdualramdac.c glint_dga.c
+ pm3_dac.c pm3_accel.c TIramdac.c \
+ glint_shadow.c $(DRISRC) sx_accel.c glint_dga.c
OBJS = glint_driver.o pm2_dac.o pm2ramdac.o pm2_accel.o pm_dac.o IBMramdac.o \
pm_accel.o tx_dac.o tx_accel.o pm2v_dac.o pm2vramdac.o pm2_video.o \
- pm3_dac.o pm3_accel.o TIramdac.o dualmx_dac.o dualmx_accel.o \
- glint_shadow.o $(DRIOBJ) sx_accel.o TIdualramdac.o glint_dga.o
+ pm3_dac.o pm3_accel.o TIramdac.o \
+ glint_shadow.o $(DRIOBJ) sx_accel.o glint_dga.o
#if defined(XF86DriverSDK)
INCLUDES = -I. -I../../include
@@ -52,7 +52,6 @@ ObjectModuleTarget(glint,$(OBJS))
InstallObjectModule(glint,$(MODULEDIR),drivers)
#if !defined(XF86DriverSDK)
-CppManTarget(glint,)
InstallModuleManPage(glint)
#endif
@@ -61,9 +60,6 @@ DependTarget()
InstallDriverSDKNonExecFile(IBMramdac.c,$(DRIVERSDKDIR)/drivers/glint)
InstallDriverSDKNonExecFile(Imakefile,$(DRIVERSDKDIR)/drivers/glint)
InstallDriverSDKNonExecFile(TIramdac.c,$(DRIVERSDKDIR)/drivers/glint)
-InstallDriverSDKNonExecFile(TIdualramdac.c,$(DRIVERSDKDIR)/drivers/glint)
-InstallDriverSDKNonExecFile(dualmx_accel.c,$(DRIVERSDKDIR)/drivers/glint)
-InstallDriverSDKNonExecFile(dualmx_dac.c,$(DRIVERSDKDIR)/drivers/glint)
InstallDriverSDKNonExecFile(glint.h,$(DRIVERSDKDIR)/drivers/glint)
InstallDriverSDKNonExecFile(glint_dri.c,$(DRIVERSDKDIR)/drivers/glint)
InstallDriverSDKNonExecFile(glint_dri.h,$(DRIVERSDKDIR)/drivers/glint)
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/README.pm3 b/xc/programs/Xserver/hw/xfree86/drivers/glint/README.pm3
index caa5961ee..5a79d688e 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/glint/README.pm3
+++ b/xc/programs/Xserver/hw/xfree86/drivers/glint/README.pm3
@@ -1,14 +1,12 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/README.pm3,v 1.6 2000/12/12 17:02:43 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/README.pm3,v 1.7 2000/12/20 11:13:01 alanh Exp $ */
STATUS as of Mon, 16 Oct 2000 21:24:51 +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.
- * Untested on big endian systems, i had some reports of endianess problems
- with a Permedia4 though, so i suppose things are broken for Permedia3
- also. If you encounter problems, please contact me or try with
- acceleration disabled.
+ * Endianess clean, thanks to Romain Dolbeau <dolbeaur@club-internet.fr> for
+ helping me debug this.
* HW cursor.
* ShadowFb works.
* Full 2D Accels.
@@ -65,7 +63,7 @@ Video Overlay [NOTHING DONE YET] :
* I have not done anything yet here.
-DRI/3D Accels [NOTHING DONE YET] :
+DRI/3D Accels [WORK IS PLANED] :
* First approach would be to use the gamma for one head only (most probably
the first head, it could be configurable though).
@@ -103,3 +101,4 @@ DRI/3D Accels [NOTHING DONE YET] :
sync the gamma also when doing syncs. Not sure where the right place for
this is though. Maybe when switching between 2D and 3D ?
+Sven Luther <luther@dpt-info.u-strasbg.fr>
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/TIdualramdac.c b/xc/programs/Xserver/hw/xfree86/drivers/glint/TIdualramdac.c
deleted file mode 100644
index 92efb5f13..000000000
--- a/xc/programs/Xserver/hw/xfree86/drivers/glint/TIdualramdac.c
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Copyright 1998 by Alan Hourihane, Wigan, England.
- *
- * 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 Alan Hourihane not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Alan Hourihane makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL ALAN HOURIHANE 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.
- *
- * Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk>
- *
- * Modified from IBMramdac.c to support TI RAMDAC routines
- * by Jens Owen, <jens@precisioninsight.com>.
- *
- * glintOutTIIndReg() and glintInTIIndReg() are used to access
- * the indirect TI RAMDAC registers only.
- */
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/TIdualramdac.c,v 1.1 2000/03/21 21:46:27 alanh Exp $ */
-
-#include "xf86.h"
-#include "xf86_OSproc.h"
-#include "xf86_ansic.h"
-
-#include "xf86PciInfo.h"
-#include "xf86Pci.h"
-
-#include "TI.h"
-#include "glint_regs.h"
-#include "glint.h"
-
-#define TI_WRITE_ADDR 0x4000
-#define TI_RAMDAC_DATA 0x4008
-#define TI_PIXEL_MASK 0x4010
-#define TI_READ_ADDR 0x4018
-#define TI_CURS_COLOR_WRITE_ADDR 0x4020
-#define TI_CURS_COLOR_DATA 0x4028
-#define TI_CURS_COLOR_READ_ADDR 0x4038
-#define TI_DIRECT_CURS_CTRL 0x4048
-#define TI_INDEX_DATA 0x4050
-#define TI_CURS_RAM_DATA 0x4058
-#define TI_CURS_X_LOW 0x4060
-#define TI_CURS_X_HIGH 0x4068
-#define TI_CURS_Y_LOW 0x4070
-#define TI_CURS_Y_HIGH 0x4078
-
-void
-DUALglintOutTIIndReg(ScrnInfoPtr pScrn,
- CARD32 reg, unsigned char mask, unsigned char data)
-{
- GLINTPtr pGlint = GLINTPTR(pScrn);
- unsigned char tmp = 0x00;
- int offset;
-
- if ((reg & 0xf0) == 0xa0) { /* this is really a direct register write */
- offset = TI_WRITE_ADDR + ((reg & 0xf) << 3);
- if (mask != 0x00)
- tmp = GLINT_SECONDARY_READ_REG(offset) & mask;
-
- GLINT_SECONDARY_SLOW_WRITE_REG(tmp | data, offset);
- }
- else { /* normal indirect access */
- GLINT_SECONDARY_SLOW_WRITE_REG(reg & 0xFF, TI_WRITE_ADDR);
-
- if (mask != 0x00)
- tmp = GLINT_SECONDARY_READ_REG(TI_INDEX_DATA) & mask;
-
- GLINT_SECONDARY_SLOW_WRITE_REG(tmp | data, TI_INDEX_DATA);
- }
-}
-
-unsigned char
-DUALglintInTIIndReg (ScrnInfoPtr pScrn, CARD32 reg)
-{
- GLINTPtr pGlint = GLINTPTR(pScrn);
- unsigned char ret;
- int offset;
-
- if ((reg & 0xf0) == 0xa0) { /* this is really a direct register write */
- offset = TI_WRITE_ADDR + ((reg & 0xf) << 3);
- ret = GLINT_SECONDARY_READ_REG(offset);
- }
- else { /* normal indirect access */
- GLINT_SECONDARY_SLOW_WRITE_REG(reg & 0xFF, TI_WRITE_ADDR);
- ret = GLINT_SECONDARY_READ_REG(TI_INDEX_DATA);
- }
-
- return (ret);
-}
-
-void
-DUALglintTIWriteAddress (ScrnInfoPtr pScrn, CARD32 index)
-{
- GLINTPtr pGlint = GLINTPTR(pScrn);
-
- GLINT_SECONDARY_SLOW_WRITE_REG(index, TI_WRITE_ADDR);
-}
-
-void
-DUALglintTIWriteData (ScrnInfoPtr pScrn, unsigned char data)
-{
- GLINTPtr pGlint = GLINTPTR(pScrn);
-
- GLINT_SECONDARY_SLOW_WRITE_REG(data, TI_RAMDAC_DATA);
-}
-
-void
-DUALglintTIReadAddress (ScrnInfoPtr pScrn, CARD32 index)
-{
- GLINTPtr pGlint = GLINTPTR(pScrn);
-
- GLINT_SECONDARY_SLOW_WRITE_REG(0xFF, TI_PIXEL_MASK);
- GLINT_SECONDARY_SLOW_WRITE_REG(index, TI_READ_ADDR);
-}
-
-unsigned char
-DUALglintTIReadData (ScrnInfoPtr pScrn)
-{
- GLINTPtr pGlint = GLINTPTR(pScrn);
-
- return(GLINT_SECONDARY_READ_REG(TI_RAMDAC_DATA));
-}
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/dualmx_accel.c b/xc/programs/Xserver/hw/xfree86/drivers/glint/dualmx_accel.c
deleted file mode 100644
index fa93a2905..000000000
--- a/xc/programs/Xserver/hw/xfree86/drivers/glint/dualmx_accel.c
+++ /dev/null
@@ -1,1003 +0,0 @@
-/*
- * Copyright 1997,1998 by Alan Hourihane, Wigan, England.
- *
- * 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 Alan Hourihane not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Alan Hourihane makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL ALAN HOURIHANE 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.
- *
- * Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk>
- * Dirk Hohndel, <hohndel@suse.de>
- * Stefan Dirsch, <sndirsch@suse.de>
- *
- * Dual MX accelerated options.
- *
- * Modified version of tx_accel.c to support dual MX chips by
- * Jens Owen, <jens@precisioninsight.com>
- */
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/dualmx_accel.c,v 1.9 2000/06/21 13:35:51 alanh Exp $ */
-
-#include "xf86.h"
-#include "xf86_OSproc.h"
-#include "xf86_ansic.h"
-
-#include "xf86PciInfo.h"
-#include "xf86Pci.h"
-
-#include "fb.h"
-
-#include "miline.h"
-
-#include "glint_regs.h"
-#include "glint.h"
-
-#include "xaalocal.h" /* For replacements */
-
-static void DualMXSync(ScrnInfoPtr pScrn);
-static void DualMXSetupForFillRectSolid(ScrnInfoPtr pScrn, int color, int rop,
- unsigned int planemask);
-static void DualMXSubsequentFillRectSolid(ScrnInfoPtr pScrn, int x, int y,
- int w, int h);
-static void DualMXSetupForMono8x8PatternFill(ScrnInfoPtr pScrn, int patternx,
- int patterny,
- int fg, int bg, int rop,
- unsigned int planemask);
-static void DualMXSubsequentMono8x8PatternFillRect(ScrnInfoPtr pScrn, int patternx,
- int patterny, int x, int y,
- int w, int h);
-static void DualMXSetupForScreenToScreenCopy(ScrnInfoPtr pScrn, int xdir, int ydir,
- int rop, unsigned int planemask,
- int transparency_color);
-static void DualMXSubsequentScreenToScreenCopy(ScrnInfoPtr pScrn, int x1, int y1,
- int x2, int y2, int w, int h);
-static void DualMXWriteBitmap(ScrnInfoPtr pScrn, int x, int y, int w, int h,
- unsigned char *src, int srcwidth,
- int skipleft, int fg, int bg, int rop,
- unsigned int planemask);
-static void DualMXSetClippingRectangle(ScrnInfoPtr pScrn, int x1, int y1,
- int x2,int y2);
-static void DualMXDisableClipping(ScrnInfoPtr pScrn);
-static void DualMXWritePixmap(ScrnInfoPtr pScrn, int x, int y, int w, int h,
- unsigned char *src, int srcwidth, int rop,
- unsigned int planemask, int trans,
- int bpp, int depth);
-static void DualMXSetupForCPUToScreenColorExpandFill(ScrnInfoPtr pScrn, int fg,
- int bg, int rop, unsigned int planemask);
-static void DualMXSubsequentCPUToScreenColorExpandFill(ScrnInfoPtr pScrn, int x,
- int y, int w, int h, int skipleft);
-static void DualMXSetupForScanlineCPUToScreenColorExpandFill(ScrnInfoPtr pScrn, int fg,
- int bg, int rop, unsigned int planemask);
-static void DualMXSubsequentScanlineCPUToScreenColorExpandFill(ScrnInfoPtr pScrn, int x,
- int y, int w, int h, int skipleft);
-static void DualMXSubsequentColorExpandScanline(ScrnInfoPtr pScrn, int bufno);
-static void DualMXLoadCoord(ScrnInfoPtr pScrn, int x, int y, int w, int h,
- int a, int d);
-static void DualMXSetupForSolidLine(ScrnInfoPtr pScrn, int color, int rop,
- unsigned int planemask);
-static void DualMXSubsequentHorVertLine(ScrnInfoPtr pScrn, int x1, int y1,
- int len, int dir);
-static void DualMXSubsequentSolidBresenhamLine(ScrnInfoPtr pScrn,
- int x, int y, int dmaj, int dmin, int e,
- int len, int octant);
-static void DualMXPolylinesThinSolidWrapper(DrawablePtr pDraw, GCPtr pGC,
- int mode, int npt, DDXPointPtr pPts);
-static void DualMXPolySegmentThinSolidWrapper(DrawablePtr pDraw, GCPtr pGC,
- int nseg, xSegment *pSeg);
-
-#define MAX_FIFO_ENTRIES 15
-
-void
-DualMXInitializeEngine(ScrnInfoPtr pScrn)
-{
- GLINTPtr pGlint = GLINTPTR(pScrn);
-
- pGlint->rasterizerMode = RMMultiGLINT;
-
- /* Initialize the Accelerator Engine to defaults */
-
- /* Only write the following registerto the first MX */
- GLINT_SLOW_WRITE_REG(1, BroadcastMask);
- GLINT_SLOW_WRITE_REG(0x00000001, ScanLineOwnership);
-
- /* Only write the following register to the second MX */
- GLINT_SLOW_WRITE_REG(2, BroadcastMask);
- GLINT_SLOW_WRITE_REG(0x00000005, ScanLineOwnership);
-
- /* Make sure the rest of the register writes go to both MX's */
- GLINT_SLOW_WRITE_REG(3, BroadcastMask);
-
- GLINT_SLOW_WRITE_REG(pGlint->rasterizerMode, RasterizerMode);
- GLINT_SLOW_WRITE_REG(UNIT_DISABLE, ScissorMode);
- GLINT_SLOW_WRITE_REG(pGlint->pprod | LBRM_ScanlineInt2, LBReadMode);
- pGlint->pprod |= FBRM_ScanlineInt2;
- GLINT_SLOW_WRITE_REG(pGlint->pprod, FBReadMode);
- GLINT_SLOW_WRITE_REG(0, dXSub);
- GLINT_SLOW_WRITE_REG(UNIT_DISABLE, LBWriteMode);
- GLINT_SLOW_WRITE_REG(UNIT_ENABLE, FBWriteMode);
- GLINT_SLOW_WRITE_REG(UNIT_DISABLE, DitherMode);
- GLINT_SLOW_WRITE_REG(UNIT_DISABLE, AlphaBlendMode);
- GLINT_SLOW_WRITE_REG(UNIT_DISABLE, ColorDDAMode);
- GLINT_SLOW_WRITE_REG(UNIT_DISABLE, TextureColorMode);
- GLINT_SLOW_WRITE_REG(UNIT_DISABLE, TextureAddressMode);
- GLINT_SLOW_WRITE_REG(UNIT_DISABLE, TextureReadMode);
- GLINT_SLOW_WRITE_REG(UNIT_DISABLE, GLINTWindow);
- GLINT_SLOW_WRITE_REG(UNIT_DISABLE, AlphaBlendMode);
- GLINT_SLOW_WRITE_REG(UNIT_DISABLE, DepthMode);
- GLINT_SLOW_WRITE_REG(UNIT_DISABLE, RouterMode);
- GLINT_SLOW_WRITE_REG(UNIT_DISABLE, FogMode);
- GLINT_SLOW_WRITE_REG(UNIT_DISABLE, AntialiasMode);
- GLINT_SLOW_WRITE_REG(UNIT_DISABLE, AlphaTestMode);
- GLINT_SLOW_WRITE_REG(UNIT_DISABLE, StencilMode);
- GLINT_SLOW_WRITE_REG(UNIT_DISABLE, AreaStippleMode);
- GLINT_SLOW_WRITE_REG(UNIT_DISABLE, LineStippleMode);
- GLINT_SLOW_WRITE_REG(0, UpdateLineStippleCounters);
- GLINT_SLOW_WRITE_REG(UNIT_DISABLE, LogicalOpMode);
- GLINT_SLOW_WRITE_REG(UNIT_DISABLE, DepthMode);
- GLINT_SLOW_WRITE_REG(UNIT_DISABLE, StatisticMode);
- GLINT_SLOW_WRITE_REG(0x400, FilterMode);
- GLINT_SLOW_WRITE_REG(0xffffffff, FBHardwareWriteMask);
- GLINT_SLOW_WRITE_REG(0xffffffff, FBSoftwareWriteMask);
- GLINT_SLOW_WRITE_REG(UNIT_DISABLE, GLINTDepth);
- GLINT_SLOW_WRITE_REG(UNIT_DISABLE, FBSourceOffset);
- GLINT_SLOW_WRITE_REG(UNIT_DISABLE, FBPixelOffset);
- GLINT_SLOW_WRITE_REG(UNIT_DISABLE, LBSourceOffset);
- GLINT_SLOW_WRITE_REG(UNIT_DISABLE, WindowOrigin);
- GLINT_SLOW_WRITE_REG(UNIT_DISABLE, FBWindowBase);
- GLINT_SLOW_WRITE_REG(UNIT_DISABLE, LBWindowBase);
- GLINT_SLOW_WRITE_REG(UNIT_DISABLE, TextureAddressMode);
- GLINT_SLOW_WRITE_REG(UNIT_DISABLE, RouterMode);
- GLINT_SLOW_WRITE_REG(UNIT_DISABLE, PatternRamMode);
-
- 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;
- }
-
- pGlint->ROP = 0xFF;
- pGlint->ClippingOn = FALSE;
- pGlint->startxsub = 0;
- pGlint->startxdom = 0;
- pGlint->starty = 0;
- pGlint->count = 0;
- pGlint->dxdom = 0;
- pGlint->dy = 1;
- pGlint->planemask = 0;
- GLINT_SLOW_WRITE_REG(0, StartXSub);
- GLINT_SLOW_WRITE_REG(0, StartXDom);
- GLINT_SLOW_WRITE_REG(0, StartY);
- GLINT_SLOW_WRITE_REG(0, GLINTCount);
- GLINT_SLOW_WRITE_REG(0, dXDom);
- GLINT_SLOW_WRITE_REG(1<<16, dY);
-}
-
-Bool
-DualMXAccelInit(ScreenPtr pScreen)
-{
- XAAInfoRecPtr infoPtr;
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- GLINTPtr pGlint = GLINTPTR(pScrn);
- long memory = pGlint->FbMapSize;
- BoxRec AvailFBArea;
-
- pGlint->AccelInfoRec = infoPtr = XAACreateInfoRec();
- if (!infoPtr) return FALSE;
-
- DualMXInitializeEngine(pScrn);
-
- infoPtr->Flags = PIXMAP_CACHE |
- LINEAR_FRAMEBUFFER |
- OFFSCREEN_PIXMAPS;
-
- infoPtr->Sync = DualMXSync;
-
- infoPtr->SetClippingRectangle = DualMXSetClippingRectangle;
- infoPtr->DisableClipping = DualMXDisableClipping;
- infoPtr->ClippingFlags = HARDWARE_CLIP_MONO_8x8_FILL |
-#if 0
- HARDWARE_CLIP_SCREEN_TO_SCREEN_COPY |
-#endif
- HARDWARE_CLIP_SOLID_FILL;
-
- infoPtr->SolidFillFlags = 0;
- infoPtr->SetupForSolidFill = DualMXSetupForFillRectSolid;
- infoPtr->SubsequentSolidFillRect = DualMXSubsequentFillRectSolid;
-
- infoPtr->SolidLineFlags = 0;
- infoPtr->PolySegmentThinSolidFlags = 0;
- infoPtr->PolylinesThinSolidFlags = 0;
- infoPtr->SetupForSolidLine = DualMXSetupForSolidLine;
- infoPtr->SubsequentSolidHorVertLine = DualMXSubsequentHorVertLine;
- if (!(pScrn->overlayFlags & OVERLAY_8_32_PLANAR))
- {
- infoPtr->SubsequentSolidBresenhamLine =
- DualMXSubsequentSolidBresenhamLine;
- }
- infoPtr->PolySegmentThinSolid = DualMXPolySegmentThinSolidWrapper;
- infoPtr->PolylinesThinSolid = DualMXPolylinesThinSolidWrapper;
-
-#if 0
- infoPtr->ScreenToScreenCopyFlags = NO_TRANSPARENCY |
- ONLY_LEFT_TO_RIGHT_BITBLT;
- infoPtr->SetupForScreenToScreenCopy = DualMXSetupForScreenToScreenCopy;
- infoPtr->SubsequentScreenToScreenCopy = DualMXSubsequentScreenToScreenCopy;
-#endif
-
- infoPtr->Mono8x8PatternFillFlags = HARDWARE_PATTERN_PROGRAMMED_ORIGIN |
- HARDWARE_PATTERN_SCREEN_ORIGIN |
- HARDWARE_PATTERN_PROGRAMMED_BITS;
- infoPtr->SetupForMono8x8PatternFill = DualMXSetupForMono8x8PatternFill;
- infoPtr->SubsequentMono8x8PatternFillRect =
- DualMXSubsequentMono8x8PatternFillRect;
-
-#if 0
- if (!pGlint->UsePCIRetry) {
- infoPtr->ScanlineCPUToScreenColorExpandFillFlags =
- TRANSPARENCY_ONLY |
-#if 0
- LEFT_EDGE_CLIPPING |
- LEFT_EDGE_CLIPPING_NEGATIVE_X |
-#endif
- BIT_ORDER_IN_BYTE_LSBFIRST;
-
- pGlint->XAAScanlineColorExpandBuffers[0] =
- xnfalloc(((pScrn->virtualX + 63)/32) *4* (pScrn->bitsPerPixel / 8));
- pGlint->XAAScanlineColorExpandBuffers[1] =
- xnfalloc(((pScrn->virtualX + 63)/32) *4* (pScrn->bitsPerPixel / 8));
-
- infoPtr->NumScanlineColorExpandBuffers = 2;
- infoPtr->ScanlineColorExpandBuffers =
- pGlint->XAAScanlineColorExpandBuffers;
-
- infoPtr->SetupForScanlineCPUToScreenColorExpandFill =
- DualMXSetupForScanlineCPUToScreenColorExpandFill;
- infoPtr->SubsequentScanlineCPUToScreenColorExpandFill =
- DualMXSubsequentScanlineCPUToScreenColorExpandFill;
- infoPtr->SubsequentColorExpandScanline =
- DualMXSubsequentColorExpandScanline;
- } else {
- infoPtr->CPUToScreenColorExpandFillFlags = TRANSPARENCY_ONLY |
- SYNC_AFTER_COLOR_EXPAND |
- CPU_TRANSFER_PAD_DWORD |
-#if 0
- LEFT_EDGE_CLIPPING |
- LEFT_EDGE_CLIPPING_NEGATIVE_X |
-#endif
- BIT_ORDER_IN_BYTE_LSBFIRST;
- infoPtr->ColorExpandBase = pGlint->IOBase + OutputFIFO + 4;
- infoPtr->SetupForCPUToScreenColorExpandFill =
- DualMXSetupForCPUToScreenColorExpandFill;
- infoPtr->SubsequentCPUToScreenColorExpandFill =
- DualMXSubsequentCPUToScreenColorExpandFill;
- }
-#endif
-
- infoPtr->ColorExpandRange = MAX_FIFO_ENTRIES;
-
- infoPtr->WriteBitmap = DualMXWriteBitmap;
- infoPtr->WritePixmap = DualMXWritePixmap;
-
- AvailFBArea.x1 = 0;
- AvailFBArea.y1 = 0;
- AvailFBArea.x2 = pScrn->displayWidth;
- if (memory > (16383*1024)) memory = 16383*1024;
- AvailFBArea.y2 = memory / (pScrn->displayWidth *
- pScrn->bitsPerPixel / 8);
-
- xf86InitFBManager(pScreen, &AvailFBArea);
-
- return (XAAInit(pScreen, infoPtr));
-}
-
-static void DualMXLoadCoord(
- ScrnInfoPtr pScrn,
- int x, int y,
- int w, int h,
- int a, int d
-){
- GLINTPtr pGlint = GLINTPTR(pScrn);
-
- GLINT_WRITE_REG(w<<16, StartXSub);
- GLINT_WRITE_REG(x<<16,StartXDom);
- GLINT_WRITE_REG(y<<16,StartY);
- GLINT_WRITE_REG(h,GLINTCount);
- GLINT_WRITE_REG(a<<16,dXDom);
- GLINT_WRITE_REG(d<<16,dY);
-}
-
-static void MoveDWORDS(
- register CARD32* dest,
- register CARD32* src,
- register int dwords )
-{
- while(dwords & ~0x03) {
- *dest = *src;
- *(dest + 1) = *(src + 1);
- *(dest + 2) = *(src + 2);
- *(dest + 3) = *(src + 3);
- src += 4;
- dest += 4;
- dwords -= 4;
- }
- if (!dwords) return;
- *dest = *src;
- if (dwords == 1) return;
- *(dest + 1) = *(src + 1);
- if (dwords == 2) return;
- *(dest + 2) = *(src + 2);
-}
-
-#define Sync_tag 0x188
-
-static void
-DualMXSync(
- ScrnInfoPtr pScrn
-){
- GLINTPtr pGlint = GLINTPTR(pScrn);
- unsigned long readValue;
-
- CHECKCLIPPING;
-
- while (GLINT_READ_REG(DMACount) != 0);
- GLINT_WAIT(3);
- GLINT_WRITE_REG(3, BroadcastMask); /* hack! this shouldn't need to be reloaded */
- GLINT_WRITE_REG(1<<10, FilterMode);
- GLINT_WRITE_REG(0, GlintSync);
-
- /* Read 1st MX until Sync Tag shows */
- do {
- while(GLINT_READ_REG(OutFIFOWords) == 0);
- readValue = GLINT_READ_REG(OutputFIFO);
-#ifdef DEBUG
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "1st MX: OutputFIFO %x\n",readValue);
-#endif
- } while (readValue != Sync_tag);
-
- /* Read 2nd MX until Sync Tag shows */
- do {
- while(GLINT_SECONDARY_READ_REG(OutFIFOWords) == 0);
- readValue = GLINT_SECONDARY_READ_REG(OutputFIFO);
-#ifdef DEBUG
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "2nd MX: OutputFIFO %x\n",readValue);
-#endif
- } while (readValue != Sync_tag);
-
-#ifdef DEBUG
- if (GLINT_READ_REG(OutFIFOWords)||GLINT_SECONDARY_READ_REG(OutFIFOWords)) {
- xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
- "Unread data in output FIFO after sync\n");
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "1st MX: OutFifoWords %d\n",GLINT_READ_REG(OutFIFOWords));
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "2nd MX: OutFifoWords %d\n",GLINT_SECONDARY_READ_REG(OutFIFOWords));
- }
-#endif
-}
-
-static void
-DualMXSetupForFillRectSolid(
- ScrnInfoPtr pScrn,
- int color, int rop,
- unsigned int planemask
-){
- GLINTPtr pGlint = GLINTPTR(pScrn);
- pGlint->ForeGroundColor = color;
-
- GLINT_WAIT(5);
- REPLICATE(color);
- DO_PLANEMASK(planemask);
- if (rop == GXcopy) {
- GLINT_WRITE_REG(pGlint->pprod, FBReadMode);
- GLINT_WRITE_REG(UNIT_DISABLE, PatternRamMode);
- GLINT_WRITE_REG(color, FBBlockColor);
- pGlint->FrameBufferReadMode = FastFillEnable;
- } else {
- GLINT_WRITE_REG(pGlint->pprod | FBRM_DstEnable, FBReadMode);
- GLINT_WRITE_REG(UNIT_ENABLE, PatternRamMode);
- GLINT_WRITE_REG(color, PatternRamData0);
- pGlint->FrameBufferReadMode = FastFillEnable | SpanOperation;
- }
- LOADROP(rop);
-}
-
-static void
-DualMXSubsequentFillRectSolid(
- ScrnInfoPtr pScrn,
- int x, int y,
- int w, int h
-){
- GLINTPtr pGlint = GLINTPTR(pScrn);
-
- GLINT_WAIT(8);
- DualMXLoadCoord(pScrn, x, y, x+w, h, 0, 1);
- GLINT_WRITE_REG(PrimitiveTrapezoid | pGlint->FrameBufferReadMode,Render);
-}
-
-static void
-DualMXSetClippingRectangle(
- ScrnInfoPtr pScrn,
- int x1, int y1,
- int x2, int y2
-){
- GLINTPtr pGlint = GLINTPTR(pScrn);
-
- GLINT_WAIT(3);
- GLINT_WRITE_REG((y1&0xFFFF)<<16|(x1&0xFFFF), ScissorMinXY);
- GLINT_WRITE_REG((y2&0xFFFF)<<16|(x2&0xFFFF), ScissorMaxXY);
- GLINT_WRITE_REG(1, ScissorMode); /* Enable Scissor Mode */
- pGlint->ClippingOn = TRUE;
-}
-
-static void
-DualMXDisableClipping(
- ScrnInfoPtr pScrn
-){
- GLINTPtr pGlint = GLINTPTR(pScrn);
- CHECKCLIPPING;
-}
-
-static void
-DualMXSetupForScreenToScreenCopy(
- ScrnInfoPtr pScrn,
- int xdir, int ydir,
- int rop,
- unsigned int planemask,
- int transparency_color
-){
- GLINTPtr pGlint = GLINTPTR(pScrn);
-
- pGlint->BltScanDirection = ydir;
-
- GLINT_WAIT(5);
- DO_PLANEMASK(planemask);
- GLINT_WRITE_REG(UNIT_DISABLE, PatternRamMode);
-
- if (rop == GXcopy) {
- GLINT_WRITE_REG(pGlint->pprod | FBRM_SrcEnable, FBReadMode);
- } else {
- GLINT_WRITE_REG(pGlint->pprod | FBRM_SrcEnable | FBRM_DstEnable, FBReadMode);
- }
- LOADROP(rop);
-}
-
-static void
-DualMXSubsequentScreenToScreenCopy(
- ScrnInfoPtr pScrn,
- int x1, int y1,
- int x2, int y2,
- int w, int h
-){
- GLINTPtr pGlint = GLINTPTR(pScrn);
- int srcaddr, dstaddr;
-
- GLINT_WAIT(10);
- if (pGlint->BltScanDirection != 1) {
- y1 += h - 1;
- y2 += h - 1;
- DualMXLoadCoord(pScrn, x2, y2, x2+w, h, 0, -1);
- } else {
- DualMXLoadCoord(pScrn, x2, y2, x2+w, h, 0, 1);
- }
-
- srcaddr = y1 * pScrn->displayWidth + x1;
- dstaddr = y2 * pScrn->displayWidth + x2;
-
- GLINT_WRITE_REG(srcaddr - dstaddr, FBSourceOffset);
- GLINT_WRITE_REG(PrimitiveTrapezoid| FastFillEnable | SpanOperation, Render);
-}
-
-static void
-DualMXSetupForScanlineCPUToScreenColorExpandFill(
- ScrnInfoPtr pScrn,
- int fg, int bg,
- int rop,
- unsigned int planemask
-){
- GLINTPtr pGlint = GLINTPTR(pScrn);
- REPLICATE(fg);
- REPLICATE(bg);
- GLINT_WAIT(6);
- DO_PLANEMASK(planemask);
- GLINT_WRITE_REG(pGlint->rasterizerMode, RasterizerMode);
- if (rop == GXcopy) {
- GLINT_WRITE_REG(pGlint->pprod, FBReadMode);
- GLINT_WRITE_REG(UNIT_DISABLE, PatternRamMode);
- pGlint->FrameBufferReadMode = FastFillEnable;
- GLINT_WRITE_REG(fg, FBBlockColor);
- } else {
- GLINT_WRITE_REG(pGlint->pprod | FBRM_DstEnable, FBReadMode);
- GLINT_WRITE_REG(UNIT_ENABLE, PatternRamMode);
- pGlint->FrameBufferReadMode = FastFillEnable | SpanOperation;
- GLINT_WRITE_REG(fg, PatternRamData0);
- }
- LOADROP(rop);
-}
-
-static void
-DualMXSubsequentScanlineCPUToScreenColorExpandFill(
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h,
- int skipleft
-){
- GLINTPtr pGlint = GLINTPTR(pScrn);
-
- pGlint->dwords = ((w + 31) >> 5); /* dwords per scanline */
-
-#if 0
- DualMXSetClippingRectangle(pScrn,x+skipleft, y, x+w, y+h);
-#endif
-
- pGlint->cpucount = y;
- pGlint->cpuheight = h;
- GLINT_WAIT(6);
- DualMXLoadCoord(pScrn, x, pGlint->cpucount, x+w, 1, 0, 1);
-}
-
-static void
-DualMXSubsequentColorExpandScanline(ScrnInfoPtr pScrn, int bufno)
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
- GLINTPtr pGlint = GLINTPTR(pScrn);
- CARD32 *src;
- int dwords = pGlint->dwords;
-
- GLINT_WAIT(7);
- DualMXLoadCoord(pScrn, pGlint->startxdom, pGlint->cpucount, pGlint->startxsub, 1, 0, 1);
-
- GLINT_WRITE_REG(PrimitiveTrapezoid | pGlint->FrameBufferReadMode | SyncOnBitMask,
- Render);
-
- src = (CARD32*)pGlint->XAAScanlineColorExpandBuffers[bufno];
- while (dwords >= infoRec->ColorExpandRange) {
- GLINT_WAIT(infoRec->ColorExpandRange);
- GLINT_WRITE_REG((infoRec->ColorExpandRange - 2)<<16 | 0x0D, OutputFIFO);
- MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), src,
- infoRec->ColorExpandRange - 1);
- dwords -= (infoRec->ColorExpandRange - 1);
- src += (infoRec->ColorExpandRange - 1);
- }
- if (dwords) {
- GLINT_WAIT(dwords);
- GLINT_WRITE_REG((dwords - 1)<<16 | 0x0D, OutputFIFO);
- MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), src,dwords);
- }
- pGlint->cpucount += 1;
-#if 0
- if (pGlint->cpucount == (pGlint->cpuheight + 1))
- CHECKCLIPPING;
-#endif
-}
-
-static void
-DualMXSetupForCPUToScreenColorExpandFill(
- ScrnInfoPtr pScrn,
- int fg, int bg,
- int rop,
- unsigned int planemask
-){
- GLINTPtr pGlint = GLINTPTR(pScrn);
- REPLICATE(fg);
-
- DO_PLANEMASK(planemask);
- if (rop == GXcopy) {
- GLINT_WRITE_REG(pGlint->pprod, FBReadMode);
- GLINT_WRITE_REG(UNIT_DISABLE, PatternRamMode);
- GLINT_WRITE_REG(fg, FBBlockColor);
- pGlint->FrameBufferReadMode = FastFillEnable;
- } else {
- GLINT_WRITE_REG(pGlint->pprod | FBRM_DstEnable, FBReadMode);
- GLINT_WRITE_REG(UNIT_ENABLE, PatternRamMode);
- GLINT_WRITE_REG(fg, PatternRamData0);
- pGlint->FrameBufferReadMode = FastFillEnable | SpanOperation;
- }
- LOADROP(rop);
-}
-
-static void
-DualMXSubsequentCPUToScreenColorExpandFill(
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h,
- int skipleft
-){
- GLINTPtr pGlint = GLINTPTR(pScrn);
- int dwords = ((w + 31) >> 5) * h;
-
-#if 0
- DualMXSetClippingRectangle(pScrn,x+skipleft, y, x+w, y+h);
-#endif
-
- DualMXLoadCoord(pScrn, x, y, x+w, h, 0, 1);
- GLINT_WRITE_REG(PrimitiveTrapezoid | pGlint->FrameBufferReadMode |
- SyncOnBitMask, Render);
- GLINT_WRITE_REG((dwords - 1)<<16 | 0x0D, OutputFIFO);
-}
-
-void DualMXSetupForMono8x8PatternFill(
- 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(13);
- DO_PLANEMASK(planemask);
- GLINT_WRITE_REG((patternx & 0x000000FF), AreaStipplePattern0);
- GLINT_WRITE_REG((patternx & 0x0000FF00) >> 8, AreaStipplePattern1);
- GLINT_WRITE_REG((patternx & 0x00FF0000) >> 16, AreaStipplePattern2);
- GLINT_WRITE_REG((patternx & 0xFF000000) >> 24, AreaStipplePattern3);
- GLINT_WRITE_REG((patterny & 0x000000FF), AreaStipplePattern4);
- GLINT_WRITE_REG((patterny & 0x0000FF00) >> 8, AreaStipplePattern5);
- GLINT_WRITE_REG((patterny & 0x00FF0000) >> 16, AreaStipplePattern6);
- GLINT_WRITE_REG((patterny & 0xFF000000) >> 24, AreaStipplePattern7);
-
- if (rop == GXcopy) {
- GLINT_WRITE_REG(UNIT_DISABLE, PatternRamMode);
- GLINT_WRITE_REG(pGlint->pprod, FBReadMode);
- } else {
- GLINT_WRITE_REG(UNIT_ENABLE, PatternRamMode);
- GLINT_WRITE_REG(pGlint->pprod | FBRM_DstEnable, FBReadMode);
- }
- LOADROP(rop);
-}
-
-static void
-DualMXSubsequentMono8x8PatternFillRect(
- ScrnInfoPtr pScrn,
- int patternx, int patterny,
- int x, int y,
- int w, int h
-){
- GLINTPtr pGlint = GLINTPTR(pScrn);
- int span = 0;
-
- GLINT_WAIT(12);
- DualMXLoadCoord(pScrn, x, y, x+w, h, 0, 1);
-
- if (pGlint->FrameBufferReadMode != -1) {
- if (pGlint->ROP == GXcopy) {
- GLINT_WRITE_REG(pGlint->BackGroundColor, FBBlockColor);
- span = 0;
- } else {
- GLINT_WRITE_REG(pGlint->BackGroundColor, PatternRamData0);
- span = SpanOperation;
- }
- GLINT_WRITE_REG(2<<1|2<<4|patternx<<7|patterny<<12|ASM_InvertPattern |
- UNIT_ENABLE, AreaStippleMode);
- GLINT_WRITE_REG(AreaStippleEnable | span | FastFillEnable |
- PrimitiveTrapezoid, Render);
- }
-
- if (pGlint->ROP == GXcopy) {
- GLINT_WRITE_REG(pGlint->ForeGroundColor, FBBlockColor);
- span = 0;
- } else {
- GLINT_WRITE_REG(pGlint->ForeGroundColor, PatternRamData0);
- span = SpanOperation;
- }
- GLINT_WRITE_REG(2<<1|2<<4|patternx<<7|patterny<<12|
- UNIT_ENABLE, AreaStippleMode);
- GLINT_WRITE_REG(AreaStippleEnable | span | FastFillEnable |
- PrimitiveTrapezoid, Render);
-}
-
-static void
-DualMXWriteBitmap(ScrnInfoPtr pScrn,
- int x, int y, int w, int h,
- unsigned char *src,
- int srcwidth,
- int skipleft,
- int fg, int bg,
- int rop,
- unsigned int planemask
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
- GLINTPtr pGlint = GLINTPTR(pScrn);
- unsigned char *srcpntr;
- int dwords, height, mode;
- Bool SecondPass = FALSE;
- register int count;
- register CARD32* pattern;
-
- w += skipleft;
- x -= skipleft;
- dwords = (w + 31) >> 5;
-
- DualMXSetClippingRectangle(pScrn,x+skipleft, y, x+w, y+h);
-
- GLINT_WAIT(11);
- DO_PLANEMASK(planemask);
- GLINT_WRITE_REG(pGlint->rasterizerMode, RasterizerMode);
- LOADROP(rop);
- if (rop == GXcopy) {
- mode = 0;
- GLINT_WRITE_REG(UNIT_DISABLE, PatternRamMode);
- GLINT_WRITE_REG(pGlint->pprod, FBReadMode);
- } else {
- mode = SpanOperation;
- GLINT_WRITE_REG(UNIT_ENABLE, PatternRamMode);
- GLINT_WRITE_REG(pGlint->pprod | FBRM_DstEnable, FBReadMode);
- }
- DualMXLoadCoord(pScrn, x, y, x+w, h, 0, 1);
-
- if(bg == -1) {
- /* >>>>> set fg <<<<<<<< */
- REPLICATE(fg);
- GLINT_WAIT(3);
- if (rop == GXcopy) {
- GLINT_WRITE_REG(fg, FBBlockColor);
- } else {
- GLINT_WRITE_REG(fg, PatternRamData0);
- }
- } else if(rop == GXcopy) {
- REPLICATE(bg);
- GLINT_WAIT(5);
- if (rop == GXcopy) {
- GLINT_WRITE_REG(bg, FBBlockColor);
- } else {
- GLINT_WRITE_REG(bg, PatternRamData0);
- }
- GLINT_WRITE_REG(PrimitiveTrapezoid |mode|FastFillEnable,Render);
- REPLICATE(fg);
- if (rop == GXcopy) {
- GLINT_WRITE_REG(fg, FBBlockColor);
- } else {
- GLINT_WRITE_REG(fg, PatternRamData0);
- }
- } else {
- SecondPass = TRUE;
- REPLICATE(fg);
- GLINT_WAIT(3);
- if (rop == GXcopy) {
- GLINT_WRITE_REG(fg, FBBlockColor);
- } else {
- GLINT_WRITE_REG(fg, PatternRamData0);
- }
- }
-
-SECOND_PASS:
- GLINT_WRITE_REG(PrimitiveTrapezoid | FastFillEnable | mode | SyncOnBitMask, Render);
-
- height = h;
- srcpntr = src;
- while(height--) {
- count = dwords >> 3;
- pattern = (CARD32*)srcpntr;
- while(count--) {
- GLINT_WAIT(8);
- GLINT_WRITE_REG(*(pattern), BitMaskPattern);
- GLINT_WRITE_REG(*(pattern+1), BitMaskPattern);
- GLINT_WRITE_REG(*(pattern+2), BitMaskPattern);
- GLINT_WRITE_REG(*(pattern+3), BitMaskPattern);
- GLINT_WRITE_REG(*(pattern+4), BitMaskPattern);
- GLINT_WRITE_REG(*(pattern+5), BitMaskPattern);
- GLINT_WRITE_REG(*(pattern+6), BitMaskPattern);
- GLINT_WRITE_REG(*(pattern+7), BitMaskPattern);
- pattern+=8;
- }
- count = dwords & 0x07;
- GLINT_WAIT(count);
- while (count--)
- GLINT_WRITE_REG(*(pattern++), BitMaskPattern);
- srcpntr += srcwidth;
- }
-
- if(SecondPass) {
- SecondPass = FALSE;
- REPLICATE(bg);
- GLINT_WAIT(4);
- GLINT_WRITE_REG((pGlint->rasterizerMode|InvertBitMask), RasterizerMode);
- if (rop == GXcopy) {
- GLINT_WRITE_REG(bg, FBBlockColor);
- } else {
- GLINT_WRITE_REG(bg, PatternRamData0);
- }
- goto SECOND_PASS;
- }
-
- GLINT_WAIT(2);
- GLINT_WRITE_REG(pGlint->rasterizerMode, RasterizerMode);
- CHECKCLIPPING;
- SET_SYNC_FLAG(infoRec);
-}
-
-static void
-DualMXWritePixmap(
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h,
- unsigned char *src,
- int srcwidth, /* bytes */
- int rop,
- unsigned int planemask,
- int trans,
- int bpp, int depth
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
- GLINTPtr pGlint = GLINTPTR(pScrn);
- CARD32 *srcp;
- int count,dwords, skipleft, Bpp = bpp >> 3;
-
- if((skipleft = (long)src & 0x03L)) {
- skipleft /= Bpp;
-
- x -= skipleft;
- w += skipleft;
-
- src = (unsigned char*)((long)src & ~0x03L);
- }
-
- switch(Bpp) {
- case 1: dwords = (w + 3) >> 2;
- break;
- case 2: dwords = (w + 1) >> 1;
- break;
- case 4: dwords = w;
- break;
- default: return;
- }
-
- DualMXSetClippingRectangle(pScrn,x+skipleft, y, x+w, y+h);
-
- GLINT_WAIT(12);
- DO_PLANEMASK(planemask);
- GLINT_WRITE_REG(0, PatternRamMode);
- if (rop == GXcopy) {
- GLINT_WRITE_REG(pGlint->pprod, FBReadMode);
- } else {
- GLINT_WRITE_REG(pGlint->pprod | FBRM_DstEnable, FBReadMode);
- }
- LOADROP(rop);
- DualMXLoadCoord(pScrn, x, y, x+w, h, 0, 1);
- GLINT_WRITE_REG(PrimitiveTrapezoid | FastFillEnable | SpanOperation |
- SyncOnHostData, Render);
-
- while(h--) {
- count = dwords;
- srcp = (CARD32*)src;
- while(count >= infoRec->ColorExpandRange) {
- GLINT_WAIT(infoRec->ColorExpandRange);
- /* (0x15 << 4) | 0x05 is the TAG for FBSourceData */
- GLINT_WRITE_REG(((infoRec->ColorExpandRange - 2) << 16) | (0x15 << 4) |
- 0x05, OutputFIFO);
- MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
- (CARD32*)srcp, infoRec->ColorExpandRange - 1);
- count -= infoRec->ColorExpandRange - 1;
- srcp += infoRec->ColorExpandRange - 1;
- }
- if(count) {
- GLINT_WAIT(count);
- /* (0x15 << 4) | 0x05 is the TAG for FBSourceData */
- GLINT_WRITE_REG(((count - 1) << 16) | (0x15 << 4) |
- 0x05, OutputFIFO);
- MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
- (CARD32*)srcp, count);
- }
- src += srcwidth;
- }
- CHECKCLIPPING;
- SET_SYNC_FLAG(infoRec);
-}
-
-static void
-DualMXPolylinesThinSolidWrapper(
- DrawablePtr pDraw,
- GCPtr pGC,
- int mode,
- int npt,
- DDXPointPtr pPts
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- GLINTPtr pGlint = GLINTPTR(infoRec->pScrn);
- pGlint->CurrentGC = pGC;
- pGlint->CurrentDrawable = pDraw;
- if(infoRec->NeedToSync) (*infoRec->Sync)(infoRec->pScrn);
- XAAPolyLines(pDraw, pGC, mode, npt, pPts);
-}
-
-static void
-DualMXPolySegmentThinSolidWrapper(
- DrawablePtr pDraw,
- GCPtr pGC,
- int nseg,
- xSegment *pSeg
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- GLINTPtr pGlint = GLINTPTR(infoRec->pScrn);
- pGlint->CurrentGC = pGC;
- pGlint->CurrentDrawable = pDraw;
- if(infoRec->NeedToSync) (*infoRec->Sync)(infoRec->pScrn);
- XAAPolySegment(pDraw, pGC, nseg, pSeg);
-}
-
-static void
-DualMXSetupForSolidLine(ScrnInfoPtr pScrn, int color,
- int rop, unsigned int planemask)
-{
- GLINTPtr pGlint = GLINTPTR(pScrn);
-
- GLINT_WAIT(5);
- DO_PLANEMASK(planemask);
- GLINT_WRITE_REG(color, GLINTColor);
- if (rop == GXcopy) {
- GLINT_WRITE_REG(pGlint->pprod, FBReadMode);
- } else {
- GLINT_WRITE_REG(pGlint->pprod | FBRM_DstEnable, FBReadMode);
- }
- LOADROP(rop);
-}
-
-static void
-DualMXSubsequentHorVertLine(ScrnInfoPtr pScrn,int x,int y,int len,int dir)
-{
- GLINTPtr pGlint = GLINTPTR(pScrn);
-
- GLINT_WAIT(7);
- if (dir == DEGREES_0) {
- DualMXLoadCoord(pScrn, x, y, 0, len, 1, 0);
- } else {
- DualMXLoadCoord(pScrn, x, y, 0, len, 0, 1);
- }
-
- GLINT_WRITE_REG(PrimitiveLine, Render);
-}
-
-static void
-DualMXSubsequentSolidBresenhamLine( ScrnInfoPtr pScrn,
- int x, int y, int dmaj, int dmin, int e, int len, int octant)
-{
- GLINTPtr pGlint = GLINTPTR(pScrn);
- int dxdom, dy;
-
- if(dmaj == dmin) {
- GLINT_WAIT(7);
- if(octant & YDECREASING) {
- dy = -1;
- } else {
- dy = 1;
- }
-
- if(octant & XDECREASING) {
- dxdom = -1;
- } else {
- dxdom = 1;
- }
-
- DualMXLoadCoord(pScrn, x, y, 0, len, dxdom, dy);
- GLINT_WRITE_REG(PrimitiveLine, Render);
- return;
- }
-
- fbBres(pGlint->CurrentDrawable, pGlint->CurrentGC, 0,
- (octant & XDECREASING) ? -1 : 1,
- (octant & YDECREASING) ? -1 : 1,
- (octant & YMAJOR) ? Y_AXIS : X_AXIS,
- x, y, dmin + e, dmin, -dmaj, len);
-}
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/dualmx_dac.c b/xc/programs/Xserver/hw/xfree86/drivers/glint/dualmx_dac.c
deleted file mode 100644
index d042bfa47..000000000
--- a/xc/programs/Xserver/hw/xfree86/drivers/glint/dualmx_dac.c
+++ /dev/null
@@ -1,807 +0,0 @@
-/*
- * Copyright 1997,1998 by Alan Hourihane <alanh@fairlite.demon.co.uk>
- *
- * 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 Alan Hourihane not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Alan Hourihane makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL ALAN HOURIHANE 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.
- *
- * Original Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk>
- * Dirk Hohndel, <hohndel@suse.de>
- * Stefan Dirsch, <sndirsch@suse.de>
- * Helmut Fahrion, <hf@suse.de>
- *
- * Modified version of tx_dac.c to support Dual MX rasterizers by
- * Jens Owen <jens@precisioninsight.com>
- */
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/dualmx_dac.c,v 1.4 2000/05/10 18:55:28 alanh Exp $ */
-
-#include "xf86.h"
-#include "xf86_OSproc.h"
-#include "xf86_ansic.h"
-
-#include "xf86PciInfo.h"
-#include "xf86Pci.h"
-
-#include "IBM.h"
-#include "TI.h"
-#include "glint_regs.h"
-#include "glint.h"
-
-#define DEBUG
-#ifdef DEBUG
-#define DUMP(name,field) do { \
- value = GLINT_READ_REG(field); \
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "\t\t%s(primary): 0x%lX\n", name, value); \
- value = GLINT_SECONDARY_READ_REG(field); \
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "\t\t%s(secondary): 0x%lX\n", name, value); \
-} while (0)
-
-#define TIDUMP(name,field) do { \
- value = glintInTIIndReg(pScrn,field); \
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "\t\t%s: 0x%lX\n", name, value); \
-} while (0)
-
-void
-GLINTDumpRegs(ScrnInfoPtr pScrn) {
- GLINTPtr pGlint = GLINTPTR(pScrn);
- unsigned long value;
-
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "\tGAMMA/MX regs:\n");
- DUMP("ResetStatus",ResetStatus);
- DUMP("IntEnable",IntEnable);
- DUMP("IntFlags",IntFlags);
- DUMP("InFIFOSpace",InFIFOSpace);
- DUMP("OutFIFOWords",OutFIFOWords);
- DUMP("DMAAddress",DMAAddress);
- DUMP("DMACount",DMACount);
- DUMP("ErrorFlags",ErrorFlags);
- DUMP("VClkCtl",VClkCtl);
- DUMP("TestRegister",TestRegister);
- DUMP("Aperture0",Aperture0);
- DUMP("Aperture1",Aperture1);
- DUMP("DMAControl",DMAControl);
- DUMP("FIFODis",FIFODis);
- DUMP("LBMemoryCtl",LBMemoryCtl);
- DUMP("LBMemoryEDO",LBMemoryEDO);
- DUMP("FBMemoryCtl",FBMemoryCtl);
- DUMP("FBModeSel",FBModeSel);
- DUMP("FBGCWrMask",FBGCWrMask);
- DUMP("FBGCColorLower",FBGCColorLower);
- DUMP("FBTXMemCtl",FBTXMemCtl);
- DUMP("FBWrMaskk",FBWrMaskk);
- DUMP("FBGCColorUpper",FBGCColorUpper);
- DUMP("OutputFIFO",OutputFIFO);
- DUMP("VTGHLimit",VTGHLimit);
- DUMP("VTGHSyncStart",VTGHSyncStart);
- DUMP("VTGHSyncEnd",VTGHSyncEnd);
- DUMP("VTGHBlankEnd",VTGHBlankEnd);
- DUMP("VTGVLimit",VTGVLimit);
- DUMP("VTGVSyncStart",VTGVSyncStart);
- DUMP("VTGVSyncEnd",VTGVSyncEnd);
- DUMP("VTGVBlankEnd",VTGVBlankEnd);
- DUMP("VTGHGateStart",VTGHGateStart);
- DUMP("VTGHGateEnd",VTGHGateEnd);
- DUMP("VTGVGateStart",VTGVGateStart);
- DUMP("VTGVGateEnd",VTGVGateEnd);
- DUMP("VTGPolarity",VTGPolarity);
- DUMP("VTGFrameRowAddr",VTGFrameRowAddr);
- DUMP("VTGVLineNumber",VTGVLineNumber);
- DUMP("VTGSerialClk",VTGSerialClk);
- DUMP("VTGModeCtl",VTGModeCtl);
- DUMP("GInFIFOSpace",GInFIFOSpace);
- DUMP("GDMAAddress",GDMAAddress);
- DUMP("GDMAControl",GDMAControl);
- DUMP("GOutDMA",GOutDMA);
- DUMP("GOutDMACount",GOutDMACount);
- DUMP("GResetStatus",GResetStatus);
- DUMP("GIntEnable",GIntEnable);
- DUMP("GIntFlags",GIntFlags);
- DUMP("GErrorFlags",GErrorFlags);
- DUMP("GTestRegister",GTestRegister);
- DUMP("GFIFODis",GFIFODis);
- DUMP("GChipConfig",GChipConfig);
- DUMP("GCSRAperture",GCSRAperture);
- DUMP("GPageTableAddr",GPageTableAddr);
- DUMP("GPageTableLength",GPageTableLength);
- DUMP("GDelayTimer",GDelayTimer);
- DUMP("GCommandMode",GCommandMode);
- DUMP("GCommandIntEnable",GCommandIntEnable);
- DUMP("GCommandIntFlags",GCommandIntFlags);
- DUMP("GCommandErrorFlags",GCommandErrorFlags);
- DUMP("GCommandStatus",GCommandStatus);
- DUMP("GCommandFaultingAddr",GCommandFaultingAddr);
- DUMP("GVertexFaultingAddr",GVertexFaultingAddr);
- DUMP("GWriteFaultingAddr",GWriteFaultingAddr);
- DUMP("GFeedbackSelectCount",GFeedbackSelectCount);
- DUMP("GGammaProcessorMode",GGammaProcessorMode);
- DUMP("GVGAShadow",GVGAShadow);
- DUMP("GMultGLINTAperture",GMultGLINTAperture);
- DUMP("GMultGLINT1",GMultGLINT1);
- DUMP("GMultGLINT2",GMultGLINT2);
- DUMP("StartXDom",StartXDom);
- DUMP("dXDom",dXDom);
- DUMP("StartXSub",StartXSub);
- DUMP("dXSub",dXSub);
- DUMP("StartY",StartY);
- DUMP("dY",dY);
- DUMP("GLINTCount",GLINTCount);
- DUMP("Render",Render);
- DUMP("ContinueNewLine",ContinueNewLine);
- DUMP("ContinueNewDom",ContinueNewDom);
- DUMP("ContinueNewSub",ContinueNewSub);
- DUMP("Continue",Continue);
- DUMP("FlushSpan",FlushSpan);
- DUMP("BitMaskPattern",BitMaskPattern);
- DUMP("PointTable0",PointTable0);
- DUMP("PointTable1",PointTable1);
- DUMP("PointTable2",PointTable2);
- DUMP("PointTable3",PointTable3);
- DUMP("RasterizerMode",RasterizerMode);
- DUMP("YLimits",YLimits);
- DUMP("ScanLineOwnership",ScanLineOwnership);
- DUMP("WaitForCompletion",WaitForCompletion);
- DUMP("PixelSize",PixelSize);
- DUMP("XLimits",XLimits);
- DUMP("RectangleOrigin",RectangleOrigin);
- DUMP("RectangleSize",RectangleSize);
- DUMP("PackedDataLimits",PackedDataLimits);
- DUMP("ScissorMode",ScissorMode);
- DUMP("ScissorMinXY",ScissorMinXY);
- DUMP("ScissorMaxXY",ScissorMaxXY);
- DUMP("ScreenSize",ScreenSize);
- DUMP("AreaStippleMode",AreaStippleMode);
- DUMP("LineStippleMode",LineStippleMode);
- DUMP("LoadLineStippleCounters",LoadLineStippleCounters);
- DUMP("UpdateLineStippleCounters",UpdateLineStippleCounters);
- DUMP("SaveLineStippleState",SaveLineStippleState);
- DUMP("WindowOrigin",WindowOrigin);
- DUMP("AreaStipplePattern0",AreaStipplePattern0);
- DUMP("AreaStipplePattern1",AreaStipplePattern1);
- DUMP("AreaStipplePattern2",AreaStipplePattern2);
- DUMP("AreaStipplePattern3",AreaStipplePattern3);
- DUMP("AreaStipplePattern4",AreaStipplePattern4);
- DUMP("AreaStipplePattern5",AreaStipplePattern5);
- DUMP("AreaStipplePattern6",AreaStipplePattern6);
- DUMP("AreaStipplePattern7",AreaStipplePattern7);
- DUMP("TextureAddressMode",TextureAddressMode);
- DUMP("TextureReadMode",TextureReadMode);
- DUMP("TextureFormat",TextureFormat);
- DUMP("TextureCacheControl",TextureCacheControl);
- DUMP("GLINTBorderColor",GLINTBorderColor);
- DUMP("TexelLUTIndex",TexelLUTIndex);
- DUMP("TexelLUTData",TexelLUTData);
- DUMP("Texel0",Texel0);
- DUMP("Texel1",Texel1);
- DUMP("Texel2",Texel2);
- DUMP("Texel3",Texel3);
- DUMP("Texel4",Texel4);
- DUMP("Texel5",Texel5);
- DUMP("Texel6",Texel6);
- DUMP("Texel7",Texel7);
- DUMP("Interp0",Interp0);
- DUMP("Interp1",Interp1);
- DUMP("Interp2",Interp2);
- DUMP("Interp3",Interp3);
- DUMP("Interp4",Interp4);
- DUMP("TextureFilter",TextureFilter);
- DUMP("TexelLUTMode",TexelLUTMode);
- DUMP("TextureColorMode",TextureColorMode);
- DUMP("TextureEnvColor",TextureEnvColor);
- DUMP("FogMode",FogMode);
- DUMP("FogColor",FogColor);
- DUMP("FStart",FStart);
- DUMP("dFdx",dFdx);
- DUMP("dFdyDom",dFdyDom);
- DUMP("KsStart",KsStart);
- DUMP("dKsdx",dKsdx);
- DUMP("dKsdyDom",dKsdyDom);
- DUMP("KdStart", KdStart );
- DUMP("dKdStart", dKdStart);
- DUMP("dKddyDom", dKddyDom);
- DUMP("RStart", RStart );
- DUMP("dRdx", dRdx);
- DUMP("dRdyDom", dRdyDom );
- DUMP("GStart", GStart );
- DUMP("dGdx", dGdx );
- DUMP("dGdyDom", dGdyDom );
- DUMP("BStart", BStart );
- DUMP("dBdx", dBdx );
- DUMP("dBdyDom", dBdyDom );
- DUMP("AStart", AStart );
- DUMP("dAdx", dAdx );
- DUMP("dAdyDom", dAdyDom );
- DUMP("ColorDDAMode", ColorDDAMode );
- DUMP("ConstantColor", ConstantColor );
- DUMP("GLINTColor", GLINTColor);
- DUMP("AlphaTestMode", AlphaTestMode );
- DUMP("AntialiasMode", AntialiasMode);
- DUMP("AlphaBlendMode", AlphaBlendMode);
- DUMP("DitherMode", DitherMode );
- DUMP("FBSoftwareWriteMask", FBSoftwareWriteMask);
- DUMP("LogicalOpMode", LogicalOpMode );
- DUMP("FBWriteData", FBWriteData);
- DUMP("RouterMode", RouterMode);
- DUMP("LBReadMode", LBReadMode);
- DUMP("LBReadFormat", LBReadFormat);
- DUMP("LBSourceOffset", LBSourceOffset);
- DUMP("LBStencil", LBStencil);
- DUMP("LBDepth", LBDepth );
- DUMP("LBWindowBase", LBWindowBase);
- DUMP("LBWriteMode", LBWriteMode);
- DUMP("LBWriteFormat", LBWriteFormat);
- DUMP("TextureData", TextureData );
- DUMP("TextureDownloadOffset", TextureDownloadOffset);
- DUMP("GLINTWindow", GLINTWindow );
- DUMP("StencilMode", StencilMode);
- DUMP("StencilData", StencilData);
- DUMP("GLINTStencil", GLINTStencil );
- DUMP("DepthMode", DepthMode);
- DUMP("GLINTDepth", GLINTDepth );
- DUMP("ZStartU", ZStartU );
- DUMP("ZStartL", ZStartL );
- DUMP("dZdxU", dZdxU);
- DUMP("dZdxL", dZdxL);
- DUMP("dZdyDomU",dZdyDomU );
- DUMP("dZdyDomL", dZdyDomL);
- DUMP("FastClearDepth", FastClearDepth);
- DUMP("FBReadMode", FBReadMode);
- DUMP("FBSourceOffset", FBSourceOffset );
- DUMP("FBPixelOffset", FBPixelOffset);
- DUMP("FBColor", FBColor );
- DUMP("FBData", FBData);
- DUMP("FBSourceData", FBSourceData );
- DUMP("FBWindowBase", FBWindowBase );
- DUMP("FBWriteMode", FBWriteMode );
- DUMP("FBHardwareWriteMask", FBHardwareWriteMask );
- DUMP("FBBlockColor", FBBlockColor );
- DUMP("FBReadPixel", FBReadPixel);
- DUMP("PatternRamMode", PatternRamMode );
- DUMP("PatternRamData0", PatternRamData0 );
- DUMP("PatternRamData1", PatternRamData1);
- DUMP("PatternRamData2", PatternRamData2 );
- DUMP("PatternRamData3", PatternRamData3 );
- DUMP("PatternRamData4", PatternRamData4);
- DUMP("PatternRamData5", PatternRamData5 );
- DUMP("PatternRamData6", PatternRamData6 );
- DUMP("PatternRamData7", PatternRamData7 );
- DUMP("FilterMode", FilterMode );
- DUMP("StatisticMode", StatisticMode);
- DUMP("MinRegion", MinRegion );
- DUMP("MaxRegion", MaxRegion );
- DUMP("ResetPickResult", ResetPickResult );
- DUMP("MitHitRegion", MitHitRegion );
- DUMP("MaxHitRegion", MaxHitRegion );
- DUMP("PickResult", PickResult );
- DUMP("GlintSync", GlintSync);
- DUMP("FBBlockColorU", FBBlockColorU );
- DUMP("FBBlockColorL", FBBlockColorL );
- DUMP("SuspendUntilFrameBlank", SuspendUntilFrameBlank );
- DUMP("FBSourceBase", FBSourceBase );
- DUMP("FBSourceDelta", FBSourceDelta);
- DUMP("Config", Config );
- DUMP("YUVMode", YUVMode );
- DUMP("DrawTriangle", DrawTriangle);
- DUMP("RepeatTriangle", RepeatTriangle);
- DUMP("DrawLine01", DrawLine01);
- DUMP("DrawLine10", DrawLine10 );
- DUMP("RepeatLine", RepeatLine );
- DUMP("BroadcastMask", BroadcastMask );
-
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "\tTI3030 direct regs:\n");
-#define TI_WRITE_ADDR 0x4000
-#define TI_RAMDAC_DATA 0x4008
-#define TI_PIXEL_MASK 0x4010
-#define TI_READ_ADDR 0x4018
-#define TI_CURS_COLOR_WRITE_ADDR 0x4020
-#define TI_CURS_COLOR_DATA 0x4028
-#define TI_CURS_COLOR_READ_ADDR 0x4038
-#define TI_DIRECT_CURS_CTRL 0x4048
-#define TI_INDEX_DATA 0x4050
-#define TI_CURS_RAM_DATA 0x4058
-#define TI_CURS_X_LOW 0x4060
-#define TI_CURS_X_HIGH 0x4068
-#define TI_CURS_Y_LOW 0x4070
-#define TI_CURS_Y_HIGH 0x4078
- DUMP("TI_WRITE_ADDR", TI_WRITE_ADDR);
- DUMP("TI_RAMDAC_DATA", TI_RAMDAC_DATA);
- DUMP("TI_PIXEL_MASK", TI_PIXEL_MASK);
- DUMP("TI_READ_ADDR", TI_READ_ADDR);
- DUMP("TI_CURS_COLOR_WRITE_ADDR", TI_CURS_COLOR_WRITE_ADDR);
- DUMP("TI_CURS_COLOR_DATA", TI_CURS_COLOR_DATA);
- DUMP("TI_CURS_COLOR_READ_ADDR", TI_CURS_COLOR_READ_ADDR);
- DUMP("TI_DIRECT_CURS_CTRL", TI_DIRECT_CURS_CTRL);
- DUMP("TI_INDEX_DATA", TI_INDEX_DATA);
- DUMP("TI_CURS_RAM_DATA", TI_CURS_RAM_DATA);
- DUMP("TI_CURS_X_LOW", TI_CURS_X_LOW);
- DUMP("TI_CURS_X_HIGH", TI_CURS_X_HIGH);
- DUMP("TI_CURS_Y_LOW", TI_CURS_Y_LOW);
- DUMP("TI_CURS_Y_HIGH", TI_CURS_Y_HIGH);
-
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "\tTI3030 indirect regs:\n");
- TIDUMP("TIDAC_rev",TIDAC_rev);
- TIDUMP("TIDAC_ind_curs_ctrl",TIDAC_ind_curs_ctrl);
- TIDUMP("TIDAC_byte_router_ctrl",TIDAC_byte_router_ctrl);
- TIDUMP("TIDAC_latch_ctrl",TIDAC_latch_ctrl);
- TIDUMP("TIDAC_true_color_ctrl",TIDAC_true_color_ctrl);
- TIDUMP("TIDAC_multiplex_ctrl",TIDAC_multiplex_ctrl);
- TIDUMP("TIDAC_clock_select",TIDAC_clock_select);
- TIDUMP("TIDAC_palette_page",TIDAC_palette_page);
- TIDUMP("TIDAC_general_ctrl",TIDAC_general_ctrl);
- TIDUMP("TIDAC_misc_ctrl",TIDAC_misc_ctrl);
- TIDUMP("TIDAC_pll_addr",TIDAC_pll_addr);
- TIDUMP("TIDAC_pll_pixel_data",TIDAC_pll_pixel_data);
- TIDUMP("TIDAC_pll_memory_data",TIDAC_pll_memory_data);
- TIDUMP("TIDAC_pll_loop_data",TIDAC_pll_loop_data);
- TIDUMP("TIDAC_key_over_low",TIDAC_key_over_low);
- TIDUMP("TIDAC_key_over_high",TIDAC_key_over_high);
- TIDUMP("TIDAC_key_red_low",TIDAC_key_red_low);
- TIDUMP("TIDAC_key_red_high",TIDAC_key_red_high);
- TIDUMP("TIDAC_key_green_low",TIDAC_key_green_low);
- TIDUMP("TIDAC_key_green_high",TIDAC_key_green_high);
- TIDUMP("TIDAC_key_blue_low",TIDAC_key_blue_low);
- TIDUMP("TIDAC_key_blue_high",TIDAC_key_blue_high);
- TIDUMP("TIDAC_key_ctrl",TIDAC_key_ctrl);
- TIDUMP("TIDAC_clock_ctrl",TIDAC_clock_ctrl);
- TIDUMP("TIDAC_sense_test",TIDAC_sense_test);
- TIDUMP("TIDAC_test_mode_data",TIDAC_test_mode_data);
- TIDUMP("TIDAC_crc_remain_lsb",TIDAC_crc_remain_lsb);
- TIDUMP("TIDAC_crc_remain_msb",TIDAC_crc_remain_msb);
- TIDUMP("TIDAC_crc_bit_select",TIDAC_crc_bit_select);
- TIDUMP("TIDAC_id",TIDAC_id);
-
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "\tTI3030 PLL regs:\n");
- glintOutTIIndReg(pScrn, TIDAC_pll_addr, 0, 0x00);
- TIDUMP("Pixel N",TIDAC_pll_pixel_data);
- glintOutTIIndReg(pScrn, TIDAC_pll_addr, 0, 0x01);
- TIDUMP("Pixel M",TIDAC_pll_pixel_data);
- glintOutTIIndReg(pScrn, TIDAC_pll_addr, 0, 0x02);
- TIDUMP("Pixel P",TIDAC_pll_pixel_data);
- glintOutTIIndReg(pScrn, TIDAC_pll_addr, 0, 0x00);
- TIDUMP("Memory N",TIDAC_pll_memory_data);
- glintOutTIIndReg(pScrn, TIDAC_pll_addr, 0, 0x04);
- TIDUMP("Memory M",TIDAC_pll_memory_data);
- glintOutTIIndReg(pScrn, TIDAC_pll_addr, 0, 0x08);
- TIDUMP("Memory P",TIDAC_pll_memory_data);
- glintOutTIIndReg(pScrn, TIDAC_pll_addr, 0, 0x00);
- TIDUMP("Loop N",TIDAC_pll_loop_data);
- glintOutTIIndReg(pScrn, TIDAC_pll_addr, 0, 0x10);
- TIDUMP("Loop M",TIDAC_pll_loop_data);
- glintOutTIIndReg(pScrn, TIDAC_pll_addr, 0, 0x20);
- TIDUMP("Loop P",TIDAC_pll_loop_data);
-}
-#endif
-
-static int
-Shiftbpp(ScrnInfoPtr pScrn, int value)
-{
- GLINTPtr pGlint = GLINTPTR(pScrn);
- int logbytesperaccess;
-
- if ( (pGlint->RamDac->RamDacType == (IBM640_RAMDAC)) ||
- (pGlint->RamDac->RamDacType == (TI3030_RAMDAC)) )
- logbytesperaccess = 4;
- else
- logbytesperaccess = 3;
-
- switch (pScrn->bitsPerPixel) {
- case 8:
- value >>= logbytesperaccess;
- pGlint->BppShift = logbytesperaccess;
- break;
- case 16:
- if (pGlint->DoubleBuffer) {
- value >>= (logbytesperaccess-2);
- pGlint->BppShift = logbytesperaccess-2;
- } else {
- value >>= (logbytesperaccess-1);
- pGlint->BppShift = logbytesperaccess-1;
- }
- break;
- case 24:
- value *= 3;
- value >>= logbytesperaccess;
- pGlint->BppShift = logbytesperaccess;
- break;
- case 32:
- value >>= (logbytesperaccess-2);
- pGlint->BppShift = logbytesperaccess-2;
- break;
- }
- return (value);
-}
-
-Bool
-DualMXInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
-{
- GLINTPtr pGlint = GLINTPTR(pScrn);
- GLINTRegPtr pReg = &pGlint->ModeReg;
- RamDacHWRecPtr pTI = RAMDACHWPTR(pScrn);
- RamDacRegRecPtr ramdacReg = &pTI->ModeReg;
- CARD32 temp1, temp2, temp3, temp4;
-
- pReg->glintRegs[Aperture0 >> 3] = 0;
- pReg->glintRegs[Aperture1 >> 3] = 0;
-
- if (pGlint->UsePCIRetry) {
- pReg->glintRegs[DFIFODis >> 3] = GLINT_READ_REG(DFIFODis) | 0x01;
- if (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_GAMMA)
- pReg->glintRegs[FIFODis >> 3] = GLINT_READ_REG(FIFODis) | 0x01;
- else
- pReg->glintRegs[FIFODis >> 3] = GLINT_READ_REG(FIFODis) | 0x03;
- } else {
- pReg->glintRegs[DFIFODis >> 3] = GLINT_READ_REG(DFIFODis) & 0xFFFFFFFE;
- pReg->glintRegs[FIFODis >> 3] = GLINT_READ_REG(FIFODis) | 0x01;
- }
-
- temp1 = mode->CrtcHSyncStart - mode->CrtcHDisplay;
- temp2 = mode->CrtcVSyncStart - mode->CrtcVDisplay;
- temp3 = mode->CrtcHSyncEnd - mode->CrtcHSyncStart;
- temp4 = mode->CrtcVSyncEnd - mode->CrtcVSyncStart;
-
- pReg->glintRegs[VTGHLimit >> 3] = Shiftbpp(pScrn,mode->CrtcHTotal);
- pReg->glintRegs[VTGHSyncEnd >> 3] = Shiftbpp(pScrn, temp1 + temp3);
- pReg->glintRegs[VTGHSyncStart >> 3] = Shiftbpp(pScrn, temp1);
- pReg->glintRegs[VTGHBlankEnd >> 3] = Shiftbpp(pScrn, mode->CrtcHTotal -
- mode->CrtcHDisplay);
-
- pReg->glintRegs[VTGVLimit >> 3] = mode->CrtcVTotal;
- pReg->glintRegs[VTGVSyncEnd >> 3] = temp2 + temp4;
- pReg->glintRegs[VTGVSyncStart >> 3] = temp2;
- pReg->glintRegs[VTGVBlankEnd >> 3] = mode->CrtcVTotal - mode->CrtcVDisplay;
-
-#if 1 /* We force them high */
- pReg->glintRegs[VTGPolarity >> 3] = 0xBA;
-#else
- pReg->glintRegs[VTGPolarity >> 3] = (((mode->Flags & V_PHSYNC) ? 0:2)<<2) |
- ((mode->Flags & V_PVSYNC) ? 0 : 2) | (0xb0);
-#endif
-
- pReg->glintRegs[VClkCtl >> 3] = 0;
- pReg->glintRegs[VTGVGateStart >> 3] = pReg->glintRegs[VTGVBlankEnd>>3] - 1;
- pReg->glintRegs[VTGVGateEnd >> 3] = pReg->glintRegs[VTGVBlankEnd>>3];
- /*
- * tell DAC to use the ICD chip clock 0 as ref clock
- * and set up some more video timing generator registers
- */
- pReg->glintRegs[VTGHGateStart >> 3] = pReg->glintRegs[VTGHBlankEnd>>3] - 1;
- pReg->glintRegs[VTGHGateEnd >> 3] = pReg->glintRegs[VTGHLimit>>3] - 1;
- pReg->glintRegs[VTGSerialClk >> 3] = 0x0002;
- pReg->glintRegs[FBModeSel >> 3] = 0x907;
- pReg->glintRegs[VTGModeCtl >> 3] = 0x04;
-
- /*
- * Setup memory control registers for FB and LB
- */
- pReg->glintRegs[FBMemoryCtl >> 3] = 0x00000800;
- pReg->glintRegs[LBMemoryEDO >> 3] = GLINT_READ_REG(LBMemoryEDO);
- pReg->glintRegs[LBMemoryEDO >> 3] &= ~(LBEDOMask |
- LBEDOBankSizeMask |
- LBTwoPageDetectorMask);
- pReg->glintRegs[LBMemoryEDO >> 3] |= (LBEDOEnabled |
- LBEDOBankSize4M |
- LBTwoPageDetector);
- pReg->glintRegs[LBMemoryCtl >> 3] = GLINT_READ_REG(LBMemoryCtl);
- pReg->glintRegs[LBMemoryCtl >> 3] &= ~(LBNumBanksMask |
- LBPageSizeMask |
- LBRASCASLowMask |
- LBRASPrechargeMask |
- LBCASLowMask |
- LBPageModeMask |
- LBRefreshCountMask);
- pReg->glintRegs[LBMemoryCtl >> 3] |= (LBNumBanks2 |
- LBPageSize1024 |
- LBRASCASLow2 |
- LBRASPrecharge2 |
- LBCASLow1 |
- LBPageModeEnabled |
- (0x20 << LBRefreshCountShift));
- pReg->glintRegs[GCSRAperture >> 3] = GCSRSecondaryGLINTMapEn;
-
- /*
- * Setup HW
- *
- * Note: The order of discovery for the MX devices is dependent
- * on which way the resource allocation code decides to scan the
- * bus. This setup assumes the first MX found owns the even
- * scanlines. Should the implementation change an scan the bus
- * in the opposite direction, then simple invert the indices for
- * MXPciInfo below. If this is setup wrong, the bug will appear
- * as incorrect scanline interleaving when software rendering.
- */
- pReg->glintRegs[GMultGLINTAperture >> 3] = pGlint->realMXWidth;
- pReg->glintRegs[GMultGLINT1 >> 3] =
- pGlint->MXPciInfo[0]->memBase[2] & 0xFF800000;
- pReg->glintRegs[GMultGLINT2 >> 3] =
- pGlint->MXPciInfo[1]->memBase[2] & 0xFF800000;
-
- /* Copy info to secondary regs */
- pReg->glintSecondRegs[Aperture0>>3] = pReg->glintRegs[Aperture0>>3];
- pReg->glintSecondRegs[Aperture1>>3] = pReg->glintRegs[Aperture1>>3];
-
- pReg->glintSecondRegs[DFIFODis>>3] = pReg->glintRegs[DFIFODis>>3];
- pReg->glintSecondRegs[FIFODis>>3] = pReg->glintRegs[FIFODis>>3];
- pReg->glintSecondRegs[VTGHLimit>>3] = pReg->glintRegs[VTGHLimit>>3];
- pReg->glintSecondRegs[VTGHSyncEnd>>3] = pReg->glintRegs[VTGHSyncEnd>>3];
- pReg->glintSecondRegs[VTGHSyncStart>>3] = pReg->glintRegs[VTGHSyncStart>>3];
- pReg->glintSecondRegs[VTGHBlankEnd>>3] = pReg->glintRegs[VTGHBlankEnd>>3];
- pReg->glintSecondRegs[VTGVLimit>>3] = pReg->glintRegs[VTGVLimit>>3];
- pReg->glintSecondRegs[VTGVSyncEnd>>3] = pReg->glintRegs[VTGVSyncEnd>>3];
- pReg->glintSecondRegs[VTGVSyncStart>>3] = pReg->glintRegs[VTGVSyncStart>>3];
- pReg->glintSecondRegs[VTGVBlankEnd>>3] = pReg->glintRegs[VTGVBlankEnd>>3];
- pReg->glintSecondRegs[VTGPolarity>>3] = pReg->glintRegs[VTGPolarity>>3];
- pReg->glintSecondRegs[VClkCtl>>3] = pReg->glintRegs[VClkCtl>>3];
- pReg->glintSecondRegs[VTGVGateStart>>3] = pReg->glintRegs[VTGVGateStart>>3];
- pReg->glintSecondRegs[VTGVGateEnd>>3] = pReg->glintRegs[VTGVGateEnd>>3];
- pReg->glintSecondRegs[VTGSerialClk>>3] = pReg->glintRegs[VTGSerialClk>>3];
- pReg->glintSecondRegs[VTGHGateStart>>3] = pReg->glintRegs[VTGHGateStart>>3];
- pReg->glintSecondRegs[VTGHGateEnd>>3] = pReg->glintRegs[VTGHGateEnd>>3];
- pReg->glintSecondRegs[FBModeSel>>3] = pReg->glintRegs[FBModeSel>>3];
- pReg->glintSecondRegs[VTGModeCtl>>3] = pReg->glintRegs[VTGModeCtl>>3];
- pReg->glintSecondRegs[FBMemoryCtl>>3] = pReg->glintRegs[FBMemoryCtl>>3];
- pReg->glintSecondRegs[LBMemoryEDO>>3] = pReg->glintRegs[LBMemoryEDO>>3];
- pReg->glintSecondRegs[LBMemoryCtl>>3] = pReg->glintRegs[LBMemoryCtl>>3];
- pReg->glintSecondRegs[GCSRAperture>>3] = pReg->glintRegs[GCSRAperture>>3];
- pReg->glintSecondRegs[GMultGLINTAperture>>3] =
- pReg->glintRegs[GMultGLINTAperture>>3];
- pReg->glintSecondRegs[GMultGLINT1>>3] = pReg->glintRegs[GMultGLINT1>>3];
- pReg->glintSecondRegs[GMultGLINT2>>3] = pReg->glintRegs[GMultGLINT2>>3];
-
- switch (pGlint->RamDac->RamDacType) {
- case TI3030_RAMDAC:
- case TI3026_RAMDAC:
- {
- /* Get the programmable clock values */
- unsigned long m=0,n=0,p=0;
- unsigned long clock;
- int count;
- unsigned long q, status, VCO;
-
- clock = TIramdacCalculateMNPForClock(pGlint->RefClock,
- mode->Clock, 1, pGlint->MinClock, pGlint->MaxClock, &m, &n, &p);
-
- ramdacReg->DacRegs[TIDAC_PIXEL_N] = ((n & 0x3f) | 0xc0);
- ramdacReg->DacRegs[TIDAC_PIXEL_M] = (m & 0x3f) ;
- ramdacReg->DacRegs[TIDAC_PIXEL_P] = ((p & 0x03) | 0xb0);
- ramdacReg->DacRegs[TIDAC_PIXEL_VALID] = TRUE;
-
- if (pGlint->RamDac->RamDacType == (TI3026_RAMDAC))
- n = 65 - ((64 << 2) / pScrn->bitsPerPixel);
- else
- n = 65 - ((128 << 2) / pScrn->bitsPerPixel);
- m = 61;
- p = 0;
- for (q = 0; q < 8; q++) {
- if (q > 0) p = 3;
- for ( ; p < 4; p++) {
- VCO = ((clock * (q + 1) * (65 - m)) / (65 - n)) << (p + 1);
- if (VCO >= 110000) { break; }
- }
- if (VCO >= 110000) { break; }
- }
- ramdacReg->DacRegs[TIDAC_clock_ctrl] = (q | 0x38);
-
- ramdacReg->DacRegs[TIDAC_LOOP_N] = ((n & 0x3f) | 0xc0);
- ramdacReg->DacRegs[TIDAC_LOOP_M] = (m & 0x3f) ;
- ramdacReg->DacRegs[TIDAC_LOOP_P] = ((p & 0x03) | 0xf0);
- ramdacReg->DacRegs[TIDAC_LOOP_VALID] = TRUE;
- }
- break;
- }
-
- /* Now use helper routines to setup bpp for this driver */
- (*pGlint->RamDac->SetBpp)(pScrn, ramdacReg);
-
- return(TRUE);
-}
-
-void
-DualMXSave(ScrnInfoPtr pScrn, GLINTRegPtr glintReg)
-{
- GLINTPtr pGlint = GLINTPTR(pScrn);
-
- glintReg->glintRegs[Aperture0 >> 3] = GLINT_READ_REG(Aperture0);
- glintReg->glintRegs[Aperture1 >> 3] = GLINT_READ_REG(Aperture1);
-
- glintReg->glintRegs[DFIFODis >> 3] = GLINT_READ_REG(DFIFODis);
- glintReg->glintRegs[FIFODis >> 3] = GLINT_READ_REG(FIFODis);
-
- glintReg->glintRegs[VClkCtl >> 3] = GLINT_READ_REG(VClkCtl);
- glintReg->glintRegs[VTGPolarity >> 3] = GLINT_READ_REG(VTGPolarity);
- glintReg->glintRegs[VTGHLimit >> 3] = GLINT_READ_REG(VTGHLimit);
- glintReg->glintRegs[VTGHBlankEnd >> 3] = GLINT_READ_REG(VTGHBlankEnd);
- glintReg->glintRegs[VTGHSyncStart >> 3] = GLINT_READ_REG(VTGHSyncStart);
- glintReg->glintRegs[VTGHSyncEnd >> 3] = GLINT_READ_REG(VTGHSyncEnd);
- glintReg->glintRegs[VTGVLimit >> 3] = GLINT_READ_REG(VTGVLimit);
- glintReg->glintRegs[VTGVBlankEnd >> 3] = GLINT_READ_REG(VTGVBlankEnd);
- glintReg->glintRegs[VTGVSyncStart >> 3] = GLINT_READ_REG(VTGVSyncStart);
- glintReg->glintRegs[VTGVSyncEnd >> 3] = GLINT_READ_REG(VTGVSyncEnd);
- glintReg->glintRegs[VTGVGateStart >> 3] = GLINT_READ_REG(VTGVGateStart);
- glintReg->glintRegs[VTGVGateEnd >> 3] = GLINT_READ_REG(VTGVGateEnd);
- glintReg->glintRegs[VTGSerialClk >> 3] = GLINT_READ_REG(VTGSerialClk);
- glintReg->glintRegs[FBModeSel >> 3] = GLINT_READ_REG(FBModeSel);
- glintReg->glintRegs[VTGModeCtl >> 3] = GLINT_READ_REG(VTGModeCtl);
- glintReg->glintRegs[VTGHGateStart >> 3] = GLINT_READ_REG(VTGHGateStart);
- glintReg->glintRegs[VTGHGateEnd >> 3] = GLINT_READ_REG(VTGHGateEnd);
- glintReg->glintRegs[FBMemoryCtl >> 3] = GLINT_READ_REG(FBMemoryCtl);
- glintReg->glintRegs[LBMemoryEDO >> 3] = GLINT_READ_REG(LBMemoryEDO);
- glintReg->glintRegs[LBMemoryCtl >> 3] = GLINT_READ_REG(LBMemoryCtl);
- glintReg->glintRegs[GCSRAperture >> 3] = GLINT_READ_REG(GCSRAperture);
- glintReg->glintRegs[GMultGLINTAperture>>3] =
- GLINT_READ_REG(GMultGLINTAperture);
- glintReg->glintRegs[GMultGLINT1>>3] = GLINT_READ_REG(GMultGLINT1);
- glintReg->glintRegs[GMultGLINT2>>3] = GLINT_READ_REG(GMultGLINT2);
-
- glintReg->glintSecondRegs[Aperture0 >> 3] =
- GLINT_SECONDARY_READ_REG(Aperture0);
- glintReg->glintSecondRegs[Aperture1 >> 3] =
- GLINT_SECONDARY_READ_REG(Aperture1);
-
- glintReg->glintSecondRegs[DFIFODis >> 3] =
- GLINT_SECONDARY_READ_REG(DFIFODis);
- glintReg->glintSecondRegs[FIFODis >> 3] =
- GLINT_SECONDARY_READ_REG(FIFODis);
-
- glintReg->glintSecondRegs[VClkCtl >> 3] =
- GLINT_SECONDARY_READ_REG(VClkCtl);
- glintReg->glintSecondRegs[VTGPolarity >> 3] =
- GLINT_SECONDARY_READ_REG(VTGPolarity);
- glintReg->glintSecondRegs[VTGHLimit >> 3] =
- GLINT_SECONDARY_READ_REG(VTGHLimit);
- glintReg->glintSecondRegs[VTGHBlankEnd >> 3] =
- GLINT_SECONDARY_READ_REG(VTGHBlankEnd);
- glintReg->glintSecondRegs[VTGHSyncStart >> 3] =
- GLINT_SECONDARY_READ_REG(VTGHSyncStart);
- glintReg->glintSecondRegs[VTGHSyncEnd >> 3] =
- GLINT_SECONDARY_READ_REG(VTGHSyncEnd);
- glintReg->glintSecondRegs[VTGVLimit >> 3] =
- GLINT_SECONDARY_READ_REG(VTGVLimit);
- glintReg->glintSecondRegs[VTGVBlankEnd >> 3] =
- GLINT_SECONDARY_READ_REG(VTGVBlankEnd);
- glintReg->glintSecondRegs[VTGVSyncStart >> 3] =
- GLINT_SECONDARY_READ_REG(VTGVSyncStart);
- glintReg->glintSecondRegs[VTGVSyncEnd >> 3] =
- GLINT_SECONDARY_READ_REG(VTGVSyncEnd);
- glintReg->glintSecondRegs[VTGVGateStart >> 3] =
- GLINT_SECONDARY_READ_REG(VTGVGateStart);
- glintReg->glintSecondRegs[VTGVGateEnd >> 3] =
- GLINT_SECONDARY_READ_REG(VTGVGateEnd);
- glintReg->glintSecondRegs[VTGSerialClk >> 3] =
- GLINT_SECONDARY_READ_REG(VTGSerialClk);
- glintReg->glintSecondRegs[FBModeSel >> 3] =
- GLINT_SECONDARY_READ_REG(FBModeSel);
- glintReg->glintSecondRegs[VTGModeCtl >> 3] =
- GLINT_SECONDARY_READ_REG(VTGModeCtl);
- glintReg->glintSecondRegs[VTGHGateStart >> 3] =
- GLINT_SECONDARY_READ_REG(VTGHGateStart);
- glintReg->glintSecondRegs[VTGHGateEnd >> 3] =
- GLINT_SECONDARY_READ_REG(VTGHGateEnd);
- glintReg->glintSecondRegs[FBMemoryCtl >> 3] =
- GLINT_SECONDARY_READ_REG(FBMemoryCtl);
- glintReg->glintSecondRegs[LBMemoryEDO >> 3] =
- GLINT_SECONDARY_READ_REG(LBMemoryEDO);
- glintReg->glintSecondRegs[LBMemoryCtl >> 3] =
- GLINT_SECONDARY_READ_REG(LBMemoryCtl);
- glintReg->glintSecondRegs[GCSRAperture >> 3] =
- GLINT_SECONDARY_READ_REG(GCSRAperture);
- glintReg->glintSecondRegs[GMultGLINTAperture>>3] =
- GLINT_SECONDARY_READ_REG(GMultGLINTAperture);
- glintReg->glintSecondRegs[GMultGLINT1>>3] =
- GLINT_SECONDARY_READ_REG(GMultGLINT1);
- glintReg->glintSecondRegs[GMultGLINT2>>3] =
- GLINT_SECONDARY_READ_REG(GMultGLINT2);
-}
-
-void
-DualMXRestore(ScrnInfoPtr pScrn, GLINTRegPtr glintReg)
-{
- GLINTPtr pGlint = GLINTPTR(pScrn);
-
-#if 0
- GLINT_SLOW_WRITE_REG(0, ResetStatus);
- while(GLINT_READ_REG(ResetStatus) != 0) {
- xf86MsgVerb(X_INFO, 2, "Resetting Engine - Please Wait.\n");
- };
-#endif
-
- GLINT_SLOW_WRITE_REG(glintReg->glintRegs[Aperture0 >> 3], Aperture0);
- GLINT_SLOW_WRITE_REG(glintReg->glintRegs[Aperture1 >> 3], Aperture1);
-
- GLINT_SLOW_WRITE_REG(glintReg->glintRegs[DFIFODis >> 3], DFIFODis);
- GLINT_SLOW_WRITE_REG(glintReg->glintRegs[FIFODis >> 3], FIFODis);
-
- GLINT_SLOW_WRITE_REG(glintReg->glintRegs[VTGPolarity >> 3], VTGPolarity);
- GLINT_SLOW_WRITE_REG(glintReg->glintRegs[VTGSerialClk >> 3], VTGSerialClk);
- GLINT_SLOW_WRITE_REG(glintReg->glintRegs[VTGModeCtl >> 3], VTGModeCtl);
- GLINT_SLOW_WRITE_REG(glintReg->glintRegs[VTGHLimit >> 3], VTGHLimit);
- GLINT_SLOW_WRITE_REG(glintReg->glintRegs[VTGHSyncStart >> 3],VTGHSyncStart);
- GLINT_SLOW_WRITE_REG(glintReg->glintRegs[VTGHSyncEnd >> 3], VTGHSyncEnd);
- GLINT_SLOW_WRITE_REG(glintReg->glintRegs[VTGHBlankEnd >> 3], VTGHBlankEnd);
- GLINT_SLOW_WRITE_REG(glintReg->glintRegs[VTGVLimit >> 3], VTGVLimit);
- GLINT_SLOW_WRITE_REG(glintReg->glintRegs[VTGVSyncStart >> 3],VTGVSyncStart);
- GLINT_SLOW_WRITE_REG(glintReg->glintRegs[VTGVSyncEnd >> 3], VTGVSyncEnd);
- GLINT_SLOW_WRITE_REG(glintReg->glintRegs[VTGVBlankEnd >> 3], VTGVBlankEnd);
- GLINT_SLOW_WRITE_REG(glintReg->glintRegs[VTGVGateStart >> 3],VTGVGateStart);
- GLINT_SLOW_WRITE_REG(glintReg->glintRegs[VTGVGateEnd >> 3], VTGVGateEnd);
- GLINT_SLOW_WRITE_REG(glintReg->glintRegs[FBModeSel >> 3], FBModeSel);
- GLINT_SLOW_WRITE_REG(glintReg->glintRegs[VTGHGateStart >> 3],VTGHGateStart);
- GLINT_SLOW_WRITE_REG(glintReg->glintRegs[VTGHGateEnd >> 3], VTGHGateEnd);
- GLINT_SLOW_WRITE_REG(glintReg->glintRegs[FBMemoryCtl >> 3], FBMemoryCtl);
- GLINT_SLOW_WRITE_REG(glintReg->glintRegs[LBMemoryEDO >> 3], LBMemoryEDO);
- GLINT_SLOW_WRITE_REG(glintReg->glintRegs[LBMemoryCtl >> 3], LBMemoryCtl);
- GLINT_SLOW_WRITE_REG(glintReg->glintRegs[GCSRAperture >> 3], GCSRAperture);
- GLINT_SLOW_WRITE_REG(glintReg->glintRegs[GMultGLINTAperture >> 3],
- GMultGLINTAperture);
- GLINT_SLOW_WRITE_REG(glintReg->glintRegs[GMultGLINT1 >> 3], GMultGLINT1);
- GLINT_SLOW_WRITE_REG(glintReg->glintRegs[GMultGLINT2 >> 3], GMultGLINT2);
-
- GLINT_SECONDARY_SLOW_WRITE_REG(
- glintReg->glintSecondRegs[Aperture0 >> 3], Aperture0);
- GLINT_SECONDARY_SLOW_WRITE_REG(
- glintReg->glintSecondRegs[Aperture1 >> 3], Aperture1);
-
- GLINT_SECONDARY_SLOW_WRITE_REG(
- glintReg->glintSecondRegs[DFIFODis >> 3], DFIFODis);
- GLINT_SECONDARY_SLOW_WRITE_REG(
- glintReg->glintSecondRegs[FIFODis >> 3], FIFODis);
-
- GLINT_SECONDARY_SLOW_WRITE_REG(
- glintReg->glintSecondRegs[VTGPolarity >> 3], VTGPolarity);
- GLINT_SECONDARY_SLOW_WRITE_REG(
- glintReg->glintSecondRegs[VTGSerialClk >> 3], VTGSerialClk);
- GLINT_SECONDARY_SLOW_WRITE_REG(
- glintReg->glintSecondRegs[VTGModeCtl >> 3], VTGModeCtl);
- GLINT_SECONDARY_SLOW_WRITE_REG(
- glintReg->glintSecondRegs[VTGHLimit >> 3], VTGHLimit);
- GLINT_SECONDARY_SLOW_WRITE_REG(
- glintReg->glintSecondRegs[VTGHSyncStart >> 3],VTGHSyncStart);
- GLINT_SECONDARY_SLOW_WRITE_REG(
- glintReg->glintSecondRegs[VTGHSyncEnd >> 3], VTGHSyncEnd);
- GLINT_SECONDARY_SLOW_WRITE_REG(
- glintReg->glintSecondRegs[VTGHBlankEnd >> 3], VTGHBlankEnd);
- GLINT_SECONDARY_SLOW_WRITE_REG(
- glintReg->glintSecondRegs[VTGVLimit >> 3], VTGVLimit);
- GLINT_SECONDARY_SLOW_WRITE_REG(
- glintReg->glintSecondRegs[VTGVSyncStart >> 3],VTGVSyncStart);
- GLINT_SECONDARY_SLOW_WRITE_REG(
- glintReg->glintSecondRegs[VTGVSyncEnd >> 3], VTGVSyncEnd);
- GLINT_SECONDARY_SLOW_WRITE_REG(
- glintReg->glintSecondRegs[VTGVBlankEnd >> 3], VTGVBlankEnd);
- GLINT_SECONDARY_SLOW_WRITE_REG(
- glintReg->glintSecondRegs[VTGVGateStart >> 3],VTGVGateStart);
- GLINT_SECONDARY_SLOW_WRITE_REG(
- glintReg->glintSecondRegs[VTGVGateEnd >> 3], VTGVGateEnd);
- GLINT_SECONDARY_SLOW_WRITE_REG(
- glintReg->glintSecondRegs[FBModeSel >> 3], FBModeSel);
- GLINT_SECONDARY_SLOW_WRITE_REG(
- glintReg->glintSecondRegs[VTGHGateStart >> 3],VTGHGateStart);
- GLINT_SECONDARY_SLOW_WRITE_REG(
- glintReg->glintSecondRegs[VTGHGateEnd >> 3], VTGHGateEnd);
- GLINT_SECONDARY_SLOW_WRITE_REG(
- glintReg->glintSecondRegs[FBMemoryCtl >> 3], FBMemoryCtl);
- GLINT_SECONDARY_SLOW_WRITE_REG(
- glintReg->glintSecondRegs[LBMemoryEDO >> 3], LBMemoryEDO);
- GLINT_SECONDARY_SLOW_WRITE_REG(
- glintReg->glintSecondRegs[LBMemoryCtl >> 3], LBMemoryCtl);
- GLINT_SECONDARY_SLOW_WRITE_REG(
- glintReg->glintSecondRegs[GCSRAperture >> 3], GCSRAperture);
- GLINT_SECONDARY_SLOW_WRITE_REG(
- glintReg->glintSecondRegs[GMultGLINTAperture >>3], GMultGLINTAperture);
- GLINT_SECONDARY_SLOW_WRITE_REG(
- glintReg->glintSecondRegs[GMultGLINT1 >> 3], GMultGLINT1);
- GLINT_SECONDARY_SLOW_WRITE_REG(
- glintReg->glintSecondRegs[GMultGLINT2 >> 3], GMultGLINT2);
-}
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/glint.cpp b/xc/programs/Xserver/hw/xfree86/drivers/glint/glint.cpp
deleted file mode 100644
index 00ba3b542..000000000
--- a/xc/programs/Xserver/hw/xfree86/drivers/glint/glint.cpp
+++ /dev/null
@@ -1,114 +0,0 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/glint.cpp,v 1.10 2000/12/11 20:18:13 dawes Exp $
-.\" shorthand for double quote that works everywhere.
-.ds q \N'34'
-.TH GLINT __drivermansuffix__ "Version 4.0.2" "XFree86"
-.SH NAME
-glint \- GLINT/Permedia video driver
-.SH SYNOPSIS
-.nf
-.B "Section \*qDevice\*q"
-.BI " Identifier \*q" devname \*q
-.B " Driver \*qglint\*q"
-\ \ ...
-.B EndSection
-.fi
-.SH DESCRIPTION
-.B glint
-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.
-.SH SUPPORTED HARDWARE
-The
-.B glint
-driver supports 3Dlabs (GLINT MX, GLINT 500TX, GLINT GAMMA, Permedia,
-Permedia 2, Permedia 2v, Permedia 3) and Texas Instruments (Permedia,
-Permedia 2) chips.
-.SH CONFIGURATION DETAILS
-Please refer to XF86Config(__filemansuffix__) for general configuration
-details. This section only covers configuration details specific to this
-driver.
-.PP
-The driver auto-detects the chipset type, but the following
-.B ChipSet
-names may optionally be specified in the config file
-.B \*qDevice\*q
-section, and will override the auto-detection:
-.PP
-.RS 4
-"ti_pm2", "ti_pm", "pm3", "pm2v", "pm2", "pm", "500tx", "mx", "gamma".
-.RE
-.PP
-The driver will try to auto-detect the amount of video memory present for all
-chips. If it's not detected correctly, the actual amount of video memory should
-be specified with a
-.B VideoRam
-entry in the config file
-.B \*qDevice\*q
-section.
-.PP
-Additionally, you may need to specify the bus ID of your card with a
-.B BusID
-entry in the config file
-.B \*qDevice\*q
-section, especially with FBDev support.
-.PP
-The following driver
-.B Options
-are supported:
-.TP
-.BI "Option \*qHWCursor\*q \*q" boolean \*q
-Enable or disable the HW cursor. Default: on.
-.TP
-.BI "Option \*qSWCursor\*q \*q" boolean \*q
-Enable or disable the SW cursor. Default: off.
-This option disables the
-.B HWCursor
-option and vice versa.
-.TP
-.BI "Option \*qNoAccel\*q \*q" boolean \*q
-Disable or enable acceleration. Default: acceleration is enabled.
-.TP
-.BI "Option \*qOverlay\*q"
-Enable 8+24 overlay mode. Only appropriate for depth 24, 32 bpp.
-.RB ( Note:
-This hasn't been tested with FBDev support and probably won't work.)
-Recognized values are: "8,24", "24,8". Default: off.
-.TP
-.BI "Option \*qPciRetry\*q \*q" boolean \*q
-Enable or disable PCI retries.
-.RB ( Note:
-This doesn't work with Permedia2 based cards for Amigas.) Default: off.
-.TP
-.BI "Option \*qShadowFB\*q \*q" boolean \*q
-Enable or disable use of the shadow framebuffer layer. See
-shadowfb(__drivermansuffix__) for further information.
-.RB ( Note:
-This disables hardware acceleration.) Default: off.
-.TP
-.BI "Option \*qUseFBDev\*q \*q" boolean \*q
-Enable or disable use of an OS-specific fb interface (which is not supported
-on all OSs). See fbdevhw(__drivermansuffix__) for further information.
-Default: off.
-.ig
-.TP
-.BI "Option \*qRGBbits\*q \*q" integer \*q
-Each gun of the RGB triple can have either 8 or 10 bits. Default: 8
-..
-.TP
-.BI "Option \*qBlockWrite\*q \*q" boolean \*q
-Enable or disable block writes for the various Permedia 2 chips. This improves
-acceleration in general, but disables it for some special cases. Default: off.
-.TP
-.BI "Option \*qFireGL3000\*q \*q" boolean \*q
-If you have a card of the same name, turn this on. Default: off.
-.TP
-.BI "Option \*qSetMClk\*q \*q" freq \*q
-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 "SEE ALSO"
-XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__)
-.SH AUTHORS
-Authors include: Alan Hourihane, Dirk Hohndel, Stefan Dirsch, Michel Dänzer,
-Sven Luther
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/glint.h b/xc/programs/Xserver/hw/xfree86/drivers/glint/glint.h
index d7467a00d..52cc1f883 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/glint/glint.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/glint/glint.h
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/glint.h,v 1.37 2000/11/14 17:32:59 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/glint.h,v 1.44 2001/02/07 13:26:18 alanh Exp $ */
/*
- * Copyright 1997,1998 by Alan Hourihane <alanh@fairlite.demon.co.uk>
+ * Copyright 1997-2001 by Alan Hourihane <alanh@fairlite.demon.co.uk>
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -45,7 +45,7 @@
#include "glint_dripriv.h"
#endif
-#define GLINT_MAX_MX_DEVICES 2
+#define GLINT_MAX_MULTI_DEVICES 2
#define GLINT_VGA_MMIO_OFF 0x6000
#define VERSION 4000
@@ -57,21 +57,27 @@
typedef struct {
CARD32 glintRegs[0x2000];
- CARD32 glintSecondRegs[0x2000];
- CARD32 DacRegs[0x100]; /* used by internal DACs */
+ CARD32 DacRegs[0x100];
CARD8 cmap[0x300];
} GLINTRegRec, *GLINTRegPtr;
#define GLINTPTR(p) ((GLINTPtr)((p)->driverPrivate))
typedef struct {
+ int lastInstance;
+ int refCount;
+} GLINTEntRec, *GLINTEntPtr;
+
+typedef struct {
pciVideoPtr PciInfo;
- pciVideoPtr MXPciInfo[GLINT_MAX_MX_DEVICES];
- int numMXDevices;
+ pciVideoPtr MultiPciInfo[GLINT_MAX_MULTI_DEVICES];
+ int numMultiDevices;
+ int MultiChip;
+ Bool MultiAperture;
PCITAG PciTag;
EntityInfoPtr pEnt;
+ GLINTEntPtr entityPrivate;
RamDacHelperRecPtr RamDac;
- int MemClock;
int Chipset;
int ChipRev;
int HwBpp;
@@ -94,7 +100,7 @@ typedef struct {
int cpuheight;
int cpucount;
int planemask;
- int realMXWidth;
+ int realWidth;
CARD32 IOAddress;
unsigned long FbAddress;
int irq;
@@ -102,6 +108,7 @@ typedef struct {
unsigned char * IOBaseVGA;
unsigned char * FbBase;
long FbMapSize;
+ long IOOffset;
DGAModePtr DGAModes;
int numDGAModes;
Bool DGAactive;
@@ -110,47 +117,52 @@ typedef struct {
Bool NoAccel;
Bool FBDev;
Bool ShadowFB;
- Bool WriteBitmap;
unsigned char * ShadowPtr;
int ShadowPitch;
Bool Dac6Bit;
Bool HWCursor;
Bool ClippingOn;
- Bool UsePCIRetry;
Bool UseBlockWrite;
Bool UseFireGL3000;
+ CARD8 VGAdata[65536];
Bool VGAcore;
+ Bool STATE;
+ Bool ScanlineDirect;
int MXFbSize;
CARD32 rasterizerMode;
int MinClock;
int MaxClock;
int RefClock;
- GLINTRegRec SavedReg;
- GLINTRegRec ModeReg;
+ GLINTRegRec SavedReg[GLINT_MAX_MULTI_DEVICES];
+ GLINTRegRec ModeReg[GLINT_MAX_MULTI_DEVICES];
CARD32 AccelFlags;
CARD32 ROP;
CARD32 FrameBufferReadMode;
CARD32 BltScanDirection;
CARD32 TexMapFormat;
CARD32 PixelWidth;
+ CARD32 FIFOSize;
RamDacRecPtr RamDacRec;
xf86CursorInfoPtr CursorInfoRec;
XAAInfoRecPtr AccelInfoRec;
CloseScreenProcPtr CloseScreen;
+ ScreenBlockHandlerProcPtr BlockHandler;
GCPtr CurrentGC;
DrawablePtr CurrentDrawable;
I2CBusPtr DDCBus, VSBus;
+ CARD32 FGCursor;
+ CARD32 BGCursor;
+ CARD8 HardwareCursorPattern[1024];
CARD8* XAAScanlineColorExpandBuffers[2];
+ CARD8* ScratchBuffer;
CARD32 RasterizerSwap;
+ void (*LoadCursorCallback)(ScrnInfoPtr);
+ void (*CursorColorCallback)(ScrnInfoPtr);
+ CARD32 PM3_PixelSize;
int PM3_Config2D;
int PM3_Render2D;
int PM3_AreaStippleMode;
int PM3_VideoControl;
- Bool PM3_UseGamma;
- pciVideoPtr PM3_GammaPciInfo;
- PCITAG PM3_GammaPciTag;
- CARD32 PM3_GammaIOAddress;
- unsigned char * PM3_GammaIOBase;
#ifdef XF86DRI
Bool directRenderingEnabled;
DRIInfoPtr pDRIInfo;
@@ -212,28 +224,24 @@ void PermediaInitializeEngine(ScrnInfoPtr pScrn);
void Permedia2VRestore(ScrnInfoPtr pScrn, GLINTRegPtr glintReg);
void Permedia2VSave(ScrnInfoPtr pScrn, GLINTRegPtr glintReg);
Bool Permedia2VInit(ScrnInfoPtr pScrn, DisplayModePtr mode);
+void Permedia2VPreInit(ScrnInfoPtr pScrn);
Bool Permedia2vHWCursorInit(ScreenPtr pScreen);
-/* pm3_dac.c */
void Permedia3PreInit(ScrnInfoPtr pScrn);
int Permedia3MemorySizeDetect(ScrnInfoPtr pScrn);
void Permedia3Restore(ScrnInfoPtr pScrn, GLINTRegPtr glintReg);
void Permedia3Save(ScrnInfoPtr pScrn, GLINTRegPtr glintReg);
-Bool Permedia3Init(ScrnInfoPtr pScrn, DisplayModePtr mode);
-/* pm3_accel.c */
-/* Not needed, ... is it ever called outside of pm3_accel.c ?
-void Permedia3Sync(ScrnInfoPtr pScrn);
-*/
+Bool Permedia3Init(ScrnInfoPtr pScrn, DisplayModePtr mode, GLINTRegPtr pReg);
Bool Permedia3AccelInit(ScreenPtr pScreen);
void Permedia3InitializeEngine(ScrnInfoPtr pScrn);
-/* End of pm3 stuff */
void TXRestore(ScrnInfoPtr pScrn, GLINTRegPtr glintReg);
void TXSave(ScrnInfoPtr pScrn, GLINTRegPtr glintReg);
-Bool TXInit(ScrnInfoPtr pScrn, DisplayModePtr mode);
+Bool TXInit(ScrnInfoPtr pScrn, DisplayModePtr mode, GLINTRegPtr glintReg);
Bool TXAccelInit(ScreenPtr pScreen);
void TXInitializeEngine(ScrnInfoPtr pScrn);
+void SXInitializeEngine(ScrnInfoPtr pScrn);
Bool SXAccelInit(ScreenPtr pScreen);
void DualMXRestore(ScrnInfoPtr pScrn, GLINTRegPtr glintReg);
@@ -256,17 +264,17 @@ Bool glintIBM640HWCursorInit(ScreenPtr pScreen);
void glintOutTIIndReg(ScrnInfoPtr pScrn,
CARD32 reg, unsigned char mask, unsigned char data);
unsigned char glintInTIIndReg(ScrnInfoPtr pScrn, CARD32 reg);
-void DUALglintOutTIIndReg(ScrnInfoPtr pScrn,
+void GMX2000OutIndReg(ScrnInfoPtr pScrn,
CARD32 reg, unsigned char mask, unsigned char data);
-unsigned char DUALglintInTIIndReg(ScrnInfoPtr pScrn, CARD32 reg);
+unsigned char GMX2000InIndReg(ScrnInfoPtr pScrn, CARD32 reg);
void glintTIWriteAddress(ScrnInfoPtr pScrn, CARD32 index);
void glintTIReadAddress(ScrnInfoPtr pScrn, CARD32 index);
void glintTIWriteData(ScrnInfoPtr pScrn, unsigned char data);
unsigned char glintTIReadData(ScrnInfoPtr pScrn);
-void DUALglintTIWriteAddress(ScrnInfoPtr pScrn, CARD32 index);
-void DUALglintTIReadAddress(ScrnInfoPtr pScrn, CARD32 index);
-void DUALglintTIWriteData(ScrnInfoPtr pScrn, unsigned char data);
-unsigned char DUALglintTIReadData(ScrnInfoPtr pScrn);
+void GMX2000WriteAddress(ScrnInfoPtr pScrn, CARD32 index);
+void GMX2000ReadAddress(ScrnInfoPtr pScrn, CARD32 index);
+void GMX2000WriteData(ScrnInfoPtr pScrn, unsigned char data);
+unsigned char GMX2000ReadData(ScrnInfoPtr pScrn);
Bool glintTIHWCursorInit(ScreenPtr pScreen);
void Permedia2OutIndReg(ScrnInfoPtr pScrn,
@@ -282,6 +290,10 @@ void Permedia2LoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices,
LOCO *colors, VisualPtr pVisual);
void Permedia2LoadPalette16(ScrnInfoPtr pScrn, int numColors, int *indices,
LOCO *colors, VisualPtr pVisual);
+void Permedia3LoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices,
+ LOCO *colors, VisualPtr pVisual);
+void Permedia3LoadPalette16(ScrnInfoPtr pScrn, int numColors, int *indices,
+ LOCO *colors, VisualPtr pVisual);
void Permedia2I2CUDelay(I2CBusPtr b, int usec);
void Permedia2I2CPutBits(I2CBusPtr b, int scl, int sda);
void Permedia2I2CGetBits(I2CBusPtr b, int *scl, int *sda);
@@ -300,6 +312,8 @@ void GLINTAdjustFrame(int scrnIndex, int x, int y, int flags);
extern int partprodPermedia[];
+Bool GLINTDGAInit(ScreenPtr pScreen);
+
Bool GLINTDRIScreenInit(ScreenPtr pScreen);
Bool GLINTDRIFinishScreenInit(ScreenPtr pScreen);
void GLINTDRICloseScreen(ScreenPtr pScreen);
@@ -314,4 +328,10 @@ void GLINT_VERB_WRITE_REG(GLINTPtr, CARD32 v, int r, char *file, int line);
CARD32 GLINT_VERB_READ_REG(GLINTPtr, CARD32 r, char *file, int line);
void GLINTRefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox);
+
+void GLINT_MoveBYTE(CARD32* dest, unsigned char* src, int dwords);
+void GLINT_MoveWORDS(CARD32* dest, unsigned short* src, int dwords);
+void GLINT_MoveDWORDS(CARD32* dest, CARD32* src, int dwords);
+
+int Shiftbpp(ScrnInfoPtr pScrn, int value);
#endif /* _GLINT_H_ */
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/glint_dga.c b/xc/programs/Xserver/hw/xfree86/drivers/glint/glint_dga.c
index 2c6ed447f..a82d7da8a 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/glint/glint_dga.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/glint/glint_dga.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2000 by Alan Hourihane, Sychdyn, North Wales, UK.
+ * Copyright 2000-2001 by Alan Hourihane, Sychdyn, North Wales, UK.
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -21,7 +21,7 @@
*
* Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk>
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/glint_dga.c,v 1.1 2000/05/10 18:55:29 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/glint_dga.c,v 1.2 2001/01/31 16:14:54 alanh Exp $ */
#include "xf86.h"
#include "xf86_OSproc.h"
@@ -54,9 +54,8 @@ DGAFunctionRec GLINTDGAFuncs = {
GLINT_GetViewport,
GLINT_Sync,
GLINT_FillRect,
- NULL,
-#if 0
GLINT_BlitRect,
+#if 0
GLINT_BlitTransRect
#else
NULL
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/glint_dri.c b/xc/programs/Xserver/hw/xfree86/drivers/glint/glint_dri.c
index 6cf4650f2..2da9bb004 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/glint/glint_dri.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/glint/glint_dri.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/glint_dri.c,v 1.18 2000/06/23 23:43:43 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/glint_dri.c,v 1.21 2001/02/07 13:26:18 alanh Exp $ */
/**************************************************************************
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
@@ -305,8 +305,9 @@ GLINTInitVisualConfigs(ScreenPtr pScreen)
LBRF_FrameCountPos24 |
LBRF_GIDWidth4 |
LBRF_GIDPos32 ), LBWriteFormat);
- if (pGlint->numMXDevices == 2) {
- GLINT_SECONDARY_SLOW_WRITE_REG(
+ if (pGlint->numMultiDevices == 2) {
+ ACCESSCHIP2();
+ GLINT_SLOW_WRITE_REG(
(LBRF_DepthWidth16 |
LBRF_StencilWidth8 |
LBRF_StencilPos16 |
@@ -314,7 +315,7 @@ GLINTInitVisualConfigs(ScreenPtr pScreen)
LBRF_FrameCountPos24 |
LBRF_GIDWidth4 |
LBRF_GIDPos32 ), LBReadFormat);
- GLINT_SECONDARY_SLOW_WRITE_REG(
+ GLINT_SLOW_WRITE_REG(
(LBRF_DepthWidth16 |
LBRF_StencilWidth8 |
LBRF_StencilPos16 |
@@ -322,6 +323,7 @@ GLINTInitVisualConfigs(ScreenPtr pScreen)
LBRF_FrameCountPos24 |
LBRF_GIDWidth4 |
LBRF_GIDPos32 ), LBWriteFormat);
+ ACCESSCHIP1();
}
return TRUE;
@@ -361,7 +363,7 @@ GLINTDRIScreenInit(ScreenPtr pScreen)
if (pGlint->Chipset != PCI_VENDOR_3DLABS_CHIP_GAMMA) return FALSE;
- if (pGlint->numMXDevices > 2) return FALSE;
+ if (pGlint->numMultiDevices > 2) return FALSE;
pDRIInfo = DRICreateInfoRec();
if(pDRIInfo == NULL)
@@ -455,7 +457,7 @@ GLINTDRIScreenInit(ScreenPtr pScreen)
}
/* Tell the client driver how many MX's we have */
- pGlintDRI->numMXDevices = pGlint->numMXDevices;
+ pGlintDRI->numMultiDevices = pGlint->numMultiDevices;
/* Tell the client about our screen size setup */
pGlintDRI->pprod = pGlint->pprod;
@@ -831,68 +833,70 @@ GLINTDRISwapContext(
pRC->MX1.CFilterMode = GLINT_READ_REG(FilterMode);
pRC->MX1.CStatisticMode = GLINT_READ_REG(StatisticMode);
- if (pGlint->numMXDevices == 2) {
+ if (pGlint->numMultiDevices == 2) {
pRC->MX1.CBroadcastMask = GLINT_READ_REG(BroadcastMask);
- pRC->MX2.CStartXDom = GLINT_SECONDARY_READ_REG(StartXDom);
- pRC->MX2.CdXDom = GLINT_SECONDARY_READ_REG(dXDom);
- pRC->MX2.CStartXSub = GLINT_SECONDARY_READ_REG(StartXSub);
- pRC->MX2.CdXSub = GLINT_SECONDARY_READ_REG(dXSub);
- pRC->MX2.CStartY = GLINT_SECONDARY_READ_REG(StartY);
- pRC->MX2.CdY = GLINT_SECONDARY_READ_REG(dY);
- pRC->MX2.CGLINTCount = GLINT_SECONDARY_READ_REG(GLINTCount);
- pRC->MX2.CPointTable0 = GLINT_SECONDARY_READ_REG(PointTable0);
- pRC->MX2.CPointTable1 = GLINT_SECONDARY_READ_REG(PointTable1);
- pRC->MX2.CPointTable2 = GLINT_SECONDARY_READ_REG(PointTable2);
- pRC->MX2.CPointTable3 = GLINT_SECONDARY_READ_REG(PointTable3);
- pRC->MX2.CRasterizerMode = GLINT_SECONDARY_READ_REG(RasterizerMode);
- pRC->MX2.CYLimits = GLINT_SECONDARY_READ_REG(YLimits);
- pRC->MX2.CScanLineOwnership = GLINT_SECONDARY_READ_REG(ScanLineOwnership);
- pRC->MX2.CPixelSize = GLINT_SECONDARY_READ_REG(PixelSize);
- pRC->MX2.CScissorMode = GLINT_SECONDARY_READ_REG(ScissorMode);
- pRC->MX2.CScissorMinXY = GLINT_SECONDARY_READ_REG(ScissorMinXY);
- pRC->MX2.CScissorMaxXY = GLINT_SECONDARY_READ_REG(ScissorMaxXY);
- pRC->MX2.CScreenSize = GLINT_SECONDARY_READ_REG(ScreenSize);
- pRC->MX2.CAreaStippleMode = GLINT_SECONDARY_READ_REG(AreaStippleMode);
- pRC->MX2.CLineStippleMode = GLINT_SECONDARY_READ_REG(LineStippleMode);
- pRC->MX2.CLoadLineStippleCounters = GLINT_SECONDARY_READ_REG(LoadLineStippleCounters);
- pRC->MX2.CWindowOrigin = GLINT_SECONDARY_READ_REG(WindowOrigin);
- pRC->MX2.CRouterMode = GLINT_SECONDARY_READ_REG(RouterMode);
- pRC->MX2.CTextureAddressMode = GLINT_SECONDARY_READ_REG(TextureAddressMode);
- pRC->MX2.CTextureReadMode = GLINT_SECONDARY_READ_REG(TextureReadMode);
- pRC->MX2.CTextureColorMode = GLINT_SECONDARY_READ_REG(TextureColorMode);
- pRC->MX2.CFogMode = GLINT_SECONDARY_READ_REG(FogMode);
- pRC->MX2.CColorDDAMode = GLINT_SECONDARY_READ_REG(ColorDDAMode);
- pRC->MX2.CGLINTColor = GLINT_SECONDARY_READ_REG(GLINTColor);
- pRC->MX2.CAlphaTestMode = GLINT_SECONDARY_READ_REG(AlphaTestMode);
- pRC->MX2.CAntialiasMode = GLINT_SECONDARY_READ_REG(AntialiasMode);
- pRC->MX2.CAlphaBlendMode = GLINT_SECONDARY_READ_REG(AlphaBlendMode);
- pRC->MX2.CDitherMode = GLINT_SECONDARY_READ_REG(DitherMode);
- pRC->MX2.CFBSoftwareWriteMask = GLINT_SECONDARY_READ_REG(FBSoftwareWriteMask);
- pRC->MX2.CLogicalOpMode = GLINT_SECONDARY_READ_REG(LogicalOpMode);
- pRC->MX2.CFBWriteData = GLINT_SECONDARY_READ_REG(FBWriteData);
- pRC->MX2.CLBReadMode = GLINT_SECONDARY_READ_REG(LBReadMode);
- pRC->MX2.CLBSourceOffset = GLINT_SECONDARY_READ_REG(LBSourceOffset);
- pRC->MX2.CLBWindowBase = GLINT_SECONDARY_READ_REG(LBWindowBase);
- pRC->MX2.CLBWriteMode = GLINT_SECONDARY_READ_REG(LBWriteMode);
- pRC->MX2.CTextureDownloadOffset = GLINT_SECONDARY_READ_REG(TextureDownloadOffset);
- pRC->MX2.CLBWindowOffset = GLINT_SECONDARY_READ_REG(LBWindowOffset);
- pRC->MX2.CGLINTWindow = GLINT_SECONDARY_READ_REG(GLINTWindow);
- pRC->MX2.CStencilMode = GLINT_SECONDARY_READ_REG(StencilMode);
- pRC->MX2.CDepthMode = GLINT_SECONDARY_READ_REG(DepthMode);
- pRC->MX2.CGLINTDepth = GLINT_SECONDARY_READ_REG(GLINTDepth);
- pRC->MX2.CFBReadMode = GLINT_SECONDARY_READ_REG(FBReadMode);
- pRC->MX2.CFBSourceOffset = GLINT_SECONDARY_READ_REG(FBSourceOffset);
- pRC->MX2.CFBPixelOffset = GLINT_SECONDARY_READ_REG(FBPixelOffset);
- pRC->MX2.CFBWindowBase = GLINT_SECONDARY_READ_REG(FBWindowBase);
- pRC->MX2.CFBWriteMode = GLINT_SECONDARY_READ_REG(FBWriteMode);
- pRC->MX2.CFBHardwareWriteMask = GLINT_SECONDARY_READ_REG(FBHardwareWriteMask);
- pRC->MX2.CFBBlockColor = GLINT_SECONDARY_READ_REG(FBBlockColor);
- pRC->MX2.CPatternRamMode = GLINT_SECONDARY_READ_REG(PatternRamMode);
- pRC->MX2.CFBBlockColorU = GLINT_SECONDARY_READ_REG(FBBlockColorU);
- pRC->MX2.CFBBlockColorL = GLINT_SECONDARY_READ_REG(FBBlockColorL);
- pRC->MX2.CFilterMode = GLINT_SECONDARY_READ_REG(FilterMode);
- pRC->MX2.CStatisticMode = GLINT_SECONDARY_READ_REG(StatisticMode);
+ ACCESSCHIP2();
+ pRC->MX2.CStartXDom = GLINT_READ_REG(StartXDom);
+ pRC->MX2.CdXDom = GLINT_READ_REG(dXDom);
+ pRC->MX2.CStartXSub = GLINT_READ_REG(StartXSub);
+ pRC->MX2.CdXSub = GLINT_READ_REG(dXSub);
+ pRC->MX2.CStartY = GLINT_READ_REG(StartY);
+ pRC->MX2.CdY = GLINT_READ_REG(dY);
+ pRC->MX2.CGLINTCount = GLINT_READ_REG(GLINTCount);
+ pRC->MX2.CPointTable0 = GLINT_READ_REG(PointTable0);
+ pRC->MX2.CPointTable1 = GLINT_READ_REG(PointTable1);
+ pRC->MX2.CPointTable2 = GLINT_READ_REG(PointTable2);
+ pRC->MX2.CPointTable3 = GLINT_READ_REG(PointTable3);
+ pRC->MX2.CRasterizerMode = GLINT_READ_REG(RasterizerMode);
+ pRC->MX2.CYLimits = GLINT_READ_REG(YLimits);
+ pRC->MX2.CScanLineOwnership = GLINT_READ_REG(ScanLineOwnership);
+ pRC->MX2.CPixelSize = GLINT_READ_REG(PixelSize);
+ pRC->MX2.CScissorMode = GLINT_READ_REG(ScissorMode);
+ pRC->MX2.CScissorMinXY = GLINT_READ_REG(ScissorMinXY);
+ pRC->MX2.CScissorMaxXY = GLINT_READ_REG(ScissorMaxXY);
+ pRC->MX2.CScreenSize = GLINT_READ_REG(ScreenSize);
+ pRC->MX2.CAreaStippleMode = GLINT_READ_REG(AreaStippleMode);
+ pRC->MX2.CLineStippleMode = GLINT_READ_REG(LineStippleMode);
+ pRC->MX2.CLoadLineStippleCounters = GLINT_READ_REG(LoadLineStippleCounters);
+ pRC->MX2.CWindowOrigin = GLINT_READ_REG(WindowOrigin);
+ pRC->MX2.CRouterMode = GLINT_READ_REG(RouterMode);
+ pRC->MX2.CTextureAddressMode = GLINT_READ_REG(TextureAddressMode);
+ pRC->MX2.CTextureReadMode = GLINT_READ_REG(TextureReadMode);
+ pRC->MX2.CTextureColorMode = GLINT_READ_REG(TextureColorMode);
+ pRC->MX2.CFogMode = GLINT_READ_REG(FogMode);
+ pRC->MX2.CColorDDAMode = GLINT_READ_REG(ColorDDAMode);
+ pRC->MX2.CGLINTColor = GLINT_READ_REG(GLINTColor);
+ pRC->MX2.CAlphaTestMode = GLINT_READ_REG(AlphaTestMode);
+ pRC->MX2.CAntialiasMode = GLINT_READ_REG(AntialiasMode);
+ pRC->MX2.CAlphaBlendMode = GLINT_READ_REG(AlphaBlendMode);
+ pRC->MX2.CDitherMode = GLINT_READ_REG(DitherMode);
+ pRC->MX2.CFBSoftwareWriteMask = GLINT_READ_REG(FBSoftwareWriteMask);
+ pRC->MX2.CLogicalOpMode = GLINT_READ_REG(LogicalOpMode);
+ pRC->MX2.CFBWriteData = GLINT_READ_REG(FBWriteData);
+ pRC->MX2.CLBReadMode = GLINT_READ_REG(LBReadMode);
+ pRC->MX2.CLBSourceOffset = GLINT_READ_REG(LBSourceOffset);
+ pRC->MX2.CLBWindowBase = GLINT_READ_REG(LBWindowBase);
+ pRC->MX2.CLBWriteMode = GLINT_READ_REG(LBWriteMode);
+ pRC->MX2.CTextureDownloadOffset = GLINT_READ_REG(TextureDownloadOffset);
+ pRC->MX2.CLBWindowOffset = GLINT_READ_REG(LBWindowOffset);
+ pRC->MX2.CGLINTWindow = GLINT_READ_REG(GLINTWindow);
+ pRC->MX2.CStencilMode = GLINT_READ_REG(StencilMode);
+ pRC->MX2.CDepthMode = GLINT_READ_REG(DepthMode);
+ pRC->MX2.CGLINTDepth = GLINT_READ_REG(GLINTDepth);
+ pRC->MX2.CFBReadMode = GLINT_READ_REG(FBReadMode);
+ pRC->MX2.CFBSourceOffset = GLINT_READ_REG(FBSourceOffset);
+ pRC->MX2.CFBPixelOffset = GLINT_READ_REG(FBPixelOffset);
+ pRC->MX2.CFBWindowBase = GLINT_READ_REG(FBWindowBase);
+ pRC->MX2.CFBWriteMode = GLINT_READ_REG(FBWriteMode);
+ pRC->MX2.CFBHardwareWriteMask = GLINT_READ_REG(FBHardwareWriteMask);
+ pRC->MX2.CFBBlockColor = GLINT_READ_REG(FBBlockColor);
+ pRC->MX2.CPatternRamMode = GLINT_READ_REG(PatternRamMode);
+ pRC->MX2.CFBBlockColorU = GLINT_READ_REG(FBBlockColorU);
+ pRC->MX2.CFBBlockColorL = GLINT_READ_REG(FBBlockColorL);
+ pRC->MX2.CFilterMode = GLINT_READ_REG(FilterMode);
+ pRC->MX2.CStatisticMode = GLINT_READ_REG(StatisticMode);
+ ACCESSCHIP1();
}
if (readContextType == DRI_3D_CONTEXT) {
@@ -1020,133 +1024,135 @@ GLINTDRISwapContext(
pRC->MX1.CKdBStart = GLINT_READ_REG(KdBStart);
pRC->MX1.CdKdBdx = GLINT_READ_REG(dKdBdx);
pRC->MX1.CdKdBdyDom = GLINT_READ_REG(dKdBdyDom);
- if (pGlint->numMXDevices == 2) {
- pRC->MX2.CSStart = GLINT_SECONDARY_READ_REG(SStart);
- pRC->MX2.CdSdx = GLINT_SECONDARY_READ_REG(dSdx);
- pRC->MX2.CdSdyDom = GLINT_SECONDARY_READ_REG(dSdyDom);
- pRC->MX2.CTStart = GLINT_SECONDARY_READ_REG(TStart);
- pRC->MX2.CdTdx = GLINT_SECONDARY_READ_REG(dTdx);
- pRC->MX2.CdTdyDom = GLINT_SECONDARY_READ_REG(dTdyDom);
- pRC->MX2.CQStart = GLINT_SECONDARY_READ_REG(QStart);
- pRC->MX2.CdQdx = GLINT_SECONDARY_READ_REG(dQdx);
- pRC->MX2.CdQdyDom = GLINT_SECONDARY_READ_REG(dQdyDom);
- pRC->MX2.CLOD = GLINT_SECONDARY_READ_REG(LOD);
- pRC->MX2.CdSdy = GLINT_SECONDARY_READ_REG(dSdy);
- pRC->MX2.CdTdy = GLINT_SECONDARY_READ_REG(dTdy);
- pRC->MX2.CdQdy = GLINT_SECONDARY_READ_REG(dQdy);
- pRC->MX2.CTextureFormat = GLINT_SECONDARY_READ_REG(TextureFormat);
- pRC->MX2.CTextureCacheControl = GLINT_SECONDARY_READ_REG(TextureCacheControl);
- pRC->MX2.CGLINTBorderColor = GLINT_SECONDARY_READ_REG(GLINTBorderColor);
- pRC->MX2.CTexelLUTIndex = GLINT_SECONDARY_READ_REG(TexelLUTIndex);
- pRC->MX2.CTexelLUTData = GLINT_SECONDARY_READ_REG(TexelLUTData);
- pRC->MX2.CTexelLUTAddress = GLINT_SECONDARY_READ_REG(TexelLUTAddress);
- pRC->MX2.CTexelLUTTransfer = GLINT_SECONDARY_READ_REG(TexelLUTTransfer);
- pRC->MX2.CTextureFilterMode = GLINT_SECONDARY_READ_REG(TextureFilterMode);
- pRC->MX2.CTextureChromaUpper = GLINT_SECONDARY_READ_REG(TextureChromaUpper);
- pRC->MX2.CTextureChromaLower = GLINT_SECONDARY_READ_REG(TextureChromaLower);
- pRC->MX2.CTxBaseAddr0 = GLINT_SECONDARY_READ_REG(TxBaseAddr0);
- pRC->MX2.CTxBaseAddr1 = GLINT_SECONDARY_READ_REG(TxBaseAddr1);
- pRC->MX2.CTxBaseAddr2 = GLINT_SECONDARY_READ_REG(TxBaseAddr2);
- pRC->MX2.CTxBaseAddr3 = GLINT_SECONDARY_READ_REG(TxBaseAddr3);
- pRC->MX2.CTxBaseAddr4 = GLINT_SECONDARY_READ_REG(TxBaseAddr4);
- pRC->MX2.CTxBaseAddr5 = GLINT_SECONDARY_READ_REG(TxBaseAddr5);
- pRC->MX2.CTxBaseAddr6 = GLINT_SECONDARY_READ_REG(TxBaseAddr6);
- pRC->MX2.CTxBaseAddr7 = GLINT_SECONDARY_READ_REG(TxBaseAddr7);
- pRC->MX2.CTxBaseAddr8 = GLINT_SECONDARY_READ_REG(TxBaseAddr8);
- pRC->MX2.CTxBaseAddr9 = GLINT_SECONDARY_READ_REG(TxBaseAddr9);
- pRC->MX2.CTxBaseAddr10 = GLINT_SECONDARY_READ_REG(TxBaseAddr10);
- pRC->MX2.CTxBaseAddr11 = GLINT_SECONDARY_READ_REG(TxBaseAddr11);
- pRC->MX2.CTexelLUT0 = GLINT_SECONDARY_READ_REG(TexelLUT0);
- pRC->MX2.CTexelLUT1 = GLINT_SECONDARY_READ_REG(TexelLUT1);
- pRC->MX2.CTexelLUT2 = GLINT_SECONDARY_READ_REG(TexelLUT2);
- pRC->MX2.CTexelLUT3 = GLINT_SECONDARY_READ_REG(TexelLUT3);
- pRC->MX2.CTexelLUT4 = GLINT_SECONDARY_READ_REG(TexelLUT4);
- pRC->MX2.CTexelLUT5 = GLINT_SECONDARY_READ_REG(TexelLUT5);
- pRC->MX2.CTexelLUT6 = GLINT_SECONDARY_READ_REG(TexelLUT6);
- pRC->MX2.CTexelLUT7 = GLINT_SECONDARY_READ_REG(TexelLUT7);
- pRC->MX2.CTexelLUT8 = GLINT_SECONDARY_READ_REG(TexelLUT8);
- pRC->MX2.CTexelLUT9 = GLINT_SECONDARY_READ_REG(TexelLUT9);
- pRC->MX2.CTexelLUT10 = GLINT_SECONDARY_READ_REG(TexelLUT10);
- pRC->MX2.CTexelLUT11 = GLINT_SECONDARY_READ_REG(TexelLUT11);
- pRC->MX2.CTexelLUT12 = GLINT_SECONDARY_READ_REG(TexelLUT12);
- pRC->MX2.CTexelLUT13 = GLINT_SECONDARY_READ_REG(TexelLUT13);
- pRC->MX2.CTexelLUT14 = GLINT_SECONDARY_READ_REG(TexelLUT14);
- pRC->MX2.CTexelLUT15 = GLINT_SECONDARY_READ_REG(TexelLUT15);
- pRC->MX2.CTexel0 = GLINT_SECONDARY_READ_REG(Texel0);
- pRC->MX2.CTexel1 = GLINT_SECONDARY_READ_REG(Texel1);
- pRC->MX2.CTexel2 = GLINT_SECONDARY_READ_REG(Texel2);
- pRC->MX2.CTexel3 = GLINT_SECONDARY_READ_REG(Texel3);
- pRC->MX2.CTexel4 = GLINT_SECONDARY_READ_REG(Texel4);
- pRC->MX2.CTexel5 = GLINT_SECONDARY_READ_REG(Texel5);
- pRC->MX2.CTexel6 = GLINT_SECONDARY_READ_REG(Texel6);
- pRC->MX2.CTexel7 = GLINT_SECONDARY_READ_REG(Texel7);
- pRC->MX2.CInterp0 = GLINT_SECONDARY_READ_REG(Interp0);
- pRC->MX2.CInterp1 = GLINT_SECONDARY_READ_REG(Interp1);
- pRC->MX2.CInterp2 = GLINT_SECONDARY_READ_REG(Interp2);
- pRC->MX2.CInterp3 = GLINT_SECONDARY_READ_REG(Interp3);
- pRC->MX2.CInterp4 = GLINT_SECONDARY_READ_REG(Interp4);
- pRC->MX2.CTextureFilter = GLINT_SECONDARY_READ_REG(TextureFilter);
- pRC->MX2.CTextureEnvColor = GLINT_SECONDARY_READ_REG(TextureEnvColor);
- pRC->MX2.CFogColor = GLINT_SECONDARY_READ_REG(FogColor);
- pRC->MX2.CFStart = GLINT_SECONDARY_READ_REG(FStart);
- pRC->MX2.CdFdx = GLINT_SECONDARY_READ_REG(dFdx);
- pRC->MX2.CdFdyDom = GLINT_SECONDARY_READ_REG(dFdyDom);
- pRC->MX2.CKsStart = GLINT_SECONDARY_READ_REG(KsStart);
- pRC->MX2.CdKsdx = GLINT_SECONDARY_READ_REG(dKsdx);
- pRC->MX2.CdKsdyDom = GLINT_SECONDARY_READ_REG(dKsdyDom);
- pRC->MX2.CKdStart = GLINT_SECONDARY_READ_REG(KdStart);
- pRC->MX2.CdKdStart = GLINT_SECONDARY_READ_REG(dKdStart);
- pRC->MX2.CdKddyDom = GLINT_SECONDARY_READ_REG(dKddyDom);
- pRC->MX2.CRStart = GLINT_SECONDARY_READ_REG(RStart);
- pRC->MX2.CdRdx = GLINT_SECONDARY_READ_REG(dRdx);
- pRC->MX2.CdRdyDom = GLINT_SECONDARY_READ_REG(dRdyDom);
- pRC->MX2.CGStart = GLINT_SECONDARY_READ_REG(GStart);
- pRC->MX2.CdGdx = GLINT_SECONDARY_READ_REG(dGdx);
- pRC->MX2.CdGdyDom = GLINT_SECONDARY_READ_REG(dGdyDom);
- pRC->MX2.CBStart = GLINT_SECONDARY_READ_REG(BStart);
- pRC->MX2.CdBdx = GLINT_SECONDARY_READ_REG(dBdx);
- pRC->MX2.CdBdyDom = GLINT_SECONDARY_READ_REG(dBdyDom);
- pRC->MX2.CAStart = GLINT_SECONDARY_READ_REG(AStart);
- pRC->MX2.CdAdx = GLINT_SECONDARY_READ_REG(dAdx);
- pRC->MX2.CdAdyDom = GLINT_SECONDARY_READ_REG(dAdyDom);
- pRC->MX2.CConstantColor = GLINT_SECONDARY_READ_REG(ConstantColor);
- pRC->MX2.CChromaUpper = GLINT_SECONDARY_READ_REG(ChromaUpper);
- pRC->MX2.CChromaLower = GLINT_SECONDARY_READ_REG(ChromaLower);
- pRC->MX2.CChromaTestMode = GLINT_SECONDARY_READ_REG(ChromaTestMode);
- pRC->MX2.CStencilData = GLINT_SECONDARY_READ_REG(StencilData);
- pRC->MX2.CGLINTStencil = GLINT_SECONDARY_READ_REG(GLINTStencil);
- pRC->MX2.CZStartU = GLINT_SECONDARY_READ_REG(ZStartU);
- pRC->MX2.CZStartL = GLINT_SECONDARY_READ_REG(ZStartL);
- pRC->MX2.CdZdxU = GLINT_SECONDARY_READ_REG(dZdxU);
- pRC->MX2.CdZdxL = GLINT_SECONDARY_READ_REG(dZdxL);
- pRC->MX2.CdZdyDomU = GLINT_SECONDARY_READ_REG(dZdyDomU);
- pRC->MX2.CdZdyDomL = GLINT_SECONDARY_READ_REG(dZdyDomL);
- pRC->MX2.CFastClearDepth = GLINT_SECONDARY_READ_REG(FastClearDepth);
- pRC->MX2.CMinRegion = GLINT_SECONDARY_READ_REG(MinRegion);
- pRC->MX2.CMaxRegion = GLINT_SECONDARY_READ_REG(MaxRegion);
- pRC->MX2.CKsRStart = GLINT_SECONDARY_READ_REG(KsRStart);
- pRC->MX2.CdKsRdx = GLINT_SECONDARY_READ_REG(dKsRdx);
- pRC->MX2.CdKsRdyDom = GLINT_SECONDARY_READ_REG(dKsRdyDom);
- pRC->MX2.CKsGStart = GLINT_SECONDARY_READ_REG(KsGStart);
- pRC->MX2.CdKsGdx = GLINT_SECONDARY_READ_REG(dKsGdx);
- pRC->MX2.CdKsGdyDom = GLINT_SECONDARY_READ_REG(dKsGdyDom);
- pRC->MX2.CKsBStart = GLINT_SECONDARY_READ_REG(KsBStart);
- pRC->MX2.CdKsBdx = GLINT_SECONDARY_READ_REG(dKsBdx);
- pRC->MX2.CdKsBdyDom = GLINT_SECONDARY_READ_REG(dKsBdyDom);
- pRC->MX2.CKdRStart = GLINT_SECONDARY_READ_REG(KdRStart);
- pRC->MX2.CdKdRdx = GLINT_SECONDARY_READ_REG(dKdRdx);
- pRC->MX2.CdKdRdyDom = GLINT_SECONDARY_READ_REG(dKdRdyDom);
- pRC->MX2.CKdGStart = GLINT_SECONDARY_READ_REG(KdGStart);
- pRC->MX2.CdKdGdx = GLINT_SECONDARY_READ_REG(dKdGdx);
- pRC->MX2.CdKdGdyDom = GLINT_SECONDARY_READ_REG(dKdGdyDom);
- pRC->MX2.CKdBStart = GLINT_SECONDARY_READ_REG(KdBStart);
- pRC->MX2.CdKdBdx = GLINT_SECONDARY_READ_REG(dKdBdx);
- pRC->MX2.CdKdBdyDom = GLINT_SECONDARY_READ_REG(dKdBdyDom);
+ if (pGlint->numMultiDevices == 2) {
+ ACCESSCHIP2();
+ pRC->MX2.CSStart = GLINT_READ_REG(SStart);
+ pRC->MX2.CdSdx = GLINT_READ_REG(dSdx);
+ pRC->MX2.CdSdyDom = GLINT_READ_REG(dSdyDom);
+ pRC->MX2.CTStart = GLINT_READ_REG(TStart);
+ pRC->MX2.CdTdx = GLINT_READ_REG(dTdx);
+ pRC->MX2.CdTdyDom = GLINT_READ_REG(dTdyDom);
+ pRC->MX2.CQStart = GLINT_READ_REG(QStart);
+ pRC->MX2.CdQdx = GLINT_READ_REG(dQdx);
+ pRC->MX2.CdQdyDom = GLINT_READ_REG(dQdyDom);
+ pRC->MX2.CLOD = GLINT_READ_REG(LOD);
+ pRC->MX2.CdSdy = GLINT_READ_REG(dSdy);
+ pRC->MX2.CdTdy = GLINT_READ_REG(dTdy);
+ pRC->MX2.CdQdy = GLINT_READ_REG(dQdy);
+ pRC->MX2.CTextureFormat = GLINT_READ_REG(TextureFormat);
+ pRC->MX2.CTextureCacheControl = GLINT_READ_REG(TextureCacheControl);
+ pRC->MX2.CGLINTBorderColor = GLINT_READ_REG(GLINTBorderColor);
+ pRC->MX2.CTexelLUTIndex = GLINT_READ_REG(TexelLUTIndex);
+ pRC->MX2.CTexelLUTData = GLINT_READ_REG(TexelLUTData);
+ pRC->MX2.CTexelLUTAddress = GLINT_READ_REG(TexelLUTAddress);
+ pRC->MX2.CTexelLUTTransfer = GLINT_READ_REG(TexelLUTTransfer);
+ pRC->MX2.CTextureFilterMode = GLINT_READ_REG(TextureFilterMode);
+ pRC->MX2.CTextureChromaUpper = GLINT_READ_REG(TextureChromaUpper);
+ pRC->MX2.CTextureChromaLower = GLINT_READ_REG(TextureChromaLower);
+ pRC->MX2.CTxBaseAddr0 = GLINT_READ_REG(TxBaseAddr0);
+ pRC->MX2.CTxBaseAddr1 = GLINT_READ_REG(TxBaseAddr1);
+ pRC->MX2.CTxBaseAddr2 = GLINT_READ_REG(TxBaseAddr2);
+ pRC->MX2.CTxBaseAddr3 = GLINT_READ_REG(TxBaseAddr3);
+ pRC->MX2.CTxBaseAddr4 = GLINT_READ_REG(TxBaseAddr4);
+ pRC->MX2.CTxBaseAddr5 = GLINT_READ_REG(TxBaseAddr5);
+ pRC->MX2.CTxBaseAddr6 = GLINT_READ_REG(TxBaseAddr6);
+ pRC->MX2.CTxBaseAddr7 = GLINT_READ_REG(TxBaseAddr7);
+ pRC->MX2.CTxBaseAddr8 = GLINT_READ_REG(TxBaseAddr8);
+ pRC->MX2.CTxBaseAddr9 = GLINT_READ_REG(TxBaseAddr9);
+ pRC->MX2.CTxBaseAddr10 = GLINT_READ_REG(TxBaseAddr10);
+ pRC->MX2.CTxBaseAddr11 = GLINT_READ_REG(TxBaseAddr11);
+ pRC->MX2.CTexelLUT0 = GLINT_READ_REG(TexelLUT0);
+ pRC->MX2.CTexelLUT1 = GLINT_READ_REG(TexelLUT1);
+ pRC->MX2.CTexelLUT2 = GLINT_READ_REG(TexelLUT2);
+ pRC->MX2.CTexelLUT3 = GLINT_READ_REG(TexelLUT3);
+ pRC->MX2.CTexelLUT4 = GLINT_READ_REG(TexelLUT4);
+ pRC->MX2.CTexelLUT5 = GLINT_READ_REG(TexelLUT5);
+ pRC->MX2.CTexelLUT6 = GLINT_READ_REG(TexelLUT6);
+ pRC->MX2.CTexelLUT7 = GLINT_READ_REG(TexelLUT7);
+ pRC->MX2.CTexelLUT8 = GLINT_READ_REG(TexelLUT8);
+ pRC->MX2.CTexelLUT9 = GLINT_READ_REG(TexelLUT9);
+ pRC->MX2.CTexelLUT10 = GLINT_READ_REG(TexelLUT10);
+ pRC->MX2.CTexelLUT11 = GLINT_READ_REG(TexelLUT11);
+ pRC->MX2.CTexelLUT12 = GLINT_READ_REG(TexelLUT12);
+ pRC->MX2.CTexelLUT13 = GLINT_READ_REG(TexelLUT13);
+ pRC->MX2.CTexelLUT14 = GLINT_READ_REG(TexelLUT14);
+ pRC->MX2.CTexelLUT15 = GLINT_READ_REG(TexelLUT15);
+ pRC->MX2.CTexel0 = GLINT_READ_REG(Texel0);
+ pRC->MX2.CTexel1 = GLINT_READ_REG(Texel1);
+ pRC->MX2.CTexel2 = GLINT_READ_REG(Texel2);
+ pRC->MX2.CTexel3 = GLINT_READ_REG(Texel3);
+ pRC->MX2.CTexel4 = GLINT_READ_REG(Texel4);
+ pRC->MX2.CTexel5 = GLINT_READ_REG(Texel5);
+ pRC->MX2.CTexel6 = GLINT_READ_REG(Texel6);
+ pRC->MX2.CTexel7 = GLINT_READ_REG(Texel7);
+ pRC->MX2.CInterp0 = GLINT_READ_REG(Interp0);
+ pRC->MX2.CInterp1 = GLINT_READ_REG(Interp1);
+ pRC->MX2.CInterp2 = GLINT_READ_REG(Interp2);
+ pRC->MX2.CInterp3 = GLINT_READ_REG(Interp3);
+ pRC->MX2.CInterp4 = GLINT_READ_REG(Interp4);
+ pRC->MX2.CTextureFilter = GLINT_READ_REG(TextureFilter);
+ pRC->MX2.CTextureEnvColor = GLINT_READ_REG(TextureEnvColor);
+ pRC->MX2.CFogColor = GLINT_READ_REG(FogColor);
+ pRC->MX2.CFStart = GLINT_READ_REG(FStart);
+ pRC->MX2.CdFdx = GLINT_READ_REG(dFdx);
+ pRC->MX2.CdFdyDom = GLINT_READ_REG(dFdyDom);
+ pRC->MX2.CKsStart = GLINT_READ_REG(KsStart);
+ pRC->MX2.CdKsdx = GLINT_READ_REG(dKsdx);
+ pRC->MX2.CdKsdyDom = GLINT_READ_REG(dKsdyDom);
+ pRC->MX2.CKdStart = GLINT_READ_REG(KdStart);
+ pRC->MX2.CdKdStart = GLINT_READ_REG(dKdStart);
+ pRC->MX2.CdKddyDom = GLINT_READ_REG(dKddyDom);
+ pRC->MX2.CRStart = GLINT_READ_REG(RStart);
+ pRC->MX2.CdRdx = GLINT_READ_REG(dRdx);
+ pRC->MX2.CdRdyDom = GLINT_READ_REG(dRdyDom);
+ pRC->MX2.CGStart = GLINT_READ_REG(GStart);
+ pRC->MX2.CdGdx = GLINT_READ_REG(dGdx);
+ pRC->MX2.CdGdyDom = GLINT_READ_REG(dGdyDom);
+ pRC->MX2.CBStart = GLINT_READ_REG(BStart);
+ pRC->MX2.CdBdx = GLINT_READ_REG(dBdx);
+ pRC->MX2.CdBdyDom = GLINT_READ_REG(dBdyDom);
+ pRC->MX2.CAStart = GLINT_READ_REG(AStart);
+ pRC->MX2.CdAdx = GLINT_READ_REG(dAdx);
+ pRC->MX2.CdAdyDom = GLINT_READ_REG(dAdyDom);
+ pRC->MX2.CConstantColor = GLINT_READ_REG(ConstantColor);
+ pRC->MX2.CChromaUpper = GLINT_READ_REG(ChromaUpper);
+ pRC->MX2.CChromaLower = GLINT_READ_REG(ChromaLower);
+ pRC->MX2.CChromaTestMode = GLINT_READ_REG(ChromaTestMode);
+ pRC->MX2.CStencilData = GLINT_READ_REG(StencilData);
+ pRC->MX2.CGLINTStencil = GLINT_READ_REG(GLINTStencil);
+ pRC->MX2.CZStartU = GLINT_READ_REG(ZStartU);
+ pRC->MX2.CZStartL = GLINT_READ_REG(ZStartL);
+ pRC->MX2.CdZdxU = GLINT_READ_REG(dZdxU);
+ pRC->MX2.CdZdxL = GLINT_READ_REG(dZdxL);
+ pRC->MX2.CdZdyDomU = GLINT_READ_REG(dZdyDomU);
+ pRC->MX2.CdZdyDomL = GLINT_READ_REG(dZdyDomL);
+ pRC->MX2.CFastClearDepth = GLINT_READ_REG(FastClearDepth);
+ pRC->MX2.CMinRegion = GLINT_READ_REG(MinRegion);
+ pRC->MX2.CMaxRegion = GLINT_READ_REG(MaxRegion);
+ pRC->MX2.CKsRStart = GLINT_READ_REG(KsRStart);
+ pRC->MX2.CdKsRdx = GLINT_READ_REG(dKsRdx);
+ pRC->MX2.CdKsRdyDom = GLINT_READ_REG(dKsRdyDom);
+ pRC->MX2.CKsGStart = GLINT_READ_REG(KsGStart);
+ pRC->MX2.CdKsGdx = GLINT_READ_REG(dKsGdx);
+ pRC->MX2.CdKsGdyDom = GLINT_READ_REG(dKsGdyDom);
+ pRC->MX2.CKsBStart = GLINT_READ_REG(KsBStart);
+ pRC->MX2.CdKsBdx = GLINT_READ_REG(dKsBdx);
+ pRC->MX2.CdKsBdyDom = GLINT_READ_REG(dKsBdyDom);
+ pRC->MX2.CKdRStart = GLINT_READ_REG(KdRStart);
+ pRC->MX2.CdKdRdx = GLINT_READ_REG(dKdRdx);
+ pRC->MX2.CdKdRdyDom = GLINT_READ_REG(dKdRdyDom);
+ pRC->MX2.CKdGStart = GLINT_READ_REG(KdGStart);
+ pRC->MX2.CdKdGdx = GLINT_READ_REG(dKdGdx);
+ pRC->MX2.CdKdGdyDom = GLINT_READ_REG(dKdGdyDom);
+ pRC->MX2.CKdBStart = GLINT_READ_REG(KdBStart);
+ pRC->MX2.CdKdBdx = GLINT_READ_REG(dKdBdx);
+ pRC->MX2.CdKdBdyDom = GLINT_READ_REG(dKdBdyDom);
+ ACCESSCHIP1();
}
/* send gamma the context dump command */
GLINT_WAIT(3);
- if (pGlint->numMXDevices == 2)
+ if (pGlint->numMultiDevices == 2)
GLINT_WRITE_REG(1, BroadcastMask);
GLINT_WRITE_REG(3<<14, FilterMode); /* context bits on gamma */
GLINT_WRITE_REG(GLINT_GAMMA_CONTEXT_MASK, ContextDump);
@@ -1179,7 +1185,7 @@ dumpIndex,readValue);
readValue = GLINT_READ_REG(OutputFIFO);
GLINT_SLOW_WRITE_REG(1<<10, FilterMode);
- if (pGlint->numMXDevices == 2)
+ if (pGlint->numMultiDevices == 2)
GLINT_SLOW_WRITE_REG(3,BroadcastMask);
}
}
@@ -1191,7 +1197,7 @@ dumpIndex,readValue);
/* send context restore command */
GLINT_WAIT(1);
- if (pGlint->numMXDevices == 2)
+ if (pGlint->numMultiDevices == 2)
GLINT_WRITE_REG(1, BroadcastMask);
GLINT_WAIT(3);
@@ -1220,7 +1226,7 @@ dumpIndex,pWC->Gamma[dumpIndex]);
pGlint->AccelInfoRec->NeedToSync = TRUE;
/* finally the MX portions */
- if (pGlint->numMXDevices == 2)
+ if (pGlint->numMultiDevices == 2)
GLINT_SLOW_WRITE_REG(1, BroadcastMask);
GLINT_SLOW_WRITE_REG(pWC->MX1.CSStart, SStart);
GLINT_SLOW_WRITE_REG(pWC->MX1.CdSdx, dSdx);
@@ -1344,7 +1350,7 @@ dumpIndex,pWC->Gamma[dumpIndex]);
GLINT_SLOW_WRITE_REG(pWC->MX1.CdKdBdx, dKdBdx);
GLINT_SLOW_WRITE_REG(pWC->MX1.CdKdBdyDom, dKdBdyDom);
- if (pGlint->numMXDevices == 2) {
+ if (pGlint->numMultiDevices == 2) {
GLINT_SLOW_WRITE_REG(2, BroadcastMask);
GLINT_SLOW_WRITE_REG(pWC->MX2.CSStart, SStart);
GLINT_SLOW_WRITE_REG(pWC->MX2.CdSdx, dSdx);
@@ -1473,7 +1479,7 @@ dumpIndex,pWC->Gamma[dumpIndex]);
/* restore the 2D portion of the new context */
/* Restore MX1's registers */
- if (pGlint->numMXDevices == 2)
+ if (pGlint->numMultiDevices == 2)
GLINT_SLOW_WRITE_REG(1, BroadcastMask);
GLINT_SLOW_WRITE_REG(pWC->MX1.CStartXDom, StartXDom);
GLINT_SLOW_WRITE_REG(pWC->MX1.CdXDom, dXDom);
@@ -1536,7 +1542,7 @@ dumpIndex,pWC->Gamma[dumpIndex]);
GLINT_SLOW_WRITE_REG(pWC->MX1.CStatisticMode, StatisticMode);
/* Restore MX2's registers */
- if (pGlint->numMXDevices == 2) {
+ if (pGlint->numMultiDevices == 2) {
GLINT_SLOW_WRITE_REG(2, BroadcastMask);
GLINT_SLOW_WRITE_REG(pWC->MX2.CStartXDom, StartXDom);
GLINT_SLOW_WRITE_REG(pWC->MX2.CdXDom, dXDom);
@@ -1629,7 +1635,7 @@ GLINTDRIInitBuffers(
GLINT_WRITE_REG(0, FBWriteMode);
GLINT_WRITE_REG(0, LBWindowBase);
GLINT_WRITE_REG(1, LBWriteMode);
- if (pGlint->numMXDevices == 2) {
+ if (pGlint->numMultiDevices == 2) {
GLINT_WRITE_REG( pGlint->pprod |
LBRM_ScanlineInt2 , LBReadMode);
} else {
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/glint_dri.h b/xc/programs/Xserver/hw/xfree86/drivers/glint/glint_dri.h
index 9fe9f02de..08dc5e3b1 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/glint/glint_dri.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/glint/glint_dri.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/glint_dri.h,v 1.4 2000/05/10 18:55:29 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/glint_dri.h,v 1.5 2001/01/31 16:14:55 alanh Exp $ */
/**************************************************************************
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
@@ -50,7 +50,7 @@ typedef struct {
drmMapFlags flagsControlRegs1;
drmMapFlags flagsControlRegs2;
drmMapFlags flagsControlRegs3;
- int numMXDevices;
+ int numMultiDevices;
int pprod;
} GLINTDRIRec, *GLINTDRIPtr;
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 344381c19..638c2298c 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/glint/glint_driver.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/glint/glint_driver.c
@@ -1,5 +1,5 @@
/*
- * Copyright 1997,1998 by Alan Hourihane, Wigan, England.
+ * Copyright 1997-2001 by Alan Hourihane, Wigan, England.
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -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.103 2000/12/08 13:42:35 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/glint_driver.c,v 1.117 2001/02/15 11:03:56 alanh Exp $ */
#include "fb.h"
#include "cfb8_32.h"
@@ -53,21 +53,18 @@
#include "mibstore.h"
+#include "pm3_regs.h"
#include "glint_regs.h"
#include "IBM.h"
#include "TI.h"
#include "glint.h"
-#ifdef XFreeXDGA
#define _XF86DGA_SERVER_
#include "extensions/xf86dgastr.h"
-#endif
-#ifdef DPMSExtension
#include "globals.h"
#define DPMS_SERVER
#include "extensions/dpms.h"
-#endif
#define DEBUG 0
@@ -103,12 +100,13 @@ static Bool GLINTUnmapMem(ScrnInfoPtr pScrn);
static void GLINTSave(ScrnInfoPtr pScrn);
static void GLINTRestore(ScrnInfoPtr pScrn);
static Bool GLINTModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode);
+static void GLINTBlockHandler(int, pointer, pointer, pointer);
/*
* This is intentionally screen-independent. It indicates the binding
* choice made in the first PreInit.
*/
-static int pix24bpp = 0;
+static int GLINTEntityIndex = -1;
static Bool FBDevProbed = FALSE;
/*
@@ -122,9 +120,6 @@ static Bool FBDevProbed = FALSE;
DriverRec GLINT = {
VERSION,
GLINT_DRIVER_NAME,
-#if 0
- "accelerated driver for 3dlabs and derived chipsets",
-#endif
GLINTIdentify,
GLINTProbe,
GLINTAvailableOptions,
@@ -132,6 +127,25 @@ DriverRec GLINT = {
0
};
+static SymTabRec GLINTVGAChipsets[] = {
+ { PCI_VENDOR_TI_CHIP_PERMEDIA2, "ti_pm2" },
+ { PCI_VENDOR_TI_CHIP_PERMEDIA, "ti_pm" },
+ { PCI_VENDOR_3DLABS_CHIP_PERMEDIA3, "pm3" },
+ { PCI_VENDOR_3DLABS_CHIP_PERMEDIA2V, "pm2v" },
+ { PCI_VENDOR_3DLABS_CHIP_PERMEDIA2, "pm2" },
+ { PCI_VENDOR_3DLABS_CHIP_PERMEDIA, "pm" },
+};
+
+static PciChipsets GLINTVGAPciChipsets[] = {
+ { PCI_VENDOR_TI_CHIP_PERMEDIA2, PCI_VENDOR_TI_CHIP_PERMEDIA2, RES_SHARED_VGA },
+ { PCI_VENDOR_TI_CHIP_PERMEDIA, PCI_VENDOR_TI_CHIP_PERMEDIA, NULL },
+ { PCI_VENDOR_3DLABS_CHIP_PERMEDIA3, PCI_VENDOR_3DLABS_CHIP_PERMEDIA3, RES_SHARED_VGA },
+ { PCI_VENDOR_3DLABS_CHIP_PERMEDIA2V, PCI_VENDOR_3DLABS_CHIP_PERMEDIA2V, RES_SHARED_VGA },
+ { PCI_VENDOR_3DLABS_CHIP_PERMEDIA2, PCI_VENDOR_3DLABS_CHIP_PERMEDIA2, RES_SHARED_VGA },
+ { PCI_VENDOR_3DLABS_CHIP_PERMEDIA, PCI_VENDOR_3DLABS_CHIP_PERMEDIA, NULL },
+ { -1, -1, RES_UNDEFINED }
+};
+
static SymTabRec GLINTChipsets[] = {
{ PCI_VENDOR_3DLABS_CHIP_GAMMA, "gamma" },
{ PCI_VENDOR_TI_CHIP_PERMEDIA2, "ti_pm2" },
@@ -166,33 +180,23 @@ static PciChipsets GLINTPciChipsets[] = {
{ -1, -1, RES_UNDEFINED }
};
-
typedef enum {
OPTION_SW_CURSOR,
- OPTION_HW_CURSOR,
- OPTION_PCI_RETRY,
OPTION_RGB_BITS,
OPTION_NOACCEL,
OPTION_BLOCK_WRITE,
OPTION_FIREGL3000,
- OPTION_MEM_CLK,
OPTION_OVERLAY,
OPTION_SHADOW_FB,
- OPTION_FBDEV,
- OPTION_NOWRITEBITMAP,
- OPTION_PM3_USE_GAMMA
+ OPTION_FBDEV
} GLINTOpts;
static OptionInfoRec GLINTOptions[] = {
- { OPTION_PM3_USE_GAMMA, "UseGamma", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE },
- { OPTION_HW_CURSOR, "HWcursor", OPTV_BOOLEAN, {0}, FALSE },
- { OPTION_PCI_RETRY, "PciRetry", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_RGB_BITS, "RGBbits", OPTV_INTEGER, {0}, FALSE },
{ OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_BLOCK_WRITE, "BlockWrite", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_FIREGL3000, "FireGL3000", OPTV_BOOLEAN, {0}, FALSE },
- { OPTION_MEM_CLK, "SetMClk", OPTV_FREQ, {0}, FALSE },
{ OPTION_OVERLAY, "Overlay", OPTV_ANYSTR, {0}, FALSE },
{ OPTION_SHADOW_FB, "ShadowFB", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_FBDEV, "UseFBDev", OPTV_BOOLEAN, {0}, FALSE },
@@ -212,7 +216,6 @@ static RamDacSupportedInfoRec TIRamdacs[] = {
{ -1 }
};
-
static const char *vgahwSymbols[] = {
"vgaHWGetIndex",
"vgaHWSave",
@@ -251,9 +254,7 @@ static const char *xaaSymbols[] = {
static const char *fbSymbols[] = {
"cfb8_32ScreenInit",
-#ifdef RENDER
"fbPictureInit",
-#endif
"fbScreenInit",
"fbBres",
NULL
@@ -479,7 +480,6 @@ int partprodPermedia[] = {
-1, -1, -1, -1,
0};
-#ifdef DPMSExtension
static void
GLINTDisplayPowerManagementSet(ScrnInfoPtr pScrn, int PowerManagementMode,
int flags)
@@ -490,7 +490,8 @@ GLINTDisplayPowerManagementSet(ScrnInfoPtr pScrn, int PowerManagementMode,
if((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_500TX) ||
(pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_300SX) ||
(pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_MX) ||
- (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_GAMMA)) {
+ ((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_GAMMA) &&
+ (pGlint->MultiChip == PCI_CHIP_MX)) ) {
vtgpolarity = GLINT_READ_REG(VTGPolarity) & 0xFFFFFFF0;
} else {
videocontrol = GLINT_READ_REG(PMVideoControl) & 0xFFFFFFD6;
@@ -524,13 +525,13 @@ GLINTDisplayPowerManagementSet(ScrnInfoPtr pScrn, int PowerManagementMode,
if((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_500TX) ||
(pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_300SX) ||
(pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_MX) ||
- (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_GAMMA)) {
+ ((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_GAMMA) &&
+ (pGlint->MultiChip == PCI_CHIP_MX)) ) {
GLINT_SLOW_WRITE_REG(vtgpolarity, VTGPolarity);
} else {
GLINT_SLOW_WRITE_REG(videocontrol, PMVideoControl);
}
}
-#endif
static Bool
GLINTGetRec(ScrnInfoPtr pScrn)
@@ -686,9 +687,20 @@ GLINTProbe(DriverPtr drv, int flags)
} else if (checkusedPci) {
- numUsed = xf86MatchPciInstances(GLINT_NAME, 0,
- GLINTChipsets, GLINTPciChipsets, devSections,
- numDevSections, drv, &usedChips);
+ if (flags & PROBE_DETECT) {
+ /* HACK, Currently when -configuring, we only return VGA
+ * based chips. Manual configuring is necessary to poke
+ * at the other chips */
+ numUsed = xf86MatchPciInstances(GLINT_NAME, 0,
+ GLINTVGAChipsets, GLINTVGAPciChipsets,
+ devSections,
+ numDevSections, drv, &usedChips);
+ } else {
+ numUsed = xf86MatchPciInstances(GLINT_NAME, 0,
+ GLINTChipsets, GLINTPciChipsets, devSections,
+ numDevSections, drv, &usedChips);
+ }
+
xfree(devSections);
if (numUsed <= 0)
return FALSE;
@@ -697,51 +709,111 @@ GLINTProbe(DriverPtr drv, int flags)
if (!(flags & PROBE_DETECT))
for (i = 0; i < numUsed; i++) {
ScrnInfoPtr pScrn = NULL;
+ GLINTEntPtr pGlintEnt = NULL;
+ DevUnion *pPriv;
+ pPci = xf86GetPciInfoForEntity(usedChips[i]);
/* Allocate a ScrnInfoRec and claim the slot */
if ((pScrn = xf86ConfigPciEntity(pScrn, 0, usedChips[i],
GLINTPciChipsets, NULL,
NULL, NULL, NULL, NULL))) {
- pPci = xf86GetPciInfoForEntity(usedChips[i]);
- /* Only claim other chips when GAMMA is used */
- if (pPci->chipType == PCI_CHIP_GAMMA) {
- while (*checkusedPci != NULL) {
- int eIndex;
+ /* Claim specifics, when we KNOW ! the board */
+
+ /* Appian Jeronimo J2000 */
+ if ((pPci->subsysVendor == 0x1097) &&
+ (pPci->subsysCard == 0x3d32)) {
+ int eIndex;
+ if (!xf86IsEntityShared(usedChips[i])) {
+ eIndex = xf86ClaimPciSlot(pPci->bus,
+ pPci->device,
+ 1,
+ drv, -1 /* XXX */,
+ NULL, FALSE);
+ xf86AddEntityToScreen(pScrn,eIndex);
+ } else {
+ eIndex = xf86ClaimPciSlot(pPci->bus,
+ pPci->device,
+ 2,
+ drv, -1 /* XXX */,
+ NULL, FALSE);
+ xf86AddEntityToScreen(pScrn,eIndex);
+ }
+ } else
+ /* Only claim other chips when GAMMA is used */
+ if (pPci->chipType == PCI_CHIP_GAMMA) {
+ while (*checkusedPci != NULL) {
+ int eIndex;
/* make sure we claim all but our source device */
- if ((pPci->bus == (*checkusedPci)->bus &&
- pPci->device == (*checkusedPci)->device) &&
+ if ((pPci->bus == (*checkusedPci)->bus &&
+ pPci->device == (*checkusedPci)->device) &&
pPci->func != (*checkusedPci)->func) {
-
- /* Claim other entities on the same card */
- eIndex = xf86ClaimPciSlot((*checkusedPci)->bus,
+
+ /* Claim other entities on the same card */
+ eIndex = xf86ClaimPciSlot((*checkusedPci)->bus,
(*checkusedPci)->device,
(*checkusedPci)->func,
drv, -1 /* XXX */,
NULL, FALSE);
- if (eIndex == -1) {
- /* This can't happen */
- FatalError("someone claimed the free slot!\n");
- }
- xf86AddEntityToScreen(pScrn,eIndex);
- }
- checkusedPci++;
- }
- }
- /* Fill in what we can of the ScrnInfoRec */
- pScrn->driverVersion = VERSION;
- pScrn->driverName = GLINT_DRIVER_NAME;
- pScrn->name = GLINT_NAME;
- pScrn->Probe = GLINTProbe;
- pScrn->PreInit = GLINTPreInit;
- pScrn->ScreenInit = GLINTScreenInit;
- pScrn->SwitchMode = GLINTSwitchMode;
- pScrn->FreeScreen = GLINTFreeScreen;
- pScrn->EnterVT = GLINTEnterVT;
+ if (eIndex != -1) {
+ xf86AddEntityToScreen(pScrn,eIndex);
+ } else {
+ ErrorF("BusID %d:%d:%d already claimed\n",
+ (*checkusedPci)->bus,
+ (*checkusedPci)->device,
+ (*checkusedPci)->func);
+ xfree(usedChips);
+ return FALSE;
+ }
+ }
+ checkusedPci++;
+ }
}
- }
+
+ /* Fill in what we can of the ScrnInfoRec */
+ pScrn->driverVersion = VERSION;
+ pScrn->driverName = GLINT_DRIVER_NAME;
+ pScrn->name = GLINT_NAME;
+ pScrn->Probe = GLINTProbe;
+ pScrn->PreInit = GLINTPreInit;
+ pScrn->ScreenInit = GLINTScreenInit;
+ pScrn->SwitchMode = GLINTSwitchMode;
+ pScrn->FreeScreen = GLINTFreeScreen;
+ pScrn->EnterVT = GLINTEnterVT;
+ }
+
+ /* Allow sharing if Appian J2000 detected */
+ /* (later Diamond FireGL3000 support too) */
+
+ if ((pPci->subsysVendor == 0x1097) &&
+ (pPci->subsysCard == 0x3d32)) {
+ xf86SetEntitySharable(usedChips[i]);
+ /* Allocate an entity private if necessary */
+ if (GLINTEntityIndex < 0)
+ GLINTEntityIndex = xf86AllocateEntityPrivateIndex();
+ pPriv = xf86GetEntityPrivate(pScrn->entityList[0],
+ GLINTEntityIndex);
+ if (!pPriv->ptr) {
+ pPriv->ptr = xnfcalloc(sizeof(GLINTEntRec), 1);
+ pGlintEnt = pPriv->ptr;
+ pGlintEnt->lastInstance = -1;
+ } else {
+ pGlintEnt = pPriv->ptr;
+ }
+
+ /*
+ * Set the entity instance for this instance of the driver.
+ * For dual head per card, instance 0 is the "master"
+ * instance, driving the primary head, and instance 1 is
+ * the "slave".
+ */
+ pGlintEnt->lastInstance++;
+ xf86SetEntityInstanceForScreen(pScrn,
+ pScrn->entityList[0], pGlintEnt->lastInstance);
+ }
+ }
}
xfree(usedChips);
@@ -767,7 +839,6 @@ GetAccelPitchValues(ScrnInfoPtr pScrn)
switch (pGlint->Chipset) {
case PCI_VENDOR_TI_CHIP_PERMEDIA2:
case PCI_VENDOR_TI_CHIP_PERMEDIA:
- case PCI_VENDOR_3DLABS_CHIP_PERMEDIA3:
case PCI_VENDOR_3DLABS_CHIP_PERMEDIA2V:
case PCI_VENDOR_3DLABS_CHIP_PERMEDIA2:
case PCI_VENDOR_3DLABS_CHIP_PERMEDIA:
@@ -776,9 +847,18 @@ GetAccelPitchValues(ScrnInfoPtr pScrn)
case PCI_VENDOR_3DLABS_CHIP_500TX:
case PCI_VENDOR_3DLABS_CHIP_300SX:
case PCI_VENDOR_3DLABS_CHIP_MX:
- case PCI_VENDOR_3DLABS_CHIP_GAMMA:
linep = &partprod500TX[0];
break;
+ case PCI_VENDOR_3DLABS_CHIP_GAMMA:
+ /* When GAMMA in use, we always have MultiChip defined, even if
+ * only one chip is connected to GAMMA as the entites > 1
+ */
+ switch (pGlint->MultiChip) {
+ case PCI_CHIP_MX:
+ linep = &partprod500TX[0];
+ break;
+ }
+ break;
}
for (i = 0; linep[i] != 0; i++) {
@@ -806,21 +886,12 @@ GLINTProbeTIramdac(ScrnInfoPtr pScrn)
pGlint = GLINTPTR(pScrn);
pGlint->RamDacRec = RamDacCreateInfoRec();
- if (pGlint->numMXDevices == 2) {
- pGlint->RamDacRec->ReadDAC = DUALglintInTIIndReg;
- pGlint->RamDacRec->WriteDAC = DUALglintOutTIIndReg;
- pGlint->RamDacRec->ReadAddress = DUALglintTIReadAddress;
- pGlint->RamDacRec->WriteAddress = DUALglintTIWriteAddress;
- pGlint->RamDacRec->ReadData = DUALglintTIReadData;
- pGlint->RamDacRec->WriteData = DUALglintTIWriteData;
- } else {
- 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->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;
if(!RamDacInit(pScrn, pGlint->RamDacRec)) {
@@ -828,12 +899,12 @@ GLINTProbeTIramdac(ScrnInfoPtr pScrn)
return;
}
GLINTMapMem(pScrn);
- if (pGlint->numMXDevices == 2) {
+ if (pGlint->numMultiDevices == 2) {
temp = GLINT_READ_REG(GCSRAperture);
GLINT_SLOW_WRITE_REG(GCSRSecondaryGLINTMapEn, GCSRAperture);
}
pGlint->RamDac = TIramdacProbe(pScrn, TIRamdacs);
- if (pGlint->numMXDevices == 2) {
+ if (pGlint->numMultiDevices == 2) {
GLINT_SLOW_WRITE_REG(temp, GCSRAperture);
}
GLINTUnmapMem(pScrn);
@@ -866,10 +937,9 @@ static Bool
GLINTPreInit(ScrnInfoPtr pScrn, int flags)
{
GLINTPtr pGlint;
+ GLINTEntPtr pGlintEnt = NULL;
MessageType from;
int i;
- int LinearFramebuffer = 0;
- double real;
Bool Overlay = FALSE;
int maxwidth = 0, maxheight = 0;
ClockRangePtr clockRanges;
@@ -904,28 +974,23 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags)
/* Get the entities, and make sure they are PCI. */
pGlint->pEnt = xf86GetEntityInfo(pScrn->entityList[0]);
- if (flags & PROBE_DETECT) {
- GLINTProbeDDC(pScrn, pGlint->pEnt->index);
- return TRUE;
+ /* Allocate an entity private if necessary */
+ if (xf86IsEntityShared(pScrn->entityList[0])) {
+ pGlintEnt = xf86GetEntityPrivate(pScrn->entityList[0],
+ GLINTEntityIndex)->ptr;
+ pGlint->entityPrivate = pGlintEnt;
}
if (pGlint->pEnt->location.type == BUS_PCI)
{
- /* Initialize the card through int10 interface if needed */
- if ( xf86LoadSubModule(pScrn, "int10")){
- xf86Int10InfoPtr pInt;
-
- xf86LoaderReqSymLists(int10Symbols, NULL);
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Initializing int10\n");
- pInt = xf86InitInt10(pGlint->pEnt->index);
- xf86FreeInt10(pInt);
- }
-
pGlint->PciInfo = xf86GetPciInfoForEntity(pGlint->pEnt->index);
pGlint->PciTag = pciTag(pGlint->PciInfo->bus, pGlint->PciInfo->device,
pGlint->PciInfo->func);
}
+ pGlint->numMultiDevices = 0;
+ pGlint->IOOffset = 0; /* Set IO Offset for Gamma */
+
if (pScrn->numEntities > 1) {
pciVideoPtr pPci;
EntityInfoPtr pEnt;
@@ -933,29 +998,41 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags)
for (i = 1; i < pScrn->numEntities; i++) {
pEnt = xf86GetEntityInfo(pScrn->entityList[i]);
pPci = xf86GetPciInfoForEntity(pEnt->index);
- if (pPci->chipType == PCI_CHIP_MX) {
- if (pGlint->numMXDevices >= GLINT_MAX_MX_DEVICES) {
+ if ( (pPci->chipType == PCI_CHIP_MX) ||
+ (pPci->chipType == PCI_CHIP_PERMEDIA3) ) {
+ pGlint->MultiChip = pPci->chipType;
+ if (pGlint->numMultiDevices >= GLINT_MAX_MULTI_DEVICES) {
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
- "%d MX chips unsupported, aborting. (Max - 2)\n",
- pGlint->numMXDevices);
+ "%d multiple chips unsupported, aborting. (Max - 2)\n",
+ pGlint->numMultiDevices);
return FALSE;
} else {
- LinearFramebuffer = pPci->memBase[2];
- pGlint->MXPciInfo[pGlint->numMXDevices] = pPci;
- pGlint->numMXDevices++;
+ pGlint->MultiPciInfo[pGlint->numMultiDevices] = pPci;
+ pGlint->numMultiDevices++;
}
}
}
}
- /*
- * VGA isn't used, so mark it so. XXX Should check if any VGA resources
- * are decoded or not, and if not, change them from Unused to Disabled.
- * Mem resources seem to be disabled. This is importand to avoid conflicts
- * with DGA
- */
+ {
+ EntityInfoPtr pEnt = xf86GetEntityInfo(pScrn->entityList[0]);
+ pciVideoPtr pPci = xf86GetPciInfoForEntity(pEnt->index);
+
+ if ( (pPci->chipType == PCI_CHIP_GAMMA) &&
+ (pGlint->numMultiDevices == 0) ) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "Gamma with ZERO connected chips, aborting\n");
+ return FALSE;
+ }
+ }
+
+ if (flags & PROBE_DETECT) {
+ GLINTProbeDDC(pScrn, pGlint->pEnt->index);
+ return TRUE;
+ }
+
xf86SetOperatingState(resVgaMemShared, pGlint->pEnt->index, ResDisableOpr);
- xf86SetOperatingState(resVgaIoShared, pGlint->pEnt->index, ResUnusedOpr);
+ xf86SetOperatingState(resVgaIoShared, pGlint->pEnt->index, ResDisableOpr);
/* Operations for which memory access is required. */
pScrn->racMemFlags = RAC_FB | RAC_COLORMAP | RAC_CURSOR | RAC_VIEWPORT;
@@ -1002,10 +1079,6 @@ GLINTPreInit(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.
@@ -1058,22 +1131,14 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags)
/* Default to 8bits per RGB */
if (pScrn->depth == 30) pScrn->rgbBits = 10;
- else pScrn->rgbBits = 8;
+ else pScrn->rgbBits = 8;
if (xf86GetOptValInteger(GLINTOptions, OPTION_RGB_BITS, &pScrn->rgbBits)) {
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Bits per RGB set to %d\n",
pScrn->rgbBits);
}
- if (xf86GetOptValFreq(GLINTOptions, OPTION_MEM_CLK, OPTUNITS_MHZ, &real)) {
- pGlint->MemClock = (int)real;
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
- "Memory Clock override enabled, set to %dMHz\n",
- pGlint->MemClock);
- }
from = X_DEFAULT;
pGlint->HWCursor = TRUE; /* ON by default */
- if (xf86GetOptValBool(GLINTOptions, OPTION_HW_CURSOR, &pGlint->HWCursor))
- from = X_CONFIG;
if (xf86ReturnOptValBool(GLINTOptions, OPTION_SW_CURSOR, FALSE)) {
from = X_CONFIG;
pGlint->HWCursor = FALSE;
@@ -1127,12 +1192,6 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags)
xf86DrvMsg(pScrn->scrnIndex, from, "%s Linux framebuffer device\n",
pGlint->FBDev ? "Using" : "Not using");
- pGlint->UsePCIRetry = FALSE;
- from = X_DEFAULT;
- if (xf86GetOptValBool(GLINTOptions, OPTION_PCI_RETRY, &pGlint->UsePCIRetry))
- from = X_CONFIG;
- if (pGlint->UsePCIRetry)
- xf86DrvMsg(pScrn->scrnIndex, from, "PCI retry enabled\n");
pScrn->overlayFlags = 0;
from = X_DEFAULT;
if ((s = xf86GetOptValString(GLINTOptions, OPTION_OVERLAY))) {
@@ -1154,6 +1213,7 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags)
pGlint->VGAcore = FALSE;
pGlint->DoubleBuffer = FALSE;
pGlint->RamDac = NULL;
+ pGlint->STATE = FALSE;
/*
* Set the Chipset and ChipRev, allowing config file entries to
* override.
@@ -1208,59 +1268,7 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags)
xf86DrvMsg(pScrn->scrnIndex, from, "Chipset: \"%s\"\n", pScrn->chipset);
- /* SVEN : Claim a Gamma chip if available. */
- if (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_PERMEDIA3) {
- int eIndex = -1;
- from = X_DEFAULT;
- pGlint->PM3_UseGamma = FALSE;
- if (xf86ReturnOptValBool(GLINTOptions, OPTION_PM3_USE_GAMMA, FALSE)) {
- from = X_CONFIG;
- pGlint->PM3_UseGamma = TRUE;
- }
- xf86DrvMsg(pScrn->scrnIndex, from, "%s to use Gamma with Permedia 3.\n",
- (pGlint->PM3_UseGamma ? "Trying" : "Not trying"));
- if (pGlint->PM3_UseGamma) {
- pciVideoPtr *checkusedPci;
- checkusedPci = xf86GetPciVideoInfo();
- while (*checkusedPci != NULL) {
- /* Is there a free gamma on the same device ? */
- if (((*checkusedPci)->chipType == PCI_CHIP_GAMMA) &&
- (((*checkusedPci)->bus == pGlint->PciInfo->bus)) &&
- (((*checkusedPci)->device == pGlint->PciInfo->device)))
- if ((eIndex = xf86ClaimPciSlot((*checkusedPci)->bus,
- (*checkusedPci)->device,
- (*checkusedPci)->func,
- pScrn->drv, -1,
- NULL, FALSE)) != -1) break;
- }
- checkusedPci++;
- }
- if (eIndex == -1) {
- xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
- "No free Gamma chip was found.\n");
- pGlint->PM3_UseGamma = FALSE;
- } else {
- unsigned int r;
- /* Add the Gamma to the screen info structure. */
- xf86AddEntityToScreen(pScrn,eIndex);
- pGlint->PM3_GammaPciInfo =
- xf86GetPciInfoForEntity(eIndex);
- pGlint->PM3_GammaPciTag = pciTag(
- pGlint->PM3_GammaPciInfo->bus,
- pGlint->PM3_GammaPciInfo->device,
- pGlint->PM3_GammaPciInfo->func);
- xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
- "Gamma Claimed at BusID PCI:%d:%d:%d.\n",
- pGlint->PM3_GammaPciInfo->bus,
- pGlint->PM3_GammaPciInfo->device,
- pGlint->PM3_GammaPciInfo->func);
- /* Let's dump the Gamma registers, at least some of them ... */
- pGlint->PM3_GammaIOAddress =
- pGlint->PM3_GammaPciInfo->memBase[0] & 0xFFFFC000;
- }
- }
if ((pGlint->Chipset == PCI_VENDOR_TI_CHIP_PERMEDIA2) ||
- (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_PERMEDIA3) ||
(pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_PERMEDIA2V) ||
(pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_PERMEDIA2)) {
if (xf86ReturnOptValBool(GLINTOptions, OPTION_BLOCK_WRITE, FALSE)) {
@@ -1290,17 +1298,18 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags)
pGlint->FbAddress = pGlint->PciInfo->memBase[2] & 0xFF800000;
}
- xf86DrvMsg(pScrn->scrnIndex, from, "Linear framebuffer at 0x%lX\n",
+ if (pGlint->FbAddress)
+ xf86DrvMsg(pScrn->scrnIndex, from, "Linear framebuffer at 0x%lX\n",
(unsigned long)pGlint->FbAddress);
/* Trap GAMMA & DELTA specification, with no linear address */
- /* Find the first SX/TX/MX chip and use that address */
+ /* Find the first GLINT chip and use that address */
if (pGlint->FbAddress == 0) {
- if (LinearFramebuffer) {
- pGlint->FbAddress = LinearFramebuffer;
+ if (pGlint->MultiPciInfo[0]->memBase[2]) {
+ pGlint->FbAddress = pGlint->MultiPciInfo[0]->memBase[2];
xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
- "FrameBuffer used from first SX/TX/MX chip at 0x%x\n",
- LinearFramebuffer);
+ "FrameBuffer used from first rasterizer chip at 0x%x\n",
+ pGlint->MultiPciInfo[0]->memBase[2]);
} else {
xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
"No FrameBuffer memory - aborting\n");
@@ -1315,11 +1324,6 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags)
*/
pGlint->IOAddress = pGlint->pEnt->device->IOBase;
from = X_CONFIG;
-#if 0 /* This freezes the box, why ? */
- } else if ((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_PERMEDIA3) &&
- pGlint->PM3_UseGamma) {
- pGlint->IOAddress = pGlint->PM3_GammaPciInfo->memBase[0] & 0xFFFFC000;
-#endif
} else {
pGlint->IOAddress = pGlint->PciInfo->memBase[0] & 0xFFFFC000;
}
@@ -1327,6 +1331,21 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags)
pGlint->IOAddress += 0x10000;
#endif
+ if ((IS_J2000) && (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_GAMMA)) {
+ /* Fix up for dual head mode, offset gamma registers at 0x10000 */
+ if ((xf86IsEntityShared(pScrn->entityList[0])) &&
+ (xf86IsPrimInitDone(pScrn->entityList[0]))) {
+#if 0 /* When we need gamma & acceleration, this should be used instead */
+ pGlint->IOAddress += 0x10000;
+#endif
+ } else {
+ xf86SetPrimInitDone(pScrn->entityList[0]);
+ }
+#if 1 /* And then remove this */
+ pGlint->IOAddress = pGlint->MultiPciInfo[0]->memBase[0] & 0xFFFFC000;
+#endif
+ }
+
xf86DrvMsg(pScrn->scrnIndex, from, "MMIO registers at 0x%lX\n",
(unsigned long)pGlint->IOAddress);
@@ -1344,6 +1363,31 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags)
}
}
+ pGlint->FbMapSize = 0;
+
+ {
+ /* We have to boot some multiple head type boards here */
+ GLINTMapMem(pScrn);
+ switch (pGlint->Chipset) {
+ case PCI_VENDOR_3DLABS_CHIP_PERMEDIA3:
+ Permedia3PreInit(pScrn);
+ break;
+ case PCI_VENDOR_3DLABS_CHIP_PERMEDIA2V:
+ Permedia2VPreInit(pScrn);
+ break;
+ case PCI_VENDOR_3DLABS_CHIP_GAMMA:
+ switch (pGlint->MultiChip) {
+ case PCI_CHIP_PERMEDIA3:
+ Permedia3PreInit(pScrn);
+ break;
+ }
+ break;
+ default:
+ break;
+ }
+ GLINTUnmapMem(pScrn);
+ }
+
/* HW bpp matches reported bpp */
pGlint->HwBpp = pScrn->bitsPerPixel;
@@ -1352,32 +1396,47 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags)
if (pGlint->pEnt->device->videoRam != 0) {
pScrn->videoRam = pGlint->pEnt->device->videoRam;
from = X_CONFIG;
- } else if (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_PERMEDIA3) {
- /* Need to initialize the memory timings of the second head
- * of the Appian Jeronimo 2000 board here.
- * Check this routine in pm3_dac.c if you have another board
- * than a J2000, as memory timings will surely change.
- */
- GLINTMapMem(pScrn);
- Permedia3PreInit(pScrn);
- GLINTUnmapMem(pScrn);
- pScrn->videoRam = Permedia3MemorySizeDetect(pScrn);
- } else if (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_PERMEDIA2V) {
- /* The PM2v has the same problem detecting memory as the PM3 */
- pScrn->videoRam = Permedia3MemorySizeDetect(pScrn);
} else {
- pGlint->FbMapSize = 0; /* Need to set FbMapSize for MMIO access */
/* Need to access MMIO to determine videoRam */
GLINTMapMem(pScrn);
- if( (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_500TX) ||
- (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_300SX) ||
- (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_MX) ||
- (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_GAMMA) )
- pScrn->videoRam = 1024 * (1 << ((GLINT_READ_REG(FBMemoryCtl) &
- 0xE0000000)>>29));
- else
- pScrn->videoRam = 2048 * (((GLINT_READ_REG(PMMemConfig) >> 29) &
- 0x03) + 1);
+ switch (pGlint->Chipset) {
+ case PCI_VENDOR_3DLABS_CHIP_500TX:
+ case PCI_VENDOR_3DLABS_CHIP_300SX:
+ case PCI_VENDOR_3DLABS_CHIP_MX:
+ pScrn->videoRam = (1 << ((GLINT_READ_REG(FBMemoryCtl) &
+ 0xE0000000)>>29)) * 1024;
+ break;
+ case PCI_VENDOR_TI_CHIP_PERMEDIA2:
+ case PCI_VENDOR_TI_CHIP_PERMEDIA:
+ case PCI_VENDOR_3DLABS_CHIP_PERMEDIA:
+ case PCI_VENDOR_3DLABS_CHIP_PERMEDIA2:
+ case PCI_VENDOR_3DLABS_CHIP_PERMEDIA2V:
+ pScrn->videoRam = (((GLINT_READ_REG(PMMemConfig) >> 29) &
+ 0x03) + 1) * 2048;
+ break;
+ case PCI_VENDOR_3DLABS_CHIP_PERMEDIA3:
+ pScrn->videoRam = Permedia3MemorySizeDetect(pScrn);
+ break;
+ case PCI_VENDOR_3DLABS_CHIP_GAMMA:
+ switch (pGlint->MultiChip) {
+ case PCI_CHIP_MX:
+ xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
+ "Attached Rasterizer is GLINT MX\n");
+ pScrn->videoRam =
+ (1 << ((GLINT_READ_REG(FBMemoryCtl) &
+ 0xE0000000)>>29)) * 1024;
+ break;
+ case PCI_CHIP_PERMEDIA3:
+ xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
+ "Attached Rasterizer is Permedia3\n");
+ pScrn->videoRam = Permedia3MemorySizeDetect(pScrn);
+ break;
+ }
+ xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
+ "Number of Rasterizers attached is %d\n",
+ pGlint->numMultiDevices);
+ break;
+ }
GLINTUnmapMem(pScrn);
}
} else {
@@ -1386,61 +1445,19 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags)
pGlint->FbMapSize = pScrn->videoRam * 1024;
- /* We should move this out somewhere ! */
+ /* OVERRIDE videoRam/FbMapSize, for Multiply connected chips to GAMMA */
+ pGlint->MultiAperture = FALSE;
if ( (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_GAMMA) &&
- (pGlint->numMXDevices == 2) ) {
+ (pGlint->numMultiDevices == 2) ) {
CARD32 chipconfig;
+ CARD32 size = 0;
CARD32 temp;
GLINTMapMem(pScrn);
-#if 0
- /* We shouldn't really do this yet, we haven't saved the
- * state of the chip.
- * Best of all put a timer in to reset the engine if it
- * doesn't respond - but later */
- /*
- * This is needed before the first GLINT_SLOW_WRITE_REG --
- * otherwise the server will hang if it was left in a bad state.
- */
- GLINT_WRITE_REG(0, ResetStatus);
- while (GLINT_READ_REG(ResetStatus) & 0x80000000) {
- xf86DrvMsg(pScrn->scrnIndex, from, "Resetting Core\n");
- }
-#endif
-
temp = GLINT_READ_REG(GCSRAperture);
GLINT_SLOW_WRITE_REG(GCSRSecondaryGLINTMapEn, GCSRAperture);
-#if 0
- xf86DrvMsg(pScrn->scrnIndex, from,
- "InFIFOSpace = %d, %d (after reset)\n",
- GLINT_READ_REG(InFIFOSpace),
- GLINT_SECONDARY_READ_REG(InFIFOSpace));
- xf86DrvMsg(pScrn->scrnIndex, from,
- "OutFIFOSWords = %d, %d (after reset)\n",
- GLINT_READ_REG(OutFIFOWords),
- GLINT_SECONDARY_READ_REG(OutFIFOWords));
-
- /* Reset doesn't appear to drain the Output
- FIFO. Argh. */
- while (GLINT_READ_REG(OutFIFOWords)) {
- GLINT_READ_REG(OutputFIFO);
- }
- while (GLINT_SECONDARY_READ_REG(OutFIFOWords)) {
- GLINT_SECONDARY_READ_REG(OutputFIFO);
- }
-
- xf86DrvMsg(pScrn->scrnIndex, from,
- "InFIFOSpace = %d, %d (after drain)\n",
- GLINT_READ_REG(InFIFOSpace),
- GLINT_SECONDARY_READ_REG(InFIFOSpace));
- xf86DrvMsg(pScrn->scrnIndex, from,
- "OutFIFOSWords = %d, %d (after drain)\n",
- GLINT_READ_REG(OutFIFOWords),
- GLINT_SECONDARY_READ_REG(OutFIFOWords));
-#endif
-
chipconfig = GLINT_READ_REG(GChipConfig);
GLINT_SLOW_WRITE_REG(GCSRSecondaryGLINTMapEn, GCSRAperture);
@@ -1449,18 +1466,26 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags)
switch (chipconfig & GChipMultiGLINTApMask) {
case GChipMultiGLINTAp_0M:
- pGlint->FbMapSize = 0;
+ size = 0;
break;
case GChipMultiGLINTAp_16M:
- pGlint->FbMapSize = 16 * 1024 * 1024;
+ size = 16 * 1024 * 1024;
break;
case GChipMultiGLINTAp_32M:
- pGlint->FbMapSize = 32 * 1024 * 1024;
+ size = 32 * 1024 * 1024;
break;
case GChipMultiGLINTAp_64M:
- pGlint->FbMapSize = 64 * 1024 * 1024;
+ size = 64 * 1024 * 1024;
break;
}
+
+ if (size == 0) {
+ xf86DrvMsg(pScrn->scrnIndex, from, "MultiAperture: disabled\n");
+ } else {
+ xf86DrvMsg(pScrn->scrnIndex, from, "MultiAperture: enabled\n");
+ pGlint->FbMapSize = size;
+ pGlint->MultiAperture = TRUE;
+ }
}
xf86DrvMsg(pScrn->scrnIndex, from, "VideoRAM: %d kByte\n",
@@ -1474,6 +1499,7 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags)
switch (pGlint->Chipset) {
case PCI_VENDOR_TI_CHIP_PERMEDIA2:
case PCI_VENDOR_3DLABS_CHIP_PERMEDIA2:
+ pGlint->FIFOSize = 256;
maxheight = 2048;
maxwidth = 2048;
pGlint->RefClock = 14318;
@@ -1491,6 +1517,7 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags)
}
break;
case PCI_VENDOR_3DLABS_CHIP_PERMEDIA2V:
+ pGlint->FIFOSize = 256;
maxheight = 2048;
maxwidth = 2048;
pGlint->RefClock = 14318;
@@ -1508,6 +1535,7 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags)
}
break;
case PCI_VENDOR_3DLABS_CHIP_PERMEDIA3:
+ pGlint->FIFOSize = 120;
maxheight = 4096;
maxwidth = 4096;
pGlint->RefClock = 14318;
@@ -1539,13 +1567,7 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags)
case PCI_VENDOR_3DLABS_CHIP_500TX:
case PCI_VENDOR_3DLABS_CHIP_300SX:
case PCI_VENDOR_3DLABS_CHIP_MX:
- case PCI_VENDOR_3DLABS_CHIP_GAMMA:
- if ((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_GAMMA) &&
- pGlint->UsePCIRetry) {
- xf86DrvMsg(pScrn->scrnIndex, from,
- "GAMMA in use - PCI retries disabled\n");
- pGlint->UsePCIRetry = FALSE;
- }
+ pGlint->FIFOSize = 16;
if (pScrn->bitsPerPixel == 24) {
xf86DrvMsg(pScrn->scrnIndex, from,
"-depth 24 -pixmap24 not supported by this chip.\n");
@@ -1571,22 +1593,119 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags)
if (pGlint->RamDac->RamDacType == (IBM526DB_RAMDAC) ||
pGlint->RamDac->RamDacType == (IBM526_RAMDAC))
pGlint->RefClock = 40000;
- else {
- xf86DrvMsg(pScrn->scrnIndex, X_DEFAULT,
- "Undefined RefClock\n");
- return FALSE;
- }
}
}
if (!pGlint->RamDac)
return FALSE;
break;
+ case PCI_VENDOR_3DLABS_CHIP_GAMMA:
+ pGlint->FIFOSize = 32;
+ if (pScrn->bitsPerPixel == 24) {
+ xf86DrvMsg(pScrn->scrnIndex, from,
+ "-depth 24 -pixmap24 not supported by this chip.\n");
+ return FALSE;
+ }
+ maxheight = 4096;
+ maxwidth = 4096;
+ /* Let's do board specific stuff first */
+ if (IS_J2000) {
+ xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
+ "Appian Jeronimo 2000 board detected\n");
+ pGlint->RefClock = 14318;
+ 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;
+ }
+#if 1 /* REMOVE LATER - see other IS_J2000 fixup code */
+ /* As we push the acceleration through the pm3 (for now) we can
+ * safely set the FIFOSize to 120 again */
+ pGlint->FIFOSize = 120;
+#endif
+ break;
+ }
+ if (IS_GMX2000) {
+ xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
+ "3DLabs GMX2000 board detected\n");
+ /* We need to wrap these after detection as the second MX
+ * is the only chip that can write to the TI3030 dac */
+ ACCESSCHIP2();
+ GLINTProbeTIramdac(pScrn);
+ ACCESSCHIP1();
+ pGlint->RamDacRec->ReadDAC = GMX2000InIndReg;
+ pGlint->RamDacRec->WriteDAC = GMX2000OutIndReg;
+ pGlint->RamDacRec->ReadAddress = GMX2000ReadAddress;
+ pGlint->RamDacRec->WriteAddress = GMX2000WriteAddress;
+ pGlint->RamDacRec->ReadData = GMX2000ReadData;
+ pGlint->RamDacRec->WriteData = GMX2000WriteData;
+ pGlint->RefClock = 14318;
+ break;
+ }
+ /* Test for an TI ramdac */
+ if (!pGlint->RamDac) {
+ GLINTProbeTIramdac(pScrn);
+ if (pGlint->RamDac)
+ if ( (pGlint->RamDac->RamDacType == (TI3026_RAMDAC)) ||
+ (pGlint->RamDac->RamDacType == (TI3030_RAMDAC)) )
+ pGlint->RefClock = 14318;
+ }
+ /* Test for an IBM ramdac */
+ if (!pGlint->RamDac) {
+ GLINTProbeIBMramdac(pScrn);
+ if (pGlint->RamDac) {
+ if (pGlint->RamDac->RamDacType == (IBM640_RAMDAC))
+ pGlint->RefClock = 28322;
+ else
+ if (pGlint->RamDac->RamDacType == (IBM526DB_RAMDAC) ||
+ pGlint->RamDac->RamDacType == (IBM526_RAMDAC))
+ pGlint->RefClock = 40000;
+ }
+ }
+ if (!pGlint->RamDac) {
+ if (pGlint->MultiChip == PCI_CHIP_PERMEDIA3) {
+ pGlint->RefClock = 14318;
+ 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;
+ }
+ } else
+ if (!pGlint->RamDac)
+ return FALSE;
+ break;
}
+ if (pGlint->FIFOSize)
+ xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "FIFO Size is %d DWORDS\n",
+ pGlint->FIFOSize);
+
if (pGlint->FBDev || FBDevProbed)
pGlint->VGAcore = FALSE;
if (pGlint->VGAcore) {
+ /* Initialize the card through int10 interface if needed */
+ if ( xf86LoadSubModule(pScrn, "int10")){
+ xf86Int10InfoPtr pInt;
+
+ xf86LoaderReqSymLists(int10Symbols, NULL);
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Initializing int10\n");
+ pInt = xf86InitInt10(pGlint->pEnt->index);
+ xf86FreeInt10(pInt);
+ }
+
/* The vgahw module should be loaded here when needed */
if (!xf86LoadSubModule(pScrn, "vgahw"))
return FALSE;
@@ -1634,7 +1753,8 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags)
if((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_500TX)||
(pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_300SX) ||
(pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_MX) ||
- (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_GAMMA) )
+ ((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_GAMMA) &&
+ (pGlint->MultiChip == PCI_CHIP_MX)) )
pGlint->MaxClock = 220000;
if ( (pGlint->Chipset == PCI_VENDOR_TI_CHIP_PERMEDIA) ||
(pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_PERMEDIA) ) {
@@ -1671,7 +1791,9 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags)
break;
}
}
- if (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_PERMEDIA3)
+ if ((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_PERMEDIA3) ||
+ ((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_GAMMA) &&
+ (pGlint->MultiChip == PCI_CHIP_PERMEDIA3)) )
pGlint->MaxClock = 300000;
}
xf86DrvMsg(pScrn->scrnIndex, from, "Max pixel clock is %d MHz\n",
@@ -1698,7 +1820,9 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags)
/* Select valid modes from those available */
if ((pGlint->NoAccel) ||
- (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_PERMEDIA3)) {
+ (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_PERMEDIA3) ||
+ ((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_GAMMA) &&
+ (pGlint->MultiChip == PCI_CHIP_PERMEDIA3)) ) {
/*
* XXX Assuming min pitch 256, max <maxwidth>
* XXX Assuming min height 128, max <maxheight>
@@ -1784,9 +1908,10 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags)
if ((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_500TX) ||
(pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_300SX) ||
(pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_MX) ||
- (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_GAMMA)) {
+ ((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_GAMMA) &&
+ (pGlint->MultiChip == PCI_CHIP_MX)) ) {
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
- "GLINT SX/TX/MX chipsets only support one modeline, using first\n");
+ "This GLINT chip only supports one modeline, using first\n");
pScrn->modes->next = NULL;
pScrn->virtualX = pScrn->modes->HDisplay;
pScrn->virtualY = pScrn->modes->VDisplay;
@@ -1813,24 +1938,31 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags)
case PCI_VENDOR_3DLABS_CHIP_500TX:
case PCI_VENDOR_3DLABS_CHIP_MX:
case PCI_VENDOR_3DLABS_CHIP_300SX:
- case PCI_VENDOR_3DLABS_CHIP_GAMMA:
pGlint->pprod = partprod500TX[pScrn->displayWidth >> 5];
pGlint->bppalign = 0;
break;
+ case PCI_VENDOR_3DLABS_CHIP_GAMMA:
+ switch (pGlint->MultiChip) {
+ case PCI_CHIP_MX:
+ pGlint->pprod = partprod500TX[pScrn->displayWidth >> 5];
+ pGlint->bppalign = 0;
+ break;
+ }
+ break;
}
if ( (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_GAMMA) &&
- (pGlint->numMXDevices == 2) ) {
- int bytesPerPixel, realMXWidthBytes, inputXSpanBytes;
+ (pGlint->numMultiDevices == 2) ) {
+ int bytesPerPixel, realWidthBytes, inputXSpanBytes;
CARD32 postMultiply, productEnable, use16xProduct, inputXSpan;
CARD32 binaryEval, glintApSize;
/* setup multi glint framebuffer aperture */
bytesPerPixel = (pScrn->bitsPerPixel >> 3);
- realMXWidthBytes = pScrn->displayWidth * bytesPerPixel;
+ realWidthBytes = pScrn->displayWidth * bytesPerPixel;
/* compute Input X Span field */
- binaryEval = ((realMXWidthBytes << 1) - 1);
+ binaryEval = ((realWidthBytes << 1) - 1);
if (binaryEval & (8 << 10)) { /* 8K */
inputXSpan = 3;
inputXSpanBytes = 8 * 1024;
@@ -1849,7 +1981,7 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags)
}
/* compute post multiply */
- binaryEval = realMXWidthBytes >> 3;
+ binaryEval = realWidthBytes >> 3;
postMultiply = 0;
while ((postMultiply < 5) && !(binaryEval & 1)) {
postMultiply++;
@@ -1894,7 +2026,7 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags)
glintApSize = 0 << 10;
}
- pGlint->realMXWidth = ( glintApSize |
+ pGlint->realWidth = ( glintApSize |
postMultiply |
productEnable |
use16xProduct |
@@ -2107,14 +2239,17 @@ GLINTSave(ScrnInfoPtr pScrn)
{
GLINTPtr pGlint;
GLINTRegPtr glintReg;
+ GLINTRegPtr glintReg2;
RamDacHWRecPtr pRAMDAC;
RamDacRegRecPtr RAMDACreg;
pGlint = GLINTPTR(pScrn);
pRAMDAC = RAMDACHWPTR(pScrn);
- glintReg = &pGlint->SavedReg;
+ glintReg = &pGlint->SavedReg[0];
+ glintReg2 = &pGlint->SavedReg[1];
RAMDACreg = &pRAMDAC->SavedReg;
TRACE_ENTER("GLINTSave");
+
if (pGlint->VGAcore) {
vgaRegPtr vgaReg;
vgaReg = &VGAHWPTR(pScrn)->SavedReg;
@@ -2145,15 +2280,32 @@ GLINTSave(ScrnInfoPtr pScrn)
case PCI_VENDOR_3DLABS_CHIP_500TX:
case PCI_VENDOR_3DLABS_CHIP_300SX:
case PCI_VENDOR_3DLABS_CHIP_MX:
+ TXSave(pScrn, glintReg);
+ (*pGlint->RamDac->Save)(pScrn, pGlint->RamDacRec, RAMDACreg);
+ break;
case PCI_VENDOR_3DLABS_CHIP_GAMMA:
- if ( (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_GAMMA) &&
- (pGlint->numMXDevices == 2) ) {
- DualMXSave(pScrn, glintReg);
- }
- else {
+ switch (pGlint->MultiChip) {
+ case PCI_CHIP_MX:
+ if (pGlint->numMultiDevices == 2) {
+ ACCESSCHIP2()
+ TXSave(pScrn, glintReg2);
+#if 0
+ (*pGlint->RamDac->Save)(pScrn, pGlint->RamDacRec, RAMDACreg2);
+#endif
+ ACCESSCHIP1();
+ }
TXSave(pScrn, glintReg);
+ (*pGlint->RamDac->Save)(pScrn, pGlint->RamDacRec, RAMDACreg);
+ break;
+ case PCI_CHIP_PERMEDIA3:
+ if (pGlint->numMultiDevices == 2) {
+ ACCESSCHIP2();
+ Permedia3Save(pScrn, glintReg2);
+ ACCESSCHIP1();
+ }
+ Permedia3Save(pScrn, glintReg);
+ break;
}
- (*pGlint->RamDac->Save)(pScrn, pGlint->RamDacRec, RAMDACreg);
break;
}
TRACE_EXIT("GLINTSave");
@@ -2171,9 +2323,10 @@ GLINTModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
{
int ret = -1;
GLINTPtr pGlint = GLINTPTR(pScrn);
- GLINTRegPtr glintReg;
RamDacHWRecPtr pRAMDAC = RAMDACHWPTR(pScrn);
RamDacRegRecPtr RAMDACreg;
+ GLINTRegPtr glintReg = &pGlint->ModeReg[0];
+ GLINTRegPtr glintReg2 = &pGlint->ModeReg[1];
if (pGlint->VGAcore) {
vgaHWPtr hwp = VGAHWPTR(pScrn);
@@ -2195,7 +2348,7 @@ GLINTModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
ret = Permedia2VInit(pScrn, mode);
break;
case PCI_VENDOR_3DLABS_CHIP_PERMEDIA3:
- ret = Permedia3Init(pScrn, mode);
+ ret = Permedia3Init(pScrn, mode, glintReg);
break;
case PCI_VENDOR_TI_CHIP_PERMEDIA:
case PCI_VENDOR_3DLABS_CHIP_PERMEDIA:
@@ -2204,13 +2357,26 @@ GLINTModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
case PCI_VENDOR_3DLABS_CHIP_500TX:
case PCI_VENDOR_3DLABS_CHIP_300SX:
case PCI_VENDOR_3DLABS_CHIP_MX:
+ ret = TXInit(pScrn, mode, glintReg);
+ break;
case PCI_VENDOR_3DLABS_CHIP_GAMMA:
- if ( (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_GAMMA) &&
- (pGlint->numMXDevices == 2) ) {
- ret = DualMXInit(pScrn, mode);
- }
- else {
- ret = TXInit(pScrn, mode);
+ switch (pGlint->MultiChip) {
+ case PCI_CHIP_MX:
+ if (pGlint->numMultiDevices == 2) {
+ ACCESSCHIP2();
+ ret = TXInit(pScrn, mode, glintReg2);
+ ACCESSCHIP1();
+ }
+ ret = TXInit(pScrn, mode, glintReg);
+ break;
+ case PCI_CHIP_PERMEDIA3:
+ if (pGlint->numMultiDevices == 2) {
+ ACCESSCHIP2();
+ ret = Permedia3Init(pScrn, mode, glintReg2);
+ ACCESSCHIP1();
+ }
+ ret = Permedia3Init(pScrn, mode, glintReg);
+ break;
}
break;
}
@@ -2226,9 +2392,12 @@ GLINTModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
vgaHWRestore(pScrn, vgaReg, VGA_SR_MODE);
}
- glintReg = &pGlint->ModeReg;
+ glintReg = &pGlint->ModeReg[0];
+ glintReg2 = &pGlint->ModeReg[1];
RAMDACreg = &pRAMDAC->ModeReg;
+ pGlint->STATE = FALSE;
+
switch (pGlint->Chipset) {
case PCI_VENDOR_TI_CHIP_PERMEDIA2:
case PCI_VENDOR_3DLABS_CHIP_PERMEDIA2:
@@ -2248,15 +2417,32 @@ GLINTModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
case PCI_VENDOR_3DLABS_CHIP_500TX:
case PCI_VENDOR_3DLABS_CHIP_300SX:
case PCI_VENDOR_3DLABS_CHIP_MX:
+ TXRestore(pScrn, glintReg);
+ (*pGlint->RamDac->Restore)(pScrn, pGlint->RamDacRec, RAMDACreg);
+ break;
case PCI_VENDOR_3DLABS_CHIP_GAMMA:
- if ( (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_GAMMA) &&
- (pGlint->numMXDevices == 2) ) {
- DualMXRestore(pScrn, glintReg);
- }
- else {
+ switch (pGlint->MultiChip) {
+ case PCI_CHIP_MX:
+ if (pGlint->numMultiDevices == 2) {
+ ACCESSCHIP2();
+ TXRestore(pScrn, glintReg2);
+#if 0
+ (*pGlint->RamDac->Restore)(pScrn, pGlint->RamDacRec,RAMDACreg2);
+#endif
+ ACCESSCHIP1();
+ }
TXRestore(pScrn, glintReg);
+ (*pGlint->RamDac->Restore)(pScrn, pGlint->RamDacRec, RAMDACreg);
+ break;
+ case PCI_CHIP_PERMEDIA3:
+ if (pGlint->numMultiDevices == 2) {
+ ACCESSCHIP2();
+ Permedia3Restore(pScrn, glintReg2);
+ ACCESSCHIP1();
+ }
+ Permedia3Restore(pScrn, glintReg);
+ break;
}
- (*pGlint->RamDac->Restore)(pScrn, pGlint->RamDacRec, RAMDACreg);
break;
}
@@ -2278,12 +2464,14 @@ GLINTRestore(ScrnInfoPtr pScrn)
{
GLINTPtr pGlint;
GLINTRegPtr glintReg;
+ GLINTRegPtr glintReg2;
RamDacHWRecPtr pRAMDAC;
RamDacRegRecPtr RAMDACreg;
pGlint = GLINTPTR(pScrn);
pRAMDAC = RAMDACHWPTR(pScrn);
- glintReg = &pGlint->SavedReg;
+ glintReg = &pGlint->SavedReg[0];
+ glintReg2 = &pGlint->SavedReg[1];
RAMDACreg = &pRAMDAC->SavedReg;
TRACE_ENTER("GLINTRestore");
@@ -2312,15 +2500,32 @@ GLINTRestore(ScrnInfoPtr pScrn)
case PCI_VENDOR_3DLABS_CHIP_500TX:
case PCI_VENDOR_3DLABS_CHIP_300SX:
case PCI_VENDOR_3DLABS_CHIP_MX:
+ TXRestore(pScrn, glintReg);
+ (*pGlint->RamDac->Restore)(pScrn, pGlint->RamDacRec, RAMDACreg);
+ break;
case PCI_VENDOR_3DLABS_CHIP_GAMMA:
- if ( (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_GAMMA) &&
- (pGlint->numMXDevices == 2) ) {
- DualMXRestore(pScrn, glintReg);
- }
- else {
+ switch (pGlint->MultiChip) {
+ case PCI_CHIP_MX:
+ if (pGlint->numMultiDevices == 2) {
+ ACCESSCHIP2();
+ TXRestore(pScrn, glintReg2);
+#if 0
+ (*pGlint->RamDac->Restore)(pScrn, pGlint->RamDacRec,RAMDACreg2);
+#endif
+ ACCESSCHIP1();
+ }
TXRestore(pScrn, glintReg);
+ (*pGlint->RamDac->Restore)(pScrn, pGlint->RamDacRec, RAMDACreg);
+ break;
+ case PCI_CHIP_PERMEDIA3:
+ if (pGlint->numMultiDevices == 2) {
+ ACCESSCHIP2();
+ Permedia3Restore(pScrn, glintReg2);
+ ACCESSCHIP1();
+ }
+ Permedia3Restore(pScrn, glintReg);
+ break;
}
- (*pGlint->RamDac->Restore)(pScrn, pGlint->RamDacRec, RAMDACreg);
break;
}
@@ -2334,6 +2539,7 @@ GLINTRestore(ScrnInfoPtr pScrn)
}
vgaHWProtect(pScrn, FALSE);
}
+
TRACE_EXIT("GLINTRestore");
}
@@ -2366,19 +2572,7 @@ GLINTScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
return FALSE;
}
- /* Timing problem with PM3 & PM2V chips dont like being blasted */
- /* 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;
- } else if (pGlint->Chipset != PCI_VENDOR_3DLABS_CHIP_PERMEDIA2V)
- vgaHWSetMmioFuncs(hwp, pGlint->IOBaseVGA, 0);
+ vgaHWSetMmioFuncs(hwp, pGlint->IOBaseVGA, 0);
vgaHWGetIOBase(hwp);
}
@@ -2405,6 +2599,7 @@ GLINTScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
xf86SetDDCproperties(pScrn,xf86PrintEDID(pMon));
}
+
/* Initialise the first mode */
if ( (!pGlint->FBDev) && !(GLINTModeInit(pScrn, pScrn->currentMode))) {
xf86DrvMsg(scrnIndex, X_ERROR,
@@ -2494,10 +2689,8 @@ GLINTScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
pScrn->virtualX, pScrn->virtualY,
pScrn->xDpi, pScrn->yDpi,
displayWidth, pScrn->bitsPerPixel);
-#ifdef RENDER
if (ret)
fbPictureInit(pScreen, 0, 0);
-#endif
break;
case 32:
if(pScrn->overlayFlags & OVERLAY_8_32_PLANAR)
@@ -2510,10 +2703,8 @@ GLINTScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
pScrn->virtualX, pScrn->virtualY,
pScrn->xDpi, pScrn->yDpi,
displayWidth, pScrn->bitsPerPixel);
-#ifdef RENDER
if (ret)
fbPictureInit(pScreen, 0, 0);
-#endif
}
break;
default:
@@ -2528,6 +2719,9 @@ GLINTScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
xf86SetBlackWhitePixels(pScreen);
+ pGlint->BlockHandler = pScreen->BlockHandler;
+ pScreen->BlockHandler = GLINTBlockHandler;
+
if (!pGlint->ShadowFB)
GLINTDGAInit(pScreen);
@@ -2563,13 +2757,16 @@ GLINTScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
break;
case PCI_VENDOR_3DLABS_CHIP_500TX:
case PCI_VENDOR_3DLABS_CHIP_MX:
+ TXAccelInit(pScreen);
+ break;
case PCI_VENDOR_3DLABS_CHIP_GAMMA:
- if ( (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_GAMMA) &&
- (pGlint->numMXDevices == 2) ) {
- DualMXAccelInit(pScreen);
- }
- else {
+ switch (pGlint->MultiChip) {
+ case PCI_CHIP_MX:
TXAccelInit(pScreen);
+ break;
+ case PCI_CHIP_PERMEDIA3:
+ Permedia3AccelInit(pScreen);
+ break;
}
break;
case PCI_VENDOR_3DLABS_CHIP_300SX:
@@ -2592,7 +2789,9 @@ GLINTScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
Permedia2HWCursorInit(pScreen);
else
if ((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_PERMEDIA2V) ||
- (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_PERMEDIA3))
+ (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_PERMEDIA3) ||
+ ((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_GAMMA) &&
+ (pGlint->MultiChip == PCI_CHIP_PERMEDIA3)) )
Permedia2vHWCursorInit(pScreen);
else
/* If we get here pGlint->Ramdac should have been set */
@@ -2610,8 +2809,19 @@ GLINTScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
if (!miCreateDefColormap(pScreen))
return FALSE;
+ if ((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_PERMEDIA3) ||
+ ((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_GAMMA) &&
+ (pGlint->MultiChip == PCI_CHIP_PERMEDIA3)) ) {
+ if (!xf86HandleColormaps(pScreen, 256, pScrn->rgbBits,
+ (pGlint->FBDev) ? fbdevHWLoadPalette :
+ ((pScrn->depth == 16) ? Permedia3LoadPalette16:Permedia3LoadPalette),
+ NULL,
+ CMAP_RELOAD_ON_MODE_SWITCH |
+ ((pScrn->overlayFlags & OVERLAY_8_32_PLANAR)
+ ? 0 : CMAP_PALETTED_TRUECOLOR)))
+ return FALSE;
+ } else
if ((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_PERMEDIA2V) ||
- (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_PERMEDIA3) ||
(pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_PERMEDIA2) ||
(pGlint->Chipset == PCI_VENDOR_TI_CHIP_PERMEDIA2)) {
if (!xf86HandleColormaps(pScreen, 256, pScrn->rgbBits,
@@ -2645,9 +2855,7 @@ GLINTScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
if(pGlint->ShadowFB)
ShadowFBInit(pScreen, GLINTRefreshArea);
-#ifdef DPMSExtension
xf86DPMSInit(pScreen, (DPMSSetProcPtr)GLINTDisplayPowerManagementSet, 0);
-#endif
#ifdef XF86DRI
if (pGlint->directRenderingEnabled) {
@@ -2720,14 +2928,20 @@ GLINTSwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
PermediaInitializeEngine(pScrn);
break;
case PCI_VENDOR_3DLABS_CHIP_500TX:
- case PCI_VENDOR_3DLABS_CHIP_300SX:
case PCI_VENDOR_3DLABS_CHIP_MX:
+ TXInitializeEngine(pScrn);
+ break;
+ case PCI_VENDOR_3DLABS_CHIP_300SX:
+ SXInitializeEngine(pScrn);
+ break;
case PCI_VENDOR_3DLABS_CHIP_GAMMA:
- if ((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_GAMMA) &&
- (pGlint->numMXDevices == 2)) {
- DualMXInitializeEngine(pScrn);
- } else {
- TXInitializeEngine(pScrn);
+ switch (pGlint->MultiChip) {
+ case PCI_CHIP_MX:
+ TXInitializeEngine(pScrn);
+ break;
+ case PCI_CHIP_PERMEDIA3:
+ Permedia3InitializeEngine(pScrn);
+ break;
}
break;
}
@@ -2774,9 +2988,18 @@ GLINTAdjustFrame(int scrnIndex, int x, int y, int flags)
case PCI_VENDOR_TI_CHIP_PERMEDIA2:
case PCI_VENDOR_3DLABS_CHIP_PERMEDIA2:
case PCI_VENDOR_3DLABS_CHIP_PERMEDIA2V:
+ GLINT_SLOW_WRITE_REG(base, PMScreenBase);
+ break;
case PCI_VENDOR_3DLABS_CHIP_PERMEDIA3:
+ base = (y * pScrn->displayWidth + x) >> pGlint->BppShift;
GLINT_SLOW_WRITE_REG(base, PMScreenBase);
break;
+ case PCI_VENDOR_3DLABS_CHIP_GAMMA:
+ if (pGlint->MultiChip == PCI_CHIP_PERMEDIA3) {
+ base = (y * pScrn->displayWidth + x) >> pGlint->BppShift;
+ GLINT_SLOW_WRITE_REG(base, PMScreenBase);
+ }
+ break;
}
TRACE_EXIT("GLINTAdjustFrame (normal)");
}
@@ -2827,14 +3050,20 @@ GLINTEnterVT(int scrnIndex, int flags)
PermediaInitializeEngine(pScrn);
break;
case PCI_VENDOR_3DLABS_CHIP_500TX:
- case PCI_VENDOR_3DLABS_CHIP_300SX:
case PCI_VENDOR_3DLABS_CHIP_MX:
+ TXInitializeEngine(pScrn);
+ break;
+ case PCI_VENDOR_3DLABS_CHIP_300SX:
+ SXInitializeEngine(pScrn);
+ break;
case PCI_VENDOR_3DLABS_CHIP_GAMMA:
- if ( (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_GAMMA) &&
- (pGlint->numMXDevices == 2) ) {
- DualMXInitializeEngine(pScrn);
- } else {
- TXInitializeEngine(pScrn);
+ switch (pGlint->MultiChip) {
+ case PCI_CHIP_MX:
+ TXInitializeEngine(pScrn);
+ break;
+ case PCI_CHIP_PERMEDIA3:
+ Permedia3InitializeEngine(pScrn);
+ break;
}
break;
}
@@ -2860,6 +3089,7 @@ GLINTLeaveVT(int scrnIndex, int flags)
GLINTPtr pGlint = GLINTPTR(pScrn);
TRACE_ENTER("GLINTLeaveVT");
+ pGlint->STATE = TRUE;
GLINTRestore(pScrn);
if (pGlint->VGAcore)
vgaHWLock(VGAHWPTR(pScrn));
@@ -2903,6 +3133,7 @@ GLINTCloseScreen(int scrnIndex, ScreenPtr pScreen)
if (pGlint->FBDev)
fbdevHWRestore(pScrn);
else {
+ pGlint->STATE = TRUE;
GLINTRestore(pScrn);
if (pGlint->VGAcore)
vgaHWLock(VGAHWPTR(pScrn));
@@ -2917,11 +3148,16 @@ GLINTCloseScreen(int scrnIndex, ScreenPtr pScreen)
xfree(pGlint->ShadowPtr);
if (pGlint->DGAModes)
xfree(pGlint->DGAModes);
+ if (pGlint->ScratchBuffer)
+ xfree(pGlint->ScratchBuffer);
pScrn->vtSema = FALSE;
if (xf86IsPc98())
outb(0xfac, 0x00);
+ if(pGlint->BlockHandler)
+ pScreen->BlockHandler = pGlint->BlockHandler;
+
pScreen->CloseScreen = pGlint->CloseScreen;
TRACE_EXIT("GLINTCloseScreen");
return (*pScreen->CloseScreen)(scrnIndex, pScreen);
@@ -2934,15 +3170,12 @@ GLINTCloseScreen(int scrnIndex, ScreenPtr pScreen)
static void
GLINTFreeScreen(int scrnIndex, int flags)
{
- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
- GLINTPtr pGlint = GLINTPTR(pScrn);
-
TRACE_ENTER("GLINTFreeScreen");
- if ((pGlint->FBDev || FBDevProbed) && xf86LoaderCheckSymbol("fbdevHWFreeRec"))
+ if (xf86LoaderCheckSymbol("fbdevHWFreeRec"))
fbdevHWFreeRec(xf86Screens[scrnIndex]);
- if (pGlint->VGAcore && xf86LoaderCheckSymbol("vgaHWFreeHWRec"))
+ if (xf86LoaderCheckSymbol("vgaHWFreeHWRec"))
vgaHWFreeHWRec(xf86Screens[scrnIndex]);
- if (pGlint->RamDacRec && xf86LoaderCheckSymbol("RamDacFreeRec"))
+ if (xf86LoaderCheckSymbol("RamDacFreeRec"))
RamDacFreeRec(xf86Screens[scrnIndex]);
GLINTFreeRec(xf86Screens[scrnIndex]);
TRACE_EXIT("GLINTFreeScreen");
@@ -3038,6 +3271,14 @@ GLINTSaveScreen(ScreenPtr pScreen, int mode)
case PCI_VENDOR_3DLABS_CHIP_300SX:
case PCI_VENDOR_3DLABS_CHIP_MX:
break;
+ case PCI_VENDOR_3DLABS_CHIP_GAMMA:
+ if (pGlint->MultiChip == PCI_CHIP_PERMEDIA3) {
+ temp = GLINT_READ_REG(PMVideoControl);
+ if (unblank) temp |= 1;
+ else temp &= 0xFFFFFFFE;
+ GLINT_SLOW_WRITE_REG(temp, PMVideoControl);
+ }
+ break;
}
}
@@ -3045,22 +3286,174 @@ GLINTSaveScreen(ScreenPtr pScreen, int mode)
return TRUE;
}
+static void
+GLINTBlockHandler (
+ int i,
+ pointer blockData,
+ pointer pTimeout,
+ pointer pReadmask
+){
+ ScreenPtr pScreen = screenInfo.screens[i];
+ ScrnInfoPtr pScrn = xf86Screens[i];
+ GLINTPtr pGlint = GLINTPTR(pScrn);
+
+ if(pGlint->CursorColorCallback)
+ (*pGlint->CursorColorCallback)(pScrn);
+
+ if(pGlint->LoadCursorCallback)
+ (*pGlint->LoadCursorCallback)(pScrn);
+
+ pScreen->BlockHandler = pGlint->BlockHandler;
+ (*pScreen->BlockHandler) (i, blockData, pTimeout, pReadmask);
+ pScreen->BlockHandler = GLINTBlockHandler;
+}
+
#ifdef DEBUG
void
GLINT_VERB_WRITE_REG(GLINTPtr pGlint, CARD32 v, int r, char *file, int line)
{
if (xf86GetVerbosity() > 2)
ErrorF("[0x%04x] <- 0x%08x (%s, %d)\n", r, v, file, line);
- *(volatile CARD32 *)((char *) pGlint->IOBase + r) = v;
+ *(volatile CARD32 *)((char *) pGlint->IOBase + pGlint->IOOffset + r) = v;
}
CARD32
GLINT_VERB_READ_REG(GLINTPtr pGlint, CARD32 r, char *file, int line)
{
- CARD32 v = *(volatile CARD32 *)((char *) pGlint->IOBase + r);
+ CARD32 v =
+ *(volatile CARD32 *)((char *) pGlint->IOBase + pGlint->IOOffset + r);
if (xf86GetVerbosity() > 2)
ErrorF("[0x%04x] -> 0x%08x (%s, %d)\n", r, v, file, line);
return v;
}
#endif
+
+void GLINT_MoveBYTE(
+ register CARD32* dest,
+ register unsigned char* src,
+ register int dwords)
+{
+#ifdef __alpha__
+ write_mem_barrier();
+#endif
+ while(dwords) {
+ *dest = *src;
+ src += 1;
+ dest += 1;
+ dwords -= 1;
+ }
+}
+
+void GLINT_MoveWORDS(
+ register CARD32* dest,
+ register unsigned short* src,
+ register int dwords)
+{
+#ifdef __alpha__
+ write_mem_barrier();
+#endif
+ while(dwords & ~0x01) {
+ *dest = *src;
+ *(dest + 1) = *(src + 1);
+ src += 2;
+ dest += 2;
+ dwords -= 2;
+ }
+ if (dwords)
+ *dest = *src;
+}
+
+void GLINT_MoveDWORDS(
+ register CARD32* dest,
+ register CARD32* src,
+ register int dwords)
+{
+#ifdef __alpha__
+ write_mem_barrier();
+#endif
+ while(dwords & ~0x03) {
+ *dest = *src;
+ *(dest + 1) = *(src + 1);
+ *(dest + 2) = *(src + 2);
+ *(dest + 3) = *(src + 3);
+ src += 4;
+ dest += 4;
+ dwords -= 4;
+ }
+
+ while(dwords) {
+ *dest = *src;
+ src++;
+ dest++;
+ dwords--;
+ }
+}
+
+int
+Shiftbpp(ScrnInfoPtr pScrn, int value)
+{
+ GLINTPtr pGlint = GLINTPTR(pScrn);
+ int logbytesperaccess = 2; /* default */
+
+ switch (pGlint->Chipset) {
+ case PCI_VENDOR_TI_CHIP_PERMEDIA:
+ case PCI_VENDOR_TI_CHIP_PERMEDIA2:
+ case PCI_VENDOR_3DLABS_CHIP_PERMEDIA:
+ case PCI_VENDOR_3DLABS_CHIP_PERMEDIA2:
+ case PCI_VENDOR_3DLABS_CHIP_PERMEDIA2V:
+ logbytesperaccess = 2;
+ break;
+ case PCI_VENDOR_3DLABS_CHIP_PERMEDIA3:
+ logbytesperaccess = 4;
+ break;
+ case PCI_VENDOR_3DLABS_CHIP_300SX:
+ case PCI_VENDOR_3DLABS_CHIP_500TX:
+ case PCI_VENDOR_3DLABS_CHIP_MX:
+ if ( (pGlint->RamDac->RamDacType == (IBM640_RAMDAC)) ||
+ (pGlint->RamDac->RamDacType == (TI3030_RAMDAC)) )
+ logbytesperaccess = 4;
+ else
+ logbytesperaccess = 3;
+ break;
+ case PCI_VENDOR_3DLABS_CHIP_GAMMA:
+ switch (pGlint->MultiChip) {
+ case PCI_CHIP_MX:
+ if ( (pGlint->RamDac->RamDacType == (IBM640_RAMDAC)) ||
+ (pGlint->RamDac->RamDacType == (TI3030_RAMDAC)) )
+ logbytesperaccess = 4;
+ else
+ logbytesperaccess = 3;
+ break;
+ case PCI_CHIP_PERMEDIA3:
+ logbytesperaccess = 4;
+ break;
+ }
+ }
+
+ switch (pScrn->bitsPerPixel) {
+ case 8:
+ value >>= logbytesperaccess;
+ pGlint->BppShift = logbytesperaccess;
+ break;
+ case 16:
+ if (pGlint->DoubleBuffer) {
+ value >>= (logbytesperaccess-2);
+ pGlint->BppShift = logbytesperaccess-2;
+ } else {
+ value >>= (logbytesperaccess-1);
+ pGlint->BppShift = logbytesperaccess-1;
+ }
+ break;
+ case 24:
+ value *= 3;
+ value >>= logbytesperaccess;
+ pGlint->BppShift = logbytesperaccess;
+ break;
+ case 32:
+ value >>= (logbytesperaccess-2);
+ pGlint->BppShift = logbytesperaccess-2;
+ break;
+ }
+ return (value);
+}
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 8e319152b..06e1cb265 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.21 2000/09/19 14:12:32 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/glint_regs.h,v 1.25 2001/02/15 11:03:57 alanh Exp $ */
/*
* glint register file
@@ -19,16 +19,7 @@
#include "compiler.h"
-/**********************************************
-* GLINT 500TX Configuration Region Registers *
-***********************************************/
-
-/* Device Identification */
-#define CFGVendorId 0x0000
-#define PCI_VENDOR_3DLABS 0x3D3D
-#define PCI_VENDOR_TI 0x104C
-#define CFGDeviceId 0x0002
-
+/* The chips we know */
#define PCI_CHIP_3DLABS_300SX 0x01
#define PCI_CHIP_3DLABS_500TX 0x02
#define PCI_CHIP_3DLABS_DELTA 0x03
@@ -40,6 +31,26 @@
#define PCI_CHIP_3DLABS_PERMEDIA3 0x0A
#define PCI_CHIP_TI_PERMEDIA 0x3d04
+/* The boards we know */
+#define IS_GMX2000 ((pGlint->PciInfo->subsysVendor == 0x3d3d) && \
+ (pGlint->PciInfo->subsysCard == 0x0106))
+
+#define IS_J2000 ((pGlint->PciInfo->subsysVendor == 0x1097) && \
+ (pGlint->PciInfo->subsysCard == 0x3d32))
+
+#define IS_JPRO ((pGlint->PciInfo->subsysVendor == 0x1097) && \
+ (pGlint->PciInfo->subsysCard == 0x3db3))
+
+/**********************************************
+* GLINT 500TX Configuration Region Registers *
+***********************************************/
+
+/* Device Identification */
+#define CFGVendorId 0x0000
+#define PCI_VENDOR_3DLABS 0x3D3D
+#define PCI_VENDOR_TI 0x104C
+#define CFGDeviceId 0x0002
+
#define CFGRevisionId 0x08
#define CFGClassCode 0x09
#define CFGHeaderType 0x0E
@@ -323,6 +334,10 @@
#define PM2VDACRDDClk1PreScale 0x204
#define PM2VDACRDDClk1FeedbackScale 0x205
#define PM2VDACRDDClk1PostScale 0x206
+#define PM2VDACRDMClkControl 0x20D
+#define PM2VDACRDMClkPreScale 0x20E
+#define PM2VDACRDMClkFeedbackScale 0x20F
+#define PM2VDACRDMClkPostScale 0x210
#define PM2VDACRDCursorPalette 0x303
#define PM2VDACRDCursorPattern 0x400
#define PM2VDACIndexRegLow 0x4020
@@ -981,6 +996,8 @@
#define FM_PassStatisticTag 0x1000
#define FM_PassStatisticData 0x2000
+#define Sync_tag 0x0188
+
#define StatisticMode GLINT_TAG_ADDR(0x18,0x01)
#define MinRegion GLINT_TAG_ADDR(0x18,0x02)
#define MaxRegion GLINT_TAG_ADDR(0x18,0x03)
@@ -1173,44 +1190,40 @@
GLINT_VERB_READ_REG(pGlint,r,__FILE__,__LINE__)
#else
-#define GLINT_WRITE_REG(v,r) MMIO_OUT32(pGlint->IOBase,(unsigned long)r, v)
-#define GLINT_READ_REG(r) MMIO_IN32(pGlint->IOBase,(unsigned long)r)
-#define GLINT_SECONDARY_WRITE_REG(v,r) \
- MMIO_OUT32(pGlint->IOBase,(unsigned long)r+0x10000, v)
-#define GLINT_SECONDARY_READ_REG(r) \
- MMIO_IN32(pGlint->IOBase,(unsigned long)r+0x10000)
+#define GLINT_WRITE_REG(v,r) \
+ MMIO_OUT32(pGlint->IOBase + pGlint->IOOffset,(unsigned long)(r), (v))
+#define GLINT_READ_REG(r) \
+ MMIO_IN32(pGlint->IOBase + pGlint->IOOffset,(unsigned long)(r))
#endif /* DEBUG */
#define GLINT_WAIT(n) \
do{ \
- if(!pGlint->UsePCIRetry) \
- while(GLINT_READ_REG(InFIFOSpace)<(n)){ \
- mem_barrier(); \
- } \
+ while(GLINT_READ_REG(InFIFOSpace)<(n)); \
}while(0)
-#define GLINT_MASK_WRITE_REG(v,m,r) \
- GLINT_WRITE_REG((GLINT_READ_REG(r)&(m))|(v),r)
-
#define GLINTDACDelay(x) do { \
int delay = x; \
unsigned char tmp; \
while(delay--){tmp = GLINT_READ_REG(InFIFOSpace);}; \
} while(0)
+#define GLINT_MASK_WRITE_REG(v,m,r) \
+ GLINT_WRITE_REG((GLINT_READ_REG(r)&(m))|(v),r)
+
#define GLINT_SLOW_WRITE_REG(v,r) \
do{ \
- GLINTDACDelay(5); \
+ mem_barrier(); \
+ GLINT_WAIT(1); \
+ mem_barrier(); \
GLINT_WRITE_REG(v,r); \
- GLINTDACDelay(5); \
}while(0)
-#define GLINT_SECONDARY_SLOW_WRITE_REG(v,r) \
-do{ \
- while(GLINT_READ_REG(InFIFOSpace)<1); \
- GLINT_SECONDARY_WRITE_REG(v,r); \
-}while(0)
+#define GLINT_SET_INDEX(index) \
+do{ \
+ GLINT_SLOW_WRITE_REG(((index)>>8)&0xff,PM2VDACIndexRegHigh); \
+ GLINT_SLOW_WRITE_REG((index)&0xff,PM2VDACIndexRegLow); \
+} while(0)
#define REPLICATE(r) \
{ \
@@ -1266,4 +1279,38 @@ do{ \
GLINT_WRITE_REG(planemask, FBHardwareWriteMask);\
}
#endif
+
+/* Permedia Save/Restore functions */
+
+#define STOREREG(address,value) \
+ pReg->glintRegs[address >> 3] = value;
+
+#define SAVEREG(address) \
+ pReg->glintRegs[address >> 3] = GLINT_READ_REG(address);
+
+#define RESTOREREG(address) \
+ GLINT_SLOW_WRITE_REG(pReg->glintRegs[address >> 3], address);
+
+#define STOREDAC(address,value) \
+ pReg->DacRegs[address] = value;
+
+#define P2VOUT(address) \
+ Permedia2vOutIndReg(pScrn, address, 0x00, pReg->DacRegs[address]);
+
+#define P2VIN(address) \
+ pReg->DacRegs[address] = Permedia2vInIndReg(pScrn, address);
+
+/* RamDac Save/Restore functions, used by external DAC's */
+
+#define STORERAMDAC(address,value) \
+ ramdacReg->DacRegs[address] = value;
+
+/* Multi Chip access */
+
+#define ACCESSCHIP1() \
+ pGlint->IOOffset = 0;
+
+#define ACCESSCHIP2() \
+ pGlint->IOOffset = 0x10000;
+
#endif
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_accel.c b/xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_accel.c
index 65b7d0b36..ef3a1b1bb 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_accel.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_accel.c
@@ -1,5 +1,5 @@
/*
- * Copyright 1997,1998 by Alan Hourihane, Wigan, England.
+ * Copyright 1997-2001 by Alan Hourihane, Wigan, England.
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -30,7 +30,7 @@
*
* Permedia 2 accelerated options.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_accel.c,v 1.24 2000/03/31 22:55:43 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_accel.c,v 1.28 2001/02/15 11:03:57 alanh Exp $ */
#include "Xarch.h"
#include "xf86.h"
@@ -115,18 +115,10 @@ static void Permedia2WritePixmap16bpp(ScrnInfoPtr pScrn, int x, int y, int w,
int h, unsigned char *src, int srcwidth,
int rop, unsigned int planemask,
int transparency_color, int bpp, int depth);
-static void Permedia2WritePixmap24bpp(ScrnInfoPtr pScrn, int x, int y, int w,
- int h, unsigned char *src, int srcwidth,
- int rop, unsigned int planemask,
- int transparency_color, int bpp, int depth);
static void Permedia2WritePixmap32bpp(ScrnInfoPtr pScrn, int x, int y, int w,
int h, unsigned char *src, int srcwidth,
int rop, unsigned int planemask,
int transparency_color, int bpp, int depth);
-static void Permedia2SetupForCPUToScreenColorExpandFill(ScrnInfoPtr pScrn,
- int fg, int bg, int rop,unsigned int planemask);
-static void Permedia2SubsequentCPUToScreenColorExpandFill(ScrnInfoPtr pScrn,
- int x, int y, int w, int h, int skipleft);
static void Permedia2SetupForScanlineCPUToScreenColorExpandFill(
ScrnInfoPtr pScrn,
int fg, int bg, int rop,
@@ -141,8 +133,6 @@ static void Permedia2PolylinesThinSolidWrapper(DrawablePtr pDraw, GCPtr pGC,
static void Permedia2PolySegmentThinSolidWrapper(DrawablePtr pDraw, GCPtr pGC,
int nseg, xSegment *pSeg);
-#define MAX_FIFO_ENTRIES 256
-
#if X_BYTE_ORDER == X_BIG_ENDIAN
# define STIPPLE_SWAP 1<<18 /* Mirror stipple pattern horizontally */
#else
@@ -182,7 +172,7 @@ Permedia2InitializeEngine(ScrnInfoPtr pScrn)
GLINT_SLOW_WRITE_REG(UNIT_DISABLE, LogicalOpMode);
GLINT_SLOW_WRITE_REG(UNIT_DISABLE, DepthMode);
GLINT_SLOW_WRITE_REG(UNIT_DISABLE, StatisticMode);
- GLINT_SLOW_WRITE_REG(0xc00, FilterMode);
+ GLINT_SLOW_WRITE_REG(0x400, FilterMode);
GLINT_SLOW_WRITE_REG(0xffffffff, FBHardwareWriteMask);
GLINT_SLOW_WRITE_REG(0xffffffff, FBSoftwareWriteMask);
GLINT_SLOW_WRITE_REG(UNIT_DISABLE, RasterizerMode);
@@ -328,35 +318,21 @@ Permedia2AccelInit(ScreenPtr pScreen)
Permedia2SubsequentMono8x8PatternFillRect;
}
- if (pGlint->UsePCIRetry) {
- infoPtr->CPUToScreenColorExpandFillFlags = SYNC_AFTER_COLOR_EXPAND |
- BIT_ORDER_IN_BYTE_LSBFIRST |
- CPU_TRANSFER_PAD_DWORD;
+ infoPtr->ScanlineCPUToScreenColorExpandFillFlags =
+ BIT_ORDER_IN_BYTE_LSBFIRST;
- infoPtr->ColorExpandBase = pGlint->IOBase + OutputFIFO + 4;
- infoPtr->SetupForCPUToScreenColorExpandFill =
- Permedia2SetupForCPUToScreenColorExpandFill;
- infoPtr->SubsequentCPUToScreenColorExpandFill =
- Permedia2SubsequentCPUToScreenColorExpandFill;
- } else {
- infoPtr->ScanlineCPUToScreenColorExpandFillFlags =
- BIT_ORDER_IN_BYTE_LSBFIRST;
-
- infoPtr->NumScanlineColorExpandBuffers = 1;
- infoPtr->ScanlineColorExpandBuffers =
+ infoPtr->NumScanlineColorExpandBuffers = 1;
+ infoPtr->ScanlineColorExpandBuffers =
pGlint->XAAScanlineColorExpandBuffers;
- pGlint->XAAScanlineColorExpandBuffers[0] =
+ pGlint->XAAScanlineColorExpandBuffers[0] =
pGlint->IOBase + OutputFIFO + 4;
- infoPtr->SetupForScanlineCPUToScreenColorExpandFill =
+ infoPtr->SetupForScanlineCPUToScreenColorExpandFill =
Permedia2SetupForScanlineCPUToScreenColorExpandFill;
- infoPtr->SubsequentScanlineCPUToScreenColorExpandFill =
+ infoPtr->SubsequentScanlineCPUToScreenColorExpandFill =
Permedia2SubsequentScanlineCPUToScreenColorExpandFill;
- infoPtr->SubsequentColorExpandScanline =
+ infoPtr->SubsequentColorExpandScanline =
Permedia2SubsequentColorExpandScanline;
- }
-
- infoPtr->ColorExpandRange = MAX_FIFO_ENTRIES;
infoPtr->WriteBitmap = Permedia2WriteBitmap;
@@ -366,13 +342,6 @@ Permedia2AccelInit(ScreenPtr pScreen)
if (pScrn->bitsPerPixel == 16)
infoPtr->WritePixmap = Permedia2WritePixmap16bpp;
else
-#if 0
- if (pScrn->bitsPerPixel == 24) {
- infoPtr->WritePixmap = Permedia2WritePixmap24bpp;
- infoPtr->WritePixmapFlags |= NO_PLANEMASK;
- }
- else
-#endif
if (pScrn->bitsPerPixel == 32)
infoPtr->WritePixmap = Permedia2WritePixmap32bpp;
@@ -381,7 +350,6 @@ Permedia2AccelInit(ScreenPtr pScreen)
infoPtr->SolidFillFlags |= NO_PLANEMASK;
infoPtr->ScreenToScreenCopyFlags |= NO_PLANEMASK;
infoPtr->WriteBitmapFlags |= NO_PLANEMASK;
- infoPtr->CPUToScreenColorExpandFillFlags |= NO_PLANEMASK;
infoPtr->ScanlineCPUToScreenColorExpandFillFlags |= NO_PLANEMASK;
infoPtr->Mono8x8PatternFillFlags |= NO_PLANEMASK;
}
@@ -427,11 +395,11 @@ Permedia2Sync(ScrnInfoPtr pScrn)
CHECKCLIPPING;
while (GLINT_READ_REG(DMACount) != 0);
- GLINT_WAIT(1);
+ GLINT_WAIT(2);
+ GLINT_WRITE_REG(0x400, FilterMode);
GLINT_WRITE_REG(0, GlintSync);
do {
while(GLINT_READ_REG(OutFIFOWords) == 0);
-#define Sync_tag 0x188
} while (GLINT_READ_REG(OutputFIFO) != Sync_tag);
}
@@ -733,63 +701,6 @@ Permedia2SubsequentFillRectSolid(ScrnInfoPtr pScrn, int x, int y, int w, int h)
TRACE_EXIT("Permedia2SubsequentFillRectSolid");
}
-static void MoveBYTE(
- register CARD32* dest,
- register unsigned char* src,
- register int dwords
-)
-{
- while(dwords) {
- *dest = *src;
- src += 1;
- dest += 1;
- dwords -= 1;
- }
-}
-
-static void MoveWORDS(
- register CARD32* dest,
- register unsigned short* src,
- register int dwords
-)
-{
- while(dwords & ~0x01) {
- *dest = *src;
- *(dest + 1) = *(src + 1);
- src += 2;
- dest += 2;
- dwords -= 2;
- }
- switch(dwords) {
- case 0: return;
- case 1: *dest = *src;
- return;
- }
-}
-
-static void MoveDWORDS(
- register CARD32* dest,
- register CARD32* src,
- register int dwords )
-{
- while(dwords & ~0x03) {
- *dest = *src;
- *(dest + 1) = *(src + 1);
- *(dest + 2) = *(src + 2);
- *(dest + 3) = *(src + 3);
- src += 4;
- dest += 4;
- dwords -= 4;
- }
- if (!dwords) return;
- *dest = *src;
- if (dwords == 1) return;
- *(dest + 1) = *(src + 1);
- if (dwords == 2) return;
- *(dest + 2) = *(src + 2);
-}
-
-
static void
Permedia2SetupForMono8x8PatternFill24bpp(ScrnInfoPtr pScrn,
int patternx, int patterny,
@@ -939,82 +850,6 @@ Permedia2SubsequentMono8x8PatternFillRect(ScrnInfoPtr pScrn,
}
static void
-Permedia2SetupForCPUToScreenColorExpandFill(
- ScrnInfoPtr pScrn,
- int fg, int bg,
- int rop,
- unsigned int planemask
-){
- GLINTPtr pGlint = GLINTPTR(pScrn);
- int dobackground = 0;
-
- TRACE_ENTER("Permedia2SetupForCPUToScreenColorExpandFill");
- if (bg != -1) dobackground |= ForceBackgroundColor;
-
- GLINT_WAIT(7);
- DO_PLANEMASK(planemask);
- if (rop == GXcopy) {
- GLINT_WRITE_REG(pGlint->pprod, FBReadMode);
- } else {
- GLINT_WRITE_REG(pGlint->pprod | FBRM_DstEnable, FBReadMode);
- }
-
- pGlint->ForeGroundColor = fg;
- pGlint->BackGroundColor = bg;
- REPLICATE(fg);
- REPLICATE(bg);
-
- if ((pScrn->bitsPerPixel != 24) && (rop == GXcopy)) {
- GLINT_WRITE_REG(UNIT_DISABLE, ColorDDAMode);
- if (dobackground) {
- GLINT_WRITE_REG(bg, FBBlockColor);
- } else {
- GLINT_WRITE_REG(fg, FBBlockColor);
- }
- GLINT_WRITE_REG(pGlint->RasterizerSwap,RasterizerMode);
- pGlint->FrameBufferReadMode = FastFillEnable;
- } else {
- GLINT_WRITE_REG(UNIT_ENABLE, ColorDDAMode);
- GLINT_WRITE_REG(BitMaskPackingEachScanline|dobackground|
- pGlint->RasterizerSwap,RasterizerMode);
- GLINT_WRITE_REG(fg, ConstantColor);
- if (dobackground) {
- pGlint->FrameBufferReadMode = TextureEnable;
- GLINT_WRITE_REG(bg, Texel0);
- } else
- pGlint->FrameBufferReadMode = 0;
- }
- LOADROP(rop);
- TRACE_EXIT("Permedia2SetupForCPUToScreenColorExpandFill");
-}
-
-static void
-Permedia2SubsequentCPUToScreenColorExpandFill(
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h,
- int skipleft
-){
- GLINTPtr pGlint = GLINTPTR(pScrn);
- int dwords = ((w + 31) >> 5) * h;
-
- TRACE_ENTER("Permedia2SubsequentCPUToScreenColorExpandFill");
- GLINT_WAIT(8);
- Permedia2LoadCoord(pScrn, x, y, w, h);
-
- if ((pGlint->ROP == GXcopy) && (pGlint->BackGroundColor != -1)) {
- GLINT_WRITE_REG(PrimitiveRectangle | XPositive | YPositive | FastFillEnable, Render);
- REPLICATE(pGlint->ForeGroundColor)
- GLINT_WRITE_REG(pGlint->ForeGroundColor, FBBlockColor);
- }
-
- GLINT_WRITE_REG(PrimitiveRectangle | XPositive | YPositive | SyncOnBitMask |
- pGlint->FrameBufferReadMode, Render);
- GLINT_WRITE_REG((dwords - 1)<<16 | 0x0D, OutputFIFO);
- GLINT_WAIT(dwords);
- TRACE_EXIT("Permedia2SubsequentCPUToScreenColorExpandFill");
-}
-
-static void
Permedia2SetupForScanlineCPUToScreenColorExpandFill(
ScrnInfoPtr pScrn,
int fg, int bg,
@@ -1141,44 +976,28 @@ Permedia2WriteBitmap(ScrnInfoPtr pScrn,
}
if(bg == -1) {
- /* >>>>> set fg <<<<<<<< */
REPLICATE(fg);
- if ((pScrn->bitsPerPixel != 24) && (rop == GXcopy)) {
+ if ((pScrn->bitsPerPixel != 24) && (rop == GXcopy)) {
GLINT_WRITE_REG(fg, FBBlockColor);
} else {
GLINT_WRITE_REG(fg, ConstantColor);
}
- } else if(rop == GXcopy) {
- /* >>>>> set bg <<<<<<< */
- /* >>>>> draw rect (x,y,w,h) */
+ } else if((rop == GXcopy) && (pScrn->bitsPerPixel != 24)) {
REPLICATE(bg);
- if ((pScrn->bitsPerPixel != 24) && (rop == GXcopy)) {
- GLINT_WRITE_REG(bg, FBBlockColor);
- } else {
- GLINT_WRITE_REG(bg, ConstantColor);
- }
- GLINT_WRITE_REG(PrimitiveRectangle | XPositive | YPositive |mode,Render);
- /* >>>>>> set fg <<<<<< */
+ GLINT_WRITE_REG(bg, FBBlockColor);
+ GLINT_WRITE_REG(PrimitiveRectangle | XPositive |YPositive |mode,Render);
REPLICATE(fg);
- if ((pScrn->bitsPerPixel != 24) && (rop == GXcopy)) {
- GLINT_WRITE_REG(fg, FBBlockColor);
- } else {
- GLINT_WRITE_REG(fg, ConstantColor);
- }
+ GLINT_WRITE_REG(fg, FBBlockColor);
} else {
SecondPass = TRUE;
- /* >>>>> set fg <<<<<<< */
REPLICATE(fg);
- if ((pScrn->bitsPerPixel != 24) && (rop == GXcopy)) {
+ if ((pScrn->bitsPerPixel != 24) && (rop == GXcopy)) {
GLINT_WRITE_REG(fg, FBBlockColor);
} else {
GLINT_WRITE_REG(fg, ConstantColor);
}
}
- /* >>>>>>>>> initiate transfer (x,y,w,h). Skipleft pixels on the
- left edge will be clipped <<<<<< */
-
SECOND_PASS:
GLINT_WRITE_REG(PrimitiveRectangle | XPositive | YPositive | mode | SyncOnBitMask, Render);
@@ -1188,17 +1007,16 @@ SECOND_PASS:
GLINT_WAIT(dwords);
/* 0x0D is the TAG value for BitMaskPattern */
GLINT_WRITE_REG(((dwords - 1) << 16) | 0x0D, OutputFIFO);
- MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
+ GLINT_MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
(CARD32 *)srcpntr, dwords);
srcpntr += srcwidth;
}
if(SecondPass) {
SecondPass = FALSE;
- /* >>>>>> invert bitmask and set bg <<<<<<<< */
REPLICATE(bg);
GLINT_WAIT(3);
- if ((pScrn->bitsPerPixel != 24) && (rop == GXcopy)) {
+ if ((pScrn->bitsPerPixel != 24) && (rop == GXcopy)) {
GLINT_WRITE_REG(InvertBitMask|pGlint->RasterizerSwap,RasterizerMode);
GLINT_WRITE_REG(bg, FBBlockColor);
} else {
@@ -1276,24 +1094,27 @@ Permedia2WritePixmap8bpp(
count = dwords;
address = ((y * pScrn->displayWidth) + x) >> 2;
srcp = (CARD32*)src;
+ GLINT_WAIT(1); /*??*/
GLINT_WRITE_REG(address, TextureDownloadOffset);
- while(count >= MAX_FIFO_ENTRIES) {
- GLINT_WAIT(MAX_FIFO_ENTRIES);
+ while(count >= pGlint->FIFOSize) {
+ GLINT_WAIT(pGlint->FIFOSize);
/* (0x11 << 4) | 0x0D is the TAG for TextureData */
- GLINT_WRITE_REG(((MAX_FIFO_ENTRIES - 2) << 16) | (0x11 << 4) |
+ GLINT_WRITE_REG(((pGlint->FIFOSize - 2) << 16) | (0x11 << 4) |
0x0D, OutputFIFO);
- MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
- (CARD32*)srcp, MAX_FIFO_ENTRIES - 1);
- count -= MAX_FIFO_ENTRIES - 1;
- address += MAX_FIFO_ENTRIES - 1;
- srcp += MAX_FIFO_ENTRIES - 1;
+ GLINT_MoveDWORDS(
+ (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
+ (CARD32*)srcp, pGlint->FIFOSize - 1);
+ count -= pGlint->FIFOSize - 1;
+ address += pGlint->FIFOSize - 1;
+ srcp += pGlint->FIFOSize - 1;
}
if(count) {
GLINT_WAIT(count + 1);
/* (0x11 << 4) | 0x0D is the TAG for TextureData */
GLINT_WRITE_REG(((count - 1) << 16) | (0x11 << 4) | 0x0D,
OutputFIFO);
- MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
+ GLINT_MoveDWORDS(
+ (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
(CARD32*)srcp, count);
}
src += srcwidth;
@@ -1305,6 +1126,7 @@ Permedia2WritePixmap8bpp(
char align = (x & pGlint->bppalign);
+ GLINT_WAIT(1); /*??*/
GLINT_WRITE_REG(UNIT_DISABLE, ColorDDAMode);
if (rop == GXcopy) {
GLINT_WAIT(6);
@@ -1324,22 +1146,24 @@ Permedia2WritePixmap8bpp(
while(h--) {
count = dwords;
srcp = (CARD32*)src;
- while(count >= MAX_FIFO_ENTRIES) {
- GLINT_WAIT(MAX_FIFO_ENTRIES);
+ while(count >= pGlint->FIFOSize) {
+ GLINT_WAIT(pGlint->FIFOSize);
/* (0x15 << 4) | 0x05 is the TAG for FBSourceData */
- GLINT_WRITE_REG(((MAX_FIFO_ENTRIES - 2) << 16) | (0x15 << 4) |
+ GLINT_WRITE_REG(((pGlint->FIFOSize - 2) << 16) | (0x15 << 4) |
0x05, OutputFIFO);
- MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
- (CARD32*)srcp, MAX_FIFO_ENTRIES - 1);
- count -= MAX_FIFO_ENTRIES - 1;
- srcp += MAX_FIFO_ENTRIES - 1;
+ GLINT_MoveDWORDS(
+ (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
+ (CARD32*)srcp, pGlint->FIFOSize - 1);
+ count -= pGlint->FIFOSize - 1;
+ srcp += pGlint->FIFOSize - 1;
}
if(count) {
GLINT_WAIT(count + 1);
/* (0x15 << 4) | 0x05 is the TAG for FBSourceData */
GLINT_WRITE_REG(((count - 1) << 16) | (0x15 << 4) |
0x05, OutputFIFO);
- MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
+ GLINT_MoveDWORDS(
+ (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
(CARD32*)srcp, count);
}
src += srcwidth;
@@ -1348,22 +1172,24 @@ Permedia2WritePixmap8bpp(
while(h--) {
count = w;
srcpbyte = (unsigned char *)src;
- while(count >= MAX_FIFO_ENTRIES) {
- GLINT_WAIT(MAX_FIFO_ENTRIES);
+ while(count >= pGlint->FIFOSize) {
+ GLINT_WAIT(pGlint->FIFOSize);
/* (0x15 << 4) | 0x05 is the TAG for FBSourceData */
- GLINT_WRITE_REG(((MAX_FIFO_ENTRIES - 2) << 16) | (0x15 << 4) |
+ GLINT_WRITE_REG(((pGlint->FIFOSize - 2) << 16) | (0x15 << 4) |
0x05, OutputFIFO);
- MoveBYTE((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
- (unsigned char *)srcpbyte, MAX_FIFO_ENTRIES - 1);
- count -= MAX_FIFO_ENTRIES - 1;
- srcpbyte += MAX_FIFO_ENTRIES - 1;
+ GLINT_MoveBYTE(
+ (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
+ (unsigned char *)srcpbyte, pGlint->FIFOSize - 1);
+ count -= pGlint->FIFOSize - 1;
+ srcpbyte += pGlint->FIFOSize - 1;
}
if(count) {
GLINT_WAIT(count + 1);
/* (0x15 << 4) | 0x05 is the TAG for FBSourceData */
GLINT_WRITE_REG(((count - 1) << 16) | (0x15 << 4) |
0x05, OutputFIFO);
- MoveBYTE((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
+ GLINT_MoveBYTE(
+ (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
(unsigned char *)srcpbyte, count);
}
src += srcwidth;
@@ -1435,24 +1261,27 @@ Permedia2WritePixmap16bpp(
count = dwords;
address = ((y * pScrn->displayWidth) + x) >> 1;
srcp = (CARD32*)src;
+ GLINT_WAIT(1); /*??*/
GLINT_WRITE_REG(address, TextureDownloadOffset);
- while(count >= MAX_FIFO_ENTRIES) {
- GLINT_WAIT(MAX_FIFO_ENTRIES);
+ while(count >= pGlint->FIFOSize) {
+ GLINT_WAIT(pGlint->FIFOSize);
/* (0x11 << 4) | 0x0D is the TAG for TextureData */
- GLINT_WRITE_REG(((MAX_FIFO_ENTRIES - 2) << 16) | (0x11 << 4) |
+ GLINT_WRITE_REG(((pGlint->FIFOSize - 2) << 16) | (0x11 << 4) |
0x0D, OutputFIFO);
- MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
- (CARD32*)srcp, MAX_FIFO_ENTRIES - 1);
- count -= MAX_FIFO_ENTRIES - 1;
- address += MAX_FIFO_ENTRIES - 1;
- srcp += MAX_FIFO_ENTRIES - 1;
+ GLINT_MoveDWORDS(
+ (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
+ (CARD32*)srcp, pGlint->FIFOSize - 1);
+ count -= pGlint->FIFOSize - 1;
+ address += pGlint->FIFOSize - 1;
+ srcp += pGlint->FIFOSize - 1;
}
if(count) {
GLINT_WAIT(count + 1);
/* (0x11 << 4) | 0x0D is the TAG for TextureData */
GLINT_WRITE_REG(((count - 1) << 16) | (0x11 << 4) | 0x0D,
OutputFIFO);
- MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
+ GLINT_MoveDWORDS(
+ (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
(CARD32*)srcp, count);
}
src += srcwidth;
@@ -1483,22 +1312,24 @@ Permedia2WritePixmap16bpp(
while(h--) {
count = dwords;
srcp = (CARD32*)src;
- while(count >= MAX_FIFO_ENTRIES) {
- GLINT_WAIT(MAX_FIFO_ENTRIES);
+ while(count >= pGlint->FIFOSize) {
+ GLINT_WAIT(pGlint->FIFOSize);
/* (0x15 << 4) | 0x05 is the TAG for FBSourceData */
- GLINT_WRITE_REG(((MAX_FIFO_ENTRIES - 2) << 16) | (0x15 << 4) |
+ GLINT_WRITE_REG(((pGlint->FIFOSize - 2) << 16) | (0x15 << 4) |
0x05, OutputFIFO);
- MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
- (CARD32*)srcp, MAX_FIFO_ENTRIES - 1);
- count -= MAX_FIFO_ENTRIES - 1;
- srcp += MAX_FIFO_ENTRIES - 1;
+ GLINT_MoveDWORDS(
+ (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
+ (CARD32*)srcp, pGlint->FIFOSize - 1);
+ count -= pGlint->FIFOSize - 1;
+ srcp += pGlint->FIFOSize - 1;
}
if(count) {
GLINT_WAIT(count + 1);
/* (0x15 << 4) | 0x05 is the TAG for FBSourceData */
GLINT_WRITE_REG(((count - 1) << 16) | (0x15 << 4) |
0x05, OutputFIFO);
- MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
+ GLINT_MoveDWORDS(
+ (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
(CARD32*)srcp, count);
}
src += srcwidth;
@@ -1507,22 +1338,24 @@ Permedia2WritePixmap16bpp(
while(h--) {
count = w;
srcpword = (unsigned short *)src;
- while(count >= MAX_FIFO_ENTRIES) {
- GLINT_WAIT(MAX_FIFO_ENTRIES);
+ while(count >= pGlint->FIFOSize) {
+ GLINT_WAIT(pGlint->FIFOSize);
/* (0x15 << 4) | 0x05 is the TAG for FBSourceData */
- GLINT_WRITE_REG(((MAX_FIFO_ENTRIES - 2) << 16) | (0x15 << 4) |
+ GLINT_WRITE_REG(((pGlint->FIFOSize - 2) << 16) | (0x15 << 4) |
0x05, OutputFIFO);
- MoveWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
- (unsigned short *)srcpword, MAX_FIFO_ENTRIES - 1);
- count -= MAX_FIFO_ENTRIES - 1;
- srcpword += MAX_FIFO_ENTRIES - 1;
+ GLINT_MoveWORDS(
+ (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
+ (unsigned short *)srcpword, pGlint->FIFOSize - 1);
+ count -= pGlint->FIFOSize - 1;
+ srcpword += pGlint->FIFOSize - 1;
}
if(count) {
GLINT_WAIT(count + 1);
/* (0x15 << 4) | 0x05 is the TAG for FBSourceData */
GLINT_WRITE_REG(((count - 1) << 16) | (0x15 << 4) |
0x05, OutputFIFO);
- MoveWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
+ GLINT_MoveWORDS(
+ (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
(unsigned short *)srcpword, count);
}
src += srcwidth;
@@ -1536,107 +1369,6 @@ Permedia2WritePixmap16bpp(
}
static void
-Permedia2WritePixmap24bpp(
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h,
- unsigned char *src,
- int srcwidth,
- int rop,
- unsigned int planemask,
- int transparency_color,
- int bpp, int depth
-)
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
- GLINTPtr pGlint = GLINTPTR(pScrn);
- int skipleft = 0, dwords, count;
- unsigned char* srcpbyte;
- CARD32* srcp;
-
- GLINT_WAIT(3);
- GLINT_WRITE_REG(pGlint->RasterizerSwap,RasterizerMode);
- GLINT_WRITE_REG(UNIT_DISABLE, ColorDDAMode);
- if (rop == GXcopy) {
- GLINT_WRITE_REG(pGlint->pprod, FBReadMode);
- } else {
- GLINT_WRITE_REG(pGlint->pprod | FBRM_DstEnable, FBReadMode);
- }
-
- dwords = ((w+1)*3)>>2;
- if((skipleft = (long)src & 0x03L)) {
- skipleft = 4 - skipleft;
-
- x -= skipleft;
- w += skipleft;
-
- src = (unsigned char*)(src - (3*skipleft));
- }
-
- {
- Permedia2SetClippingRectangle(pScrn,x+skipleft,y,x+w,y+h);
-
- GLINT_WAIT(4);
- Permedia2LoadCoord(pScrn, x&0xFFFF, y, w, h);
- LOADROP(rop);
- GLINT_WRITE_REG(PrimitiveRectangle | XPositive | YPositive |
- SyncOnHostData, Render);
-
-#if 1
- while(h--) {
- count = w;
- srcpbyte = (unsigned char *)src;
- while(count >= MAX_FIFO_ENTRIES) {
- GLINT_WAIT(MAX_FIFO_ENTRIES);
- /* (0x15 << 4) | 0x05 is the TAG for FBSourceData */
- GLINT_WRITE_REG(((MAX_FIFO_ENTRIES - 2) << 16) | (0x15 << 4) |
- 0x05, OutputFIFO);
- MoveBYTE((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
- (unsigned char *)srcpbyte, MAX_FIFO_ENTRIES - 1);
- count -= MAX_FIFO_ENTRIES - 1;
- srcpbyte += MAX_FIFO_ENTRIES - 1;
- }
- if(count) {
- GLINT_WAIT(count + 1);
- /* (0x15 << 4) | 0x05 is the TAG for FBSourceData */
- GLINT_WRITE_REG(((count - 1) << 16) | (0x15 << 4) |
- 0x05, OutputFIFO);
- MoveBYTE((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
- (unsigned char *)srcpbyte, count);
- }
- src += srcwidth;
-#else
- while(h--) {
- count = dwords;
- srcp = (CARD32*)src;
- while(count >= MAX_FIFO_ENTRIES) {
- GLINT_WAIT(MAX_FIFO_ENTRIES);
- /* (0x15 << 4) | 0x05 is the TAG for FBSourceData */
- GLINT_WRITE_REG(((MAX_FIFO_ENTRIES - 2) << 16) | (0x15 << 4) |
- 0x05, OutputFIFO);
- MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
- (CARD32*)srcp, MAX_FIFO_ENTRIES - 1);
- count -= MAX_FIFO_ENTRIES - 1;
- srcp += MAX_FIFO_ENTRIES - 1;
- }
- if(count) {
- GLINT_WAIT(count + 1);
- /* (0x15 << 4) | 0x05 is the TAG for FBSourceData */
- GLINT_WRITE_REG(((count - 1) << 16) | (0x15 << 4) |
- 0x05, OutputFIFO);
- MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
- (CARD32*)srcp, count);
- }
- src += srcwidth;
-#endif
- }
- }
-
- Permedia2DisableClipping(pScrn);
- SET_SYNC_FLAG(infoRec);
-}
-
-
-static void
Permedia2WritePixmap32bpp(
ScrnInfoPtr pScrn,
int x, int y, int w, int h,
@@ -1689,24 +1421,27 @@ Permedia2WritePixmap32bpp(
count = dwords;
address = (y * pScrn->displayWidth) + x;
srcp = (CARD32*)src;
+ GLINT_WAIT(1); /*??*/
GLINT_WRITE_REG(address, TextureDownloadOffset);
- while(count >= MAX_FIFO_ENTRIES) {
- GLINT_WAIT(MAX_FIFO_ENTRIES);
+ while(count >= pGlint->FIFOSize) {
+ GLINT_WAIT(pGlint->FIFOSize);
/* (0x11 << 4) | 0x0D is the TAG for TextureData */
- GLINT_WRITE_REG(((MAX_FIFO_ENTRIES - 2) << 16) | (0x11 << 4) |
+ GLINT_WRITE_REG(((pGlint->FIFOSize - 2) << 16) | (0x11 << 4) |
0x0D, OutputFIFO);
- MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
- (CARD32*)srcp, MAX_FIFO_ENTRIES - 1);
- count -= MAX_FIFO_ENTRIES - 1;
- address += MAX_FIFO_ENTRIES - 1;
- srcp += MAX_FIFO_ENTRIES - 1;
+ GLINT_MoveDWORDS(
+ (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
+ (CARD32*)srcp, pGlint->FIFOSize - 1);
+ count -= pGlint->FIFOSize - 1;
+ address += pGlint->FIFOSize - 1;
+ srcp += pGlint->FIFOSize - 1;
}
if(count) {
GLINT_WAIT(count + 1);
/* (0x11 << 4) | 0x0D is the TAG for TextureData */
GLINT_WRITE_REG(((count - 1) << 16) | (0x11 << 4) | 0x0D,
OutputFIFO);
- MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
+ GLINT_MoveDWORDS(
+ (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
(CARD32*)srcp, count);
}
src += srcwidth;
@@ -1727,22 +1462,24 @@ Permedia2WritePixmap32bpp(
while(h--) {
count = dwords;
srcp = (CARD32*)src;
- while(count >= MAX_FIFO_ENTRIES) {
- GLINT_WAIT(MAX_FIFO_ENTRIES);
+ while(count >= pGlint->FIFOSize) {
+ GLINT_WAIT(pGlint->FIFOSize);
/* (0x15 << 4) | 0x05 is the TAG for FBSourceData */
- GLINT_WRITE_REG(((MAX_FIFO_ENTRIES - 2) << 16) | (0x15 << 4) |
+ GLINT_WRITE_REG(((pGlint->FIFOSize - 2) << 16) | (0x15 << 4) |
0x05, OutputFIFO);
- MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
- (CARD32*)srcp, MAX_FIFO_ENTRIES - 1);
- count -= MAX_FIFO_ENTRIES - 1;
- srcp += MAX_FIFO_ENTRIES - 1;
+ GLINT_MoveDWORDS(
+ (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
+ (CARD32*)srcp, pGlint->FIFOSize - 1);
+ count -= pGlint->FIFOSize - 1;
+ srcp += pGlint->FIFOSize - 1;
}
if(count) {
GLINT_WAIT(count + 1);
/* (0x15 << 4) | 0x05 is the TAG for FBSourceData */
GLINT_WRITE_REG(((count - 1) << 16) | (0x15 << 4) |
0x05, OutputFIFO);
- MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
+ GLINT_MoveDWORDS(
+ (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
(CARD32*)srcp, count);
}
src += srcwidth;
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 45f605dd5..604ed1533 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_accel.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_accel.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2000 by Sven Luther <luther@dpt-info.u-strasbg.fr>.
+ * Copyright 2000-2001 by Sven Luther <luther@dpt-info.u-strasbg.fr>.
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -26,7 +26,7 @@
*
* Permedia 3 accelerated options.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_accel.c,v 1.7 2000/11/28 16:10:39 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_accel.c,v 1.22 2001/02/05 15:10:43 alanh Exp $ */
#include "Xarch.h"
#include "xf86.h"
@@ -47,7 +47,6 @@
#include "xaalocal.h" /* For replacements */
#define DEBUG 0
-#define USE_DIRECT_FIFO_WRITES 1
#if DEBUG
# define TRACE_ENTER(str) ErrorF("pm3_accel: " str " %d\n",pScrn->scrnIndex)
@@ -61,6 +60,7 @@
/* Sync */
void Permedia3Sync(ScrnInfoPtr pScrn);
+void DualPermedia3Sync(ScrnInfoPtr pScrn);
/* Clipping */
static void Permedia3SetClippingRectangle(ScrnInfoPtr pScrn, int x, int y,
int w, int h);
@@ -78,6 +78,8 @@ static void Permedia3SetupForFillRectSolid(ScrnInfoPtr pScrn, int color,
int rop, unsigned int planemask);
static void Permedia3SubsequentFillRectSolid(ScrnInfoPtr pScrn, int x,
int y, int w, int h);
+static void Permedia3SubsequentFillRectSolid32bpp(ScrnInfoPtr pScrn, int x,
+ int y, int w, int h);
/* 8x8 Mono Pattern Fills */
static void Permedia3SetupForMono8x8PatternFill(ScrnInfoPtr pScrn,
int patternx, int patterny, int fg, int bg,
@@ -85,26 +87,28 @@ static void Permedia3SetupForMono8x8PatternFill(ScrnInfoPtr pScrn,
static void Permedia3SubsequentMono8x8PatternFillRect(ScrnInfoPtr pScrn,
int x_offset, int y_offset, int x, int y,
int w, int h);
-/* Color Expansion Fills */
-static void Permedia3SetupForCPUToScreenColorExpandFill(ScrnInfoPtr pScrn,
- int fg, int bg, int rop,unsigned int planemask);
-static void Permedia3SubsequentCPUToScreenColorExpandFill(ScrnInfoPtr pScrn,
- int x, int y, int w, int h, int skipleft);
-/* Direct Fifo Bitmap Writes */
-static void Permedia3WriteBitmap(ScrnInfoPtr pScrn, int x, int y, int w, int h,
- unsigned char *src, int srcwidth, int skipleft,
- int fg, int bg, int rop,unsigned int planemask);
-/* Images Writes */
-static void Permedia3SetupForImageWrite(ScrnInfoPtr pScrn, int rop,
+static void Permedia3SetupForScanlineCPUToScreenColorExpandFill(
+ ScrnInfoPtr pScrn,
+ int fg, int bg, int rop,
+ unsigned int planemask);
+static void Permedia3SubsequentScanlineCPUToScreenColorExpandFill(
+ ScrnInfoPtr pScrn, int x,
+ int y, int w, int h, int skipleft);
+static void Permedia3SubsequentColorExpandScanline(ScrnInfoPtr pScrn, int bufno);
+static void Permedia3SetupForScanlineImageWrite(ScrnInfoPtr pScrn, int rop,
unsigned int planemask, int trans_color,
int bpp, int depth);
-static void Permedia3SubsequentImageWriteRect(ScrnInfoPtr pScrn,
+static void Permedia3SubsequentScanlineImageWriteRect(ScrnInfoPtr pScrn,
int x, int y, int w, int h, int skipleft);
-/* Direct Fifo Pixmap Writes */
+static void Permedia3SubsequentImageWriteScanline(ScrnInfoPtr pScrn, int bufno);
+static void Permedia3RestoreAccelState(ScrnInfoPtr pScrn);
static void Permedia3WritePixmap(ScrnInfoPtr pScrn, int x, int y, int w, int h,
unsigned char *src, int srcwidth, int rop,
unsigned int planemask, int transparency_color,
int bpp, int depth);
+static void Permedia3WriteBitmap(ScrnInfoPtr pScrn, int x, int y, int w, int h,
+ unsigned char *src, int srcwidth, int skipleft,
+ int fg, int bg, int rop,unsigned int planemask);
void
Permedia3InitializeEngine(ScrnInfoPtr pScrn)
@@ -115,14 +119,23 @@ Permedia3InitializeEngine(ScrnInfoPtr pScrn)
/* Initialize the Accelerator Engine to defaults */
TRACE_ENTER("Permedia3InitializeEngine");
+ if (pGlint->MultiAperture) {
+ /* Only write the following register to the first PM3 */
+ GLINT_SLOW_WRITE_REG(1, BroadcastMask);
+ GLINT_SLOW_WRITE_REG(0x00000001, ScanLineOwnership);
+
+ /* Only write the following register to the second PM3 */
+ GLINT_SLOW_WRITE_REG(2, BroadcastMask);
+ GLINT_SLOW_WRITE_REG(0x00000005, ScanLineOwnership);
+
+ /* Make sure the rest of the register writes go to both PM3's */
+ GLINT_SLOW_WRITE_REG(3, BroadcastMask);
+ }
+
/* Host out PreInit */
/* Set filter mode to enable sync tag & data output */
- GLINT_SLOW_WRITE_REG(0xc00, FilterMode);
+ GLINT_SLOW_WRITE_REG(0x400, FilterMode);
GLINT_SLOW_WRITE_REG(UNIT_DISABLE, StatisticMode);
- Permedia3Sync(pScrn);
-
- TRACE("Permedia3InitializeEngine : first sync");
- /* Disable most units by default */
GLINT_SLOW_WRITE_REG(UNIT_DISABLE, PM3DeltaMode);
GLINT_SLOW_WRITE_REG(UNIT_DISABLE, RasterizerMode);
GLINT_SLOW_WRITE_REG(UNIT_DISABLE, ScissorMode);
@@ -171,7 +184,6 @@ Permedia3InitializeEngine(ScrnInfoPtr pScrn)
GLINT_SLOW_WRITE_REG(0, PM3DeltaControl);
GLINT_SLOW_WRITE_REG(0xffffffff, BitMaskPattern);
- Permedia3Sync(pScrn);
/* ScissorStippleUnit Initialization (is it needed ?) */
pGlint->ClippingOn = FALSE;
@@ -184,14 +196,12 @@ Permedia3InitializeEngine(ScrnInfoPtr pScrn)
(0&0xffff)|((0&0xffff)<<16),
WindowOrigin);
*/
- Permedia3Sync(pScrn);
/* StencilDepthUnit Initialization */
GLINT_SLOW_WRITE_REG(0, PM3Window);
GLINT_SLOW_WRITE_REG(UNIT_DISABLE, DepthMode);
GLINT_SLOW_WRITE_REG(UNIT_DISABLE, StencilMode);
GLINT_SLOW_WRITE_REG(0, StencilData);
- Permedia3Sync(pScrn);
/* FBReadUnit Initialization */
TRACE("Permedia3InitializeEngine : only syncs upto now");
@@ -242,30 +252,29 @@ Permedia3InitializeEngine(ScrnInfoPtr pScrn)
TRACE("Permedia3InitializeEngine : SourceRead");
switch (pScrn->bitsPerPixel) {
case 8:
- GLINT_SLOW_WRITE_REG(0x2, PixelSize);
+ pGlint->PM3_PixelSize = 2;
#if X_BYTE_ORDER == X_BIG_ENDIAN
pGlint->RasterizerSwap = 3<<15; /* Swap host data */
#endif
break;
case 16:
- GLINT_SLOW_WRITE_REG(0x1, PixelSize);
+ pGlint->PM3_PixelSize = 1;
#if X_BYTE_ORDER == X_BIG_ENDIAN
pGlint->RasterizerSwap = 2<<15; /* Swap host data */
#endif
break;
case 32:
- GLINT_SLOW_WRITE_REG(0x0, PixelSize);
+ pGlint->PM3_PixelSize = 0;
break;
}
+ GLINT_SLOW_WRITE_REG(pGlint->PM3_PixelSize, PixelSize);
#if X_BYTE_ORDER == X_BIG_ENDIAN
GLINT_SLOW_WRITE_REG(1 | pGlint->RasterizerSwap, RasterizerMode);
#endif
TRACE("Permedia3InitializeEngine : PixelSize");
- Permedia3Sync(pScrn);
/* LogicalOpUnit Initialization */
GLINT_SLOW_WRITE_REG(0xffffffff, FBSoftwareWriteMask);
- Permedia3Sync(pScrn);
/* FBWriteUnit Initialization */
GLINT_SLOW_WRITE_REG(
@@ -278,7 +287,6 @@ Permedia3InitializeEngine(ScrnInfoPtr pScrn)
GLINT_SLOW_WRITE_REG(
PM3FBWriteBufferWidth_Width(pScrn->displayWidth),
PM3FBWriteBufferWidth0);
- Permedia3Sync(pScrn);
/*
GLINT_SLOW_WRITE_REG(0, PM3FBWriteBufferAddr1);
GLINT_SLOW_WRITE_REG(0, PM3FBWriteBufferOffset1);
@@ -305,7 +313,6 @@ Permedia3InitializeEngine(ScrnInfoPtr pScrn)
(pScrn->bitsPerPixel * pScrn->displayWidth)),
PM3SizeOfFramebuffer);
GLINT_SLOW_WRITE_REG(0xffffffff, FBHardwareWriteMask);
- Permedia3Sync(pScrn);
TRACE("Permedia3InitializeEngine : FBHardwareWriteMask & SizeOfFramebuffer");
/* Color Format */
switch (pScrn->depth) {
@@ -346,6 +353,8 @@ Permedia3InitializeEngine(ScrnInfoPtr pScrn)
GLINT_SLOW_WRITE_REG(0, StartXSub);
GLINT_SLOW_WRITE_REG(0, StartY);
GLINT_SLOW_WRITE_REG(0, GLINTCount);
+ if (*pGlint->AccelInfoRec->Sync)
+ (*pGlint->AccelInfoRec->Sync)(pScrn);
TRACE_EXIT("Permedia3InitializeEngine");
}
@@ -360,36 +369,30 @@ Permedia3AccelInit(ScreenPtr pScreen)
pGlint->AccelInfoRec = infoPtr = XAACreateInfoRec();
if (!infoPtr) return FALSE;
- Permedia3InitializeEngine(pScrn);
-
/* Generic accel engine flags */
- infoPtr->Flags =
- PIXMAP_CACHE |
- OFFSCREEN_PIXMAPS |
- LINEAR_FRAMEBUFFER;
+ infoPtr->Flags = PIXMAP_CACHE |
+ OFFSCREEN_PIXMAPS |
+ LINEAR_FRAMEBUFFER;
/* Synchronization of the accel engine */
- infoPtr->Sync = Permedia3Sync;
+ if (pGlint->MultiAperture)
+ infoPtr->Sync = DualPermedia3Sync;
+ else
+ infoPtr->Sync = Permedia3Sync;
+
+ Permedia3InitializeEngine(pScrn);
/* Clipping Setup */
infoPtr->ClippingFlags = 0;
- /* This does not work correctly, i don't know why, but i guess it is
- * because the clipping stuff is not ok ...
- * Let's disable it for now (also in the respective functions, we
- * clear the UserScissorEnable bit in Render2D.
- HARDWARE_CLIP_MONO_8x8_FILL |
- HARDWARE_CLIP_SOLID_FILL;
- */
infoPtr->SetClippingRectangle = Permedia3SetClippingRectangle;
infoPtr->DisableClipping = Permedia3DisableClipping;
/* ScreenToScreenCopy */
- infoPtr->ScreenToScreenCopyFlags =
- NO_TRANSPARENCY;
+ infoPtr->ScreenToScreenCopyFlags = NO_TRANSPARENCY;
infoPtr->SetupForScreenToScreenCopy =
- Permedia3SetupForScreenToScreenCopy;
+ Permedia3SetupForScreenToScreenCopy;
infoPtr->SubsequentScreenToScreenCopy =
- Permedia3SubsequentScreenToScreenCopy;
+ Permedia3SubsequentScreenToScreenCopy;
/* SolidFill */
infoPtr->SolidFillFlags = 0;
@@ -397,80 +400,84 @@ Permedia3AccelInit(ScreenPtr pScreen)
infoPtr->SubsequentSolidFillRect = Permedia3SubsequentFillRectSolid;
/* 8x8 Mono Pattern Fills */
- infoPtr->Mono8x8PatternFillFlags =
- HARDWARE_PATTERN_PROGRAMMED_ORIGIN |
- HARDWARE_PATTERN_PROGRAMMED_BITS |
- HARDWARE_PATTERN_SCREEN_ORIGIN |
- BIT_ORDER_IN_BYTE_LSBFIRST;
+ infoPtr->Mono8x8PatternFillFlags = HARDWARE_PATTERN_PROGRAMMED_BITS |
+ HARDWARE_PATTERN_PROGRAMMED_ORIGIN |
+ HARDWARE_PATTERN_SCREEN_ORIGIN |
+ BIT_ORDER_IN_BYTE_LSBFIRST;
infoPtr->SetupForMono8x8PatternFill =
- Permedia3SetupForMono8x8PatternFill;
+ Permedia3SetupForMono8x8PatternFill;
infoPtr->SubsequentMono8x8PatternFillRect =
- Permedia3SubsequentMono8x8PatternFillRect;
+ Permedia3SubsequentMono8x8PatternFillRect;
+
+ infoPtr->ScanlineCPUToScreenColorExpandFillFlags =
+ LEFT_EDGE_CLIPPING |
+ LEFT_EDGE_CLIPPING_NEGATIVE_X |
+ BIT_ORDER_IN_BYTE_LSBFIRST |
+ CPU_TRANSFER_PAD_DWORD;
+
+ infoPtr->NumScanlineColorExpandBuffers = 1;
+ pGlint->ScratchBuffer = xalloc(((pScrn->virtualX+62)/32*4)
+ + (pScrn->virtualX
+ * pScrn->bitsPerPixel / 8));
+ infoPtr->ScanlineColorExpandBuffers =
+ pGlint->XAAScanlineColorExpandBuffers;
+ pGlint->XAAScanlineColorExpandBuffers[0] =
+ pGlint->IOBase + OutputFIFO + 4;
+
+ infoPtr->SetupForScanlineCPUToScreenColorExpandFill =
+ Permedia3SetupForScanlineCPUToScreenColorExpandFill;
+ infoPtr->SubsequentScanlineCPUToScreenColorExpandFill =
+ Permedia3SubsequentScanlineCPUToScreenColorExpandFill;
+ infoPtr->SubsequentColorExpandScanline =
+ Permedia3SubsequentColorExpandScanline;
+
+ infoPtr->ScanlineImageWriteFlags = NO_GXCOPY |
+ LEFT_EDGE_CLIPPING |
+ LEFT_EDGE_CLIPPING_NEGATIVE_X |
+ BIT_ORDER_IN_BYTE_LSBFIRST |
+ CPU_TRANSFER_PAD_DWORD;
+ infoPtr->NumScanlineImageWriteBuffers = 1;
+ infoPtr->ScanlineImageWriteBuffers =
+ pGlint->XAAScanlineColorExpandBuffers;
+ infoPtr->SetupForScanlineImageWrite =
+ Permedia3SetupForScanlineImageWrite;
+ infoPtr->SubsequentScanlineImageWriteRect =
+ Permedia3SubsequentScanlineImageWriteRect;
+ infoPtr->SubsequentImageWriteScanline =
+ Permedia3SubsequentImageWriteScanline;
-#if USE_DIRECT_FIFO_WRITES
- /* Direct Fifo Bitmap Writes */
- infoPtr->WriteBitmapFlags = 0;
infoPtr->WriteBitmap = Permedia3WriteBitmap;
-#endif
+ infoPtr->WriteBitmapFlags = 0;
- /* Color Expand Fills */
- infoPtr->CPUToScreenColorExpandFillFlags =
- /*
- SYNC_AFTER_COLOR_EXPAND |
- */
- LEFT_EDGE_CLIPPING |
- BIT_ORDER_IN_BYTE_LSBFIRST |
- CPU_TRANSFER_BASE_FIXED |
- CPU_TRANSFER_PAD_DWORD;
- infoPtr->ColorExpandBase = pGlint->IOBase + BitMaskPattern;
- infoPtr->ColorExpandRange = 4;
- infoPtr->SetupForCPUToScreenColorExpandFill =
- Permedia3SetupForCPUToScreenColorExpandFill;
- infoPtr->SubsequentCPUToScreenColorExpandFill =
- Permedia3SubsequentCPUToScreenColorExpandFill;
-
-#if USE_DIRECT_FIFO_WRITES
- /* Direct Fifo Images Writes */
- infoPtr->WritePixmapFlags = 0;
infoPtr->WritePixmap = Permedia3WritePixmap;
-#else
- /* Images Writes */
- infoPtr->ImageWriteFlags =
- NO_GXCOPY |
- /*
- SYNC_AFTER_IMAGE_WRITE |
- */
- LEFT_EDGE_CLIPPING |
- LEFT_EDGE_CLIPPING_NEGATIVE_X |
- BIT_ORDER_IN_BYTE_LSBFIRST |
- CPU_TRANSFER_BASE_FIXED |
- CPU_TRANSFER_PAD_DWORD;
- infoPtr->ImageWriteBase = pGlint->IOBase + PM3FBSourceData;
- infoPtr->ImageWriteRange = 4;
- infoPtr->SetupForImageWrite =
- Permedia3SetupForImageWrite;
- infoPtr->SubsequentImageWriteRect =
- Permedia3SubsequentImageWriteRect;
-#endif
+ infoPtr->WritePixmapFlags = 0;
/* Available Framebuffer Area for XAA. */
AvailFBArea.x1 = 0;
AvailFBArea.y1 = 0;
AvailFBArea.x2 = pScrn->displayWidth;
- AvailFBArea.y2 = pGlint->FbMapSize / (pScrn->displayWidth *
- pScrn->bitsPerPixel / 8);
- /* Alan does this ???
+ /* X coords are short's so we have to do this to make sure we dont wrap*/
AvailFBArea.y2 = ((pGlint->FbMapSize > 16384*1024) ? 16384*1024 :
- pGlint->FbMapSize) / (pScrn->displayWidth
+ pGlint->FbMapSize) / (pScrn->displayWidth *
pScrn->bitsPerPixel / 8);
- */
/* Permedia3 has a maximum 4096x4096 framebuffer */
if (AvailFBArea.y2 > 4095) AvailFBArea.y2 = 4095;
+ {
+ Bool shared_accel = FALSE;
+ int i;
+
+ for(i = 0; i < pScrn->numEntities; i++) {
+ if(xf86IsEntityShared(pScrn->entityList[i]))
+ shared_accel = TRUE;
+ }
+ if(shared_accel == TRUE)
+ infoPtr->RestoreAccelState = Permedia3RestoreAccelState;
+ }
+
xf86InitFBManager(pScreen, &AvailFBArea);
- Permedia3Sync(pScrn);
return(XAAInit(pScreen, infoPtr));
}
@@ -491,11 +498,41 @@ Permedia3Sync(ScrnInfoPtr pScrn)
CHECKCLIPPING;
while (GLINT_READ_REG(DMACount) != 0);
- GLINT_WAIT(1);
+ GLINT_WAIT(2);
+ GLINT_WRITE_REG(0x400, FilterMode);
GLINT_WRITE_REG(0, GlintSync);
do {
while(GLINT_READ_REG(OutFIFOWords) == 0);
- } while (GLINT_READ_REG(OutputFIFO) != PM3SyncTag);
+ } while (GLINT_READ_REG(OutputFIFO) != Sync_tag);
+}
+
+void
+DualPermedia3Sync(
+ ScrnInfoPtr pScrn
+){
+ GLINTPtr pGlint = GLINTPTR(pScrn);
+
+ CHECKCLIPPING;
+
+ while (GLINT_READ_REG(DMACount) != 0);
+ GLINT_WAIT(3);
+ GLINT_WRITE_REG(3, BroadcastMask); /* hack! this shouldn't need to be reloaded */
+ GLINT_WRITE_REG(0x400, FilterMode);
+ GLINT_WRITE_REG(0, GlintSync);
+
+ /* Read 1st PM3 until Sync Tag shows */
+ ACCESSCHIP1();
+ do {
+ while(GLINT_READ_REG(OutFIFOWords) == 0);
+ } while (GLINT_READ_REG(OutputFIFO) != Sync_tag);
+
+ ACCESSCHIP2();
+ /* Read 2nd PM3 until Sync Tag shows */
+ do {
+ while(GLINT_READ_REG(OutFIFOWords) == 0);
+ } while (GLINT_READ_REG(OutputFIFO) != Sync_tag);
+
+ ACCESSCHIP1();
}
static void
@@ -523,26 +560,34 @@ Permedia3SetupForScreenToScreenCopy(ScrnInfoPtr pScrn,
{
GLINTPtr pGlint = GLINTPTR(pScrn);
TRACE_ENTER("Permedia3SetupForScreenToScreenCopy");
+
pGlint->PM3_Render2D =
PM3Render2D_SpanOperation |
PM3Render2D_Operation_Normal;
+
pGlint->ClippingOn = TRUE;
+
pGlint->PM3_Config2D =
PM3Config2D_UserScissorEnable |
PM3Config2D_ForegroundROPEnable |
PM3Config2D_ForegroundROP(rop) |
PM3Config2D_FBWriteEnable;
+
if (xdir == 1) pGlint->PM3_Render2D |= PM3Render2D_XPositive;
if (ydir == 1) pGlint->PM3_Render2D |= PM3Render2D_YPositive;
+
if ((rop!=GXclear)&&(rop!=GXset)&&(rop!=GXnoop)&&(rop!=GXinvert)) {
pGlint->PM3_Render2D |= PM3Render2D_FBSourceReadEnable;
pGlint->PM3_Config2D |= PM3Config2D_Blocking;
}
+
if ((rop!=GXclear)&&(rop!=GXset)&&(rop!=GXcopy)&&(rop!=GXcopyInverted))
pGlint->PM3_Config2D |= PM3Config2D_FBDestReadEnable;
+
GLINT_WAIT(2);
DO_PLANEMASK(planemask);
GLINT_WRITE_REG(pGlint->PM3_Config2D, PM3Config2D);
+
TRACE_EXIT("Permedia3SetupForScreenToScreenCopy");
}
static void
@@ -578,10 +623,8 @@ Permedia3SetupForFillRectSolid(ScrnInfoPtr pScrn, int color,
{
GLINTPtr pGlint = GLINTPTR(pScrn);
TRACE_ENTER("Permedia3SetupForFillRectSolid");
- REPLICATE(color);
- /* Prepapre Common Render2D & Config2D data */
+ /* Prepare Common Render2D & Config2D data */
pGlint->PM3_Render2D =
- PM3Render2D_SpanOperation |
PM3Render2D_XPositive |
PM3Render2D_YPositive |
PM3Render2D_Operation_Normal;
@@ -590,28 +633,42 @@ Permedia3SetupForFillRectSolid(ScrnInfoPtr pScrn, int color,
PM3Config2D_ForegroundROPEnable |
PM3Config2D_ForegroundROP(rop) |
PM3Config2D_FBWriteEnable;
- if ((rop!=GXclear)&&(rop!=GXset)&&(rop!=GXcopy)&&(rop!=GXcopyInverted))
- pGlint->PM3_Config2D |= PM3Config2D_FBDestReadEnable;
- /* Clipping is not working ok yet, let's disable it.
- if (pGlint->ClippingOn)
- pGlint->PM3_Config2D |= PM3Config2D_UserScissorEnable;
- */
GLINT_WAIT(3);
- /* Using FBClockColor (have to disable SpanOperation) will fill only the
- * first 32 pixels of the 64 pixels of a span. Lets use ForegroundColor
- * instead (from the LogicOps unit)
- GLINT_WRITE_REG(color, PM3FBBlockColor);
+ REPLICATE(color);
+ /* We can't do block fills properly at 32bpp, so we can stick the chip
+ * into 16bpp and double the width and xcoord, but it seems that at
+ * extremely high resolutions (above 1600) it doesn't fill.
+ * so, we fall back to the slower span filling method.
*/
- GLINT_WRITE_REG(color, PM3ForegroundColor);
+ if ((rop == GXcopy) && (pScrn->bitsPerPixel == 32) &&
+ (pScrn->displayWidth <= 1600)) {
+ pGlint->AccelInfoRec->SubsequentSolidFillRect =
+ Permedia3SubsequentFillRectSolid32bpp;
+ GLINT_WRITE_REG(color, PM3FBBlockColor);
+ } else {
+ pGlint->AccelInfoRec->SubsequentSolidFillRect =
+ Permedia3SubsequentFillRectSolid;
+ /* Can't do block fills at 8bpp either */
+ if ((rop == GXcopy) && (pScrn->bitsPerPixel == 16)) {
+ GLINT_WRITE_REG(color, PM3FBBlockColor);
+ } else {
+ pGlint->PM3_Render2D |= PM3Render2D_SpanOperation;
+ GLINT_WRITE_REG(color, PM3ForegroundColor);
+ }
+ }
+ if ((rop!=GXclear)&&(rop!=GXset)&&(rop!=GXcopy)&&(rop!=GXcopyInverted))
+ pGlint->PM3_Config2D |= PM3Config2D_FBDestReadEnable;
DO_PLANEMASK(planemask);
GLINT_WRITE_REG(pGlint->PM3_Config2D, PM3Config2D);
TRACE_EXIT("Permedia3SetupForFillRectSolid");
}
+
static void
Permedia3SubsequentFillRectSolid(ScrnInfoPtr pScrn, int x, int y, int w, int h)
{
GLINTPtr pGlint = GLINTPTR(pScrn);
TRACE_ENTER("Permedia3SubsequentFillRectSolid");
+
GLINT_WAIT(2);
GLINT_WRITE_REG(
PM3RectanglePosition_XOffset(x) |
@@ -620,8 +677,42 @@ Permedia3SubsequentFillRectSolid(ScrnInfoPtr pScrn, int x, int y, int w, int h)
GLINT_WRITE_REG(pGlint->PM3_Render2D |
PM3Render2D_Width(w) | PM3Render2D_Height(h),
PM3Render2D);
+
TRACE_EXIT("Permedia3SubsequentFillRectSolid");
}
+
+static void
+Permedia3SubsequentFillRectSolid32bpp(ScrnInfoPtr pScrn, int x, int y, int w, int h)
+{
+ GLINTPtr pGlint = GLINTPTR(pScrn);
+ TRACE_ENTER("Permedia3SubsequentFillRectSolid32bpp");
+
+ GLINT_WAIT(6);
+
+ /* Put the chip into 16bpp mode */
+ GLINT_WRITE_REG(1, PixelSize);
+ /* Now double the displayWidth */
+ GLINT_WRITE_REG(
+ PM3FBWriteBufferWidth_Width(pScrn->displayWidth<<1),
+ PM3FBWriteBufferWidth0);
+
+ /* and double the x,w coords */
+ GLINT_WRITE_REG(
+ PM3RectanglePosition_XOffset(x<<1) |
+ PM3RectanglePosition_YOffset(y),
+ PM3RectanglePosition);
+ GLINT_WRITE_REG(pGlint->PM3_Render2D |
+ PM3Render2D_Width(w<<1) | PM3Render2D_Height(h),
+ PM3Render2D);
+
+ /* Now fixup */
+ GLINT_WRITE_REG(
+ PM3FBWriteBufferWidth_Width(pScrn->displayWidth),
+ PM3FBWriteBufferWidth0);
+ GLINT_WRITE_REG(0, PixelSize);
+ TRACE_EXIT("Permedia3SubsequentFillRectSolid32bpp");
+}
+
/* 8x8 Mono Pattern Fills */
static void
Permedia3SetupForMono8x8PatternFill(ScrnInfoPtr pScrn,
@@ -645,10 +736,6 @@ Permedia3SetupForMono8x8PatternFill(ScrnInfoPtr pScrn,
PM3Config2D_FBWriteEnable;
if ((rop!=GXclear)&&(rop!=GXset)&&(rop!=GXcopy)&&(rop!=GXcopyInverted))
pGlint->PM3_Config2D |= PM3Config2D_FBDestReadEnable;
- /* Clipping is not working correctly yet ...
- if (pGlint->ClippingOn)
- pGlint->PM3_Config2D |= PM3Config2D_UserScissorEnable;
- */
pGlint->PM3_AreaStippleMode = 1;
/* Mirror stipple pattern horizontally */
#if X_BYTE_ORDER == X_BIG_ENDIAN
@@ -699,12 +786,15 @@ Permedia3SubsequentMono8x8PatternFillRect(ScrnInfoPtr pScrn,
TRACE_EXIT("Permedia3SubsequentMono8x8PatternFillRect");
}
-/* Color Expansion Fills */
-static void Permedia3SetupForCPUToScreenColorExpandFill(ScrnInfoPtr pScrn,
- int fg, int bg, int rop,unsigned int planemask)
-{
+static void
+Permedia3SetupForScanlineCPUToScreenColorExpandFill(
+ ScrnInfoPtr pScrn,
+ int fg, int bg,
+ int rop,
+ unsigned int planemask
+){
GLINTPtr pGlint = GLINTPTR(pScrn);
- TRACE_ENTER("Permedia3SetupForCPUToScreenColorExpandFill");
+
REPLICATE(fg);
pGlint->PM3_Render2D =
PM3Render2D_SpanOperation |
@@ -729,14 +819,23 @@ static void Permedia3SetupForCPUToScreenColorExpandFill(ScrnInfoPtr pScrn,
GLINT_WRITE_REG(fg, PM3ForegroundColor);
DO_PLANEMASK(planemask);
GLINT_WRITE_REG(pGlint->PM3_Config2D, PM3Config2D);
- TRACE_EXIT("Permedia3SetupForCPUToScreenColorExpandFill");
}
-static void Permedia3SubsequentCPUToScreenColorExpandFill(ScrnInfoPtr pScrn,
- int x, int y, int w, int h, int skipleft)
-{
+
+static void
+Permedia3SubsequentScanlineCPUToScreenColorExpandFill(
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h,
+ int skipleft
+){
GLINTPtr pGlint = GLINTPTR(pScrn);
- TRACE_ENTER("Permedia3SubsequentCPUToScreenColorExpandFill");
- GLINT_WAIT(4);
+
+ TRACE_ENTER("Permedia2SubsequentScanlineCPUToScreenColorExpandFill");
+
+ pGlint->dwords = ((w + 31) >> 5); /* dwords per scanline */
+
+ pGlint->cpucount = h;
+
+ GLINT_WAIT(5);
GLINT_WRITE_REG(((y&0x0fff)<<16)|((x+skipleft)&0x0fff), ScissorMinXY);
GLINT_WRITE_REG((((y+h)&0x0fff)<<16)|((x+w)&0x0fff), ScissorMaxXY);
GLINT_WRITE_REG(
@@ -746,16 +845,55 @@ static void Permedia3SubsequentCPUToScreenColorExpandFill(ScrnInfoPtr pScrn,
GLINT_WRITE_REG(pGlint->PM3_Render2D |
PM3Render2D_Width(w) | PM3Render2D_Height(h),
PM3Render2D);
- TRACE_EXIT("Permedia3SubsequentCPUToScreenColorExpandFill");
+
+ if ((pGlint->dwords*h) < pGlint->FIFOSize) {
+ /* Turn on direct for less than 120 dword colour expansion */
+ pGlint->XAAScanlineColorExpandBuffers[0] = pGlint->IOBase+OutputFIFO+4;
+ pGlint->ScanlineDirect = 1;
+ GLINT_WRITE_REG(((pGlint->dwords*h)-1)<<16 | 0x0D, OutputFIFO);
+ GLINT_WAIT(pGlint->dwords*h);
+ } else {
+ /* Use indirect for anything else */
+ pGlint->XAAScanlineColorExpandBuffers[0] = pGlint->ScratchBuffer;
+ pGlint->ScanlineDirect = 0;
+ }
+
+ pGlint->cpucount--;
}
+static void
+Permedia3SubsequentColorExpandScanline(ScrnInfoPtr pScrn, int bufno)
+{
+ GLINTPtr pGlint = GLINTPTR(pScrn);
+ CARD32 *srcp = (CARD32*)pGlint->XAAScanlineColorExpandBuffers[bufno];
+ int dwords = pGlint->dwords;
+
+ if (!pGlint->ScanlineDirect) {
+ while(dwords >= pGlint->FIFOSize) {
+ GLINT_WAIT(pGlint->FIFOSize);
+ GLINT_WRITE_REG(((pGlint->FIFOSize - 2) << 16) | 0x0D, OutputFIFO);
+ GLINT_MoveDWORDS(
+ (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
+ (CARD32*)srcp, pGlint->FIFOSize - 1);
+ dwords -= pGlint->FIFOSize - 1;
+ srcp += pGlint->FIFOSize - 1;
+ }
+ if(dwords) {
+ GLINT_WAIT(dwords + 1);
+ GLINT_WRITE_REG(((dwords - 1) << 16) | 0x0D, OutputFIFO);
+ GLINT_MoveDWORDS(
+ (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
+ (CARD32*)srcp, dwords);
+ }
+ }
+}
/* Images Writes */
-static void Permedia3SetupForImageWrite(ScrnInfoPtr pScrn, int rop,
+static void Permedia3SetupForScanlineImageWrite(ScrnInfoPtr pScrn, int rop,
unsigned int planemask, int trans_color, int bpp, int depth)
{
GLINTPtr pGlint = GLINTPTR(pScrn);
- TRACE_ENTER("Permedia3SetupForImageWrite");
+ TRACE_ENTER("Permedia3SetupForScanlineImageWrite");
pGlint->PM3_Render2D =
PM3Render2D_SpanOperation |
PM3Render2D_XPositive |
@@ -771,14 +909,18 @@ static void Permedia3SetupForImageWrite(ScrnInfoPtr pScrn, int rop,
GLINT_WAIT(2);
DO_PLANEMASK(planemask);
GLINT_WRITE_REG(pGlint->PM3_Config2D, PM3Config2D);
- TRACE_EXIT("Permedia3SetupForImageWrite");
+ TRACE_EXIT("Permedia3SetupForScanlineImageWrite");
}
-static void Permedia3SubsequentImageWriteRect(ScrnInfoPtr pScrn,
+
+static void Permedia3SubsequentScanlineImageWriteRect(ScrnInfoPtr pScrn,
int x, int y, int w, int h, int skipleft)
{
GLINTPtr pGlint = GLINTPTR(pScrn);
- TRACE_ENTER("Permedia3SubsequentImageWrite");
- GLINT_WAIT(4);
+ TRACE_ENTER("Permedia3SubsequentScanlineImageWrite");
+ pGlint->dwords = (((w * pScrn->bitsPerPixel) + 3) >> 2); /* per scanline */
+
+ pGlint->cpucount = h;
+ GLINT_WAIT(5);
GLINT_WRITE_REG(((y&0x0fff)<<16)|((x+skipleft)&0x0fff), ScissorMinXY);
GLINT_WRITE_REG((((y+h)&0x0fff)<<16)|((x+w)&0x0fff), ScissorMaxXY);
GLINT_WRITE_REG(
@@ -788,81 +930,62 @@ static void Permedia3SubsequentImageWriteRect(ScrnInfoPtr pScrn,
GLINT_WRITE_REG(pGlint->PM3_Render2D |
PM3Render2D_Width(w) | PM3Render2D_Height(h),
PM3Render2D);
- TRACE_EXIT("Permedia3SubsequentImageWrite");
-}
+ if (pGlint->dwords < pGlint->FIFOSize) {
+ /* Turn on direct for less than 120 dword colour expansion */
+ pGlint->XAAScanlineColorExpandBuffers[0] = pGlint->IOBase+OutputFIFO+4;
+ pGlint->ScanlineDirect = 1;
+ GLINT_WRITE_REG(((pGlint->dwords*h)-1)<<16 | (0x15<<4) | 0x05,
+ OutputFIFO);
+ GLINT_WAIT(pGlint->dwords);
+ } else {
+ /* Use indirect for anything else */
+ pGlint->XAAScanlineColorExpandBuffers[0] = pGlint->ScratchBuffer;
+ pGlint->ScanlineDirect = 0;
+ }
-/* Defines for Direct Fifo access */
-
-#define WriteRange 120
-#define PciRetryWriteRange 1023
-#define WriteBase_Fixed ((CARD32 *)(pGlint->IOBase + PM3FBSourceData))
-#define WriteBase ((CARD32 *)(pGlint->IOBase + OutputFIFO + 4))
-
-/* Direct Fifo Bitmap Writes */
+ pGlint->cpucount--;
+ TRACE_EXIT("Permedia3SubsequentScanlineImageWrite");
+}
static void
-Permedia3WriteBitmap(ScrnInfoPtr pScrn,
- int x, int y, int w, int h,
- unsigned char *src,
- int srcwidth, int skipleft,
- int fg, int bg, int rop,
- unsigned int planemask
-)
+Permedia3SubsequentImageWriteScanline(ScrnInfoPtr pScrn, int bufno)
{
- int dwords;
- int ApertureRange;
GLINTPtr pGlint = GLINTPTR(pScrn);
- TRACE_ENTER("Permedia3WriteBitmap");
+ int dwords = pGlint->dwords;
- w += skipleft;
- x -= skipleft;
- dwords = (w + 31) >>5;
- if (pGlint->UsePCIRetry) ApertureRange = PciRetryWriteRange;
- else ApertureRange = WriteRange;
-
- /* width of the stuff to copy in 32 bit words */
- Permedia3SetupForCPUToScreenColorExpandFill(pScrn, fg, bg, rop, planemask);
- Permedia3SubsequentCPUToScreenColorExpandFill(pScrn, x, y, w, h, skipleft);
-
- if (dwords > ApertureRange) {
- while(h--) {
- XAAMoveDWORDS_FixedBase(WriteBase_Fixed, (CARD32*)src, dwords);
- src += srcwidth;
- }
+ if (pGlint->ScanlineDirect) {
+ if (pGlint->cpucount--)
+ GLINT_WAIT(dwords);
+ return;
} else {
- /* the src is exatcly as wide as the target rectangle. We copy all
- * of it, so no need to separate stuff by scanline */
- if(srcwidth == (dwords << 5)) {
- /* decrement contains the number of lines that can be
- * put in the fifo */
- int decrement = ApertureRange/dwords;
-
- while(h > decrement) {
- GLINT_WAIT(dwords * decrement);
- GLINT_WRITE_REG((((dwords * decrement)-1) << 16) | 0xd,
- OutputFIFO);
- XAAMoveDWORDS(WriteBase, (CARD32*)src, dwords * decrement);
- src += (srcwidth * decrement);
- h -= decrement;
- }
- if(h) {
- GLINT_WAIT(dwords * h);
- GLINT_WRITE_REG((((dwords * h)-1) << 16) | 0xd, OutputFIFO);
- XAAMoveDWORDS(WriteBase, (CARD32*)src, dwords * h);
- }
- } else {
- while(h--) {
- GLINT_WAIT(dwords);
- GLINT_WRITE_REG(((dwords-1) << 16) | 0xd, OutputFIFO);
- XAAMoveDWORDS(WriteBase, (CARD32*)src, dwords);
- src += srcwidth;
- }
+ while(dwords >= pGlint->FIFOSize) {
+ GLINT_WAIT(pGlint->FIFOSize);
+ GLINT_WRITE_REG(((pGlint->FIFOSize - 2) << 16) | (0x15 << 4) |
+ 0x05, OutputFIFO);
+ GLINT_MoveDWORDS(
+ (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
+ (CARD32*)pGlint->XAAScanlineColorExpandBuffers[bufno],
+ pGlint->FIFOSize - 1);
+ dwords -= pGlint->FIFOSize - 1;
+ }
+ if(dwords) {
+ GLINT_WAIT(dwords + 1);
+ GLINT_WRITE_REG(((dwords - 1) << 16) | (0x15 << 4) |
+ 0x05, OutputFIFO);
+ GLINT_MoveDWORDS(
+ (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
+ (CARD32*)pGlint->XAAScanlineColorExpandBuffers[bufno],
+ dwords);
}
}
- TRACE_EXIT("Permedia3WriteBitmap");
}
-/* Direct Fifo Images Writes */
+
+static void
+Permedia3RestoreAccelState(ScrnInfoPtr pScrn)
+{
+ Permedia3Sync(pScrn);
+}
static void
Permedia3WritePixmap(
@@ -877,9 +1000,10 @@ Permedia3WritePixmap(
)
{
int dwords;
+ int count;
int skipleft = (long)src & 0x03L;
int Bpp = bpp >> 3;
- int ApertureRange;
+ CARD32 *srcp;
GLINTPtr pGlint = GLINTPTR(pScrn);
TRACE_ENTER("Permedia3WritePixmap");
@@ -893,51 +1017,143 @@ Permedia3WritePixmap(
x -= skipleft;
w += skipleft;
-
+
src = (unsigned char*)((long)src & ~0x03L);
}
- Permedia3SetupForImageWrite(pScrn, rop, planemask, trans, bpp, depth);
- Permedia3SubsequentImageWriteRect(pScrn, x, y, w, h, skipleft);
+ pGlint->PM3_Render2D =
+ PM3Render2D_SpanOperation |
+ PM3Render2D_XPositive |
+ PM3Render2D_YPositive |
+ PM3Render2D_Operation_SyncOnHostData;
+ pGlint->PM3_Config2D =
+ PM3Config2D_UserScissorEnable |
+ PM3Config2D_ForegroundROPEnable |
+ PM3Config2D_ForegroundROP(rop) |
+ PM3Config2D_FBWriteEnable;
+ if ((rop!=GXclear)&&(rop!=GXset)&&(rop!=GXcopy)&&(rop!=GXcopyInverted))
+ pGlint->PM3_Config2D |= PM3Config2D_FBDestReadEnable;
+ GLINT_WAIT(6);
+ DO_PLANEMASK(planemask);
+ GLINT_WRITE_REG(pGlint->PM3_Config2D, PM3Config2D);
+ GLINT_WRITE_REG(((y&0x0fff)<<16)|((x+skipleft)&0x0fff), ScissorMinXY);
+ GLINT_WRITE_REG((((y+h)&0x0fff)<<16)|((x+w)&0x0fff), ScissorMaxXY);
+ GLINT_WRITE_REG(
+ PM3RectanglePosition_XOffset(x) |
+ PM3RectanglePosition_YOffset(y),
+ PM3RectanglePosition);
+ GLINT_WRITE_REG(pGlint->PM3_Render2D |
+ PM3Render2D_Width(w) | PM3Render2D_Height(h),
+ PM3Render2D);
/* width of the stuff to copy in 32 bit words */
dwords = ((w * Bpp) + 3) >> 2;
- if (pGlint->UsePCIRetry) ApertureRange = PciRetryWriteRange;
- else ApertureRange = WriteRange;
- if (dwords > ApertureRange) {
- while(h--) {
- XAAMoveDWORDS_FixedBase(WriteBase_Fixed, (CARD32*)src, dwords);
- src += srcwidth;
+ while(h--) {
+ count = dwords;
+ srcp = (CARD32*)src;
+ while(count >= pGlint->FIFOSize) {
+ GLINT_WAIT(pGlint->FIFOSize);
+ /* (0x15 << 4) | 0x05 is the TAG for FBSourceData */
+ GLINT_WRITE_REG(((pGlint->FIFOSize - 2) << 16) | (0x15 << 4) |
+ 0x05, OutputFIFO);
+ GLINT_MoveDWORDS(
+ (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
+ (CARD32*)srcp, pGlint->FIFOSize - 1);
+ count -= pGlint->FIFOSize - 1;
+ srcp += pGlint->FIFOSize - 1;
}
- } else {
- /* the src is exatcly as wide as the target rectangle. We copy all
- * of it, so no need to separate stuff by scanline */
- if(srcwidth == (dwords << 2)) {
- /* decrement contains the number of lines that can be
- * put in the fifo */
- int decrement = ApertureRange/dwords;
-
- while(h > decrement) {
- GLINT_WAIT(dwords * decrement);
- GLINT_WRITE_REG((((dwords * decrement)-1) << 16) | 0x155,
- OutputFIFO);
- XAAMoveDWORDS(WriteBase, (CARD32*)src, dwords * decrement);
- src += (srcwidth * decrement);
- h -= decrement;
- }
- if(h) {
- GLINT_WAIT(dwords * h);
- GLINT_WRITE_REG((((dwords * h)-1) << 16) | 0x155, OutputFIFO);
- XAAMoveDWORDS(WriteBase, (CARD32*)src, dwords * h);
- }
- } else {
- while(h--) {
- GLINT_WAIT(dwords);
- GLINT_WRITE_REG(((dwords-1) << 16) | 0x155, OutputFIFO);
- XAAMoveDWORDS(WriteBase, (CARD32*)src, dwords);
- src += srcwidth;
- }
+ if(count) {
+ GLINT_WAIT(count + 1);
+ /* (0x15 << 4) | 0x05 is the TAG for FBSourceData */
+ GLINT_WRITE_REG(((count - 1) << 16) | (0x15 << 4) |
+ 0x05, OutputFIFO);
+ GLINT_MoveDWORDS(
+ (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
+ (CARD32*)srcp, count);
}
+ src += srcwidth;
+ }
+
+ Permedia3DisableClipping(pScrn);
+ Permedia3Sync(pScrn);
+}
+
+static void
+Permedia3WriteBitmap(ScrnInfoPtr pScrn,
+ int x, int y, int w, int h,
+ unsigned char *src,
+ int srcwidth, int skipleft,
+ int fg, int bg, int rop,
+ unsigned int planemask
+)
+{
+ int dwords;
+ GLINTPtr pGlint = GLINTPTR(pScrn);
+ int count;
+ CARD32 *srcp;
+ TRACE_ENTER("Permedia3WriteBitmap");
+
+ w += skipleft;
+ x -= skipleft;
+ dwords = (w + 31) >>5;
+
+ REPLICATE(fg);
+ pGlint->PM3_Render2D =
+ PM3Render2D_SpanOperation |
+ PM3Render2D_XPositive |
+ PM3Render2D_YPositive |
+ PM3Render2D_Operation_SyncOnBitMask;
+ pGlint->PM3_Config2D =
+ PM3Config2D_UserScissorEnable |
+ PM3Config2D_UseConstantSource |
+ PM3Config2D_ForegroundROPEnable |
+ PM3Config2D_ForegroundROP(rop) |
+ PM3Config2D_FBWriteEnable;
+ if ((rop!=GXclear)&&(rop!=GXset)&&(rop!=GXcopy)&&(rop!=GXcopyInverted))
+ pGlint->PM3_Config2D |= PM3Config2D_FBDestReadEnable;
+ if (bg != -1) {
+ REPLICATE(bg);
+ pGlint->PM3_Config2D |= PM3Config2D_OpaqueSpan;
+ GLINT_WAIT(8);
+ GLINT_WRITE_REG(bg, BackgroundColor);
}
- TRACE_EXIT("Permedia3WritePixmap");
+ else GLINT_WAIT(7);
+ GLINT_WRITE_REG(fg, PM3ForegroundColor);
+ DO_PLANEMASK(planemask);
+ GLINT_WRITE_REG(pGlint->PM3_Config2D, PM3Config2D);
+ GLINT_WRITE_REG(((y&0x0fff)<<16)|((x+skipleft)&0x0fff), ScissorMinXY);
+ GLINT_WRITE_REG((((y+h)&0x0fff)<<16)|((x+w)&0x0fff), ScissorMaxXY);
+ GLINT_WRITE_REG(
+ PM3RectanglePosition_XOffset(x) |
+ PM3RectanglePosition_YOffset(y),
+ PM3RectanglePosition);
+ GLINT_WRITE_REG(pGlint->PM3_Render2D |
+ PM3Render2D_Width(w) | PM3Render2D_Height(h),
+ PM3Render2D);
+
+ while(h--) {
+ count = dwords;
+ srcp = (CARD32*)src;
+ while(count >= pGlint->FIFOSize) {
+ GLINT_WAIT(pGlint->FIFOSize);
+ GLINT_WRITE_REG(((pGlint->FIFOSize - 2) << 16) |
+ 0x0D, OutputFIFO);
+ GLINT_MoveDWORDS(
+ (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
+ (CARD32*)srcp, pGlint->FIFOSize - 1);
+ count -= pGlint->FIFOSize - 1;
+ srcp += pGlint->FIFOSize - 1;
+ }
+ if(count) {
+ GLINT_WAIT(count + 1);
+ GLINT_WRITE_REG(((count - 1) << 16) | 0x0D, OutputFIFO);
+ GLINT_MoveDWORDS(
+ (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
+ (CARD32*)srcp, count);
+ }
+ src += srcwidth;
+ }
+
+ Permedia3DisableClipping(pScrn);
+ Permedia3Sync(pScrn);
}
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 467d9674f..2cdcbbea4 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_dac.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_dac.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2000 by Sven Luther <luther@dpt-info.u-strasbg.fr>.
+ * Copyright 2000,2001 by Sven Luther <luther@dpt-info.u-strasbg.fr>.
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -21,11 +21,12 @@
*
* Authors: Sven Luther, <luther@dpt-info.u-strasbg.fr>
* Thomas Witzel, <twitzel@nmr.mgh.harvard.edu>
+ * Alan Hourihane, <alanh@fairlite.demon.co.uk>
*
* this work is sponsored by Appian Graphics.
*
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_dac.c,v 1.8 2000/10/26 13:41:32 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_dac.c,v 1.18 2001/02/05 10:44:58 alanh Exp $ */
#include "xf86.h"
#include "xf86_OSproc.h"
@@ -50,104 +51,78 @@
# define TRACE(str)
#endif
-int PM3QuickFillMemory(ScrnInfoPtr pScrn,int size);
-
int
-PM3QuickFillMemory(ScrnInfoPtr pScrn,int size)
+Permedia3MemorySizeDetect(ScrnInfoPtr pScrn)
{
GLINTPtr pGlint = GLINTPTR (pScrn);
- unsigned int * p;
- unsigned int p_content;
- unsigned int i, j;
- long savemapsize;
-
- savemapsize = pGlint->FbMapSize;
- pGlint->FbMapSize = size*1024*1024;
-
- pGlint->FbBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER,
- pGlint->PciTag, pGlint->FbAddress, pGlint->FbMapSize);
- if (pGlint->FbBase == NULL) {
- pGlint->FbMapSize = savemapsize;
- return FALSE;
- }
+ CARD32 size = 0, temp, temp1, temp2, i;
- /* Set pointer to Aperture1 */
- p = (unsigned int *) pGlint->FbBase;
- /* Fill in megs number of megabytes */
- for(i=0;i<size;i++)
- for(j=0;j<1024*256;j+=1024)
- p[j+(i*1024*256)] = j + (i * 1024*256);
+ /* We can map 64MB, as that's the size of the Permedia3 aperture
+ * regardless of memory configuration */
+ pGlint->FbMapSize = 64*1024*1024;
- /* Set pointer to Aperture1 */
- p = (unsigned int *) pGlint->FbBase;
+ /* Mark as VIDMEM_MMIO to avoid write-combining while detecting memory */
+ pGlint->FbBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO,
+ pGlint->PciTag, pGlint->FbAddress, pGlint->FbMapSize);
- /* If original ptr is 0x0 then no rollover occured */
- p_content = p[0];
- xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pGlint->FbBase,
- pGlint->FbMapSize);
- pGlint->FbBase = NULL;
- pGlint->FbMapSize = savemapsize;
- if (p_content == 0x0)
- return TRUE;
- else return FALSE;
-}
-int
-Permedia3MemorySizeDetect(ScrnInfoPtr pScrn)
-{
- GLINTPtr pGlint;
- int size = 1;
- pGlint = GLINTPTR (pScrn);
- /* Fill memory until get a rollover of dram to 0
- * fill in powers of 2, 1,2,4,8,16,32
+ if (pGlint->FbBase == NULL)
+ return 0;
+
+ temp = GLINT_READ_REG(PM3MemBypassWriteMask);
+ GLINT_SLOW_WRITE_REG(0xffffffff, PM3MemBypassWriteMask);
+
+ /* The Permedia3 splits up memory, and even replicates it. Grrr.
+ * So that each 32MB appears at offset 0, and offset 32, unless
+ * there's really 64MB attached to the chip.
+ * So, 16MB appears at offset 0, nothing between 16-32, then it re-appears
+ * at offset 32.
+ * This below is to detect the cases of memory combinations
+ * It may also need closer examination for boards other than 16 or 32MB
*/
- while(PM3QuickFillMemory(pScrn,size))
- {
- size = size*2;
- if(size == 64) break;
+
+ /* Test first 32MB */
+ for(i=0;i<32;i++) {
+ /* write test pattern */
+ MMIO_OUT32(pGlint->FbBase, i*1024*1024, i*0x00345678);
+ mem_barrier();
+ temp1 = MMIO_IN32(pGlint->FbBase, i*1024*1024);
+ /* Let's check for wrapover, write will fail at 16MB boundary */
+ if (temp1 == (i*0x00345678))
+ size = i;
+ else
+ break;
}
- /* Correct memory amount since fail */
- if (size != 1)
- size = size / 2;
- else
- return 1*1024;
- /* Just to make sure */
- if (PM3QuickFillMemory(pScrn,size))
- return size*1024;
- return 16*1024;
-}
-static int
-Shiftbpp(ScrnInfoPtr pScrn, int value)
-{
- GLINTPtr pGlint = GLINTPTR(pScrn);
- /* shift horizontal timings for 128bit SGRAMs or SDRAMs */
- int logbytesperaccess = 4;
-
- switch (pScrn->bitsPerPixel) {
- case 8:
- value >>= logbytesperaccess;
- pGlint->BppShift = logbytesperaccess;
- break;
- case 16:
- if (pGlint->DoubleBuffer) {
- value >>= (logbytesperaccess-2);
- pGlint->BppShift = logbytesperaccess-2;
- } else {
- value >>= (logbytesperaccess-1);
- pGlint->BppShift = logbytesperaccess-1;
+ /* Ok, we're satisfied we've got 32MB, let's test the second lot */
+ if (size == i) {
+ for(i=0;i<32;i++) {
+ /* Clear first 32MB */
+ MMIO_OUT32(pGlint->FbBase, i*1024*1024, 0);
+ mem_barrier();
+ }
+ for(i=32;i<64;i++) {
+ /* write test pattern */
+ MMIO_OUT32(pGlint->FbBase, i*1024*1024, i*0x00345678);
+ mem_barrier();
+ temp1 = MMIO_IN32(pGlint->FbBase, i*1024*1024);
+ temp2 = MMIO_IN32(pGlint->FbBase, (i-32)*1024*1024);
+ /* Let's check for wrapover */
+ if ( (temp1 == (i*0x00345678)) && (temp2 == 0) )
+ size = i;
+ else
+ break;
}
- break;
- case 24:
- value *= 3;
- value >>= logbytesperaccess;
- pGlint->BppShift = logbytesperaccess;
- break;
- case 32:
- value >>= (logbytesperaccess-2);
- pGlint->BppShift = logbytesperaccess-2;
- break;
}
- return (value);
+
+ GLINT_SLOW_WRITE_REG(temp, PM3MemBypassWriteMask);
+
+ xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pGlint->FbBase,
+ pGlint->FbMapSize);
+
+ pGlint->FbBase = NULL;
+ pGlint->FbMapSize = 0;
+
+ return ( (size+1) * 1024 );
}
static unsigned long
@@ -188,18 +163,17 @@ void
Permedia3PreInit(ScrnInfoPtr pScrn)
{
GLINTPtr pGlint = GLINTPTR(pScrn);
+
TRACE_ENTER("Permedia3PreInit");
- if ((pGlint->PciInfo->subsysVendor == 0x1097) &&
- (pGlint->PciInfo->subsysCard == 0x3d32)) {
+ if (IS_J2000) {
unsigned char m,n,p;
unsigned long clockused;
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "Appian Jeronimo 2000 board detected and initialized.\n\t"
- "subsysVendor = 0x%04x, subsysCard = 0x%04x.\n",
- pGlint->PciInfo->subsysVendor, pGlint->PciInfo->subsysCard);
+
+ if (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_GAMMA)
+ GLINT_SLOW_WRITE_REG(GCSRSecondaryGLINTMapEn, GCSRAperture);
/* Memory timings for the Appian J2000 board.
- * This is needed for the second head which is left unitilialized
+ * This is needed for the second head which is left un-initialized
* by the bios, thus freezing the machine. */
GLINT_SLOW_WRITE_REG(0x02e311B8, PM3LocalMemCaps);
GLINT_SLOW_WRITE_REG(0x07424905, PM3LocalMemTimings);
@@ -231,98 +205,91 @@ Permedia3PreInit(ScrnInfoPtr pScrn)
PM3RD_SClkControl_SOURCE_PCLK |
PM3RD_SClkControl_ENABLE);
}
- else xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "Unknown Glint Permedia3 board detected.\n\t"
- "subsysVendor = 0x%04x, subsysCard = 0x%04x.\n\t"
- "Let's hope that it is correctly initialized by the bios.\n",
- pGlint->PciInfo->subsysVendor, pGlint->PciInfo->subsysCard);
+
TRACE_EXIT("Permedia3PreInit");
}
Bool
-Permedia3Init(ScrnInfoPtr pScrn, DisplayModePtr mode)
+Permedia3Init(ScrnInfoPtr pScrn, DisplayModePtr mode, GLINTRegPtr pReg)
{
GLINTPtr pGlint = GLINTPTR(pScrn);
- GLINTRegPtr pReg = &pGlint->ModeReg;
CARD32 temp1, temp2, temp3, temp4;
- 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;
+ if ((pGlint->numMultiDevices == 2) || (IS_J2000)) {
+ STOREREG(GCSRAperture, GCSRSecondaryGLINTMapEn);
+ }
- if (pGlint->UsePCIRetry) {
- pReg->glintRegs[DFIFODis >> 3] = 1;
- pReg->glintRegs[FIFODis >> 3] = 3;
- } else {
- pReg->glintRegs[DFIFODis >> 3] = 0;
- pReg->glintRegs[FIFODis >> 3] = 1;
+ if (pGlint->MultiAperture) {
+ STOREREG(GMultGLINTAperture, pGlint->realWidth);
+ STOREREG(GMultGLINT1,
+ pGlint->MultiPciInfo[0]->memBase[2] & 0xFF800000);
+ STOREREG(GMultGLINT2,
+ pGlint->MultiPciInfo[1]->memBase[2] & 0xFF800000);
}
+ STOREREG(PM3MemBypassWriteMask, 0xffffffff);
+ STOREREG(Aperture0, 0x00000000);
+ STOREREG(Aperture1, 0x00000000);
+
+ if (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_GAMMA)
+ STOREREG(DFIFODis, 0x00000001);
+
+ STOREREG(FIFODis, 0x00000007);
+
temp1 = mode->CrtcHSyncStart - mode->CrtcHDisplay;
temp2 = mode->CrtcVSyncStart - mode->CrtcVDisplay;
temp3 = mode->CrtcHSyncEnd - mode->CrtcHSyncStart;
temp4 = mode->CrtcVSyncEnd - mode->CrtcVSyncStart;
- pReg->glintRegs[PMHTotal >> 3] = Shiftbpp(pScrn,mode->CrtcHTotal);
- pReg->glintRegs[PMHsEnd >> 3] = Shiftbpp(pScrn, temp1 + temp3);
- pReg->glintRegs[PMHsStart >> 3] = Shiftbpp(pScrn, temp1);
- pReg->glintRegs[PMHbEnd >> 3] =
- Shiftbpp(pScrn,mode->CrtcHTotal-mode->CrtcHDisplay);
- pReg->glintRegs[PMHgEnd >> 3] = pReg->glintRegs[PMHbEnd >> 3];
- pReg->glintRegs[PMScreenStride >> 3] =
- Shiftbpp(pScrn,pScrn->displayWidth);
-
- pReg->glintRegs[PMVTotal >> 3] = mode->CrtcVTotal;
- pReg->glintRegs[PMVsEnd >> 3] = temp2 + temp4;
- pReg->glintRegs[PMVsStart >> 3] = temp2;
- pReg->glintRegs[PMVbEnd >> 3] = mode->CrtcVTotal - mode->CrtcVDisplay;
-
- pReg->glintRegs[PMHTotal >> 3] -= 1;
- pReg->glintRegs[PMVTotal >> 3] -= 1;
- pReg->glintRegs[PMVsStart >> 3] -= 1;
- pReg->glintRegs[PMVsEnd >> 3] -= 1;
-
- /* 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. */
- /* We need to set the pixelsize (bit 19 & 20) also ... */
+ STOREREG(PMHTotal, Shiftbpp(pScrn, mode->CrtcHTotal - 1));
+ STOREREG(PMHsEnd, Shiftbpp(pScrn, temp1 + temp3));
+ STOREREG(PMHsStart, Shiftbpp(pScrn, temp1));
+ STOREREG(PMHbEnd, Shiftbpp(pScrn, mode->CrtcHTotal - mode->CrtcHDisplay));
+ STOREREG(PMHgEnd, Shiftbpp(pScrn, mode->CrtcHTotal - mode->CrtcHDisplay));
+ STOREREG(PMScreenStride, Shiftbpp(pScrn, pScrn->displayWidth));
+
+ STOREREG(PMVTotal, mode->CrtcVTotal - 1);
+ STOREREG(PMVsEnd, temp2 + temp4 - 1);
+ STOREREG(PMVsStart, temp2 - 1);
+ STOREREG(PMVbEnd, mode->CrtcVTotal - mode->CrtcVDisplay);
+
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);
+ STOREREG(PM3ByAperture1Mode, PM3ByApertureMode_PIXELSIZE_8BIT);
+ STOREREG(PM3ByAperture2Mode, PM3ByApertureMode_PIXELSIZE_8BIT);
+ STOREREG(PMVideoControl, 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);
+#if X_BYTE_ORDER != X_BIG_ENDIAN
+ STOREREG(PM3ByAperture1Mode, PM3ByApertureMode_PIXELSIZE_16BIT);
+ STOREREG(PM3ByAperture2Mode, PM3ByApertureMode_PIXELSIZE_16BIT);
+#else
+ STOREREG(PM3ByAperture1Mode, PM3ByApertureMode_PIXELSIZE_16BIT |
+ PM3ByApertureMode_BYTESWAP_BADC);
+ STOREREG(PM3ByAperture2Mode, PM3ByApertureMode_PIXELSIZE_16BIT |
+ PM3ByApertureMode_BYTESWAP_BADC);
+#endif
+ STOREREG(PMVideoControl, 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);
+#if X_BYTE_ORDER != X_BIG_ENDIAN
+ STOREREG(PM3ByAperture1Mode, PM3ByApertureMode_PIXELSIZE_32BIT);
+ STOREREG(PM3ByAperture2Mode, PM3ByApertureMode_PIXELSIZE_32BIT);
+#else
+ STOREREG(PM3ByAperture2Mode, PM3ByApertureMode_PIXELSIZE_32BIT |
+ PM3ByApertureMode_BYTESWAP_DCBA);
+ STOREREG(PM3ByAperture2Mode, PM3ByApertureMode_PIXELSIZE_32BIT |
+ PM3ByApertureMode_BYTESWAP_DCBA);
+#endif
+ STOREREG(PMVideoControl, 1 | (1 << 3) | (1 << 5) | (2 << 19));
break;
}
- pReg->glintRegs[VClkCtl >> 3] = (GLINT_READ_REG(VClkCtl) & 0xFFFFFFFC);
- pReg->glintRegs[PMScreenBase >> 3] = 0;
+ STOREREG(VClkCtl, GLINT_READ_REG(VClkCtl) & 0xFFFFFFFC);
+ STOREREG(PMScreenBase, 0x00000000);
+ STOREREG(ChipConfig, GLINT_READ_REG(ChipConfig) & 0xFFFFFFFD);
- pReg->glintRegs[ChipConfig >> 3] = GLINT_READ_REG(ChipConfig) & 0xFFFFFFDD;
- pReg->DacRegs[PM2VDACRDDACControl] = 0x00;
-
{
/* Get the programmable clock values */
unsigned char m,n,p;
@@ -331,197 +298,274 @@ Permedia3Init(ScrnInfoPtr pScrn, DisplayModePtr mode)
/* 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;
+ STOREDAC(PM3RD_DClk0PreScale, m);
+ STOREDAC(PM3RD_DClk0FeedbackScale, n);
+ STOREDAC(PM3RD_DClk0PostScale, p);
}
- pReg->DacRegs[PM2VDACRDIndexControl] = 0x00;
-
- if (pScrn->rgbBits == 8)
- pReg->DacRegs[PM2VDACRDMiscControl] = 0x01; /* 8bit DAC */
- else
- pReg->DacRegs[PM2VDACRDMiscControl] = 0x00; /* 6bit DAC */
-
- pReg->DacRegs[PM2VDACRDSyncControl] = 0x00;
- if (!(mode->Flags & V_PHSYNC))
- pReg->DacRegs[PM2VDACRDSyncControl] |= 0x01; /* invert hsync */
- if (!(mode->Flags & V_PVSYNC))
- pReg->DacRegs[PM2VDACRDSyncControl] |= 0x08; /* invert vsync */
-
+ temp1 = 0;
+ temp2 = 0;
#if 0 /* Currently commented out while testing Flat Panel support */
- pReg->DacRegs[PM2VDACRDDACControl] = 0x01;
- pReg->DacRegs[PM2VDACRDSyncControl] |= 0x40;
- pReg->glintRegs[VSConfiguration >> 3] = (GLINT_READ_REG(VSConfiguration) & 0xFFFFFFF8) | 0x06;
- pReg->glintRegs[VSBBase >> 3] = 1<<14;
+ temp1 |= 0x40;
+ temp2 |= 0x01;
+ STOREREG(VSConfiguration,
+ (GLINT_READ_REG(VSConfiguration) & 0xFFFFFFF8) | 0x06));
+ STOREREG(VSBBase, 1<<14);
#endif
+ if (mode->Flags & V_PHSYNC) temp1 |= 0x01; /* invert hsync */
+ if (mode->Flags & V_PVSYNC) temp1 |= 0x08; /* invert vsync */
+
+ STOREDAC(PM2VDACRDIndexControl, 0x00);
+ STOREDAC(PM2VDACRDSyncControl, temp1);
+ STOREDAC(PM2VDACRDDACControl, 0x00);
+
+ temp3 = 0;
+ if (pScrn->rgbBits == 8)
+ temp3 |= 0x01; /* 8bit DAC */
switch (pScrn->bitsPerPixel)
{
case 8:
- pReg->DacRegs[PM2VDACRDPixelSize] = 0x00;
- pReg->DacRegs[PM2VDACRDColorFormat] = 0x2E;
+ STOREDAC(PM2VDACRDPixelSize, 0x00);
+ STOREDAC(PM2VDACRDColorFormat, 0x2E);
break;
case 16:
- pReg->DacRegs[PM2VDACRDPixelSize] = 0x01;
- if (pScrn->depth == 15)
- pReg->DacRegs[PM2VDACRDColorFormat] = 0x61;
- else
- pReg->DacRegs[PM2VDACRDColorFormat] = 0x70;
+ STOREDAC(PM2VDACRDPixelSize, 0x01);
+ if (pScrn->depth == 15) {
+ STOREDAC(PM2VDACRDColorFormat, 0x61);
+ } else {
+ STOREDAC(PM2VDACRDColorFormat, 0x70);
+ }
break;
case 24:
- pReg->DacRegs[PM2VDACRDPixelSize] = 0x04;
- pReg->DacRegs[PM2VDACRDColorFormat] = 0x60;
+ STOREDAC(PM2VDACRDPixelSize, 0x04);
+ STOREDAC(PM2VDACRDColorFormat, 0x60);
break;
case 32:
- pReg->DacRegs[PM2VDACRDPixelSize] = 0x02;
- pReg->DacRegs[PM2VDACRDColorFormat] = 0x20;
if (pScrn->overlayFlags & OVERLAY_8_32_PLANAR) {
- pReg->DacRegs[PM2VDACRDMiscControl] |= 0x10;
- pReg->DacRegs[PM2VDACRDOverlayKey] = pScrn->colorKey;
+ temp3 |= 0x18;
+ STOREDAC(PM2VDACRDOverlayKey, pScrn->colorKey);
}
+ STOREDAC(PM2VDACRDPixelSize, 0x02);
+ STOREDAC(PM2VDACRDColorFormat, 0x20);
break;
}
+ STOREDAC(PM2VDACRDMiscControl, temp3);
return(TRUE);
}
void
-Permedia3Save(ScrnInfoPtr pScrn, GLINTRegPtr glintReg)
+Permedia3Save(ScrnInfoPtr pScrn, GLINTRegPtr pReg)
{
GLINTPtr pGlint = GLINTPTR(pScrn);
int i;
+ /* We can't rely on the vgahw layer copying the font information
+ * back properly, due to problems with MMIO access to VGA space
+ * so we memcpy the information */
+ memcpy((CARD8*)pGlint->VGAdata,(CARD8*)pGlint->FbBase, 65536);
+
+ if ((pGlint->numMultiDevices == 2) || (IS_J2000)) {
+ SAVEREG(GCSRAperture);
+ }
+
+ if (pGlint->MultiAperture) {
+ SAVEREG(GMultGLINTAperture);
+ SAVEREG(GMultGLINT1);
+ SAVEREG(GMultGLINT2);
+ }
+
/* Permedia 3 memory Timings */
- glintReg->glintRegs[PM3MemBypassWriteMask >> 3] =
- GLINT_READ_REG(PM3MemBypassWriteMask);
- glintReg->glintRegs[PM3ByAperture1Mode >> 3] =
- GLINT_READ_REG(PM3ByAperture1Mode);
- glintReg->glintRegs[PM3ByAperture2Mode >> 3] =
- GLINT_READ_REG(PM3ByAperture2Mode);
-
- glintReg->glintRegs[ChipConfig >> 3] = GLINT_READ_REG(ChipConfig);
- glintReg->glintRegs[Aperture0 >> 3] = GLINT_READ_REG(Aperture0);
- glintReg->glintRegs[Aperture1 >> 3] = GLINT_READ_REG(Aperture1);
-
- glintReg->glintRegs[DFIFODis >> 3] = GLINT_READ_REG(DFIFODis);
- glintReg->glintRegs[FIFODis >> 3] = GLINT_READ_REG(FIFODis);
- glintReg->glintRegs[PMHTotal >> 3] = GLINT_READ_REG(PMHTotal);
- glintReg->glintRegs[PMHbEnd >> 3] = GLINT_READ_REG(PMHbEnd);
- glintReg->glintRegs[PMHbEnd >> 3] = GLINT_READ_REG(PMHgEnd);
- glintReg->glintRegs[PMScreenStride >> 3] = GLINT_READ_REG(PMScreenStride);
- glintReg->glintRegs[PMHsStart >> 3] = GLINT_READ_REG(PMHsStart);
- glintReg->glintRegs[PMHsEnd >> 3] = GLINT_READ_REG(PMHsEnd);
- glintReg->glintRegs[PMVTotal >> 3] = GLINT_READ_REG(PMVTotal);
- glintReg->glintRegs[PMVbEnd >> 3] = GLINT_READ_REG(PMVbEnd);
- glintReg->glintRegs[PMVsStart >> 3] = GLINT_READ_REG(PMVsStart);
- glintReg->glintRegs[PMVsEnd >> 3] = GLINT_READ_REG(PMVsEnd);
- glintReg->glintRegs[PMScreenBase >> 3] = GLINT_READ_REG(PMScreenBase);
- glintReg->glintRegs[PMVideoControl >> 3] = GLINT_READ_REG(PMVideoControl);
- glintReg->glintRegs[VClkCtl >> 3] = GLINT_READ_REG(VClkCtl);
+ SAVEREG(PM3MemBypassWriteMask);
+ SAVEREG(PM3ByAperture1Mode);
+ SAVEREG(PM3ByAperture2Mode);
+ SAVEREG(ChipConfig);
+ SAVEREG(Aperture0);
+ SAVEREG(Aperture1);
+
+ if (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_GAMMA)
+ SAVEREG(DFIFODis);
+ SAVEREG(FIFODis);
+ SAVEREG(PMHTotal);
+ SAVEREG(PMHbEnd);
+ SAVEREG(PMHgEnd);
+ SAVEREG(PMScreenStride);
+ SAVEREG(PMHsStart);
+ SAVEREG(PMHsEnd);
+ SAVEREG(PMVTotal);
+ SAVEREG(PMVbEnd);
+ SAVEREG(PMVsStart);
+ SAVEREG(PMVsEnd);
+ SAVEREG(PMScreenBase);
+ SAVEREG(PMVideoControl);
+ SAVEREG(VClkCtl);
#if 0 /* Currently commented out while testing Flat Panel support */
- glintReg->glintRegs[VSConfiguration >> 3] = GLINT_READ_REG(VSConfiguration);
- glintReg->glintRegs[VSBBase >> 3] = GLINT_READ_REG(VSBBase);
+ SAVEREG(VSConfiguration);
+ SAVEREG(VSBBase);
#endif
for (i=0;i<768;i++) {
Permedia2ReadAddress(pScrn, i);
- glintReg->cmap[i] = Permedia2ReadData(pScrn);
+ pReg->cmap[i] = Permedia2ReadData(pScrn);
}
- glintReg->DacRegs[PM2VDACRDIndexControl] =
- Permedia2vInIndReg(pScrn, PM2VDACRDIndexControl);
- glintReg->DacRegs[PM2VDACRDOverlayKey] =
- Permedia2vInIndReg(pScrn, PM2VDACRDOverlayKey);
- glintReg->DacRegs[PM2VDACRDSyncControl] =
- Permedia2vInIndReg(pScrn, PM2VDACRDSyncControl);
- glintReg->DacRegs[PM2VDACRDMiscControl] =
- Permedia2vInIndReg(pScrn, PM2VDACRDMiscControl);
- glintReg->DacRegs[PM2VDACRDDACControl] =
- Permedia2vInIndReg(pScrn, PM2VDACRDDACControl);
- glintReg->DacRegs[PM2VDACRDPixelSize] =
- Permedia2vInIndReg(pScrn, PM2VDACRDPixelSize);
- glintReg->DacRegs[PM2VDACRDColorFormat] =
- Permedia2vInIndReg(pScrn, PM2VDACRDColorFormat);
-
- glintReg->DacRegs[PM2VDACRDDClk0PreScale] = Permedia2vInIndReg(pScrn, PM2VDACRDDClk0PreScale);
- glintReg->DacRegs[PM2VDACRDDClk0FeedbackScale] = Permedia2vInIndReg(pScrn, PM2VDACRDDClk0FeedbackScale);
- glintReg->DacRegs[PM2VDACRDDClk0PostScale] = Permedia2vInIndReg(pScrn, PM2VDACRDDClk0PostScale);
+ P2VIN(PM2VDACRDIndexControl);
+ P2VIN(PM2VDACRDOverlayKey);
+ P2VIN(PM2VDACRDSyncControl);
+ P2VIN(PM2VDACRDMiscControl);
+ P2VIN(PM2VDACRDDACControl);
+ P2VIN(PM2VDACRDPixelSize);
+ P2VIN(PM2VDACRDColorFormat);
+ P2VIN(PM2VDACRDDClk0PreScale);
+ P2VIN(PM2VDACRDDClk0FeedbackScale);
+ P2VIN(PM2VDACRDDClk0PostScale);
}
void
-Permedia3Restore(ScrnInfoPtr pScrn, GLINTRegPtr glintReg)
+Permedia3Restore(ScrnInfoPtr pScrn, GLINTRegPtr pReg)
{
GLINTPtr pGlint = GLINTPTR(pScrn);
CARD32 temp;
int i;
-#if 0
- GLINT_SLOW_WRITE_REG(0, ResetStatus);
- while(GLINT_READ_REG(ResetStatus) != 0) {
- xf86MsgVerb(X_INFO, 2, "Resetting Engine - Please Wait.\n");
- };
-#endif
+ /* We can't rely on the vgahw layer copying the font information
+ * back properly, due to problems with MMIO access to VGA space
+ * so we memcpy the information */
+ if (pGlint->STATE)
+ memcpy((CARD8*)pGlint->FbBase,(CARD8*)pGlint->VGAdata, 65536);
+
+ if ((pGlint->numMultiDevices == 2) || (IS_J2000)) {
+ RESTOREREG(GCSRAperture);
+ }
+
+ if (pGlint->MultiAperture) {
+ RESTOREREG(GMultGLINTAperture);
+ RESTOREREG(GMultGLINT1);
+ RESTOREREG(GMultGLINT2);
+ }
/* Permedia 3 memory Timings */
- GLINT_SLOW_WRITE_REG(glintReg->glintRegs[PM3MemBypassWriteMask >> 3],
- PM3MemBypassWriteMask);
- GLINT_SLOW_WRITE_REG(glintReg->glintRegs[PM3ByAperture1Mode >> 3],
- PM3ByAperture1Mode);
- GLINT_SLOW_WRITE_REG(glintReg->glintRegs[PM3ByAperture2Mode >> 3],
- PM3ByAperture2Mode);
-
- GLINT_SLOW_WRITE_REG(glintReg->glintRegs[ChipConfig >> 3], ChipConfig);
- GLINT_SLOW_WRITE_REG(glintReg->glintRegs[Aperture0 >> 3], Aperture0);
- GLINT_SLOW_WRITE_REG(glintReg->glintRegs[Aperture1 >> 3], Aperture1);
- GLINT_SLOW_WRITE_REG(glintReg->glintRegs[DFIFODis >> 3], DFIFODis);
- GLINT_SLOW_WRITE_REG(glintReg->glintRegs[FIFODis >> 3], FIFODis);
- GLINT_SLOW_WRITE_REG(glintReg->glintRegs[PMVideoControl >> 3],
- PMVideoControl);
- GLINT_SLOW_WRITE_REG(glintReg->glintRegs[PMHbEnd >> 3], PMHgEnd);
- GLINT_SLOW_WRITE_REG(glintReg->glintRegs[PMScreenBase >> 3], PMScreenBase);
- GLINT_SLOW_WRITE_REG(glintReg->glintRegs[VClkCtl >> 3], VClkCtl);
- GLINT_SLOW_WRITE_REG(glintReg->glintRegs[PMScreenStride >> 3],
- PMScreenStride);
- GLINT_SLOW_WRITE_REG(glintReg->glintRegs[PMHTotal >> 3], PMHTotal);
- GLINT_SLOW_WRITE_REG(glintReg->glintRegs[PMHbEnd >> 3], PMHbEnd);
- GLINT_SLOW_WRITE_REG(glintReg->glintRegs[PMHsStart >> 3], PMHsStart);
- GLINT_SLOW_WRITE_REG(glintReg->glintRegs[PMHsEnd >> 3], PMHsEnd);
- GLINT_SLOW_WRITE_REG(glintReg->glintRegs[PMVTotal >> 3], PMVTotal);
- GLINT_SLOW_WRITE_REG(glintReg->glintRegs[PMVbEnd >> 3], PMVbEnd);
- GLINT_SLOW_WRITE_REG(glintReg->glintRegs[PMVsStart >> 3], PMVsStart);
- GLINT_SLOW_WRITE_REG(glintReg->glintRegs[PMVsEnd >> 3], PMVsEnd);
+ RESTOREREG(PM3MemBypassWriteMask);
+ RESTOREREG(PM3ByAperture1Mode);
+ RESTOREREG(PM3ByAperture2Mode);
+ RESTOREREG(ChipConfig);
+ RESTOREREG(Aperture0);
+ RESTOREREG(Aperture1);
+ if (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_GAMMA)
+ RESTOREREG(DFIFODis);
+ RESTOREREG(FIFODis);
+ RESTOREREG(PMVideoControl);
+ RESTOREREG(PMHbEnd);
+ RESTOREREG(PMHgEnd);
+ RESTOREREG(PMScreenBase);
+ RESTOREREG(VClkCtl);
+ RESTOREREG(PMScreenStride);
+ RESTOREREG(PMHTotal);
+ RESTOREREG(PMHsStart);
+ RESTOREREG(PMHsEnd);
+ RESTOREREG(PMVTotal);
+ RESTOREREG(PMVbEnd);
+ RESTOREREG(PMVsStart);
+ RESTOREREG(PMVsEnd);
+
#if 0 /* Currently commented out while testing Flat Panel support */
- GLINT_SLOW_WRITE_REG(glintReg->glintRegs[VSConfiguration >> 3], VSConfiguration);
- GLINT_SLOW_WRITE_REG(glintReg->glintRegs[VSBBase >> 3], VSBBase);
+ RESTOREREG(VSConfiguration);
+ RESTOREREG(VSBBase);
#endif
- Permedia2vOutIndReg(pScrn, PM2VDACRDIndexControl, 0x00,
- glintReg->DacRegs[PM2VDACRDIndexControl]);
- Permedia2vOutIndReg(pScrn, PM2VDACRDOverlayKey, 0x00,
- glintReg->DacRegs[PM2VDACRDOverlayKey]);
- Permedia2vOutIndReg(pScrn, PM2VDACRDSyncControl, 0x00,
- glintReg->DacRegs[PM2VDACRDSyncControl]);
- Permedia2vOutIndReg(pScrn, PM2VDACRDMiscControl, 0x00,
- glintReg->DacRegs[PM2VDACRDMiscControl]);
- Permedia2vOutIndReg(pScrn, PM2VDACRDDACControl, 0x00,
- glintReg->DacRegs[PM2VDACRDDACControl]);
- Permedia2vOutIndReg(pScrn, PM2VDACRDPixelSize, 0x00,
- glintReg->DacRegs[PM2VDACRDPixelSize]);
- Permedia2vOutIndReg(pScrn, PM2VDACRDColorFormat, 0x00,
- glintReg->DacRegs[PM2VDACRDColorFormat]);
+ P2VOUT(PM2VDACRDIndexControl);
+ P2VOUT(PM2VDACRDOverlayKey);
+ P2VOUT(PM2VDACRDSyncControl);
+ P2VOUT(PM2VDACRDMiscControl);
+ P2VOUT(PM2VDACRDDACControl);
+ P2VOUT(PM2VDACRDPixelSize);
+ P2VOUT(PM2VDACRDColorFormat);
for (i=0;i<768;i++) {
Permedia2WriteAddress(pScrn, i);
- Permedia2WriteData(pScrn, glintReg->cmap[i]);
+ Permedia2WriteData(pScrn, pReg->cmap[i]);
}
temp = Permedia2vInIndReg(pScrn, PM2VDACIndexClockControl) & 0xFC;
- Permedia2vOutIndReg(pScrn, PM2VDACRDDClk0PreScale, 0x00,
- glintReg->DacRegs[PM2VDACRDDClk0PreScale]);
- Permedia2vOutIndReg(pScrn, PM2VDACRDDClk0FeedbackScale, 0x00,
- glintReg->DacRegs[PM2VDACRDDClk0FeedbackScale]);
- Permedia2vOutIndReg(pScrn, PM2VDACRDDClk0PostScale, 0x00,
- glintReg->DacRegs[PM2VDACRDDClk0PostScale]);
+ P2VOUT(PM2VDACRDDClk0PreScale);
+ P2VOUT(PM2VDACRDDClk0FeedbackScale);
+ P2VOUT(PM2VDACRDDClk0PostScale);
Permedia2vOutIndReg(pScrn, PM2VDACIndexClockControl, 0x00, temp|0x03);
}
+
+void Permedia3LoadPalette(
+ ScrnInfoPtr pScrn,
+ int numColors,
+ int *indices,
+ LOCO *colors,
+ VisualPtr pVisual
+){
+#if 0 /* NOT YET */
+ GLINTPtr pGlint = GLINTPTR(pScrn);
+#endif
+ int i, index, shift = 0, j, repeat = 1;
+
+ if (pScrn->depth == 15) {
+ repeat = 8;
+ shift = 3;
+ }
+
+ for(i = 0; i < numColors; i++) {
+ index = indices[i];
+ for (j = 0; j < repeat; j++) {
+ Permedia2WriteAddress(pScrn, (index << shift)+j);
+ Permedia2WriteData(pScrn, colors[index].red);
+ Permedia2WriteData(pScrn, colors[index].green);
+ Permedia2WriteData(pScrn, colors[index].blue);
+ }
+ /* for video i/o */
+#if 0 /* NOT YET */
+ GLINT_SLOW_WRITE_REG(index, PM3LUTIndex);
+ GLINT_SLOW_WRITE_REG((colors[index].red & 0xFF) |
+ ((colors[index].green & 0xFF) << 8) |
+ ((colors[index].blue & 0xFF) << 16),
+ PM3LUTData);
+#endif
+ }
+}
+
+/* special one for 565 mode */
+void Permedia3LoadPalette16(
+ ScrnInfoPtr pScrn,
+ int numColors,
+ int *indices,
+ LOCO *colors,
+ VisualPtr pVisual
+){
+#if 0 /* NOT YET */
+ GLINTPtr pGlint = GLINTPTR(pScrn);
+#endif
+ int i, index, j;
+
+ for(i = 0; i < numColors; i++) {
+ index = indices[i];
+ for (j = 0; j < 4; j++) {
+ Permedia2WriteAddress(pScrn, (index << 2)+j);
+ Permedia2WriteData(pScrn, colors[index >> 1].red);
+ Permedia2WriteData(pScrn, colors[index].green);
+ Permedia2WriteData(pScrn, colors[index >> 1].blue);
+ }
+#if 0 /* NOT YET */
+ GLINT_SLOW_WRITE_REG(index, PM3LUTIndex);
+ GLINT_SLOW_WRITE_REG((colors[index].red & 0xFF) |
+ ((colors[index].green & 0xFF) << 8) |
+ ((colors[index].blue & 0xFF) << 16),
+ PM3LUTData);
+#endif
+
+ if(index <= 31) {
+ for (j = 0; j < 4; j++) {
+ Permedia2WriteAddress(pScrn, (index << 3)+j);
+ Permedia2WriteData(pScrn, colors[index].red);
+ Permedia2WriteData(pScrn, colors[(index << 1) + 1].green);
+ Permedia2WriteData(pScrn, colors[index].blue);
+ }
+ }
+ }
+}
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_regs.h b/xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_regs.h
index ed455edd9..42946b213 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_regs.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_regs.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_regs.h,v 1.3 2000/10/17 09:07:05 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_regs.h,v 1.4 2001/01/31 16:15:02 alanh Exp $ */
/*
* glint register file
@@ -698,7 +698,7 @@
#define PM3LUT 0x8e80
#define PM3LUTAddress 0x84d0
#define PM3LUTData 0x84c8
-#define PM3LUTIndex 0x64c0
+#define PM3LUTIndex 0x84c0
#define PM3LUTMode 0xb378
#define PM3LUTModeAnd 0xad70
#define PM3LUTModeOr 0xad78
@@ -955,11 +955,6 @@
#define PM3FillRectanglePosition_XOffset(x) ((x)&0xffff)
#define PM3FillRectanglePosition_YOffset(y) (((y)&0xffff)<<16)
-/**********************************************
-* GLINT Permedia3 Tags and other stuff *
-***********************************************/
-#define PM3SyncTag 0x0188
-
#if 0
/**********************************************
@@ -986,16 +981,6 @@
WRITE_REG(base,offset,temp&(~(val))); \
}
-#if 0 /* Old Xfree code ... */
-#define WAIT(n) \
-do{ \
- if(!pGlint->UsePCIRetry) \
- while(READ_REG(InFIFOSpace)<(n)){ \
- mem_barrier(); \
- } \
-}while(0)
-#endif
-
#define RAMDAC_DELAY(b,x) do { \
int delay = x; \
unsigned char tmp; \
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/tx_accel.c b/xc/programs/Xserver/hw/xfree86/drivers/glint/tx_accel.c
index 2f08ac36d..1909ffada 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/glint/tx_accel.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/glint/tx_accel.c
@@ -1,5 +1,5 @@
/*
- * Copyright 1997,1998 by Alan Hourihane, Wigan, England.
+ * Copyright 1997-2001 by Alan Hourihane, Wigan, England.
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -28,7 +28,7 @@
*
* GLINT 500TX / MX accelerated options.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/tx_accel.c,v 1.22 2000/05/10 20:01:32 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/tx_accel.c,v 1.25 2001/02/07 13:26:21 alanh Exp $ */
#include "xf86.h"
#include "xf86_OSproc.h"
@@ -47,6 +47,7 @@
#include "xaalocal.h" /* For replacements */
static void TXSync(ScrnInfoPtr pScrn);
+static void DualTXSync(ScrnInfoPtr pScrn);
static void TXSetupForFillRectSolid(ScrnInfoPtr pScrn, int color, int rop,
unsigned int planemask);
static void TXSubsequentFillRectSolid(ScrnInfoPtr pScrn, int x, int y,
@@ -74,10 +75,6 @@ static void TXWritePixmap(ScrnInfoPtr pScrn, int x, int y, int w, int h,
unsigned char *src, int srcwidth, int rop,
unsigned int planemask, int trans,
int bpp, int depth);
-static void TXSetupForCPUToScreenColorExpandFill(ScrnInfoPtr pScrn, int fg,
- int bg, int rop, unsigned int planemask);
-static void TXSubsequentCPUToScreenColorExpandFill(ScrnInfoPtr pScrn, int x,
- int y, int w, int h, int skipleft);
static void TXSetupForScanlineCPUToScreenColorExpandFill(ScrnInfoPtr pScrn, int fg,
int bg, int rop, unsigned int planemask);
static void TXSubsequentScanlineCPUToScreenColorExpandFill(ScrnInfoPtr pScrn, int x,
@@ -104,9 +101,30 @@ TXInitializeEngine(ScrnInfoPtr pScrn)
{
GLINTPtr pGlint = GLINTPTR(pScrn);
/* Initialize the Accelerator Engine to defaults */
+ pGlint->rasterizerMode = UNIT_DISABLE;
+
+ if (pGlint->MultiAperture) {
+ pGlint->rasterizerMode = RMMultiGLINT;
+
+ /* Only write the following register to the first chip */
+ GLINT_SLOW_WRITE_REG(1, BroadcastMask);
+ GLINT_SLOW_WRITE_REG(0x00000001, ScanLineOwnership);
+
+ /* Only write the following register to the second chip */
+ GLINT_SLOW_WRITE_REG(2, BroadcastMask);
+ GLINT_SLOW_WRITE_REG(0x00000005, ScanLineOwnership);
+
+ /* Make sure the rest of the register writes go to both chip's */
+ GLINT_SLOW_WRITE_REG(3, BroadcastMask);
+ GLINT_SLOW_WRITE_REG(pGlint->pprod | LBRM_ScanlineInt2, LBReadMode);
+ pGlint->pprod |= FBRM_ScanlineInt2;
+ } else {
+ GLINT_SLOW_WRITE_REG(pGlint->pprod, LBReadMode);
+ }
+
+ GLINT_SLOW_WRITE_REG(pGlint->rasterizerMode, RasterizerMode);
GLINT_SLOW_WRITE_REG(UNIT_DISABLE, ScissorMode);
- GLINT_SLOW_WRITE_REG(pGlint->pprod, LBReadMode);
GLINT_SLOW_WRITE_REG(pGlint->pprod, FBReadMode);
GLINT_SLOW_WRITE_REG(0, dXSub);
GLINT_SLOW_WRITE_REG(UNIT_DISABLE, LBWriteMode);
@@ -134,7 +152,6 @@ TXInitializeEngine(ScrnInfoPtr pScrn)
GLINT_SLOW_WRITE_REG(0x400, FilterMode);
GLINT_SLOW_WRITE_REG(0xffffffff, FBHardwareWriteMask);
GLINT_SLOW_WRITE_REG(0xffffffff, FBSoftwareWriteMask);
- GLINT_SLOW_WRITE_REG(UNIT_DISABLE, RasterizerMode);
GLINT_SLOW_WRITE_REG(UNIT_DISABLE, GLINTDepth);
GLINT_SLOW_WRITE_REG(UNIT_DISABLE, FBSourceOffset);
GLINT_SLOW_WRITE_REG(UNIT_DISABLE, FBPixelOffset);
@@ -192,7 +209,10 @@ TXAccelInit(ScreenPtr pScreen)
LINEAR_FRAMEBUFFER |
OFFSCREEN_PIXMAPS;
- infoPtr->Sync = TXSync;
+ if (pGlint->MultiAperture)
+ infoPtr->Sync = DualTXSync;
+ else
+ infoPtr->Sync = TXSync;
infoPtr->SetClippingRectangle = TXSetClippingRectangle;
infoPtr->DisableClipping = TXDisableClipping;
@@ -217,10 +237,12 @@ TXAccelInit(ScreenPtr pScreen)
infoPtr->PolySegmentThinSolid = TXPolySegmentThinSolidWrapper;
infoPtr->PolylinesThinSolid = TXPolylinesThinSolidWrapper;
- infoPtr->ScreenToScreenCopyFlags = NO_TRANSPARENCY |
- ONLY_LEFT_TO_RIGHT_BITBLT;
- infoPtr->SetupForScreenToScreenCopy = TXSetupForScreenToScreenCopy;
- infoPtr->SubsequentScreenToScreenCopy = TXSubsequentScreenToScreenCopy;
+ if (!pGlint->MultiAperture) {
+ infoPtr->ScreenToScreenCopyFlags = NO_TRANSPARENCY |
+ ONLY_LEFT_TO_RIGHT_BITBLT;
+ infoPtr->SetupForScreenToScreenCopy = TXSetupForScreenToScreenCopy;
+ infoPtr->SubsequentScreenToScreenCopy = TXSubsequentScreenToScreenCopy;
+ }
infoPtr->Mono8x8PatternFillFlags = HARDWARE_PATTERN_PROGRAMMED_ORIGIN |
HARDWARE_PATTERN_SCREEN_ORIGIN |
@@ -228,37 +250,25 @@ TXAccelInit(ScreenPtr pScreen)
infoPtr->SetupForMono8x8PatternFill = TXSetupForMono8x8PatternFill;
infoPtr->SubsequentMono8x8PatternFillRect = TXSubsequentMono8x8PatternFillRect;
- if (!pGlint->UsePCIRetry) {
- infoPtr->ScanlineCPUToScreenColorExpandFillFlags =
+ infoPtr->ScanlineCPUToScreenColorExpandFillFlags =
TRANSPARENCY_ONLY |
BIT_ORDER_IN_BYTE_LSBFIRST;
- pGlint->XAAScanlineColorExpandBuffers[0] =
+ pGlint->XAAScanlineColorExpandBuffers[0] =
xnfalloc(((pScrn->virtualX + 63)/32) *4* (pScrn->bitsPerPixel / 8));
- pGlint->XAAScanlineColorExpandBuffers[1] =
+ pGlint->XAAScanlineColorExpandBuffers[1] =
xnfalloc(((pScrn->virtualX + 63)/32) *4* (pScrn->bitsPerPixel / 8));
- infoPtr->NumScanlineColorExpandBuffers = 2;
- infoPtr->ScanlineColorExpandBuffers =
+ infoPtr->NumScanlineColorExpandBuffers = 2;
+ infoPtr->ScanlineColorExpandBuffers =
pGlint->XAAScanlineColorExpandBuffers;
- infoPtr->SetupForScanlineCPUToScreenColorExpandFill =
+ infoPtr->SetupForScanlineCPUToScreenColorExpandFill =
TXSetupForScanlineCPUToScreenColorExpandFill;
- infoPtr->SubsequentScanlineCPUToScreenColorExpandFill =
+ infoPtr->SubsequentScanlineCPUToScreenColorExpandFill =
TXSubsequentScanlineCPUToScreenColorExpandFill;
- infoPtr->SubsequentColorExpandScanline =
+ infoPtr->SubsequentColorExpandScanline =
TXSubsequentColorExpandScanline;
- } else {
- infoPtr->CPUToScreenColorExpandFillFlags = TRANSPARENCY_ONLY |
- SYNC_AFTER_COLOR_EXPAND |
- CPU_TRANSFER_PAD_DWORD |
- BIT_ORDER_IN_BYTE_LSBFIRST;
- infoPtr->ColorExpandBase = pGlint->IOBase + OutputFIFO + 4;
- infoPtr->SetupForCPUToScreenColorExpandFill =
- TXSetupForCPUToScreenColorExpandFill;
- infoPtr->SubsequentCPUToScreenColorExpandFill =
- TXSubsequentCPUToScreenColorExpandFill;
- }
infoPtr->ColorExpandRange = MAX_FIFO_ENTRIES;
@@ -312,42 +322,20 @@ static void TXLoadCoord(
}
#else
GLINT_WRITE_REG(w<<16, StartXSub);
- pGlint->startxsub = w;
GLINT_WRITE_REG(x<<16,StartXDom);
- pGlint->startxdom = x;
GLINT_WRITE_REG(y<<16,StartY);
- pGlint->starty = y;
GLINT_WRITE_REG(h,GLINTCount);
- pGlint->count = h;
GLINT_WRITE_REG(a<<16,dXDom);
- pGlint->dxdom = a;
GLINT_WRITE_REG(d<<16,dY);
+ pGlint->startxsub = w;
+ pGlint->startxdom = x;
+ pGlint->starty = y;
+ pGlint->count = h;
+ pGlint->dxdom = a;
pGlint->dy = d;
#endif
}
-static void MoveDWORDS(
- register CARD32* dest,
- register CARD32* src,
- register int dwords )
-{
- while(dwords & ~0x03) {
- *dest = *src;
- *(dest + 1) = *(src + 1);
- *(dest + 2) = *(src + 2);
- *(dest + 3) = *(src + 3);
- src += 4;
- dest += 4;
- dwords -= 4;
- }
- if (!dwords) return;
- *dest = *src;
- if (dwords == 1) return;
- *(dest + 1) = *(src + 1);
- if (dwords == 2) return;
- *(dest + 2) = *(src + 2);
-}
-
static void
TXSync(
ScrnInfoPtr pScrn
@@ -363,12 +351,46 @@ TXSync(
GLINT_WRITE_REG(0, GlintSync);
do {
while(GLINT_READ_REG(OutFIFOWords) == 0);
-#define Sync_tag 0x188
readValue = GLINT_READ_REG(OutputFIFO);
} while (readValue != Sync_tag);
}
static void
+DualTXSync(
+ ScrnInfoPtr pScrn
+){
+ GLINTPtr pGlint = GLINTPTR(pScrn);
+ unsigned long readValue;
+
+ CHECKCLIPPING;
+
+ while (GLINT_READ_REG(DMACount) != 0);
+ GLINT_WAIT(3);
+
+ /* hack! this shouldn't need to be reloaded */
+ GLINT_WRITE_REG(3, BroadcastMask);
+ GLINT_WRITE_REG(0x400, FilterMode);
+ GLINT_WRITE_REG(0, GlintSync);
+
+ /* Read 1st MX until Sync Tag shows */
+ ACCESSCHIP1();
+ do {
+ while(GLINT_READ_REG(OutFIFOWords) == 0);
+ readValue = GLINT_READ_REG(OutputFIFO);
+ } while (readValue != Sync_tag);
+
+ ACCESSCHIP2();
+ /* Read 2nd MX until Sync Tag shows */
+ do {
+ while(GLINT_READ_REG(OutFIFOWords) == 0);
+ readValue = GLINT_READ_REG(OutputFIFO);
+ } while (readValue != Sync_tag);
+
+ ACCESSCHIP1();
+}
+
+
+static void
TXSetupForFillRectSolid(
ScrnInfoPtr pScrn,
int color, int rop,
@@ -492,7 +514,7 @@ TXSetupForScanlineCPUToScreenColorExpandFill(
REPLICATE(bg);
GLINT_WAIT(6);
DO_PLANEMASK(planemask);
- GLINT_WRITE_REG(0, RasterizerMode);
+ GLINT_WRITE_REG(pGlint->rasterizerMode, RasterizerMode);
if (rop == GXcopy) {
GLINT_WRITE_REG(pGlint->pprod, FBReadMode);
GLINT_WRITE_REG(UNIT_DISABLE, PatternRamMode);
@@ -541,7 +563,8 @@ TXSubsequentColorExpandScanline(ScrnInfoPtr pScrn, int bufno)
while (dwords >= infoRec->ColorExpandRange) {
GLINT_WAIT(infoRec->ColorExpandRange);
GLINT_WRITE_REG((infoRec->ColorExpandRange - 2)<<16 | 0x0D, OutputFIFO);
- MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), src,
+ GLINT_MoveDWORDS(
+ (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), src,
infoRec->ColorExpandRange - 1);
dwords -= (infoRec->ColorExpandRange - 1);
src += (infoRec->ColorExpandRange - 1);
@@ -549,51 +572,12 @@ TXSubsequentColorExpandScanline(ScrnInfoPtr pScrn, int bufno)
if (dwords) {
GLINT_WAIT(dwords);
GLINT_WRITE_REG((dwords - 1)<<16 | 0x0D, OutputFIFO);
- MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), src,dwords);
+ GLINT_MoveDWORDS(
+ (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), src,dwords);
}
pGlint->cpucount += 1;
}
-static void
-TXSetupForCPUToScreenColorExpandFill(
- ScrnInfoPtr pScrn,
- int fg, int bg,
- int rop,
- unsigned int planemask
-){
- GLINTPtr pGlint = GLINTPTR(pScrn);
- REPLICATE(fg);
-
- DO_PLANEMASK(planemask);
- if (rop == GXcopy) {
- GLINT_WRITE_REG(pGlint->pprod, FBReadMode);
- GLINT_WRITE_REG(UNIT_DISABLE, PatternRamMode);
- GLINT_WRITE_REG(fg, FBBlockColor);
- pGlint->FrameBufferReadMode = FastFillEnable;
- } else {
- GLINT_WRITE_REG(pGlint->pprod | FBRM_DstEnable, FBReadMode);
- GLINT_WRITE_REG(UNIT_ENABLE, PatternRamMode);
- GLINT_WRITE_REG(fg, PatternRamData0);
- pGlint->FrameBufferReadMode = FastFillEnable | SpanOperation;
- }
- LOADROP(rop);
-}
-
-static void
-TXSubsequentCPUToScreenColorExpandFill(
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h,
- int skipleft
-){
- GLINTPtr pGlint = GLINTPTR(pScrn);
- int dwords = ((w + 31) >> 5) * h;
-
- TXLoadCoord(pScrn, x, y, x+w, h, 0, 1);
- GLINT_WRITE_REG(PrimitiveTrapezoid | pGlint->FrameBufferReadMode |
- SyncOnBitMask, Render);
- GLINT_WRITE_REG((dwords - 1)<<16 | 0x0D, OutputFIFO);
-}
-
void TXSetupForMono8x8PatternFill(
ScrnInfoPtr pScrn,
int patternx, int patterny,
@@ -696,7 +680,7 @@ TXWriteBitmap(ScrnInfoPtr pScrn,
GLINT_WAIT(11);
DO_PLANEMASK(planemask);
- GLINT_WRITE_REG(0, RasterizerMode);
+ GLINT_WRITE_REG(pGlint->rasterizerMode, RasterizerMode);
LOADROP(rop);
if (rop == GXcopy) {
mode = 0;
@@ -775,7 +759,7 @@ SECOND_PASS:
SecondPass = FALSE;
REPLICATE(bg);
GLINT_WAIT(4);
- GLINT_WRITE_REG(InvertBitMask, RasterizerMode);
+ GLINT_WRITE_REG(InvertBitMask | pGlint->rasterizerMode, RasterizerMode);
if (rop == GXcopy) {
GLINT_WRITE_REG(bg, FBBlockColor);
} else {
@@ -785,7 +769,7 @@ SECOND_PASS:
}
GLINT_WAIT(2);
- GLINT_WRITE_REG(0, RasterizerMode);
+ GLINT_WRITE_REG(pGlint->rasterizerMode, RasterizerMode);
CHECKCLIPPING;
SET_SYNC_FLAG(infoRec);
}
@@ -848,7 +832,8 @@ TXWritePixmap(
/* (0x15 << 4) | 0x05 is the TAG for FBSourceData */
GLINT_WRITE_REG(((infoRec->ColorExpandRange - 2) << 16) | (0x15 << 4) |
0x05, OutputFIFO);
- MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
+ GLINT_MoveDWORDS(
+ (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
(CARD32*)srcp, infoRec->ColorExpandRange - 1);
count -= infoRec->ColorExpandRange - 1;
srcp += infoRec->ColorExpandRange - 1;
@@ -858,7 +843,8 @@ TXWritePixmap(
/* (0x15 << 4) | 0x05 is the TAG for FBSourceData */
GLINT_WRITE_REG(((count - 1) << 16) | (0x15 << 4) |
0x05, OutputFIFO);
- MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
+ GLINT_MoveDWORDS(
+ (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
(CARD32*)srcp, count);
}
src += srcwidth;
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/i128/Imakefile b/xc/programs/Xserver/hw/xfree86/drivers/i128/Imakefile
index ff5cdf85f..30bd22e5e 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/i128/Imakefile
+++ b/xc/programs/Xserver/hw/xfree86/drivers/i128/Imakefile
@@ -1,4 +1,4 @@
-XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i128/Imakefile,v 1.3 2000/12/11 01:53:00 robin Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i128/Imakefile,v 1.4 2001/01/24 00:06:19 dawes Exp $
XCOMM
XCOMM This is the Imakefile for the I128 driver.
XCOMM
@@ -36,7 +36,6 @@ ObjectModuleTarget(i128,$(OBJS))
InstallObjectModule(i128,$(MODULEDIR),drivers)
#if !defined(XF86DriverSDK)
-CppManTarget(i128,)
InstallModuleManPage(i128)
#endif
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/i128/i128.cpp b/xc/programs/Xserver/hw/xfree86/drivers/i128/i128.cpp
deleted file mode 100644
index 48926990f..000000000
--- a/xc/programs/Xserver/hw/xfree86/drivers/i128/i128.cpp
+++ /dev/null
@@ -1,70 +0,0 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i128/i128.cpp,v 1.2 2000/12/11 20:18:14 dawes Exp $
-.\" shorthand for double quote that works everywhere.
-.ds q \N'34'
-.TH I128 __drivermansuffix__ "Version 4.0.2" "XFree86"
-.SH NAME
-i128 \- Number 9 I128 video driver
-.SH SYNOPSIS
-.nf
-.B "Section \*qDevice\*q"
-.BI " Identifier \*q" devname \*q
-.B " Driver \*qi128\*q"
-\ \ ...
-.B EndSection
-.fi
-.SH DESCRIPTION
-.B i128
-is an XFree86 driver for Number 9 I128 video cards. The driver is
-accelerated and provides support for all versions of the I128 chip family,
-including the SGI flatpanel configuration. Multi-head configurations are
-supported.
-.SH SUPPORTED HARDWARE
-The
-.B i128
-driver supports PCI and AGP video cards based on the following I128 chips:
-.TP 12
-.B I128 rev 1
-(original)
-.TP 12
-.B I128-II
-.TP 12
-.B I128-T2R
-Ticket 2 Ride
-.TP 12
-.B I128-T2R4
-Ticket 2 Ride IV
-.SH CONFIGURATION DETAILS
-Please refer to XF86Config(__filemansuffix__) for general configuration
-details. This section only covers configuration details specific to this
-driver.
-.PP
-The driver auto-detects the chipset type and may not be overridden.
-.PP
-The driver auto-detects the amount of video memory present for all
-chips and may not be overridden.
-.PP
-The following driver
-.B Options
-are supported:
-.TP
-.BI "Option \*qHWCursor\*q \*q" boolean \*q
-Enable or disable the HW cursor. Default: on.
-.TP
-.BI "Option \*qNoAccel\*q \*q" boolean \*q
-Disable or enable acceleration. Default: acceleration is enabled.
-.TP
-.BI "Option \*qSyncOnGreen\*q \*q" boolean \*q
-Enable or disable combining the sync signals with the green signal.
-Default: off.
-.TP
-.BI "Option \*qDac6Bit\*q \*q" boolean \*q
-Reduce DAC operations to 6 bits.
-Default: false.
-.TP
-.BI "Option \*qDebug\*q \*q" boolean \*q
-This turns on verbose debug information from the driver.
-Default: off.
-.SH "SEE ALSO"
-XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__)
-.SH AUTHORS
-Authors include: Robin Cutshaw (driver), Galen Brooks (flatpanel support).
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/i128/i128_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/i128/i128_driver.c
index af1800868..4ce35cb0a 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/i128/i128_driver.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/i128/i128_driver.c
@@ -22,7 +22,7 @@
*
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i128/i128_driver.c,v 1.17 2000/12/11 01:53:01 robin Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i128/i128_driver.c,v 1.18 2001/01/21 21:19:26 tsi Exp $ */
/* All drivers should typically include these */
@@ -86,11 +86,9 @@ static Bool I128SaveScreen(ScreenPtr pScreen, int mode);
static void I128FreeScreen(int scrnIndex, int flags);
static int I128ValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose,
int flags);
-#ifdef DPMSExtension
static void I128DisplayPowerManagementSet(ScrnInfoPtr pScrn,
int PowerManagementMode,
int flags);
-#endif
/* Internally used functions */
static Bool I128GetRec(ScrnInfoPtr pScrn);
@@ -188,9 +186,7 @@ static const char *vgahwSymbols[] = {
static const char *fbSymbols[] = {
"fbScreenInit",
-#ifdef RENDER
"fbPictureInit",
-#endif
NULL
};
@@ -1158,10 +1154,7 @@ I128PreInit(ScrnInfoPtr pScrn, int flags)
I128FreeRec(pScrn);
return FALSE;
}
- xf86LoaderReqSymbols("fbScreenInit", NULL);
-#ifdef RENDER
- xf86LoaderReqSymbols("fbPictureInit", NULL);
-#endif
+ xf86LoaderReqSymbols("fbScreenInit", "fbPictureInit", NULL);
/* Load XAA if needed */
if (!pI128->NoAccel) {
@@ -1536,9 +1529,7 @@ I128ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
if (!ret)
return FALSE;
-#ifdef RENDER
fbPictureInit(pScreen, 0, 0);
-#endif
if (pScrn->bitsPerPixel > 8) {
/* Fixup RGB ordering */
@@ -1603,9 +1594,7 @@ I128ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
CMAP_PALETTED_TRUECOLOR | CMAP_RELOAD_ON_MODE_SWITCH))
return FALSE;
-#ifdef DPMSExtension
xf86DPMSInit(pScreen, I128DisplayPowerManagementSet, 0);
-#endif
pScrn->memPhysBase = (unsigned long)pI128->MemoryPtr;
pScrn->fbOffset = 0;
@@ -1980,7 +1969,6 @@ I128getDDC(ScrnInfoPtr pScrn)
*
* Sets VESA Display Power Management Signaling (DPMS) Mode.
*/
-#ifdef DPMSExtension
void
I128DisplayPowerManagementSet(ScrnInfoPtr pScrn, int PowerManagementMode,
int flags)
@@ -2019,8 +2007,6 @@ I128DisplayPowerManagementSet(ScrnInfoPtr pScrn, int PowerManagementMode,
pI128->mem.rbase_g[DATA_I] = snc; MB;
}
-#endif
-
void
I128DumpBaseRegisters(ScrnInfoPtr pScrn)
{
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/i740/i740.cpp b/xc/programs/Xserver/hw/xfree86/drivers/i740/i740.cpp
deleted file mode 100644
index b3d4c9438..000000000
--- a/xc/programs/Xserver/hw/xfree86/drivers/i740/i740.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i740/i740.cpp,v 1.5 2000/12/11 20:18:15 dawes Exp $
-.\" shorthand for double quote that works everywhere.
-.ds q \N'34'
-.TH I740 __drivermansuffix__ "Version 4.0.2" "XFree86"
-.SH NAME
-i740 \- Intel i740 video driver
-.SH SYNOPSIS
-.nf
-.B "Section \*qDevice\*q"
-.BI " Identifier \*q" devname \*q
-.B " Driver \*qi740\*q"
-\ \ ...
-.B EndSection
-.fi
-.SH DESCRIPTION
-.B i740
-is an XFree86 driver for Intel i740 video cards.
-THIS MAN PAGE NEEDS TO BE FILLED IN.
-.SH SUPPORTED HARDWARE
-The
-.B i740
-driver supports...
-.SH CONFIGURATION DETAILS
-Please refer to XF86Config(__filemansuffix__) for general configuration
-details. This section only covers configuration details specific to this
-driver.
-.SH "SEE ALSO"
-XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__)
-.SH AUTHORS
-Authors include: ...
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/i810/Imakefile b/xc/programs/Xserver/hw/xfree86/drivers/i810/Imakefile
index 661c7000e..22ea98c08 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.13 2000/09/20 00:09:21 keithp Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/Imakefile,v 1.14 2001/01/24 00:06:20 dawes Exp $
XCOMM
XCOMM This is the Imakefile for the i810 driver.
XCOMM
@@ -47,7 +47,6 @@ ObjectModuleTarget(i810,$(OBJS))
InstallObjectModule(i810,$(MODULEDIR),drivers)
#if !defined(XF86DriverSDK)
-CppManTarget(i810,)
InstallModuleManPage(i810)
#endif
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/i810/i810.cpp b/xc/programs/Xserver/hw/xfree86/drivers/i810/i810.cpp
deleted file mode 100644
index 17ab9429c..000000000
--- a/xc/programs/Xserver/hw/xfree86/drivers/i810/i810.cpp
+++ /dev/null
@@ -1,71 +0,0 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810.cpp,v 1.6 2000/12/11 20:18:17 dawes Exp $
-.\" shorthand for double quote that works everywhere.
-.ds q \N'34'
-.TH I810 __drivermansuffix__ "Version 4.0.2" "XFree86"
-.SH NAME
-i810 \- Intel i810 video driver
-.SH SYNOPSIS
-.nf
-.B "Section \*qDevice\*q"
-.BI " Identifier \*q" devname \*q
-.B " Driver \*qi810\*q"
-\ \ ...
-.B EndSection
-.fi
-.SH DESCRIPTION
-.B i810
-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
-.B i810
-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: 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_dri.c b/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_dri.c
index 03ec81480..c8c1d34cf 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.13 2000/12/01 14:28:56 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_dri.c,v 1.14 2000/12/21 12:22:56 alanh Exp $ */
#include "xf86.h"
#include "xf86_OSproc.h"
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 5f9416924..985ff3f10 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.39 2000/12/02 15:30:42 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c,v 1.43 2001/01/21 21:19:27 tsi Exp $ */
/*
* Authors:
@@ -84,15 +84,13 @@ static void I810FreeScreen(int scrnIndex, int flags);
static int I810ValidMode(int scrnIndex, DisplayModePtr mode, Bool
verbose, int flags);
-#ifdef DPMSExtension
static void I810DisplayPowerManagementSet(ScrnInfoPtr pScrn,
int PowerManagermentMode,
int flags);
-#endif
DriverRec I810 = {
I810_VERSION,
- "Accelerated driver for Intel i810 cards",
+ I810_DRIVER_NAME,
I810Identify,
I810Probe,
I810AvailableOptions,
@@ -158,12 +156,16 @@ static const char *fbSymbols[] = {
NULL
};
-
static const char *miscSymbols[] = {
"GetTimeInMillis",
NULL
};
+static const char *vbeSymbols[] = {
+ "VBEInit",
+ "vbeDoEDID",
+ NULL
+};
static const char *xaaSymbols[] = {
"XAADestroyInfoRec",
@@ -290,6 +292,7 @@ i810Setup(pointer module, pointer opts, int *errmaj, int *errmin)
drmSymbols,
driSymbols,
#endif
+ vbeSymbols,
NULL /* ddcsymbols */,
NULL /* i2csymbols */,
NULL /* shadowSymbols */,
@@ -1644,6 +1647,9 @@ I810ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) {
return FALSE;
}
+ if (!miSetPixmapDepths ())
+ return FALSE;
+
{
I810RegPtr i810Reg = &pI810->ModeReg;
int i;
@@ -1717,6 +1723,8 @@ I810ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) {
}
}
+ fbPictureInit (pScreen, 0, 0);
+
xf86SetBlackWhitePixels(pScreen);
#ifdef XF86DRI
@@ -1785,9 +1793,7 @@ I810ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) {
return FALSE;
#endif
-#ifdef DPMSExtension
xf86DPMSInit(pScreen, I810DisplayPowerManagementSet, 0);
-#endif
I810InitVideo(pScreen);
@@ -2012,7 +2018,6 @@ I810SaveScreen(ScreenPtr pScreen, Bool unblack)
return vgaHWSaveScreen(pScreen, unblack);
}
-#ifdef DPMSExtension
static void
I810DisplayPowerManagementSet(ScrnInfoPtr pScrn, int PowerManagementMode,
int flags) {
@@ -2051,10 +2056,3 @@ I810DisplayPowerManagementSet(ScrnInfoPtr pScrn, int PowerManagementMode,
/* Set the DPMS mode */
OUTREG8(DPMS_SYNC_SELECT, DPMSSyncSelect);
}
-#endif
-
-
-
-
-
-
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 35daecb8c..b1ab66cb0 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.14 2000/12/06 01:40:49 mvojkovi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_video.c,v 1.16 2001/01/30 19:23:55 mvojkovi Exp $ */
/*
* i810_video.c: i810 Xv driver. Based on the mga Xv driver by Mark Vojkovich.
@@ -31,10 +31,6 @@ THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* Authors:
* Jonathan Bian <jonathan.bian@intel.com>
*
- * Notes:
- * This module currently allocates 810*2KB out of "SysMem" for the YUV
- * buffers. This may not be the best solution ...
- *
*/
#include "xf86.h"
@@ -133,6 +129,9 @@ static Atom xvBrightness, xvContrast, xvColorKey;
#define BUFFER1_FIELD0 0x00000004
#define OVERLAY_ENABLE 0x00000001
+#define UV_VERT_BUF1 0x02
+#define UV_VERT_BUF0 0x04
+
/*
* DOV0STA - Display/Overlay 0 Status Register
*/
@@ -600,6 +599,9 @@ I810QueryBestSize(
unsigned int *p_w, unsigned int *p_h,
pointer data
){
+ if(vid_w > (drw_w << 1)) drw_w = vid_w >> 1;
+ if(vid_h > (drw_h << 1)) drw_h = vid_h >> 1;
+
*p_w = drw_w;
*p_h = drw_h;
}
@@ -856,6 +858,9 @@ I810DisplayVideo(
switch(id) {
case FOURCC_YV12:
case FOURCC_I420:
+ /* set UV vertical phase to -0.25 */
+ overlay->UV_VPH = 0x30003000;
+ overlay->INIT_PH = UV_VERT_BUF0 | UV_VERT_BUF1;
overlay->OV0STRIDE = (dstPitch << 1) | (dstPitch << 16);
overlay->OV0CMD &= ~SOURCE_FORMAT;
overlay->OV0CMD |= YUV_420;
@@ -863,6 +868,8 @@ I810DisplayVideo(
case FOURCC_UYVY:
case FOURCC_YUY2:
default:
+ overlay->UV_VPH = 0;
+ overlay->INIT_PH = 0;
overlay->OV0STRIDE = dstPitch;
overlay->OV0CMD &= ~SOURCE_FORMAT;
overlay->OV0CMD |= YUV_422;
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/imstt/Imakefile b/xc/programs/Xserver/hw/xfree86/drivers/imstt/Imakefile
index a2f771acb..313ed5002 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/imstt/Imakefile
+++ b/xc/programs/Xserver/hw/xfree86/drivers/imstt/Imakefile
@@ -1,4 +1,4 @@
-XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/imstt/Imakefile,v 1.3 2000/10/11 16:21:21 mvojkovi Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/imstt/Imakefile,v 1.4 2001/01/24 00:06:20 dawes Exp $
/*
*
* Copyright 2000 Ani Joshi <ajoshi@unixbox.com>
@@ -39,7 +39,6 @@ ObjectModuleTarget(imstt, $(OBJS))
InstallObjectModule(imstt,$(MODULEDIR),drivers)
#if !defined(XF86DriverSDK)
-CppManTarget(imstt,)
InstallModuleManPage(imstt)
#endif
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt.cpp b/xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt.cpp
deleted file mode 100644
index 1a7b51245..000000000
--- a/xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt.cpp,v 1.3 2000/12/11 20:18:18 dawes Exp $
-.\" shorthand for double quote that works everywhere.
-.ds q \N'34'
-.TH IMSTT __drivermansuffix__ "Version 4.0.2" "XFree86"
-.SH NAME
-imstt \- Integrated Micro Solutions Twin Turbo 128 driver
-.SH SYNOPSIS
-.nf
-.B "Section \*qDevice\*q"
-.BI " Identifier \*q" devname \*q
-.B " Driver \*qimstt\*q"
-\ \ ...
-.B EndSection
-.fi
-.SH DESCRIPTION
-.B imstt
-is an XFree86 driver for Integrated Micro Solutions Twin Turbo 128 video chips.
-THIS MAN PAGE NEEDS TO BE FILLED IN.
-.SH SUPPORTED HARDWARE
-The
-.B imstt
-driver supports...
-.SH CONFIGURATION DETAILS
-Please refer to XF86Config(__filemansuffix__) for general configuration
-details. This section only covers configuration details specific to this
-driver.
-.SH "SEE ALSO"
-XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__)
-.SH AUTHORS
-Authors include: ...
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/mga/Imakefile b/xc/programs/Xserver/hw/xfree86/drivers/mga/Imakefile
index 9aadb83c2..958906fa6 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.39 2000/12/14 16:38:49 dawes Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/Imakefile,v 1.41 2001/02/13 19:19:15 dawes Exp $
XCOMM
XCOMM This is an Imakefile for the MGA driver.
XCOMM
@@ -57,10 +57,10 @@ hallib/libmga_hal.a: $(SUBDIRS)
MGASRCS = mga_driver.c mga_hwcurs.c /* mga_cmap.c */ mga_dac3026.c mga_dacG.c \
mga_storm8.c mga_storm16.c mga_storm24.c mga_storm32.c mga_arc.c \
- mga_dga.c mga_shadow.c mga_video.c $(DRISRCS)
+ mga_dga.c mga_shadow.c mga_video.c mga_g450pll.c $(DRISRCS)
MGAOBJS = mga_driver.o mga_hwcurs.o /* mga_cmap.o */ mga_dac3026.o mga_dacG.o \
mga_storm8.o mga_storm16.o mga_storm24.o mga_storm32.o mga_arc.o \
- mga_dga.o mga_shadow.o mga_video.o $(DRIOBJS)
+ mga_dga.o mga_shadow.o mga_video.o mga_g450pll.o $(DRIOBJS)
SRCS = $(MGASRCS) $(MGAHALSRCS)
OBJS = $(MGAOBJS) $(MGAHALOBJS)
@@ -109,7 +109,6 @@ InstallObjectModule(mga_hal,$(MODULEDIR),drivers)
#endif
#if !defined(XF86DriverSDK)
-CppManTarget(mga,)
InstallModuleManPage(mga)
#endif
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/mga/mga.cpp b/xc/programs/Xserver/hw/xfree86/drivers/mga/mga.cpp
deleted file mode 100644
index 9711e40d1..000000000
--- a/xc/programs/Xserver/hw/xfree86/drivers/mga/mga.cpp
+++ /dev/null
@@ -1,122 +0,0 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga.cpp,v 1.9 1999/08/28 10:43:36 dawes Exp $
-.TH MGA __drivermansuffix__ "Version 3.9.16" "XFree86"
-.SH NAME
-mga \- Matrox video driver
-.SH SYNOPSIS
-.B "Section ""Device"""
-.br
-.BI " Identifier """ devname """"
-.br
-.B " Driver ""mga"""
-.br
-\ \ ...
-.br
-.B EndSection
-.SH DESCRIPTION
-.B mga
-is an XFree86 driver for Matrox video cards. The driver is fully
-accelerated, and provides support for the following framebuffer depths:
-8, 15, 16, 24, and an 8+24 overlay mode (all chips except G100). All
-visual types are supported for depth 8, and both TrueColor and DirectColor
-visuals are supported for the other depths except 8+24 mode which supports
-PseudoColor, GrayScale and TrueColor. Multi-head configurations
-are supported.
-.SH SUPPORTED HARDWARE
-The
-.B mga
-driver supports PCI and AGP video cards based on the following Matrox chips:
-.TP 12
-.B MGA2064W
-Millennium (original)
-.TP 12
-.B MGA1064SG
-Mystique
-.TP 12
-.B MGA2164W
-Millennium II
-.TP 12
-.B G100
-.TP 12
-.B G200
-Millennium G200 and Mystique G200
-.TP 12
-.B G400
-.SH CONFIGURATION DETAILS
-Please refer to XF86Config(__filemansuffix__) for general configuration
-details. This section only covers configuration details specific to this
-driver.
-.PP
-The driver auto-detects the chipset type, but the following
-.B ChipSet
-names may optionally be specified in the config file
-.B """Device"""
-section, and will override the auto-detection:
-.PP
-.RS 4
-"mga2064w", "mga1064sg", "mga2164w", "mga2164w agp", "mgag100", "mgag200",
-"mgag200 pci" "mgag400".
-.RE
-.PP
-The driver will auto-detect the amount of video memory present for all
-chips except the Millennium II. In the Millennium II case it defaults
-to 4096\ kBytes. When using a Millennium II, the actual amount of video
-memory should be specified with a
-.B VideoRam
-entry in the config file
-.B """Device"""
-section.
-.PP
-The following driver
-.B Options
-are supported:
-.TP
-.BI "Option ""ColorKey"" """ integer """
-Set the colormap index used for the transparency key for the depth 8 plane
-when operating in 8+24 overlay mode. The value must be in the range
-2\-255. Default: 255.
-.TP
-.BI "Option ""HWCursor"" """ boolean """
-Enable or disable the HW cursor. Default: on.
-.TP
-.BI "Option ""MGASDRAM"" """ boolean """
-Specify whether G100 and G200 cards have SDRAM. The driver attempts to
-auto-detect this based on the card's PCI subsystem ID. This option may
-be used to override that auto-detection. Default: auto-detected.
-.TP
-.BI "Option ""NoAccel"" """ boolean """
-Disable or enable acceleration. Default: acceleration is enabled.
-.TP
-.BI "Option ""OverclockMem""
-Set clocks to values used by some commercial X-Servers (G100, G200 and G400
-only). Default: off.
-.TP
-.BI "Option ""Overlay""
-Enable 8+24 overlay mode. Only appropriate for depth 24. Default: off.
-.TP
-.BI "Option ""PciRetry"" """ boolean """
-Enable or disable PCI retries. Default: off.
-.TP
-.BI "Option ""Rotate"" ""CW""
-.TP
-.BI "Option ""Rotate"" ""CCW""
-Rotate the display clockwise or counterclockwise. This mode is unaccelerated.
-Default: no rotation.
-.TP
-.BI "Option ""ShadowFB"" """ boolean """
-Enable or disable use of the shadow framebuffer layer. See
-shadowfb(__drivermansuffix__) for further information. Default: off.
-.TP
-.BI "Option ""SyncOnGreen"" """ boolean """
-Enable or disable combining the sync signals with the green signal.
-Default: off.
-.TP
-.BI "Option ""UseFBDev"" """ boolean """
-Enable or disable use of on OS-specific fb interface (and is not supported
-on all OSs). See fbdevhw(__drivermansuffix__) for further information.
-Default: off.
-.SH "SEE ALSO"
-XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(1)
-.SH AUTHORS
-Authors include: Radoslaw Kapitan, Mark Vojkovich, and also David Dawes, Guy
-Desbief, Dirk Hohndel, Doug Merritt, Andrew E. Mileski, Andrew Vanderstock,
-Leonard N. Zubkoff.
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/mga/mga.h b/xc/programs/Xserver/hw/xfree86/drivers/mga/mga.h
index 1881ab7ad..3e6336a32 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.70 2000/12/06 15:35:19 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga.h,v 1.71 2001/02/13 19:19:15 dawes Exp $ */
/*
* MGA Millennium (MGA2064W) functions
*
@@ -432,4 +432,5 @@ Bool MgaInitDma(ScrnInfoPtr pScrn, int prim_size);
#endif
+double G450SetPLLFreq(ScrnInfoPtr pScrn, long f_out);
#endif
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 3f74af156..2d5361f9b 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.42 2000/12/06 15:35:20 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dacG.c,v 1.43 2001/02/13 19:19:15 dawes Exp $ */
/*
* This is a first cut at a non-accelerated version to work with the
@@ -237,6 +237,11 @@ MGAGSetPCLK( ScrnInfoPtr pScrn, long f_out )
/* The actual frequency output by the clock */
double f_pll;
+ if(MGAISG450(pMga)) {
+ G450SetPLLFreq(pScrn, f_out);
+ return;
+ }
+
/* Do the calculations for m, n, p and s */
f_pll = MGAGCalcClock( pScrn, f_out, &m, &n, &p, &s );
@@ -338,6 +343,9 @@ MGAGInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
#ifdef USEMGAHAL
MGA_HAL(break;);
#endif
+ if (MGAISG450(pMga))
+ break;
+
if(pMga->Dac.maxPixelClock == 360000) { /* G400 MAX */
if(pMga->OverclockMem) {
/* 150/200 */
@@ -379,7 +387,7 @@ MGAGInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
case PCI_CHIP_MGAG200_PCI:
default:
#ifdef USEMGAHAL
- MGA_HAL(break;);
+ MGA_HAL(break;);
#endif
if(pMga->OverclockMem) {
/* 143 Mhz */
@@ -528,6 +536,10 @@ MGAGInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
if (mode->Flags & V_DBLSCAN)
pVga->CRTC[9] |= 0x80;
+ if(MGAISG450(pMga)) {
+ OUTREG(MGAREG_ZORG, 0);
+ }
+
MGAGSetPCLK(pScrn, mode->Clock);
); /* MGA_NOT_HAL */
@@ -656,7 +668,10 @@ MGAGRestore(ScrnInfoPtr pScrn, vgaRegPtr vgaReg, MGARegPtr mgaReg,
(i == 0x1b) ||
(i == 0x1c) ||
((i >= 0x1f) && (i <= 0x29)) ||
- ((i >= 0x30) && (i <= 0x37)) )
+ ((i >= 0x30) && (i <= 0x37)) ||
+ (MGAISG450(pMga) &&
+ ((i == 0x2c) || (i == 0x2d) || (i == 0x2e) ||
+ (i == 0x4c) || (i == 0x4d) || (i == 0x4e))))
continue;
outMGAdac(i, mgaReg->DacRegs[i]);
}
@@ -665,15 +680,17 @@ MGAGRestore(ScrnInfoPtr pScrn, vgaRegPtr vgaReg, MGARegPtr mgaReg,
should be correct already */
optionMask = (pMga->Primary) ? OPTION1_MASK_PRIMARY : OPTION1_MASK;
- /* restore pci_option register */
- pciSetBitsLong(pMga->PciTag, PCI_OPTION_REG, optionMask,
- mgaReg->Option);
- if (pMga->Chipset != PCI_CHIP_MGA1064)
- pciSetBitsLong(pMga->PciTag, PCI_MGA_OPTION2, OPTION2_MASK,
- mgaReg->Option2);
- if (pMga->Chipset == PCI_CHIP_MGAG400)
- pciSetBitsLong(pMga->PciTag, PCI_MGA_OPTION3, OPTION3_MASK,
- mgaReg->Option3);
+ if (!MGAISG450(pMga)) {
+ /* restore pci_option register */
+ pciSetBitsLong(pMga->PciTag, PCI_OPTION_REG, optionMask,
+ mgaReg->Option);
+ if (pMga->Chipset != PCI_CHIP_MGA1064)
+ pciSetBitsLong(pMga->PciTag, PCI_MGA_OPTION2, OPTION2_MASK,
+ mgaReg->Option2);
+ if (pMga->Chipset == PCI_CHIP_MGAG400)
+ pciSetBitsLong(pMga->PciTag, PCI_MGA_OPTION3, OPTION3_MASK,
+ mgaReg->Option3);
+ }
); /* MGA_NOT_HAL */
/* restore CRTCEXT regs */
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 73fbb11bd..09221b4aa 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.14 2000/12/11 22:34:55 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dri.c,v 1.16 2001/01/08 01:07:37 martin Exp $ */
/*
* Copyright 2000 VA Linux Systems Inc., Fremont, California.
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 d8e27a6c2..10aa74cbb 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_driver.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_driver.c
@@ -42,8 +42,8 @@
* doug@netcom.com
* Fixed 32bpp hires 8MB horizontal line glitch at middle right
*/
-
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_driver.c,v 1.185 2000/12/07 20:26:21 dawes Exp $ */
+
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_driver.c,v 1.189 2001/02/15 18:16:18 eich Exp $ */
/*
* This is a first cut at a non-accelerated version to work with the
@@ -96,11 +96,6 @@
#include "dri.h"
#endif
-
-#ifdef RENDER
-#include "picturestr.h"
-#endif
-
/*
* Forward definitions for the functions that make up the driver.
*/
@@ -129,11 +124,9 @@ static void VgaIORestore(int i, void *arg);
static void MGAFreeScreen(int scrnIndex, int flags);
static int MGAValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose,
int flags);
-#ifdef DPMSExtension
static void MGADisplayPowerManagementSet(ScrnInfoPtr pScrn,
int PowerManagementMode,
int flags);
-#endif
/* Internally used functions */
static Bool MGAMapMem(ScrnInfoPtr pScrn);
@@ -143,6 +136,7 @@ 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 void MGAG100BlackMagic(MGAPtr pMga);
static int MGAEntityIndex = -1;
@@ -157,9 +151,6 @@ static int MGAEntityIndex = -1;
DriverRec MGA_C_NAME = {
MGA_VERSION,
MGA_DRIVER_NAME,
-#if 0
- "accelerated driver for Matrox Millennium and Mystique cards",
-#endif
MGAIdentify,
MGAProbe,
MGAAvailableOptions,
@@ -212,13 +203,16 @@ typedef enum {
OPTION_ROTATE,
OPTION_TEXTURED_VIDEO,
OPTION_CRTC2HALF,
+ OPTION_CRTC2RAM,
OPTION_INT10,
OPTION_AGP_MODE,
OPTION_DIGITAL,
OPTION_TV,
OPTION_TVSTANDARD,
OPTION_CABLETYPE,
- OPTION_NOHAL
+ OPTION_USEIRQZERO,
+ OPTION_NOHAL,
+ OPTION_SWAPPED_HEAD
} MGAOpts;
static OptionInfoRec MGAOptions[] = {
@@ -239,6 +233,7 @@ static OptionInfoRec MGAOptions[] = {
{ OPTION_ROTATE, "Rotate", OPTV_ANYSTR, {0}, FALSE },
{ OPTION_TEXTURED_VIDEO, "TexturedVideo",OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_CRTC2HALF, "Crtc2Half", OPTV_BOOLEAN, {0}, FALSE },
+ { OPTION_CRTC2RAM, "Crtc2Ram", OPTV_INTEGER, {0}, FALSE },
{ OPTION_INT10, "Int10", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_AGP_MODE, "AGPMode", OPTV_INTEGER, {0}, FALSE },
{ OPTION_DIGITAL, "DigitalScreen",OPTV_BOOLEAN, {0}, FALSE },
@@ -246,6 +241,7 @@ static OptionInfoRec MGAOptions[] = {
{ OPTION_TVSTANDARD, "TVStandard", OPTV_ANYSTR, {0}, FALSE },
{ OPTION_CABLETYPE, "CableType", OPTV_ANYSTR, {0}, FALSE },
{ OPTION_NOHAL, "NoHal", OPTV_BOOLEAN, {0}, FALSE },
+ { OPTION_SWAPPED_HEAD, "SwappedHead", OPTV_BOOLEAN, {0}, FALSE },
{ -1, NULL, OPTV_NONE, {0}, FALSE }
};
@@ -1157,6 +1153,7 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
MGAMODEINFO mgaModeInfo = {0};
Bool digital = FALSE;
Bool tv = FALSE;
+ Bool swap_head = FALSE;
#endif
/*
@@ -1372,9 +1369,8 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, MGAOptions);
pMga->softbooted = FALSE;
- if (xf86ReturnOptValBool(MGAOptions, OPTION_INT10, FALSE) &&
- xf86LoadSubModule(pScrn, "int10"))
- {
+ if (xf86ReturnOptValBool(MGAOptions, OPTION_INT10, FALSE) &&
+ xf86LoadSubModule(pScrn, "int10")) {
xf86Int10InfoPtr pInt;
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Initializing int10\n");
@@ -1387,7 +1383,6 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
if (pScrn->depth == 8)
pScrn->rgbBits = 8;
-
/*
* Set the Chipset and ChipRev, allowing config file entries to
* override.
@@ -1416,13 +1411,15 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
}
#ifdef USEMGAHAL
- if (HAL_CHIPSETS && !xf86ReturnOptValBool(MGAOptions, OPTION_NOHAL, FALSE)
- && xf86LoadSubModule(pScrn, "mga_hal")) {
+ if (HAL_CHIPSETS && !xf86ReturnOptValBool(MGAOptions, OPTION_NOHAL, FALSE)
+ && xf86LoadSubModule(pScrn, "mga_hal")) {
xf86LoaderReqSymLists(halSymbols, NULL);
xf86DrvMsg(pScrn->scrnIndex, X_INFO,"Matrox HAL module used\n");
pMga->HALLoaded = TRUE;
- } else
+ } else {
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Matrox HAL module not found - using builtin mode setup instead\n");
pMga->HALLoaded = FALSE;
+ }
#endif
/*
@@ -1759,8 +1756,8 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
xf86GetOptValBool(MGAOptions, OPTION_CRTC2HALF, &UseHalf);
adjust = pScrn->videoRam / 2;
- if (UseHalf == TRUE) {
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
+ if (UseHalf == TRUE || xf86GetOptValInteger(MGAOptions, OPTION_CRTC2RAM, &adjust)) {
+ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
"Crtc2 will use %dK of VideoRam\n",
adjust);
} else {
@@ -1900,11 +1897,16 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
}
if(pMga->SecondCrtc == TRUE) {
/* Override on 2nd crtc */
- pMga->MaxClock = 112000;
+
+ if (pMga->ChipRev >= 0x80) { /* G450 */
+ pMga->MaxClock = 234000;
+ } else {
+ pMga->MaxClock = 135000;
+ }
}
xf86DrvMsg(pScrn->scrnIndex, from, "Max pixel clock is %d MHz\n",
pMga->MaxClock / 1000);
- /*
+ /*
* Setup the ClockRanges, which describe what clock ranges are available,
* and what sort of modes they can be used for.
*/
@@ -2016,6 +2018,9 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
}
#ifdef USEMGAHAL
MGA_HAL(
+ swap_head
+ = xf86ReturnOptValBool(MGAOptions, OPTION_SWAPPED_HEAD, FALSE);
+
if(pMga->SecondCrtc == FALSE) {
pMga->pBoard = (LPBOARDHANDLE) xalloc (sizeof(CLIENTDATA) + MGAGetBOARDHANDLESize());
pMga->pClientStruct = (LPCLIENTDATA) xalloc (sizeof(CLIENTDATA));
@@ -2032,8 +2037,13 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
pMgaEnt->pClientStruct = pMga->pClientStruct;
pMgaEnt->pBoard = pMga->pBoard;
pMgaEnt->pMgaHwInfo = pMga->pMgaHwInfo;
- }
- mgaModeInfo.flOutput = MGAMODEINFO_ANALOG1;
+ }
+
+ if (!swap_head) {
+ mgaModeInfo.flOutput = MGAMODEINFO_ANALOG1;
+ } else {
+ mgaModeInfo.flOutput = MGAMODEINFO_ANALOG2;
+ }
mgaModeInfo.ulDispWidth = pScrn->virtualX;
mgaModeInfo.ulDispHeight = pScrn->virtualY;
mgaModeInfo.ulDeskWidth = pScrn->virtualX;
@@ -2048,8 +2058,13 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
mgaModeInfo.flOutput = MGAMODEINFO_TV |
MGAMODEINFO_SECOND_CRTC;
} else {
- mgaModeInfo.flOutput = MGAMODEINFO_ANALOG2 |
- MGAMODEINFO_SECOND_CRTC;
+ if (!swap_head) {
+ mgaModeInfo.flOutput = MGAMODEINFO_ANALOG2 |
+ MGAMODEINFO_SECOND_CRTC;
+ } else {
+ mgaModeInfo.flOutput = MGAMODEINFO_ANALOG1 |
+ MGAMODEINFO_SECOND_CRTC;
+ }
}
mgaModeInfo.ulDispWidth = pScrn->virtualX;
mgaModeInfo.ulDispHeight = pScrn->virtualY;
@@ -2082,10 +2097,10 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
* Can we trust HALlib to set the memory configuration
* registers correctly?
*/
- else if ((pMga->softbooted || pMga->Primary /*|| pMga->HALLoaded*/ ) &&
- (pMga->Chipset != PCI_CHIP_MGA2064) &&
- (pMga->Chipset != PCI_CHIP_MGA2164) &&
- (pMga->Chipset != PCI_CHIP_MGA2164_AGP)) {
+ else if ((pMga->softbooted || pMga->Primary /*|| pMga->HALLoaded*/ ) &&
+ (pMga->Chipset != PCI_CHIP_MGA2064) &&
+ (pMga->Chipset != PCI_CHIP_MGA2164) &&
+ (pMga->Chipset != PCI_CHIP_MGA2164_AGP)) {
CARD32 option_reg = pciReadLong(pMga->PciTag, PCI_OPTION_REG);
if(!(option_reg & (1 << 14))) {
pMga->HasSDRAM = TRUE;
@@ -2102,11 +2117,9 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
* are not pre-initialised at all.
*/
#ifdef USEMGAHAL
- MGA_HAL(xf86SetCrtcForModes(pScrn, 0));
- MGA_NOT_HAL(xf86SetCrtcForModes(pScrn, INTERLACE_HALVE_V));
-#else
- xf86SetCrtcForModes(pScrn, INTERLACE_HALVE_V);
+ MGA_HAL(xf86SetCrtcForModes(pScrn, 0));
#endif
+ MGA_NOT_HAL(xf86SetCrtcForModes(pScrn, INTERLACE_HALVE_V));
/* Set the current mode to the first in the list */
pScrn->currentMode = pScrn->modes;
@@ -2226,9 +2239,7 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
return FALSE;
}
reqSym = "fbScreenInit";
-#ifdef RENDER
xf86LoaderReqSymbols("fbPictureInit", NULL);
-#endif
}
xf86LoaderReqSymbols(reqSym, NULL);
@@ -2455,8 +2466,7 @@ MGASave(ScrnInfoPtr pScrn)
if(pMga->SecondCrtc == TRUE) return;
#ifdef USEMGAHAL
- if (pMga->HALLoaded)
- MGA_HAL(if (pMga->pBoard != NULL) MGASaveVgaState(pMga->pBoard));
+ MGA_HAL(if (pMga->pBoard != NULL) MGASaveVgaState(pMga->pBoard));
#endif
/* Only save text mode fonts/text for the primary card */
@@ -2545,13 +2555,13 @@ MGAModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
Bool digital = FALSE;
Bool tv = FALSE;
ULONG status;
+ Bool swap_head
+ = xf86ReturnOptValBool(MGAOptions, OPTION_SWAPPED_HEAD, FALSE);
- if (pMga->HALLoaded) {
- /* Verify if user wants digital screen output */
- xf86GetOptValBool(MGAOptions, OPTION_DIGITAL, &digital);
- /* Verify if user wants TV output */
- xf86GetOptValBool(MGAOptions, OPTION_TV, &tv);
- }
+ /* Verify if user wants digital screen output */
+ xf86GetOptValBool(MGAOptions, OPTION_DIGITAL, &digital);
+ /* Verify if user wants TV output */
+ xf86GetOptValBool(MGAOptions, OPTION_TV, &tv);
#endif
vgaHWUnlock(hwp);
@@ -2570,7 +2580,7 @@ MGAModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
mgaReg = &pMga->ModeReg;
#ifdef USEMGAHAL
- MGA_HAL(
+ MGA_HAL(
FillModeInfoStruct(pScrn,mode);
if(pMga->SecondCrtc == TRUE) {
@@ -2585,14 +2595,26 @@ MGAModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
MGAMODEINFO_FORCE_PITCH |
MGAMODEINFO_FORCE_DISPLAYORG;
} else {
- pMga->pMgaModeInfo->flOutput = MGAMODEINFO_ANALOG2 |
- MGAMODEINFO_SECOND_CRTC |
- MGAMODEINFO_FORCE_PITCH |
- MGAMODEINFO_FORCE_DISPLAYORG;
+ if (!swap_head) {
+ pMga->pMgaModeInfo->flOutput = MGAMODEINFO_ANALOG2 |
+ MGAMODEINFO_SECOND_CRTC |
+ MGAMODEINFO_FORCE_PITCH |
+ MGAMODEINFO_FORCE_DISPLAYORG;
+ } else {
+ pMga->pMgaModeInfo->flOutput = MGAMODEINFO_ANALOG1 |
+ MGAMODEINFO_SECOND_CRTC |
+ MGAMODEINFO_FORCE_PITCH |
+ MGAMODEINFO_FORCE_DISPLAYORG;
+ }
}
} else {
- pMga->pMgaModeInfo->flOutput = MGAMODEINFO_ANALOG1 |
- MGAMODEINFO_FORCE_PITCH;
+ if (!swap_head) {
+ pMga->pMgaModeInfo->flOutput = MGAMODEINFO_ANALOG1 |
+ MGAMODEINFO_FORCE_PITCH;
+ } else {
+ pMga->pMgaModeInfo->flOutput = MGAMODEINFO_ANALOG2 |
+ MGAMODEINFO_FORCE_PITCH;
+ }
}
pMga->pMgaModeInfo->ulFBPitch = pScrn->displayWidth;
@@ -2635,10 +2657,8 @@ MGAModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
outMGAdac(MGA1064_CURSOR_BASE_ADR_HI, pMga->FbCursorOffset >> 18);
}
); /* MGA_HAL */
- MGA_NOT_HAL((*pMga->Restore)(pScrn, vgaReg, mgaReg, FALSE));
-#else
- (*pMga->Restore)(pScrn, vgaReg, mgaReg, FALSE);
#endif
+ MGA_NOT_HAL((*pMga->Restore)(pScrn, vgaReg, mgaReg, FALSE));
MGAStormSync(pScrn);
MGAStormEngineInit(pScrn);
@@ -2681,12 +2701,12 @@ MGARestore(ScrnInfoPtr pScrn)
vgaHWProtect(pScrn, TRUE);
if (pMga->Primary) {
#ifdef USEMGAHAL
- MGA_HAL(
- if(pMga->pBoard != NULL) {
- MGASetVgaMode(pMga->pBoard);
- MGARestoreVgaState(pMga->pBoard);
- }
- ); /* MGA_HAL */
+ MGA_HAL(
+ if(pMga->pBoard != NULL) {
+ MGASetVgaMode(pMga->pBoard);
+ MGARestoreVgaState(pMga->pBoard);
+ }
+ ); /* MGA_HAL */
#endif
(*pMga->Restore)(pScrn, vgaReg, mgaReg, TRUE);
} else {
@@ -2754,6 +2774,10 @@ MGAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
return FALSE;
}
+ if ((pMga->Chipset == PCI_CHIP_MGAG100)
+ || (pMga->Chipset == PCI_CHIP_MGAG100_PCI))
+ MGAG100BlackMagic(pMga);
+
if (xf86IsEntityShared(pScrn->entityList[0])) {
DevUnion *pPriv;
pPriv = xf86GetEntityPrivate(pScrn->entityList[0], MGAEntityIndex);
@@ -2787,7 +2811,7 @@ MGAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
pMga->pBoard = pMgaEnt->pBoard;
pMga->pMgaHwInfo = pMgaEnt->pMgaHwInfo;
}
- );
+ ); /* MGA_HAL */
#endif
} else {
#ifdef USEMGAHAL
@@ -2804,14 +2828,14 @@ MGAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
}
#ifdef USEMGAHAL
MGA_HAL(
- /* There is a problem in the HALlib: set soft reset bit */
- if ( !pMga->Primary && !pMga->FBDev &&
- (pMga->PciInfo->subsysCard == PCI_CARD_MILL_G200_SG) ) {
- OUTREG(MGAREG_Reset, 1);
- usleep(200);
- OUTREG(MGAREG_Reset, 0);
- }
- )
+ /* There is a problem in the HALlib: set soft reset bit */
+ if (!pMga->Primary && !pMga->FBDev &&
+ (pMga->PciInfo->subsysCard == PCI_CARD_MILL_G200_SG) ) {
+ OUTREG(MGAREG_Reset, 1);
+ usleep(200);
+ OUTREG(MGAREG_Reset, 0);
+ }
+ ); /* MGA_HAL */
#endif
/* Initialise the MMIO vgahw functions */
@@ -2944,10 +2968,8 @@ 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)
@@ -3035,10 +3057,8 @@ MGAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
ShadowFBInit(pScreen, refreshArea);
}
-#ifdef DPMSExtension
xf86DPMSInit(pScreen, MGADisplayPowerManagementSet, 0);
-#endif
-
+
pScrn->memPhysBase = pMga->FbAddress;
pScrn->fbOffset = pMga->YDstOrg * (pScrn->bitsPerPixel / 8);
@@ -3459,7 +3479,6 @@ MGASaveScreen(ScreenPtr pScreen, int mode)
*
* Sets VESA Display Power Management Signaling (DPMS) Mode.
*/
-#ifdef DPMSExtension
static void
MGADisplayPowerManagementSet(ScrnInfoPtr pScrn, int PowerManagementMode,
int flags)
@@ -3498,7 +3517,6 @@ MGADisplayPowerManagementSet(ScrnInfoPtr pScrn, int PowerManagementMode,
crtcext1 |= INREG8(0x1FDF) & ~0x30;
OUTREG8(0x1FDF, crtcext1);
}
-#endif
static void
@@ -3635,3 +3653,12 @@ dbg_outreg32(ScrnInfoPtr pScrn,int addr,int val)
*(volatile CARD32 *)(pMga->IOBase + (addr)) = (val);
}
#endif /* DEBUG */
+
+static void
+MGAG100BlackMagic(MGAPtr pMga)
+{
+ OUTREG(MGAREG_PLNWT, ~(CARD32)0x0);
+ /* reset memory */
+ OUTREG(MGAREG_MACCESS, 1<<15);
+ usleep(10);
+}
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_macros.h b/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_macros.h
index db0180527..63385747c 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_macros.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_macros.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_macros.h,v 1.18 2000/12/06 15:35:21 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_macros.h,v 1.19 2001/02/13 19:19:16 dawes Exp $ */
#ifndef _MGA_MACROS_H_
#define _MGA_MACROS_H_
@@ -107,4 +107,6 @@ while(INREG(MGAREG_DWGSYNC) != MGA_SYNC_XTAG) ; \
#define MGA_NOT_HAL(x) { x; }
#endif
+#define MGAISG450(x) ( ((x)->Chipset == PCI_CHIP_MGAG400) && ((x)->ChipRev >= 0x80) )
+
#endif /* _MGA_MACROS_H_ */
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_storm.c b/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_storm.c
index d9c83d9ba..7b1308a24 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_storm.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_storm.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_storm.c,v 1.81 2000/12/14 16:33:09 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_storm.c,v 1.84 2001/02/16 15:39:35 alanh Exp $ */
/* All drivers should typically include these */
@@ -37,6 +37,12 @@
#include "mga_dri.h"
#endif
+#define MGAMoveDWORDS(d,s,c) \
+do { \
+ write_mem_barrier(); \
+ XAAMoveDWORDS((d),(s),(c)); \
+} while (0)
+
static void MGANAME(SubsequentScreenToScreenCopy)(ScrnInfoPtr pScrn,
int srcX, int srcY, int dstX, int dstY,
int w, int h);
@@ -1119,8 +1125,11 @@ MGAStormEngineInit(ScrnInfoPtr pScrn)
pMga->MAccess = maccess;
pMga->PlaneMask = ~0;
/* looks like this doesn't apply to mga g100 pci */
- if (pMga->Chipset != PCI_CHIP_MGAG100)
- OUTREG(MGAREG_PLNWT, pMga->PlaneMask);
+
+ if ((pMga->Chipset != PCI_CHIP_MGAG100)
+ && (pMga->Chipset != PCI_CHIP_MGAG100_PCI))
+ OUTREG(MGAREG_PLNWT, pMga->PlaneMask);
+
pMga->FgColor = 0;
OUTREG(MGAREG_FCOL, pMga->FgColor);
pMga->BgColor = 0;
@@ -1689,7 +1698,12 @@ MGANAME(SubsequentScanlineCPUToScreenColorExpandFill)(
OUTREG(MGAREG_FXBNDRY, ((x + w - 1) << 16) | (x & 0xFFFF));
OUTREG(MGAREG_YDSTLEN + MGAREG_EXEC, (y << 16) | h);
- if(pMga->expandDWORDs > pMga->FifoSize) {
+#ifdef __alpha__
+ if(1)
+#else
+ if(pMga->expandDWORDs > pMga->FifoSize)
+#endif
+ {
pMga->AccelInfoRec->SubsequentColorExpandScanline =
MGANAME(SubsequentColorExpandScanlineIndirect);
pMga->AccelInfoRec->ScanlineColorExpandBuffers =
@@ -1714,13 +1728,13 @@ MGANAME(SubsequentColorExpandScanlineIndirect)(
while(dwords > pMga->FifoSize) {
WAITFIFO(pMga->FifoSize);
- XAAMoveDWORDS((CARD32*)(pMga->ColorExpandBase), src, pMga->FifoSize);
+ MGAMoveDWORDS((CARD32*)(pMga->ColorExpandBase), src, pMga->FifoSize);
src += pMga->FifoSize;
dwords -= pMga->FifoSize;
}
WAITFIFO(dwords);
- XAAMoveDWORDS((CARD32*)(pMga->ColorExpandBase), src, dwords);
+ MGAMoveDWORDS((CARD32*)(pMga->ColorExpandBase), src, dwords);
if(!(--pMga->expandRows)) {
if(pMga->expandRemaining) {
@@ -1816,13 +1830,13 @@ static void MGANAME(SubsequentImageWriteScanline)(
while(dwords > pMga->FifoSize) {
WAITFIFO(pMga->FifoSize);
- XAAMoveDWORDS((CARD32*)(pMga->ColorExpandBase), src, pMga->FifoSize);
+ MGAMoveDWORDS((CARD32*)(pMga->ColorExpandBase), src, pMga->FifoSize);
src += pMga->FifoSize;
dwords -= pMga->FifoSize;
}
WAITFIFO(dwords);
- XAAMoveDWORDS((CARD32*)(pMga->ColorExpandBase), src, dwords);
+ MGAMoveDWORDS((CARD32*)(pMga->ColorExpandBase), src, dwords);
if(!(--pMga->expandRows)) {
DISABLE_CLIP();
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 940e22148..391194b04 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.21 2000/12/05 20:03:45 mvojkovi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_video.c,v 1.22 2000/12/21 00:10:56 mvojkovi Exp $ */
#include "xf86.h"
#include "xf86_OSproc.h"
@@ -703,9 +703,9 @@ MGADisplayVideoOverlay(
OUTREG(MGAREG_BESA1ORG, offset);
if(y1 & 0x00010000)
- OUTREG(MGAREG_BESCTL, 0x00050c41);
+ OUTREG(MGAREG_BESCTL, 0x00040c41);
else
- OUTREG(MGAREG_BESCTL, 0x00050c01);
+ OUTREG(MGAREG_BESCTL, 0x00040c01);
OUTREG(MGAREG_BESHCOORD, (dstBox->x1 << 16) | (dstBox->x2 - 1));
OUTREG(MGAREG_BESVCOORD, (dstBox->y1 << 16) | (dstBox->y2 - 1));
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/neomagic/neomagic.cpp b/xc/programs/Xserver/hw/xfree86/drivers/neomagic/neomagic.cpp
deleted file mode 100644
index a3b1d5acc..000000000
--- a/xc/programs/Xserver/hw/xfree86/drivers/neomagic/neomagic.cpp
+++ /dev/null
@@ -1,90 +0,0 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/neomagic/neomagic.cpp,v 1.7 2000/12/14 08:11:15 herrb Exp $
-.\" shorthand for double quote that works everywhere.
-.ds q \N'34'
-.TH NEOMAGIC __drivermansuffix__ "Version 4.0.2" "XFree86"
-.SH NAME
-neomagic \- Neomagic video driver
-.SH SYNOPSIS
-.nf
-.B "Section \*qDevice\*q"
-.BI " Identifier \*q" devname \*q
-.B " Driver \*qneomagic\*q"
-\ \ ...
-.B EndSection
-.fi
-.SH DESCRIPTION
-.B neomagic
-is an XFree86 driver for the Neomagic graphics chipsets found in many
-laptop computers.
-.SH SUPPORTED HARDWARE
-.B neomagic
-supports the following chipsets:
-.PP
-.TP
-MagicGraph 128 (NM2070)
-.TP
-MagicGraph 128V (NM2090)
-.TP
-MagicGraph 128ZV (NM2093)
-.TP
-MagicGraph 128ZV+ (NM2097)
-.TP
-MagicGraph 128XD (NM2160)
-.TP
-MagicGraph 256AV (NM2200)
-.TP
-MagicGraph 256AV+ (NM2230)
-.TP
-MagicGraph 256ZX (NM2360)
-.TP
-MagicGraph 256XL+ (NM2380)
-.PP
-The driver supports depths 8, 15, 16 and 24 for all chipsets except the
-NM2070 which does not support depth 24. All depths are accelerated except for
-depth 24 which is only accelerated on NM2200
-and newer models. All visuals are supported in depth 8. TrueColor and
-DirectColor visuals are supported in the other depths.
-
-.SH CONFIGURATION DETAILS
-Please refer to XF86Config(__filemansuffix__) for general configuration
-details. This section only covers configuration details specific to this
-driver.
-.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 \*qPCIBurst\*q \*q" boolean \*q
-Disable or enable PCI burst modes. Default: enabled.
-.TP
-.BI "Option \*qRotate\*q \*qCW\*q"
-.TP
-.BI "Option \*qRotate\*q \*qCCW\*q"
-Rotate the display clockwise or counterclockwise. This mode is unaccelerated.
-Default: no rotation.
-.TP
-.BI "Option \*qShadowFB\*q \*q" boolean \*q
-Enable or disable use of the shadow framebuffer layer. See
-shadowfb(__drivermansuffix__) for further information. Default: off.
-.PP
-.B Note
-.br
-On some laptops using the 2160 chipset (MagicGraph 128XD) the
-following options are needed to avoid a lock-up of the graphic engine:
-.nf
- Option "XaaNoScanlineImageWriteRect"
- Option "XaaNoScanlineCPUToScreenColorExpandFill"
-.fi
-
-.SH "SEE ALSO"
-XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__)
-.SH AUTHORS
-Authors include: Jens Owen, Kevin E. Martin, and also Egbert Eich,
-Mark Vojkovich, Alan Hourihane.
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/newport/Imakefile b/xc/programs/Xserver/hw/xfree86/drivers/newport/Imakefile
index f29a52de1..f3fc19a4b 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/newport/Imakefile
+++ b/xc/programs/Xserver/hw/xfree86/drivers/newport/Imakefile
@@ -1,4 +1,4 @@
-XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/newport/Imakefile,v 1.2 2000/12/14 20:59:12 dawes Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/newport/Imakefile,v 1.3 2001/01/24 00:06:22 dawes Exp $
#define IHaveModules
#include <Server.tmpl>
@@ -34,7 +34,6 @@ InstallObjectModule(newport,$(MODULEDIR),drivers)
InstallNamedNonExec($(XF86CONFIG),$(XF86CONFIG),$(LIBDIR))
#if !defined(XF86DriverSDK)
-CppManTarget(newport,)
InstallModuleManPage(newport)
#endif
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/newport/newport.cpp b/xc/programs/Xserver/hw/xfree86/drivers/newport/newport.cpp
deleted file mode 100644
index 3eb1954bd..000000000
--- a/xc/programs/Xserver/hw/xfree86/drivers/newport/newport.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/newport/newport.cpp,v 1.1 2000/12/14 20:59:12 dawes Exp $
-.\" shorthand for double quote that works everywhere.
-.ds q \N'34'
-.TH NEWPORT __drivermansuffix__ "Version 4.0.2" "XFree86"
-.SH NAME
-newport \- Newport video driver
-.SH SYNOPSIS
-.nf
-.B "Section \*qDevice\*q"
-.BI " Identifier \*q" devname \*q
-.B " Driver \*qnewport\*q"
-\ \ ...
-.B EndSection
-.fi
-.SH DESCRIPTION
-.B newport
-is an XFree86 driver for the SGI Indy's newport video cards.
-.SH SUPPORTED HARDWARE
-The
-.B newport
-driver supports the Newport(sometimes called XL) cards found in SGI Indys. It
-does not support the XZ boards. The driver is currently limited to 8bit only.
-.SH CONFIGURATION DETAILS
-Please refer to XF86Config(__filemansuffix__) for general configuration
-details. This section only covers configuration details specific to this
-driver.
-.PP
-The driver auto-detects all device information necessary to initialize
-the card. However, if you have problems with auto-detection, you can
-specify:
-.br
-.TP
-.BI "Option \*qbitplanes\*q \*q" integer \*q
-number of bitplanes of the board (8 or 24)
-Default: auto-detected.
-.SH "SEE ALSO"
-XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__)
-.SH AUTHORS
-Authors:
-Guido Guenther \fIguido.guenther@gmx.net\fP
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/nv/nv.cpp b/xc/programs/Xserver/hw/xfree86/drivers/nv/nv.cpp
deleted file mode 100644
index 4f748aa57..000000000
--- a/xc/programs/Xserver/hw/xfree86/drivers/nv/nv.cpp
+++ /dev/null
@@ -1,61 +0,0 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv.cpp,v 1.3 1999/08/28 09:01:06 dawes Exp $
-.TH NV __drivermansuffix__ "Version 3.9.16" "XFree86"
-.SH NAME
-nv \-NVIDIA video driver
-.SH SYNOPSIS
-.B "Section ""Device"""
-.br
-.BI " Identifier """ devname """"
-.br
-.B " Driver ""nv"""
-.br
-\ \ ...
-.br
-.B EndSection
-.SH DESCRIPTION
-.B nv
-is an XFree86 driver for NVIDIA video cards. The driver is fully
-accelerated, and provides support for the following framebuffer depths:
-8, 15, 16 and 24. All
-visual types are supported for depth 8, and both TrueColor and DirectColor
-visuals are supported for the other depths. Multi-head configurations
-are supported.
-.SH SUPPORTED HARDWARE
-The
-.B nv
-driver supports PCI and AGP video cards based on the following NVIDIA chips:
-.TP 12
-.B RIVA 128
-NV3
-.TP 12
-.B RIVA TNT
-NV4
-.TP 12
-.B RIVA TNT2
-NV5
-.SH CONFIGURATION DETAILS
-Please refer to XF86Config(__filemansuffix__) for general configuration
-details. This section only covers configuration details specific to this
-driver.
-.PP
-The driver auto-detects the chipset type and the amount of video memory
-present for all chips.
-.PP
-The following driver
-.B Options
-are supported:
-.TP
-.BI "Option ""HWCursor"" """ boolean """
-Enable or disable the HW cursor. Default: on.
-.TP
-.BI "Option ""NoAccel"" """ boolean """
-Disable or enable acceleration. Default: acceleration is enabled.
-.TP
-.BI "Option ""UseFBDev"" """ boolean """
-Enable or disable use of on OS-specific fb interface (and is not supported
-on all OSs). See fbdevhw(__drivermansuffix__) for further information.
-Default: off.
-.SH "SEE ALSO"
-XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(1)
-.SH AUTHORS
-Authors include: David McKay, Jarno Paananen, Chas Inman, Dave Schmenk
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/nv/nv_shadow.c b/xc/programs/Xserver/hw/xfree86/drivers/nv/nv_shadow.c
index be3fa3d0e..5effc7955 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/nv/nv_shadow.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/nv/nv_shadow.c
@@ -2,19 +2,13 @@
Copyright (c) 1999, The XFree86 Project Inc.
Written by Mark Vojkovich <markv@valinux.com>
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_shadow.c,v 1.5 2000/03/13 18:49:29 mvojkovi Exp $ */
-
-#include "xf86.h"
-#include "xf86_OSproc.h"
-#include "xf86Resources.h"
-#include "xf86_ansic.h"
-#include "xf86PciInfo.h"
-#include "xf86Pci.h"
-#include "shadowfb.h"
-#include "servermd.h"
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_shadow.c,v 1.6 2001/01/22 21:32:36 dawes Exp $ */
+
#include "nv_local.h"
+#include "nv_include.h"
#include "nv_type.h"
-
+#include "shadowfb.h"
+#include "servermd.h"
void
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition.cpp b/xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition.cpp
deleted file mode 100644
index e60216399..000000000
--- a/xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition.cpp
+++ /dev/null
@@ -1,112 +0,0 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition.cpp,v 1.7 2000/12/12 18:54:31 dawes Exp $
-.\" shorthand for double quote that works everywhere.
-.ds q \N'34'
-.TH RENDITION __drivermansuffix__ "Version 4.0.2" "XFree86"
-.SH NAME
-rendition \- Rendition video driver
-.SH SYNOPSIS
-.nf
-.B "Section \*qDevice\*q"
-.BI " Identifier \*q" devname \*q
-.B " Driver \*qrendition\*q"
-\ \ ...
-.B EndSection
-.fi
-.SH DESCRIPTION
-.B rendition
-is an XFree86 driver for Rendition/Micron based video cards. The driver
-supports following framebuffer depths: 8, 15 (Verite V1000 only), 16
-and 24. Acceleration and multi-head configurations are
-not supported yet, but are work in progress.
-.SH SUPPORTED HARDWARE
-The
-.B rendition
-driver supports PCI and AGP video cards based on the following Rendition/Micron chips:
-.TP 12
-.B V1000
-Verite V1000 based cards.
-.TP 12
-.B V2100
-Verite V2100 based cards. Diamond Stealth II S220 is the only known such card.
-.TP 12
-.B V2200
-Verite V2200 based cards.
-.SH CONFIGURATION DETAILS
-Please refer to XF86Config(__filemansuffix__) for general configuration
-details. This section only covers configuration details specific to this
-driver.
-.PP
-The driver auto-detects the chipset type, but the following
-.B ChipSet
-names may optionally be specified in the config file
-.B \*qDevice\*q
-section, and will override the auto-detection:
-.PP
-.RS 4
-"v1000", "v2100", "v2200".
-.RE
-.PP
-The driver will auto-detect the amount of video memory present for all
-chips. If the amount of memory is detected incorrectly, the actual amount
-of video memory should be specified with a
-.B VideoRam
-entry in the config file
-.B \*qDevice\*q
-section.
-.PP
-The following driver
-.B Options
-are supported:
-.TP
-.BI "Option \*qSWCursor\*q \*q" boolean \*q
-Disables use of the hardware cursor. Default: use HW-cursor.
-.TP
-.BI "Option \*qOverclockMem\*q \*q" boolean \*q
-Increases the Mem/Sys clock to 125MHz/60MHz from standard 110MHz/50MHz.
-Default: Not overclocked.
-.TP
-.BI "Option \*qDacSpeed\*q \*q" MHz \*q
-Run the memory at a higher clock. Useful on some cards with display glitches
-at higher resolutions. But adds the risk to damage the hardware. Use with
-caution.
-.TP
-.BI "Option \*qFramebufferWC\*q \*q" boolean \*q
-If writecombine is disabled in BIOS, and you add this option in configuration
-file, then the driver will try to request writecombined access to the
-framebuffer. This can drastically increase the performance on unaccelerated
-server. Requires that "MTRR"-support is compiled into the OS-kernel.
-Default: Disabled for V1000, enabled for V2100/V2200.
-.TP
-.BI "Option \*qNoDDC\*q \*q" boolean \*q
-Disable probing of DDC-information from your monitor. This information is not
-used yet and is only there for informational purposes. This might change
-before final XFree86 4.0 release. Safe to disable if you experience problems
-during startup of X-server.
-Default: Probe DDC.
-.TP
-.BI "Option \*qShadowFB\*q \*q" boolean \*q
-If this option is enabled, the driver will cause the CPU to do each drawing
-operation first into a shadow frame buffer in system virtual memory and then
-copy the result into video memory. If this option is not active, the CPU will
-draw directly into video memory. Enabling this option is beneficial for those
-systems where reading from video memory is, on average, slower than the
-corresponding read/modify/write operation in system virtual memory. This is
-normally the case for PCI or AGP adapters, and, so, this option is enabled by
-default unless acceleration is enabled.
-Default: Enabled unless acceleration is used.
-.TP
-.BI "Option \*qRotate\*q \*qCW\*q"
-.TP
-.BI "Option \*qRotate\*q \*qCCW\*q"
-Rotate the display clockwise or counterclockwise. This mode is unaccelerated.
-Default: no rotation.
-.TP
-.SH "Notes"
-For the moment the driver defaults to not request write-combine for any chipset
-as there has been indications of problems with it. Use
-.B "Option \*qMTRR\*q"
-to let the driver request write-combining of memory access on the video board.
-.SH "SEE ALSO"
-XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__)
-.SH AUTHORS
-Authors include: Marc Langenbach, Dejan Ilic
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v_xv.c b/xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v_xv.c
index 87c0076e1..2353118fa 100755
--- a/xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v_xv.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v_xv.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v_xv.c,v 1.2 2000/11/28 20:59:18 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v_xv.c,v 1.3 2001/02/09 03:23:30 dawes Exp $ */
/*
Copyright (C) 2000 The XFree86 Project, Inc. All Rights Reserved.
@@ -106,9 +106,9 @@ void S3VInitVideo(ScreenPtr pScreen)
(pScrn->bitsPerPixel == 16)
)
&&
- ((ps3v->Chipset == S3_ViRGE_DXGX) ||
+ ((ps3v->Chipset == S3_ViRGE_DXGX) /* || */
/* S3_ViRGE_GX2_SERIES(ps3v->Chipset) || */
- (ps3v->Chipset == S3_ViRGE)
+ /* (ps3v->Chipset == S3_ViRGE) */
)
&& !ps3v->NoAccel
)
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3virge.cpp b/xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3virge.cpp
deleted file mode 100644
index 44ba44e9f..000000000
--- a/xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3virge.cpp
+++ /dev/null
@@ -1,186 +0,0 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3virge.cpp,v 1.4 1999/08/22 13:04:27 dawes Exp $
-.TH s3virge __drivermansuffix__ "Version 3.9.16" "XFree86"
-.SH NAME
-s3virge \- S3 ViRGE video driver
-.SH SYNOPSIS
-.B "Section ""Device"""
-.br
-.BI " Identifier """ devname """"
-.br
-.B " Driver ""s3virge"""
-.br
-\ \ ...
-.br
-\ \ [
-.B "Option"
-"optionname" ["optionvalue"]]
-.br
-.B EndSection
-.SH DESCRIPTION
-.B s3virge
-is an XFree86 driver for S3 based video cards. The driver is fully
-accelerated, and provides support for the following framebuffer depths:
-8, 15, 16, and 24. All
-visual types are supported for depth 8, and TrueColor
-visuals are supported for the other depths.
-.SH SUPPORTED HARDWARE
-The
-.B s3virge
-driver supports PCI video cards based on the following S3 chips:
-.TP 12
-.B ViRGE
-86C325
-.TP 12
-.B ViRGE VX
-86C988
-.TP 12
-.B ViRGE DX
-86C375
-.TP 12
-.B ViRGE GX
-86C385
-.TP 12
-.B ViRGE GX2
-86C357
-.TP 12
-.B ViRGE MX
-86C260
-.TP 12
-.B ViRGE MX+
-86C280
-.SH CONFIGURATION DETAILS
-Please refer to XF86Config(__filemansuffix__) for general configuration
-details. This section only covers configuration details specific to this
-driver.
-.PP
-The driver auto-detects the chipset type, but the following
-.B ChipSet
-names may optionally be specified in the config file
-.B """Device"""
-section, and will override the auto-detection:
-.PP
-.RS 4
-"virge", "86c325", "virge vx", "86c988", "virge dx", "86c375",
-"virge gx", "86c385", "virge gx2", "86c357", "virge mx", "86c260",
-"virge mx+", "86c280".
-.RE
-.PP
-The following Cursor
-.B Options
-are supported:
-.TP
-.BI "Option ""HWCursor"" """ boolean """
-Enable or disable the HW cursor. Default: on.
-.TP
-.BI "Option ""SWCursor"" """ boolean """
-Inverse of "HWCursor". Default: off.
-.PP
-The following video memory
-.B Options
-are supported:
-.TP
-.BI "Option ""slow_edodram"""
-Switch the standard ViRGE to 2-cycle edo mode. Try this
-if you encounter pixel corruption on the ViRGE. Using this option will
-cause a large decrease in performance. Default: off
-.TP
-.BI "Option ""fpm_vram"""
-Switch the ViRGE/VX to fast page mode vram mode. Default: off.
-.TP
-.BR "Option ""early_ras_precharge " | " late_ras_precharge"""
-adjust memory parameters. One
-of these will us the same settings as your video card defaults, and
-using neither in the config file does the same. Default: none.
-.TP
-.BI "Option ""set_mclk"" """ integer """
-sets the memory clock, where
-.I integer
-is in kHz, and
-.I integer
-<= 100000. Default: probe the memory clock value,
-and use it at server start.
-.PP
-The following acceleration and graphic engine
-.B Options
-are supported:
-.TP
-.B "Option ""NoAccel""
-Disable acceleration. Very useful for determining if the
-driver has problems with drawing and acceleration routines. This is the first
-option to try if your server runs but you see graphic corruption on the screen.
-Using it decreases performance, as it uses software emulation for drawing
-operations the video driver can accelerate with hardware.
-Default: acceleration is enabled.
-.TP
-.BR "Option ""fifo_aggressive " | " fifo_moderate " | " fifo_conservative"""
-alter the settings
-for the threshold at which the pixel FIFO takes over the internal
-memory bus to refill itself. The smaller this threshold, the better
-the acceleration performance of the card. You may try the fastest
-setting
-.RB ( "fifo_aggressive" )
-and move down if you encounter pixel corruption.
-The optimal setting will probably depend on dot-clock and on color
-depth. Note that specifying any of these options will also alter other
-memory settings which may increase performance, so trying
-.B "fifo_conservative"
-will in most cases be a slight benefit (this uses the chip defaults).
-If pixel corruption or transient streaking is observed during drawing
-operations then removing any fifo options is recommended. Default: none.
-
-.PP
-The following PCI bus
-.B Options
-are supported:
-.TP
-.BI "Option ""pci_burst"" """ boolean """
-will enable PCI burst mode. This should work on all but a
-few broken PCI chipsets, and will increase performance. Default: off.
-.TP
-.BI "Option ""pci_retry"" """ boolean """
-will allow the driver to rely on PCI Retry to program the
-ViRGE registers.
-.B "pci_burst"
-must be enabled for this to work.
-This will increase performance, especially for small fills/blits,
-because the driver does not have to poll the ViRGE before sending it
-commands to make sure it is ready. It should work on most
-recent PCI chipsets. Default: off.
-.PP
-The following ViRGE MX LCD
-.B Options
-are supported:
-.TP
-.BI "Option ""lcd_center""
-.TP
-.BI "Option ""set_lcdclk"" """ integer """
-allows setting the clock for a ViRGE MX LCD display.
-.I integer
-is in Hz. Default: use probed value.
-
-.PP
-The following additional
-.B Options
-are supported:
-.TP
-.BI "Option ""ShowCache"" """ boolean """
-Enable or disable viewing offscreen memory. Default: off.
-
-.SH SEE ALSO
-XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(1)
-
-.SH SUPPORT
-For assistance with this driver, or XFree86 in general, check the XFree86 web
-site at http://www.xfree86.org. A FAQ is available on the web site at
-http://www.xfree86.org/FAQ/. If you find a problem with XFree86 or have a
-question not answered in the FAQ please use our bug report form available on
-the web site or send mail to XFree86@XFree86.org. When reporting problems
-with the driver send as much detail as possible, including chipset type, a
-server output log, and operating system specifics.
-
-.SH AUTHORS
-Kevin Brosius,
-Matt Grossman,
-Harald Koenig,
-Sebastien Marineau,
-Mark Vojkovich.
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/savage/savage.cpp b/xc/programs/Xserver/hw/xfree86/drivers/savage/savage.cpp
deleted file mode 100644
index d35f7f8ad..000000000
--- a/xc/programs/Xserver/hw/xfree86/drivers/savage/savage.cpp
+++ /dev/null
@@ -1,96 +0,0 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage.cpp,v 1.2 2000/12/11 20:18:25 dawes Exp $
-.\" shorthand for double quote that works everywhere.
-.ds q \N'34'
-.TH SAVAGE __drivermansuffix__ "Version 4.0.2" "XFree86"
-.SH NAME
-savage \- S3 Savage video driver
-.SH SYNOPSIS
-.nf
-.B "Section \*qDevice\*q"
-.BI " Identifier \*q" devname \*q
-.B " Driver \*qsavage\*q"
-\ \ ...
-.B EndSection
-.fi
-.SH DESCRIPTION
-.B savage
-is an XFree86 driver for the S3 Savage family video accelerator chips. The
-.B savage
-driver supports PCI and AGP boards with the following chips:
-.TP 16
-.BI Savage3D
-(8a20 and 8a21)
-.TP 16
-.B Savage4
-(8a22)
-.TP 16
-.B Savage2000
-(9102)
-.TP 16
-.B Savage/MX
-(8c10 and 8c11)
-.TP 16
-.B Savage/IX
-(8c12 and 8c13)
-.TP 16
-.B ProSavage PM133
-(8a25)
-.TP 16
-.B ProSavage KM133
-(8a26)
-.SH CONFIGURATION DETAILS
-Please refer to XF86Config(__filemansuffix__) for general configuration
-details. This section only covers configuration details specific to this
-driver.
-.PP
-The following driver
-.B Options
-are supported:
-.TP
-.BI "Option \*qHWCursor\*q \*q" boolean \*q
-.TP
-.BI "Option \*qSWCursor\*q \*q" boolean \*q
-These two options interact to specify hardware or software cursor. If the
-SWCursor option is specified, any HWCursor setting is ignored. Thus, either
-\*qHWCursor off\*q or \*qSWCursor on\*q will force the use of the software
-cursor. On Savage/MX and Savage/IX chips which are connected to LCDs, a
-software cursor will be forced, because the Savage hardware cursor does not
-correctly track the automatic panel expansion feature.
-Default: hardware cursor.
-.TP
-.BI "Option \*qNoAccel\*q \*q" boolean \*q
-Disable or enable acceleration. Default: acceleration is enabled.
-.TP
-.BI "Option \*qRotate\*q \*qCW\*q"
-.TP
-.BI "Option \*qRotate\*q \*qCCW\*q"
-Rotate the desktop 90 degrees clockwise or counterclockwise. This option
-forces the ShadowFB option on, and disables acceleration.
-Default: no rotation.
-.TP
-.BI "Option \*qShadowFB\*q \*q" boolean \*q
-Enable or disable use of the shadow framebuffer layer. See
-shadowfb(__drivermansuffix__) for further information. This option
-disables acceleration. Default: off.
-.TP
-.BI "Option \*qUseBIOS\*q \*q" boolean \*q
-Enable or disable use of the video BIOS to change modes. Ordinarily, the
-.B savage
-driver tries to use the video BIOS to do mode switches. This generally
-produces the best results with the mobile chips (/MX and /IX), since the BIOS
-knows how to handle the critical but unusual timing requirements of the
-various LCD panels supported by the chip. To do this, the driver searches
-through the BIOS mode list, looking for the mode which most closely matches
-the XF86Config mode line. Some purists find this scheme objectionable. If
-you would rather have the
-.B savage
-driver use your mode line timing exactly, turn off the UseBios option.
-Default: on (use the BIOS).
-.SH FILES
-savage_drv.o
-.SH "SEE ALSO"
-XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__)
-.SH AUTHORS
-Authors include Tim Roberts (timr@probo.com) and Ani Joshi (ajoshi@unixbox.com)
-for the 4.0 version, and Tim Roberts and S. Marineau for the 3.3 driver from
-which this was derived.
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_accel.c b/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_accel.c
index 2dfaf1432..b31a08d26 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_accel.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_accel.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_accel.c,v 1.4 2000/12/07 20:26:22 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_accel.c,v 1.5 2001/02/13 21:15:19 dawes Exp $ */
/*
*
@@ -15,14 +15,10 @@
*
*/
+#include <math.h>
#include "Xarch.h"
-#include "xf86.h"
-#include "xf86_ansic.h"
-#include "xf86_OSproc.h"
-#include "compiler.h"
#include "xaalocal.h"
#include "xaarop.h"
-#include "xf86PciInfo.h"
#include "miline.h"
#include "savage_driver.h"
@@ -30,16 +26,10 @@
#include "savage_bci.h"
-/* Globals used in driver */
-extern pointer s3savMmioMem;
-#ifdef __alpha__
-extern pointer s3savMmioMemSparse;
-#endif
+static unsigned int dwBCIWait2DIdle;
/* Forward declaration of functions used in the driver */
-static void SavageAccelSync( ScrnInfoPtr );
-
static void SavageSetupForScreenToScreenCopy(
ScrnInfoPtr pScrn,
int xdir,
@@ -220,7 +210,7 @@ void SavageSetGBD( ScrnInfoPtr );
* call from the debugger.
*/
-static ScrnInfoPtr gpScrn = 0;
+ScrnInfoPtr gpScrn = 0;
@@ -265,7 +255,7 @@ SavageInitialize2DEngine(ScrnInfoPtr pScrn)
OUTREG(0x48C18, INREG(0x48C18) & 0x3FF0);
/* Disable shadow status update */
OUTREG(0x48C0C, 0);
- /* Enabel BCI without the COB */
+ /* Enable BCI without the COB */
OUTREG(0x48C18, INREG(0x48C18) | 0x08);
break;
@@ -294,6 +284,14 @@ SavageInitialize2DEngine(ScrnInfoPtr pScrn)
BCI_BD_SET_STRIDE(psav->SavedGbd, pScrn->displayWidth);
SavageSetGBD(pScrn);
+
+ if( psav->StatusHack )
+ {
+ if( psav->Chipset == S3_SAVAGE2000 )
+ dwBCIWait2DIdle = 0xc0040000;
+ else
+ dwBCIWait2DIdle = 0xc0020000;
+ }
}
@@ -335,8 +333,8 @@ SavageSetGBD( ScrnInfoPtr pScrn )
OUTREG(0x8178,0);
OUTREG(0x817C,psav->SavedGbd);
- OUTREG(0x81C8, pScrn->displayWidth << 4);
- OUTREG(0x81D8, pScrn->displayWidth << 4);
+ OUTREG(PRI_STREAM_STRIDE, pScrn->displayWidth * pScrn->bitsPerPixel >> 3);
+ OUTREG(SEC_STREAM_STRIDE, pScrn->displayWidth * pScrn->bitsPerPixel >> 3);
}
@@ -352,18 +350,18 @@ SavageInitAccel(ScreenPtr pScreen)
/* Set-up our GE command primitive */
- if (pScrn->bitsPerPixel == 8) {
- psav->PlaneMask = 0xFF;
- }
- else if (pScrn->bitsPerPixel == 16) {
- psav->PlaneMask = 0xFFFF;
- }
- else if (pScrn->bitsPerPixel == 24) {
- psav->PlaneMask = 0xFFFFFF;
- }
- else if (pScrn->bitsPerPixel == 32) {
- psav->PlaneMask = 0xFFFFFFFF;
- }
+ if (pScrn->depth == 8) {
+ psav->PlaneMask = 0xFF;
+ }
+ else if (pScrn->depth == 15) {
+ psav->PlaneMask = 0x7FFF;
+ }
+ else if (pScrn->depth == 16) {
+ psav->PlaneMask = 0xFFFF;
+ }
+ else if (pScrn->depth == 24) {
+ psav->PlaneMask = 0xFFFFFF;
+ }
/* General acceleration flags */
@@ -504,7 +502,7 @@ SavageInitAccel(ScreenPtr pScreen)
psav->Bpp = pScrn->bitsPerPixel / 8;
psav->Bpl = pScrn->displayWidth * psav->Bpp;
- psav->ScissB = psav->CursorKByte / psav->Bpl;
+ psav->ScissB = (psav->CursorKByte << 10) / psav->Bpl;
if (psav->ScissB > 2047)
psav->ScissB = 2047;
@@ -520,6 +518,9 @@ SavageInitAccel(ScreenPtr pScreen)
AvailFBArea.x2 = pScrn->displayWidth;
AvailFBArea.y2 = psav->ScissB;
xf86InitFBManager(pScreen, &AvailFBArea);
+ xf86DrvMsg( pScrn->scrnIndex, X_INFO,
+ "Using %d lines for offscreen memory.\n",
+ psav->ScissB - pScrn->virtualY );
return XAAInit(pScreen, xaaptr);
}
@@ -532,9 +533,44 @@ void
SavageAccelSync(ScrnInfoPtr pScrn)
{
SavagePtr psav = SAVPTR(pScrn);
- WaitIdleEmpty();
+
+ if( psav->StatusHack )
+ {
+ static int counter = 0;
+ int i;
+
+ /*
+ * This is an attempt to work around the status register read hang
+ * that affects about 4% of all Savage chips. Instead of reading
+ * the register through MMIO, we send a BCI command to wait for
+ * engine idle (which does not hang), then another BCI command to
+ * set an incrementing value into an innocuous register (the
+ * Cr Base register used in YUV page flipping). Then we loop
+ * waiting for the MMIO value of that register to change.
+ */
+
+ BCI_GET_PTR;
+ BCI_SEND(dwBCIWait2DIdle); /* wait for 2D idle */
+ BCI_SEND(0x96010045); /* update New Cr Base Address ... */
+ counter++;
+ BCI_SEND(counter); /* ... to this value */
+ for(
+ i = 0;
+ (INREG(0x48914) != counter) && (i < 100000);
+ i++
+ )
+ ;
+ }
+ else
+ {
+ if( psav->StatusDelay )
+ usleep( psav->StatusDelay );
+ WaitIdleEmpty();
+ }
}
+#undef WaitQueue
+#define WaitQueue(x) SavageAccelSync(pScrn)
/*
* The XAA ROP helper routines all assume that a solid color is a
@@ -731,6 +767,9 @@ SavageSubsequentSolidFillRect(
{
SavagePtr psav = SAVPTR(pScrn);
BCI_GET_PTR;
+
+ if( !w || !h )
+ return;
WaitQueue(5);
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_driver.c
index 4227e11c7..ba7cf5adc 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_driver.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_driver.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_driver.c,v 1.6 2000/12/12 16:50:48 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_driver.c,v 1.11 2001/02/15 20:00:19 eich Exp $ */
/*
* vim: sw=4 ts=8 ai ic:
*
@@ -15,11 +15,13 @@
#include "xf86RAC.h"
#include "shadowfb.h"
-#ifdef DPMSExtension
#include "globals.h"
#define DPMS_SERVER
#include "extensions/dpms.h"
-#endif /* DPMSExtension */
+
+#ifdef XvExtension
+#include "xf86xv.h"
+#endif
#include "savage_driver.h"
#include "savage_bci.h"
@@ -41,7 +43,7 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags);
static Bool SavageEnterVT(int scrnIndex, int flags);
static void SavageLeaveVT(int scrnIndex, int flags);
static void SavageSave(ScrnInfoPtr pScrn);
-static void SavageWriteMode(ScrnInfoPtr pScrn, vgaRegPtr, SavageRegPtr);
+static void SavageWriteMode(ScrnInfoPtr pScrn, vgaRegPtr, SavageRegPtr, Bool);
static Bool SavageScreenInit(int scrnIndex, ScreenPtr pScreen, int argc,
char **argv);
@@ -49,9 +51,10 @@ static int SavageInternalScreenInit(int scrnIndex, ScreenPtr pScreen);
static ModeStatus SavageValidMode(int index, DisplayModePtr mode,
Bool verbose, int flags);
+void SavageDGAInit(ScreenPtr);
static Bool SavageMapMMIO(ScrnInfoPtr pScrn);
static Bool SavageMapFB(ScrnInfoPtr pScrn);
-static void SavageUnmapMem(ScrnInfoPtr pScrn);
+static void SavageUnmapMem(ScrnInfoPtr pScrn, int All);
static Bool SavageModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode);
static Bool SavageCloseScreen(int scrnIndex, ScreenPtr pScreen);
static Bool SavageSaveScreen(ScreenPtr pScreen, int mode);
@@ -64,24 +67,32 @@ static void SavageCalcClock(long freq, int min_m, int min_n1, int max_n1,
unsigned int *ndiv, unsigned int *r);
void SavageGEReset(ScrnInfoPtr pScrn, int from_timeout, int line, char *file);
void SavagePrintRegs(ScrnInfoPtr pScrn);
-#ifdef DPMSExtension
static void SavageDPMS(ScrnInfoPtr pScrn, int mode, int flags);
-#endif
+static Bool SavageDDC1(int scrnIndex);
+static unsigned int SavageDDC1Read(ScrnInfoPtr pScrn);
+static void SavageProbeDDC(ScrnInfoPtr pScrn, int index);
-static int pix24bpp = 0;
+extern ScrnInfoPtr gpScrn;
#define iabs(a) ((int)(a)>0?(a):(-(a)))
#define DRIVER_NAME "savage"
-#define DRIVER_VERSION "1.1.0"
+#define DRIVER_VERSION "1.1.12"
#define VERSION_MAJOR 1
#define VERSION_MINOR 1
-#define PATCHLEVEL 0
+#define PATCHLEVEL 12
#define SAVAGE_VERSION ((VERSION_MAJOR << 24) | \
(VERSION_MINOR << 16) | \
PATCHLEVEL)
+/* #define TRACEON */
+#ifdef TRACEON
+#define TRACE(prms) ErrorF prms
+#else
+#define TRACE(prms)
+#endif
+
DriverRec SAVAGE =
{
SAVAGE_VERSION,
@@ -107,6 +118,9 @@ static SymTabRec SavageChips[] = {
{ PCI_CHIP_SAVAGE_IX, "Savage/IX" },
{ PCI_CHIP_PROSAVAGE_PM, "ProSavage PM133" },
{ PCI_CHIP_PROSAVAGE_KM, "ProSavage KM133" },
+ /* Twister is a code name; hope I get the real name soon. */
+ { PCI_CHIP_TWISTER_P, "TwisterP" },
+ { PCI_CHIP_TWISTER_K, "TwisterK" },
{ -1, NULL }
};
@@ -132,22 +146,18 @@ static PciChipsets SavagePciChipsets[] = {
{ S3_SAVAGE_MX, PCI_CHIP_SAVAGE_IX, RES_SHARED_VGA },
{ S3_PROSAVAGE, PCI_CHIP_PROSAVAGE_PM, RES_SHARED_VGA },
{ S3_PROSAVAGE, PCI_CHIP_PROSAVAGE_KM, RES_SHARED_VGA },
+ { S3_PROSAVAGE, PCI_CHIP_TWISTER_P, RES_SHARED_VGA },
+ { S3_PROSAVAGE, PCI_CHIP_TWISTER_K, RES_SHARED_VGA },
{ -1, -1, RES_UNDEFINED }
};
typedef enum {
- OPTION_SLOW_EDODRAM,
- OPTION_SLOW_DRAM,
- OPTION_FAST_DRAM,
- OPTION_FPM_VRAM,
OPTION_PCI_BURST,
OPTION_FIFO_CONSERV,
OPTION_FIFO_MODERATE,
OPTION_FIFO_AGGRESSIVE,
OPTION_PCI_RETRY,
OPTION_NOACCEL,
- OPTION_EARLY_RAS_PRECHARGE,
- OPTION_LATE_RAS_PRECHARGE,
OPTION_LCD_CENTER,
OPTION_LCDCLOCK,
OPTION_MCLK,
@@ -157,23 +167,23 @@ typedef enum {
OPTION_HWCURSOR,
OPTION_SHADOW_FB,
OPTION_ROTATE,
- OPTION_USEBIOS
+ OPTION_USEBIOS,
+ OPTION_STATUS_DELAY,
+ OPTION_STATUS_HACK
} SavageOpts;
static OptionInfoRec SavageOptions[] =
{
- { OPTION_SLOW_EDODRAM, "slow_edodram", OPTV_BOOLEAN, {0}, FALSE },
- { OPTION_SLOW_DRAM, "slow_dram", OPTV_BOOLEAN, {0}, FALSE },
- { OPTION_FAST_DRAM, "fast_dram", OPTV_BOOLEAN, {0}, FALSE },
- { OPTION_FPM_VRAM, "fpm_vram", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_HWCURSOR, "HWCursor", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_SWCURSOR, "SWCursor", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_SHADOW_FB, "ShadowFB", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_ROTATE, "Rotate", OPTV_ANYSTR, {0}, FALSE },
{ OPTION_USEBIOS, "UseBIOS", OPTV_BOOLEAN, {0}, FALSE },
- /* finish later... */
+ { OPTION_LCDCLOCK, "LCDClock", OPTV_FREQ, {0}, FALSE },
+ { OPTION_STATUS_DELAY, "StatusDelay", OPTV_INTEGER, {0}, FALSE },
+ { OPTION_STATUS_HACK, "StatusHack", OPTV_BOOLEAN, {0}, FALSE },
{ -1, NULL, OPTV_NONE, {0}, FALSE }
};
@@ -208,6 +218,7 @@ static const char *vbeSymbols[] = {
"VBEInit",
"vbeDoEDID",
"vbeFree",
+ "VBESetVBEMode",
NULL
};
@@ -216,6 +227,12 @@ static const char *ddcSymbols[] = {
NULL
};
+static const char *i2cSymbols[] = {
+ "xf86CreateI2CBusRec",
+ "xf86I2CBusInit",
+ NULL
+};
+
static const char *xaaSymbols[] = {
"XAACopyROP",
"XAACopyROP_PM",
@@ -224,6 +241,7 @@ static const char *xaaSymbols[] = {
"XAAHelpPatternROP",
"XAAHelpSolidROP",
"XAAInit",
+ "XAAFillSolidRects",
"XAAScreenIndex",
NULL
};
@@ -242,14 +260,9 @@ static const char *int10Symbols[] = {
NULL
};
-static const char *cfbSymbols[] = {
- "cfbScreenInit",
- "cfb16ScreenInit",
- "cfb24ScreenInit",
- "cfb24_32ScreenInit",
- "cfb32ScreenInit",
- "cfb16BresS",
- "cfb24BresS",
+static const char *fbSymbols[] = {
+ "fbScreenInit",
+ "fbPictureInit",
NULL
};
@@ -280,9 +293,9 @@ static pointer SavageSetup(pointer module, pointer opts, int *errmaj,
if (!setupDone) {
setupDone = TRUE;
xf86AddDriver(&SAVAGE, module, 0);
- LoaderRefSymLists(vgaHWSymbols, cfbSymbols, ramdacSymbols,
+ LoaderRefSymLists(vgaHWSymbols, fbSymbols, ramdacSymbols,
xaaSymbols, shadowSymbols, vbeSymbols,
- ddcSymbols, NULL);
+ int10Symbols, i2cSymbols, ddcSymbols, NULL);
return (pointer) 1;
} else {
if (errmaj)
@@ -395,8 +408,6 @@ WaitIdleEmpty2K(SavagePtr psav)
{
int loop = 0;
mem_barrier();
- /* CAUTION! How do we insure this read isn't optimized away? */
- /* Is the "volatile" enough to do that? */
loop &= ALT_STATUS_WORD0;
while( ((ALT_STATUS_WORD0 & 0x009fffff) != 0) && (loop++ < MAXLOOP) )
;
@@ -482,11 +493,12 @@ static Bool SavageGetRec(ScrnInfoPtr pScrn)
static void SavageFreeRec(ScrnInfoPtr pScrn)
{
+ TRACE(( "SavageFreeRec(%x)\n", pScrn->driverPrivate ));
if (!pScrn->driverPrivate)
return;
xfree(pScrn->driverPrivate);
pScrn->driverPrivate = NULL;
- SavageUnmapMem(pScrn);
+ SavageUnmapMem(pScrn, 1);
}
@@ -499,7 +511,7 @@ static OptionInfoPtr SavageAvailableOptions(int chipid, int busid)
static void SavageIdentify(int flags)
{
xf86PrintChipsets("SAVAGE",
- "driver (version " DRIVER_VERSION " for S3 Savage chipsets",
+ "driver (version " DRIVER_VERSION ") for S3 Savage chipsets",
SavageChips);
}
@@ -507,7 +519,7 @@ static void SavageIdentify(int flags)
static Bool SavageProbe(DriverPtr drv, int flags)
{
int i;
- GDevPtr *devSections;
+ GDevPtr *devSections = NULL;
int *usedChips;
int numDevSections;
int numUsed;
@@ -523,7 +535,9 @@ static Bool SavageProbe(DriverPtr drv, int flags)
SavageChipsets, SavagePciChipsets,
devSections, numDevSections, drv,
&usedChips);
- xfree(devSections);
+ if (devSections)
+ xfree(devSections);
+ devSections = NULL;
if (numUsed <= 0)
return FALSE;
@@ -574,23 +588,28 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
MessageType from = X_DEFAULT;
int i;
ClockRangePtr clockRanges;
- char *mod = NULL;
char *s = NULL;
- const char *reqSym = NULL;
unsigned char config1, m, n, n1, n2, sr8, cr66 = 0, tmp;
int mclk;
vgaHWPtr hwp;
int vgaCRIndex, vgaCRReg, vgaIOBase;
+ pointer ddc;
- if (flags & PROBE_DETECT)
- return FALSE;
+ TRACE(("SavagePreInit(%d)\n", flags));
+
+ gpScrn = pScrn;
+
+ if (flags & PROBE_DETECT) {
+ SavageProbeDDC( pScrn, xf86GetEntityInfo(pScrn->entityList[0])->index );
+ return TRUE;
+ }
if (!xf86LoadSubModule(pScrn, "vgahw"))
- return FALSE;
+ return FALSE;
xf86LoaderReqSymLists(vgaHWSymbols, NULL);
if (!vgaHWGetHWRec(pScrn))
- return FALSE;
+ return FALSE;
#if 0
/* Here we can alter the number of registers saved and restored by the
@@ -609,24 +628,36 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
if (!xf86SetDepthBpp(pScrn, 8, 8, 8, Support32bppFb))
return FALSE;
else {
+ int requiredBpp;
+
switch (pScrn->depth) {
case 8:
- case 15:
case 16:
+ requiredBpp = pScrn->depth;
+ break;
+ case 15:
+ requiredBpp = 16;
+ break;
case 24:
- /* OK */
+ requiredBpp = 32;
break;
+
default:
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Given depth (%d) is not supported by this driver\n",
pScrn->depth);
return FALSE;
}
+
+ if( pScrn->bitsPerPixel != requiredBpp ) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "Depth %d must specify %d bpp; %d was given\n",
+ pScrn->depth, requiredBpp, pScrn->bitsPerPixel );
+ return FALSE;
+ }
}
- xf86PrintDepthBpp(pScrn);
- if (pScrn->depth == 24 && pix24bpp == 0)
- pix24bpp = xf86GetBppFromDepth(pScrn, 24);
+ xf86PrintDepthBpp(pScrn);
if (pScrn->depth > 8) {
rgb zeros = {0, 0, 0};
@@ -664,11 +695,13 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, SavageOptions);
- if (xf86ReturnOptValBool(SavageOptions, OPTION_PCI_BURST, FALSE)) {
- psav->pci_burst = TRUE;
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: pci_burst - PCI burst read enabled\n");
- } else
- psav->pci_burst = FALSE;
+ xf86GetOptValBool(SavageOptions, OPTION_PCI_BURST, &psav->pci_burst);
+
+ if (psav->pci_burst) {
+ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
+ "Option: pci_burst - PCI burst read enabled\n");
+ }
+
psav->NoPCIRetry = 1; /* default */
if (xf86ReturnOptValBool(SavageOptions, OPTION_PCI_RETRY, FALSE)) {
if (xf86ReturnOptValBool(SavageOptions, OPTION_PCI_BURST, FALSE)) {
@@ -677,48 +710,26 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
} else
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "\"pci_retry\" option requires \"pci_burst\"\n");
}
- if (xf86IsOptionSet(SavageOptions, OPTION_FIFO_CONSERV)) {
- psav->fifo_conservative = TRUE;
+
+ xf86GetOptValBool( SavageOptions, OPTION_FIFO_CONSERV, &psav->fifo_conservative );
+ if (psav->fifo_conservative) {
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: fifo conservative set\n");
- } else
- psav->fifo_conservative = FALSE;
- if (xf86IsOptionSet(SavageOptions, OPTION_FIFO_MODERATE)) {
- psav->fifo_moderate = TRUE;
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: fifo_moderate set\n");
- } else
- psav->fifo_moderate = FALSE;
- if (xf86IsOptionSet(SavageOptions, OPTION_FIFO_AGGRESSIVE)) {
- psav->fifo_aggressive = TRUE;
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: fifo_aggressive set\n");
- } else
- psav->fifo_aggressive = FALSE;
- if (xf86IsOptionSet(SavageOptions, OPTION_SLOW_EDODRAM)) {
- psav->slow_edodram = TRUE;
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: slow_edodram_set\n");
- } else
- psav->slow_edodram = FALSE;
- if (xf86IsOptionSet(SavageOptions, OPTION_SLOW_DRAM)) {
- psav->slow_dram = TRUE;
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: slow_dram set\n");
- } else
- psav->slow_dram = FALSE;
- if (xf86IsOptionSet(SavageOptions, OPTION_FAST_DRAM)) {
- psav->fast_dram = TRUE;
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: fast_dram set\n");
- } else
- psav->fast_dram = FALSE;
- if (xf86IsOptionSet(SavageOptions, OPTION_FPM_VRAM)) {
- psav->fpm_vram = TRUE;
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: fpm_vram set\n");
- } else
- psav->fpm_vram = FALSE;
+ }
- if (xf86IsOptionSet(SavageOptions, OPTION_SHADOW_FB)) {
- psav->shadowFB = TRUE;
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: ShadowFB %s.\n",
- psav->shadowFB ? "enabled" : "disabled");
- } else
- psav->shadowFB = FALSE;
+ xf86GetOptValBool( SavageOptions, OPTION_FIFO_CONSERV, &psav->fifo_moderate );
+ if (psav->fifo_moderate) {
+ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: fifo moderate set\n");
+ }
+
+ xf86GetOptValBool( SavageOptions, OPTION_FIFO_CONSERV, &psav->fifo_aggressive );
+ if (psav->fifo_aggressive) {
+ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: fifo aggressive set\n");
+ }
+
+ xf86GetOptValBool( SavageOptions, OPTION_SHADOW_FB, &psav->shadowFB );
+ if (psav->shadowFB) {
+ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: shadow FB enabled\n");
+ }
if ((s = xf86GetOptValString(SavageOptions, OPTION_ROTATE))) {
if(!xf86NameCmp(s, "CW")) {
@@ -740,11 +751,9 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
}
}
- if (xf86ReturnOptValBool(SavageOptions, OPTION_NOACCEL, FALSE)) {
- psav->NoAccel = TRUE;
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: NoAccel - Acceleration Disabled\n");
- } else
- psav->NoAccel = FALSE;
+ if (xf86GetOptValBool(SavageOptions, OPTION_NOACCEL, &psav->NoAccel))
+ xf86DrvMsg( pScrn->scrnIndex, X_CONFIG,
+ "Option: NoAccel - Acceleration Disabled\n");
if (psav->shadowFB && !psav->NoAccel) {
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
@@ -752,19 +761,14 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
psav->NoAccel = TRUE;
}
- if (xf86ReturnOptValBool(SavageOptions, OPTION_EARLY_RAS_PRECHARGE, FALSE)) {
- psav->early_ras_precharge = TRUE;
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: early_ras_precharge set\n");
- } else
- psav->early_ras_precharge = FALSE;
-
/*
* The SWCursor setting takes priority over HWCursor. The default
- * if neither is specified is HW.
+ * if neither is specified is HW, unless ShadowFB is specified,
+ * then SW.
*/
from = X_DEFAULT;
- psav->hwcursor = TRUE;
+ psav->hwcursor = psav->shadowFB ? FALSE : TRUE;
if (xf86GetOptValBool(SavageOptions, OPTION_HWCURSOR, &psav->hwcursor))
from = X_CONFIG;
if (xf86ReturnOptValBool(SavageOptions, OPTION_SWCURSOR, FALSE)) {
@@ -776,20 +780,27 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
from = X_DEFAULT;
psav->UseBIOS = TRUE;
- if (xf86IsOptionSet(SavageOptions, OPTION_USEBIOS) )
- {
+ if (xf86GetOptValBool(SavageOptions, OPTION_USEBIOS, &psav->UseBIOS) )
from = X_CONFIG;
- xf86GetOptValBool(SavageOptions, OPTION_USEBIOS, &psav->UseBIOS);
- }
xf86DrvMsg(pScrn->scrnIndex, from, "%ssing video BIOS to set modes\n",
psav->UseBIOS ? "U" : "Not u" );
+ psav->LCDClock = 0.0;
+ if( xf86GetOptValFreq( SavageOptions, OPTION_LCDCLOCK, OPTUNITS_MHZ, &psav->LCDClock ) )
+ xf86DrvMsg( pScrn->scrnIndex, X_CONFIG,
+ "Option: LCDClock %1.2f MHz\n", psav->LCDClock );
- /* DO OTHERS HERE LATER!!!!!!!!!!!!!! */
+ psav->StatusDelay = 0;
+ if( xf86GetOptValInteger( SavageOptions, OPTION_STATUS_DELAY, &psav->StatusDelay ) )
+ xf86DrvMsg( pScrn->scrnIndex, X_CONFIG,
+ "Option: StatusDelay %d microseconds\n", psav->StatusDelay );
- from = X_DEFAULT;
+ if( xf86GetOptValBool( SavageOptions, OPTION_STATUS_HACK, &psav->StatusHack))
+ xf86DrvMsg( pScrn->scrnIndex, X_CONFIG,
+ "Option: StatusHack enabled\n" );
+ /* Add more options here. */
if (pScrn->numEntities > 1) {
SavageFreeRec(pScrn);
@@ -804,23 +815,23 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
}
psav->EntityIndex = pEnt->index;
- if (psav->UseBIOS) {
- if (xf86LoadSubModule(pScrn, "int10")) {
- xf86LoaderReqSymLists(int10Symbols, NULL);
- psav->pInt10 = xf86InitInt10(pEnt->index);
- }
+ if (xf86LoadSubModule(pScrn, "int10")) {
+ xf86LoaderReqSymLists(int10Symbols, NULL);
+ psav->pInt10 = xf86InitInt10(pEnt->index);
+ }
- if (xf86LoadSubModule(pScrn, "vbe")) {
- xf86LoaderReqSymLists(vbeSymbols, NULL);
- psav->pVbe = VBEInit(psav->pInt10, pEnt->index);
- }
+ if (xf86LoadSubModule(pScrn, "vbe")) {
+ xf86LoaderReqSymLists(vbeSymbols, NULL);
+ psav->pVbe = VBEInit(psav->pInt10, pEnt->index);
}
+
psav->PciInfo = xf86GetPciInfoForEntity(pEnt->index);
xf86RegisterResources(pEnt->index, NULL, ResNone);
xf86SetOperatingState(RES_SHARED_VGA, pEnt->index, ResUnusedOpr);
xf86SetOperatingState(resVgaMemShared, pEnt->index, ResDisableOpr);
+ from = X_DEFAULT;
if (pEnt->device->chipset && *pEnt->device->chipset) {
pScrn->chipset = pEnt->device->chipset;
psav->ChipId = pEnt->device->chipID;
@@ -842,6 +853,9 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
psav->Chipset);
}
+ xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Chip: id %04x, \"%s\"\n",
+ psav->ChipId, xf86TokenToString( SavageChips, psav->ChipId ) );
+
if (pEnt->device->chipRev >= 0) {
psav->ChipRev = pEnt->device->chipRev;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ChipRev override: %d\n",
@@ -853,7 +867,7 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
/* maybe throw in some more sanity checks here */
- xf86DrvMsg(pScrn->scrnIndex, from, "Chipset: \"%s\"\n", pScrn->chipset);
+ xf86DrvMsg(pScrn->scrnIndex, from, "Engine: \"%s\"\n", pScrn->chipset);
psav->PciTag = pciTag(psav->PciInfo->bus, psav->PciInfo->device,
psav->PciInfo->func);
@@ -876,7 +890,7 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
/* unlock extended regs */
VGAOUT16(vgaCRIndex, 0x4838);
- VGAOUT16(vgaCRIndex, 0xa539);
+ VGAOUT16(vgaCRIndex, 0xa039);
VGAOUT16(0x3c4, 0x0608);
VGAOUT8(vgaCRIndex, 0x40);
@@ -917,6 +931,18 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
break;
case S3_SAVAGE4:
+ /*
+ * The Savage4 has one ugly special case to consider. On
+ * systems with 4 banks of 2Mx32 SDRAM, the BIOS says 4MB
+ * when it really means 8MB. Why do it the same when you
+ * can do it different...
+ */
+ VGAOUT8(vgaCRIndex, 0x68); /* memory control 1 */
+ if( (VGAIN8(vgaCRReg) & 0xC0) == (0x01 << 6) )
+ RamSavage4[1] = 8;
+
+ /*FALLTHROUGH*/
+
case S3_SAVAGE2000:
pScrn->videoRam = RamSavage4[ (config1 & 0xE0) >> 5 ] * 1024;
break;
@@ -1002,7 +1028,7 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
VGAOUT8(vgaCRReg, cr66 & ~0x02); /* clear reset flag */
usleep(10000);
- /* Set status word positions based on chip type. */
+ /* Set status word positions based on chip type. */
switch( psav->Chipset ) {
case S3_SAVAGE3D:
@@ -1028,8 +1054,42 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
psav->myWaitCommandEmpty = WaitCommandEmpty2K;
break;
}
-
- /* savage ramdac speeds */
+
+ /* Do the DDC dance. */
+
+ ddc = xf86LoadSubModule(pScrn, "ddc");
+ if (ddc) {
+#if 0
+ xf86MonPtr pMon = NULL;
+#endif
+
+ xf86LoaderReqSymLists(ddcSymbols, NULL);
+#if 0
+/*
+ * On many machines, the attempt to read DDC information via VBE puts the
+ * BIOS access into a state which prevents me from reading mode information.
+ * This is a complete mystery to me.
+ */
+ if ((psav->pVbe)
+ && ((pMon = xf86PrintEDID(vbeDoEDID(psav->pVbe, ddc))) != NULL))
+ xf86SetDDCproperties(pScrn,pMon);
+ else
+#endif
+ if (!SavageDDC1(pScrn->scrnIndex)) {
+ if ( xf86LoadSubModule(pScrn, "i2c") ) {
+ xf86LoaderReqSymLists(i2cSymbols,NULL);
+ if (SavageI2CInit(pScrn)) {
+ CARD32 tmp = (INREG(DDC_REG));
+ OUTREG(DDC_REG,(tmp | 0x13));
+ xf86SetDDCproperties(pScrn,xf86PrintEDID(
+ xf86DoEDID_DDC2(pScrn->scrnIndex,psav->I2C)));
+ OUTREG(DDC_REG,tmp);
+ }
+ }
+ }
+ }
+
+ /* Savage ramdac speeds */
pScrn->numClocks = 4;
pScrn->clock[0] = 250000;
pScrn->clock[1] = 250000;
@@ -1047,7 +1107,7 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
psav->dacSpeedBpp = pScrn->clock[0];
}
- /* set ramdac limits */
+ /* Set ramdac limits */
psav->maxClock = psav->dacSpeedBpp;
/* detect current mclk */
@@ -1067,25 +1127,99 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Detected current MCLK value of %1.3f MHz\n",
mclk / 1000.0);
- psav->minClock = 20000;
+ psav->minClock = 10000;
- pScrn->maxHValue = 2048;
- pScrn->maxVValue = 2048;
+ pScrn->maxHValue = 2048 << 3; /* 11 bits of h_total 8-pixel units */
+ pScrn->maxVValue = 2048; /* 11 bits of v_total */
pScrn->virtualX = pScrn->display->virtualX;
+ pScrn->virtualY = pScrn->display->virtualY;
+
+ /* Check LCD panel information */
+
+ if( psav->Chipset == S3_SAVAGE_MX )
+ {
+ unsigned char cr6b = hwp->readCrtc( hwp, 0x6b );
+
+ int panelX = (hwp->readSeq(hwp, 0x61) +
+ ((hwp->readSeq(hwp, 0x66) & 0x02) << 7) + 1) * 8;
+ int panelY = hwp->readSeq(hwp, 0x69) +
+ ((hwp->readSeq(hwp, 0x6e) & 0x70) << 4) + 1;
+
+ char * sTechnology = "Unknown";
+
+ /* OK, I admit it. I don't know how to limit the max dot clock
+ * for LCD panels of various sizes. I thought I copied the formula
+ * from the BIOS, but many users have informed me of my folly.
+ *
+ * Instead, I'll abandon any attempt to automatically limit the
+ * clock, and add an LCDClock option to XF86Config. Some day,
+ * I should come back to this.
+ */
+
+ enum ACTIVE_DISPLAYS { /* These are the bits in CR6B */
+ ActiveCRT = 0x01,
+ ActiveLCD = 0x02,
+ ActiveTV = 0x04,
+ ActiveCRT2 = 0x20,
+ ActiveDUO = 0x80
+ };
+
+ if( (hwp->readSeq( hwp, 0x39 ) & 0x03) == 0 )
+ {
+ sTechnology = "TFT";
+ }
+ else if( (hwp->readSeq( hwp, 0x30 ) & 0x01) == 0 )
+ {
+ sTechnology = "DSTN";
+ }
+ else
+ {
+ sTechnology = "STN";
+ }
+
+ xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
+ "%dx%d %s LCD panel detected %s\n",
+ panelX, panelY, sTechnology,
+ cr6b & ActiveLCD ? "and active" : "but not active");
+ if( cr6b & ActiveLCD ) {
+ /* If the LCD is active and panel expansion is enabled, */
+ /* we probably want to kill the HW cursor. */
+
+ xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
+ "- Limiting video mode to %dx%d\n",
+ panelX, panelY );
+
+ if( pScrn->virtualX > panelX )
+ pScrn->virtualX = panelX;
+ if( pScrn->virtualY > panelY )
+ pScrn->virtualY = panelY;
+
+ if( psav->LCDClock > 0.0 )
+ {
+ psav->maxClock = psav->LCDClock * 1000.0;
+ xf86DrvMsg( pScrn->scrnIndex, X_CONFIG,
+ "- Limiting dot clock to %1.2f MHz\n",
+ psav->LCDClock );
+ }
+ }
+ }
+
clockRanges = xnfalloc(sizeof(ClockRange));
clockRanges->next = NULL;
clockRanges->minClock = psav->minClock;
clockRanges->maxClock = psav->maxClock;
clockRanges->clockIndex = -1;
clockRanges->interlaceAllowed = TRUE;
- clockRanges->doubleScanAllowed = FALSE;
+ clockRanges->doubleScanAllowed = TRUE;
+ clockRanges->ClockDivFactor = 1.0;
+ clockRanges->ClockMulFactor = 1.0;
i = xf86ValidateModes(pScrn, pScrn->monitor->Modes,
pScrn->display->modes, clockRanges, NULL,
256, 2048, 16 * pScrn->bitsPerPixel,
128, 2048,
- pScrn->virtualX, pScrn->display->virtualY,
+ pScrn->virtualX, pScrn->virtualY,
psav->videoRambytes, LOOKUP_BEST_REFRESH);
if (i == -1) {
@@ -1111,15 +1245,14 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
SavageFreeBIOSModeTable( psav, &psav->ModeTable );
}
- psav->ModeTable = SavageGetBIOSModeTable( psav, pScrn->depth );
+ psav->ModeTable = SavageGetBIOSModeTable( psav, pScrn->bitsPerPixel );
if( !psav->ModeTable || !psav->ModeTable->NumModes ) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "Failed to fetch any BIOS modes.\n");
- SavageFreeRec(pScrn);
- return FALSE;
+ "Failed to fetch any BIOS modes. Disabling BIOS.\n");
+ psav->UseBIOS = FALSE;
}
-
+ else
/*if( xf86Verbose )*/
{
int i;
@@ -1151,28 +1284,12 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
xf86PrintModes(pScrn);
xf86SetDpi(pScrn, 0, 0);
- /* load bpp-specific modules */
- switch (pScrn->bitsPerPixel) {
- case 8:
- mod = "cfb";
- reqSym = "cfbScreenInit";
- break;
- case 16:
- mod = "cfb16";
- reqSym = "cfb16ScreenInit";
- break;
- case 32:
- mod = "cfb32";
- reqSym = "cfb32ScreenInit";
- break;
- }
-
- if (mod && xf86LoadSubModule(pScrn, mod) == NULL) {
+ if (xf86LoadSubModule(pScrn, "fb") == NULL) {
SavageFreeRec(pScrn);
return FALSE;
}
- xf86LoaderReqSymbols(reqSym, NULL);
+ xf86LoaderReqSymbols("fbScreenInit", NULL);
if( !psav->NoAccel ) {
if( !xf86LoadSubModule(pScrn, "xaa") ) {
@@ -1205,7 +1322,10 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
static Bool SavageEnterVT(int scrnIndex, int flags)
{
ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+ TRACE(("SavageEnterVT(%d)\n", flags));
+ gpScrn = pScrn;
+ SavageEnableMMIO(pScrn);
SavageSave(pScrn);
return SavageModeInit(pScrn, pScrn->currentMode);
}
@@ -1219,7 +1339,10 @@ static void SavageLeaveVT(int scrnIndex, int flags)
vgaRegPtr vgaSavePtr = &hwp->SavedReg;
SavageRegPtr SavageSavePtr = &psav->SavedReg;
- SavageWriteMode(pScrn, vgaSavePtr, SavageSavePtr);
+ TRACE(("SavageLeaveVT(%d)\n", flags));
+ gpScrn = pScrn;
+ SavageWriteMode(pScrn, vgaSavePtr, SavageSavePtr, FALSE);
+ SavageDisableMMIO(pScrn);
}
@@ -1235,9 +1358,10 @@ static void SavageSave(ScrnInfoPtr pScrn)
vgaCRReg = vgaIOBase + 5;
vgaCRIndex = vgaIOBase + 4;
+ TRACE(("SavageSave()\n"));
VGAOUT16(vgaCRIndex, 0x4838);
- VGAOUT16(vgaCRIndex, 0xa539);
+ VGAOUT16(vgaCRIndex, 0xa039);
VGAOUT16(0x3c4, 0x0608);
VGAOUT8(vgaCRIndex, 0x66);
@@ -1371,10 +1495,12 @@ static void SavageSave(ScrnInfoPtr pScrn)
VGAOUT8(vgaCRReg, cr3a | 0x80);
/* now save MIU regs */
- save->MMPR0 = INREG(FIFO_CONTROL_REG);
- save->MMPR1 = INREG(MIU_CONTROL_REG);
- save->MMPR2 = INREG(STREAMS_TIMEOUT_REG);
- save->MMPR3 = INREG(MISC_TIMEOUT_REG);
+ if( psav->Chipset != S3_SAVAGE_MX ) {
+ save->MMPR0 = INREG(FIFO_CONTROL_REG);
+ save->MMPR1 = INREG(MIU_CONTROL_REG);
+ save->MMPR2 = INREG(STREAMS_TIMEOUT_REG);
+ save->MMPR3 = INREG(MISC_TIMEOUT_REG);
+ }
VGAOUT8(vgaCRIndex, 0x3a);
VGAOUT8(vgaCRReg, cr3a);
@@ -1397,18 +1523,19 @@ static void SavageSave(ScrnInfoPtr pScrn)
static void SavageWriteMode(ScrnInfoPtr pScrn, vgaRegPtr vgaSavePtr,
- SavageRegPtr restore)
+ SavageRegPtr restore, Bool Entering)
{
unsigned char tmp, cr3a, cr66, cr67;
vgaHWPtr hwp = VGAHWPTR(pScrn);
SavagePtr psav = SAVPTR(pScrn);
int vgaCRIndex, vgaCRReg, vgaIOBase;
- Bool graphicsMode = FALSE;
vgaIOBase = hwp->IOBase;
vgaCRIndex = vgaIOBase + 4;
vgaCRReg = vgaIOBase + 5;
+
+ TRACE(("SavageWriteMode(%x)\n", restore->mode));
/*
* If we figured out a VESA mode number for this timing, just use
@@ -1447,15 +1574,18 @@ static void SavageWriteMode(ScrnInfoPtr pScrn, vgaRegPtr vgaSavePtr,
/* Disable old MMIO. */
VGAOUT8(vgaCRIndex, 0x53);
- tmp = VGAIN8(vgaCRReg);
- VGAOUT8(vgaCRReg, tmp & ~0x10);
+ VGAOUT8(vgaCRReg, VGAIN8(vgaCRReg) & ~0x10);
+
+ /* Set the color mode. */
+
+ VGAOUT8(vgaCRIndex, 0x67);
+ VGAOUT8(vgaCRReg, restore->CR67);
/* We may need TV/panel fixups here. See s3bios.c line 2904. */
/* Set FIFO fetch delay. */
VGAOUT8(vgaCRIndex, 0x85);
- tmp = VGAIN8(vgaCRReg);
- VGAOUT8(vgaCRReg, (tmp & 0xf8) | 0x03);
+ VGAOUT8(vgaCRReg, (VGAIN8(vgaCRReg) & 0xf8) | 0x03);
/* Patch CR79. These values are magical. */
@@ -1516,16 +1646,11 @@ static void SavageWriteMode(ScrnInfoPtr pScrn, vgaRegPtr vgaSavePtr,
/* Enable the graphics engine. */
VGAOUT16(vgaCRIndex, 0x0140);
- #if 0
- if( !psav->NoAccel )
- S3SAVInitialize2DEngine();
- #endif
/* Handle the pitch. */
VGAOUT8(vgaCRIndex, 0x50);
- tmp = VGAIN8(vgaCRReg);
- VGAOUT8(vgaCRReg, tmp | 0xC1);
+ VGAOUT8(vgaCRReg, VGAIN8(vgaCRReg) | 0xC1);
width = (pScrn->displayWidth * (pScrn->bitsPerPixel / 8)) >> 3;
VGAOUT16(vgaCRIndex, ((width & 0xff) << 8) | 0x13 );
@@ -1533,22 +1658,23 @@ static void SavageWriteMode(ScrnInfoPtr pScrn, vgaRegPtr vgaSavePtr,
/* Some non-S3 BIOSes enable block write even on non-SGRAM devices. */
- if( psav->Chipset == S3_SAVAGE2000 )
- {
- VGAOUT8(vgaCRIndex, 0x73);
- tmp = VGAIN8(vgaCRReg);
- VGAOUT8(vgaCRReg, tmp & 0xdf );
- }
- else if( psav->Chipset != S3_SAVAGE_MX )
+ switch( psav->Chipset )
{
- VGAOUT8(vgaCRIndex, 0x68);
- if( !(VGAIN8(vgaCRReg) & 0x80) )
- {
- /* Not SGRAM; disable block write. */
- VGAOUT8(vgaCRIndex, 0x88);
- tmp = VGAIN8(vgaCRReg);
- VGAOUT8(vgaCRReg, tmp | 0x10);
- }
+ case S3_SAVAGE2000:
+ VGAOUT8(vgaCRIndex, 0x73);
+ VGAOUT8(vgaCRReg, VGAIN8(vgaCRReg) & 0xdf );
+ break;
+
+ case S3_SAVAGE3D:
+ case S3_SAVAGE4:
+ VGAOUT8(vgaCRIndex, 0x68);
+ if( !(VGAIN8(vgaCRReg) & 0x80) )
+ {
+ /* Not SGRAM; disable block write. */
+ VGAOUT8(vgaCRIndex, 0x88);
+ VGAOUT8(vgaCRReg, VGAIN8(vgaCRReg) | 0x10);
+ }
+ break;
}
if( !psav->NoAccel )
@@ -1563,7 +1689,7 @@ static void SavageWriteMode(ScrnInfoPtr pScrn, vgaRegPtr vgaSavePtr,
VGAOUT8(0x3c2, 0x23);
VGAOUT16(vgaCRIndex, 0x4838);
- VGAOUT16(vgaCRIndex, 0xa539);
+ VGAOUT16(vgaCRIndex, 0xa039);
VGAOUT16(0x3c4, 0x0608);
vgaHWProtect(pScrn, TRUE);
@@ -1571,8 +1697,6 @@ static void SavageWriteMode(ScrnInfoPtr pScrn, vgaRegPtr vgaSavePtr,
/* will we be reenabling STREAMS for the new mode? */
psav->STREAMSRunning = 0;
- graphicsMode = (restore->CR31 & 0x0a) ? TRUE : FALSE;
-
/* reset GE to make sure nothing is going on */
VGAOUT8(vgaCRIndex, 0x66);
if(VGAIN8(vgaCRReg) & 0x01)
@@ -1585,14 +1709,8 @@ static void SavageWriteMode(ScrnInfoPtr pScrn, vgaRegPtr vgaSavePtr,
* switch to mode 3 here seems to eliminate the issue.
*/
-#define CLEAR_X86_REGS(pi) \
- (pi)->ax = (pi)->bx = (pi)->cx = (pi)->dx = (pi)->si = (pi)->di = 0
-
- if( !graphicsMode && psav->pInt10 ) {
- CLEAR_X86_REGS( psav->pInt10 );
- psav->pInt10->num = 0x10;
- psav->pInt10->ax = 0x0083;
- xf86ExecX86int10( psav->pInt10 );
+ if( ((restore->CR31 & 0x0a) == 0) && psav->pInt10 ) {
+ SavageSetTextMode( psav );
}
VGAOUT8(vgaCRIndex, 0x67);
@@ -1758,26 +1876,28 @@ static void SavageWriteMode(ScrnInfoPtr pScrn, vgaRegPtr vgaSavePtr,
cr3a = VGAIN8(vgaCRReg);
VGAOUT8(vgaCRReg, cr3a | 0x80);
- if (graphicsMode)
+ if (psav->Entering)
SavageGEReset(pScrn,0,__LINE__,__FILE__);
- VerticalRetraceWait();
- OUTREG(FIFO_CONTROL_REG, restore->MMPR0);
- WaitIdle();
- OUTREG(MIU_CONTROL_REG, restore->MMPR1);
- WaitIdle();
- OUTREG(STREAMS_TIMEOUT_REG, restore->MMPR2);
- WaitIdle();
- OUTREG(MISC_TIMEOUT_REG, restore->MMPR3);
+ if( psav->Chipset != S3_SAVAGE_MX )
+ {
+ VerticalRetraceWait();
+ OUTREG(FIFO_CONTROL_REG, restore->MMPR0);
+ WaitIdle();
+ OUTREG(MIU_CONTROL_REG, restore->MMPR1);
+ WaitIdle();
+ OUTREG(STREAMS_TIMEOUT_REG, restore->MMPR2);
+ WaitIdle();
+ OUTREG(MISC_TIMEOUT_REG, restore->MMPR3);
+ }
/* If we're going into graphics mode and acceleration was enabled, */
/* go set up the BCI buffer and the global bitmap descriptor. */
- if( graphicsMode && (!psav->NoAccel) )
+ if( psav->Entering && (!psav->NoAccel) )
{
VGAOUT8(vgaCRIndex, 0x50);
- tmp = VGAIN8(vgaCRReg);
- VGAOUT8(vgaCRReg, tmp | 0xC1);
+ VGAOUT8(vgaCRReg, VGAIN8(vgaCRReg) | 0xC1);
SavageInitialize2DEngine(pScrn);
}
@@ -1786,7 +1906,7 @@ static void SavageWriteMode(ScrnInfoPtr pScrn, vgaRegPtr vgaSavePtr,
VGAOUT8(vgaCRIndex, 0x3a);
VGAOUT8(vgaCRReg, cr3a);
- if( graphicsMode )
+ if( psav->Entering )
SavageSetGBD(pScrn);
vgaHWProtect(pScrn, FALSE);
@@ -1800,6 +1920,8 @@ static Bool SavageMapMMIO(ScrnInfoPtr pScrn)
SavagePtr psav;
vgaHWPtr hwp;
+ TRACE(("SavageMapMMIO()\n"));
+
psav = SAVPTR(pScrn);
if( S3_SAVAGE3D_SERIES(psav->Chipset) ) {
@@ -1845,6 +1967,8 @@ static Bool SavageMapFB(ScrnInfoPtr pScrn)
{
SavagePtr psav = SAVPTR(pScrn);
+ TRACE(("SavageMapFB()\n"));
+
xf86DrvMsg( pScrn->scrnIndex, X_PROBED,
"mapping framebuffer @ 0x%x with size 0x%x\n",
psav->FrameBufferBase, psav->videoRambytes);
@@ -1868,24 +1992,33 @@ static Bool SavageMapFB(ScrnInfoPtr pScrn)
}
-static void SavageUnmapMem(ScrnInfoPtr pScrn)
+static void SavageUnmapMem(ScrnInfoPtr pScrn, int All)
{
SavagePtr psav;
psav = SAVPTR(pScrn);
+ TRACE(("SavageUnmapMem(%x,%x)\n", psav->MapBase, psav->FBBase));
+
if (psav->PrimaryVidMapped) {
vgaHWUnmapMem(pScrn);
psav->PrimaryVidMapped = FALSE;
}
SavageDisableMMIO(pScrn);
- if (psav->MapBase)
+
+ if (All && psav->MapBase) {
xf86UnMapVidMem(pScrn->scrnIndex, (pointer)psav->MapBase,
SAVAGE_NEWMMIO_REGSIZE);
- if (psav->FBBase)
+ psav->MapBase = 0;
+ }
+
+ if (psav->FBBase) {
xf86UnMapVidMem(pScrn->scrnIndex, (pointer)psav->FBBase,
psav->videoRambytes);
+ psav->FBBase = 0;
+ }
+
#if 0
xf86UnMapVidMem(pScrn->scrnIndex, (pointer)psav->MapBaseDense,
0x8000);
@@ -1902,9 +2035,13 @@ static Bool SavageScreenInit(int scrnIndex, ScreenPtr pScreen,
SavagePtr psav;
int ret;
+ TRACE(("SavageScreenInit()\n"));
+
pScrn = xf86Screens[pScreen->myNum];
psav = SAVPTR(pScrn);
+ SavageEnableMMIO(pScrn);
+
if (!SavageMapFB(pScrn))
return FALSE;
@@ -1921,10 +2058,18 @@ static Bool SavageScreenInit(int scrnIndex, ScreenPtr pScreen,
if (!miSetVisualTypes(pScrn->depth, TrueColorMask,
pScrn->rgbBits, pScrn->defaultVisual))
return FALSE;
+#if 0
+ if (!miSetPixmapDepths ())
+ return FALSE;
+#endif
} else {
if (!miSetVisualTypes(pScrn->depth, miGetDefaultVisualMask(pScrn->depth),
pScrn->rgbBits, pScrn->defaultVisual))
return FALSE;
+#if 0
+ if (!miSetPixmapDepths ())
+ return FALSE;
+#endif
}
ret = SavageInternalScreenInit(scrnIndex, pScreen);
@@ -1956,9 +2101,8 @@ static Bool SavageScreenInit(int scrnIndex, ScreenPtr pScreen,
miInitializeBackingStore(pScreen);
xf86SetBackingStore(pScreen);
-#if 0
- SavageDGAInit(pScreen);
-#endif
+ if( !psav->numDGAModes )
+ SavageDGAInit(pScreen);
miDCInitialize(pScreen, xf86GetPointerScreenFuncs());
@@ -2002,9 +2146,12 @@ static Bool SavageScreenInit(int scrnIndex, ScreenPtr pScreen,
pScreen->SaveScreen = SavageSaveScreen;
pScreen->CloseScreen = SavageCloseScreen;
-#ifdef DPMSExtension
if (xf86DPMSInit(pScreen, SavageDPMS, 0) == FALSE)
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "DPMS initialization failed\n");
+
+#ifdef XvExtension
+ if( !psav->NoAccel )
+ SavageInitVideo( pScreen );
#endif
if (serverGeneration == 1)
@@ -2022,6 +2169,8 @@ static int SavageInternalScreenInit(int scrnIndex, ScreenPtr pScreen)
int width, height, displayWidth;
unsigned char *FBStart;
+ TRACE(("SavageInternalScreenInit()\n"));
+
pScrn = xf86Screens[pScreen->myNum];
psav = SAVPTR(pScrn);
@@ -2046,29 +2195,12 @@ static int SavageInternalScreenInit(int scrnIndex, ScreenPtr pScreen)
FBStart = psav->FBStart;
}
- switch (pScrn->bitsPerPixel) {
- case 8:
- ret = cfbScreenInit(pScreen, FBStart, width, height,
- pScrn->xDpi, pScrn->yDpi,
- displayWidth);
- break;
- case 16:
- ret = cfb16ScreenInit(pScreen, FBStart, width, height,
- pScrn->xDpi, pScrn->yDpi,
- displayWidth);
- break;
- case 32:
- ret = cfb32ScreenInit(pScreen, FBStart, width, height,
- pScrn->xDpi, pScrn->yDpi,
- displayWidth);
- break;
- default:
- xf86DrvMsg(scrnIndex, X_ERROR,
- "Internal error: invalid bpp (%d) in SavageScreenInit\n",
- pScrn->bitsPerPixel);
- ret = FALSE;
- break;
- }
+ ret = fbScreenInit(pScreen, FBStart, width, height,
+ pScrn->xDpi, pScrn->yDpi,
+ displayWidth,
+ pScrn->bitsPerPixel);
+ if (ret)
+ fbPictureInit (pScreen, 0, 0);
return ret;
}
@@ -2078,6 +2210,7 @@ static ModeStatus SavageValidMode(int index, DisplayModePtr mode,
Bool verbose, int flags)
{
/* TODO check modes */
+ TRACE(("SavageValidMode\n"));
return MODE_OK;
}
@@ -2096,6 +2229,9 @@ static Bool SavageModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
vgaCRIndex = vgaIOBase + 4;
vgaCRReg = vgaIOBase + 5;
+ TRACE(("SavageModeInit(%dx%d, %dHz)\n",
+ mode->HDisplay, mode->VDisplay, mode->Clock));
+
#if 0
ErrorF("Clock = %d, HDisplay = %d, HSStart = %d\n",
mode->Clock, mode->HDisplay, mode->HSyncStart);
@@ -2139,6 +2275,35 @@ static Bool SavageModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
new->mode = 0;
+ /* We need to set CR67 whether or not we use the BIOS. */
+
+ dclk = mode->Clock;
+ new->CR67 = 0x00;
+
+ switch( pScrn->depth ) {
+ case 8:
+ if( (dclk <= 110000) && (psav->Chipset != S3_SAVAGE_MX) )
+ new->CR67 = 0x10; /* 8bpp, 135Mhz */
+ else
+ new->CR67 = 0x00; /* 8bpp, 220Mhz */
+ break;
+ case 15:
+ if( (dclk <= 110000) && (psav->Chipset != S3_SAVAGE_MX) )
+ new->CR67 = 0x20; /* 15bpp, 135Mhz */
+ else
+ new->CR67 = 0x30; /* 15bpp, 220Mhz */
+ break;
+ case 16:
+ if( (dclk <= 110000) && (psav->Chipset != S3_SAVAGE_MX) )
+ new->CR67 = 0x40; /* 16bpp, 135Mhz */
+ else
+ new->CR67 = 0x50; /* 16bpp, 220Mhz */
+ break;
+ case 24:
+ new->CR67 = 0xd0;
+ break;
+ }
+
if( psav->UseBIOS ) {
int refresh;
SavageModeEntryPtr pmt;
@@ -2222,8 +2387,6 @@ static Bool SavageModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
new->CR55 |= 0x10;
#endif
- dclk = mode->Clock;
- new->CR67 = 0x00;
new->SR15 = 0x03 | 0x80;
new->SR18 = 0x00;
new->CR43 = new->CR45 = new->CR65 = 0x00;
@@ -2250,31 +2413,6 @@ static Bool SavageModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
psav->NeedSTREAMS = FALSE;
- /****
- * TODO
- * old code uses the "dclk<=110000" path for all non-MX/IX, and the
- * >110000 path for MX/IX. What does this mean?
- ****/
-
- if (pScrn->bitsPerPixel == 8) {
- if (dclk <= 110000)
- new->CR67 = 0x00; /* 8bpp, 135Mhz */
- else
- new->CR67 = 0x10; /* 8bpp, 220Mhz */
- } else if ((pScrn->bitsPerPixel == 16) && (pScrn->weight.green == 5)) {
- if (dclk <= 110000)
- new->CR67 = 0x20; /* 15bpp, 135Mhz */
- else
- new->CR67 = 0x30; /* 15bpp, 220Mhz */
- } else if (pScrn->bitsPerPixel == 16) {
- if (dclk <= 110000)
- new->CR67 = 0x40; /* 16bpp, 135Mhz */
- else
- new->CR67 = 0x50; /* 16bpp, 220Mhz */
- } else if (pScrn->bitsPerPixel == 32) {
- new->CR67 = 0xd0;
- }
-
SavageCalcClock(dclk, 1, 1, 127, 0, 4, 180000, 360000,
&m, &n, &r);
new->SR12 = (r << 6) | (n & 0x3f);
@@ -2342,17 +2480,17 @@ static Bool SavageModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
else
new->CR50 = 0x30;
- if (pScrn->displayWidth <= 640)
+ if (pScrn->displayWidth == 640)
new->CR50 |= 0x40;
- else if (pScrn->displayWidth <= 800)
+ else if (pScrn->displayWidth == 800)
new->CR50 |= 0x80;
- else if (pScrn->displayWidth <= 1024)
+ else if (pScrn->displayWidth == 1024)
new->CR50 |= 0x00;
- else if (pScrn->displayWidth <= 1152)
+ else if (pScrn->displayWidth == 1152)
new->CR50 |= 0x01;
- else if (pScrn->displayWidth <= 1280)
+ else if (pScrn->displayWidth == 1280)
new->CR50 |= 0xc0;
- else if (pScrn->displayWidth <= 1600)
+ else if (pScrn->displayWidth == 1600)
new->CR50 |= 0x81;
else
new->CR50 |= 0xc1; /* Use GBD */
@@ -2382,7 +2520,7 @@ static Bool SavageModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
pScrn->vtSema = TRUE;
/* do it! */
- SavageWriteMode(pScrn, vganew, new);
+ SavageWriteMode(pScrn, vganew, new, TRUE);
SavageAdjustFrame(pScrn->scrnIndex, pScrn->frameX0, pScrn->frameY0, 0);
return TRUE;
@@ -2397,28 +2535,17 @@ static Bool SavageCloseScreen(int scrnIndex, ScreenPtr pScreen)
vgaRegPtr vgaSavePtr = &hwp->SavedReg;
SavageRegPtr SavageSavePtr = &psav->SavedReg;
+ TRACE(("SavageCloseScreen\n"));
+
if( psav->AccelInfoRec ) {
XAADestroyInfoRec( psav->AccelInfoRec );
psav->AccelInfoRec = NULL;
}
-#if 0
- if( psav->pInt10 ) {
- xf86FreeInt10( psav->pInt10 );
- psav->pInt10 = NULL;
- }
-
- if (psav->pVbe)
- {
- vbeFree(psav->pVbe);
- psav->pVbe = NULL;
- }
-#endif
-
if (pScrn->vtSema) {
- SavageWriteMode(pScrn, vgaSavePtr, SavageSavePtr);
+ SavageWriteMode(pScrn, vgaSavePtr, SavageSavePtr, FALSE);
vgaHWLock(hwp);
- SavageUnmapMem(pScrn);
+ SavageUnmapMem(pScrn, 0);
}
pScrn->vtSema = FALSE;
@@ -2430,6 +2557,17 @@ static Bool SavageCloseScreen(int scrnIndex, ScreenPtr pScreen)
static Bool SavageSaveScreen(ScreenPtr pScreen, int mode)
{
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ TRACE(("SavageSaveScreen(0x%x)\n", mode));
+
+ if( SAVPTR(pScrn)->hwcursor )
+ {
+ if( xf86IsUnblank(mode) )
+ SavageShowCursor( pScrn );
+ else
+ SavageHideCursor( pScrn );
+ }
+
return vgaHWSaveScreen(pScreen, mode);
}
@@ -2445,10 +2583,12 @@ void SavageAdjustFrame(int scrnIndex, int x, int y, int flags)
vgaCRIndex = vgaIOBase + 4;
vgaCRReg = vgaIOBase + 5;
+ TRACE(("SavageAdjustFrame(%d,%d,%x)\n", x, y, flags));
+
if (psav->ShowCache && y)
y += pScrn->virtualY - 1;
- Base = ((y * pScrn->displayWidth + x) *
+ Base = ((y * pScrn->displayWidth + (x&~1)) *
(pScrn->bitsPerPixel / 8)) >> 2;
/* now program the start address registers */
VGAOUT16(vgaCRIndex, (Base & 0x00ff00) | 0x0c);
@@ -2462,6 +2602,7 @@ void SavageAdjustFrame(int scrnIndex, int x, int y, int flags)
Bool SavageSwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
{
+ TRACE(("SavageSwitchMode\n"));
return SavageModeInit(xf86Screens[scrnIndex], mode);
}
@@ -2473,6 +2614,9 @@ void SavageEnableMMIO(ScrnInfoPtr pScrn)
int vgaCRIndex, vgaCRReg;
unsigned char val;
+ TRACE(("SavageEnableMMIO\n"));
+
+ vgaHWSetStdFuncs(hwp);
vgaHWSetMmioFuncs(hwp, psav->MapBase, 0x8000);
val = VGAIN8(0x3c3);
VGAOUT8(0x3c3, val | 0x01);
@@ -2482,9 +2626,12 @@ void SavageEnableMMIO(ScrnInfoPtr pScrn)
vgaCRIndex = hwp->IOBase + 4;
vgaCRReg = hwp->IOBase + 5;
- VGAOUT8(vgaCRIndex, 0x40);
- val = VGAIN8(vgaCRReg);
- VGAOUT8(vgaCRReg, val | 1);
+ if( psav->Chipset >= S3_SAVAGE4 )
+ {
+ VGAOUT8(vgaCRIndex, 0x40);
+ val = VGAIN8(vgaCRReg);
+ VGAOUT8(vgaCRReg, val | 1);
+ }
return;
}
@@ -2497,13 +2644,20 @@ void SavageDisableMMIO(ScrnInfoPtr pScrn)
int vgaCRIndex, vgaCRReg;
unsigned char val;
+ TRACE(("SavageDisableMMIO\n"));
+
vgaHWGetIOBase(hwp);
vgaCRIndex = hwp->IOBase + 4;
vgaCRReg = hwp->IOBase + 5;
- VGAOUT8(vgaCRIndex, 0x40);
- val = VGAIN8(vgaCRReg);
- VGAOUT8(vgaCRReg, val | 1);
+ if( psav->Chipset >= S3_SAVAGE4 )
+ {
+ VGAOUT8(vgaCRIndex, 0x40);
+ val = VGAIN8(vgaCRReg);
+ VGAOUT8(vgaCRReg, val | 1);
+ }
+
+ vgaHWSetStdFuncs(hwp);
return;
}
@@ -2527,6 +2681,9 @@ void SavageLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indicies,
static void SavageCalcClock(long freq, int min_m, int min_n1, int max_n1,
+
+ /* Make sure linear addressing is enabled after the BIOS call. */
+ /* Note that we must use an I/O port to do this. */
int min_n2, int max_n2, long freq_min,
long freq_max, unsigned int *mdiv,
unsigned int *ndiv, unsigned int *r)
@@ -2592,6 +2749,8 @@ void SavageGEReset(ScrnInfoPtr pScrn, int from_timeout, int line, char *file)
SavagePtr psav = SAVPTR(pScrn);
int vgaCRIndex, vgaCRReg, vgaIOBase;
+ TRACE(("SavageGEReset(%d,%s)\n", line, file));
+
vgaIOBase = hwp->IOBase;
vgaCRIndex = vgaIOBase + 4;
vgaCRReg = vgaIOBase + 5;
@@ -2603,7 +2762,7 @@ void SavageGEReset(ScrnInfoPtr pScrn, int from_timeout, int line, char *file)
} else
WaitIdleEmpty();
- if (from_timeout) {
+ if (from_timeout && (psav->Chipset != S3_SAVAGE_MX) ) {
fifo_control = INREG(FIFO_CONTROL_REG);
miu_control = INREG(MIU_CONTROL_REG);
streams_timeout = INREG(STREAMS_TIMEOUT_REG);
@@ -2647,7 +2806,7 @@ void SavageGEReset(ScrnInfoPtr pScrn, int from_timeout, int line, char *file)
break;
}
- if (from_timeout) {
+ if (from_timeout && (psav->Chipset != S3_SAVAGE_MX) ) {
OUTREG(FIFO_CONTROL_REG, fifo_control);
OUTREG(MIU_CONTROL_REG, miu_control);
OUTREG(STREAMS_TIMEOUT_REG, streams_timeout);
@@ -2700,12 +2859,13 @@ SavagePrintRegs(ScrnInfoPtr pScrn)
}
-#ifdef DPMSExtension
static void SavageDPMS(ScrnInfoPtr pScrn, int mode, int flags)
{
SavagePtr psav = SAVPTR(pScrn);
unsigned char sr8 = 0x00, srd = 0x00;
+ TRACE(("SavageDPMS(%d,%x)\n", mode, flags));
+
VGAOUT8(0x3c4, 0x08);
sr8 = VGAIN8(0x3c5);
sr8 |= 0x06;
@@ -2738,4 +2898,53 @@ static void SavageDPMS(ScrnInfoPtr pScrn, int mode, int flags)
return;
}
-#endif /* DPMSExtension */
+
+
+static unsigned int
+SavageDDC1Read(ScrnInfoPtr pScrn)
+{
+ register vgaHWPtr hwp = VGAHWPTR(pScrn);
+ register CARD32 tmp;
+ SavagePtr psav = SAVPTR(pScrn);
+
+ while (hwp->readST01(hwp)&0x8) {};
+ while (!(hwp->readST01(hwp)&0x8)) {};
+
+ tmp = (INREG(DDC_REG));
+ return ((unsigned int) (tmp & 0x08));
+}
+
+static Bool
+SavageDDC1(int scrnIndex)
+{
+ ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+ SavagePtr psav = SAVPTR(pScrn);
+ CARD32 tmp;
+ Bool success = FALSE;
+ xf86MonPtr pMon;
+
+ /* initialize chipset */
+ tmp = INREG(DDC_REG);
+ OUTREG(DDC_REG,(tmp | 0x12));
+
+ if ((pMon = xf86PrintEDID(
+ xf86DoEDID_DDC1(scrnIndex,vgaHWddc1SetSpeed,SavageDDC1Read))) != NULL)
+ success = TRUE;
+ xf86SetDDCproperties(pScrn,pMon);
+
+ /* undo initialization */
+ OUTREG(DDC_REG,(tmp));
+ return success;
+}
+
+
+static void
+SavageProbeDDC(ScrnInfoPtr pScrn, int index)
+{
+ vbeInfoPtr pVbe;
+ if (xf86LoadSubModule(pScrn, "vbe")) {
+ pVbe = VBEInit(NULL,index);
+ ConfiguredMonitor = vbeDoEDID(pVbe, NULL);
+ }
+}
+
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_driver.h b/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_driver.h
index d05cdb19e..24929fb6c 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_driver.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_driver.h
@@ -1,32 +1,31 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_driver.h,v 1.3 2000/12/07 20:26:22 dawes Exp $ */
+/* $xFree86: $ */
#ifndef SAVAGE_VGAHWMMIO_H
#define SAVAGE_VGAHWMMIO_H
+#include "xf86_ansic.h"
+#include "compiler.h"
#include "vgaHW.h"
#include "xf86.h"
#include "xf86Resources.h"
-#include "xf86_ansic.h"
#include "xf86Pci.h"
#include "xf86PciInfo.h"
#include "xf86_OSproc.h"
-#include "compiler.h"
#include "xf86Cursor.h"
#include "mipointer.h"
#include "micmap.h"
-#include "cfb.h"
-#include "cfb16.h"
-#include "cfb32.h"
+#include "fb.h"
#include "xf86cmap.h"
#include "vbe.h"
#include "xaa.h"
+#include "xf86xv.h"
#include "savage_regs.h"
#define VGAIN8(addr) MMIO_IN8(psav->MapBase+0x8000, addr)
#define VGAIN16(addr) MMIO_IN16(psav->MapBase+0x8000, addr)
#define VGAIN(addr) MMIO_IN32(psav->MapBase+0x8000, addr)
-
+
#define VGAOUT8(addr,val) MMIO_OUT8(psav->MapBase+0x8000, addr, val)
#define VGAOUT16(addr,val) MMIO_OUT16(psav->MapBase+0x8000, addr, val)
#define VGAOUT(addr,val) MMIO_OUT32(psav->MapBase+0x8000, addr, val)
@@ -79,6 +78,7 @@ typedef struct _Savage {
Bool STREAMSRunning;
int Bpp, Bpl, ScissB;
unsigned PlaneMask;
+ I2CBusPtr I2C;
int videoRambytes;
int videoRamKbytes;
@@ -112,16 +112,14 @@ typedef struct _Savage {
Bool fifo_conservative;
Bool fifo_moderate;
Bool fifo_aggressive;
- Bool slow_edodram;
- Bool slow_dram;
- Bool fast_dram;
- Bool fpm_vram;
- Bool early_ras_precharge;
Bool hwcursor;
Bool NoAccel;
Bool shadowFB;
Bool UseBIOS;
int rotate;
+ double LCDClock;
+ int StatusDelay;
+ Bool StatusHack;
CloseScreenProcPtr CloseScreen;
pciVideoPtr PciInfo;
@@ -153,6 +151,7 @@ typedef struct _Savage {
unsigned int SavedGbd;
unsigned int SavedSbdOffset;
unsigned int SavedSbd;
+ Bool Entering;
/* Support for Int10 processing */
xf86Int10InfoPtr pInt10;
@@ -163,8 +162,27 @@ typedef struct _Savage {
unsigned long cobSize; /* size in bytes */
unsigned long cobOffset; /* offset in frame buffer */
+ /* Support for DGA */
+ int numDGAModes;
+ DGAModePtr DGAModes;
+ Bool DGAactive;
+ int DGAViewportStatus;
+
+ /* Support for XVideo */
+
+ unsigned int videoFlags;
+ unsigned int blendBase;
+ int videoFourCC;
+ XF86VideoAdaptorPtr adaptor;
+ int VideoZoomMax;
+
} SavageRec, *SavagePtr;
+/* Video flags. */
+
+#define VF_STREAMS_ON 0x0001
+
+
/* Shortcuts. These depend on a local symbol "psav". */
#define WaitIdle() psav->myWaitIdle(psav)
@@ -186,12 +204,19 @@ Bool SavageSwitchMode(int scrnIndex, DisplayModePtr mode, int flags);
/* In savage_cursor.c. */
Bool SavageHWCursorInit(ScreenPtr pScreen);
+void SavageShowCursor(ScrnInfoPtr);
+void SavageHideCursor(ScrnInfoPtr);
/* In savage_accel.c. */
Bool SavageInitAccel(ScreenPtr);
void SavageInitialize2DEngine(ScrnInfoPtr);
void SavageSetGBD(ScrnInfoPtr);
+void SavageAccelSync(ScrnInfoPtr);
+
+/* In savage_i2c.c. */
+
+Bool SavageI2CInit(ScrnInfoPtr pScrn);
/* In savage_shadow.c */
@@ -215,5 +240,9 @@ unsigned short SavageGetBIOSModes(
SavageModeEntryPtr s3vModeTable );
+/* In savage_video.c */
+
+void SavageInitVideo( ScreenPtr pScreen );
+
#endif /* SAVAGE_VGAHWMMIO_H */
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_regs.h b/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_regs.h
index 679795c8d..c730eb290 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_regs.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_regs.h
@@ -1,9 +1,14 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_regs.h,v 1.4 2000/12/07 20:26:22 dawes Exp $ */
-
#ifndef _SAVAGE_REGS_H
#define _SAVAGE_REGS_H
-#include "savage_driver.h"
+/* These are here until xf86PciInfo.h is updated. */
+
+#ifndef PCI_CHIP_TWISTER_P
+#define PCI_CHIP_TWISTER_P 0x8d01
+#endif
+#ifndef PCI_CHIP_TWISTER_K
+#define PCI_CHIP_TWISTER_K 0x8d02
+#endif
#define S3_SAVAGE3D_SERIES(chip) ((chip>=S3_SAVAGE3D) && (chip<=S3_SAVAGE_MX))
@@ -41,28 +46,95 @@ enum S3CHIPTAGS {
#define STREAMS_TIMEOUT_REG 0x8208
#define MISC_TIMEOUT_REG 0x820c
-#define PSTREAM_CONTROL_REG 0x8180
-#define COL_CHROMA_KEY_CONTROL_REG 0x8184
-#define SSTREAM_CONTROL_REG 0x8190
-#define CHROMA_KEY_UPPER_BOUND_REG 0x8194
-#define SSTREAM_STRETCH_REG 0x8198
-#define BLEND_CONTROL_REG 0x81a0
-#define PSTREAM_FBADDR0_REG 0x81c0
-#define PSTREAM_FBADDR1_REG 0x81c4
-#define PSTREAM_STRIDE_REG 0x81c8
-#define DOUBLE_BUFFER_REG 0x81cc
-#define SSTREAM_FBADDR0_REG 0x81d0
-#define SSTREAM_FBADDR1_REG 0x81d4
-#define SSTREAM_STRIDE_REG 0x81d8
-#define OPAQUE_OVERLAY_CONTROL_REG 0x81dc
-#define K1_VSCALE_REG 0x81e0
-#define K2_VSCALE_REG 0x81e4
-#define DDA_VERT_REG 0x81e8
-#define STREAMS_FIFO_REG 0x81ec
-#define PSTREAM_START_REG 0x81f0
-#define PSTREAM_WINDOW_SIZE_REG 0x81f4
-#define SSTREAM_START_REG 0x81f8
-#define SSTREAM_WINDOW_SIZE_REG 0x81fC
+/* Stream Processor 1 */
+
+/* Primary Stream 1 Frame Buffer Address 0 */
+#define PRI_STREAM_FBUF_ADDR0 0x81c0
+/* Primary Stream 1 Frame Buffer Address 0 */
+#define PRI_STREAM_FBUF_ADDR1 0x81c4
+/* Primary Stream 1 Stride */
+#define PRI_STREAM_STRIDE 0x81c8
+/* Primary Stream 1 Frame Buffer Size */
+#define PRI_STREAM_BUFFERSIZE 0x8214
+
+/* Secondary stream 1 Color/Chroma Key Control */
+#define SEC_STREAM_CKEY_LOW 0x8184
+/* Secondary stream 1 Chroma Key Upper Bound */
+#define SEC_STREAM_CKEY_UPPER 0x8194
+/* Blend Control of Secondary Stream 1 & 2 */
+#define BLEND_CONTROL 0x8190
+/* Secondary Stream 1 Color conversion/Adjustment 1 */
+#define SEC_STREAM_COLOR_CONVERT1 0x8198
+/* Secondary Stream 1 Color conversion/Adjustment 2 */
+#define SEC_STREAM_COLOR_CONVERT2 0x819c
+/* Secondary Stream 1 Color conversion/Adjustment 3 */
+#define SEC_STREAM_COLOR_CONVERT3 0x81e4
+/* Secondary Stream 1 Horizontal Scaling */
+#define SEC_STREAM_HSCALING 0x81a0
+/* Secondary Stream 1 Frame Buffer Size */
+#define SEC_STREAM_BUFFERSIZE 0x81a8
+/* Secondary Stream 1 Horizontal Scaling */
+#define SEC_STREAM_VSCALING 0x81e8
+/* Secondary Stream 1 Frame Buffer Address 0 */
+#define SEC_STREAM_FBUF_ADDR0 0x81d0
+/* Secondary Stream 1 Frame Buffer Address 1 */
+#define SEC_STREAM_FBUF_ADDR1 0x81d4
+/* Secondary Stream 1 Frame Buffer Address 2 */
+#define SEC_STREAM_FBUF_ADDR2 0x81ec
+/* Secondary Stream 1 Stride */
+#define SEC_STREAM_STRIDE 0x81d8
+/* Secondary Stream 1 Window Start Coordinates */
+#define SEC_STREAM_WINDOW_START 0x81f8
+/* Secondary Stream 1 Window Size */
+#define SEC_STREAM_WINDOW_SZ 0x81fc
+/* Secondary Streams Tile Offset */
+#define SEC_STREAM_TILE_OFF 0x821c
+/* Secondary Stream 1 Opaque Overlay Control */
+#define SEC_STREAM_OPAQUE_OVERLAY 0x81dc
+
+
+/* Stream Processor 2 */
+
+/* Primary Stream 2 Frame Buffer Address 0 */
+#define PRI_STREAM2_FBUF_ADDR0 0x81b0
+/* Primary Stream 2 Frame Buffer Address 1 */
+#define PRI_STREAM2_FBUF_ADDR1 0x81b4
+/* Primary Stream 2 Stride */
+#define PRI_STREAM2_STRIDE 0x81b8
+/* Primary Stream 2 Frame Buffer Size */
+#define PRI_STREAM2_BUFFERSIZE 0x8218
+
+/* Secondary Stream 2 Color/Chroma Key Control */
+#define SEC_STREAM2_CKEY_LOW 0x8188
+/* Secondary Stream 2 Chroma Key Upper Bound */
+#define SEC_STREAM2_CKEY_UPPER 0x818c
+/* Secondary Stream 2 Horizontal Scaling */
+#define SEC_STREAM2_HSCALING 0x81a4
+/* Secondary Stream 2 Horizontal Scaling */
+#define SEC_STREAM2_VSCALING 0x8204
+/* Secondary Stream 2 Frame Buffer Size */
+#define SEC_STREAM2_BUFFERSIZE 0x81ac
+/* Secondary Stream 2 Frame Buffer Address 0 */
+#define SEC_STREAM2_FBUF_ADDR0 0x81bc
+/* Secondary Stream 2 Frame Buffer Address 1 */
+#define SEC_STREAM2_FBUF_ADDR1 0x81e0
+/* Secondary Stream 2 Frame Buffer Address 2 */
+#define SEC_STREAM2_FBUF_ADDR2 0x8208
+/* Multiple Buffer/LPB and Secondary Stream 2 Stride */
+#define SEC_STREAM2_STRIDE_LPB 0x81cc
+/* Secondary Stream 2 Color conversion/Adjustment 1 */
+#define SEC_STREAM2_COLOR_CONVERT1 0x81f0
+/* Secondary Stream 2 Color conversion/Adjustment 2 */
+#define SEC_STREAM2_COLOR_CONVERT2 0x81f4
+/* Secondary Stream 2 Color conversion/Adjustment 3 */
+#define SEC_STREAM2_COLOR_CONVERT3 0x8200
+/* Secondary Stream 2 Window Start Coordinates */
+#define SEC_STREAM2_WINDOW_START 0x820c
+/* Secondary Stream 2 Window Size */
+#define SEC_STREAM2_WINDOW_SZ 0x8210
+/* Secondary Stream 2 Opaque Overlay Control */
+#define SEC_STREAM2_OPAQUE_OVERLAY 0x8180
+
#define SUBSYS_STAT_REG 0x8504
@@ -74,6 +146,8 @@ enum S3CHIPTAGS {
#define MONO_PAT_0 0xa4e8
#define MONO_PAT_1 0xa4ec
+#define DDC_REG 0xff20
+
/* Constants for CR69. */
@@ -99,7 +173,6 @@ enum S3CHIPTAGS {
{ \
VGAOUT8(vgaCRIndex, 0x17); \
if (VGAIN8(vgaCRReg) & 0x80) { \
- while ((VGAIN8(vgaIOBase + 0x0a) & 0x08) == 0x00) ; \
while ((VGAIN8(vgaIOBase + 0x0a) & 0x08) == 0x08) ; \
while ((VGAIN8(vgaIOBase + 0x0a) & 0x08) == 0x00) ; \
} \
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/README b/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/README
index c7ed98328..d2f142d68 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/README
+++ b/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/README
@@ -21,6 +21,7 @@ Display:
- "Rotate" "cw" | "ccw" Rotate the screen CW - clockwise or CCW - counter
clockwise. Uses ShadowFB. Default: no rotation.
- "UseBIOS" Use BIOS to set modes. Default: on.
+- "ZoomOnLCD" Allow changing resolution on panel. Default: off.
Overlays:
@@ -72,4 +73,4 @@ Debug:
Header: //Mercury/Projects/archives/XFree86/4.0/README.-arc 1.2 14 Sep 2000 12:28:36 Frido $
-$XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/README,v 1.2 2000/12/05 21:18:37 dawes Exp $
+$XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/README,v 1.3 2001/02/15 18:20:33 dawes Exp $
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/Release.txt b/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/Release.txt
index a9448ee81..af828eb31 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/Release.txt
+++ b/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/Release.txt
@@ -1,5 +1,41 @@
+
--------------------------------------------------------------------------------
- Silicon Motion Driver for XFree86 4.0.1
+ Silicon Motion Driver for XFree86 4.0.2
+ Alpha Release 1.2.2, 02/14/2001
+-------------------------------------------------------------------------------
+
+Fixed bugs:
+
+- #920 - Color change/flash at 8bpp when switch back to desktop in rotation
+ mode.
+- #932 - System hangs when enabling rotation in 24-bpp.
+- #941 - Overlay disappear in the virtual desktop when move the window.
+- #944 - Mouse pointer doesn't work properly in panning modes under rotation.
+- #950 - Garbage appears on desktop when click the Basic/Metal for the Theme
+ Selector.
+- #983 - Added ZoomOnLCD option.
+- #1058 - Desktop changes color when panning in 24-bpp mode.
+- #1069 - CRT is off after exit X on DSTN 800x600.
+- #1074 - Screen broken occurs in X when enable Rotation on DSTN 800x600.
+
+Known problems:
+
+- When video is playing in panning mode, it is not correctly clipped when you
+ move the panning window.
+- Sound breaks apart in Netscape when moving the window around.
+
+-------------------------------------------------------------------------------
+ Silicon Motion Driver for XFree86 4.0.2
+ Alpha Release 1.2.1, 01/03/2001
+--------------------------------------------------------------------------------
+
+Fixed bugs:
+
+- Severe corruption in 24-bpp across all chips.
+- Disable hardware cursor on older BIOSes.
+
+--------------------------------------------------------------------------------
+ Silicon Motion Driver for XFree86 4.0.2
Alpha Release 1.2.0, 12/13/2000
--------------------------------------------------------------------------------
@@ -148,6 +184,6 @@ This driver has been tested on the LynxEM+ 712 chip under 16-bit mode. Any other
mode might still show lock-ups and/or garbage. Please report any problems to
frido@siliconmotion.com.
-Header: //Mercury/Projects/archives/XFree86/4.0/Release.txt-arc 1.30 30 Nov 2000 17:00:58 Frido $
+Header: //Mercury/Projects/archives/XFree86/4.0/Release.txt-arc 1.33 13 Dec 2000 09:52:48 Frido $
-$XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/Release.txt,v 1.3 2000/12/14 01:05:43 dawes Exp $
+$XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/Release.txt,v 1.5 2001/02/15 18:20:33 dawes Exp $
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/siliconmotion.cpp b/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/siliconmotion.cpp
deleted file mode 100644
index 43ab525f7..000000000
--- a/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/siliconmotion.cpp
+++ /dev/null
@@ -1,195 +0,0 @@
-.\" Header: //Mercury/Projects/archives/XFree86/4.0/siliconmotion.cpp-arc 1.4 29 Nov 2000 14:12:56 Frido $
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/siliconmotion.cpp,v 1.4 2000/12/12 18:54:31 dawes Exp $
-.\" shorthand for double quote that works everywhere.
-.ds q \N'34'
-.TH siliconmotion __drivermansuffix__ "Version 4.0.2" "XFree86"
-.SH NAME
-siliconmotion \- Silicon Motion video driver
-.SH SYNOPSIS
-.B "Section \*qDevice\*q"
-.br
-.BI " Identifier \*q" devname \*q
-.br
-.B " Driver \*qsiliconmotion\*q"
-.br
-\ \ ...
-.br
-\ \ [
-.B "Option"
-"optionname" ["optionvalue"]]
-.br
-.B EndSection
-.SH DESCRIPTION
-.B siliconmotion
-is an XFree86 driver for Silicon Motion based video cards. The driver is fully
-accelerated, and provides support for the following framebuffer depths:
-8, 16, and 24. All
-visual types are supported for depth 8, and TrueColor
-visuals are supported for the other depths.
-.SH SUPPORTED HARDWARE
-The
-.B siliconmotion
-driver supports PCI and AGP video cards based on the following Silicon Motion chips:
-.TP 12
-.B Lynx
-SM910
-.TP 12
-.B LynxE
-SM810
-.TP 12
-.B Lynx3D
-SM820
-.TP 12
-.B LynxEM
-SM710
-.TP 12
-.B LynxEM+
-SM712
-.TP 12
-.B Lynx3DM
-SM720
-.SH CONFIGURATION DETAILS
-Please refer to XF86Config(__filemansuffix__) for general configuration
-details. This section only covers configuration details specific to this
-driver. All options names are case and white space insensitive when
-parsed by the server, for example, "lynxe" and "LynxE" are equivalent.
-.PP
-The driver auto-detects the chipset type, but the following
-.B ChipSet
-names may optionally be specified in the config file
-.B \*qDevice\*q
-section, and will override the auto-detection:
-.PP
-.RS 4
-"lynx", "lynxe", "lynx3d", "lynxem", "lynxem+", "lynx3dm".
-.RE
-
-.PP
-The following Cursor
-.B Options
-are supported:
-.TP
-.BI "Option \*qHWCursor\*q \*q" boolean \*q
-Enable or disable the HW cursor. Default: on.
-.TP
-.BI "Option \*qSWCursor\*q \*q" boolean \*q
-Inverse of "HWCursor". Default: off.
-
-.PP
-The following display
-.B Options
-are supported:
-.TP
-.BI "Option \*qShadowFB\*q \*q" boolean \*q
-Use shadow framebuffer. Default: off.
-.TP
-.BI "Option \*qRotate\*q \*qCW\*q"
-.TP
-.BI "Option \*qRotate\*q \*qCCW\*q"
-Rotate the screen CW - clockwise or CCW - counter clockwise.
-Uses ShadowFB. Default: no rotation.
-.TP
-.BI "Option \*qVideoKey\*q \*q" integer \*q
-Set the video color key. Default: a little off full blue.
-.TP
-.BI "Option \*qByteSwap\*q \*q" boolean \*q
-Turn on byte swapping for capturing using SMI demo board. Default: off.
-.TP
-.BI "Option \*qUseBIOS\*q \*q" boolean \*q
-Use the BIOS to set the modes. This is used for custom panel timings.
-Default: on.
-
-.PP
-The following video memory
-.B Options
-are supported:
-.TP
-.BI "Option \*qset_mclk\*q \*q" integer \*q
-sets the memory clock, where
-.I integer
-is in kHz, and
-.I integer
-<= 100000. Default: probe the memory clock value,
-and use it at server start.
-
-
-.PP
-The following acceleration and graphics engine
-.B Options
-are supported:
-.TP
-.B "Option \*qNoAccel\*q"
-Disable acceleration. Very useful for determining if the
-driver has problems with drawing and acceleration routines. This is the first
-option to try if your server runs but you see graphic corruption on the screen.
-Using it decreases performance, as it uses software emulation for drawing
-operations the video driver can accelerate with hardware.
-Default: acceleration is enabled.
-.TP
-.B "Option \*qfifo_aggressive\*q"
-.TP
-.B "Option \*qfifo_moderate\*q"
-.TP
-.B "Option \*qfifo_conservative\*q"
-alter the settings
-for the threshold at which the pixel FIFO takes over the internal
-memory bus to refill itself. The smaller this threshold, the better
-the acceleration performance of the card. You may try the fastest
-setting
-.RB ( "fifo_aggressive" )
-and move down if you encounter pixel corruption.
-The optimal setting will probably depend on dot-clock and on color
-depth. Note that specifying any of these options will also alter other
-memory settings which may increase performance, so trying
-.B "fifo_conservative"
-will in most cases be a slight benefit (this uses the chip defaults).
-If pixel corruption or transient streaking is observed during drawing
-operations then removing any fifo options is recommended. Default: none.
-
-.PP
-The following PCI bus
-.B Options
-are supported:
-.TP
-.BI "Option \*qpci_burst\*q \*q" boolean \*q
-will enable PCI burst mode. This should work on all but a
-few broken PCI chipsets, and will increase performance. Default: off.
-.TP
-.BI "Option \*qpci_retry\*q \*q" boolean \*q
-will allow the driver to rely on PCI Retry to program the
-ViRGE registers.
-.B "pci_burst"
-must be enabled for this to work.
-This will increase performance, especially for small fills/blits,
-because the driver does not have to poll the ViRGE before sending it
-commands to make sure it is ready. It should work on most
-recent PCI chipsets. Default: off.
-
-.PP
-The following additional
-.B Options
-are supported:
-.TP
-.BI "Option \*qShowCache\*q \*q" boolean \*q
-Enable or disable viewing offscreen cache memory. A
-development debug option. Default: off.
-
-.SH SEE ALSO
-XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__)
-
-.SH SUPPORT
-For assistance with this driver, or XFree86 in general, check the XFree86 web
-site at http://www.xfree86.org. A FAQ is available on the web site at
-http://www.xfree86.org/FAQ/. If you find a problem with XFree86 or have a
-question not answered in the FAQ please use our bug report form available on
-the web site or send mail to XFree86@XFree86.org. When reporting problems
-with the driver send as much detail as possible, including chipset type, a
-server output log, and operating system specifics.
-
-.SH AUTHORS
-Kevin Brosius,
-Matt Grossman,
-Harald Koenig,
-Sebastien Marineau,
-Mark Vojkovich,
-Frido Garritsen.
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi.h b/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi.h
index dbe80934e..6c48ddf9f 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi.h
@@ -26,7 +26,7 @@ Silicon Motion shall not be used in advertising or otherwise to promote the
sale, use or other dealings in this Software without prior written
authorization from the XFree86 Project and Silicon Motion.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi.h,v 1.2 2000/12/05 21:18:37 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi.h,v 1.3 2001/02/15 18:20:33 dawes Exp $ */
#ifndef _SMI_H
#define _SMI_H
@@ -154,6 +154,7 @@ typedef struct
Bool hwcursor; /* hardware cursor enabled */
Bool ShowCache; /* Debugging option */
Bool useBIOS; /* USe BIOS for mode sets */
+ Bool zoomOnLCD; /* Zoom on LCD */
CloseScreenProcPtr CloseScreen; /* Pointer used to save wrapped *
* CloseScreen function. */
@@ -196,6 +197,7 @@ typedef struct
void * pSaveBuffer; /* #670 - FB save buffer */
CARD32 savedFBOffset; /* #670 - Saved FBOffset value */
CARD32 savedFBReserved; /* #670 - Saved FBReserved value */
+ CARD8 * paletteBuffer; /* #920 - Palette save buffer */
/* Polylines - #671 */
ValidateGCProcPtr ValidatePolylines;/* Org. ValidatePolylines function */
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_accel.c b/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_accel.c
index 516b22d29..7712742a3 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_accel.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_accel.c
@@ -1,4 +1,4 @@
-/* Header: //Mercury/Projects/archives/XFree86/4.0/smi_accel.c-arc 1.15 29 Nov 2000 12:12:04 Frido $ */
+/* Header: //Mercury/Projects/archives/XFree86/4.0/smi_accel.c-arc 1.16 03 Jan 2001 13:29:06 Frido $ */
/*
Copyright (C) 1994-1999 The XFree86 Project, Inc. All Rights Reserved.
@@ -26,7 +26,7 @@ Silicon Motion shall not be used in advertising or otherwise to promote the
sale, use or other dealings in this Software without prior written
authorization from the XFree86 Project and silicon Motion.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_accel.c,v 1.2 2000/12/05 21:18:37 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_accel.c,v 1.4 2001/02/15 18:20:33 dawes Exp $ */
#include "smi.h"
@@ -404,7 +404,7 @@ SMI_SubsequentScreenToScreenCopy(ScrnInfoPtr pScrn, int x1, int y1, int x2,
if (pScrn->bitsPerPixel == 24)
{
x1 *= 3;
- x2 *= 2;
+ x2 *= 3;
w *= 3;
if (pSmi->Chipset == SMI_LYNX)
@@ -714,10 +714,11 @@ SMI_SetupForColor8x8PatternFill(ScrnInfoPtr pScrn, int patx, int paty, int rop,
if (pScrn->bitsPerPixel <= 16)
{
- unsigned char * pattern = pSmi->FBBase + patx * pSmi->Bpp
- + paty * pSmi->Stride;
+ /* PDR#950 */
+ CARD8* pattern = pSmi->FBBase
+ + (patx + paty * pSmi->Stride) * pSmi->Bpp;
- WaitQueue(1);
+ WaitIdleEmpty();
WRITE_DPR(pSmi, 0x0C, SMI_BITBLT | SMI_COLOR_PATTERN);
memcpy(pSmi->DataPortBase, pattern, 8 * pSmi->Bpp * 8);
}
@@ -777,7 +778,7 @@ SMI_SubsequentColor8x8PatternFillRect(ScrnInfoPtr pScrn, int patx, int paty,
WaitQueue(3);
WRITE_DPR(pSmi, 0x04, (x << 16) | (y & 0xFFFF));
- WRITE_DPR(pSmi, 0x08, (w << 16) | (y & 0xFFFF));
+ WRITE_DPR(pSmi, 0x08, (w << 16) | (h & 0xFFFF)); /* PDR#950 */
WRITE_DPR(pSmi, 0x0C, pSmi->AccelCmd);
LEAVE_PROC("SMI_SubsequentColor8x8PatternFillRect");
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_driver.c
index 719399f9f..68257cda5 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_driver.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_driver.c
@@ -1,4 +1,4 @@
-/* Header: //Mercury/Projects/archives/XFree86/4.0/smi_driver.c-arc 1.40 06 Dec 2000 15:35:00 Frido $ */
+/* Header: //Mercury/Projects/archives/XFree86/4.0/smi_driver.c-arc 1.42 03 Jan 2001 13:52:16 Frido $ */
/*
Copyright (C) 1994-1999 The XFree86 Project, Inc. All Rights Reserved.
@@ -26,7 +26,7 @@ Silicon Motion shall not be used in advertising or otherwise to promote the
sale, use or other dealings in this Software without prior written
authorization from The XFree86 Project or Silicon Motion.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_driver.c,v 1.6 2000/12/14 01:05:43 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_driver.c,v 1.9 2001/02/15 18:20:33 dawes Exp $ */
#include "xf86Resources.h"
#include "xf86RAC.h"
@@ -37,11 +37,9 @@ authorization from The XFree86 Project or Silicon Motion.
#include "smi.h"
-#ifdef DPMSExtension
- #include "globals.h"
- #define DPMS_SERVER
- #include "extensions/dpms.h"
-#endif
+#include "globals.h"
+#define DPMS_SERVER
+#include "extensions/dpms.h"
/*
* Internals
@@ -74,10 +72,8 @@ static Bool SMI_CloseScreen(int scrnIndex, ScreenPtr pScreen);
static Bool SMI_SaveScreen(ScreenPtr pScreen, int mode);
static void SMI_LoadPalette(ScrnInfoPtr pScrn, int numColors, int *indicies,
LOCO *colors, VisualPtr pVisual);
-#ifdef DPMSExtension
static void SMI_DisplayPowerManagementSet(ScrnInfoPtr pScrn,
int PowerManagementMode, int flags);
-#endif
static Bool SMI_ddc1(int scrnIndex);
static unsigned int SMI_ddc1Read(ScrnInfoPtr pScrn);
static void SMI_FreeScreen(int ScrnIndex, int flags);
@@ -86,10 +82,10 @@ static void SMI_ProbeDDC(ScrnInfoPtr pScrn, int index);
#define SILICONMOTION_NAME "Silicon Motion"
#define SILICONMOTION_DRIVER_NAME "siliconmotion"
-#define SILICONMOTION_VERSION_NAME "1.2.0"
+#define SILICONMOTION_VERSION_NAME "1.2.2"
#define SILICONMOTION_VERSION_MAJOR 1
#define SILICONMOTION_VERSION_MINOR 2
-#define SILICONMOTION_PATCHLEVEL 0
+#define SILICONMOTION_PATCHLEVEL 2
#define SILICONMOTION_DRIVER_VERSION ( (SILICONMOTION_VERSION_MAJOR << 24) \
| (SILICONMOTION_VERSION_MINOR << 16) \
| (SILICONMOTION_PATCHLEVEL) \
@@ -157,6 +153,7 @@ typedef enum
OPTION_BYTESWAP,
#endif
OPTION_USEBIOS,
+ OPTION_ZOOMONLCD,
NUMBER_OF_OPTIONS
} SMIOpts;
@@ -180,6 +177,7 @@ static OptionInfoRec SMIOptions[] =
{ OPTION_BYTESWAP, "ByteSwap", OPTV_BOOLEAN, {0}, FALSE },
#endif
{ OPTION_USEBIOS, "UseBIOS", OPTV_BOOLEAN, {0}, FALSE },
+ { OPTION_ZOOMONLCD, "ZoomOnLCD", OPTV_BOOLEAN, {0}, FALSE },
{ -1, NULL, OPTV_NONE, {0}, FALSE }
};
@@ -741,6 +739,9 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags)
pSmi->shadowFB ? "enabled" : "disabled");
}
+ #if 1 /* PDR#932 */
+ if ((pScrn->depth == 8) || (pScrn->depth == 16))
+ #endif /* PDR#932 */
if ((s = xf86GetOptValString(SMIOptions, OPTION_ROTATE)))
{
if(!xf86NameCmp(s, "CW"))
@@ -801,6 +802,17 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags)
pSmi->useBIOS = TRUE;
}
+ if (xf86GetOptValBool(SMIOptions, OPTION_ZOOMONLCD, &pSmi->zoomOnLCD))
+ {
+ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: ZoomOnLCD %s.\n",
+ pSmi->zoomOnLCD ? "enabled" : "disabled");
+ }
+ else
+ {
+ /* Default to ZoomOnLCD disabled. */
+ pSmi->zoomOnLCD = FALSE;
+ }
+
/* Find the PCI slot for this screen */
pEnt = xf86GetEntityInfo(pScrn->entityList[0]);
if ((pEnt->location.type != BUS_PCI) || (pEnt->resources))
@@ -1234,6 +1246,20 @@ SMI_EnterVT(int scrnIndex, int flags)
{
BoxRec box;
+ /* #920 */
+ if (pSmi->paletteBuffer)
+ {
+ int i;
+
+ VGAOUT8(pSmi, VGA_DAC_WRITE_ADDR, 0);
+ for(i = 0; i < 256 * 3; i++)
+ {
+ VGAOUT8(pSmi, VGA_DAC_DATA, pSmi->paletteBuffer[i]);
+ }
+ xfree(pSmi->paletteBuffer);
+ pSmi->paletteBuffer = NULL;
+ }
+
if (pSmi->pSaveBuffer)
{
memcpy(pSmi->FBBase, pSmi->pSaveBuffer, pSmi->saveBufferSize);
@@ -1280,6 +1306,22 @@ SMI_LeaveVT(int scrnIndex, int flags)
pSmi->savedFBOffset = pSmi->FBOffset;
pSmi->savedFBReserved = pSmi->FBReserved;
+
+ /* #920 */
+ if (pSmi->Bpp == 1)
+ {
+ pSmi->paletteBuffer = xnfalloc(256 * 3);
+ if (pSmi->paletteBuffer)
+ {
+ int i;
+
+ VGAOUT8(pSmi, VGA_DAC_READ_ADDR, 0);
+ for (i = 0; i < 256 * 3; i++)
+ {
+ pSmi->paletteBuffer[i] = VGAIN8(pSmi, VGA_DAC_DATA);
+ }
+ }
+ }
}
memset(pSmi->FBBase, 0, 256 * 1024); /* #689 */
@@ -1371,6 +1413,9 @@ SMI_Save(ScrnInfoPtr pScrn)
{
save->CRA0[i] = VGAIN8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0xA0 + i);
}
+
+ /* PDR#1069 */
+ VGAOUT8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x9E, save->CR90[14]);
}
else
{
@@ -1580,6 +1625,8 @@ SMI_WriteMode(ScrnInfoPtr pScrn, vgaRegPtr vgaSavePtr, SMIRegPtr restore)
}
}
+ VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x81, 0x00);
+
WRITE_DPR(pSmi, 0x10, restore->DPR10);
WRITE_DPR(pSmi, 0x1C, restore->DPR1C);
WRITE_DPR(pSmi, 0x20, restore->DPR20);
@@ -1739,16 +1786,16 @@ SMI_MapMem(ScrnInfoPtr pScrn)
* the frame buffer. Also set up the reserved memory space.
*/
pSmi->FBCursorOffset = pSmi->videoRAMBytes - 1024;
- if (VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_INDEX, 0x30) & 0x01)
+ if (VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x30) & 0x01)/* #1074 */
{
- CARD32 fifiOffset = 0;
- fifiOffset |= VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x46)
+ CARD32 fifoOffset = 0;
+ fifoOffset |= VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x46)
<< 3;
- fifiOffset |= VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x47)
+ fifoOffset |= VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x47)
<< 11;
- fifiOffset |= (VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x49)
+ fifoOffset |= (VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x49)
& 0x1C) << 17;
- pSmi->FBReserved = pSmi->videoRAMBytes - fifiOffset;
+ pSmi->FBReserved = fifoOffset; /* PDR#1074 */
}
else
{
@@ -2018,12 +2065,10 @@ SMI_ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
pSmi->CloseScreen = pScreen->CloseScreen;
pScreen->CloseScreen = SMI_CloseScreen;
-#ifdef DPMSExtension
if (!xf86DPMSInit(pScreen, SMI_DisplayPowerManagementSet, 0))
{
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "DPMS initialization failed!\n");
}
-#endif
SMI_InitVideo(pScreen);
@@ -2158,7 +2203,7 @@ SMI_ValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags)
mem = (pScrn->virtualX * pScrn->bitsPerPixel / 8 + 15) & ~15;
mem *= pScrn->virtualY * 2;
- if (mem > pSmi->videoRAMBytes - pSmi->FBReserved)
+ if (mem > pSmi->FBReserved) /* PDR#1074 */
{
LEAVE_PROC("SMI_ValidMode");
return(MODE_MEM);
@@ -2167,15 +2212,8 @@ SMI_ValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags)
if (!pSmi->useBIOS || pSmi->lcd)
{
- if ( (mode->HDisplay != pSmi->lcdWidth)
- || (mode->VDisplay != pSmi->lcdHeight)
- )
- {
- LEAVE_PROC("SMI_ValidMode");
- return(MODE_PANEL);
- }
-
- if (pSmi->rotate)
+ #if 1 /* PDR#983 */
+ if (pSmi->zoomOnLCD)
{
if ( (mode->HDisplay > pSmi->lcdWidth)
|| (mode->VDisplay > pSmi->lcdHeight)
@@ -2185,8 +2223,33 @@ SMI_ValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags)
return(MODE_PANEL);
}
}
+ else
+ #endif
+ {
+ if ( (mode->HDisplay != pSmi->lcdWidth)
+ || (mode->VDisplay != pSmi->lcdHeight)
+ )
+ {
+ LEAVE_PROC("SMI_ValidMode");
+ return(MODE_PANEL);
+ }
+ }
+
}
+ #if 1 /* PDR#944 */
+ if (pSmi->rotate)
+ {
+ if ( (mode->HDisplay != pSmi->lcdWidth)
+ || (mode->VDisplay != pSmi->lcdHeight)
+ )
+ {
+ LEAVE_PROC("SMI_ValidMode");
+ return(MODE_PANEL);
+ }
+ }
+ #endif
+
LEAVE_PROC("SMI_ValidMode");
return(MODE_OK);
}
@@ -2589,6 +2652,11 @@ SMI_CloseScreen(int scrnIndex, ScreenPtr pScreen)
{
xfree(pSmi->pSaveBuffer);
}
+ /* #920 */
+ if (pSmi->paletteBuffer)
+ {
+ xfree(pSmi->paletteBuffer);
+ }
pScrn->vtSema = FALSE;
pScreen->CloseScreen = pSmi->CloseScreen;
@@ -2635,10 +2703,22 @@ SMI_AdjustFrame(int scrnIndex, int x, int y, int flags)
if (SMI_LYNX3D_SERIES(pSmi->Chipset))
{
Base = (Base + 15) & ~15;
+ #if 1 /* PDR#1058 */
+ while ((Base % pSmi->Bpp) > 0)
+ {
+ Base -= 16;
+ }
+ #endif
}
else
{
Base = (Base + 7) & ~7;
+ #if 1 /* PDR#1058 */
+ while ((Base % pSmi->Bpp) > 0)
+ {
+ Base -= 8;
+ }
+ #endif
}
WRITE_VPR(pSmi, 0x0C, Base >> 3);
@@ -2825,7 +2905,6 @@ SMI_PrintRegs(ScrnInfoPtr pScrn)
* SMI_DisplayPowerManagementSet -- Sets VESA Display Power Management
* Signaling (DPMS) Mode.
*/
-#ifdef DPMSExtension
static void
SMI_DisplayPowerManagementSet(ScrnInfoPtr pScrn, int PowerManagementMode,
int flags)
@@ -2980,7 +3059,6 @@ SMI_DisplayPowerManagementSet(ScrnInfoPtr pScrn, int PowerManagementMode,
LEAVE_PROC("SMI_DisplayPowerManagementSet");
}
-#endif
static void
SMI_ProbeDDC(ScrnInfoPtr pScrn, int index)
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_video.c b/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_video.c
index d7b288ea2..9022ba330 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_video.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_video.c
@@ -26,7 +26,7 @@ Silicon Motion shall not be used in advertising or otherwise to promote the
sale, use or other dealings in this Software without prior written
authorization from the XFree86 Project and silicon Motion.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_video.c,v 1.2 2000/12/05 21:18:37 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_video.c,v 1.3 2001/02/15 18:20:33 dawes Exp $ */
#include "smi.h"
#include "smi_video.h"
@@ -122,7 +122,6 @@ void SMI_InitVideo(ScreenPtr pScreen)
if ( (psmi->rotate == 0)
&& !psmi->NoAccel
- && (pScrn->bitsPerPixel != 8)
)
{
newAdaptor = SMI_SetupVideo(pScreen);
@@ -189,7 +188,6 @@ static XF86VideoEncodingRec SMI_VideoEncodings[] =
static XF86VideoFormatRec SMI_VideoFormats[] =
{
- { 8, PseudoColor }, /* depth, class */
{ 15, TrueColor }, /* depth, class */
{ 16, TrueColor }, /* depth, class */
{ 24, TrueColor }, /* depth, class */
@@ -213,6 +211,7 @@ static XF86ImageRec SMI_VideoImages[] =
{
XVIMAGE_YUY2,
XVIMAGE_YV12,
+ XVIMAGE_I420,
{
FOURCC_RV15, /* id */
XvRGB, /* type */
@@ -912,6 +911,14 @@ SMI_PutImage(
dstPitch = ((width << 1) + 15) & ~15;
break;
+ case FOURCC_I420:
+ srcPitch = (width + 3) & ~3;
+ offset3 = srcPitch * height;
+ srcPitch2 = ((width >> 1) + 3) & ~3;
+ offset2 = offset3 + (srcPitch2 * (height >> 1));
+ dstPitch = ((width << 1) + 15) & ~15;
+ break;
+
case FOURCC_RV24:
bpp = 3;
srcPitch = width * bpp;
@@ -953,6 +960,7 @@ SMI_PutImage(
switch (id)
{
case FOURCC_YV12:
+ case FOURCC_I420:
top &= ~1;
tmp = ((top >> 1) * srcPitch2) + (left >> 2);
offset2 += tmp;
@@ -1020,6 +1028,7 @@ SMI_QueryImageAttributes(
switch (id)
{
case FOURCC_YV12:
+ case FOURCC_I420:
*height = (*height + 1) & ~1;
size = (*width + 3) & ~3;
if (pitches != NULL)
@@ -1164,6 +1173,10 @@ SMI_ClipVideo(
ENTER_PROC("SMI_ClipVideo");
+ /* PDR#941 */
+ extents->x1 = max(extents->x1, pScrn->frameX0);
+ extents->y1 = max(extents->y1, pScrn->frameY0);
+
hscale = ((*x2 - *x1) << 16) / (dst->x2 - dst->x1);
vscale = ((*y2 - *y1) << 16) / (dst->y2 - dst->y1);
@@ -1278,6 +1291,7 @@ SMI_DisplayVideo(
switch (id)
{
case FOURCC_YV12:
+ case FOURCC_I420:
case FOURCC_YUY2:
vpr00 |= 0x6;
break;
@@ -1614,6 +1628,7 @@ SMI_AllocSurface(
switch (id)
{
case FOURCC_YV12:
+ case FOURCC_I420:
case FOURCC_YUY2:
case FOURCC_RV15:
case FOURCC_RV16:
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/sis/init301.c b/xc/programs/Xserver/hw/xfree86/drivers/sis/init301.c
index 5cde319e6..fcc011b61 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.3 2000/12/02 01:16:16 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/init301.c,v 1.4 2001/02/14 19:08:32 dawes Exp $ */
#include "xf86.h"
#include "xf86PciInfo.h"
@@ -1355,7 +1355,7 @@ VOID SetCRT2FIFO(USHORT Part1Port,ULONG ROMAddr,USHORT ModeNo,ScrnInfoPtr pScrn
USHORT oldREFIndex,CRT1ModeNo,oldModeIDOffset;
long int longtemp;
- USHORT LatencyFactor[48]={ 88, 80, 78, 72, 70, 00, /* 64 bit BQ=2 */
+ static USHORT LatencyFactor[48]={ 88, 80, 78, 72, 70, 00, /* 64 bit BQ=2 */
00, 79, 77, 71, 69, 49, /* 64 bit BQ=1 */
88, 80, 78, 72, 70, 00, /* 128 bit BQ=2 */
00, 72, 70, 64, 62, 44, /* 128 bit BQ=1 */
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/sis/sis.cpp b/xc/programs/Xserver/hw/xfree86/drivers/sis/sis.cpp
deleted file mode 100644
index 08f3b7404..000000000
--- a/xc/programs/Xserver/hw/xfree86/drivers/sis/sis.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis.cpp,v 1.5 2000/12/11 20:18:26 dawes Exp $
-.\" shorthand for double quote that works everywhere.
-.ds q \N'34'
-.TH SIS __drivermansuffix__ "Version 4.0.2" "XFree86"
-.SH NAME
-sis \- SiS video driver
-.SH SYNOPSIS
-.nf
-.B "Section \*qDevice\*q"
-.BI " Identifier \*q" devname \*q
-.B " Driver \*qsis\*q"
-\ \ ...
-.B EndSection
-.fi
-.SH DESCRIPTION
-.B sis
-is an XFree86 driver for SiS video cards.
-THIS MAN PAGE NEEDS TO BE FILLED IN.
-.SH SUPPORTED HARDWARE
-The
-.B sis
-driver supports...
-.SH CONFIGURATION DETAILS
-Please refer to XF86Config(__filemansuffix__) for general configuration
-details. This section only covers configuration details specific to this
-driver.
-.SH "SEE ALSO"
-XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__)
-.SH AUTHORS
-Authors include: ...
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 9dc2feb48..da8a6b182 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.8 2000/12/02 01:16:17 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.c,v 1.9 2000/12/21 12:22:57 alanh Exp $ */
/* modified from tdfx_dri.c, mga_dri.c */
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/sunbw2/sunbw2.cpp b/xc/programs/Xserver/hw/xfree86/drivers/sunbw2/sunbw2.cpp
deleted file mode 100644
index 8be9c868a..000000000
--- a/xc/programs/Xserver/hw/xfree86/drivers/sunbw2/sunbw2.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunbw2/sunbw2.cpp,v 1.2 2000/12/11 20:18:27 dawes Exp $
-.\" shorthand for double quote that works everywhere.
-.ds q \N'34'
-.TH SUNBW2 __drivermansuffix__ "Version 4.0.2" "XFree86"
-.SH NAME
-sunbw2 \- BW2 video driver
-.SH SYNOPSIS
-.nf
-.B "Section \*qDevice\*q"
-.BI " Identifier \*q" devname \*q
-.B " Driver \*qsunbw2\*q"
-\ \ ...
-.B EndSection
-.fi
-.SH DESCRIPTION
-.B sunbw2
-is an XFree86 driver for Sun BW2 video cards.
-THIS MAN PAGE NEEDS TO BE FILLED IN.
-.SH SUPPORTED HARDWARE
-The
-.B sunbw2
-driver supports...
-.SH CONFIGURATION DETAILS
-Please refer to XF86Config(__filemansuffix__) for general configuration
-details. This section only covers configuration details specific to this
-driver.
-.SH "SEE ALSO"
-XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__)
-.SH AUTHORS
-Authors include: Jakub Jelinek <jakub@redhat.com>
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/suncg14/suncg14.cpp b/xc/programs/Xserver/hw/xfree86/drivers/suncg14/suncg14.cpp
deleted file mode 100644
index 1d111923a..000000000
--- a/xc/programs/Xserver/hw/xfree86/drivers/suncg14/suncg14.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suncg14/suncg14.cpp,v 1.2 2000/12/11 20:18:29 dawes Exp $
-.\" shorthand for double quote that works everywhere.
-.ds q \N'34'
-.TH SUNCG14 __drivermansuffix__ "Version 4.0.2" "XFree86"
-.SH NAME
-suncg14 \- CG14 video driver
-.SH SYNOPSIS
-.nf
-.B "Section \*qDevice\*q"
-.BI " Identifier \*q" devname \*q
-.B " Driver \*qsuncg14\*q"
-\ \ ...
-.B EndSection
-.fi
-.SH DESCRIPTION
-.B suncg14
-is an XFree86 driver for Sun CG14 video cards.
-THIS MAN PAGE NEEDS TO BE FILLED IN.
-.SH SUPPORTED HARDWARE
-The
-.B suncg14
-driver supports...
-.SH CONFIGURATION DETAILS
-Please refer to XF86Config(__filemansuffix__) for general configuration
-details. This section only covers configuration details specific to this
-driver.
-.SH "SEE ALSO"
-XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__)
-.SH AUTHORS
-Authors include: Jakub Jelinek <jakub@redhat.com>
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/suncg3/suncg3.cpp b/xc/programs/Xserver/hw/xfree86/drivers/suncg3/suncg3.cpp
deleted file mode 100644
index eb183fbe2..000000000
--- a/xc/programs/Xserver/hw/xfree86/drivers/suncg3/suncg3.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suncg3/suncg3.cpp,v 1.2 2000/12/11 20:18:31 dawes Exp $
-.\" shorthand for double quote that works everywhere.
-.ds q \N'34'
-.TH SUNCG3 __drivermansuffix__ "Version 4.0.2" "XFree86"
-.SH NAME
-suncg3 \- CG3 video driver
-.SH SYNOPSIS
-.nf
-.B "Section \*qDevice\*q"
-.BI " Identifier \*q" devname \*q
-.B " Driver \*qsuncg3\*q"
-\ \ ...
-.B EndSection
-.fi
-.SH DESCRIPTION
-.B suncg3
-is an XFree86 driver for Sun CG3 video cards.
-THIS MAN PAGE NEEDS TO BE FILLED IN.
-.SH SUPPORTED HARDWARE
-The
-.B suncg3
-driver supports...
-.SH CONFIGURATION DETAILS
-Please refer to XF86Config(__filemansuffix__) for general configuration
-details. This section only covers configuration details specific to this
-driver.
-.SH "SEE ALSO"
-XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__)
-.SH AUTHORS
-Authors include: Jakub Jelinek <jakub@redhat.com>
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/suncg6/suncg6.cpp b/xc/programs/Xserver/hw/xfree86/drivers/suncg6/suncg6.cpp
deleted file mode 100644
index 8ff863c39..000000000
--- a/xc/programs/Xserver/hw/xfree86/drivers/suncg6/suncg6.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suncg6/suncg6.cpp,v 1.3 2000/12/11 20:18:32 dawes Exp $
-.\" shorthand for double quote that works everywhere.
-.ds q \N'34'
-.TH SUNCG6 __drivermansuffix__ "Version 4.0.2" "XFree86"
-.SH NAME
-suncg6 \- GX/Turbo GX video driver
-.SH SYNOPSIS
-.nf
-.B "Section \*qDevice\*q"
-.BI " Identifier \*q" devname \*q
-.B " Driver \*qsuncg6\*q"
-\ \ ...
-.B EndSection
-.fi
-.SH DESCRIPTION
-.B suncg6
-is an XFree86 driver for Sun GX and Turbo GX (also known as cgsix) video cards.
-THIS MAN PAGE NEEDS TO BE FILLED IN.
-.SH SUPPORTED HARDWARE
-The
-.B suncg6
-driver supports...
-.SH CONFIGURATION DETAILS
-Please refer to XF86Config(__filemansuffix__) for general configuration
-details. This section only covers configuration details specific to this
-driver.
-.SH "SEE ALSO"
-XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__)
-.SH AUTHORS
-Authors include: Jakub Jelinek <jakub@redhat.com>
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_dri.c b/xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_dri.c
index af7d6a1cb..0b31ce5da 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_dri.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_dri.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_dri.c,v 1.4 2000/06/23 23:43:44 alanh Exp $
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_dri.c,v 1.5 2000/12/21 12:22:57 alanh Exp $
* Acceleration for the Creator and Creator3D framebuffer - DRI/DRM support.
*
* Copyright (C) 2000 David S. Miller (davem@redhat.com)
@@ -214,6 +214,19 @@ FFBDRIScreenInit(ScreenPtr pScreen)
"FFBDRIScreenInit failed (libdri.a too old)\n");
return FALSE;
}
+
+ /* Check the DRI version */
+ {
+ int major, minor, patch;
+ DRIQueryVersion(&major, &minor, &patch);
+ if (major != 3 || minor != 1 || patch < 0) {
+ xf86DrvMsg(pScreen->myNum, X_ERROR,
+ "[drm] SISDRIScreenInit failed (DRI version = %d.%d.%d, "
+ "expected 3.1.x). Disabling DRI.\n",
+ major, minor, patch);
+ return FALSE;
+ }
+ }
pDRIInfo = DRICreateInfoRec();
if (pDRIInfo == NULL)
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/sunffb/sunffb.cpp b/xc/programs/Xserver/hw/xfree86/drivers/sunffb/sunffb.cpp
deleted file mode 100644
index 1ee144b56..000000000
--- a/xc/programs/Xserver/hw/xfree86/drivers/sunffb/sunffb.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/sunffb.cpp,v 1.3 2000/12/11 20:18:33 dawes Exp $
-.\" shorthand for double quote that works everywhere.
-.ds q \N'34'
-.TH FFB __drivermansuffix__ "Version 4.0.2" "XFree86"
-.SH NAME
-ffb \- SUNFFB video driver
-.SH SYNOPSIS
-.nf
-.B "Section \*qDevice\*q"
-.BI " Identifier \*q" devname \*q
-.B " Driver \*qsunffb\*q"
-\ \ ...
-.B EndSection
-.fi
-.SH DESCRIPTION
-.B ffb
-is an XFree86 driver for Sun Creator, Creator 3D and Elite 3D video cards.
-THIS MAN PAGE NEEDS TO BE FILLED IN.
-.SH SUPPORTED HARDWARE
-The
-.B ffb
-driver supports...
-.SH CONFIGURATION DETAILS
-Please refer to XF86Config(__filemansuffix__) for general configuration
-details. This section only covers configuration details specific to this
-driver.
-.SH "SEE ALSO"
-XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__)
-.SH AUTHORS
-Authors include: Jakub Jelinek <jakub@redhat.com>, David S. Miller <davem@redhat.com>, Michal Rehacek <majkl@iname.com>
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/sunleo/sunleo.cpp b/xc/programs/Xserver/hw/xfree86/drivers/sunleo/sunleo.cpp
deleted file mode 100644
index ee22b004d..000000000
--- a/xc/programs/Xserver/hw/xfree86/drivers/sunleo/sunleo.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunleo/sunleo.cpp,v 1.4 2000/12/11 20:18:34 dawes Exp $
-.\" shorthand for double quote that works everywhere.
-.ds q \N'34'
-.TH SUNLEO __drivermansuffix__ "Version 4.0.2" "XFree86"
-.SH NAME
-sunleo \- Leo video driver
-.SH SYNOPSIS
-.nf
-.B "Section \*qDevice\*q"
-.BI " Identifier \*q" devname \*q
-.B " Driver \*qsunleo\*q"
-\ \ ...
-.B EndSection
-.fi
-.SH DESCRIPTION
-.B leo
-is an XFree86 driver for Sun Leo (ZX) video cards.
-THIS MAN PAGE NEEDS TO BE FILLED IN.
-.SH SUPPORTED HARDWARE
-The
-.B leo
-driver supports...
-.SH CONFIGURATION DETAILS
-Please refer to XF86Config(__filemansuffix__) for general configuration
-details. This section only covers configuration details specific to this
-driver.
-.SH "SEE ALSO"
-XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__)
-.SH AUTHORS
-Authors include: Jakub Jelinek <jakub@redhat.com>
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/suntcx/suntcx.cpp b/xc/programs/Xserver/hw/xfree86/drivers/suntcx/suntcx.cpp
deleted file mode 100644
index 311f8aaf0..000000000
--- a/xc/programs/Xserver/hw/xfree86/drivers/suntcx/suntcx.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suntcx/suntcx.cpp,v 1.2 2000/12/11 20:18:35 dawes Exp $
-.\" shorthand for double quote that works everywhere.
-.ds q \N'34'
-.TH SUNTCX __drivermansuffix__ "Version 4.0.2" "XFree86"
-.SH NAME
-suntcx \- TCX video driver
-.SH SYNOPSIS
-.nf
-.B "Section \*qDevice\*q"
-.BI " Identifier \*q" devname \*q
-.B " Driver \*qsuntcx\*q"
-\ \ ...
-.B EndSection
-.fi
-.SH DESCRIPTION
-.B suntcx
-is an XFree86 driver for Sun TCX video cards.
-THIS MAN PAGE NEEDS TO BE FILLED IN.
-.SH SUPPORTED HARDWARE
-The
-.B suntcx
-driver supports...
-.SH CONFIGURATION DETAILS
-Please refer to XF86Config(__filemansuffix__) for general configuration
-details. This section only covers configuration details specific to this
-driver.
-.SH "SEE ALSO"
-XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__)
-.SH AUTHORS
-Authors include: Jakub Jelinek <jakub@redhat.com>
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/Imakefile b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/Imakefile
index dc98911b9..24087804c 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.19 2000/12/15 15:19:35 dawes Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/Imakefile,v 1.20 2001/01/24 00:06:31 dawes Exp $
XCOMM
XCOMM This is the Imakefile for the TDFX driver.
XCOMM
@@ -50,7 +50,6 @@ ObjectModuleTarget(tdfx,$(OBJS))
InstallObjectModule(tdfx,$(MODULEDIR),drivers)
#if !defined(XF86DriverSDK)
-CppManTarget(tdfx,)
InstallModuleManPage(tdfx)
#endif
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx.h b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx.h
index beee925a7..e9a9f4500 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx.h
@@ -5,7 +5,7 @@
Copyright: 1998,1999
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx.h,v 1.17 2000/12/15 15:19:35 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx.h,v 1.18 2000/12/20 01:30:46 mvojkovi Exp $ */
#ifndef _TDFX_H_
#define _TDFX_H_
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx.cpp b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx.man
index 483a12622..1dd66a7d1 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx.cpp
+++ b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx.man
@@ -1,7 +1,7 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx.cpp,v 1.6 2000/12/11 20:18:36 dawes Exp $
+.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx.man,v 1.2 2001/01/27 18:20:55 dawes Exp $
.\" shorthand for double quote that works everywhere.
.ds q \N'34'
-.TH TDFX __drivermansuffix__ "Version 4.0.2" "XFree86"
+.TH TDFX __drivermansuffix__ __vendorversion__
.SH NAME
tdfx \- 3Dfx video driver
.SH SYNOPSIS
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_dga.c b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_dga.c
index d97363b57..f52859e39 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_dga.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_dga.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_dga.c,v 1.3 2000/06/17 00:03:25 martin Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_dga.c,v 1.5 2001/01/13 00:06:29 mvojkovi Exp $ */
#include "xf86.h"
#include "xf86_OSproc.h"
@@ -32,13 +32,7 @@ DGAFunctionRec TDFX_DGAFuncs = {
TDFX_BlitTransRect
};
-/*
-We should allow you to change the depth, but the accel driver isn't
-ready to handle that yet. Also, we are currently taking the default
-visual and using it for the visual reported by DGA. It would be
-relatively easy to at least give DirectColor and TrueColor visuals
-instead of just the default
-*/
+
Bool
TDFXDGAInit(ScreenPtr pScreen)
{
@@ -47,22 +41,19 @@ TDFXDGAInit(ScreenPtr pScreen)
DisplayModePtr pMode, firstMode;
DGAModePtr modes=0, newmodes=0, currentMode;
int num=0;
- Bool oneMore;
pTDFX = TDFXPTR(pScrn);
pMode = firstMode = pScrn->modes;
while (pMode) {
newmodes = xrealloc(modes, (num+1)*sizeof(DGAModeRec));
- oneMore = FALSE;
+
if (!newmodes) {
xfree(modes);
return FALSE;
}
modes = newmodes;
-SECOND_PASS:
-
currentMode = modes+num;
num++;
currentMode->mode = pMode;
@@ -82,33 +73,21 @@ SECOND_PASS:
currentMode->visualClass = pScrn->defaultVisual;
currentMode->viewportWidth = pMode->HDisplay;
currentMode->viewportHeight = pMode->VDisplay;
- currentMode->xViewportStep = (3 - pTDFX->cpp);
+ currentMode->xViewportStep = 1;
currentMode->yViewportStep = 1;
currentMode->viewportFlags = DGA_FLIP_RETRACE;
- currentMode->offset = pTDFX->fbOffset;
+ currentMode->offset = 0;
currentMode->address = pTDFX->FbBase;
-
- if (oneMore) { /* first one is narrow width */
- currentMode->bytesPerScanline = ((pMode->HDisplay * pTDFX->cpp) + 3) & ~3L;
- currentMode->imageWidth = pMode->HDisplay;
- currentMode->imageHeight = pScrn->virtualY;
- 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 = ((pScrn->displayWidth * pTDFX->cpp) + 3) & ~3L;
- currentMode->imageWidth = pScrn->displayWidth;
- currentMode->imageHeight = pScrn->virtualY;
- 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;
- }
+ currentMode->bytesPerScanline = ((pScrn->displayWidth*pTDFX->cpp)+3) & ~3L;
+ currentMode->imageWidth = pScrn->displayWidth;
+ currentMode->imageHeight = pTDFX->pixmapCacheLinesMax;
+ 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;
pMode = pMode->next;
if (pMode == firstMode) break;
@@ -129,19 +108,17 @@ TDFX_SetMode(ScrnInfoPtr pScrn, DGAModePtr pMode)
if (!pMode) { /* restore the original mode */
/* put the ScreenParameters back */
- if (pTDFX->DGAactive) {
- TDFXSwitchMode(index, OldModes[index], 0);
- TDFXAdjustFrame(pScrn->pScreen->myNum, 0, 0, 0);
- pTDFX->DGAactive = FALSE;
+ if(pTDFX->DGAactive) {
+ TDFXSwitchMode(index, OldModes[index], 0);
+ TDFXAdjustFrame(pScrn->pScreen->myNum, 0, 0, 0);
+ pTDFX->DGAactive = FALSE;
}
} else {
- /* save the old ScreenParameters */
- if (!pTDFX->DGAactive) {
- OldModes[index] = pScrn->currentMode;
- pTDFX->DGAactive = TRUE;
+ if (!pTDFX->DGAactive) { /* save the old parameters */
+ OldModes[index] = pScrn->currentMode;
+ pTDFX->DGAactive = TRUE;
}
- pScrn->displayWidth = pMode->bytesPerScanline / pTDFX->cpp;
TDFXSwitchMode(index, pMode->mode, 0);
}
@@ -164,10 +141,11 @@ TDFX_SetViewport(ScrnInfoPtr pScrn, int x, int y, int flags)
TDFXAdjustFrame(pScrn->pScreen->myNum, x, y, flags);
- while (hwp->readST01(hwp) & 0x08);
- while (!(hwp->readST01(hwp) & 0x08));
+ /* fixme */
+ while(hwp->readST01(hwp) & 0x08);
+ while(!(hwp->readST01(hwp) & 0x08));
- pTDFX->DGAViewportStatus = 0;
+ pTDFX->DGAViewportStatus = 0;
}
static void
@@ -223,9 +201,9 @@ TDFX_OpenFramebuffer(
TDFXPtr pTDFX = TDFXPTR(pScrn);
*name = NULL; /* no special device */
- *mem = (unsigned char*)pTDFX->LinearAddr[0];
+ *mem = (unsigned char*)pTDFX->LinearAddr[0] + pTDFX->fbOffset;
*size = pTDFX->FbMapSize;
- *offset = 0;
+ *offset = /* pTDFX->fbOffset */ 0 ; /* DGA is broken */
*flags = DGA_NEED_ROOT;
return TRUE;
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_dri.c b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_dri.c
index 5d160998d..a5b9b38de 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_dri.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_dri.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_dri.c,v 1.14 2000/12/07 20:26:23 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_dri.c,v 1.17 2000/12/21 12:22:57 alanh Exp $ */
#include "xf86.h"
#include "xf86_OSproc.h"
@@ -530,12 +530,6 @@ TDFXDRIInitBuffers(WindowPtr pWin, RegionPtr prgn, CARD32 index)
pTDFX->AccelInfoRec->NeedToSync = TRUE;
}
-/*
- This routine is a modified form of XAADoBitBlt with the calls to
- ScreenToScreenBitBlt built in. My routine has the prgnSrc as source
- instead of destination. My origin is upside down so the ydir cases
- are reversed.
-*/
static void
TDFXDRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg,
RegionPtr prgnSrc, CARD32 index)
@@ -543,141 +537,37 @@ TDFXDRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg,
ScreenPtr pScreen = pParent->drawable.pScreen;
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
TDFXPtr pTDFX = TDFXPTR(pScrn);
- int nbox;
- BoxPtr pbox, pboxTmp, pboxNext, pboxBase, pboxNew1, pboxNew2;
- DDXPointPtr pptTmp, pptNew1, pptNew2;
- int xdir, ydir;
- int dx, dy, x, y, w, h;
- DDXPointPtr pptSrc;
-
- pbox = REGION_RECTS(prgnSrc);
- nbox = REGION_NUM_RECTS(prgnSrc);
- pboxNew1 = 0;
- pptNew1 = 0;
- pboxNew2 = 0;
- pboxNew2 = 0;
- pptSrc = &ptOldOrg;
+ int dx, dy, xdir, ydir, i, x, y, nbox;
+ BoxPtr pbox;
dx = pParent->drawable.x - ptOldOrg.x;
dy = pParent->drawable.y - ptOldOrg.y;
- /* If the copy will overlap in Y, reverse the order */
- if (dy>0) {
- ydir = -1;
-
- if (nbox>1) {
- /* Keep ordering in each band, reverse order of bands */
- pboxNew1 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec)*nbox);
- if (!pboxNew1) return;
- pptNew1 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec)*nbox);
- if (!pptNew1) {
- DEALLOCATE_LOCAL(pboxNew1);
- return;
- }
- pboxBase = pboxNext = pbox+nbox-1;
- while (pboxBase >= pbox) {
- while ((pboxNext >= pbox) && (pboxBase->y1 == pboxNext->y1))
- pboxNext--;
- pboxTmp = pboxNext+1;
- pptTmp = pptSrc + (pboxTmp - pbox);
- while (pboxTmp <= pboxBase) {
- *pboxNew1++ = *pboxTmp++;
- *pptNew1++ = *pptTmp++;
- }
- pboxBase = pboxNext;
- }
- pboxNew1 -= nbox;
- pbox = pboxNew1;
- pptNew1 -= nbox;
- pptSrc = pptNew1;
- }
- } else {
- /* No changes required */
- ydir = 1;
- }
+ DRIMoveBuffersHelper(pScreen, dx, dy, &xdir, &ydir, prgnSrc);
- /* If the regions will overlap in X, reverse the order */
- if (dx>0) {
- xdir = -1;
-
- if (nbox > 1) {
- /*reverse orderof rects in each band */
- pboxNew2 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec)*nbox);
- pptNew2 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec)*nbox);
- if (!pboxNew2 || !pptNew2) {
- if (pptNew2) DEALLOCATE_LOCAL(pptNew2);
- if (pboxNew2) DEALLOCATE_LOCAL(pboxNew2);
- if (pboxNew1) {
- DEALLOCATE_LOCAL(pptNew1);
- DEALLOCATE_LOCAL(pboxNew1);
- }
- return;
- }
- pboxBase = pboxNext = pbox;
- while (pboxBase < pbox+nbox) {
- while ((pboxNext < pbox+nbox) && (pboxNext->y1 == pboxBase->y1))
- pboxNext++;
- pboxTmp = pboxNext;
- pptTmp = pptSrc + (pboxTmp - pbox);
- while (pboxTmp != pboxBase) {
- *pboxNew2++ = *--pboxTmp;
- *pptNew2++ = *--pptTmp;
- }
- pboxBase = pboxNext;
- }
- pboxNew2 -= nbox;
- pbox = pboxNew2;
- pptNew2 -= nbox;
- pptSrc = pptNew2;
- }
- } else {
- /* No changes are needed */
- xdir = 1;
- }
+ pbox = REGION_RECTS(prgnSrc);
+ nbox = REGION_NUM_RECTS(prgnSrc);
- TDFXSetupForScreenToScreenCopy(pScrn, xdir, ydir, GXcopy, -1, -1);
- while (nbox--) {
- w=pbox->x2-pbox->x1+1;
- h=pbox->y2-pbox->y1+1;
-
- /* Unlike XAA, we don't get handed clipped values */
- if (pbox->x1+dx<0) {
- x=-dx;
- w-=x-pbox->x1;
- } else {
- if (pbox->x1+dx+w>pScrn->virtualX) {
- x=pScrn->virtualX-dx-w-1;
- w-=pbox->x1-x;
- } else x=pbox->x1;
- }
- if (pbox->y1+dy<0) {
- y=-dy;
- h-=y-pbox->y1;
- } else {
- if (pbox->y1+dy+h>pScrn->virtualY) {
- y=pScrn->virtualY-dy-h-1;
- h-=pbox->y1-y;
- } else y=pbox->y1;
- }
- if (w<0 || h<0 || x>pScrn->virtualX || y>pScrn->virtualY) continue;
+ TDFXSetupForScreenToScreenCopy(pScrn, xdir, ydir, GXcopy, ~0, -1);
- TDFXSelectBuffer(pTDFX, TDFX_BACK);
- TDFXSubsequentScreenToScreenCopy(pScrn, x, y, x+dx, y+dy, w, h);
- TDFXSelectBuffer(pTDFX, TDFX_DEPTH);
- TDFXSubsequentScreenToScreenCopy(pScrn, x, y, x+dx, y+dy, w, h);
- pbox++;
+ TDFXSelectBuffer(pTDFX, TDFX_BACK);
+ for(i = 0; i < nbox; i++) {
+ x = pbox[i].x1;
+ y = pbox[i].y1;
+ TDFXSubsequentScreenToScreenCopy(pScrn, x, y, x+dx, y+dy,
+ pbox[i].x2 - x, pbox[i].y2 - y);
}
- TDFXSelectBuffer(pTDFX, TDFX_FRONT);
- if (pboxNew2) {
- DEALLOCATE_LOCAL(pptNew2);
- DEALLOCATE_LOCAL(pboxNew2);
- }
- if (pboxNew1) {
- DEALLOCATE_LOCAL(pptNew1);
- DEALLOCATE_LOCAL(pboxNew1);
+ TDFXSelectBuffer(pTDFX, TDFX_DEPTH);
+ for(i = 0; i < nbox; i++) {
+ x = pbox[i].x1;
+ y = pbox[i].y1;
+ TDFXSubsequentScreenToScreenCopy(pScrn, x, y, x+dx, y+dy,
+ pbox[i].x2 - x, pbox[i].y2 - y);
}
+ TDFXSelectBuffer(pTDFX, TDFX_FRONT);
+
pTDFX->AccelInfoRec->NeedToSync = TRUE;
}
@@ -711,14 +601,13 @@ TDFXDRICloseFullScreen(ScreenPtr pScreen)
return TRUE;
}
-
static void
TDFXDRITransitionTo2d(ScreenPtr pScreen)
{
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
TDFXPtr pTDFX = TDFXPTR(pScrn);
- xf86FreeOffscreenArea(pTDFX->reservedArea);
+ xf86FreeOffscreenArea(pTDFX->reservedArea);
}
@@ -729,19 +618,11 @@ TDFXDRITransitionTo3d(ScreenPtr pScreen)
TDFXPtr pTDFX = TDFXPTR(pScrn);
FBAreaPtr pArea;
- if(pTDFX->overlayBuffer) {
- xf86FreeOffscreenLinear(pTDFX->overlayBuffer);
- pTDFX->overlayBuffer = NULL;
- }
-
- if(pTDFX->textureBuffer) {
- xf86FreeOffscreenArea(pTDFX->textureBuffer);
- pTDFX->textureBuffer = NULL;
- }
+ if(pTDFX->videoScratch)
+ xf86FreeOffscreenLinear(pTDFX->videoScratch);
xf86PurgeUnlockedOffscreenAreas(pScreen);
-
- /* this is an ugly hack! isnt there a resize? */
+
pArea = xf86AllocateOffscreenArea(pScreen, pScrn->displayWidth,
pTDFX->pixmapCacheLinesMin,
pScrn->displayWidth, NULL, NULL, NULL);
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 e3c72918d..bf0b131b5 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.47 2000/12/02 15:30:57 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_driver.c,v 1.64 2001/02/15 18:01:43 eich Exp $ */
/*
* Authors:
@@ -78,11 +78,9 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
/* !!! These need to be checked !!! */
#if 0
-#ifdef XFreeXDGA
#define _XF86DGA_SERVER_
#include "extensions/xf86dgastr.h"
#endif
-#endif
/* The driver's own header file: */
@@ -98,10 +96,6 @@ 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);
@@ -138,11 +132,9 @@ static int TDFXValidMode(int scrnIndex, DisplayModePtr mode, Bool
static void TDFXBlockHandler(int, pointer, pointer, pointer);
-#ifdef DPMSExtension
/* Switch to various Display Power Management System levels */
static void TDFXDisplayPowerManagementSet(ScrnInfoPtr pScrn,
int PowerManagermentMode, int flags);
-#endif
#define PCI_SUBDEVICE_ID_VOODOO3_2000 0x0036
#define PCI_SUBDEVICE_ID_VOODOO3_3000 0x003a
@@ -150,9 +142,6 @@ static void TDFXDisplayPowerManagementSet(ScrnInfoPtr pScrn,
DriverRec TDFX = {
TDFX_VERSION,
TDFX_DRIVER_NAME,
-#if 0
- "Accelerated driver for 3dfx cards",
-#endif
TDFXIdentify,
TDFXProbe,
TDFXAvailableOptions,
@@ -233,9 +222,7 @@ static const char *ddcSymbols[] = {
#ifdef XFree86LOADER
static const char *fbSymbols[] = {
"fbScreenInit",
-#ifdef RENDER
"fbPictureInit",
-#endif
NULL
};
@@ -717,11 +704,30 @@ TDFXPreInit(ScrnInfoPtr pScrn, int flags)
TDFXFreeRec(pScrn);
return FALSE;
}
+ /*
+ * We don't need VGA resources during OPERATING state. However I'm
+ * not sure if they are disabled.
+ */
+ xf86SetOperatingState(RES_SHARED_VGA, pTDFX->pEnt->index, ResUnusedOpr);
+#if 1
+
+ /* Is VGA memory disabled during OPERATING state? */
+ xf86SetOperatingState(resVgaMemShared, pTDFX->pEnt->index, ResDisableOpr);
+#else
+ pScrn->racMemFlags = RAC_FB | RAC_COLORMAP | RAC_CURSOR | RAC_VIEWPORT;
+#endif
+
+#if 0
+ /*
+ * I'm sure we don't need to set these. All resources
+ * for these operations are exclusive.
+ */
if (pTDFX->usePIO)
pScrn->racIoFlags = RAC_FB | RAC_COLORMAP | RAC_CURSOR | RAC_VIEWPORT;
else
pScrn->racMemFlags = RAC_FB | RAC_COLORMAP | RAC_CURSOR | RAC_VIEWPORT;
+#endif
/* Set pScrn->monitor */
pScrn->monitor = pScrn->confScreen->monitor;
@@ -948,10 +954,7 @@ TDFXPreInit(ScrnInfoPtr pScrn, int flags)
TDFXFreeRec(pScrn);
return FALSE;
}
- xf86LoaderReqSymbols("fbScreenInit", NULL);
-#ifdef RENDER
- xf86LoaderReqSymbols("fbPictureInit", NULL);
-#endif
+ xf86LoaderReqSymbols("fbScreenInit", "fbPictureInit", NULL);
if (!xf86ReturnOptValBool(TDFXOptions, OPTION_NOACCEL, FALSE)) {
if (!xf86LoadSubModule(pScrn, "xaa")) {
@@ -984,6 +987,13 @@ TDFXPreInit(ScrnInfoPtr pScrn, int flags)
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "video key default 0x%x\n", pTDFX->videoKey = 0x1E);
}
+ if (xf86GetOptValInteger(TDFXOptions, OPTION_VIDEO_KEY, &(pTDFX->videoKey))) {
+ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "video key set to 0x%x\n",
+ pTDFX->videoKey);
+ } else
+ pTDFX->videoKey = 0x1E;
+
+
if (!xf86ReturnOptValBool(TDFXOptions, OPTION_SW_CURSOR, FALSE)) {
if (!xf86LoadSubModule(pScrn, "ramdac")) {
TDFXFreeRec(pScrn);
@@ -1671,8 +1681,10 @@ calcBufferSize(int xres, int yres, Bool tiled, int cpp)
} /* calcBufferSize */
static void allocateMemory(ScrnInfoPtr pScrn) {
- TDFXPtr pTDFX = TDFXPTR(pScrn);
- int memRemaining, fbSize, cursorSize, fifoSize, screenSizeInTiles;
+ TDFXPtr pTDFX;
+ int memRemaining, fifoSize, screenSizeInTiles;
+
+ pTDFX = TDFXPTR(pScrn);
if (pTDFX->cpp!=3) {
screenSizeInTiles=calcBufferSize(pScrn->virtualX, pScrn->virtualY,
@@ -1713,29 +1725,26 @@ static void allocateMemory(ScrnInfoPtr pScrn) {
}
/* Give the cmd fifo at least */
/* CMDFIFO_PAGES pages, but no more than */
- /* 255. */
+ /* 255. We give 4096 bytes to the cursor */
fifoSize = ((255 <= CMDFIFO_PAGES) ? 255 : CMDFIFO_PAGES) << 12;
- fbSize = (pScrn->virtualY + pTDFX->pixmapCacheLinesMin) * pTDFX->stride;
- cursorSize = 4096;
- /* We give 4096 bytes to the cursor, fifoSize to the */
- /* FIFO, and everything to textures. */
- /* Bump everything by 64k to move it past VGA memory */
- pTDFX->cursorOffset = 64*1024;
- pTDFX->fifoOffset = pTDFX->cursorOffset + cursorSize;
+ pTDFX->cursorOffset = 0;
+ pTDFX->fifoOffset = 4096;
pTDFX->fifoSize = fifoSize;
/* Now, place the front buffer, forcing */
/* it to be on a page boundary too, just */
/* for giggles. */
- pTDFX->fbOffset = (pTDFX->fifoOffset + pTDFX->fifoSize) &~ 0xFFF;
- pTDFX->texOffset = pTDFX->fbOffset + fbSize;
+ pTDFX->fbOffset = pTDFX->fifoOffset + pTDFX->fifoSize;
+ pTDFX->texOffset = pTDFX->fbOffset +
+ ((pScrn->virtualY+pTDFX->pixmapCacheLinesMin)*pTDFX->stride);
pTDFX->texSize = pTDFX->backOffset - pTDFX->texOffset;
-
- if (pTDFX->texSize <= 0) {
+ pTDFX->cursorOffset = 0;
+ if (pTDFX->texSize < 0) {
pTDFX->backOffset = -1;
pTDFX->depthOffset = -1;
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "No Texture Memory available, disabling DRI\n");
} else {
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Texture Memory %0.02f MB\n", pTDFX->texSize / 1024.0 / 1024.0);
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Textures Memory %0.02f MB\n",
+ (float)pTDFX->texSize/1024.0/1024.0);
}
#if 1
@@ -1756,6 +1765,11 @@ static void allocateMemory(ScrnInfoPtr pScrn) {
pTDFX->texOffset,
pTDFX->texOffset + pTDFX->texSize);
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "Front Buffer Offset: [0x%08X, 0x%08X)\n",
+ pTDFX->fbOffset,
+ pTDFX->fbOffset +
+ (pScrn->virtualY+pTDFX->pixmapCacheLinesMin)*pTDFX->stride);
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"BackOffset: [0x%08X, 0x%08X)\n",
pTDFX->backOffset,
pTDFX->backOffset + screenSizeInTiles);
@@ -1772,7 +1786,6 @@ TDFXScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) {
vgaHWPtr hwp;
TDFXPtr pTDFX;
VisualPtr visual;
- int maxy;
BoxRec MemBox;
TDFXTRACE("TDFXScreenInit start\n");
@@ -1787,9 +1800,10 @@ TDFXScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) {
vgaHWGetIOBase(hwp);
if (!vgaHWMapMem(pScrn)) return FALSE;
- /* we want at least enough pixmap cache to do DVD */
pTDFX->stride = pScrn->displayWidth*pTDFX->cpp;
- pTDFX->pixmapCacheLinesMin = ((720*480*2) + pTDFX->stride - 1) / pTDFX->stride;
+
+ /* enough to do DVD */
+ pTDFX->pixmapCacheLinesMin = ((720*480*2) + pTDFX->stride - 1)/pTDFX->stride;
allocateMemory(pScrn);
@@ -1812,30 +1826,29 @@ TDFXScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) {
return FALSE;
}
- pTDFX->pixmapCacheLinesMax = (pTDFX->backOffset - pTDFX->fbOffset) / pTDFX->stride;
+ pTDFX->pixmapCacheLinesMax = (pTDFX->backOffset - pTDFX->fbOffset) /
+ pTDFX->stride;
+
if(pTDFX->ChipType < PCI_CHIP_VOODOO5) {
- if (pTDFX->pixmapCacheLinesMax > 2048)
- pTDFX->pixmapCacheLinesMax = 2048;
+ if(pTDFX->pixmapCacheLinesMax > 2048)
+ pTDFX->pixmapCacheLinesMax = 2048;
} else {
- if (pTDFX->pixmapCacheLinesMax > 4095)
- pTDFX->pixmapCacheLinesMax = 4095;
+ /* MaxClip seems to have only 12 bits => 0->4095 */
+ if(pTDFX->pixmapCacheLinesMax > 4095)
+ pTDFX->pixmapCacheLinesMax = 4095;
}
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "%d pixmap cache lines for 2D/video when 3D inactive\n",
- pTDFX->pixmapCacheLinesMax);
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "%d pixmap cache lines for 2D/video when 3D active\n",
- pTDFX->pixmapCacheLinesMin);
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "%i lines of offscreen memory available for 2D and video\n",
+ pTDFX->pixmapCacheLinesMax);
- /* region the whole memory (framebuffer+pixmapcache) and let
- * xf86InitFBManager do the visible region subtraction
- */
- MemBox.x1 = 0;
+
MemBox.y1 = 0;
+ MemBox.x1 = 0;
MemBox.x2 = pScrn->displayWidth;
MemBox.y2 = pTDFX->pixmapCacheLinesMax;
- pTDFX->maxClip = (MemBox.x2) | (MemBox.y2 << 16);
+
+ pTDFX->maxClip = MemBox.x2 | (MemBox.y2 << 16);
TDFXSave(pScrn);
if (!TDFXModeInit(pScrn, pScrn->currentMode)) return FALSE;
@@ -1874,9 +1887,7 @@ 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,
@@ -1939,9 +1950,7 @@ TDFXScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) {
TDFXAdjustFrame(scrnIndex, 0, 0, 0);
-#ifdef DPMSExtension
xf86DPMSInit(pScreen, TDFXDisplayPowerManagementSet, 0);
-#endif
#ifdef XF86DRI
if (!pTDFX->NoAccel) {
@@ -2001,6 +2010,8 @@ TDFXAdjustFrame(int scrnIndex, int x, int y, int flags) {
y += pScrn->virtualY - 1;
tdfxReg = &pTDFX->ModeReg;
+ if(pTDFX->ShowCache && y && pScrn->vtSema)
+ y += pScrn->virtualY - 1;
tdfxReg->startaddr = pTDFX->fbOffset+y*pTDFX->stride+(x*pTDFX->cpp);
TDFXTRACE("TDFXAdjustFrame to x=%d y=%d offset=%d\n", x, y, tdfxReg->startaddr);
pTDFX->writeLong(pTDFX, VIDDESKTOPSTARTADDR, tdfxReg->startaddr);
@@ -2106,7 +2117,13 @@ TDFXCloseScreen(int scrnIndex, ScreenPtr pScreen)
xf86XVFreeVideoAdaptorRec(pTDFX->textureAdaptor);
pTDFX->textureAdaptor = NULL;
}
-
+
+ if (pTDFX->adaptor) {
+ xfree(pTDFX->adaptor->pPortPrivates[0].ptr);
+ xf86XVFreeVideoAdaptorRec(pTDFX->adaptor);
+ pTDFX->adaptor = NULL;
+ }
+
pScrn->vtSema=FALSE;
pScreen->BlockHandler = pTDFX->BlockHandler;
@@ -2195,7 +2212,6 @@ TDFXBlockHandler(int i, pointer blockData, pointer pTimeout, pointer pReadmask)
}
}
-#ifdef DPMSExtension
static void
TDFXDisplayPowerManagementSet(ScrnInfoPtr pScrn, int PowerManagementMode,
int flags) {
@@ -2227,5 +2243,3 @@ TDFXDisplayPowerManagementSet(ScrnInfoPtr pScrn, int PowerManagementMode,
dacmode|=state;
pTDFX->writeLong(pTDFX, DACMODE, dacmode);
}
-#endif
-
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_video.c b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_video.c
index d63592085..0c9554d5b 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_video.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_video.c
@@ -1,9 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_video.c,v 1.2 2000/12/02 15:30:57 tsi Exp $ */
-
-#ifndef XvExtension
-void TDFXInitVideo(ScreenPtr pScreen) {}
-void TDFXCloseVideo(ScreenPtr pScreen) {}
-#else
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_video.c,v 1.9 2001/01/25 02:20:34 mvojkovi Exp $ */
#include "xf86.h"
#include "tdfx.h"
@@ -12,79 +7,101 @@ void TDFXCloseVideo(ScreenPtr pScreen) {}
#include "Xv.h"
#include "fourcc.h"
-static Atom xvColorKey, xvFilterQuality;
+#define OFF_DELAY 250 /* milliseconds */
+#define FREE_DELAY 15000
-/* These should move into tdfxdefs.h with better names */
-#define YUV_Y_BASE 0xC00000
-#define YUV_U_BASE 0xD00000
-#define YUV_V_BASE 0xE00000
+#define OFF_TIMER 0x01
+#define FREE_TIMER 0x02
+#define CLIENT_VIDEO_ON 0x04
-#define SST_2D_FORMAT_YUYV 0x8
-#define SST_2D_FORMAT_UYVY 0x9
+#define TIMER_MASK (OFF_TIMER | FREE_TIMER)
-#define YUVBASEADDR 0x80100
-#define YUVSTRIDE 0x80104
-#define VIDPROCCFGMASK 0xa2e3eb6c
+#define VIDPROCCFGMASK 0xa2e3eb6c
#define OFF_DELAY 250 /* milliseconds */
#define FREE_DELAY 15000
-#define OFF_TIMER 0x01
-#define FREE_TIMER 0x02
-#define CLIENT_VIDEO_ON 0x04
-#define TIMER_MASK (OFF_TIMER | FREE_TIMER)
+static XF86VideoAdaptorPtr TDFXSetupImageVideo(ScreenPtr);
+static int TDFXSetPortAttribute(ScrnInfoPtr, Atom, INT32, pointer);
+static int TDFXGetPortAttribute(ScrnInfoPtr, Atom ,INT32 *, pointer);
+static void TDFXStopVideo(ScrnInfoPtr, pointer, Bool);
+static void TDFXQueryBestSize(ScrnInfoPtr, Bool, short, short, short, short,
+ unsigned int *, unsigned int *, pointer);
+static int TDFXPutImage(ScrnInfoPtr, short, short, short, short, short,
+ short, short, short, int, unsigned char*, short,
+ short, Bool, RegionPtr, pointer);
+static int TDFXQueryImageAttributes(ScrnInfoPtr, int, unsigned short *,
+ unsigned short *, int *, int *);
-#define TDFX_MAX_OVERLAY_PORTS 1
-#define TDFX_MAX_TEXTURE_PORTS 32
-/* Doesn't matter what screen we use */
-#define DummyScreen screenInfo.screens[0]
+static void TDFXResetVideo(ScrnInfoPtr);
+
+static void TDFXVideoTimerCallback(ScrnInfoPtr pScrn, Time time);
+
-/* Needed for attribute atoms */
#define MAKE_ATOM(a) MakeAtom(a, sizeof(a) - 1, TRUE)
-/*
- * PROTOTYPES
- */
+static Atom xvColorKey, xvFilterQuality;
-void TDFXInitVideo(ScreenPtr pScreen);
-void TDFXCloseVideo(ScreenPtr pScreen);
-static FBAreaPtr TDFXAllocateMemoryArea (ScrnInfoPtr pScrn, FBAreaPtr area, int width, int height);
-static FBLinearPtr TDFXAllocateMemoryLinear (ScrnInfoPtr pScrn, FBLinearPtr linear, int size);
-static void TDFXVideoTimerCallback(ScrnInfoPtr pScrn, Time time);
+typedef struct {
+ RegionRec clip;
+ CARD32 colorKey;
+ int filterQuality;
+ CARD32 videoStatus;
+ Time offTime;
+ Time freeTime;
+} TDFXPortPrivRec, *TDFXPortPrivPtr;
+
+void TDFXInitVideo(ScreenPtr pScreen)
+{
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ TDFXPtr pTDFX = TDFXPTR(pScrn);
+ XF86VideoAdaptorPtr *adaptors, *newAdaptors = NULL;
+ XF86VideoAdaptorPtr newAdaptor = NULL;
+ int num_adaptors;
-static XF86VideoAdaptorPtr TDFXSetupImageVideoTexture(ScreenPtr);
-static int TDFXSetPortAttributeTexture(ScrnInfoPtr, Atom, INT32, pointer);
-static int TDFXGetPortAttributeTexture(ScrnInfoPtr, Atom ,INT32 *, pointer);
-static int TDFXPutImageTexture(ScrnInfoPtr, short, short, short, short, short, short, short, short, int, unsigned char*, short, short, Bool, RegionPtr, pointer);
-static void TDFXStopVideoTexture(ScrnInfoPtr, pointer, Bool);
+ if(pTDFX->AccelInfoRec && pTDFX->AccelInfoRec->FillSolidRects)
+ newAdaptor = TDFXSetupImageVideo(pScreen);
-static XF86VideoAdaptorPtr TDFXSetupImageVideoOverlay(ScreenPtr);
-static int TDFXSetPortAttributeOverlay(ScrnInfoPtr, Atom, INT32, pointer);
-static int TDFXGetPortAttributeOverlay(ScrnInfoPtr, Atom ,INT32 *, pointer);
-static int TDFXPutImageOverlay(ScrnInfoPtr, short, short, short, short, short, short, short, short, int, unsigned char*, short, short, Bool, RegionPtr, pointer);
-static void TDFXStopVideoOverlay(ScrnInfoPtr, pointer, Bool);
-static void TDFXResetVideoOverlay(ScrnInfoPtr);
+ num_adaptors = xf86XVListGenericAdaptors(pScrn, &adaptors);
-static void TDFXQueryBestSize(ScrnInfoPtr, Bool, short, short, short, short, unsigned int *, unsigned int *, pointer);
-static int TDFXQueryImageAttributes(ScrnInfoPtr, int, unsigned short *, unsigned short *, int *, int *);
+ if(newAdaptor) {
+ if(!num_adaptors) {
+ num_adaptors = 1;
+ adaptors = &newAdaptor;
+ } else {
+ newAdaptors = /* need to free this someplace */
+ xalloc((num_adaptors + 1) * sizeof(XF86VideoAdaptorPtr*));
+ if(newAdaptors) {
+ memcpy(newAdaptors, adaptors, num_adaptors *
+ sizeof(XF86VideoAdaptorPtr));
+ newAdaptors[num_adaptors] = newAdaptor;
+ adaptors = newAdaptors;
+ num_adaptors++;
+ }
+ }
+ }
-/*
- * ADAPTOR INFORMATION
- */
+ if(num_adaptors)
+ xf86XVScreenInit(pScreen, adaptors, num_adaptors);
-static XF86VideoEncodingRec OverlayEncoding[] =
-{
- { 0, "XV_IMAGE", 2048, 2048, {1, 1} }
-};
+ if(newAdaptors)
+ xfree(newAdaptors);
+}
-static XF86VideoEncodingRec TextureEncoding[] =
+/* client libraries expect an encoding */
+static XF86VideoEncodingRec DummyEncoding =
{
- { 0, "XV_IMAGE", 1024, 1024, {1, 1} }
+ 0,
+ "XV_IMAGE",
+ 2048, 2048,
+ {1, 1}
};
-static XF86VideoFormatRec OverlayFormats[] =
+#define NUM_FORMATS 12
+
+static XF86VideoFormatRec Formats[NUM_FORMATS] =
{
{8, TrueColor}, {8, DirectColor}, {8, PseudoColor},
{8, GrayScale}, {8, StaticGray}, {8, StaticColor},
@@ -92,93 +109,37 @@ static XF86VideoFormatRec OverlayFormats[] =
{15, DirectColor}, {16, DirectColor}, {24, DirectColor}
};
-static XF86VideoFormatRec TextureFormats[] =
-{
- {15, TrueColor}, {16, TrueColor}, {24, TrueColor}
-};
-static XF86AttributeRec OverlayAttributes[] =
-{
- {XvSettable | XvGettable, 0, (1 << 24) - 1, "XV_COLORKEY"},
- {XvSettable | XvGettable, 0, 1, "XV_FILTER_QUALITY"}
-};
+#define NUM_ATTRIBUTES 2
-static XF86AttributeRec TextureAttributes[] =
+static XF86AttributeRec Attributes[NUM_ATTRIBUTES] =
{
{XvSettable | XvGettable, 0, (1 << 24) - 1, "XV_COLORKEY"},
{XvSettable | XvGettable, 0, 1, "XV_FILTER_QUALITY"}
};
-static XF86ImageRec OverlayImages[] =
-{
- XVIMAGE_YUY2, XVIMAGE_UYVY, XVIMAGE_YV12, XVIMAGE_I420
-};
+#define NUM_IMAGES 4
-static XF86ImageRec TextureImages[] =
+static XF86ImageRec Images[NUM_IMAGES] =
{
- XVIMAGE_YV12, XVIMAGE_I420
+ XVIMAGE_YUY2,
+ XVIMAGE_UYVY,
+ XVIMAGE_YV12,
+ XVIMAGE_I420
};
-/*
- * COMMON SETUP FUNCTIONS
- */
-
-void TDFXInitVideo(ScreenPtr pScreen)
+static void
+TDFXResetVideo(ScrnInfoPtr pScrn)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- XF86VideoAdaptorPtr *adaptors, *newAdaptors = NULL;
- XF86VideoAdaptorPtr newOverlayAdaptor = NULL;
- XF86VideoAdaptorPtr newTextureAdaptor = NULL;
TDFXPtr pTDFX = TDFXPTR(pScrn);
- int num_adaptors;
-
- /* The hardware can't convert YUV->8 bit color */
- if(pTDFX->cpp == 1)
- return;
-
- /* Start with the generic adaptors */
- num_adaptors = xf86XVListGenericAdaptors(pScrn, &adaptors);
-
- /* Overlay adaptor */
- if(pTDFX->AccelInfoRec && pTDFX->AccelInfoRec->FillSolidRects)
- newOverlayAdaptor = TDFXSetupImageVideoOverlay(pScreen);
-
- /* Texture adaptor */
- if(pTDFX->AccelInfoRec && pTDFX->AccelInfoRec->FillSolidRects)
- newTextureAdaptor = TDFXSetupImageVideoTexture(pScreen);
-
- /* Add the overlay adaptor to the list */
- if(newOverlayAdaptor) {
- newAdaptors = xalloc((num_adaptors + 1) * sizeof(XF86VideoAdaptorPtr*));
- if(newAdaptors) {
- if (num_adaptors) memcpy(newAdaptors, adaptors, num_adaptors * sizeof(XF86VideoAdaptorPtr));
- newAdaptors[num_adaptors] = newOverlayAdaptor;
- adaptors = newAdaptors; /* FIXME: leak? */
- num_adaptors++;
- }
- }
-
- /* Add the texture adaptor to the list */
- if(newTextureAdaptor) {
- newAdaptors = xalloc((num_adaptors + 1) * sizeof(XF86VideoAdaptorPtr*));
- if(newAdaptors) {
- if (num_adaptors) memcpy(newAdaptors, adaptors, num_adaptors * sizeof(XF86VideoAdaptorPtr));
- newAdaptors[num_adaptors] = newTextureAdaptor;
- adaptors = newAdaptors; /* FIXME: leak? */
- num_adaptors++;
- }
- }
-
- if(num_adaptors)
- xf86XVScreenInit(pScreen, adaptors, num_adaptors);
-
- if(newAdaptors)
- xfree(newAdaptors);
-}
-
+ TDFXPortPrivPtr pPriv = pTDFX->adaptor->pPortPrivates[0].ptr;
-void TDFXCloseVideo (ScreenPtr pScreen)
-{
+ /* reset the video */
+ pTDFX->ModeReg.vidcfg &= ~VIDPROCCFGMASK;
+ pTDFX->writeLong(pTDFX, VIDPROCCFG, pTDFX->ModeReg.vidcfg);
+ pTDFX->writeLong(pTDFX, RGBMAXDELTA, 0x0080808);
+ pTDFX->writeLong(pTDFX, VIDCHROMAMIN, pPriv->colorKey);
+ pTDFX->writeLong(pTDFX, VIDCHROMAMAX, pPriv->colorKey);
}
@@ -188,23 +149,21 @@ TDFXAllocAdaptor(ScrnInfoPtr pScrn, int numberPorts)
XF86VideoAdaptorPtr adapt;
TDFXPtr pTDFX = TDFXPTR(pScrn);
TDFXPortPrivPtr pPriv;
- int i;
if(!(adapt = xf86XVAllocateVideoAdaptorRec(pScrn)))
- return NULL;
+ return NULL;
- if(!(pPriv = xcalloc(1, sizeof(TDFXPortPrivRec) + numberPorts * sizeof(DevUnion))))
+ if(!(pPriv = xcalloc(1, sizeof(TDFXPortPrivRec) + sizeof(DevUnion))))
{
- xfree(adapt);
- return NULL;
+ xfree(adapt);
+ return NULL;
}
adapt->pPortPrivates = (DevUnion*)(&pPriv[1]);
- for(i = 0; i < numberPorts; i++)
- adapt->pPortPrivates[i].val = i;
+ adapt->pPortPrivates[0].ptr = (pointer)pPriv;
- xvColorKey = MAKE_ATOM("XV_COLORKEY"); /* FIXME: twice, leak */
- xvFilterQuality = MAKE_ATOM("XV_FILTER_QUALITY"); /* FIXME: twice, leak */
+ xvColorKey = MAKE_ATOM("XV_COLORKEY");
+ xvFilterQuality = MAKE_ATOM("XV_FILTER_QUALITY");
pPriv->colorKey = pTDFX->videoKey;
pPriv->videoStatus = 0;
@@ -213,17 +172,16 @@ TDFXAllocAdaptor(ScrnInfoPtr pScrn, int numberPorts)
return adapt;
}
-
static XF86VideoAdaptorPtr
-TDFXSetupImageVideoOverlay(ScreenPtr pScreen)
+TDFXSetupImageVideo(ScreenPtr pScreen)
{
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
TDFXPtr pTDFX = TDFXPTR(pScrn);
TDFXPortPrivPtr pPriv;
XF86VideoAdaptorPtr adapt;
- if (!pTDFX->OverlayXvideo)
- return NULL;
+ if(!(adapt = TDFXAllocAdaptor(pScrn)))
+ return NULL;
if(!(adapt = TDFXAllocAdaptor(pScrn, TDFX_MAX_OVERLAY_PORTS)))
return NULL;
@@ -231,15 +189,15 @@ TDFXSetupImageVideoOverlay(ScreenPtr pScreen)
adapt->type = XvWindowMask | XvInputMask | XvImageMask;
adapt->flags = VIDEO_OVERLAID_IMAGES | VIDEO_CLIP_TO_VIEWPORT;
adapt->name = "3dfx Video Overlay";
- adapt->nPorts = TDFX_MAX_OVERLAY_PORTS;
- adapt->nEncodings = sizeof(OverlayEncoding) / sizeof(XF86VideoEncodingRec);
- adapt->pEncodings = OverlayEncoding;
- adapt->nFormats = sizeof(OverlayFormats) / sizeof(XF86VideoFormatRec);
- adapt->pFormats = OverlayFormats;
- adapt->nAttributes = sizeof(OverlayAttributes) / sizeof(XF86AttributeRec);
- adapt->pAttributes = OverlayAttributes;
- adapt->nImages = sizeof(OverlayImages) / sizeof(XF86ImageRec);
- adapt->pImages = OverlayImages;
+ adapt->nEncodings = 1;
+ adapt->pEncodings = &DummyEncoding;
+ adapt->nFormats = NUM_FORMATS;
+ adapt->pFormats = Formats;
+ adapt->nPorts = 1;
+ adapt->nAttributes = NUM_ATTRIBUTES;
+ adapt->pAttributes = Attributes;
+ adapt->nImages = NUM_IMAGES;
+ adapt->pImages = Images;
adapt->PutVideo = NULL;
adapt->PutStill = NULL;
adapt->GetVideo = NULL;
@@ -248,111 +206,168 @@ TDFXSetupImageVideoOverlay(ScreenPtr pScreen)
adapt->SetPortAttribute = TDFXSetPortAttributeOverlay;
adapt->GetPortAttribute = TDFXGetPortAttributeOverlay;
adapt->QueryBestSize = TDFXQueryBestSize;
- adapt->PutImage = TDFXPutImageOverlay;
+ adapt->PutImage = TDFXPutImage;
adapt->QueryImageAttributes = TDFXQueryImageAttributes;
+ pTDFX->adaptor = adapt;
+
pPriv = (TDFXPortPrivPtr)(adapt->pPortPrivates[0].ptr);
REGION_INIT(pScreen, &(pPriv->clip), NullBox, 0);
- pTDFX->overlayAdaptor = adapt;
-
- TDFXResetVideoOverlay(pScrn);
+ TDFXResetVideo(pScrn);
return adapt;
}
-static XF86VideoAdaptorPtr
-TDFXSetupImageVideoTexture(ScreenPtr pScreen)
+/* I really should stick this in miregion */
+static Bool
+RegionsEqual(RegionPtr A, RegionPtr B)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- TDFXPtr pTDFX = TDFXPTR(pScrn);
- XF86VideoAdaptorPtr adapt;
+ int *dataA, *dataB;
+ int num;
- if (!pTDFX->TextureXvideo)
- return NULL;
+ num = REGION_NUM_RECTS(A);
+ if(num != REGION_NUM_RECTS(B))
+ return FALSE;
- if(!(adapt = TDFXAllocAdaptor(pScrn, TDFX_MAX_TEXTURE_PORTS)))
- return NULL;
+ if((A->extents.x1 != B->extents.x1) ||
+ (A->extents.x2 != B->extents.x2) ||
+ (A->extents.y1 != B->extents.y1) ||
+ (A->extents.y2 != B->extents.y2))
+ return FALSE;
- adapt->type = XvWindowMask | XvInputMask | XvImageMask;
- adapt->flags = 0;
- adapt->name = "3dfx Video Texture";
- adapt->nPorts = TDFX_MAX_TEXTURE_PORTS;
- adapt->nEncodings = sizeof(TextureEncoding) / sizeof(XF86VideoEncodingRec);
- adapt->pEncodings = TextureEncoding;
- adapt->nFormats = sizeof(TextureFormats) / sizeof(XF86VideoFormatRec);
- adapt->pFormats = TextureFormats;
- adapt->nAttributes = sizeof(TextureAttributes) / sizeof(XF86AttributeRec);
- adapt->pAttributes = TextureAttributes;
- adapt->nImages = sizeof(TextureImages) / sizeof(XF86ImageRec);
- adapt->pImages = TextureImages;
- adapt->PutVideo = NULL;
- adapt->PutStill = NULL;
- adapt->GetVideo = NULL;
- adapt->GetStill = NULL;
- adapt->StopVideo = TDFXStopVideoTexture;
- adapt->SetPortAttribute = TDFXSetPortAttributeTexture;
- adapt->GetPortAttribute = TDFXGetPortAttributeTexture;
- adapt->QueryBestSize = TDFXQueryBestSize;
- adapt->PutImage = TDFXPutImageTexture;
- adapt->QueryImageAttributes = TDFXQueryImageAttributes;
+ dataA = (int*)REGION_RECTS(A);
+ dataB = (int*)REGION_RECTS(B);
- pTDFX->textureAdaptor = adapt;
+ while(num--) {
+ if((dataA[0] != dataB[0]) || (dataA[1] != dataB[1]))
+ return FALSE;
+ dataA += 2;
+ dataB += 2;
+ }
- return adapt;
+ return TRUE;
}
-/*
- * MISCELLANEOUS ROUTINES
- */
+/* TDFXClipVideo -
+ Takes the dst box in standard X BoxRec form (top and left
+ edges inclusive, bottom and right exclusive). The new dst
+ box is returned. The source boundaries are given (xa, ya
+ inclusive, xb, yb exclusive) and returned are the new source
+ boundaries in 16.16 fixed point.
+*/
-static int
-TDFXQueryImageAttributes(
- ScrnInfoPtr pScrn,
- int id,
- unsigned short *w, unsigned short *h,
- int *pitches, int *offsets
+#define DummyScreen screenInfo.screens[0]
+
+static Bool
+TDFXClipVideo(
+ BoxPtr dst,
+ INT32 *xa,
+ INT32 *xb,
+ INT32 *ya,
+ INT32 *yb,
+ RegionPtr reg,
+ INT32 width,
+ INT32 height
){
- int size, tmp;
+ INT32 vscale, hscale, delta;
+ BoxPtr extents = REGION_EXTENTS(DummyScreen, reg);
+ int diff;
- if(*w > 1024) *w = 1024;
- if(*h > 1024) *h = 1024;
+ hscale = ((*xb - *xa) << 16) / (dst->x2 - dst->x1);
+ vscale = ((*yb - *ya) << 16) / (dst->y2 - dst->y1);
- *w = (*w + 1) & ~1;
- if(offsets) offsets[0] = 0;
+ *xa <<= 16; *xb <<= 16;
+ *ya <<= 16; *yb <<= 16;
- switch(id) {
- case FOURCC_YV12:
- case FOURCC_I420:
- *h = (*h + 1) & ~1;
- size = (*w + 3) & ~3;
- if(pitches) pitches[0] = size;
- size *= *h;
- if(offsets) offsets[1] = size;
- tmp = ((*w >> 1) + 3) & ~3;
- if(pitches) pitches[1] = pitches[2] = tmp;
- tmp *= (*h >> 1);
- size += tmp;
- if(offsets) offsets[2] = size;
- size += tmp;
- break;
- case FOURCC_UYVY:
- case FOURCC_YUY2:
- default:
- size = *w << 1;
- if(pitches) pitches[0] = size;
- size *= *h;
- break;
+ diff = extents->x1 - dst->x1;
+ if(diff > 0) {
+ dst->x1 = extents->x1;
+ *xa += diff * hscale;
+ }
+ diff = dst->x2 - extents->x2;
+ if(diff > 0) {
+ dst->x2 = extents->x2;
+ *xb -= diff * hscale;
+ }
+ diff = extents->y1 - dst->y1;
+ if(diff > 0) {
+ dst->y1 = extents->y1;
+ *ya += diff * vscale;
+ }
+ diff = dst->y2 - extents->y2;
+ if(diff > 0) {
+ dst->y2 = extents->y2;
+ *yb -= diff * vscale;
}
- return size;
+ if(*xa < 0) {
+ diff = (- *xa + hscale - 1)/ hscale;
+ dst->x1 += diff;
+ *xa += diff * hscale;
+ }
+ delta = *xb - (width << 16);
+ if(delta > 0) {
+ diff = (delta + hscale - 1)/ hscale;
+ dst->x2 -= diff;
+ *xb -= diff * hscale;
+ }
+ if(*xa >= *xb) return FALSE;
+
+ if(*ya < 0) {
+ diff = (- *ya + vscale - 1)/ vscale;
+ dst->y1 += diff;
+ *ya += diff * vscale;
+ }
+ delta = *yb - (height << 16);
+ if(delta > 0) {
+ diff = (delta + vscale - 1)/ vscale;
+ dst->y2 -= diff;
+ *yb -= diff * vscale;
+ }
+ if(*ya >= *yb) return FALSE;
+
+ if((dst->x1 != extents->x1) || (dst->x2 != extents->x2) ||
+ (dst->y1 != extents->y1) || (dst->y2 != extents->y2))
+ {
+ RegionRec clipReg;
+ REGION_INIT(DummyScreen, &clipReg, dst, 1);
+ REGION_INTERSECT(DummyScreen, reg, reg, &clipReg);
+ REGION_UNINIT(DummyScreen, &clipReg);
+ }
+ return TRUE;
}
+static void
+TDFXStopVideo(ScrnInfoPtr pScrn, pointer data, Bool cleanup)
+{
+ TDFXPtr pTDFX = TDFXPTR(pScrn);
+ TDFXPortPrivPtr pPriv = (TDFXPortPrivPtr)data;
+
+ REGION_EMPTY(pScrn->pScreen, &pPriv->clip);
+
+ if(cleanup) {
+ if(pPriv->videoStatus & CLIENT_VIDEO_ON) {
+ pTDFX->ModeReg.vidcfg &= ~VIDPROCCFGMASK;
+ pTDFX->writeLong(pTDFX, VIDPROCCFG, pTDFX->ModeReg.vidcfg);
+ }
+ if(pTDFX->videoScratch) {
+ xf86FreeOffscreenLinear(pTDFX->videoScratch);
+ pTDFX->videoScratch = NULL;
+ }
+ pPriv->videoStatus = 0;
+ } else {
+ if(pPriv->videoStatus & CLIENT_VIDEO_ON) {
+ pPriv->videoStatus |= OFF_TIMER;
+ pPriv->offTime = currentTime.milliseconds + OFF_DELAY;
+ }
+ }
+}
static int
-TDFXSetPortAttributeOverlay(
+TDFXSetPortAttribute(
ScrnInfoPtr pScrn,
Atom attribute,
INT32 value,
@@ -363,21 +378,22 @@ TDFXSetPortAttributeOverlay(
TDFXPtr pTDFX = TDFXPTR(pScrn);
if(attribute == xvColorKey) {
- pPriv->colorKey = value;
- pTDFX->writeLong(pTDFX, VIDCHROMAMIN, pPriv->colorKey);
- pTDFX->writeLong(pTDFX, VIDCHROMAMAX, pPriv->colorKey);
- REGION_EMPTY(pScrn->pScreen, &pPriv->clip);
- } else if(attribute == xvFilterQuality) {
- if((value < 0) || (value > 1))
+ pPriv->colorKey = value;
+ pTDFX->writeLong(pTDFX, VIDCHROMAMIN, pPriv->colorKey);
+ pTDFX->writeLong(pTDFX, VIDCHROMAMAX, pPriv->colorKey);
+ REGION_EMPTY(pScrn->pScreen, &pPriv->clip);
+ } else
+ if(attribute == xvFilterQuality) {
+ if((value < 0) || (value > 1))
return BadValue;
- pPriv->filterQuality = value;
+ pPriv->filterQuality = value;
} else return BadMatch;
return Success;
}
static int
-TDFXGetPortAttributeOverlay(
+TDFXGetPortAttribute(
ScrnInfoPtr pScrn,
Atom attribute,
INT32 *value,
@@ -386,37 +402,16 @@ TDFXGetPortAttributeOverlay(
TDFXPortPrivPtr pPriv = (TDFXPortPrivPtr)data;
if(attribute == xvColorKey) {
- *value = pPriv->colorKey;
- } else if(attribute == xvFilterQuality) {
- *value = pPriv->filterQuality;
+ *value = pPriv->colorKey;
+ } else
+ if(attribute == xvFilterQuality) {
+ *value = pPriv->filterQuality;
} else return BadMatch;
return Success;
}
-static int
-TDFXSetPortAttributeTexture(
- ScrnInfoPtr pScrn,
- Atom attribute,
- INT32 value,
- pointer data
-) {
- return Success;
-}
-
-
-static int
-TDFXGetPortAttributeTexture(
- ScrnInfoPtr pScrn,
- Atom attribute,
- INT32 *value,
- pointer data
-){
- return Success;
-}
-
-
static void
TDFXQueryBestSize(
ScrnInfoPtr pScrn,
@@ -443,10 +438,11 @@ TDFXCopyData(
int h,
int w
){
+ w <<= 1;
while(h--) {
- memcpy(dst, src, w);
- src += srcPitch;
- dst += dstPitch;
+ memcpy(dst, src, w);
+ src += srcPitch;
+ dst += dstPitch;
}
}
@@ -469,375 +465,76 @@ TDFXCopyMungedData(
w >>= 1;
for(j = 0; j < h; j++) {
- dst = (CARD32*)dst1;
- s1 = src1; s2 = src2; s3 = src3;
- i = w;
- while(i > 4) {
- dst[0] = s1[0] | (s1[1] << 16) | (s3[0] << 8) | (s2[0] << 24);
- dst[1] = s1[2] | (s1[3] << 16) | (s3[1] << 8) | (s2[1] << 24);
- dst[2] = s1[4] | (s1[5] << 16) | (s3[2] << 8) | (s2[2] << 24);
- dst[3] = s1[6] | (s1[7] << 16) | (s3[3] << 8) | (s2[3] << 24);
- dst += 4; s2 += 4; s3 += 4; s1 += 8;
- i -= 4;
- }
- while(i--) {
- dst[0] = s1[0] | (s1[1] << 16) | (s3[0] << 8) | (s2[0] << 24);
- dst++; s2++; s3++;
- s1 += 2;
- }
-
- dst1 += dstPitch;
- src1 += srcPitch;
- if(j & 1) {
- src2 += srcPitch2;
- src3 += srcPitch2;
- }
+ dst = (CARD32*)dst1;
+ s1 = src1; s2 = src2; s3 = src3;
+ i = w;
+ while(i > 4) {
+ dst[0] = s1[0] | (s1[1] << 16) | (s3[0] << 8) | (s2[0] << 24);
+ dst[1] = s1[2] | (s1[3] << 16) | (s3[1] << 8) | (s2[1] << 24);
+ dst[2] = s1[4] | (s1[5] << 16) | (s3[2] << 8) | (s2[2] << 24);
+ dst[3] = s1[6] | (s1[7] << 16) | (s3[3] << 8) | (s2[3] << 24);
+ dst += 4; s2 += 4; s3 += 4; s1 += 8;
+ i -= 4;
+ }
+ while(i--) {
+ dst[0] = s1[0] | (s1[1] << 16) | (s3[0] << 8) | (s2[0] << 24);
+ dst++; s2++; s3++;
+ s1 += 2;
+ }
+
+ dst1 += dstPitch;
+ src1 += srcPitch;
+ if(j & 1) {
+ src2 += srcPitch2;
+ src3 += srcPitch2;
+ }
}
}
-/*
- * TEXTURE DRAWING FUNCTIONS
- */
-
-
-static void
-TDFXStopVideoTexture(ScrnInfoPtr pScrn, pointer data, Bool cleanup)
-{
- TDFXPtr pTDFX = TDFXPTR(pScrn);
- TDFXPortPrivPtr pPriv = (TDFXPortPrivPtr)data;
-
- REGION_EMPTY(pScrn->pScreen, &pPriv->clip);
-
- if (cleanup) {
- if(pTDFX->textureBuffer) {
- xf86FreeOffscreenArea(pTDFX->textureBuffer);
- pTDFX->textureBuffer = NULL;
- }
- }
-}
-
-
-static void
-TDFXScreenToScreenYUVStretchBlit (ScrnInfoPtr pScrn,
- short src_x1, short src_y1,
- short src_x2, short src_y2,
- short dst_x1, short dst_y1,
- short dst_x2, short dst_y2)
-{
- TDFXPtr pTDFX = TDFXPTR(pScrn);
- /* reformulate the paramaters the way the hardware wants them */
- INT32 src_x = src_x1 & 0x1FFF;
- INT32 src_y = src_y1 & 0x1FFF;
- INT32 dst_x = dst_x1 & 0x1FFF;
- INT32 dst_y = dst_y1 & 0x1FFF;
- INT32 src_w = (src_x2 - src_x1) & 0x1FFF;
- INT32 src_h = (src_y2 - src_y1) & 0x1FFF;
- INT32 dst_w = (dst_x2 - dst_x1) & 0x1FFF;
- INT32 dst_h = (dst_y2 - dst_y1) & 0x1FFF;
- /* Setup for blit src and dest */
- TDFXMakeRoom(pTDFX, 4);
- DECLARE(SSTCP_DSTSIZE|SSTCP_SRCSIZE|SSTCP_DSTXY|SSTCP_COMMAND/*|SSTCP_COMMANDEXTRA*/);
- /* TDFXWriteLong(pTDFX, SST_2D_COMMANDEXTRA, SST_COMMANDEXTRA_VSYNC);*/
- TDFXWriteLong(pTDFX, SST_2D_SRCSIZE, src_w | (src_h<<16));
- TDFXWriteLong(pTDFX, SST_2D_DSTSIZE, dst_w | (dst_h<<16));
- TDFXWriteLong(pTDFX, SST_2D_DSTXY, dst_x | (dst_y<<16));
- TDFXWriteLong(pTDFX, SST_2D_COMMAND, SST_2D_SCRNTOSCRNSTRETCH | 0xCC000000);
- /* Write to the launch area to start the blit */
- TDFXMakeRoom(pTDFX, 1);
- DECLARE_LAUNCH(1, 0);
- TDFXWriteLong(pTDFX, SST_2D_LAUNCH, (src_x<<1) | (src_y<<16));
- /* Wait for it to happen */
- TDFXSendNOPFifo2D(pScrn);
-}
-
-
-static void
-YUVPlanarToPacked (ScrnInfoPtr pScrn,
- short src_x, short src_y,
- short src_h, short src_w,
- int id, char *buf,
- short width, short height,
- FBAreaPtr fbarea)
-{
- TDFXPtr pTDFX = TDFXPTR(pScrn);
- char *psrc, *pdst;
- int count;
- int baseaddr;
- INT32 yuvBaseAddr, yuvStride;
-
- /* Save these registers so I can restore them when we are done. */
- yuvBaseAddr = TDFXReadLongMMIO(pTDFX, YUVBASEADDR);
- yuvStride = TDFXReadLongMMIO(pTDFX, YUVSTRIDE);
-
- /* Set yuvBaseAddress and yuvStride. */
- baseaddr = pTDFX->fbOffset + pTDFX->cpp * fbarea->box.x1 + pTDFX->stride * fbarea->box.y1;
- TDFXWriteLongMMIO(pTDFX, YUVSTRIDE, pTDFX->stride);
- TDFXWriteLongMMIO(pTDFX, YUVBASEADDR, baseaddr);
-
- /* Copy Y plane (twice as much Y as U or V) */
- psrc = (char *)buf;
- psrc += (src_x & ~0x1) + src_y * width;
- pdst = (char *)pTDFX->MMIOBase[0] + YUV_Y_BASE;
- TDFXCopyData(psrc, pdst, width, 1024, src_h, src_w + (src_x & 0x1));
-
- /* Copy V plane */
- psrc = (char*)buf + width * height;
- psrc += (src_x >> 1) + (src_y >> 1) * (width >> 1);
- pdst = (char *)pTDFX->MMIOBase[0] + YUV_V_BASE;
- TDFXCopyData(psrc, pdst, width >> 1, 1024, src_h >> 1, src_w >> 1);
-
- /* Copy U plane */
- psrc = (char*)buf + width * height + (width >> 1) * (height >> 1);
- psrc += (src_x >> 1) + (src_y >> 1) * (width >> 1);
- pdst = (char *)pTDFX->MMIOBase[0] + YUV_U_BASE;
- TDFXCopyData(psrc, pdst, width >> 1, 1024, src_h >> 1, src_w >> 1);
-
- /* IDLE until the copy finished, timeout for safety */
- for (count = 0; count < 1000; count++)
- if (!((TDFXReadLongMMIO(pTDFX, STATUS) & SST_BUSY)))
- break;
-
- /* Restore trashed registers */
- TDFXWriteLongMMIO(pTDFX, YUVBASEADDR, yuvBaseAddr);
- TDFXWriteLongMMIO(pTDFX, YUVSTRIDE, yuvStride);
-
- /* Wait for it to happen */
- TDFXSendNOPFifo2D(pScrn);
-}
-
-
-static int
-TDFXPutImageTexture(
- ScrnInfoPtr pScrn,
- short src_x, short src_y,
- short drw_x, short drw_y,
- short src_w, short src_h,
- short drw_w, short drw_h,
- int id, unsigned char* buf,
- short width, short height,
- Bool sync,
- RegionPtr clipBoxes, pointer data
- )
-{
- TDFXPtr pTDFX = TDFXPTR(pScrn);
- BoxPtr pbox;
- int nbox;
- int format;
-
- /* Check the source format */
- if (id == FOURCC_YV12) format = SST_2D_FORMAT_YUYV;
- else if (id == FOURCC_UYVY) format = SST_2D_FORMAT_UYVY;
- else return BadAlloc;
-
- /* Get a buffer to store the packed YUV data */
- if (!(pTDFX->textureBuffer = TDFXAllocateMemoryArea(pScrn, pTDFX->textureBuffer, src_w, src_h)))
- return BadAlloc;
-
- /* Pack the YUV data in offscreen memory using YUV framebuffer (0x[CDE]0000) */
- YUVPlanarToPacked (pScrn, src_x, src_y, src_h, src_w,
- id, (char *)buf, width, height,
- pTDFX->textureBuffer);
-
- /* Setup source and destination pixel formats (yuv -> rgb) */
- TDFXMakeRoom(pTDFX, 2);
- DECLARE(SSTCP_SRCFORMAT|SSTCP_DSTFORMAT);
- TDFXWriteLong(pTDFX, SST_2D_DSTFORMAT, pTDFX->stride|((pTDFX->cpp+1)<<16));
- TDFXWriteLong(pTDFX, SST_2D_SRCFORMAT, pTDFX->stride|((format)<<16));
-
- /* Blit packed YUV data from offscreen memory, respecting clips */
-#define SRC_X1 (pTDFX->textureBuffer->box.x1)
-#define SRC_Y1 (pTDFX->textureBuffer->box.y1)
-#define SCALEX(dx) ((int)(((dx) * src_w) / drw_w))
-#define SCALEY(dy) ((int)(((dy) * src_h) / drw_h))
- for (nbox = REGION_NUM_RECTS(clipBoxes),
- pbox = REGION_RECTS(clipBoxes); nbox > 0; nbox--, pbox++)
- {
- TDFXScreenToScreenYUVStretchBlit (pScrn,
- SRC_X1 + SCALEX(pbox->x1 - drw_x),
- SRC_Y1 + SCALEY(pbox->y1 - drw_y),
- SRC_X1 + SCALEX(pbox->x2 - drw_x),
- SRC_Y1 + SCALEY(pbox->y2 - drw_y),
- pbox->x1, pbox->y1,
- pbox->x2, pbox->y2);
- }
-
- /* Restore the WAX registers we trashed */
- TDFXMakeRoom(pTDFX, 2);
- DECLARE(SSTCP_SRCFORMAT|SSTCP_DSTFORMAT);
- TDFXWriteLong(pTDFX, SST_2D_DSTFORMAT, pTDFX->sst2DDstFmtShadow);
- TDFXWriteLong(pTDFX, SST_2D_SRCFORMAT, pTDFX->sst2DSrcFmtShadow);
-
- /* Wait for it to happen */
- TDFXSendNOPFifo2D(pScrn);
-
- return Success;
-}
-
-
-/*
- * COMMON DRAWING FUNCTIONS
- */
-
-static Bool
-RegionsEqual(RegionPtr A, RegionPtr B)
-{
- int *dataA, *dataB;
- int num;
-
- num = REGION_NUM_RECTS(A);
- if(num != REGION_NUM_RECTS(B))
- return FALSE;
-
- if((A->extents.x1 != B->extents.x1) ||
- (A->extents.x2 != B->extents.x2) ||
- (A->extents.y1 != B->extents.y1) ||
- (A->extents.y2 != B->extents.y2))
- return FALSE;
-
- dataA = (int*)REGION_RECTS(A);
- dataB = (int*)REGION_RECTS(B);
-
- while(num--) {
- if((dataA[0] != dataB[0]) || (dataA[1] != dataB[1]))
- return FALSE;
- dataA += 2;
- dataB += 2;
- }
-
- return TRUE;
-}
-
-
-static Bool
-TDFXClipVideo(
- BoxPtr dst,
- INT32 *xa,
- INT32 *xb,
- INT32 *ya,
- INT32 *yb,
- RegionPtr reg,
- INT32 width,
- INT32 height
+static FBLinearPtr
+TDFXAllocateMemory(
+ ScrnInfoPtr pScrn,
+ FBLinearPtr linear,
+ int size
){
- INT32 vscale, hscale, delta;
- BoxPtr extents = REGION_EXTENTS(DummyScreen, reg);
- int diff;
-
- hscale = ((*xb - *xa) << 16) / (dst->x2 - dst->x1);
- vscale = ((*yb - *ya) << 16) / (dst->y2 - dst->y1);
-
- *xa <<= 16; *xb <<= 16;
- *ya <<= 16; *yb <<= 16;
-
- diff = extents->x1 - dst->x1;
- if(diff > 0) {
- dst->x1 = extents->x1;
- *xa += diff * hscale;
- }
- diff = dst->x2 - extents->x2;
- if(diff > 0) {
- dst->x2 = extents->x2;
- *xb -= diff * hscale;
- }
- diff = extents->y1 - dst->y1;
- if(diff > 0) {
- dst->y1 = extents->y1;
- *ya += diff * vscale;
- }
- diff = dst->y2 - extents->y2;
- if(diff > 0) {
- dst->y2 = extents->y2;
- *yb -= diff * vscale;
- }
-
- if(*xa < 0) {
- diff = (- *xa + hscale - 1)/ hscale;
- dst->x1 += diff;
- *xa += diff * hscale;
- }
- delta = *xb - (width << 16);
- if(delta > 0) {
- diff = (delta + hscale - 1)/ hscale;
- dst->x2 -= diff;
- *xb -= diff * hscale;
- }
- if(*xa >= *xb) return FALSE;
-
- if(*ya < 0) {
- diff = (- *ya + vscale - 1)/ vscale;
- dst->y1 += diff;
- *ya += diff * vscale;
- }
- delta = *yb - (height << 16);
- if(delta > 0) {
- diff = (delta + vscale - 1)/ vscale;
- dst->y2 -= diff;
- *yb -= diff * vscale;
- }
- if(*ya >= *yb) return FALSE;
+ ScreenPtr pScreen;
+ FBLinearPtr new_linear;
- if((dst->x1 != extents->x1) || (dst->x2 != extents->x2) ||
- (dst->y1 != extents->y1) || (dst->y2 != extents->y2))
- {
- RegionRec clipReg;
- REGION_INIT(DummyScreen, &clipReg, dst, 1);
- REGION_INTERSECT(DummyScreen, reg, reg, &clipReg);
- REGION_UNINIT(DummyScreen, &clipReg);
- }
- return TRUE;
-}
+ if(linear) {
+ if(linear->size >= size)
+ return linear;
+ if(xf86ResizeOffscreenLinear(linear, size))
+ return linear;
-/*
- * OVERLAY DRAWING FUNCTIONS
- */
+ xf86FreeOffscreenLinear(linear);
+ }
+ pScreen = screenInfo.screens[pScrn->scrnIndex];
-static void
-TDFXResetVideoOverlay(ScrnInfoPtr pScrn)
-{
- TDFXPtr pTDFX = TDFXPTR(pScrn);
- TDFXPortPrivPtr pPriv = pTDFX->overlayAdaptor->pPortPrivates[0].ptr;
+ new_linear = xf86AllocateOffscreenLinear(pScreen, size, 4,
+ NULL, NULL, NULL);
- /* reset the video */
- pTDFX->ModeReg.vidcfg &= ~VIDPROCCFGMASK;
- pTDFX->writeLong(pTDFX, VIDPROCCFG, pTDFX->ModeReg.vidcfg);
- pTDFX->writeLong(pTDFX, RGBMAXDELTA, 0x0080808);
- pTDFX->writeLong(pTDFX, VIDCHROMAMIN, pPriv->colorKey);
- pTDFX->writeLong(pTDFX, VIDCHROMAMAX, pPriv->colorKey);
-}
+ if(!new_linear) {
+ int max_size;
+ xf86QueryLargestOffscreenLinear(pScreen, &max_size, 4,
+ PRIORITY_EXTREME);
-static void
-TDFXStopVideoOverlay(ScrnInfoPtr pScrn, pointer data, Bool cleanup)
-{
- TDFXPtr pTDFX = TDFXPTR(pScrn);
- TDFXPortPrivPtr pPriv = (TDFXPortPrivPtr)data;
+ if(max_size < size)
+ return NULL;
- REGION_EMPTY(pScrn->pScreen, &pPriv->clip);
+ xf86PurgeUnlockedOffscreenAreas(pScreen);
+ new_linear = xf86AllocateOffscreenLinear(pScreen, size, 4,
+ NULL, NULL, NULL);
+ }
- if(cleanup) {
- if(pPriv->videoStatus & CLIENT_VIDEO_ON) {
- pTDFX->ModeReg.vidcfg &= ~VIDPROCCFGMASK;
- pTDFX->writeLong(pTDFX, VIDPROCCFG, pTDFX->ModeReg.vidcfg);
- }
- if(pTDFX->overlayBuffer) {
- xf86FreeOffscreenLinear(pTDFX->overlayBuffer);
- pTDFX->overlayBuffer = NULL;
- }
- pPriv->videoStatus = 0;
- } else {
- if(pPriv->videoStatus & CLIENT_VIDEO_ON) {
- pPriv->videoStatus |= OFF_TIMER;
- pPriv->offTime = currentTime.milliseconds + OFF_DELAY;
- }
- }
+ return new_linear;
}
-
static void
-TDFXDisplayVideoOverlay(
+TDFXDisplayVideo(
ScrnInfoPtr pScrn,
int id,
int offset,
@@ -849,28 +546,31 @@ TDFXDisplayVideoOverlay(
short drw_w, short drw_h
){
TDFXPtr pTDFX = TDFXPTR(pScrn);
- TDFXPortPrivPtr pPriv = pTDFX->overlayAdaptor->pPortPrivates[0].ptr;
+ TDFXPortPrivPtr pPriv = pTDFX->adaptor->pPortPrivates[0].ptr;
int dudx, dvdy;
dudx = (src_w << 20) / drw_w;
dvdy = (src_h << 20) / drw_h;
offset += ((left >> 16) & ~1) << 1;
+
left = (left & 0x0001ffff) << 3;
pTDFX->ModeReg.vidcfg &= ~VIDPROCCFGMASK;
pTDFX->ModeReg.vidcfg |= 0x00000320;
- if(drw_w != src_w) pTDFX->ModeReg.vidcfg |= (1 << 14);
- if(drw_h != src_h) pTDFX->ModeReg.vidcfg |= (1 << 15);
- if(id == FOURCC_UYVY) pTDFX->ModeReg.vidcfg |= (6 << 21);
- else pTDFX->ModeReg.vidcfg |= (5 << 21);
- if(pScrn->depth == 8) pTDFX->ModeReg.vidcfg |= (1 << 11);
+ if(drw_w != src_w) pTDFX->ModeReg.vidcfg |= (1 << 14);
+ if(drw_h != src_h) pTDFX->ModeReg.vidcfg |= (1 << 15);
+ if(id == FOURCC_UYVY) pTDFX->ModeReg.vidcfg |= (6 << 21);
+ else pTDFX->ModeReg.vidcfg |= (5 << 21);
+ if(pScrn->depth == 8) pTDFX->ModeReg.vidcfg |= (1 << 11);
if(pPriv->filterQuality) pTDFX->ModeReg.vidcfg |= (3 << 16);
pTDFX->writeLong(pTDFX, VIDPROCCFG, pTDFX->ModeReg.vidcfg);
- pTDFX->writeLong(pTDFX, VIDOVERLAYSTARTCOORDS, dstBox->x1 | (dstBox->y1 << 12));
- pTDFX->writeLong(pTDFX, VIDOVERLAYENDSCREENCOORDS, (dstBox->x2 - 1) | ((dstBox->y2 - 1) << 12));
+ pTDFX->writeLong(pTDFX, VIDOVERLAYSTARTCOORDS,
+ dstBox->x1 | (dstBox->y1 << 12));
+ pTDFX->writeLong(pTDFX, VIDOVERLAYENDSCREENCOORDS,
+ (dstBox->x2 - 1) | ((dstBox->y2 - 1) << 12));
pTDFX->writeLong(pTDFX, VIDOVERLAYDUDX, dudx);
pTDFX->writeLong(pTDFX, VIDOVERLAYDUDXOFFSETSRCWIDTH, left | (src_w << 20));
pTDFX->writeLong(pTDFX, VIDOVERLAYDVDY, dvdy);
@@ -885,7 +585,7 @@ TDFXDisplayVideoOverlay(
static int
-TDFXPutImageOverlay(
+TDFXPutImage(
ScrnInfoPtr pScrn,
short src_x, short src_y,
short drw_x, short drw_y,
@@ -900,10 +600,8 @@ TDFXPutImageOverlay(
TDFXPortPrivPtr pPriv = (TDFXPortPrivPtr)data;
INT32 xa, xb, ya, yb;
unsigned char *dst_start;
- int pitch, new_size, offset;
- int s2offset = 0, s3offset = 0;
- int srcPitch = 0, srcPitch2 = 0;
- int dstPitch;
+ int pitch, new_size, offset, s2offset, s3offset;
+ int srcPitch, srcPitch2, dstPitch;
int top, left, npixels, nlines, bpp;
BoxRec dstBox;
CARD32 tmp;
@@ -919,6 +617,9 @@ TDFXPutImageOverlay(
*
*/
+ /* make the compiler happy */
+ s2offset = s3offset = srcPitch2 = 0;
+
if(src_w > drw_w) drw_w = src_w;
if(src_h > drw_h) drw_h = src_h;
@@ -934,7 +635,7 @@ TDFXPutImageOverlay(
dstBox.y2 = drw_y + drw_h;
if(!TDFXClipVideo(&dstBox, &xa, &xb, &ya, &yb, clipBoxes, width, height))
- return Success;
+ return Success;
dstBox.x1 -= pScrn->frameX0;
dstBox.x2 -= pScrn->frameX0;
@@ -947,71 +648,78 @@ TDFXPutImageOverlay(
switch(id) {
case FOURCC_YV12:
case FOURCC_I420:
- dstPitch = ((width << 1) + 3) & ~3;
- new_size = ((dstPitch * height) + bpp - 1) / bpp;
- srcPitch = (width + 3) & ~3;
- s2offset = srcPitch * height;
- srcPitch2 = ((width >> 1) + 3) & ~3;
- s3offset = (srcPitch2 * (height >> 1)) + s2offset;
- break;
+ dstPitch = ((width << 1) + 3) & ~3;
+ new_size = ((dstPitch * height) + bpp - 1) / bpp;
+ srcPitch = (width + 3) & ~3;
+ s2offset = srcPitch * height;
+ srcPitch2 = ((width >> 1) + 3) & ~3;
+ s3offset = (srcPitch2 * (height >> 1)) + s2offset;
+ break;
case FOURCC_UYVY:
case FOURCC_YUY2:
default:
- dstPitch = ((width << 1) + 3) & ~3;
- new_size = ((dstPitch * height) + bpp - 1) / bpp;
- srcPitch = (width << 1);
- break;
+ dstPitch = ((width << 1) + 3) & ~3;
+ new_size = ((dstPitch * height) + bpp - 1) / bpp;
+ srcPitch = (width << 1);
+ break;
}
- if(!(pTDFX->overlayBuffer = TDFXAllocateMemoryLinear(pScrn, pTDFX->overlayBuffer, new_size)))
- return BadAlloc;
+ if(!(pTDFX->videoScratch = TDFXAllocateMemory(pScrn, pTDFX->videoScratch,
+ new_size)))
+ {
+ return BadAlloc;
+ }
- /* copy data */
+ /* copy data */
top = ya >> 16;
left = (xa >> 16) & ~1;
npixels = ((((xb + 0xffff) >> 16) + 1) & ~1) - left;
- offset = (pTDFX->overlayBuffer->offset * bpp) + (top * dstPitch) + pTDFX->fbOffset;
+ offset = (pTDFX->videoScratch->offset * bpp) +
+ (top * dstPitch) + pTDFX->fbOffset;
dst_start = pTDFX->FbBase + offset;
switch(id) {
case FOURCC_YV12:
case FOURCC_I420:
- top &= ~1;
- dst_start += left << 1;
- tmp = ((top >> 1) * srcPitch2) + (left >> 1);
- s2offset += tmp;
- s3offset += tmp;
- if(id == FOURCC_I420) {
- tmp = s2offset;
- s2offset = s3offset;
- s3offset = tmp;
- }
- nlines = ((((yb + 0xffff) >> 16) + 1) & ~1) - top;
- TDFXCopyMungedData(buf + (top * srcPitch) + left, buf + s2offset,
- buf + s3offset, dst_start, srcPitch, srcPitch2,
- dstPitch, nlines, npixels);
- break;
+ top &= ~1;
+ dst_start += left << 1;
+ tmp = ((top >> 1) * srcPitch2) + (left >> 1);
+ s2offset += tmp;
+ s3offset += tmp;
+ if(id == FOURCC_I420) {
+ tmp = s2offset;
+ s2offset = s3offset;
+ s3offset = tmp;
+ }
+ nlines = ((((yb + 0xffff) >> 16) + 1) & ~1) - top;
+ TDFXCopyMungedData(buf + (top * srcPitch) + left, buf + s2offset,
+ buf + s3offset, dst_start, srcPitch, srcPitch2,
+ dstPitch, nlines, npixels);
+ break;
case FOURCC_UYVY:
case FOURCC_YUY2:
default:
- left <<= 1;
- buf += (top * srcPitch) + left;
- nlines = ((yb + 0xffff) >> 16) - top;
- dst_start += left;
- TDFXCopyData(buf, dst_start, srcPitch, dstPitch, nlines, npixels << 1);
- break;
+ left <<= 1;
+ buf += (top * srcPitch) + left;
+ nlines = ((yb + 0xffff) >> 16) - top;
+ dst_start += left;
+ TDFXCopyData(buf, dst_start, srcPitch, dstPitch, nlines, npixels);
+ break;
}
+ /* update cliplist */
if(!RegionsEqual(&pPriv->clip, clipBoxes)) {
- REGION_COPY(pScreen, &pPriv->clip, clipBoxes);
- (*pTDFX->AccelInfoRec->FillSolidRects)(pScrn, pPriv->colorKey,
- GXcopy, ~0,
- REGION_NUM_RECTS(clipBoxes),
- REGION_RECTS(clipBoxes));
+ REGION_COPY(pScreen, &pPriv->clip, clipBoxes);
+ /* draw these */
+ (*pTDFX->AccelInfoRec->FillSolidRects)(pScrn, pPriv->colorKey,
+ GXcopy, ~0,
+ REGION_NUM_RECTS(clipBoxes),
+ REGION_RECTS(clipBoxes));
}
- TDFXDisplayVideoOverlay(pScrn, id, offset, width, height, dstPitch, xa, xb, ya, &dstBox, src_w, src_h, drw_w, drw_h);
+ TDFXDisplayVideo(pScrn, id, offset, width, height, dstPitch,
+ xa, xb, ya, &dstBox, src_w, src_h, drw_w, drw_h);
pPriv->videoStatus = CLIENT_VIDEO_ON;
@@ -1021,112 +729,75 @@ TDFXPutImageOverlay(
}
-static void
-TDFXVideoTimerCallback(ScrnInfoPtr pScrn, Time time)
-{
- TDFXPtr pTDFX = TDFXPTR(pScrn);
- TDFXPortPrivPtr pPriv = pTDFX->overlayAdaptor->pPortPrivates[0].ptr;
-
- if(pPriv->videoStatus & TIMER_MASK) {
- if(pPriv->videoStatus & OFF_TIMER) {
- if(pPriv->offTime < time) {
- pTDFX->ModeReg.vidcfg &= ~VIDPROCCFGMASK;
- pTDFX->writeLong(pTDFX, VIDPROCCFG, pTDFX->ModeReg.vidcfg);
- pPriv->videoStatus = FREE_TIMER;
- pPriv->freeTime = time + FREE_DELAY;
- }
- } else
- if(pPriv->videoStatus & FREE_TIMER) {
- if(pPriv->freeTime < time) {
- if(pTDFX->overlayBuffer) {
- xf86FreeOffscreenLinear(pTDFX->overlayBuffer);
- pTDFX->overlayBuffer = NULL;
- }
- pPriv->videoStatus = 0;
- pTDFX->VideoTimerCallback = NULL;
- }
- }
- } else /* shouldn't get here */
- pTDFX->VideoTimerCallback = NULL;
-}
-
-
-/*
- * MEMORY MANAGEMENT
- */
-
-
-static FBAreaPtr
-TDFXAllocateMemoryArea (ScrnInfoPtr pScrn, FBAreaPtr area, int width, int height)
-{
- TDFXPtr pTDFX = TDFXPTR(pScrn);
- ScreenPtr pScreen;
- FBAreaPtr new_area;
-
- if (area) {
- if ((area->box.x2 - area->box.x1 >= width) &&
- (area->box.y2 - area->box.y1 >= height))
- return area;
-
- if (xf86ResizeOffscreenArea(area, width, height))
- return area;
-
- xf86FreeOffscreenArea(area);
- }
-
- pScreen = screenInfo.screens[pScrn->scrnIndex];
-
- new_area = xf86AllocateOffscreenArea(pScreen, width, height, pTDFX->cpp, NULL, NULL, NULL);
-
- if (!new_area) {
- int max_width, max_height;
+static int
+TDFXQueryImageAttributes(
+ ScrnInfoPtr pScrn,
+ int id,
+ unsigned short *w, unsigned short *h,
+ int *pitches, int *offsets
+){
+ int size, tmp;
- xf86QueryLargestOffscreenArea(pScreen, &max_width, &max_height, pTDFX->cpp, 0, PRIORITY_EXTREME);
+ if(*w > 2048) *w = 2048;
+ if(*h > 2048) *h = 2048;
- if (max_width < width || max_height < height)
- return NULL;
+ *w = (*w + 1) & ~1;
+ if(offsets) offsets[0] = 0;
- xf86PurgeUnlockedOffscreenAreas(pScreen);
- new_area = xf86AllocateOffscreenArea(pScreen, width, height, pTDFX->cpp, NULL, NULL, NULL);
- }
+ switch(id) {
+ case FOURCC_YV12:
+ case FOURCC_I420:
+ *h = (*h + 1) & ~1;
+ size = (*w + 3) & ~3;
+ if(pitches) pitches[0] = size;
+ size *= *h;
+ if(offsets) offsets[1] = size;
+ tmp = ((*w >> 1) + 3) & ~3;
+ if(pitches) pitches[1] = pitches[2] = tmp;
+ tmp *= (*h >> 1);
+ size += tmp;
+ if(offsets) offsets[2] = size;
+ size += tmp;
+ break;
+ case FOURCC_UYVY:
+ case FOURCC_YUY2:
+ default:
+ size = *w << 1;
+ if(pitches) pitches[0] = size;
+ size *= *h;
+ break;
+ }
- return new_area;
+ return size;
}
-
-static FBLinearPtr
-TDFXAllocateMemoryLinear (ScrnInfoPtr pScrn, FBLinearPtr linear, int size)
+static void
+TDFXVideoTimerCallback(ScrnInfoPtr pScrn, Time time)
{
- 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);
- }
+ TDFXPtr pTDFX = TDFXPTR(pScrn);
+ TDFXPortPrivPtr pPriv = pTDFX->adaptor->pPortPrivates[0].ptr;
- return new_linear;
+ if(pPriv->videoStatus & TIMER_MASK) {
+ if(pPriv->videoStatus & OFF_TIMER) {
+ if(pPriv->offTime < time) {
+ pTDFX->ModeReg.vidcfg &= ~VIDPROCCFGMASK;
+ pTDFX->writeLong(pTDFX, VIDPROCCFG, pTDFX->ModeReg.vidcfg);
+ pPriv->videoStatus = FREE_TIMER;
+ pPriv->freeTime = time + FREE_DELAY;
+ }
+ } else { /* FREE_TIMER */
+ if(pPriv->freeTime < time) {
+ if(pTDFX->videoScratch) {
+ xf86FreeOffscreenLinear(pTDFX->videoScratch);
+ pTDFX->videoScratch = NULL;
+ }
+ pPriv->videoStatus = 0;
+ pTDFX->VideoTimerCallback = NULL;
+ }
+ }
+ } else /* shouldn't get here */
+ pTDFX->VideoTimerCallback = NULL;
}
+
#endif /* !XvExtension */
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfxdefs.h b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfxdefs.h
index a925b22ca..c754a6c3e 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfxdefs.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfxdefs.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfxdefs.h,v 1.8 2000/12/01 14:29:00 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfxdefs.h,v 1.10 2000/12/20 01:30:47 mvojkovi Exp $ */
/*
Voodoo Banshee driver version 1.0.1
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/trident/trident.cpp b/xc/programs/Xserver/hw/xfree86/drivers/trident/trident.cpp
deleted file mode 100644
index a25063e3a..000000000
--- a/xc/programs/Xserver/hw/xfree86/drivers/trident/trident.cpp
+++ /dev/null
@@ -1,81 +0,0 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident.cpp,v 1.8 2000/12/11 20:18:37 dawes Exp $
-.\" shorthand for double quote that works everywhere.
-.ds q \N'34'
-.TH TRIDENT __drivermansuffix__ "Version 4.0.2" "XFree86"
-.SH NAME
-trident \- Trident video driver
-.SH SYNOPSIS
-.nf
-.B "Section \*qDevice\*q"
-.BI " Identifier \*q" devname \*q
-.B " Driver \*qtrident\*q"
-\ \ ...
-.B EndSection
-.fi
-.SH DESCRIPTION
-.B trident
-is an XFree86 driver for Trident video cards. The driver is fully
-accelerated, and provides support for the following framebuffer depths:
-1, 4, 8, 15, 16, and 24. Multi-head configurations
-are supported. The XvImage extension is supported on all Blade and Image
-series cards. Currently the ZOOM feature doesn't work properly on the Image
-series.
-.SH SUPPORTED HARDWARE
-The
-.B trident
-driver supports PCI,AGP and ISA video cards based on the following
-Trident chips:
-.TP 12
-.B Blade
-Blade3D, CyberBlade series i1, i7 (DSTN), i1, i1 (DSTN), Ai1, Ai1 (DSTN),
-CyberBlade/e4
-.TP 12
-.B Image
-3DImage975, 3DImage985, Cyber9520, Cyber9525, Cyber9397, Cyber9397DVD
-.TP 12
-.B ProVidia
-9682, 9685, Cyber9382, Cyber9385, Cyber9388
-.TP 12
-.B TGUI
-9440AGi, 9660, 9680
-.TP 12
-.B 8900
-8900D (ISA)
-.SH CONFIGURATION DETAILS
-Please refer to XF86Config(__filemansuffix__) for general configuration
-details. This section only covers configuration details specific to this
-driver.
-.PP
-The following driver
-.B Options
-are supported:
-.TP
-.BI "Option \*qSWCursor\*q \*q" boolean \*q
-Enable or disable the SW cursor. Default: off.
-.TP
-.BI "Option \*qNoAccel\*q \*q" boolean \*q
-Disable or enable acceleration. Default: acceleration is enabled.
-.TP
-.BI "Option \*qPciRetry\*q \*q" boolean \*q
-Enable or disable PCI retries. Default: off.
-.TP
-.BI "Option \*qCyberShadow\*q \*q" boolean \*q
-For Cyber chipsets only, turn off shadow registers. If you only see
-a partial display - this may be the option for you. Default: on.
-.TP
-.BI "Option \*qShadowFB\*q \*q" boolean \*q
-Enable or disable use of the shadow framebuffer layer. See
-shadowfb(__drivermansuffix__) for further information. Default: off.
-.TP
-.BI "Option \*qVideoKey\*q \*q" integer \*q
-This sets the default pixel value for the YUV video overlay key.
-NOTE: Default is 0 for depth 15 and 24. This needs fixing.
-Default: undefined.
-.TP
-.BI "Option \*qNoPciBurst\*q \*q" boolean \*q
-Turn off PCI burst mode, PCI Bursting is on by default.
-Default: off.
-.SH "SEE ALSO"
-XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__)
-.SH AUTHOR
-Author: Alan Hourihane
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng.cpp b/xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng.cpp
deleted file mode 100644
index 45fe633cd..000000000
--- a/xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng.cpp,v 1.6 2000/12/11 20:18:39 dawes Exp $
-.\" shorthand for double quote that works everywhere.
-.ds q \N'34'
-.TH TSENG __drivermansuffix__ "Version 4.0.2" "XFree86"
-.SH NAME
-tseng \- Tseng Labs video driver
-.SH SYNOPSIS
-.nf
-.B "Section \*qDevice\*q"
-.BI " Identifier \*q" devname \*q
-.B " Driver \*qtseng\*q"
-\ \ ...
-.B EndSection
-.fi
-.SH DESCRIPTION
-.B tseng
-is an XFree86 driver for Tseng Labs video cards.
-THIS MAN PAGE NEEDS TO BE FILLED IN.
-.SH SUPPORTED HARDWARE
-The
-.B tseng
-driver supports...
-.SH CONFIGURATION DETAILS
-Please refer to XF86Config(__filemansuffix__) for general configuration
-details. This section only covers configuration details specific to this
-driver.
-.SH "SEE ALSO"
-XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__)
-.SH AUTHORS
-Authors include: ...
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/v4l/v4l.cpp b/xc/programs/Xserver/hw/xfree86/drivers/v4l/v4l.cpp
deleted file mode 100644
index e18e938d5..000000000
--- a/xc/programs/Xserver/hw/xfree86/drivers/v4l/v4l.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/v4l/v4l.cpp,v 1.5 2000/12/11 20:18:40 dawes Exp $
-.\" shorthand for double quote that works everywhere.
-.ds q \N'34'
-.TH V4L __drivermansuffix__ "Version 4.0.2" "XFree86"
-.SH NAME
-v4l \- Video 4 Linux driver
-.SH SYNOPSIS
-.nf
-.B "Section \*qDevice\*q"
-.BI " Identifier \*q" devname \*q
-.B " Driver \*qv4l\*q"
-\ \ ...
-.B EndSection
-.fi
-.SH DESCRIPTION
-.B v4l
-is an XFree86 driver for Video 4 Linux.
-THIS MAN PAGE NEEDS TO BE FILLED IN.
-.SH SUPPORTED HARDWARE
-The
-.B v4l
-driver supports...
-.SH CONFIGURATION DETAILS
-Please refer to XF86Config(__filemansuffix__) for general configuration
-details. This section only covers configuration details specific to this
-driver.
-.SH "SEE ALSO"
-XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__)
-.SH AUTHORS
-Authors include: ...
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.c b/xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.c
index edc2421b2..0847547d4 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.c
@@ -1,3 +1,4 @@
+#define DEBUG
/*
* Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
*
@@ -24,9 +25,9 @@
* dealings in this Software without prior written authorization from
* Conectiva Linux.
*
- * Authors: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
+ * Authors: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
*
- * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.c,v 1.8 2000/12/02 15:31:00 tsi Exp $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.c,v 1.12 2001/02/16 01:45:45 dawes Exp $
*/
#include "vesa.h"
@@ -68,6 +69,8 @@ static void VESALoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices,
LOCO *colors, VisualPtr pVisual);
static void SaveFonts(ScrnInfoPtr pScrn);
static void RestoreFonts(ScrnInfoPtr pScrn);
+static Bool
+VESASaveRestore(ScrnInfoPtr pScrn, vbeSaveRestoreFunction function);
static void *VESAWindowPlanar(ScreenPtr pScrn, CARD32 row, CARD32 offset,
int mode, CARD32 *size);
@@ -139,19 +142,33 @@ static const char *fbSymbols[] = {
"xf4bppScreenInit",
"afbScreenInit",
"fbScreenInit",
-#ifdef RENDER
"fbPictureInit",
-#endif
"cfbScreenInit",
"mfbScreenInit",
+ "cfb24_32ScreenInit",
NULL
};
static const char *shadowSymbols[] = {
- "ShadowInit",
+ "shadowAlloc",
+ "shadowInit",
+ "shadowUpdatePacked",
+ "shadowUpdatePlanar4",
+ "shadowUpdatePlanar4x8",
+ NULL
+};
+
+static const char *vbeSymbols[] = {
+ "VBEInit",
+ "vbeDoEDID",
NULL
};
+static const char *ddcSymbols[] = {
+ "xf86PrintEDID",
+ "xf86SetDDCproperties",
+ NULL};
+
#ifdef XFree86LOADER
/* Module loader interface */
@@ -173,7 +190,7 @@ static XF86ModuleVersionInfo vesaVersionRec =
/*
* This data is accessed by the loader. The name must be the module name
- * followed by "ModuleInit".
+ * followed by "ModuleData".
*/
XF86ModuleData vesaModuleData = { &vesaVersionRec, vesaSetup, NULL };
@@ -186,7 +203,11 @@ vesaSetup(pointer Module, pointer Options, int *ErrorMajor, int *ErrorMinor)
{
Initialised = TRUE;
xf86AddDriver(&VESA, Module, 0);
- LoaderRefSymLists(fbSymbols, shadowSymbols, NULL);
+ LoaderRefSymLists(fbSymbols,
+ shadowSymbols,
+ vbeSymbols,
+ ddcSymbols,
+ NULL);
return (pointer)TRUE;
}
@@ -378,29 +399,30 @@ static Bool
VESAPreInit(ScrnInfoPtr pScrn, int flags)
{
VESAPtr pVesa;
- VBEInfoBlock *vbe;
+ VbeInfoBlock *vbe;
DisplayModePtr pMode, tmp;
- ModeInfoBlock *mode;
+ VbeModeInfoBlock *mode;
ModeInfoData *data = NULL;
char *mod = NULL;
const char *reqSym = NULL;
Gamma gzeros = {0.0, 0.0, 0.0};
rgb rzeros = {0, 0, 0};
- vbeInfoPtr pVbe;
pointer pVbeModule, pDDCModule;
int i;
if (flags & PROBE_DETECT)
return (FALSE);
- /* Load int10 module */
- if (!xf86LoadSubModule(pScrn, "int10"))
- return (FALSE);
-
pVesa = VESAGetRec(pScrn);
pVesa->pEnt = xf86GetEntityInfo(pScrn->entityList[0]);
pVesa->device = xf86GetDevFromEntity(pScrn->entityList[0],
pScrn->entityInstanceList[0]);
+ /* Load vbe module */
+ if ((pVbeModule = xf86LoadSubModule(pScrn, "vbe")) == NULL)
+ return (FALSE);
+ if ((pVesa->pVbe = VBEInit(NULL, pVesa->pEnt->index)) == NULL)
+ return (FALSE);
+
if (pVesa->pEnt->location.type == BUS_PCI) {
pVesa->pciInfo = xf86GetPciInfoForEntity(pVesa->pEnt->index);
pVesa->pciTag = pciTag(pVesa->pciInfo->bus, pVesa->pciInfo->device,
@@ -433,175 +455,24 @@ VESAPreInit(ScrnInfoPtr pScrn, int flags)
xf86SetGamma(pScrn, gzeros);
- if ((pVesa->pInt = xf86InitInt10(pVesa->pEnt->index)) == NULL) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "Int10 initialization failed.\n");
- return (FALSE);
- }
-
- if ((pVesa->block = xf86Int10AllocPages(pVesa->pInt, 1, &pVesa->page)) == NULL) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "Cannot allocate one scratch page in real mode memory.\n");
- return (FALSE);
- }
-
- vbe = VESAGetVBEInfo(pScrn);
+ vbe = VBEGetVBEInfo(pVesa->pVbe);
pVesa->major = (unsigned)(vbe->VESAVersion >> 8);
pVesa->minor = vbe->VESAVersion & 0xff;
pVesa->vbeInfo = vbe;
pScrn->videoRam = vbe->TotalMemory * 64 * 1024;
if (pVesa->major >= 2) {
- /* Load vbe module */
- if ((pVbeModule = xf86LoadSubModule(pScrn, "vbe")) == NULL)
- return (FALSE);
- if ((pVbe = VBEInit(pVesa->pInt, pVesa->pEnt->index)) == NULL)
- return (FALSE);
-
/* Load ddc module */
if ((pDDCModule = xf86LoadSubModule(pScrn, "ddc")) == NULL)
return (FALSE);
- if ((pVesa->monitor = vbeDoEDID(pVbe, pDDCModule)) != NULL) {
+ if ((pVesa->monitor = vbeDoEDID(pVesa->pVbe, pDDCModule)) != NULL) {
xf86PrintEDID(pVesa->monitor);
-#ifdef DEBUG
- ErrorF("Monitor data blocks:\n");
- ErrorF("VENDOR: name %s - id %d - serial %d - week %d - year %d\n",
- pVesa->monitor->vendor.name, pVesa->monitor->vendor.prod_id,
- pVesa->monitor->vendor.serial, pVesa->monitor->vendor.week,
- pVesa->monitor->vendor.year);
- ErrorF("EDID: Version %d - Revision %d\n",
- pVesa->monitor->ver.version,
- pVesa->monitor->ver.revision);
- ErrorF("FEATURES:\n input: type %d - voltage %d - setup %d - sync %d\n"
- " size: %d x %d\n gamma: %f\n dpms: %d\n type: %d\n"
- " misc: %d\n redx %d - redy %d\n greenx %d - greeny %d\n"
- " bluex: %d - bluey %d\n whitex %d - whitey\n"
- "ESTABLISHED TIMES: %d %d %d\n"
- "STD TIMINGS:\n",
- pVesa->monitor->features.input_type,
- pVesa->monitor->features.input_voltage,
- pVesa->monitor->features.input_setup,
- pVesa->monitor->features.input_sync,
- pVesa->monitor->features.hsize, pVesa->monitor->features.vsize,
- pVesa->monitor->features.gamma,
- pVesa->monitor->features.dpms,
- pVesa->monitor->features.display_type,
- pVesa->monitor->features.msc, pVesa->monitor->features.redx,
- pVesa->monitor->features.redy,
- pVesa->monitor->features.greenx, pVesa->monitor->features.greeny,
- pVesa->monitor->features.bluex, pVesa->monitor->features.bluey,
- pVesa->monitor->features.whitex, pVesa->monitor->features.whitey,
- pVesa->monitor->timings1.t1,
- pVesa->monitor->timings1.t2,
- pVesa->monitor->timings1.t_manu);
- for (i = 0; i < 8; i++) {
- ErrorF(" %d %d %d %d\n",
- pVesa->monitor->timings2[i].hsize,
- pVesa->monitor->timings2[i].vsize,
- pVesa->monitor->timings2[i].refresh,
- pVesa->monitor->timings2[i].id);
- }
- ErrorF("DETAILED MONITOR SECTION:\n");
- for (i = 0; i < 4; i++) {
- int j;
-
- ErrorF(" type ");
- switch (pVesa->monitor->det_mon[i].type) {
- case DT:
- ErrorF("DT\n");
- ErrorF(" clock: %d\n"
- " hactive: %d\n hblanking: %d\n"
- " vactive: %d\n vblanking: %d\n"
- " hsyncoff: %d\n hsyncwidth: %d\n"
- " vsyncoff: %d\n vsyncwidth: %d\n"
- " hsize: %d\n vsize: %d\n"
- " hborder: %d\n vborder: %d\n"
- " interlaced: %d\n stereo: %d\n"
- " sync: %d\n misc: %d\n",
- pVesa->monitor->det_mon[i].section.d_timings.clock,
- pVesa->monitor->det_mon[i].section.d_timings.h_active,
- pVesa->monitor->det_mon[i].section.d_timings.h_blanking,
- pVesa->monitor->det_mon[i].section.d_timings.v_active,
- pVesa->monitor->det_mon[i].section.d_timings.v_blanking,
- pVesa->monitor->det_mon[i].section.d_timings.h_sync_off,
- pVesa->monitor->det_mon[i].section.d_timings.h_sync_width,
- pVesa->monitor->det_mon[i].section.d_timings.v_sync_off,
- pVesa->monitor->det_mon[i].section.d_timings.v_sync_width,
- pVesa->monitor->det_mon[i].section.d_timings.h_size,
- pVesa->monitor->det_mon[i].section.d_timings.v_size,
- pVesa->monitor->det_mon[i].section.d_timings.h_border,
- pVesa->monitor->det_mon[i].section.d_timings.v_border,
- pVesa->monitor->det_mon[i].section.d_timings.interlaced,
- pVesa->monitor->det_mon[i].section.d_timings.stereo,
- pVesa->monitor->det_mon[i].section.d_timings.sync,
- pVesa->monitor->det_mon[i].section.d_timings.misc);
- break;
- case DS_SERIAL:
- ErrorF("SERIAL\n");
- ErrorF(" serial: %s\n", pVesa->monitor->det_mon[i].section.serial);
- break;
- case DS_ASCII_STR:
- ErrorF("ASCII_STR\n");
- ErrorF(" ascii_str: %s\n", pVesa->monitor->det_mon[i].section.ascii_data);
- break;
- case DS_NAME:
- ErrorF("NAME\n");
- ErrorF(" name: %s\n", pVesa->monitor->det_mon[i].section.name);
- break;
- case DS_RANGES:
- ErrorF("RANGES\n");
- ErrorF(" ranges: minv %d - maxv %d - minh %d - maxh %d - maxclock %d\n",
- pVesa->monitor->det_mon[i].section.ranges.min_v,
- pVesa->monitor->det_mon[i].section.ranges.max_v,
- pVesa->monitor->det_mon[i].section.ranges.min_h,
- pVesa->monitor->det_mon[i].section.ranges.min_h,
- pVesa->monitor->det_mon[i].section.ranges.max_clock);
- break;
- case DS_WHITE_P:
- ErrorF("WHITE_P\n");
- for (j = 0; j < 2; j++)
- ErrorF(" index %d - whitex %d - whitey %d - whitegamma %d\n",
- pVesa->monitor->det_mon[i].section.wp[j].index,
- pVesa->monitor->det_mon[i].section.wp[j].white_x,
- pVesa->monitor->det_mon[i].section.wp[j].white_y,
- pVesa->monitor->det_mon[i].section.wp[j].white_gamma);
- break;
- case DS_STD_TIMINGS:
- ErrorF("STD_TIMINGS\n");
- for (j = 0; j < 5; j++)
- ErrorF(" %d %d %d %d\n",
- pVesa->monitor->det_mon[i].section.std_t[j].hsize,
- pVesa->monitor->det_mon[i].section.std_t[j].vsize,
- pVesa->monitor->det_mon[i].section.std_t[j].refresh,
- pVesa->monitor->det_mon[i].section.std_t[j].id);
- break;
- default:
- ErrorF(" UNKNOWN\n");
- break;
- }
- }
-#endif
}
- /* unload modules */
- xf86UnloadSubModule(pVbeModule);
xf86UnloadSubModule(pDDCModule);
}
-#ifdef DEBUG
- ErrorF("%c%c%c%c %d.%d - %s\n",
- vbe->VESASignature[0], vbe->VESASignature[1],
- vbe->VESASignature[2], vbe->VESASignature[3],
- pVesa->major, pVesa->minor, vbe->OEMStringPtr);
-
- if (pVesa->major >= 2)
- ErrorF("Vendor: %s\nProduct: %s\nProductRev: %s\nSoftware Rev: %d.%d\n",
- vbe->OemVendorNamePtr, vbe->OemProductNamePtr,
- vbe->OemProductRevPtr, (unsigned)vbe->OemSoftwareRev >> 8,
- vbe->OemSoftwareRev & 0xff);
-#endif
-
/* Set display resolution */
xf86SetDpi(pScrn, 0, 0);
@@ -616,56 +487,8 @@ VESAPreInit(ScrnInfoPtr pScrn, int flags)
while (vbe->VideoModePtr[i] != 0xffff) {
int id = vbe->VideoModePtr[i++];
- if ((mode = VESAGetModeInfo(pScrn, id)) == NULL)
- continue;
-
- if (!(mode->ModeAttributes & (1 << 0)) || /* supported in the configured hardware */
- !(mode->ModeAttributes & (1 << 4)) || /* text mode */
- (pScrn->bitsPerPixel != 1 && !(mode->ModeAttributes & (1 << 3))) || /* monochrome */
- (mode->BitsPerPixel > 8 &&
- (mode->RedMaskSize + mode->GreenMaskSize +
- mode->BlueMaskSize != pScrn->depth)) ||
- /* only linear mode, but no PhysBasePtr */
- ((mode->ModeAttributes & (1 << 6)) &&
- (mode->ModeAttributes & (1 << 7)) && !mode->PhysBasePtr) ||
- ((mode->ModeAttributes & (1 << 6)) &&
- !(mode->ModeAttributes & (1 << 7))) ||
- mode->BitsPerPixel != pScrn->bitsPerPixel) {
- VESAFreeModeInfo(mode);
+ if ((mode = VBEGetModeInfo(pVesa->pVbe, id)) == NULL)
continue;
- }
-
- pMode = xcalloc(sizeof(DisplayModeRec), 1);
- pMode->prev = pMode->next = NULL;
-
- pMode->status = MODE_OK;
- pMode->type = M_T_DEFAULT;/*M_T_BUILTIN;*/
-
- /* for adjust frame */
- pMode->HDisplay = mode->XResolution;
- pMode->VDisplay = mode->YResolution;
-
- data = xcalloc(sizeof(ModeInfoData), 1);
- data->mode = id;
- data->data = mode;
- pMode->PrivSize = sizeof(ModeInfoData);
- pMode->Private = (INT32*)data;
-
- if (pScrn->modePool == NULL) {
- pScrn->modePool = pMode;
- pMode->next = pMode->prev = pMode;
- }
- else {
- tmp = pScrn->modePool;
-
- tmp->prev = pMode;
- while (tmp->next != pScrn->modePool)
- tmp = tmp->next;
- tmp->next = pMode;
- pMode->prev = tmp;
- pMode->next = pScrn->modePool;
- }
-
#ifdef DEBUG
ErrorF("Mode: %x (%dx%d)\n", id, mode->XResolution, mode->YResolution);
ErrorF(" ModeAttributes: 0x%x\n", mode->ModeAttributes);
@@ -714,6 +537,54 @@ VESAPreInit(ScrnInfoPtr pScrn, int flags)
}
}
#endif
+
+ if (!(mode->ModeAttributes & (1 << 0)) || /* supported in the configured hardware */
+ !(mode->ModeAttributes & (1 << 4)) || /* text mode */
+ (pScrn->bitsPerPixel != 1 && !(mode->ModeAttributes & (1 << 3))) || /* monochrome */
+ (mode->BitsPerPixel > 8 &&
+ (mode->RedMaskSize + mode->GreenMaskSize +
+ mode->BlueMaskSize != pScrn->depth)) ||
+ /* only linear mode, but no PhysBasePtr */
+ ((mode->ModeAttributes & (1 << 6)) &&
+ (mode->ModeAttributes & (1 << 7)) && !mode->PhysBasePtr) ||
+ ((mode->ModeAttributes & (1 << 6)) &&
+ !(mode->ModeAttributes & (1 << 7))) ||
+ mode->BitsPerPixel != pScrn->bitsPerPixel) {
+ VBEFreeModeInfo(mode);
+ continue;
+ }
+
+ pMode = xcalloc(sizeof(DisplayModeRec), 1);
+ pMode->prev = pMode->next = NULL;
+
+ pMode->status = MODE_OK;
+ pMode->type = M_T_DEFAULT;/*M_T_BUILTIN;*/
+
+ /* for adjust frame */
+ pMode->HDisplay = mode->XResolution;
+ pMode->VDisplay = mode->YResolution;
+
+ data = xcalloc(sizeof(ModeInfoData), 1);
+ data->mode = id;
+ data->data = mode;
+ pMode->PrivSize = sizeof(ModeInfoData);
+ pMode->Private = (INT32*)data;
+
+ if (pScrn->modePool == NULL) {
+ pScrn->modePool = pMode;
+ pMode->next = pMode->prev = pMode;
+ }
+ else {
+ tmp = pScrn->modePool;
+
+ tmp->prev = pMode;
+ while (tmp->next != pScrn->modePool)
+ tmp = tmp->next;
+ tmp->next = pMode;
+ pMode->prev = tmp;
+ pMode->next = pScrn->modePool;
+ }
+
}
#ifdef DEBUG
@@ -813,7 +684,7 @@ VESAPreInit(ScrnInfoPtr pScrn, int flags)
/* copy the "interesting" information */
memcpy((char*)pMode + from, (char*)tmp + from, to - from);
data = (ModeInfoData*)pMode->Private;
- data->block = xcalloc(sizeof(CRTCInfoBlock), 1);
+ data->block = xcalloc(sizeof(VbeCRTCInfoBlock), 1);
data->block->HorizontalTotal = pMode->HTotal;
data->block->HorizontalSyncStart = pMode->HSyncStart;
data->block->HorizontalSyncEnd = pMode->HSyncEnd;
@@ -858,6 +729,9 @@ VESAPreInit(ScrnInfoPtr pScrn, int flags)
if (pVesa->shadowFB) {
mod = "fb";
reqSym = "fbScreenInit";
+ pScrn->bitmapBitOrder = BITMAP_BIT_ORDER;
+
+ xf86LoaderReqSymbols("fbPictureInit", NULL);
}
else {
switch (pScrn->bitsPerPixel) {
@@ -877,29 +751,11 @@ VESAPreInit(ScrnInfoPtr pScrn, int flags)
}
break;
case 0x4: /* Packed pixel */
- mod = "fb";
- reqSym = "fbScreenInit";
-
- switch (pScrn->bitsPerPixel) {
- case 8:
- case 16:
- case 32:
- break;
- case 24:
- if (pVesa->pix24bpp == 32) {
- mod = "xf24_32bpp";
- reqSym = "cfb24_32ScreenInit";
- }
- break;
- default:
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "Unsupported bpp: %d", pScrn->bitsPerPixel);
- return FALSE;
- }
- break;
case 0x6: /* Direct Color */
mod = "fb";
reqSym = "fbScreenInit";
+ pScrn->bitmapBitOrder = BITMAP_BIT_ORDER;
+ xf86LoaderReqSymbols("fbPictureInit", NULL);
switch (pScrn->bitsPerPixel) {
case 8:
@@ -907,7 +763,7 @@ VESAPreInit(ScrnInfoPtr pScrn, int flags)
case 32:
break;
case 24:
- if (pVesa->pix24bpp == 32) {
+ if (pVesa->pix24bpp == 32) {
mod = "xf24_32bpp";
reqSym = "cfb24_32ScreenInit";
}
@@ -936,9 +792,6 @@ VESAPreInit(ScrnInfoPtr pScrn, int flags)
return (FALSE);
}
xf86LoaderReqSymbols(reqSym, NULL);
-#ifdef RENDER
- xf86LoaderReqSymbols("fbPictureInit", NULL);
-#endif
return (TRUE);
}
@@ -949,7 +802,7 @@ VESAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
VESAPtr pVesa = VESAGetRec(pScrn);
VisualPtr visual;
- ModeInfoBlock *mode;
+ VbeModeInfoBlock *mode;
int flags;
if (pVesa->mapPhys == 0) {
@@ -982,7 +835,7 @@ VESAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
/* save current video state */
VESASaveRestore(pScrn, MODE_SAVE);
- pVesa->savedPal = VESASetGetPaletteData(pScrn, FALSE, 0, 256,
+ pVesa->savedPal = VBESetGetPaletteData(pVesa->pVbe, FALSE, 0, 256,
NULL, FALSE, FALSE);
/* set first video mode */
@@ -1019,14 +872,23 @@ VESAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
return (FALSE);
case 0x3: /* Planar */
if (pVesa->shadowFB) {
- if (!fbScreenInit(pScreen,
- pVesa->shadowPtr,
- pScrn->virtualX, pScrn->virtualY,
- pScrn->xDpi, pScrn->yDpi,
- pScrn->displayWidth, pScrn->bitsPerPixel))
+ if (pScrn->depth == 1) {
+ if (!mfbScreenInit(pScreen,
+ pVesa->shadowPtr,
+ pScrn->virtualX, pScrn->virtualY,
+ pScrn->xDpi, pScrn->yDpi,
+ pScrn->displayWidth))
+ return FALSE;
+ } else {
+ if (!fbScreenInit(pScreen,
+ pVesa->shadowPtr,
+ pScrn->virtualX, pScrn->virtualY,
+ pScrn->xDpi, pScrn->yDpi,
+ pScrn->displayWidth, pScrn->bitsPerPixel))
return (FALSE);
- }
- else {
+ fbPictureInit(pScreen, 0, 0);
+ }
+ } else {
switch (pScrn->bitsPerPixel) {
case 1:
if (!xf1bppScreenInit(pScreen, pVesa->base,
@@ -1052,38 +914,11 @@ VESAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
}
break;
case 0x4: /* Packed pixel */
- switch (pScrn->bitsPerPixel) {
- case 24:
- if (pVesa->pix24bpp == 32) {
- if (!cfb24_32ScreenInit(pScreen,
- pVesa->shadowFB ? pVesa->shadowPtr : pVesa->base,
- pScrn->virtualX, pScrn->virtualY,
- pScrn->xDpi, pScrn->yDpi,
- pScrn->displayWidth))
- return (FALSE);
- break;
- }
- case 8:
- case 16:
- case 32:
- if (!fbScreenInit(pScreen,
- pVesa->shadowFB ? pVesa->shadowPtr : pVesa->base,
- pScrn->virtualX, pScrn->virtualY,
- pScrn->xDpi, pScrn->yDpi,
- pScrn->displayWidth, pScrn->bitsPerPixel))
- return (FALSE);
- break;
- default:
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "Unsupported bpp: %d", pScrn->bitsPerPixel);
- return FALSE;
- }
- break;
case 0x6: /* Direct Color */
switch (pScrn->bitsPerPixel) {
case 24:
if (pVesa->pix24bpp == 32) {
- if (!cfb24_32ScreenInit(pScreen,
+ if (!cfb24_32ScreenInit(pScreen,
pVesa->shadowFB ? pVesa->shadowPtr : pVesa->base,
pScrn->virtualX, pScrn->virtualY,
pScrn->xDpi, pScrn->yDpi,
@@ -1100,6 +935,7 @@ VESAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
pScrn->xDpi, pScrn->yDpi,
pScrn->displayWidth, pScrn->bitsPerPixel))
return (FALSE);
+ fbPictureInit(pScreen, 0, 0);
break;
default:
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
@@ -1109,9 +945,6 @@ VESAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
break;
}
-#ifdef RENDER
- fbPictureInit(pScreen, 0, 0);
-#endif
if (pScrn->bitsPerPixel > 8) {
/* Fixup RGB ordering */
@@ -1133,7 +966,7 @@ VESAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
ShadowWindowProc window;
if (mode->MemoryModel == 3) { /* Planar */
- if (pScrn->bitsPerPixel == 8)
+ if (pScrn->bitsPerPixel == 8)
update = shadowUpdatePlanar4x8;
else
update = shadowUpdatePlanar4;
@@ -1216,7 +1049,7 @@ VESACloseScreen(int scrnIndex, ScreenPtr pScreen)
VESAPtr pVesa = VESAGetRec(pScrn);
VESASaveRestore(xf86Screens[scrnIndex], MODE_RESTORE);
- VESASetGetPaletteData(pScrn, TRUE, 0, 256,
+ VBESetGetPaletteData(pVesa->pVbe, TRUE, 0, 256,
pVesa->savedPal, FALSE, TRUE);
VESAUnmapVidMem(pScrn);
@@ -1255,9 +1088,9 @@ VESASetMode(ScrnInfoPtr pScrn, DisplayModePtr pMode)
if (pVesa->mapPhys != 0xa0000)
mode |= 1 << 14;
- if (VESASetVBEMode(pScrn, mode, data->block) == FALSE) {
+ if (VBESetVBEMode(pVesa->pVbe, mode, data->block) == FALSE) {
if ((data->block || (data->mode & (1 << 11))) &&
- VESASetVBEMode(pScrn, (mode & ~(1 << 11)), NULL) == TRUE) {
+ VBESetVBEMode(pVesa->pVbe, (mode & ~(1 << 11)), NULL) == TRUE) {
/* Some cards do not like setting the clock.
* Free it as it will not be any longer useful
*/
@@ -1275,10 +1108,10 @@ VESASetMode(ScrnInfoPtr pScrn, DisplayModePtr pMode)
!((data->data->WinBSegment == 0) && (data->data->WinBAttributes == 0));
if (data->data->XResolution != pScrn->virtualX)
- VESASetLogicalScanline(pScrn, pScrn->virtualX);
+ VBESetLogicalScanline(pVesa->pVbe, pScrn->virtualX);
if (pScrn->bitsPerPixel >= 8 && pVesa->vbeInfo->Capabilities[0] & 0x01)
- VESASetGetDACPaletteFormat(pScrn, 8);
+ VBESetGetDACPaletteFormat(pVesa->pVbe, 8);
pScrn->vtSema = TRUE;
@@ -1288,10 +1121,9 @@ VESASetMode(ScrnInfoPtr pScrn, DisplayModePtr pMode)
static void
VESAAdjustFrame(int scrnIndex, int x, int y, int flags)
{
- ScrnInfoPtr pScrn;
+ VESAPtr pVesa = VESAGetRec(xf86Screens[scrnIndex]);
- pScrn = xf86Screens[scrnIndex];
- VESASetDisplayStart(pScrn, x, y, TRUE);
+ VBESetDisplayStart(pVesa->pVbe, x, y, TRUE);
}
static void
@@ -1348,13 +1180,12 @@ VESAWindowPlanar(ScreenPtr pScreen, CARD32 row, CARD32 offset, int mode,
{
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
VESAPtr pVesa = VESAGetRec(pScrn);
- ModeInfoBlock *data = ((ModeInfoData*)(pScrn->currentMode->Private))->data;
+ VbeModeInfoBlock *data = ((ModeInfoData*)(pScrn->currentMode->Private))->data;
int window;
int mask = 1 << (offset & 3);
outb(0x3c4, 2);
outb(0x3c5, mask);
-
offset = (offset >> 2) + pVesa->maxBytesPerScanline * row;
window = offset / (data->WinGranularity * 1024);
pVesa->windowAoffset = window * data->WinGranularity * 1024;
@@ -1382,7 +1213,7 @@ VESAWindowWindowed(ScreenPtr pScreen, CARD32 row, CARD32 offset, int mode,
{
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
VESAPtr pVesa = VESAGetRec(pScrn);
- ModeInfoBlock *data = ((ModeInfoData*)(pScrn->currentMode->Private))->data;
+ VbeModeInfoBlock *data = ((ModeInfoData*)(pScrn->currentMode->Private))->data;
int window;
offset += pVesa->maxBytesPerScanline * row;
@@ -1416,14 +1247,14 @@ VESALoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices,
(colors[j].green << 8) |
(colors[j].red << 16);
if (j != idx) {
- VESASetGetPaletteData(pScrn, TRUE, base, idx - base,
+ VBESetGetPaletteData(pVesa->pVbe, TRUE, base, idx - base,
pVesa->pal + base, FALSE, TRUE);
idx = base = j;
}
}
if (idx - 1 == indices[i - 1])
- VESASetGetPaletteData(pScrn, TRUE, base, idx - base,
+ VBESetGetPaletteData(pVesa->pVbe, TRUE, base, idx - base,
pVesa->pal + base, FALSE, TRUE);
#else
#define WriteDacWriteAddr(value) outb(VGA_DAC_WRITE_ADDR, value)
@@ -1668,281 +1499,28 @@ VESASaveScreen(ScreenPtr pScreen, int mode)
return (TRUE);
}
-VBEInfoBlock *
-VESAGetVBEInfo(ScrnInfoPtr pScrn)
-{
- VESAPtr pVesa;
- VBEInfoBlock *block = NULL;
- int i, pStr, pModes;
- char *str;
- CARD16 major, minor, *modes;
-
- pVesa = VESAGetRec(pScrn);
- bzero(pVesa->block, sizeof(VBEInfoBlock));
-
- /*
- Input:
- AH := 4Fh Super VGA support
- AL := 00h Return Super VGA information
- ES:DI := Pointer to buffer
-
- Output:
- AX := status
- (All other registers are preserved)
- */
-
- pVesa->block[0] = 'V';
- pVesa->block[1] = 'B';
- pVesa->block[2] = 'E';
- pVesa->block[3] = '2';
-
- pVesa->pInt->num = 0x10;
- pVesa->pInt->ax = 0x4f00;
- pVesa->pInt->es = SEG_ADDR(pVesa->page);
- pVesa->pInt->di = SEG_OFF(pVesa->page);
- xf86ExecX86int10(pVesa->pInt);
-
- if (pVesa->pInt->ax != 0x4f)
- return (NULL);
-
- block = xcalloc(sizeof(VBEInfoBlock), 1);
- block->VESASignature[0] = pVesa->block[0];
- block->VESASignature[1] = pVesa->block[1];
- block->VESASignature[2] = pVesa->block[2];
- block->VESASignature[3] = pVesa->block[3];
-
- block->VESAVersion = *(CARD16*)(pVesa->block + 4);
- major = (unsigned)block->VESAVersion >> 8;
- minor = block->VESAVersion & 0xff;
-
- pStr = *(CARD32*)(pVesa->block + 6);
- str = xf86int10Addr(pVesa->pInt, FARP(pStr));
- block->OEMStringPtr = strdup(str);
-
- block->Capabilities[0] = pVesa->block[10];
- block->Capabilities[1] = pVesa->block[11];
- block->Capabilities[2] = pVesa->block[12];
- block->Capabilities[3] = pVesa->block[13];
-
- pModes = *(CARD32*)(pVesa->block + 14);
- modes = xf86int10Addr(pVesa->pInt, FARP(pModes));
- i = 0;
- while (modes[i] != 0xffff)
- i++;
- block->VideoModePtr = xalloc(sizeof(CARD16) * i + 1);
- memcpy(block->VideoModePtr, modes, sizeof(CARD16) * i);
- block->VideoModePtr[i] = 0xffff;
-
- block->TotalMemory = *(CARD16*)(pVesa->block + 18);
-
- if (major < 2)
- memcpy(&block->OemSoftwareRev, pVesa->block + 20, 236);
- else {
- block->OemSoftwareRev = *(CARD16*)(pVesa->block + 20);
- pStr = *(CARD32*)(pVesa->block + 22);
- str = xf86int10Addr(pVesa->pInt, FARP(pStr));
- block->OemVendorNamePtr = strdup(str);
- pStr = *(CARD32*)(pVesa->block + 26);
- str = xf86int10Addr(pVesa->pInt, FARP(pStr));
- block->OemProductNamePtr = strdup(str);
- pStr = *(CARD32*)(pVesa->block + 30);
- str = xf86int10Addr(pVesa->pInt, FARP(pStr));
- block->OemProductRevPtr = strdup(str);
- memcpy(&block->Reserved, pVesa->block + 34, 222);
- memcpy(&block->OemData, pVesa->block + 256, 256);
- }
-
- return (block);
-}
-
-void
-VESAFreeVBEInfo(VBEInfoBlock *block)
-{
- xfree(block->OEMStringPtr);
- xfree(block->VideoModePtr);
- if (((unsigned)block->VESAVersion >> 8) >= 2) {
- xfree(block->OemVendorNamePtr);
- xfree(block->OemProductNamePtr);
- xfree(block->OemProductRevPtr);
- }
- xfree(block);
-}
-
-Bool
-VESASetVBEMode(ScrnInfoPtr pScrn, int mode, CRTCInfoBlock *block)
-{
- VESAPtr pVesa;
-
- pVesa = VESAGetRec(pScrn);
- /*
- Input:
- AH := 4Fh Super VGA support
- AL := 02h Set Super VGA video mode
- BX := Video mode
- D0-D8 := Mode number
- D9-D10 := Reserved (must be 0)
- D11 := 0 Use current default refresh rate
- := 1 Use user specified CRTC values for refresh rate
- D12-13 Reserved for VBE/AF (must be 0)
- D14 := 0 Use windowed frame buffer model
- := 1 Use linear/flat frame buffer model
- D15 := 0 Clear video memory
- := 1 Don't clear video memory
- ES:DI := Pointer to CRTCInfoBlock structure
-
- Output: AX = Status
- (All other registers are preserved)
- */
- pVesa->pInt->num = 0x10;
- pVesa->pInt->ax = 0x4f02;
- pVesa->pInt->bx = mode;
- if (block) {
- pVesa->pInt->bx |= 1 << 11;
- memcpy(pVesa->block, block, sizeof(CRTCInfoBlock));
- pVesa->pInt->es = SEG_ADDR(pVesa->page);
- pVesa->pInt->di = SEG_OFF(pVesa->page);
- }
-
- xf86ExecX86int10(pVesa->pInt);
-
- return (pVesa->pInt->ax == 0x4f);
-}
-
-Bool
-VESAGetVBEMode(ScrnInfoPtr pScrn, int *mode)
-{
- VESAPtr pVesa;
-
- pVesa = VESAGetRec(pScrn);
- /*
- Input:
- AH := 4Fh Super VGA support
- AL := 03h Return current video mode
-
- Output:
- AX := Status
- BX := Current video mode
- (All other registers are preserved)
- */
- pVesa->pInt->num = 0x10;
- pVesa->pInt->ax = 0x4f03;
-
- xf86ExecX86int10(pVesa->pInt);
-
- if (pVesa->pInt->ax == 0x4f) {
- *mode = pVesa->pInt->bx;
-
- return (TRUE);
- }
-
- return (FALSE);
-}
-
-ModeInfoBlock *
-VESAGetModeInfo(ScrnInfoPtr pScrn, int mode)
+static int
+VESABankSwitch(ScreenPtr pScreen, unsigned int iBank)
{
VESAPtr pVesa;
- ModeInfoBlock *block = NULL;
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
pVesa = VESAGetRec(pScrn);
- bzero(pVesa->block, sizeof(ModeInfoBlock));
-
- /*
- Input:
- AH := 4Fh Super VGA support
- AL := 01h Return Super VGA mode information
- CX := Super VGA video mode
- (mode number must be one of those returned by Function 0)
- ES:DI := Pointer to buffer
-
- Output:
- AX := status
- (All other registers are preserved)
- */
- pVesa->pInt->num = 0x10;
- pVesa->pInt->ax = 0x4f01;
- pVesa->pInt->cx = mode;
- pVesa->pInt->es = SEG_ADDR(pVesa->page);
- pVesa->pInt->di = SEG_OFF(pVesa->page);
- xf86ExecX86int10(pVesa->pInt);
- if (pVesa->pInt->ax != 0x4f)
- return (NULL);
-
- block = xcalloc(sizeof(ModeInfoBlock), 1);
-
- block->ModeAttributes = *(CARD16*)pVesa->block;
- block->WinAAttributes = pVesa->block[2];
- block->WinBAttributes = pVesa->block[3];
- block->WinGranularity = *(CARD16*)(pVesa->block + 4);
- block->WinSize = *(CARD16*)(pVesa->block + 6);
- block->WinASegment = *(CARD16*)(pVesa->block + 8);
- block->WinBSegment = *(CARD16*)(pVesa->block + 10);
- block->WinFuncPtr = *(CARD32*)(pVesa->block + 12);
- block->BytesPerScanline = *(CARD16*)(pVesa->block + 16);
-
- /* mandatory information for VBE 1.2 and above */
- block->XResolution = *(CARD16*)(pVesa->block + 18);
- block->YResolution = *(CARD16*)(pVesa->block + 20);
- block->XCharSize = pVesa->block[22];
- block->YCharSize = pVesa->block[23];
- block->NumberOfPlanes = pVesa->block[24];
- block->BitsPerPixel = pVesa->block[25];
- block->NumberOfBanks = pVesa->block[26];
- block->MemoryModel = pVesa->block[27];
- block->BankSize = pVesa->block[28];
- block->NumberOfImages = pVesa->block[29];
- block->Reserved = pVesa->block[30];
-
- /* Direct color fields (required for direct/6 and YUV/7 memory models) */
- block->RedMaskSize = pVesa->block[31];
- block->RedFieldPosition = pVesa->block[32];
- block->GreenMaskSize = pVesa->block[33];
- block->GreenFieldPosition = pVesa->block[34];
- block->BlueMaskSize = pVesa->block[35];
- block->BlueFieldPosition = pVesa->block[36];
- block->RsvdMaskSize = pVesa->block[37];
- block->RsvdFieldPosition = pVesa->block[38];
- block->DirectColorModeInfo = pVesa->block[39];
-
- /* Mandatory information for VBE 2.0 and above */
- if (pVesa->major >= 2) {
- block->PhysBasePtr = *(CARD32*)(pVesa->block + 40);
- block->Reserved32 = *(CARD32*)(pVesa->block + 44);
- block->Reserved16 = *(CARD16*)(pVesa->block + 48);
-
- /* Mandatory information for VBE 3.0 and above */
- if (pVesa->major >= 3) {
- block->LinBytesPerScanLine = *(CARD16*)(pVesa->block + 50);
- block->BnkNumberOfImagePages = pVesa->block[52];
- block->LinNumberOfImagePages = pVesa->block[53];
- block->LinRedMaskSize = pVesa->block[54];
- block->LinRedFieldPosition = pVesa->block[55];
- block->LinGreenMaskSize = pVesa->block[56];
- block->LinGreenFieldPosition = pVesa->block[57];
- block->LinBlueMaskSize = pVesa->block[58];
- block->LinBlueFieldPosition = pVesa->block[59];
- block->LinRsvdMaskSize = pVesa->block[60];
- block->LinRsvdFieldPosition = pVesa->block[61];
- block->MaxPixelClock = *(CARD32*)(pVesa->block + 62);
- memcpy(&block->Reserved2, pVesa->block + 66, 188);
- }
- else
- memcpy(&block->LinBytesPerScanLine, pVesa->block + 50, 206);
+ if (pVesa->curBank == iBank)
+ return (0);
+ if (!VBEBankSwitch(pVesa->pVbe, iBank, 0))
+ return (1);
+ if (pVesa->bankSwitchWindowB) {
+ if (!VBEBankSwitch(pVesa->pVbe, iBank, 1))
+ return (1);
}
- else
- memcpy(&block->PhysBasePtr, pVesa->block + 40, 216);
-
- return (block);
-}
+ pVesa->curBank = iBank;
-void
-VESAFreeModeInfo(ModeInfoBlock *block)
-{
- xfree(block);
+ return (0);
}
Bool
-VESASaveRestore(ScrnInfoPtr pScrn, int function)
+VESASaveRestore(ScrnInfoPtr pScrn, vbeSaveRestoreFunction function)
{
VESAPtr pVesa;
@@ -1951,376 +1529,55 @@ VESASaveRestore(ScrnInfoPtr pScrn, int function)
pVesa = VESAGetRec(pScrn);
- /*
- Input:
- AH := 4Fh Super VGA support
- AL := 04h Save/restore Super VGA video state
- DL := 00h Return save/restore state buffer size
- CX := Requested states
- D0 = Save/restore video hardware state
- D1 = Save/restore video BIOS data state
- D2 = Save/restore video DAC state
- D3 = Save/restore Super VGA state
-
- Output:
- AX = Status
- BX = Number of 64-byte blocks to hold the state buffer
- (All other registers are preserved)
-
-
- Input:
- AH := 4Fh Super VGA support
- AL := 04h Save/restore Super VGA video state
- DL := 01h Save Super VGA video state
- CX := Requested states (see above)
- ES:BX := Pointer to buffer
-
- Output:
- AX := Status
- (All other registers are preserved)
-
-
- Input:
- AH := 4Fh Super VGA support
- AL := 04h Save/restore Super VGA video state
- DL := 02h Restore Super VGA video state
- CX := Requested states (see above)
- ES:BX := Pointer to buffer
-
- Output:
- AX := Status
- (All other registers are preserved)
- */
/* Query amount of memory to save state */
if (function == MODE_QUERY ||
(function == MODE_SAVE && pVesa->state == NULL)) {
- int npages;
/* Make sure we save at least this information in case of failure */
- (void)VESAGetVBEMode(pScrn, &pVesa->stateMode);
+ (void)VBEGetVBEMode(pVesa->pVbe, &pVesa->stateMode);
SaveFonts(pScrn);
if (pVesa->major > 1) {
- pVesa->pInt->num = 0x10;
- pVesa->pInt->ax = 0x4f04;
- pVesa->pInt->dx = 0;
- pVesa->pInt->cx = 0x000f;
- xf86ExecX86int10(pVesa->pInt);
- if (pVesa->pInt->ax != 0x4f)
- return (FALSE);
+ if (!VBESaveRestore(pVesa->pVbe,function,(pointer)&pVesa->state,
+ &pVesa->stateSize,&pVesa->statePage))
+ return FALSE;
- npages = (pVesa->pInt->bx * 64) / 4096 + 1;
- if ((pVesa->state = xf86Int10AllocPages(pVesa->pInt, npages,
- &pVesa->statePage)) == NULL) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "Cannot allocate memory to save SVGA state.\n");
- return (FALSE);
- }
}
}
/* Save/Restore Super VGA state */
if (function != MODE_QUERY) {
- int ax_reg = 0;
+ Bool retval = TRUE;
if (pVesa->major > 1) {
- pVesa->pInt->num = 0x10;
- pVesa->pInt->ax = 0x4f04;
- pVesa->pInt->dx = function;
- pVesa->pInt->cx = 0x000f;
-
if (function == MODE_RESTORE)
memcpy(pVesa->state, pVesa->pstate, pVesa->stateSize);
- pVesa->pInt->es = SEG_ADDR(pVesa->statePage);
- pVesa->pInt->bx = SEG_OFF(pVesa->statePage);
- xf86ExecX86int10(pVesa->pInt);
- ax_reg = pVesa->pInt->ax;
+ if ((retval = VBESaveRestore(pVesa->pVbe,function,
+ (pointer)&pVesa->state,
+ &pVesa->stateSize,&pVesa->statePage))
+ && function == MODE_SAVE) {
+ /* don't rely on the memory not being touched */
+ if (pVesa->pstate == NULL)
+ pVesa->pstate = xalloc(pVesa->stateSize);
+ memcpy(pVesa->pstate, pVesa->state, pVesa->stateSize);
+ }
}
if (function == MODE_RESTORE) {
- VESASetVBEMode(pScrn, pVesa->stateMode, NULL);
+ VBESetVBEMode(pVesa->pVbe, pVesa->stateMode, NULL);
RestoreFonts(pScrn);
}
- if (pVesa->major > 1) {
- if (ax_reg != 0x4f)
- return (FALSE);
-
- if (function == MODE_SAVE && pVesa->pstate == NULL) {
- /* don't rely on the memory not being touched */
- pVesa->stateSize = pVesa->pInt->bx * 64;
- pVesa->pstate = xalloc(pVesa->stateSize);
- memcpy(pVesa->pstate, pVesa->state, pVesa->stateSize);
- }
- }
- }
-
- return (TRUE);
-}
-
-int
-VESABankSwitch(ScreenPtr pScreen, unsigned int iBank)
-{
- VESAPtr pVesa;
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
-
- pVesa = VESAGetRec(pScrn);
- if (pVesa->curBank == iBank)
- return (0);
- pVesa->curBank = iBank;
-
- /*
- Input:
- AH := 4Fh Super VGA support
- AL := 05h
-
- Output:
- */
- pVesa->pInt->num = 0x10;
- pVesa->pInt->ax = 0x4f05;
- pVesa->pInt->bx = 0;
- pVesa->pInt->dx = iBank;
- xf86ExecX86int10(pVesa->pInt);
-
- if (pVesa->pInt->ax != 0x4f)
- return (1);
-
- if (pVesa->bankSwitchWindowB) {
- pVesa->pInt->num = 0x10;
- pVesa->pInt->ax = 0x4f05;
- pVesa->pInt->bx = 1;
- pVesa->pInt->dx = iBank;
- xf86ExecX86int10(pVesa->pInt);
-
- if (pVesa->pInt->ax != 0x4f)
- return (1);
- }
-
- return (0);
-}
-
-Bool
-VESASetGetLogicalScanlineLength(ScrnInfoPtr pScrn, int command, int width,
- int *pixels, int *bytes, int *max)
-{
- VESAPtr pVesa;
-
- if (command < SCANWID_SET || command > SCANWID_GET_MAX)
- return (FALSE);
-
- pVesa = VESAGetRec(pScrn);
- /*
- Input:
- AX := 4F06h VBE Set/Get Logical Scan Line Length
- BL := 00h Set Scan Line Length in Pixels
- := 01h Get Scan Line Length
- := 02h Set Scan Line Length in Bytes
- := 03h Get Maximum Scan Line Length
- CX := If BL=00h Desired Width in Pixels
- If BL=02h Desired Width in Bytes
- (Ignored for Get Functions)
-
- Output:
- AX := VBE Return Status
- BX := Bytes Per Scan Line
- CX := Actual Pixels Per Scan Line
- (truncated to nearest complete pixel)
- DX := Maximum Number of Scan Lines
- */
-
- pVesa->pInt->num = 0x10;
- pVesa->pInt->ax = 0x4f06;
- pVesa->pInt->bx = command;
- if (command == SCANWID_SET || command == SCANWID_SET_BYTES)
- pVesa->pInt->cx = width;
- xf86ExecX86int10(pVesa->pInt);
-
- if (pVesa->pInt->ax != 0x4f)
- return (FALSE);
+ if (!retval)
+ return (FALSE);
- if (command == SCANWID_GET || command == SCANWID_GET_MAX) {
- if (pixels)
- *pixels = pVesa->pInt->cx;
- if (bytes)
- *bytes = pVesa->pInt->bx;
- if (max)
- *max = pVesa->pInt->dx;
}
return (TRUE);
}
-Bool
-VESASetDisplayStart(ScrnInfoPtr pScrn, int x, int y, Bool wait_retrace)
-{
- VESAPtr pVesa;
-
- pVesa = VESAGetRec(pScrn);
-
- pVesa->pInt->num = 0x10;
- pVesa->pInt->ax = 0x4f07;
- pVesa->pInt->bx = wait_retrace ? 0x80 : 0x00;
- pVesa->pInt->cx = x;
- pVesa->pInt->dx = y;
- xf86ExecX86int10(pVesa->pInt);
-
- if (pVesa->pInt->ax != 0x4f)
- return (FALSE);
-
- return (TRUE);
-}
-
-Bool
-VESAGetDisplayStart(ScrnInfoPtr pScrn, int *x, int *y)
-{
- VESAPtr pVesa;
-
- pVesa = VESAGetRec(pScrn);
-
- pVesa->pInt->num = 0x10;
- pVesa->pInt->ax = 0x4f07;
- pVesa->pInt->bx = 0x01;
- xf86ExecX86int10(pVesa->pInt);
-
- if (pVesa->pInt->ax != 0x4f)
- return (FALSE);
-
- *x = pVesa->pInt->cx;
- *y = pVesa->pInt->dx;
-
- return (TRUE);
-}
-
-int
-VESASetGetDACPaletteFormat(ScrnInfoPtr pScrn, int bits)
-{
- VESAPtr pVesa = VESAGetRec(pScrn);
-
- /*
- Input:
- AX := 4F08h VBE Set/Get Palette Format
- BL := 00h Set DAC Palette Format
- := 01h Get DAC Palette Format
- BH := Desired bits of color per primary
- (Set DAC Palette Format only)
-
- Output:
- AX := VBE Return Status
- BH := Current number of bits of color per primary
- */
-
- pVesa->pInt->num = 0x10;
- pVesa->pInt->ax = 0x4f08;
- if (!bits)
- pVesa->pInt->bx = 0x01;
- else
- pVesa->pInt->bx = (bits & 0x00ff) << 8;
- xf86ExecX86int10(pVesa->pInt);
-
- if (pVesa->pInt->ax != 0x4f)
- return (0);
-
- return (bits != 0 ? bits : (pVesa->pInt->bx >> 8) & 0x00ff);
-}
-
-CARD32 *
-VESASetGetPaletteData(ScrnInfoPtr pScrn, Bool set, int first, int num,
- CARD32 *data, Bool secondary, Bool wait_retrace)
-{
- VESAPtr pVesa = VESAGetRec(pScrn);
-
- /*
- Input:
- (16-bit)
- AX := 4F09h VBE Load/Unload Palette Data
- BL := 00h Set Palette Data
- := 01h Get Palette Data
- := 02h Set Secondary Palette Data
- := 03h Get Secondary Palette Data
- := 80h Set Palette Data during Vertical Retrace
- CX := Number of palette registers to update (to a maximum of 256)
- DX := First of the palette registers to update (start)
- ES:DI := Table of palette values (see below for format)
-
- Output:
- AX := VBE Return Status
-
-
- Input:
- (32-bit)
- BL := 00h Set Palette Data
- := 80h Set Palette Data during Vertical Retrace
- CX := Number of palette registers to update (to a maximum of 256)
- DX := First of the palette registers to update (start)
- ES:EDI := Table of palette values (see below for format)
- DS := Selector for memory mapped registers
- */
-
- pVesa->pInt->num = 0x10;
- pVesa->pInt->ax = 0x4f09;
- if (!secondary)
- pVesa->pInt->bx = set && wait_retrace ? 0x80 : set ? 0 : 1;
- else
- pVesa->pInt->bx = set ? 2 : 3;
- pVesa->pInt->cx = num;
- pVesa->pInt->dx = first;
- pVesa->pInt->es = SEG_ADDR(pVesa->page);
- pVesa->pInt->di = SEG_OFF(pVesa->page);
- if (set)
- memcpy(pVesa->block, data, num * sizeof(CARD32));
- xf86ExecX86int10(pVesa->pInt);
-
- if (pVesa->pInt->ax != 0x4f)
- return (NULL);
-
- if (set)
- return (data);
-
- data = xalloc(num * sizeof(CARD32));
- memcpy(data, pVesa->block, num * sizeof(CARD32));
-
- return (data);
-}
-
-VESApmi *
-VESAGetVBEpmi(ScrnInfoPtr pScrn)
-{
- VESAPtr pVesa;
- VESApmi *pmi;
-
- pVesa = VESAGetRec(pScrn);
- /*
- Input:
- AH := 4Fh Super VGA support
- AL := 0Ah Protected Mode Interface
- BL := 00h Return Protected Mode Table
-
- Output:
- AX := Status
- ES := Real Mode Segment of Table
- DI := Offset of Table
- CX := Lenght of Table including protected mode code in bytes (for copying purposes)
- (All other registers are preserved)
- */
-
- pVesa->pInt->num = 0x10;
- pVesa->pInt->ax = 0x4f0a;
- pVesa->pInt->bx = 0;
- pVesa->pInt->di = 0;
- xf86ExecX86int10(pVesa->pInt);
-
- if (pVesa->pInt->ax != 0x4f)
- return (NULL);
-
- pmi = xalloc(sizeof(VESApmi));
- pmi->seg_tbl = pVesa->pInt->es;
- pmi->tbl_off = pVesa->pInt->di;
- pmi->tbl_len = pVesa->pInt->cx;
-
- return (pmi);
-}
/***********************************************************************
* DGA stuff
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.cpp b/xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.cpp
deleted file mode 100644
index de0e2cecd..000000000
--- a/xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.cpp,v 1.2 2000/12/11 20:18:42 dawes Exp $
-.\" shorthand for double quote that works everywhere.
-.ds q \N'34'
-.TH VESA __drivermansuffix__ "Version 4.0.2" "XFree86"
-.SH NAME
-vesa \- Generic VESA video driver
-.SH SYNOPSIS
-.nf
-.B "Section \*qDevice\*q"
-.BI " Identifier \*q" devname \*q
-.B " Driver \*qvesa\*q"
-\ \ ...
-.B EndSection
-.fi
-.SH DESCRIPTION
-.B vesa
-is an XFree86 driver for generic VESA video cards. It can drive most
-VESA-compatible video cards, but only makes use of the basic standard
-VESA core that is common to these cards. The driver supports depths 8, 15
-16 and 24.
-.SH SUPPORTED HARDWARE
-The
-.B vesa
-driver supports most VESA-compatible video cards. There are some known
-exceptions, and those should be listed here.
-.SH CONFIGURATION DETAILS
-Please refer to XF86Config(__filemansuffix__) for general configuration
-details. This section only covers configuration details specific to this
-driver.
-.PP
-The driver auto-detects the presence of VESA-compatible hardware. The
-.B ChipSet
-name may optionally be specified in the config file
-.B \*qDevice\*q
-section, and will override the auto-detection:
-.PP
-.RS 4
-"vesa"
-.RE
-.PP
-The following driver
-.B Options
-are supported:
-.TP
-.BI "Option \*qShadowFB\*q \*q" boolean \*q
-Enable or disable use of the shadow framebuffer layer. See
-shadowfb(__drivermansuffix__) for further information. Default: on.
-
-This option is recommended for performance reasons.
-.SH "SEE ALSO"
-XFree86(1), XF86Config(__filemansuffix__), xf86cfg(1), xf86config(1), Xserver(1), X(__miscmansuffix__)
-.SH AUTHORS
-Authors include: Paulo César Pereira de Andrade.
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.h b/xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.h
index 1233698a1..2fd47666c 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.h
@@ -26,7 +26,7 @@
*
* Authors: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
*
- * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.h,v 1.5 2000/12/01 19:56:01 paulo Exp $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.h,v 1.7 2001/02/15 20:00:14 eich Exp $
*/
#ifndef _VESA_H_
@@ -66,10 +66,6 @@
/* Dga definitions */
#include "dgaproc.h"
-#ifdef RENDER
-#include "picturestr.h"
-#endif
-
#include "xf86Resources.h"
#include "xf86RAC.h"
@@ -77,6 +73,8 @@
#include "xf4bpp.h"
#include "fb.h"
#include "afb.h"
+#include "mfb.h"
+#include "cfb24_32.h"
#define VESA_VERSION 4000
#define VESA_NAME "VESA"
@@ -85,16 +83,14 @@
#define VESA_MINOR_VERSION 0
#define VESA_PATCHLEVEL 0
-typedef struct _VBEInfoBlock VBEInfoBlock;
-typedef struct _ModeInfoBlock ModeInfoBlock;
-typedef struct _CRTCInfoBlock CRTCInfoBlock;
+/*XXX*/
typedef struct _VESARec
{
- xf86Int10InfoPtr pInt;
+ vbeInfoPtr pVbe;
EntityInfoPtr pEnt;
CARD16 major, minor;
- VBEInfoBlock *vbeInfo;
+ VbeInfoBlock *vbeInfo;
GDevPtr device;
pciVideoPtr pciInfo;
PCITAG pciTag;
@@ -106,7 +102,6 @@ typedef struct _VESARec
CARD8 *state, *pstate; /* SVGA state */
int statePage, stateSize, stateMode;
int page;
- CARD8 *block;
int pix24bpp;
CARD32 *pal, *savedPal;
CARD8 *fonts;
@@ -119,213 +114,11 @@ typedef struct _VESARec
int nDGAMode;
} VESARec, *VESAPtr;
-#define FARP(p) (((unsigned)(p & 0xffff0000) >> 12) | (p & 0xffff))
-
-#ifndef __GNUC__
-#define __attribute__(a)
-#endif
-
typedef struct _ModeInfoData {
int mode;
- ModeInfoBlock *data;
- CRTCInfoBlock *block;
+ VbeModeInfoBlock *data;
+ VbeCRTCInfoBlock *block;
} ModeInfoData;
-/*
- * INT 0
- */
-struct _VBEInfoBlock {
- /* VESA 1.2 fields */
- CARD8 VESASignature[4]; /* VESA */
- CARD16 VESAVersion; /* Higher byte major, lower byte minor */
- /*CARD32*/char *OEMStringPtr; /* Pointer to OEM string */
- CARD8 Capabilities[4]; /* Capabilities of the video environment */
-
- /*CARD32*/CARD16 *VideoModePtr; /* pointer to supported Super VGA modes */
-
- CARD16 TotalMemory; /* Number of 64kb memory blocks on board */
- /* if not VESA 2, 236 scratch bytes follow (256 bytes total size) */
-
- /* VESA 2 fields */
- CARD16 OemSoftwareRev; /* VBE implementation Software revision */
- /*CARD32*/char *OemVendorNamePtr; /* Pointer to Vendor Name String */
- /*CARD32*/char *OemProductNamePtr; /* Pointer to Product Name String */
- /*CARD32*/char *OemProductRevPtr; /* Pointer to Product Revision String */
- CARD8 Reserved[222]; /* Reserved for VBE implementation */
- CARD8 OemData[256]; /* Data Area for OEM Strings */
-} __attribute__((packed));
-
-/* Return Super VGA Information */
-VBEInfoBlock *VESAGetVBEInfo(ScrnInfoPtr pScrn);
-void VESAFreeVBEInfo(VBEInfoBlock *block);
-
-/*
- * INT 1
- */
-struct _ModeInfoBlock {
- CARD16 ModeAttributes; /* mode attributes */
- CARD8 WinAAttributes; /* window A attributes */
- CARD8 WinBAttributes; /* window B attributes */
- CARD16 WinGranularity; /* window granularity */
- CARD16 WinSize; /* window size */
- CARD16 WinASegment; /* window A start segment */
- CARD16 WinBSegment; /* window B start segment */
- CARD32 WinFuncPtr; /* real mode pointer to window function */
- CARD16 BytesPerScanline; /* bytes per scanline */
-
- /* Mandatory information for VBE 1.2 and above */
- CARD16 XResolution; /* horizontal resolution in pixels or characters */
- CARD16 YResolution; /* vertical resolution in pixels or characters */
- CARD8 XCharSize; /* character cell width in pixels */
- CARD8 YCharSize; /* character cell height in pixels */
- CARD8 NumberOfPlanes; /* number of memory planes */
- CARD8 BitsPerPixel; /* bits per pixel */
- CARD8 NumberOfBanks; /* number of banks */
- CARD8 MemoryModel; /* memory model type */
- CARD8 BankSize; /* bank size in KB */
- CARD8 NumberOfImages; /* number of images */
- CARD8 Reserved; /* 1 */ /* reserved for page function */
-
- /* Direct color fields (required for direct/6 and YUV/7 memory models) */
- CARD8 RedMaskSize; /* size of direct color red mask in bits */
- CARD8 RedFieldPosition; /* bit position of lsb of red mask */
- CARD8 GreenMaskSize; /* size of direct color green mask in bits */
- CARD8 GreenFieldPosition; /* bit position of lsb of green mask */
- CARD8 BlueMaskSize; /* size of direct color blue mask in bits */
- CARD8 BlueFieldPosition; /* bit position of lsb of blue mask */
- CARD8 RsvdMaskSize; /* size of direct color reserved mask in bits */
- CARD8 RsvdFieldPosition; /* bit position of lsb of reserved mask */
- CARD8 DirectColorModeInfo; /* direct color mode attributes */
-
- /* Mandatory information for VBE 2.0 and above */
- CARD32 PhysBasePtr; /* physical address for flat memory frame buffer */
- CARD32 Reserved32; /* 0 */ /* Reserved - always set to 0 */
- CARD16 Reserved16; /* 0 */ /* Reserved - always set to 0 */
-
- /* Mandatory information for VBE 3.0 and above */
- CARD16 LinBytesPerScanLine; /* bytes per scan line for linear modes */
- CARD8 BnkNumberOfImagePages; /* number of images for banked modes */
- CARD8 LinNumberOfImagePages; /* number of images for linear modes */
- CARD8 LinRedMaskSize; /* size of direct color red mask (linear modes) */
- CARD8 LinRedFieldPosition; /* bit position of lsb of red mask (linear modes) */
- CARD8 LinGreenMaskSize; /* size of direct color green mask (linear modes) */
- CARD8 LinGreenFieldPosition; /* bit position of lsb of green mask (linear modes) */
- CARD8 LinBlueMaskSize; /* size of direct color blue mask (linear modes) */
- CARD8 LinBlueFieldPosition; /* bit position of lsb of blue mask (linear modes) */
- CARD8 LinRsvdMaskSize; /* size of direct color reserved mask (linear modes) */
- CARD8 LinRsvdFieldPosition; /* bit position of lsb of reserved mask (linear modes) */
- CARD32 MaxPixelClock; /* maximum pixel clock (in Hz) for graphics mode */
- CARD8 Reserved2[189]; /* remainder of ModeInfoBlock */
-} __attribute__((packed));
-
-/* Return VBE Mode Information */
-ModeInfoBlock *VESAGetModeInfo(ScrnInfoPtr pScrn, int mode);
-void VESAFreeModeInfo(ModeInfoBlock *block);
-
-/*
- * INT2
- */
-#define CRTC_DBLSCAN (1<<0)
-#define CRTC_INTERLACE (1<<1)
-#define CRTC_NHSYNC (1<<2)
-#define CRTC_NVSYNC (1<<3)
-
-struct _CRTCInfoBlock {
- CARD16 HorizontalTotal; /* Horizontal total in pixels */
- CARD16 HorizontalSyncStart; /* Horizontal sync start in pixels */
- CARD16 HorizontalSyncEnd; /* Horizontal sync end in pixels */
- CARD16 VerticalTotal; /* Vertical total in lines */
- CARD16 VerticalSyncStart; /* Vertical sync start in lines */
- CARD16 VerticalSyncEnd; /* Vertical sync end in lines */
- CARD8 Flags; /* Flags (Interlaced, Double Scan etc) */
- CARD32 PixelClock; /* Pixel clock in units of Hz */
- CARD16 RefreshRate; /* Refresh rate in units of 0.01 Hz */
- CARD8 Reserved[40]; /* remainder of ModeInfoBlock */
-} __attribute__((packed));
-/* CRTCInfoBlock is in the VESA 3.0 specs */
-
-Bool VESASetVBEMode(ScrnInfoPtr pScrn, int mode, CRTCInfoBlock *crtc);
-
-/*
- * INT 3
- */
-Bool VESAGetVBEMode(ScrnInfoPtr pScrn, int *mode);
-
-/*
- * INT 4
- */
-/* Save/Restore Super VGA video state */
-/* function values are (values stored in VESAPtr):
- * 0 := query & allocate amount of memory to save state
- * 1 := save state
- * 2 := restore state
- *
- * function 0 called automatically if function 1 called without
- * a previous call to function 0.
- */
-#define MODE_QUERY 0
-#define MODE_SAVE 1
-#define MODE_RESTORE 2
-Bool VESASaveRestore(ScrnInfoPtr pScrn, int function);
-
-/*
- * INT 6
- */
-#define SCANWID_SET 0
-#define SCANWID_GET 1
-#define SCANWID_SET_BYTES 2
-#define SCANWID_GET_MAX 3
-#define VESASetLogicalScanline(pScrn, width) \
- VESASetGetLogicalScanlineLength(pScrn, SCANWID_SET, \
- width, NULL, NULL, NULL)
-#define VESASetLogicalScanlineBytes(pScrn, width) \
- VESASetGetLogicalScanlineLength(pScrn, width, SCANWID_SET_BYTES, \
- NULL, NULL, NULL)
-#define VESAGetLogicalScanline(pScrn, pixels, bytes, max) \
- VESASetGetLogicalScanlineLength(pScrn, SCANWID_GET, NULL, \
- pixels, bytes, max)
-#define VESAGetMaxLogicalScanline(pScrn, pixels, bytes, max) \
- VESASetGetLogicalScanlineLength(pScrn, SCANWID_GET_MAX, \
- NULL, pixels, bytes, max)
-Bool VESASetGetLogicalScanlineLength(ScrnInfoPtr pScrn, int command, int width,
- int *pixels, int *bytes, int *max);
-
-/*
- * INT 7
- */
-/* 16 bit code */
-Bool VESASetDisplayStart(ScrnInfoPtr pScrn, int x, int y, Bool wait_retrace);
-Bool VESAGetDisplayStart(ScrnInfoPtr pScrn, int *x, int *y);
-
-/*
- * INT 8
- */
-/* if bits is 0, then it is a GET */
-int VESASetGetDACPaletteFormat(ScrnInfoPtr pScrn, int bits);
-
-/*
- * INT 9
- */
-/*
- * If getting a palette, the data argument is not used. It will return
- * the data.
- * If setting a palette, it will return the pointer received on success,
- * NULL on failure.
- */
-CARD32 *VESASetGetPaletteData(ScrnInfoPtr pScrn, Bool set, int first, int num,
- CARD32 *data, Bool secondary, Bool wait_retrace);
-#define VESAFreePaletteData(data) xfree(data)
-
-/*
- * INT A
- */
-typedef struct _VESApmi {
- int seg_tbl;
- int tbl_off;
- int tbl_len;
-} VESApmi;
-
-VESApmi *VESAGetVBEpmi(ScrnInfoPtr pScrn);
-#define VESAFreeVBEpmi(pmi) xfree(pmi)
#endif /* _VESA_H_ */
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/vga/vga.cpp b/xc/programs/Xserver/hw/xfree86/drivers/vga/vga.cpp
deleted file mode 100644
index 7eb5749cc..000000000
--- a/xc/programs/Xserver/hw/xfree86/drivers/vga/vga.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vga/vga.cpp,v 1.2 1999/08/28 09:01:08 dawes Exp $
-.TH VGA __drivermansuffix__ "Version 3.9.16" "XFree86"
-.SH NAME
-vga \- Generic VGA video driver
-.SH SYNOPSIS
-.B "Section ""Device"""
-.br
-.BI " Identifier """ devname """"
-.br
-.B " Driver ""vga"""
-.br
-\ \ ...
-.br
-.B EndSection
-.SH DESCRIPTION
-.B vga
-is an XFree86 driver for generic VGA video cards. It can drive most
-VGA-compatible video cards, but only makes use of the basic standard
-VGA core that is common to these cards. The driver supports depths 1, 4
-and 8. All relevant visual types are supported at each depth.
-Multi-head configurations
-are supported in combination with some other drivers, but only when the
-.B vga
-driver is driving the primary head.
-.SH SUPPORTED HARDWARE
-The
-.B vga
-driver supports most VGA-compatible video cards. There are some known
-exceptions, and those should be listed here.
-.SH CONFIGURATION DETAILS
-Please refer to XF86Config(__filemansuffix__) for general configuration
-details. This section only covers configuration details specific to this
-driver.
-.PP
-The driver auto-detects the presence of VGA-compatible hardware. The
-.B ChipSet
-name may optionally be specified in the config file
-.B """Device"""
-section, and will override the auto-detection:
-.PP
-.RS 4
-"generic"
-.RE
-.PP
-The driver will only use 64k of video memory for depth 1 and depth 8 operation,
-and 256k of video memory for depth 4 (this is the standard VGA limit).
-.PP
-When operating at depth 8, only a single built-in 320x200 video mode is
-available. At other depths there is more flexibility regarding mode choice.
-.PP
-The following driver
-.B Options
-are supported:
-.TP
-.BI "Option ""ShadowFB"" """ boolean """
-Enable or disable use of the shadow framebuffer layer. See
-shadowfb(__drivermansuffix__) for further information. Default: off.
-
-This option is recommended for performance reasons when running at depths
-1 and 4, especially when using modern PCI-based hardware. It is required
-when using those depths in a multi-head configuration where one or more
-of the other screens is operating at a different depth.
-.SH "SEE ALSO"
-XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(1)
-.SH AUTHORS
-Authors include: Marc La France, David Dawes, and Dirk Hohndel.
diff --git a/xc/programs/Xserver/hw/xfree86/etc/Xinstall.sh b/xc/programs/Xserver/hw/xfree86/etc/Xinstall.sh
index 8b6df0d29..a88bf7444 100644
--- a/xc/programs/Xserver/hw/xfree86/etc/Xinstall.sh
+++ b/xc/programs/Xserver/hw/xfree86/etc/Xinstall.sh
@@ -1,7 +1,7 @@
#!/bin/sh
#
-# $XFree86: xc/programs/Xserver/hw/xfree86/etc/Xinstall.sh,v 1.18 2000/12/15 03:01:45 dawes Exp $
+# $XFree86: xc/programs/Xserver/hw/xfree86/etc/Xinstall.sh,v 1.19 2000/12/21 18:40:09 dawes Exp $
#
# Copyright © 2000 by Precision Insight, Inc.
# Copyright © 2000 by VA Linux Systems, Inc.
@@ -180,6 +180,8 @@ Description()
echo "Docs in Japanese";;
Xps*)
echo "Docs in PostScript";;
+ Xaout*)
+ echo "a.out compatibility libraries";;
*)
echo "unknown";;
esac
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-axp/var-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-axp/var-list
index a65b41774..63edf2cad 100644
--- a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-axp/var-list
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-axp/var-list
@@ -1 +1,2 @@
-lib
+lib/xdm
+lib/xkb
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ix86/var-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ix86/var-list
index a65b41774..63edf2cad 100644
--- a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ix86/var-list
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ix86/var-list
@@ -1 +1,2 @@
-lib
+lib/xdm
+lib/xkb
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-m68k/var-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-m68k/var-list
index a65b41774..63edf2cad 100644
--- a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-m68k/var-list
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-m68k/var-list
@@ -1 +1,2 @@
-lib
+lib/xdm
+lib/xkb
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-mips/var-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-mips/var-list
index a65b41774..63edf2cad 100644
--- a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-mips/var-list
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-mips/var-list
@@ -1 +1,2 @@
-lib
+lib/xdm
+lib/xkb
diff --git a/xc/programs/Xserver/hw/xfree86/etc/pcitweak.man b/xc/programs/Xserver/hw/xfree86/etc/pcitweak.man
index 12d3cc5b1..f4bd8d405 100644
--- a/xc/programs/Xserver/hw/xfree86/etc/pcitweak.man
+++ b/xc/programs/Xserver/hw/xfree86/etc/pcitweak.man
@@ -1,5 +1,5 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/etc/pcitweak.man,v 3.2 2000/12/11 20:18:44 dawes Exp $
-.TH PCITWEAK 1 "Version 4.0.2" "XFree86"
+.\" $XFree86: xc/programs/Xserver/hw/xfree86/etc/pcitweak.man,v 3.3 2001/01/27 18:20:56 dawes Exp $
+.TH PCITWEAK 1 __vendorversion__
.SH NAME
pcitweak - read/write PCI config space
.SH SYNOPSIS
diff --git a/xc/programs/Xserver/hw/xfree86/etc/scanpci.man b/xc/programs/Xserver/hw/xfree86/etc/scanpci.man
index 65126f5ec..baf231603 100644
--- a/xc/programs/Xserver/hw/xfree86/etc/scanpci.man
+++ b/xc/programs/Xserver/hw/xfree86/etc/scanpci.man
@@ -1,5 +1,5 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/etc/scanpci.man,v 3.2 2000/12/11 20:18:45 dawes Exp $
-.TH SCANPCI 1 "Version 4.0.2" "XFree86"
+.\" $XFree86: xc/programs/Xserver/hw/xfree86/etc/scanpci.man,v 3.3 2001/01/27 18:20:56 dawes Exp $
+.TH SCANPCI 1 __vendorversion__
.SH NAME
scanpci - scan/probe PCI buses
.SH SYNOPSIS
diff --git a/xc/programs/Xserver/hw/xfree86/fbdevhw/fbdevhw.cpp b/xc/programs/Xserver/hw/xfree86/fbdevhw/fbdevhw.cpp
deleted file mode 100644
index c0807fe6a..000000000
--- a/xc/programs/Xserver/hw/xfree86/fbdevhw/fbdevhw.cpp
+++ /dev/null
@@ -1,21 +0,0 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/fbdevhw/fbdevhw.cpp,v 1.1 1999/04/04 08:46:22 dawes Exp $
-.TH FBDEVHW __drivermansuffix__ "Version 4.0" "XFree86"
-.SH NAME
-fbdevhw \- os-specific submodule for framebuffer device access
-.SH DESCRIPTION
-.B fbdevhw
-provides functions for talking to a framebuffer device. It is
-os-specific. It is a submodule used by other video drivers.
-A
-.B fbdevhw
-module is currently available for linux framebuffer devices.
-.PP
-fbdev(__drivermansuffix__) is a non-accelerated driver which runs on top of the
-fbdevhw module. fbdevhw can be used by other drivers too, this
-is usually activated with `Option "UseFBDev"' in the device section.
-.SH "SEE ALSO"
-XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(1),
-fbdev(__drivermansuffix__)
-.SH AUTHORS
-Authors include: Gerd Knorr, based on the XF68_FBDev Server code
-(Martin Schaller, Geert Uytterhoeven).
diff --git a/xc/programs/Xserver/hw/xfree86/input/citron/citron.cpp b/xc/programs/Xserver/hw/xfree86/input/citron/citron.cpp
deleted file mode 100644
index 49ec05c56..000000000
--- a/xc/programs/Xserver/hw/xfree86/input/citron/citron.cpp
+++ /dev/null
@@ -1,629 +0,0 @@
-.\" Copyright (c) 2000 Peter Kunzmann <support@@citron.de>
-.\"
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/input/citron/citron.cpp,v 1.4 2000/12/17 22:27:40 dawes Exp $
-.\"
-.\" shorthand for double quote that works everywhere.
-.ds q \N'34'
-.TH CITRON __drivermansuffix__ "Version 4.0.2" "XFREE86"
-.SH NAME
-citron \- Citron Infrared Touch Driver (CiTouch)
-.SH SYNOPSIS
-.nf
-.B "Section \*qInputDevice\*q"
-.BI " Identifier \*q" idevname \*q
-.B " Driver \*qcitron\*q"
-.BI " Option \*qDevice\*q \*q" devpath \*q
-\ \ ...
-.B EndSection
-.fi
-.SH DESCRIPTION
-.B citron
-is a XFree86 input driver for
-.I Citron Infrared Touch
-devices.
-.PP
-The
-.B citron
-driver acts as a pointer input device, and may be used as the
-X server's core pointer. It is connected via a "RS232" with the host.
-.SH SUPPORTED HARDWARE
-At the moment the following touches are supported. They are also
-available as
-.I ZPress
-touches.
-
-.B IRT6I5-V2.x
- 6.5 inch Infrared Touch
-
-.B IRT10I4-V4.x
- 10.4 inch Infrared Touch
-
-.B IRT12I1-V2.x
- 12.1 inch Infrared Touch
-
-.B IRT15I1-V1.x
- 15.1 inch Infrared Touch
-
-.SH CONFIGURATION DETAILS
-Please refer to XF86Config(__filemansuffix__) for general configuration
-details and for options that can be used with all input drivers. This
-section only covers configuration details specific to this driver.
-For better understanding please read also the
-.B CTS
-and various
-.B IRT
-manuals which are available in "pdf" format from Citron web page
-.B www.citron.de
-or directly from Citron.
-
-.PP
-.PP
-The following driver
-.B Options
-are supported:
-.TP 7
-.BI "Option \*qDevice\*q \*q" devpath \*q
-Specify the device path for the citron touch. Valid devices are:
-.PP
-.RS 12
-/dev/ttyS0, /dev/ttyS1, ...
-.RE
-.RS 7
-This option is mandatory.
-.PP
-It's important to specify the right device Note: com1 -> /dev/ttyS0, com2 -> /dev/ttyS1, ...
-
-.RE
-.TP 7
-.BI "Option \*qScreenNumber\*q \*q" screennumber \*q
-sets the
-.I screennumber
-for the
-.B citron
-InputDevice.
-.PP
-.RS 7
-.I Default:
-ScreenNumber: "0"
-
-.RE
-.TP 7
-.BI "Option \*qMinX\*q \*q" value \*q
-.TP 7
-.BI "Option \*qMinY\*q \*q" value \*q
-These are the minimum X and Y values for the
-.B citron
-input device.
-.PP
-.RS 7
-Note: MinX, MinY must be less than MaxX, MaxY.
-.PP
-.I Range:
-"0" - "65535"
-.PP
-.I Default:
-MinX: "0" MinY: "0"
-
-
-.RE
-.TP 7
-.BI "Option \*qMaxX\*q \*q" value \*q
-.TP 7
-.BI "Option \*qMaxY\*q \*q" value \*q
-These are the maximum X and Y values for the
-.B citron
-input device.
-.PP
-.RS 7
-Note: MaxX, MaxY must be greater than MinX, MinY.
-.PP
-.I Range:
-"0" - "65535"
-.PP
-.I Default:
-MaxX: "65535" MaxY: "65535"
-
-
-.RE
-.TP 7
-.BI "Option \*qButtonNumber\*q \*q" value \*q
-This value is responsible for the
-.I button number
-that is returned within the xf86PostButton event message
-.PP
-.RS 7
-.I Range:
-"0" - "255"
-.PP
-.I Default:
-"1"
-
-.RE
-.TP 7
-.BI "Option \*qButtonThreshold\*q \*q" value \*q
-This value is responsible for the
-.I button threshold.
-It changes the pressure sensitivity of the touch. A higher number
-corresponds to a higher pressure.
-.PP
-.RS 7
-Note: This feature is only available with pressure sensitive hardware.
-.PP
-.I Range:
-"0" - "255"
-.PP
-.I Default:
-"20"
-
-.RE
-.TP 7
-.B Sleep-Mode
-If the IRT is in
-.I Doze-Mode
-and Touch Zone is not interrupted for another
-certain span of time, the so-called
-.I Sleep-Mode
-is activated. The
-.I Sleep-Mode
-decreases the scan rate of the beams even further than
-the
-.I Doze-Mode
-does (see below). This way the life expectancy of the beams is
-prolonged and the power consumption of the IRT is reduced.
-As soon as an interruption of the Touch Zone is detected, the
-.I Sleep-Mode
-is deactivated and the Touch Zone will again be scanned with
-the maximum speed. With the Sleep-Mode activated,
-depending on the set scan rate the IRT's response time can be
-considerably longer as in normal operation. If, for example,
-a scan rate of 500 ms / scan is set, it may last up to a half
-of a second until the IRT detects the interruption and deactivates
-the
-.I Sleep-Mode.
-
-.PP
-.RE
-.TP 7
-.BI "Option \*qSleepMode\*q \*q" mode \*q
-This value is responsible for the
-.I sleep-mode
-of the touch.
-.RS 7
-Determines the behaviour of the Sleep-Mode.
-
-.B 0x00
- No message at either activation or deactivation
-
-.B 0x01
- Message at activation
-
-.B 0x02
- Message at deactivation
-
-.B 0x03
- Message at activation and deactivation
-
-.B 0x10
-GP_OUT output set according to the Sleep-Mode status
-
-.I Values:
-"0" "1" "2" "3" "16"
-
-.I Default:
-"0"
-
-.RE
-.TP 7
-.BI "Option \*qSleepTime\*q \*q" time \*q
-This value is responsible for the
-.I sleep-time
-of the touch. It is the activation time in seconds
-("0" = immediately activated, "65535" = always deactivated).
-.RS 7
-.PP
-.I Range:
-"0" - "65535" [s]
-.PP
-.I Default:
-"65535" => deactivated
-
-.RE
-.TP 7
-.BI "Option \*qSleepScan\*q \*q" scan \*q
-This value is responsible for the
-.I scan-time
-of the touch. This is the time interval between two scan operations
-while in Sleep-Mode. The time interval is set in steps
-of milliseconds.
-.RS 7
-.PP
-.I Range:
-"0" - "65535" [ms]
-.PP
-.I Default:
-"500"
-
-.RE
-.TP 7
-.BI "Option \*qPWMActive\*q \*q" value \*q
-This value determines the mark-to-space ratio of the
-.I PWM
-output while in normal operation (sleep-mode not active).
-Higher values result in longer pulse widths. This output
-signal can be used in conjunction with the
-.I Citron AWBI
-to do backlight-dimming via the touch.
-.RS 7
-.PP
-.I Range:
-"0" - "255"
-.PP
-.I Default:
-"255" (max. brightness)
-
-
-.RE
-.TP 7
-.BI "Option \*qPWMSleep\*q \*q" value \*q
-This value determines the mark-to-space ratio of the
-.I PWM
-output while in sleep-mode (->
-.I SleepMode, SleepScan, SleepTime
-) operation (sleep-mode active).
-Higher values result in longer pulse widths.
-.RS 7
-.PP
-.I Range:
-"0" - "255"
-.PP
-.I Default:
-"255" (max. brightness)
-
-.RE
-.TP 7
-.BI "Option \*qClickMode\*q \*q" mode \*q
-With mode one can select between 5
-.I ClickModes
-
-.B \*q1\*q
-= ClickMode Enter
-
-With this mode every interruption of the infrared beams will
-activate a ButtonPress event and after the interruption a
-ButtonRelease event will be sent.
-
-.B \*q2\*q
-= ClickMode Dual
-
-With this mode every interruption will sent a Proximity event and
-every second interruption a ButtonPress event. With the release of
-the interruption (while one interruption is still active) a
-ButtonRelease event will be sent.
-
-.B \*q3\*q
-= ClickMode Dual Exit
-
-With this mode every interruption will sent a ProximityIn event and
-every second interruption a ButtonPress event. With the release of
-the interruption (while one interruption is still active) no
-ButtonRelease event will be sent. Only if all interruptions are released
-a ButtonRelease followed by a ProximityOut event will be sent.
-
-.B \*q4\*q
-= ClickMode ZPress
-
-With this mode every interruption will sent a ProximityIn event. Only if
-a certain pressure is exceeded a ButtonPress event will occur. If the
-pressure falls below a certain limit a ButtonRelease event will be sent.
-After also the interruption is released a ProximityOut event is generated.
-
-.B \*q5\*q
-= ClickMode ZPress Exit
-
-This mode is similar to "Clickmode Dual Exit".
-The first interruption of the beams will sent a ProximityIn event. Only if
-a certain pressure is exceeded a ButtonPress event will occur. If the
-pressure falls below a certain limit no ButtonRelease event will be sent.
-After the interruption is also released a ButtonRelease followed by
-a ProximityOut event is generated.
-.RS 7
-.PP
-.I Range:
-"1" - "5"
-.PP
-.I Default:
-"1" (ClickMode Enter)
-
-.RE
-.TP 7
-.BI "Option \*qOrigin\*q \*q" value \*q
-This value sets the coordinates origin to one of the four corners of
-the screen.
-The following values are accepted:
-"0" TOPLEFT: Origin set to the left-hand side top corner.
-"1" TOPRIGHT: Origin set to the right-hand side top corner.
-"2" BOTTOMRIGHT: Origin set to the right-hand side bottom corner.
-"3" BOTTOMLEFT: Origin set to the left-hand side bottom corner.
-.RS 7
-.PP
-.I Range:
-"0" - "3"
-.PP
-.I Default:
-"0" (TOPLEFT)
-
-.RE
-.TP 7
-.B "Doze-Mode"
-If for a certain span of time the Touch Zone is not interrupted,
-the so-called Doze-Mode is automatically activated. The activated
-Doze-Mode slightly decreases the scan rate of the beams. This way
-the power consumption of the IRT is reduced. As soon as an
-interruption of the Touch Zone is detected, the Doze-Mode
-is deactivated and the Touch Zone will again be scanned with
-the maximum speed.
-
-.RE
-.TP 7
-.BI "Option \*qDozeMode\*q \*q" mode \*q
-This value is responsible for the
-.I doze-mode
-of the touch.
-.RS 7
-.PP
-Determines the behaviour of the Doze-Mode.
-.PP
-.B 0x00
-No message at either activation or deactivation
-
-.B 0x01
-Message at activation
-
-.B 0x02
-Message at deactivation
-
-.B 0x03
-Message at activation and deactivation
-
-.B 0x10
-GP_OUT output set according to the Doze-Mode status
-
-If the GP_OUT output is already controlled by the
-.I Sleep-Mode
-it is no longer available as an output port anymore.
-.PP
-.I Values:
-"0" "1" "2" "3" "16"
-.PP
-.I Default:
-"0"
-
-
-
-.RE
-.TP 7
-.BI "Option \*qDozeTime\*q \*q" time \*q
-This value is responsible for the
-.I doze-time
-of the touch. It is the activation time in seconds
-("0" = immediately activated, "65535" = always deactivated).
-.RS 7
-.PP
-.I Range:
-"0" - "65535" [s]
-.PP
-.I Default:
-"65535" => deactivated
-
-
-.RE
-.TP 7
-.BI "Option \*qDozeScan\*q \*q" scan \*q
-This value is responsible for the
-.I scan-time
-of the touch. This is the time interval between two scan operations
-while in Doze-Mode. The time interval is set in steps
-of milliseconds.
-.RS 7
-.PP
-.I Range:
-"0" - "65535" [ms]
-.PP
-.I Default:
-"500"
-
-.RE
-.TP 7
-.BI "Option \*qDeltaX\*q \*q" value \*q
-This value determines a virtual area at the left and right
-side of the current cursor position where the cursor didn't move.
-Within this area no "MotionNotify" event will be sent.
-.RS 7
-.PP
-.I Range:
-"0" - "255"
-.PP
-.I Default:
-"0" (no deltaX)
-
-
-.RE
-.TP 7
-.BI "Option \*qDeltaY\*q \*q" value \*q
-This value determines a virtual area at the top and bottom
-of the current cursor position where the cursor didn't move.
-Within this area no "MotionNotify" event will be sent.
-.RS 7
-.PP
-.I Range:
-"0" - "255"
-.PP
-.I Default:
-"0" (no deltaY)
-
-.RE
-.TP 7
-.BI "Option \*qBeep\*q \*q" value \*q
-This value determines if a "ButtonPress" and/or a "ButtonRelease"
-event should sound the buzzer. "0" deactivates the buzzer while
-every other value will activate it.
-.RS 7
-.PP
-.I Range:
-"0" - "1"
-.PP
-.I Default:
-"0" (deactivated)
-
-.RE
-.TP 7
-.BI "Option \*qPressVol\*q \*q" value \*q
-This value determines the volume of the buzzer (0-100%)
-when a "ButtonPress" event is sent.
-.RS 7
-.PP
-.I Range:
-"0" - "100"
-.PP
-.I Default:
-"100"
-
-
-.RE
-.TP 7
-.BI "Option \*qPressPitch\*q \*q" value \*q
-This value determines the pitch of the tone
-when a "ButtonPress" event is sent.
-.RS 7
-.PP
-.I Range:
-"0" - "3000"
-.PP
-.I Default:
-"880"
-
-
-
-.RE
-.TP 7
-.BI "Option \*qPressDur\*q \*q" value \*q
-This value determines the duration of the tone in ms
-when a "ButtonPress" event is sent.
-.RS 7
-.PP
-.I Range:
-"0" - "255"
-.PP
-.I Default:
-"15"
-
-.RE
-.TP 7
-.BI "Option \*qReleaseVol\*q \*q" value \*q
-This value determines the volume of the buzzer (0-100%)
-when a "ButtonRelease" event is sent.
-.RS 7
-.PP
-.I Range:
-"0" - "100"
-.PP
-.I Default:
-"100"
-
-
-.RE
-.TP 7
-.BI "Option \*qReleasePitch\*q \*q" value \*q
-This value determines the pitch of the tone when
-when a "ButtonRelease" event is sent.
-.RS 7
-.PP
-.I Range:
-"0" - "3000"
-.PP
-.I Default:
-"1200"
-
-
-
-.RE
-.TP 7
-.BI "Option \*qReleseDur\*q \*q" value \*q
-This value determines the duration of the tone in ms when
-when a "ButtonRelease" event is sent.
-.RS 7
-.PP
-.I Range:
-"0" - "255"
-.PP
-.I Default:
-"10"
-
-
-
-.RE
-.TP 7
-.BI "Option \*qBeamTimeout\*q \*q" value \*q
-Determines the time span in seconds, that has to elapse before a beam is
-considered defective, blanked-out and excluded from the coordinates
-evaluation.
-.RS 7
-.PP
-.I Range:
-"0" - "65535"
-.PP
-.I Default:
-"30" (30 seconds)
-
-
-
-
-.RE
-.TP 7
-.BI "Option \*qTouchTime\*q \*q" value \*q
-Determines the minimum time span in steps of 10ms for a valid
-interruption. In order for an interruption to be
-reported to the host computer as valid, it needs to remain at
-the same spot for at least the time span declared here.
-.RS 7
-.PP
-.I Range:
-"0" - "255"
-.PP
-.I Default:
-"0" (=6,5 ms)
-
-
-.RE
-.TP 7
-.BI "Option \*qEnterCount\*q \*q" count \*q
-Number of skipped "enter reports". Reports are sent approx.
-every 20ms.
-.RS 7
-.PP
-.I Range:
-"0" - "31"
-.PP
-.I Default:
-"3" (3 skipped messages = 60ms)
-
-
-.RE
-.TP 7
-.BI "Option \*qDualCount\*q \*q" count \*q
-Number of skipped "dual touch error". Reports are sent approx.
-every 20ms. This option is only available for "ZPress" and
-"ZPress Exit" modes.
-.RS 7
-.PP
-.I Range:
-"0" - "31"
-.PP
-.I Default:
-"2" (2 skipped messages = 40ms)
-
-
-.SH "SEE ALSO"
-XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__).
-.SH AUTHORS
-2000 - written by Citron GmbH (support@citron.de)
diff --git a/xc/programs/Xserver/hw/xfree86/input/dynapro/dynapro.cpp b/xc/programs/Xserver/hw/xfree86/input/dynapro/dynapro.cpp
deleted file mode 100644
index 0948955fd..000000000
--- a/xc/programs/Xserver/hw/xfree86/input/dynapro/dynapro.cpp
+++ /dev/null
@@ -1,36 +0,0 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/input/dynapro/dynapro.cpp,v 1.5 2000/12/11 20:18:48 dawes Exp $
-.\" shorthand for double quote that works everywhere.
-.ds q \N'34'
-.TH DYNAPRO __drivermansuffix__ "Version 4.0.2" "XFree86"
-.SH NAME
-dynapro \- Dynapro input driver
-.SH SYNOPSIS
-.nf
-.B "Section \*qInputDevice\*q"
-.BI " Identifier \*q" idevname \*q
-.B " Driver \*qdynapro\*q"
-.BI " Option \*qDevice\*q \*q" devpath \*q
-\ \ ...
-.B EndSection
-.fi
-.SH DESCRIPTION
-.B dynapro
-is an XFree86 input driver for Dynapro devices...
-.PP
-The
-.B dynapro
-driver functions as a pointer input device, and may be used as the
-X server's core pointer.
-THIS MAN PAGE NEEDS TO BE FILLED IN.
-.SH SUPPORTED HARDWARE
-What is supported...
-.SH CONFIGURATION DETAILS
-Please refer to XF86Config(__filemansuffix__) for general configuration
-details and for options that can be used with all input drivers. This
-section only covers configuration details specific to this driver.
-.PP
-Config details...
-.SH "SEE ALSO"
-XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__).
-.SH AUTHORS
-Authors include...
diff --git a/xc/programs/Xserver/hw/xfree86/input/elographics/elographics.cpp b/xc/programs/Xserver/hw/xfree86/input/elographics/elographics.cpp
deleted file mode 100644
index 03f7792e6..000000000
--- a/xc/programs/Xserver/hw/xfree86/input/elographics/elographics.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/input/elographics/elographics.cpp,v 1.3 2000/12/11 20:18:49 dawes Exp $
-.\" shorthand for double quote that works everywhere.
-.ds q \N'34'
-.TH ELOGRAPHICS __drivermansuffix__ "Version 4.0.2" "XFree86"
-.SH NAME
-elographics \- Elographics input driver
-.SH SYNOPSIS
-.B "Section \*qInputDevice\*q"
-.br
-.BI " Identifier \*q" idevname \*q
-.br
-.B " Driver \*qelographics\*q"
-.br
-.BI " Option \*qDevice\*q \*q" devpath \*q
-.br
-\ \ ...
-.br
-.B EndSection
-.SH DESCRIPTION
-.B elographics
-is an XFree86 input driver for Elographics devices...
-.PP
-The
-.B elographics
-driver functions as a pointer input device, and may be used as the
-X server's core pointer.
-THIS MAN PAGE NEEDS TO BE FILLED IN.
-.SH SUPPORTED HARDWARE
-What is supported...
-.SH CONFIGURATION DETAILS
-Please refer to XF86Config(__filemansuffix__) for general configuration
-details and for options that can be used with all input drivers. This
-section only covers configuration details specific to this driver.
-.PP
-Config details...
-.SH "SEE ALSO"
-XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__).
-.SH AUTHORS
-Authors include...
- Patrick Lecoanet
diff --git a/xc/programs/Xserver/hw/xfree86/input/keyboard/keyboard.cpp b/xc/programs/Xserver/hw/xfree86/input/keyboard/keyboard.cpp
deleted file mode 100644
index bce88740e..000000000
--- a/xc/programs/Xserver/hw/xfree86/input/keyboard/keyboard.cpp
+++ /dev/null
@@ -1,97 +0,0 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/input/keyboard/keyboard.cpp,v 1.5 2000/12/11 20:18:50 dawes Exp $
-.\" shorthand for double quote that works everywhere.
-.ds q \N'34'
-.TH KEYBOARD __drivermansuffix__ "Version 4.0.2" "XFree86"
-.SH NAME
-keyboard \- Keyboard input driver
-.SH SYNOPSIS
-.nf
-.B "Section \*qInputDevice\*q"
-.BI " Identifier \*q" idevname \*q
-.B " Driver \*qkeyboard\*q"
-\ \ ...
-.B EndSection
-.fi
-.SH DESCRIPTION
-.B keyboard
-is an XFree86 input driver for keyboards. The driver supports the standard
-OS-provided keyboard interface. This driver is currently built-in to
-the core X server.
-.PP
-The
-.B keyboard
-driver functions as a keyboard input device, and may be used as the
-X server's core keyboard. This driver is currently built-in to the core
-X server, and multiple instances are not yet supported.
-.SH CONFIGURATION DETAILS
-Please refer to XF86Config(__filemansuffix__) for general configuration
-details and for options that can be used with all input drivers. This
-section only covers configuration details specific to this driver.
-.PP
-The following driver
-.B Options
-are supported:
-.TP 7
-.BI "Option \*qProtocol\*q \*q" string \*q
-Specify the mouse protocol. Valid protocol types include:
-.PP
-.RS 12
-Standard, Xqueue.
-.RE
-.PP
-.RS 7
-Not all protocols are supported on all platforms. Default: "Standard".
-.RE
-.TP 7
-.BI "Option \*qAutoRepeat\*q \*q" "delay rate" \*q
-sets the auto repeat behaviour for the keyboard. This is not implemented
-on all platforms.
-.I delay
-is the time in milliseconds before a key starts repeating.
-.I rate
-is the number of times a key repeats per second. Default: "500 30".
-.TP 7
-.BI "Option \*qXLeds\*q \*q" ledlist \*q
-makes the keyboard LEDs specified in
-.I ledlist
-available for client use instead of their traditional function
-(Scroll Lock, Caps Lock and Num Lock). The numbers in the list are
-in the range 1 to 3. Default: empty list.
-.TP 7
-.BI "Option \*qXkbDisable\*q \*q" boolean \*q
-disable/enable the XKEYBOARD extension. The \-kb command line
-option overrides this config file option. Default: XKB is enabled.
-.TP 7
-.BI "Option \*qXkbRules\*q \*q" rules \*q
-specifies which XKB rules file to use for interpreting the
-.BR XkbModel ,
-.BR XkbLayout ,
-.BR XkbVariant ,
-and
-.B XkbOptions
-settings. Default: "xfree86" for most platforms, but "xfree98" for the
-Japanese PC-98 platforms.
-.TP 7
-.BI "Option \*qXkbModel\*q \*q" modelname \*q
-specifies the XKB keyboard model name. Default: "pc101" for most platforms,
-but "pc98" for the Japanese PC-98 platforms, and "pc101_sol8x86" for
-Solaris 8 on x86.
-.TP 7
-.BI "Option \*qXkbLayout\*q \*q" layoutname \*q
-specifies the XKB keyboard layout name. This is usually the country or
-language type of the keyboard. Default: "us" for most platforms, but
-"nec/jp" for the Japanese PC-98 platforms.
-.TP 7
-.BI "Option \*qXkbVariant\*q \*q" variants \*q
-specifies the XKB keyboard variant components. These can be used to
-enhance the keyboard layout details. Default: not set.
-.TP 7
-.BI "Option \*qXkbOptions\*q \*q" options \*q
-specifies the XKB keyboard option components. These can be used to
-enhance the keyboard behaviour. Default: not set.
-.PP
-Some other XKB-related options are available, but they are incompatible
-with the ones listed above and are not recommended, so they are not
-documented here.
-.SH "SEE ALSO"
-XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__).
diff --git a/xc/programs/Xserver/hw/xfree86/input/microtouch/microtouch.cpp b/xc/programs/Xserver/hw/xfree86/input/microtouch/microtouch.cpp
deleted file mode 100644
index ebda94e8f..000000000
--- a/xc/programs/Xserver/hw/xfree86/input/microtouch/microtouch.cpp
+++ /dev/null
@@ -1,36 +0,0 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/input/microtouch/microtouch.cpp,v 1.5 2000/12/11 20:18:51 dawes Exp $
-.\" shorthand for double quote that works everywhere.
-.ds q \N'34'
-.TH MICROTOUCH __drivermansuffix__ "Version 4.0.2" "XFree86"
-.SH NAME
-microtouch \- MicroTouch input driver
-.SH SYNOPSIS
-.nf
-.B "Section \*qInputDevice\*q"
-.BI " Identifier \*q" idevname \*q
-.B " Driver \*qmicrotouch\*q"
-.BI " Option \*qDevice\*q \*q" devpath \*q
-\ \ ...
-.B EndSection
-.fi
-.SH DESCRIPTION
-.B microtouch
-is an XFree86 input driver for MicroTouch devices...
-.PP
-The
-.B microtouch
-driver functions as a pointer input device, and may be used as the
-X server's core pointer.
-THIS MAN PAGE NEEDS TO BE FILLED IN.
-.SH SUPPORTED HARDWARE
-What is supported...
-.SH CONFIGURATION DETAILS
-Please refer to XF86Config(__filemansuffix__) for general configuration
-details and for options that can be used with all input drivers. This
-section only covers configuration details specific to this driver.
-.PP
-Config details...
-.SH "SEE ALSO"
-XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__).
-.SH AUTHORS
-Authors include...
diff --git a/xc/programs/Xserver/hw/xfree86/input/mouse/mouse.cpp b/xc/programs/Xserver/hw/xfree86/input/mouse/mouse.cpp
deleted file mode 100644
index cd4840111..000000000
--- a/xc/programs/Xserver/hw/xfree86/input/mouse/mouse.cpp
+++ /dev/null
@@ -1,151 +0,0 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/input/mouse/mouse.cpp,v 1.6 2000/12/12 18:54:32 dawes Exp $
-.\" shorthand for double quote that works everywhere.
-.ds q \N'34'
-.TH MOUSE __drivermansuffix__ "Version 4.0.2" "XFree86"
-.SH NAME
-mouse \- Mouse input driver
-.SH SYNOPSIS
-.nf
-.B "Section \*qInputDevice\*q"
-.BI " Identifier \*q" idevname \*q
-.B " Driver \*qmouse\*q"
-.BI " Option \*qProtocol\*q \*q" protoname \*q
-.BI " Option \*qDevice\*q \*q" devpath \*q
-\ \ ...
-.B EndSection
-.fi
-.SH DESCRIPTION
-.B mouse
-is an XFree86 input driver for mice. The driver supports most available
-mouse types and interfaces. USB mice are only supported on some OSs,
-and the level of support for PS/2 mice depends on the OS.
-.PP
-The
-.B mouse
-driver functions as a pointer input device, and may be used as the
-X server's core pointer. Multiple mice are supported by multiple
-instances of this driver.
-.SH SUPPORTED HARDWARE
-There is a detailed list of hardware that the
-.B mouse
-driver supports in the
-.I README.mouse
-document. This can be found
-in __projectroot__/lib/X11/doc/, or online at
-http://www.xfree86.org/current/mouse.html.
-.SH CONFIGURATION DETAILS
-Please refer to XF86Config(__filemansuffix__) for general configuration
-details and for options that can be used with all input drivers. This
-section only covers configuration details specific to this driver.
-.PP
-The driver can auto-detect the mouse type on some platforms On some
-platforms this is limited to plug and play serial mice, and on some the
-auto-detection works for any mouse that the OS's kernel driver supports.
-On others, it is always necessary to specify the mouse protocol in the
-config file. The
-.I README.mouse
-document contains some detailed information about this.
-.PP
-The following driver
-.B Options
-are supported:
-.TP 7
-.BI "Option \*qProtocol\*q \*q" string \*q
-Specify the mouse protocol. Valid protocol types include:
-.PP
-.RS 12
-Auto, Microsoft, MouseSystems, MMSeries, Logitech, MouseMan, MMHitTab,
-GlidePoint, IntelliMouse, ThinkingMouse, AceCad, PS/2, ImPS/2,
-ExplorerPS/2, ThinkingMousePS/2, MouseManPlusPS/2, GlidePointPS/2,
-NetMousePS/2, NetScrollPS/2, BusMouse, SysMouse, WSMouse, USB, Xqueue.
-.RE
-.PP
-.RS 7
-Not all protocols are supported on all platforms. The "Auto" platform
-specifies that protocol auto-detection should be attempted. There is no
-default protocol setting, and specifying this option is mandatory.
-.RE
-.TP 7
-.BI "Option \*qDevice\*q \*q" string \*q
-Specifies the device through which the mouse can be accessed. A common
-setting is "/dev/mouse", which is often a symbolic link to the real
-device. This option is mandatory, and there is no default setting.
-.TP 7
-.BI "Option \*qButtons\*q \*q" integer \*q
-Specifies the number of mouse buttons. In cases where the number of buttons
-cannot be auto-detected, the default value is 3.
-.TP 7
-.BI "Option \*qEmulate3Buttons\*q \*q" boolean \*q
-Enable/disable the emulation of the third (middle) mouse button for mice
-which only have two physical buttons. The third button is emulated by
-pressing both buttons simultaneously. Default: off
-.TP 7
-.BI "Option \*qEmulate3Timeout\*q \*q" integer \*q
-Sets the timeout (in milliseconds) that the driver waits before deciding
-if two buttons where pressed "simultaneously" when 3 button emulation is
-enabled. Default: 50.
-.TP 7
-.BI "Option \*qChordMiddle\*q \*q" boolean \*q
-Enable/disable handling of mice that send left+right events when the middle
-button is used. Default: off.
-.TP 7
-.BI "Option \*qZAxisMapping\*q \*qX\*q"
-.TP 7
-.BI "Option \*qZAxisMapping\*q \*qY\*q"
-.TP 7
-.BI "Option \*qZAxisMapping\*q \*q" "N1 N2" \*q
-.TP 7
-.BI "Option \*qZAxisMapping\*q \*q" "N1 N2 N3 N4" \*q
-Set the mapping for the Z axis (wheel) motion to buttons or another axis
-.RB ( X
-or
-.BR Y ).
-Button number
-.I N1
-is mapped to the negative Z axis motion and button number
-.I N2
-is mapped to the positive Z axis motion. For mice with two wheels,
-four button numbers can be specified, with the negative and positive motion
-of the second wheel mapped respectively to buttons number
-.I N3
-and
-.IR N4 .
-.TP 7
-.BI "Option \*qFlipXY\*q \*q" boolean \*q
-Enable/disable swapping the X and Y axes. Default: off.
-.TP 7
-.BI "Option \*qSampleRate\*q \*q" integer \*q
-Sets the number of motion/button events the mouse sends per second. Setting
-this is only supported for some mice, including some Logitech mice and
-some PS/2 mice on some platforms. Default: whatever the mouse is
-already set to.
-.TP 7
-.BI "Option \*qResolution\*q \*q" integer \*q
-Sets the resolution of the device in counts per inch. Setting this is
-only supported for some mice, including some PS/2 mice on some platforms.
-Default: whatever the mouse is already set to.
-.TP 7
-.BI "Option \*qClearDTR\*q \*q" boolean \*q
-Enable/disable clearing the DTR line on the serial port used by the mouse.
-Some dual-protocol mice require the DTR line to be cleared to operate
-in the non-default protocol. This option is for serial mice only.
-Default: off.
-.TP 7
-.BI "Option \*qClearRTS\*q \*q" boolean \*q
-Enable/disable clearing the RTS line on the serial port used by the mouse.
-Some dual-protocol mice require the RTS line to be cleared to operate
-in the non-default protocol. This option is for serial mice only.
-Default: off.
-.TP 7
-.BI "Option \*qBaudRate\*q \*q" integer \*q
-Set the baud rate to use for communicating with a serial mouse. This
-option should rarely be required because the default is correct for almost
-all situations. Valid values include: 300, 1200, 2400, 4800, 9600, 19200.
-Default: 1200.
-.PP
-There are some other options that may be used to control various parameters
-for serial port communication, but they are not documented here because
-the driver sets them correctly for each mouse protocol type.
-.SH "SEE ALSO"
-XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__),
-README.mouse.
diff --git a/xc/programs/Xserver/hw/xfree86/input/mutouch/mutouch.cpp b/xc/programs/Xserver/hw/xfree86/input/mutouch/mutouch.cpp
deleted file mode 100644
index 7b74b62fa..000000000
--- a/xc/programs/Xserver/hw/xfree86/input/mutouch/mutouch.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/input/mutouch/mutouch.cpp,v 1.3 2000/12/11 20:18:54 dawes Exp $
-.\" shorthand for double quote that works everywhere.
-.ds q \N'34'
-.TH MUTOUCH __drivermansuffix__ "Version 4.0.2" "XFree86"
-.SH NAME
-mutouch \- Microtouch input driver
-.SH SYNOPSIS
-.B "Section \*qInputDevice\*q"
-.br
-.BI " Identifier \*q" idevname \*q
-.br
-.B " Driver \*qmutouch\*q"
-.br
-.BI " Option \*qDevice\*q \*q" devpath \*q
-.br
-\ \ ...
-.br
-.B EndSection
-.SH DESCRIPTION
-.B mutouch
-is an XFree86 input driver for Microtouch devices...
-.PP
-The
-.B mutouch
-driver functions as a pointer input device, and may be used as the
-X server's core pointer.
-THIS MAN PAGE NEEDS TO BE FILLED IN.
-.SH SUPPORTED HARDWARE
-What is supported...
-.SH CONFIGURATION DETAILS
-Please refer to XF86Config(__filemansuffix__) for general configuration
-details and for options that can be used with all input drivers. This
-section only covers configuration details specific to this driver.
-.PP
-Config details...
-.SH "SEE ALSO"
-XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__).
-.SH AUTHORS
-Authors include...
- Patrick Lecoanet
diff --git a/xc/programs/Xserver/hw/xfree86/input/penmount/penmount.cpp b/xc/programs/Xserver/hw/xfree86/input/penmount/penmount.cpp
deleted file mode 100644
index 3526c47b6..000000000
--- a/xc/programs/Xserver/hw/xfree86/input/penmount/penmount.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/input/penmount/penmount.cpp,v 1.2 2000/12/11 20:18:55 dawes Exp $
-.TH PENNMOUNT __drivermansuffix__ "Version 4.0.2" "XFree86"
-.SH NAME
-penmount \- PenMount input driver
-.SH SYNOPSIS
-.B "Section ""InputDevice"""
-.br
-.BI " Identifier """ idevname """"
-.br
-.B " Driver ""penmount"""
-.br
-.BI " Option ""Device"" """ devpath """"
-.br
-\ \ ...
-.br
-.B EndSection
-.SH DESCRIPTION
-.B penmount
-is an XFree86 input driver for PenMount devices...
-.PP
-The
-.B penmount
-driver functions as a pointer input device, and may be used as the
-X server's core pointer.
-THIS MAN PAGE NEEDS TO BE FILLED IN.
-.SH SUPPORTED HARDWARE
-What is supported...
-.SH CONFIGURATION DETAILS
-Please refer to XF86Config(__filemansuffix__) for general configuration
-details and for options that can be used with all input drivers. This
-section only covers configuration details specific to this driver.
-.PP
-Config details...
-.SH "SEE ALSO"
-XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__).
-.SH AUTHORS
-Authors include...
diff --git a/xc/programs/Xserver/hw/xfree86/input/void/void.cpp b/xc/programs/Xserver/hw/xfree86/input/void/void.cpp
deleted file mode 100644
index 4c12a3c44..000000000
--- a/xc/programs/Xserver/hw/xfree86/input/void/void.cpp
+++ /dev/null
@@ -1,29 +0,0 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/input/void/void.cpp,v 1.5 2000/12/11 20:18:56 dawes Exp $
-.\" shorthand for double quote that works everywhere.
-.ds q \N'34'
-.TH VOID __drivermansuffix__ "Version 4.0.2" "XFree86"
-.SH NAME
-void \- null input driver
-.SH SYNOPSIS
-.nf
-.B "Section \*qInputDevice\*q"
-.BI " Identifier \*q" idevname \*q
-.B " Driver \*qvoid\*q"
-\ \ ...
-.B EndSection
-.fi
-.SH DESCRIPTION
-.B void
-is an dummy/null XFree86 input driver. It doesn't connect to any
-physical device, and it never delivers any events. It functions as
-both a pointer and keyboard device, and may be used as X server's core
-pointer and/or core keyboard. It's purpose is to allow the X server
-to operate without a core pointer and/or core keyboard.
-.SH CONFIGURATION DETAILS
-Please refer to XF86Config(__filemansuffix__) for general configuration
-details and for options that can be used with all input drivers. This
-driver doesn't have any configuration options in addition to those.
-.SH "SEE ALSO"
-XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__).
-.SH AUTHORS
-Authors include...
diff --git a/xc/programs/Xserver/hw/xfree86/input/wacom/wacom.cpp b/xc/programs/Xserver/hw/xfree86/input/wacom/wacom.cpp
deleted file mode 100644
index 6df170c42..000000000
--- a/xc/programs/Xserver/hw/xfree86/input/wacom/wacom.cpp
+++ /dev/null
@@ -1,116 +0,0 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/input/wacom/wacom.cpp,v 1.9 2000/12/18 00:17:18 dawes Exp $
-.\" shorthand for double quote that works everywhere.
-.ds q \N'34'
-.TH WACOM __drivermansuffix__ "Version 4.0.2" "XFree86"
-.SH NAME
-wacom \- Wacom input driver
-.SH SYNOPSIS
-.nf
-.B "Section \*qInputDevice\*q"
-.BI " Identifier \*q" idevname \*q
-.B " Driver \*qwacom\*q"
-.BI " Option \*qDevice\*q \*q" devpath \*q
-\ \ ...
-.B EndSection
-.fi
-.SH DESCRIPTION
-.B wacom
-is an XFree86 input driver for Wacom devices.
-.PP
-The
-.B wacom
-driver functions as a pointer input device, and may be used as the
-X server's core pointer.
-.SH SUPPORTED HARDWARE
-This driver supports the Wacom IV and Wacom V protocols.
-Preliminary support is available for USB devices on some Linux platforms.
-.SH CONFIGURATION DETAILS
-Please refer to XF86Config(__filemansuffix__) for general configuration
-details and for options that can be used with all input drivers. This
-section only covers configuration details specific to this driver.
-.PP
-Multiple instances of the Wacom devices can cohabit. It can be useful
-to define multiple devices with different active zones. Each device
-supports the following entries:
-.RS 8
-.TP 4
-.B Option \fI"Type"\fP \fI"stylus"|"eraser"|"cursor"\fP
-sets the type of tool the device represent. This option is mandatory.
-.TP 4
-.B Option \fI"Device"\fP \fI"path"\fP
-sets the path to the special file which represents serial line where
-the tablet is plugged. You have to specify it for each subsection with
-the same value if you want to have multiple devices with the same tablet.
-This option is mandatory.
-.TP 4
-.B Option \fI"USB"\fP \fI"on"\fP
-tells the driver to dialog with the tablet the USB way. This option is
-only available on some Linux platforms.
-.TP 4
-.B Option \fI"DeviceName"\fP \fI"name"\fP
-sets the name of the X device.
-.TP 4
-.B Option \fI"Suppress"\fP \fI"Inumber"\fP
-sets the position increment under which not to transmit coordinates.
-This entry must be specified only in the first Wacom subsection if you have
-multiple devices for one tablet. If you don't specify this entry, the default value
-is computed to
-.TP 4
-.B Option \fI"Mode"\fP \fI"Relative"|"Absolute"\fP
-sets the mode of the device.
-.TP 4
-.B Option \fI"Tilt"\fP \fI"on"\fP
-enables tilt report if your tablet supports it (ROM version 1.4 and above).
-If this is enabled, multiple devices at the same time will not be reported.
-.TP 4
-.B Option \fI"HistorySize"\fP \fI"number"\fP
-sets the motion history size. By default the value is zero.
-.TP 4
-.B Option \fI"AlwaysCore"\fP \fI"on"\fP
-enables the sharing of the core pointer. When this feature is enabled, the
-device will take control of the core pointer (and thus will emit core events)
-and at the same time will be able, when asked so, to report extended events.
-You can use the last available integer feedback to control this feature. When
-the value of the feedback is zero, the feature is disabled. The feature is
-enabled for any other value.
-.TP 4
-.B Option \fI"TopX"\fP \fI"number"\fP
-X coordinate of the top corner of the active zone.
-.TP 4
-.B Option \fI"TopY"\fP \fI"number"\fP
-Y coordinate of the top corner of the active zone.
-.TP 4
-.B Option \fI"BottomX"\fP \fI"Inumber"\fP
-X coordinate of the bottom corner of the active zone.
-.TP 4
-.B Option \fI"BottomY"\fP \fI"number"\fP
-Y coordinate of the bottom corner of the active zone.
-.TP 4
-.B Option \fI"KeepShape"\fP \fI"on"\fP
-When this option is enabled, the active zone begins according to TopX
-and TopY. The bottom corner is adjusted to keep the ratio width/height
-of the active zone the same as the screen while maximizing the area
-described by TopX, TopY, BottomX, BottomY.
-.TP 4
-.B Option \fI"DebugLevel"\fP \fInumber \fP
-sets the level of debugging info reported.
-.TP 4
-.B Option \fI"BaudRate"\fP \fI"38400"\fP, \fI"19200"\fP or \fI"9600"\fP (default)
-changes the serial link speed. This option is only available for
-wacom V models (Intuos).
-.TP 4
-.B Option \fI"Serial"\fP \fI"number"\fP
-sets the serial number associated with the physical device. This allows
-to have multiple devices of the same type (i.e. multiple pens). This
-option is only available on wacom V devices (Intuos). To see which
-serial number belongs to a device, you have to set the DebugLevel to 6 and
-watch the output of the X server.
-.TP 4
-.B Option \fI"Threshold"\fP \fI"number"\fP
-sets the pressure threshold used to generate a button 1 events of stylus
-devices for some models of tablets (Intuos and Graphire).
-.RE
-.SH "SEE ALSO"
-XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__).
-.SH AUTHORS
-Frederic Lepied <lepied@xfree86.org>
diff --git a/xc/programs/Xserver/hw/xfree86/loader/xf86sym.c b/xc/programs/Xserver/hw/xfree86/loader/xf86sym.c
index 054ac7539..51d3bd81e 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.178 2000/12/08 22:31:52 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/xf86sym.c,v 1.184 2001/02/18 16:41:14 dawes Exp $ */
/*
*
@@ -22,6 +22,7 @@
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
+#define COMPILER_H_EXTRAS
#include <fcntl.h>
#include "sym.h"
#include "misc.h"
@@ -54,10 +55,7 @@
#include "xf86Priv.h"
#include "vbe.h"
#include "xf86sbusBus.h"
-#ifdef __alpha__
-/* MMIO function prototypes */
#include "compiler.h"
-#endif
#ifdef __FreeBSD__
/* XXX used in drmOpen(). This should change to use a less os-specific
@@ -65,23 +63,6 @@
int sysctlbyname(const char*, void *, size_t *, void *, size_t);
#endif
-/* XXX Should get all of these from elsewhere */
-#if defined(PowerMAX_OS) || (defined(sun) && defined(SVR4))
-# undef inb
-# undef inw
-# undef inl
-# undef outb
-# undef outw
-# undef outl
-
-extern void outb(unsigned int a, unsigned char b);
-extern void outw(unsigned int a, unsigned short w);
-extern void outl(unsigned int a, unsigned long l);
-extern unsigned char inb(unsigned int a);
-extern unsigned short inw(unsigned int a);
-extern unsigned long inl(unsigned int a);
-#endif
-
#if defined(__alpha__)
# ifdef linux
extern unsigned long _bus_base(void);
@@ -120,16 +101,9 @@ extern long __divsf3(long, long);
extern long __moddi3(long, long);
extern long __udivdi3(long, long);
extern long __umoddi3(long, long);
-extern void _outb(char val, unsigned short port);
-extern void _outw(short val, unsigned short port);
-extern void _outl(int val, unsigned short port);
-extern unsigned int _inb(unsigned short port);
-extern unsigned int _inw(unsigned short port);
-extern unsigned int _inl(unsigned short port);
#endif
#if defined(__powerpc__) && (defined(Lynx) || defined(linux))
-void eieio();
void _restf14();
void _restf17();
void _restf18();
@@ -171,14 +145,6 @@ extern void outl(unsigned short, unsigned int);
extern unsigned int inb(unsigned short);
extern unsigned int inw(unsigned short);
extern unsigned int inl(unsigned short);
-extern unsigned long ldq_u(void *);
-extern unsigned long ldl_u(void *);
-extern unsigned short ldw_u(void *);
-extern void stl_u(unsigned long, void *);
-extern void stq_u(unsigned long, void *);
-extern void stw_u(unsigned short, void *);
-extern void mem_barrier(void);
-extern void write_mem_barrier(void);
extern void stl_brx(unsigned long, volatile unsigned char *, int);
extern void stw_brx(unsigned short, volatile unsigned char *, int);
extern unsigned long ldl_brx(volatile unsigned char *, int);
@@ -191,11 +157,7 @@ extern int testinx2(unsigned short, unsigned char, unsigned char);
extern int testinx(unsigned short, unsigned char);
#endif
-/* XXX This needs to be cleaned up for the new design */
-
-#ifdef DPMSExtension
extern void DPMSSet(CARD16);
-#endif
/* XFree86 things */
@@ -618,9 +580,7 @@ LOOKUP xfree86LookupTab[] = {
SYMFUNC(xf86XInputSetSendCoreEvents)
/* End merged segment */
#endif
-#ifdef DPMSExtension
SYMFUNC(DPMSSet)
-#endif
/* xf86Debug.c */
#ifdef BUILDDEBUG
SYMFUNC(xf86Break1)
@@ -777,22 +737,18 @@ LOOKUP xfree86LookupTab[] = {
SYMFUNC(xf86memchr)
SYMFUNC(xf86memcmp)
SYMFUNC(xf86memcpy)
-#if (defined(__powerpc__) && (defined(Lynx) || defined(linux))) || defined(__sparc__) || defined(__ia64__)
/*
- * 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.
+ * Some compilers generate calls to memcpy to handle structure copies
+ * or run-time initializations.
*/
- SYMFUNC(memcpy)
+ SYMFUNCALIAS("memcpy",xf86memcpy)
+ SYMFUNC(xf86memset)
/*
- * Some PPC, SPARC, and IA64 compilers generate calls to memset to handle
- * aggregate initializations.
+ * Some compilers generate calls to memset to handle aggregate
+ * initializations.
*/
- SYMFUNC(memset)
-#endif
+ SYMFUNCALIAS("memset",xf86memset)
SYMFUNC(xf86memmove)
- SYMFUNC(xf86memset)
SYMFUNC(xf86mmap)
SYMFUNC(xf86modf)
SYMFUNC(xf86munmap)
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/bsd/Imakefile b/xc/programs/Xserver/hw/xfree86/os-support/bsd/Imakefile
index 874355c26..ef8f8dad6 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.46 2000/11/06 19:24:08 dawes Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/Imakefile,v 3.47 2001/02/15 19:34:20 eich Exp $
#include <Server.tmpl>
@@ -94,8 +94,8 @@ RES_OBJ=bsdResource.o
#endif
#if defined(AlphaArchitecture)
-AXP_SRC=bsd_ev56.c
-AXP_OBJ=bsd_ev56.o
+AXP_SRC=bsd_ev56.c xf86Axp.c bsd_axp.c
+AXP_OBJ=bsd_ev56.o xf86Axp.o bsd_axp.o
#endif
#if defined(FreeBSDArchitecture) && HasAgpGart
@@ -118,7 +118,7 @@ OBJS = bsd_init.o bsd_video.o bsd_io.o bsd_VTsw.o \
INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) -I. -I$(SERVERSRC)/include \
-I$(XINCLUDESRC) -I$(EXTINCSRC) -I$(SERVERSRC)/mi $(APINCLUDES) \
- $(LIBUSBINCLUDES)
+ $(LIBUSBINCLUDES) -I$(XF86OSSRC)/shared
CONSDEFINES = XFree86ConsoleDefines
RESDEFINES = -DUSESTDRES
@@ -176,6 +176,9 @@ LinkSourceFile(lnx_agp.c,../linux)
#else
LinkSourceFile(agp_noop.c,../shared)
#endif
+#if defined(AlphaArchitecture)
+LinkSourceFile(xf86Axp.c,../shared)
+#endif
DependTarget()
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/bsd/bsdResource.c b/xc/programs/Xserver/hw/xfree86/os-support/bsd/bsdResource.c
index a94be5ecb..c19751bed 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/bsd/bsdResource.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/bsd/bsdResource.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsdResource.c,v 1.2 2000/11/06 19:24:08 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsdResource.c,v 1.6 2001/02/16 14:45:10 tsi Exp $ */
/* Resource information code */
@@ -23,10 +23,10 @@ xf86BusAccWindowsFromOS(void)
resPtr ret = NULL;
resRange range;
- RANGE(range,0,0xffffffff,ResExcMemBlock);
+ RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
ret = xf86AddResToList(ret, &range, -1);
- RANGE(range,0,0xffffffff,ResExcIoBlock);
+ RANGE(range, 0x00000000, 0xffffffff, ResExcIoBlock);
ret = xf86AddResToList(ret, &range, -1);
return ret;
}
@@ -44,10 +44,10 @@ xf86PciBusAccWindowsFromOS(void)
* region 0x40000000-0xbfffffff for DMA but this only matters if
* the bios screws up the pci region mappings.
*/
- RANGE(range,0x80000000,0xffffffff,ResExcMemBlock);
+ RANGE(range, 0x80000000, 0xffffffff, ResExcMemBlock);
ret = xf86AddResToList(ret, &range, -1);
- RANGE(range,0,0xffffffff,ResExcIoBlock);
+ RANGE(range, 0x00000000, 0xffffffff, ResExcIoBlock);
ret = xf86AddResToList(ret, &range, -1);
return ret;
}
@@ -58,10 +58,10 @@ xf86IsaBusAccWindowsFromOS(void)
resPtr ret = NULL;
resRange range;
- RANGE(range,0,0xffffffff,ResExcMemBlock);
+ RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
ret = xf86AddResToList(ret, &range, -1);
- RANGE(range,0,0xffffffff,ResExcIoBlock);
+ RANGE(range, 0x00000000, 0xffffffff, ResExcIoBlock);
ret = xf86AddResToList(ret, &range, -1);
return ret;
}
@@ -74,17 +74,33 @@ xf86AccResFromOS(resPtr ret)
/*
* Fallback is to claim the following areas:
*
- * 0x000C0000 - 0x000EFFFF location of VGA and other extensions ROMS
+ * 0x000c0000 - 0x000effff location of VGA and other extensions ROMS
*/
- RANGE(range,0xc0000,0xeffff,ResExcMemBlock);
+ RANGE(range, 0x000c0000, 0x000effff, ResExcMemBlock);
ret = xf86AddResToList(ret, &range, -1);
- /* Fallback is to claim well known ports in the 0x0 - 0x3ff range */
- /* Possibly should claim some of them as sparse ranges */
+ /*
+ * Fallback would be to claim well known ports in the 0x0 - 0x3ff range
+ * along with their sparse I/O aliases, but that's too imprecise. Instead
+ * claim a bare minimum here.
+ */
+ RANGE(range, 0x00000000, 0x000000ff, ResExcIoBlock); /* For mainboard */
+ ret = xf86AddResToList(ret, &range, -1);
- RANGE(range,0,0x1ff,ResExcIoBlock | ResEstimated);
+ /*
+ * At minimum, the top and bottom resources must be claimed, so that
+ * resources that are (or appear to be) unallocated can be relocated.
+ */
+ RANGE(range, 0x00000000, 0x00000000, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ RANGE(range, 0xffffffff, 0xffffffff, ResExcMemBlock);
ret = xf86AddResToList(ret, &range, -1);
+/* RANGE(range, 0x00000000, 0x00000000, ResExcIoBlock);
+ ret = xf86AddResToList(ret, &range, -1); */
+ RANGE(range, 0xffffffff, 0xffffffff, ResExcIoBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+
/* XXX add others */
return ret;
}
@@ -99,10 +115,10 @@ xf86BusAccWindowsFromOS(void)
resPtr ret = NULL;
resRange range;
- RANGE(range, 0, 0xffffffff, ResExcMemBlock);
+ RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0, 0x0000ffff, ResExcIoBlock);
+ RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock);
ret = xf86AddResToList(ret, &range, -1);
return ret;
}
@@ -113,10 +129,24 @@ xf86PciBusAccWindowsFromOS(void)
resPtr ret = NULL;
resRange range;
- RANGE(range, 0, 0xffffffff, ResExcMemBlock);
+ RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0, 0x0000ffff, ResExcIoBlock);
+ RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ return ret;
+}
+
+resPtr
+xf86IsaBusAccWindowsFromOS(void)
+{
+ resPtr ret = NULL;
+ resRange range;
+
+ RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+
+ RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock);
ret = xf86AddResToList(ret, &range, -1);
return ret;
}
@@ -124,6 +154,21 @@ xf86PciBusAccWindowsFromOS(void)
resPtr
xf86AccResFromOS(resPtr ret)
{
+ resRange range;
+
+ /*
+ * At minimum, the top and bottom resources must be claimed, so that
+ * resources that are (or appear to be) unallocated can be relocated.
+ */
+ RANGE(range, 0x00000000, 0x00000000, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ RANGE(range, 0xffffffff, 0xffffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ RANGE(range, 0x00000000, 0x00000000, ResExcIoBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ RANGE(range, 0x0000ffff, 0x0000ffff, ResExcIoBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+
return ret;
}
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 41328aab9..3c29043b8 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.3 2000/10/27 21:14:55 dawes Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/Imakefile,v 1.4 2001/01/19 08:08:40 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
@@ -14,9 +14,27 @@ MOBJ = drmmodule.o
MTRR_DEFINES = -DHAS_MTRR_SUPPORT
#endif
-SRCS = xf86drm.c xf86drmHash.c xf86drmRandom.c xf86drmSL.c xf86drmI810.c xf86drmMga.c xf86drmR128.c xf86drmSiS.c $(MSRC)
-OBJS = xf86drm.o xf86drmHash.o xf86drmRandom.o xf86drmSL.o xf86drmI810.o xf86drmMga.o xf86drmR128.o xf86drmSiS.o $(MOBJ)
+ SRCS = xf86drm.c \
+ xf86drmHash.c \
+ xf86drmRandom.c \
+ xf86drmSL.c \
+ xf86drmI810.c \
+ xf86drmMga.c \
+ xf86drmR128.c \
+ xf86drmRadeon.c \
+ xf86drmSiS.c \
+ $(MSRC)
+ OBJS = xf86drm.o \
+ xf86drmHash.o \
+ xf86drmRandom.o \
+ xf86drmSL.o \
+ xf86drmI810.o \
+ xf86drmMga.o \
+ xf86drmR128.o \
+ xf86drmRadeon.o \
+ xf86drmSiS.o \
+ $(MOBJ)
INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) -I. -I$(SERVERSRC)/include \
-I$(XINCLUDESRC) -I$(EXTINCSRC) -I../.. -Ikernel
@@ -45,6 +63,7 @@ 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(xf86drmRadeon.c,$(XF86OSSRC)/linux/drm)
LinkSourceFile(xf86drmSL.c,$(XF86OSSRC)/linux/drm)
LinkSourceFile(xf86drmSiS.c,$(XF86OSSRC)/linux/drm)
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 47dff5bfb..f58193175 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,4 +1,4 @@
-XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/Imakefile,v 1.3 2000/10/27 16:59:40 dawes Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/Imakefile,v 1.4 2001/01/12 19:28:34 dawes Exp $
#include <Server.tmpl>
@@ -18,6 +18,7 @@ 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(radeon_drm.h,$(XF86OSSRC)/linux/drm/kernel)
LinkSourceFile(sis_drm.h,$(XF86OSSRC)/linux/drm/kernel)
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/Imakefile b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/Imakefile
index 34244e6e5..189df551a 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/Imakefile
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/Imakefile
@@ -1,4 +1,4 @@
-XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/Imakefile,v 1.7 2000/10/10 16:38:43 alanh Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/Imakefile,v 1.9 2001/01/19 08:08:41 dawes Exp $
#define IHaveModules
#include <Server.tmpl>
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 d022557d8..470c25b38 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
@@ -262,5 +262,5 @@ $(R128OBJS): $(R128HEADERS)
$(RADEONOBJS): $(RADEONHEADERS)
endif
-clean:
+clean cleandir::
rm -f *.o *.a *~ core
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mga_drm.h b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mga_drm.h
index 5cf863185..7c296374c 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mga_drm.h
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mga_drm.h
@@ -296,14 +296,14 @@ typedef struct drm_mga_iload {
unsigned int length;
} drm_mga_iload_t;
-typedef struct drm_mga_blit {
+typedef struct _drm_mga_blit {
unsigned int planemask;
- unsigned int srcorg;
- unsigned int dstorg;
- int src_pitch, dst_pitch;
+ unsigned int source;
+ unsigned int dest;
int delta_sx, delta_sy;
int delta_dx, delta_dy;
int height, ydir; /* flip image vertically */
+ int source_pitch, dest_pitch;
} drm_mga_blit_t;
#endif
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/radeon_bufs.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/radeon_bufs.c
new file mode 100644
index 000000000..9a3093eb1
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/radeon_bufs.c
@@ -0,0 +1,298 @@
+/* radeon_bufs.c -- IOCTLs to manage buffers -*- linux-c -*-
+ *
+ * Copyright 2000 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Fremont, 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: Kevin E. Martin <martin@valinux.com>
+ * Rickard E. (Rik) Faith <faith@valinux.com>
+ * Jeff Hartmann <jhartmann@valinux.com>
+ *
+ */
+
+#define __NO_VERSION__
+#include <linux/config.h>
+#include "drmP.h"
+#include "radeon_drv.h"
+#include "linux/un.h"
+
+
+#if defined(CONFIG_AGP) || defined(CONFIG_AGP_MODULE)
+int radeon_addbufs_agp(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_device_dma_t *dma = dev->dma;
+ drm_buf_desc_t request;
+ drm_buf_entry_t *entry;
+ drm_buf_t *buf;
+ unsigned long offset;
+ unsigned long agp_offset;
+ int count;
+ int order;
+ int size;
+ int alignment;
+ int page_order;
+ int total;
+ int byte_count;
+ int i;
+
+ if (!dma) return -EINVAL;
+
+ if (copy_from_user(&request, (drm_buf_desc_t *)arg, sizeof(request)))
+ return -EFAULT;
+
+ count = request.count;
+ order = drm_order(request.size);
+ size = 1 << order;
+
+ alignment = (request.flags & _DRM_PAGE_ALIGN) ? PAGE_ALIGN(size):size;
+ page_order = order - PAGE_SHIFT > 0 ? order - PAGE_SHIFT : 0;
+ total = PAGE_SIZE << page_order;
+
+ byte_count = 0;
+ agp_offset = dev->agp->base + request.agp_start;
+
+ DRM_DEBUG("count: %d\n", count);
+ DRM_DEBUG("order: %d\n", order);
+ DRM_DEBUG("size: %d\n", size);
+ DRM_DEBUG("agp_offset: %ld\n", agp_offset);
+ DRM_DEBUG("alignment: %d\n", alignment);
+ DRM_DEBUG("page_order: %d\n", page_order);
+ DRM_DEBUG("total: %d\n", total);
+
+ if (order < DRM_MIN_ORDER || order > DRM_MAX_ORDER) return -EINVAL;
+ if (dev->queue_count) return -EBUSY; /* Not while in use */
+
+ spin_lock(&dev->count_lock);
+ if (dev->buf_use) {
+ spin_unlock(&dev->count_lock);
+ return -EBUSY;
+ }
+ atomic_inc(&dev->buf_alloc);
+ spin_unlock(&dev->count_lock);
+
+ down(&dev->struct_sem);
+ entry = &dma->bufs[order];
+ if (entry->buf_count) {
+ up(&dev->struct_sem);
+ atomic_dec(&dev->buf_alloc);
+ return -ENOMEM; /* May only call once for each order */
+ }
+
+ entry->buflist = drm_alloc(count * sizeof(*entry->buflist),
+ DRM_MEM_BUFS);
+ if (!entry->buflist) {
+ up(&dev->struct_sem);
+ atomic_dec(&dev->buf_alloc);
+ return -ENOMEM;
+ }
+ memset(entry->buflist, 0, count * sizeof(*entry->buflist));
+
+ entry->buf_size = size;
+ entry->page_order = page_order;
+ offset = 0;
+
+ for (offset = 0;
+ entry->buf_count < count;
+ offset += alignment, ++entry->buf_count) {
+ buf = &entry->buflist[entry->buf_count];
+ buf->idx = dma->buf_count + entry->buf_count;
+ buf->total = alignment;
+ buf->order = order;
+ buf->used = 0;
+ buf->offset = (dma->byte_count + offset);
+ buf->address = (void *)(agp_offset + offset);
+ buf->next = NULL;
+ buf->waiting = 0;
+ buf->pending = 0;
+ init_waitqueue_head(&buf->dma_wait);
+ buf->pid = 0;
+
+ buf->dev_priv_size = sizeof(drm_radeon_buf_priv_t);
+ buf->dev_private = drm_alloc(sizeof(drm_radeon_buf_priv_t),
+ DRM_MEM_BUFS);
+ memset(buf->dev_private, 0, buf->dev_priv_size);
+
+#if DRM_DMA_HISTOGRAM
+ buf->time_queued = 0;
+ buf->time_dispatched = 0;
+ buf->time_completed = 0;
+ buf->time_freed = 0;
+#endif
+
+ byte_count += PAGE_SIZE << page_order;
+
+ DRM_DEBUG("buffer %d @ %p\n",
+ entry->buf_count, buf->address);
+ }
+
+ DRM_DEBUG("byte_count: %d\n", byte_count);
+
+ dma->buflist = drm_realloc(dma->buflist,
+ dma->buf_count * sizeof(*dma->buflist),
+ (dma->buf_count + entry->buf_count)
+ * sizeof(*dma->buflist),
+ DRM_MEM_BUFS);
+ for (i = dma->buf_count; i < dma->buf_count + entry->buf_count; i++)
+ dma->buflist[i] = &entry->buflist[i - dma->buf_count];
+
+ dma->buf_count += entry->buf_count;
+ dma->byte_count += byte_count;
+
+ drm_freelist_create(&entry->freelist, entry->buf_count);
+ for (i = 0; i < entry->buf_count; i++) {
+ drm_freelist_put(dev, &entry->freelist, &entry->buflist[i]);
+ }
+
+ up(&dev->struct_sem);
+
+ request.count = entry->buf_count;
+ request.size = size;
+
+ if (copy_to_user((drm_buf_desc_t *)arg, &request, sizeof(request)))
+ return -EFAULT;
+
+ dma->flags = _DRM_DMA_USE_AGP;
+
+ atomic_dec(&dev->buf_alloc);
+ return 0;
+}
+#endif
+
+int radeon_addbufs(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_radeon_private_t *dev_priv = dev->dev_private;
+ drm_buf_desc_t request;
+
+ if (!dev_priv || dev_priv->is_pci) return -EINVAL;
+
+ if (copy_from_user(&request, (drm_buf_desc_t *)arg, sizeof(request)))
+ return -EFAULT;
+
+#if defined(CONFIG_AGP) || defined(CONFIG_AGP_MODULE)
+ if (request.flags & _DRM_AGP_BUFFER)
+ return radeon_addbufs_agp(inode, filp, cmd, arg);
+ else
+#endif
+ return -EINVAL;
+}
+
+int radeon_mapbufs(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_radeon_private_t *dev_priv = dev->dev_private;
+ drm_device_dma_t *dma = dev->dma;
+ int retcode = 0;
+ const int zero = 0;
+ unsigned long virtual;
+ unsigned long address;
+ drm_buf_map_t request;
+ int i;
+
+ if (!dma || !dev_priv || dev_priv->is_pci) return -EINVAL;
+
+ DRM_DEBUG("\n");
+
+ spin_lock(&dev->count_lock);
+ if (atomic_read(&dev->buf_alloc)) {
+ spin_unlock(&dev->count_lock);
+ return -EBUSY;
+ }
+ ++dev->buf_use; /* Can't allocate more after this call */
+ spin_unlock(&dev->count_lock);
+
+ if (copy_from_user(&request, (drm_buf_map_t *)arg, sizeof(request)))
+ return -EFAULT;
+
+ if (request.count >= dma->buf_count) {
+ if (dma->flags & _DRM_DMA_USE_AGP) {
+ drm_map_t *map;
+
+ map = dev_priv->buffers;
+ if (!map) {
+ retcode = -EINVAL;
+ goto done;
+ }
+
+ down(&current->mm->mmap_sem);
+ virtual = do_mmap(filp, 0, map->size,
+ PROT_READ|PROT_WRITE,
+ MAP_SHARED,
+ (unsigned long)map->offset);
+ up(&current->mm->mmap_sem);
+ } else {
+ down(&current->mm->mmap_sem);
+ virtual = do_mmap(filp, 0, dma->byte_count,
+ PROT_READ|PROT_WRITE, MAP_SHARED, 0);
+ up(&current->mm->mmap_sem);
+ }
+ if (virtual > -1024UL) {
+ /* Real error */
+ retcode = (signed long)virtual;
+ goto done;
+ }
+ request.virtual = (void *)virtual;
+
+ for (i = 0; i < dma->buf_count; i++) {
+ if (copy_to_user(&request.list[i].idx,
+ &dma->buflist[i]->idx,
+ sizeof(request.list[0].idx))) {
+ retcode = -EFAULT;
+ goto done;
+ }
+ if (copy_to_user(&request.list[i].total,
+ &dma->buflist[i]->total,
+ sizeof(request.list[0].total))) {
+ retcode = -EFAULT;
+ goto done;
+ }
+ if (copy_to_user(&request.list[i].used,
+ &zero,
+ sizeof(zero))) {
+ retcode = -EFAULT;
+ goto done;
+ }
+ address = virtual + dma->buflist[i]->offset;
+ if (copy_to_user(&request.list[i].address,
+ &address,
+ sizeof(address))) {
+ retcode = -EFAULT;
+ goto done;
+ }
+ }
+ }
+ done:
+ request.count = dma->buf_count;
+ DRM_DEBUG("%d buffers, retcode = %d\n", request.count, retcode);
+
+ if (copy_to_user((drm_buf_map_t *)arg, &request, sizeof(request)))
+ return -EFAULT;
+
+ return retcode;
+}
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/radeon_context.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/radeon_context.c
new file mode 100644
index 000000000..e428dc22c
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/radeon_context.c
@@ -0,0 +1,215 @@
+/* radeon_context.c -- IOCTLs for Radeon contexts -*- linux-c -*-
+ *
+ * Copyright 1999, 2000 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Fremont, 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.
+ *
+ * Author: Kevin E. Martin <martin@valinux.com>
+ * Rickard E. (Rik) Faith <faith@valinux.com>
+ *
+ */
+
+#define __NO_VERSION__
+#include "drmP.h"
+#include "radeon_drv.h"
+
+extern drm_ctx_t radeon_res_ctx;
+
+static int radeon_alloc_queue(drm_device_t *dev)
+{
+ return drm_ctxbitmap_next(dev);
+}
+
+int radeon_context_switch(drm_device_t *dev, int old, int new)
+{
+ char buf[64];
+
+ atomic_inc(&dev->total_ctx);
+
+ if (test_and_set_bit(0, &dev->context_flag)) {
+ DRM_ERROR("Reentering -- FIXME\n");
+ return -EBUSY;
+ }
+
+#if DRM_DMA_HISTOGRAM
+ dev->ctx_start = get_cycles();
+#endif
+
+ DRM_DEBUG("Context switch from %d to %d\n", old, new);
+
+ if (new == dev->last_context) {
+ clear_bit(0, &dev->context_flag);
+ return 0;
+ }
+
+ if (drm_flags & DRM_FLAG_NOCTX) {
+ radeon_context_switch_complete(dev, new);
+ } else {
+ sprintf(buf, "C %d %d\n", old, new);
+ drm_write_string(dev, buf);
+ }
+
+ return 0;
+}
+
+int radeon_context_switch_complete(drm_device_t *dev, int new)
+{
+ dev->last_context = new; /* PRE/POST: This is the _only_ writer. */
+ dev->last_switch = jiffies;
+
+ if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) {
+ DRM_ERROR("Lock isn't held after context switch\n");
+ }
+
+ /* If a context switch is ever initiated
+ when the kernel holds the lock, release
+ that lock here. */
+#if DRM_DMA_HISTOGRAM
+ atomic_inc(&dev->histo.ctx[drm_histogram_slot(get_cycles()
+ - dev->ctx_start)]);
+
+#endif
+ clear_bit(0, &dev->context_flag);
+ wake_up(&dev->context_wait);
+
+ return 0;
+}
+
+
+int radeon_resctx(struct inode *inode, struct file *filp, unsigned int cmd,
+ unsigned long arg)
+{
+ drm_ctx_res_t res;
+ drm_ctx_t ctx;
+ int i;
+
+ DRM_DEBUG("%d\n", DRM_RESERVED_CONTEXTS);
+ if (copy_from_user(&res, (drm_ctx_res_t *)arg, sizeof(res)))
+ return -EFAULT;
+ if (res.count >= DRM_RESERVED_CONTEXTS) {
+ memset(&ctx, 0, sizeof(ctx));
+ for (i = 0; i < DRM_RESERVED_CONTEXTS; i++) {
+ ctx.handle = i;
+ if (copy_to_user(&res.contexts[i], &i, sizeof(i)))
+ return -EFAULT;
+ }
+ }
+ res.count = DRM_RESERVED_CONTEXTS;
+ if (copy_to_user((drm_ctx_res_t *)arg, &res, sizeof(res)))
+ return -EFAULT;
+ return 0;
+}
+
+
+int radeon_addctx(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;
+
+ if (copy_from_user(&ctx, (drm_ctx_t *)arg, sizeof(ctx)))
+ return -EFAULT;
+ if ((ctx.handle = radeon_alloc_queue(dev)) == DRM_KERNEL_CONTEXT) {
+ /* Skip kernel's context and get a new one. */
+ ctx.handle = radeon_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;
+ }
+
+ if (copy_to_user((drm_ctx_t *)arg, &ctx, sizeof(ctx)))
+ return -EFAULT;
+ return 0;
+}
+
+int radeon_modctx(struct inode *inode, struct file *filp, unsigned int cmd,
+ unsigned long arg)
+{
+ drm_ctx_t ctx;
+
+ if (copy_from_user(&ctx, (drm_ctx_t*)arg, sizeof(ctx)))
+ return -EFAULT;
+ if (ctx.flags==_DRM_CONTEXT_PRESERVED)
+ radeon_res_ctx.handle=ctx.handle;
+ return 0;
+}
+
+int radeon_getctx(struct inode *inode, struct file *filp, unsigned int cmd,
+ unsigned long arg)
+{
+ drm_ctx_t ctx;
+
+ if (copy_from_user(&ctx, (drm_ctx_t*)arg, sizeof(ctx)))
+ return -EFAULT;
+ /* This is 0, because we don't hanlde any context flags */
+ ctx.flags = 0;
+ if (copy_to_user((drm_ctx_t*)arg, &ctx, sizeof(ctx)))
+ return -EFAULT;
+ return 0;
+}
+
+int radeon_switchctx(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;
+
+ if (copy_from_user(&ctx, (drm_ctx_t *)arg, sizeof(ctx)))
+ return -EFAULT;
+ DRM_DEBUG("%d\n", ctx.handle);
+ return radeon_context_switch(dev, dev->last_context, ctx.handle);
+}
+
+int radeon_newctx(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;
+
+ if (copy_from_user(&ctx, (drm_ctx_t *)arg, sizeof(ctx)))
+ return -EFAULT;
+ DRM_DEBUG("%d\n", ctx.handle);
+ radeon_context_switch_complete(dev, ctx.handle);
+
+ return 0;
+}
+
+int radeon_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;
+
+ if (copy_from_user(&ctx, (drm_ctx_t *)arg, sizeof(ctx)))
+ return -EFAULT;
+ DRM_DEBUG("%d\n", ctx.handle);
+ drm_ctxbitmap_free(dev, ctx.handle);
+
+ return 0;
+}
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 bb6d6cadf..4908a6981 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,7 +26,7 @@
* Author: Kevin E. Martin <martin@valinux.com>
*
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmR128.c,v 1.6 2000/12/12 17:17:14 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmR128.c,v 1.7 2001/01/08 01:07:37 martin Exp $ */
#ifdef XFree86Server
# include "xf86.h"
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmSiS.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmSiS.c
index 501ac3ac8..4d101c1a1 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmSiS.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmSiS.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmSiS.c,v 1.3 2000/10/10 19:35:30 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmSiS.c,v 1.4 2001/01/08 01:07:37 martin Exp $ */
#ifdef XFree86Server
# include "xf86.h"
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/int10/linux.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/int10/linux.c
index c8aa428f6..efa113f84 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/int10/linux.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/int10/linux.c
@@ -1,10 +1,9 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/int10/linux.c,v 1.19 2000/12/06 15:35:31 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/int10/linux.c,v 1.21 2001/02/15 19:46:04 eich Exp $ */
/*
* linux specific part of the int10 module
* Copyright 1999 Egbert Eich
*/
#include "xf86.h"
-#include "xf86str.h"
#include "xf86_OSproc.h"
#include "xf86_ansic.h"
#include "xf86Pci.h"
@@ -28,12 +27,12 @@
static int counter = 0;
-static CARD8 read_b(xf86Int10InfoPtr pInt,int addr);
-static CARD16 read_w(xf86Int10InfoPtr pInt,int addr);
-static CARD32 read_l(xf86Int10InfoPtr pInt,int addr);
-static void write_b(xf86Int10InfoPtr pInt,int addr, CARD8 val);
-static void write_w(xf86Int10InfoPtr pInt,int addr, CARD16 val);
-static void write_l(xf86Int10InfoPtr pInt,int addr, CARD32 val);
+static CARD8 read_b(xf86Int10InfoPtr pInt, int addr);
+static CARD16 read_w(xf86Int10InfoPtr pInt, int addr);
+static CARD32 read_l(xf86Int10InfoPtr pInt, int addr);
+static void write_b(xf86Int10InfoPtr pInt, int addr, CARD8 val);
+static void write_w(xf86Int10InfoPtr pInt, int addr, CARD16 val);
+static void write_l(xf86Int10InfoPtr pInt, int addr, CARD32 val);
int10MemRec linuxMem = {
read_b,
@@ -70,20 +69,20 @@ xf86InitInt10(int entityIndex)
legacyVGARec vga;
screen = (xf86FindScreenForEntity(entityIndex))->scrnIndex;
- if (int10skip(xf86Screens[screen],entityIndex))
+ if (int10skip(xf86Screens[screen], entityIndex))
return NULL;
if ((!vidMem) || (!sysMem)) {
- if ((fd = open(DEV_MEM,O_RDWR,0)) >= 0) {
+ if ((fd = open(DEV_MEM, O_RDWR, 0)) >= 0) {
if (!sysMem) {
#ifdef DEBUG
ErrorF("Mapping sys bios area\n");
#endif
- if ((sysMem = mmap((void *)(SYS_BIOS),BIOS_SIZE,PROT_READ
- | PROT_WRITE | PROT_EXEC,
- MAP_SHARED | MAP_FIXED,fd, SYS_BIOS))
+ if ((sysMem = mmap((void *)(SYS_BIOS), BIOS_SIZE,
+ PROT_READ | PROT_WRITE | PROT_EXEC,
+ MAP_SHARED | MAP_FIXED, fd, SYS_BIOS))
== MAP_FAILED) {
- xf86DrvMsg(screen,X_ERROR,"Cannot map SYS BIOS\n");
+ xf86DrvMsg(screen, X_ERROR, "Cannot map SYS BIOS\n");
close(fd);
goto error0;
}
@@ -92,33 +91,33 @@ xf86InitInt10(int entityIndex)
#ifdef DEBUG
ErrorF("Mapping VRAM area\n");
#endif
- if ((vidMem = mmap((void *)(V_RAM),VRAM_SIZE,PROT_READ
- | PROT_WRITE | PROT_EXEC,
- MAP_SHARED | MAP_FIXED,fd, V_RAM))
+ if ((vidMem = mmap((void *)(V_RAM), VRAM_SIZE,
+ PROT_READ | PROT_WRITE | PROT_EXEC,
+ MAP_SHARED | MAP_FIXED, fd, V_RAM))
== MAP_FAILED) {
- xf86DrvMsg(screen,X_ERROR,"Cannot map V_RAM\n");
+ xf86DrvMsg(screen, X_ERROR, "Cannot map V_RAM\n");
close(fd);
goto error0;
}
}
close(fd);
} else {
- xf86DrvMsg(screen,X_ERROR,"Cannot open %s\n",DEV_MEM);
+ xf86DrvMsg(screen, X_ERROR, "Cannot open %s\n", DEV_MEM);
goto error0;
}
}
-
- pInt = (xf86Int10InfoPtr)xnfcalloc(1,sizeof(xf86Int10InfoRec));
+
+ pInt = (xf86Int10InfoPtr)xnfcalloc(1, sizeof(xf86Int10InfoRec));
pInt->scrnIndex = screen;
pInt->entityIndex = entityIndex;
if (!xf86Int10ExecSetup(pInt))
goto error0;
pInt->mem = &linuxMem;
pagesize = getpagesize();
- pInt->private = (pointer)xnfcalloc(1,sizeof(linuxInt10Priv));
+ pInt->private = (pointer)xnfcalloc(1, sizeof(linuxInt10Priv));
((linuxInt10Priv*)pInt->private)->screen = screen;
- ((linuxInt10Priv*)pInt->private)->alloc =
- (pointer)xnfcalloc(1,ALLOC_ENTRIES(pagesize));
+ ((linuxInt10Priv*)pInt->private)->alloc =
+ (pointer)xnfcalloc(1, ALLOC_ENTRIES(pagesize));
#ifdef DEBUG
ErrorF("Mapping high memory area\n");
@@ -135,23 +134,23 @@ xf86InitInt10(int entityIndex)
ErrorF("Mapping 640kB area\n");
#endif
if ((low_mem = shmget(counter++, V_RAM,
- IPC_CREAT|SHM_R|SHM_W)) == -1)
+ IPC_CREAT | SHM_R | SHM_W)) == -1)
goto error2;
-
+
((linuxInt10Priv*)pInt->private)->lowMem = low_mem;
- base = shmat(low_mem,0,0);
+ base = shmat(low_mem, 0, 0);
((linuxInt10Priv *)pInt->private)->base = base;
- base_high = shmat(high_mem,0,0);
- ((linuxInt10Priv *)pInt->private)->base_high = base_high;
-
- MapCurrentInt10(pInt);
+ base_high = shmat(high_mem, 0, 0);
+ ((linuxInt10Priv*)pInt->private)->base_high = base_high;
+
+ MapCurrentInt10(pInt);
Int10Current = pInt;
-
+
#ifdef DEBUG
ErrorF("Mapping int area\n");
#endif
- if (xf86ReadBIOS(0,0,(unsigned char *)0,LOW_PAGE_SIZE) < 0) {
- xf86DrvMsg(screen,X_ERROR,"Cannot read int vect\n");
+ if (xf86ReadBIOS(0, 0, (unsigned char *)0, LOW_PAGE_SIZE) < 0) {
+ xf86DrvMsg(screen, X_ERROR, "Cannot read int vect\n");
goto error3;
}
@@ -166,33 +165,61 @@ xf86InitInt10(int entityIndex)
xf86DrvMsg(screen, X_WARNING,
"Unable to retrieve all of segment 0x%06X.\n", cs);
- if (xf86IsEntityPrimary(entityIndex)) {
- cs = ((CARD16*)0)[(0x10<<1)+1];
+ if (xf86IsEntityPrimary(entityIndex)
+ && !(initPrimary(xf86Screens[screen],entityIndex))) {
+ cs = ((CARD16*)0)[(0x10<<1) + 1];
+
bios_base = (unsigned char *)(cs << 4);
-
+
if (!int10_check_bios(screen, cs, bios_base)) {
- cs = ((CARD16*)0)[(0x42<<1)+1];
+ cs = ((CARD16*)0)[(0x42 << 1) + 1];
bios_base = (unsigned char *)(cs << 4);
if (!int10_check_bios(screen, cs, bios_base)) {
cs = V_BIOS >> 4;
bios_base = (unsigned char *)(cs << 4);
if (!int10_check_bios(screen, cs, bios_base)) {
- xf86DrvMsg(screen,X_ERROR,"No V_BIOS found\n");
+ xf86DrvMsg(screen, X_ERROR, "No V_BIOS found\n");
goto error3;
}
}
}
- xf86DrvMsg(screen,X_INFO,"Primary V_BIOS segment is: 0x%x\n",cs);
+ xf86DrvMsg(screen, X_INFO, "Primary V_BIOS segment is: 0x%x\n", cs);
pInt->BIOSseg = cs;
set_return_trap(pInt);
} else {
- if (!mapPciRom(pInt,(unsigned char *)(V_BIOS))) {
- xf86DrvMsg(screen,X_ERROR,"Cannot read V_BIOS\n");
+ EntityInfoPtr pEnt = xf86GetEntityInfo(pInt->entityIndex);
+ switch (pEnt->location.type) {
+ case BUS_PCI:
+ if (!mapPciRom(pInt, (unsigned char *)(V_BIOS))) {
+ xf86DrvMsg(screen, X_ERROR, "Cannot read V_BIOS\n");
+ goto error3;
+ }
+ pInt->BIOSseg = V_BIOS >> 4;
+ break;
+ case BUS_ISA:
+ cs = ((CARD16*)0)[(0x10<<1)+1];
+ bios_base = (unsigned char *)(cs << 4);
+
+ if (!int10_check_bios(screen, cs, bios_base)) {
+ cs = ((CARD16*)0)[(0x42<<1)+1];
+ bios_base = (unsigned char *)(cs << 4);
+ if (!int10_check_bios(screen, cs, bios_base)) {
+ cs = V_BIOS >> 4;
+ bios_base = (unsigned char *)(cs << 4);
+ if (!int10_check_bios(screen, cs, bios_base)) {
+ xf86DrvMsg(screen,X_ERROR,"No V_BIOS found\n");
+ goto error3;
+ }
+ }
+ }
+ xf86DrvMsg(screen,X_INFO,"Primary V_BIOS segment is: 0x%x\n",cs);
+ pInt->BIOSseg = cs;
+ break;
+ default:
goto error3;
}
-
- pInt->BIOSseg = V_BIOS >> 4;
+ xfree(pEnt);
pInt->num = 0xe6;
reset_int_vect(pInt);
set_return_trap(pInt);
@@ -201,20 +228,20 @@ xf86InitInt10(int entityIndex)
UnlockLegacyVGA(screen, &vga);
}
#ifdef DEBUG
- dprint(0xc0000,0x20);
+ dprint(0xc0000, 0x20);
#endif
-
+
return pInt;
-
+
error3:
shmdt(base_high);
shmdt(base);
shmdt(0);
shmdt((char*)HIGH_MEM);
- shmctl(low_mem,IPC_RMID,NULL);
+ shmctl(low_mem, IPC_RMID, NULL);
Int10Current = NULL;
error2:
- shmctl(high_mem,IPC_RMID,NULL);
+ shmctl(high_mem, IPC_RMID,NULL);
error1:
xfree(((linuxInt10Priv*)pInt->private)->alloc);
xfree(pInt->private);
@@ -230,120 +257,120 @@ MapCurrentInt10(xf86Int10InfoPtr pInt)
shmdt(0);
shmdt((char*)HIGH_MEM);
}
- shmat(((linuxInt10Priv *)pInt->private)->lowMem,(char*)1,SHM_RND);
- shmat(((linuxInt10Priv *)pInt->private)->highMem,(char*)HIGH_MEM,0);
+ shmat(((linuxInt10Priv*)pInt->private)->lowMem, (char*)1, SHM_RND);
+ shmat(((linuxInt10Priv*)pInt->private)->highMem, (char*)HIGH_MEM, 0);
}
void
xf86FreeInt10(xf86Int10InfoPtr pInt)
{
if (!pInt)
- return;
+ return;
if (Int10Current == pInt) {
shmdt(0);
shmdt((char*)HIGH_MEM);
Int10Current = NULL;
}
- shmdt(((linuxInt10Priv *)pInt->private)->base_high);
- shmdt(((linuxInt10Priv *)pInt->private)->base);
- shmctl(((linuxInt10Priv *)pInt->private)->lowMem,IPC_RMID,NULL);
- shmctl(((linuxInt10Priv *)pInt->private)->highMem,IPC_RMID,NULL);
+ shmdt(((linuxInt10Priv*)pInt->private)->base_high);
+ shmdt(((linuxInt10Priv*)pInt->private)->base);
+ shmctl(((linuxInt10Priv*)pInt->private)->lowMem, IPC_RMID, NULL);
+ shmctl(((linuxInt10Priv*)pInt->private)->highMem, IPC_RMID, NULL);
xfree(((linuxInt10Priv*)pInt->private)->alloc);
xfree(pInt->private);
+ xfree(pInt->cpuRegs);
xfree(pInt);
}
void *
-xf86Int10AllocPages(xf86Int10InfoPtr pInt,int num, int *off)
+xf86Int10AllocPages(xf86Int10InfoPtr pInt, int num, int *off)
{
int pagesize = getpagesize();
int num_pages = ALLOC_ENTRIES(pagesize);
- int i,j;
+ int i, j;
- for (i=0;i<num_pages - num;i++) {
+ for (i = 0; i < (num_pages - num); i++) {
if (((linuxInt10Priv*)pInt->private)->alloc[i] == 0) {
- for (j=i;j < num + i;j++)
+ for (j = i; j < (num + i); j++)
if ((((linuxInt10Priv*)pInt->private)->alloc[j] != 0))
break;
- if (j == num + i)
+ if (j == (num + i))
break;
else
i = i + num;
}
}
- if (i == num_pages - num)
+ if (i == (num_pages - num))
return NULL;
-
- for (j = i; j < i + num; j++)
+
+ for (j = i; j < (i + num); j++)
((linuxInt10Priv*)pInt->private)->alloc[j] = 1;
*off = (i + 1) * pagesize;
-
- return (void *)
- (((linuxInt10Priv*)pInt->private)->base + (i + 1) * pagesize);
+
+ return ((linuxInt10Priv*)pInt->private)->base + ((i + 1) * pagesize);
}
void
xf86Int10FreePages(xf86Int10InfoPtr pInt, void *pbase, int num)
{
int pagesize = getpagesize();
- int first = ((unsigned long)pbase
+ int first = (((unsigned long)pbase
- (unsigned long)((linuxInt10Priv*)pInt->private)->base)
- / pagesize - 1;
+ / pagesize) - 1;
int i;
- for (i = first; i < first + num; i++)
+ for (i = first; i < (first + num); i++)
((linuxInt10Priv*)pInt->private)->alloc[i] = 0;
}
static CARD8
-read_b(xf86Int10InfoPtr pInt,int addr)
+read_b(xf86Int10InfoPtr pInt, int addr)
{
- return *((CARD8 *)(addr));
+ return *((CARD8 *)addr);
}
static CARD16
-read_w(xf86Int10InfoPtr pInt,int addr)
+read_w(xf86Int10InfoPtr pInt, int addr)
{
- return *((CARD16 *)(addr));
+ return *((CARD16 *)addr);
}
static CARD32
-read_l(xf86Int10InfoPtr pInt,int addr)
+read_l(xf86Int10InfoPtr pInt, int addr)
{
- return *((CARD32 *)(addr));
+ return *((CARD32 *)addr);
}
static void
-write_b(xf86Int10InfoPtr pInt,int addr, CARD8 val)
+write_b(xf86Int10InfoPtr pInt, int addr, CARD8 val)
{
- *((CARD8 *)(addr)) = (CARD8)val;
+ *((CARD8 *)addr) = val;
}
static void
-write_w(xf86Int10InfoPtr pInt,int addr, CARD16 val)
+write_w(xf86Int10InfoPtr pInt, int addr, CARD16 val)
{
- *((CARD16 *)(addr)) = (CARD16)val;
+ *((CARD16 *)addr) = val;
}
static
-void write_l(xf86Int10InfoPtr pInt,int addr, CARD32 val)
+void write_l(xf86Int10InfoPtr pInt, int addr, CARD32 val)
{
- *((CARD32 *)(addr)) = (CARD32)val;
+ *((CARD32 *)addr) = val;
}
pointer
xf86int10Addr(xf86Int10InfoPtr pInt, CARD32 addr)
{
if (addr < V_RAM)
- return (pointer)(((linuxInt10Priv*)pInt->private)->base + addr);
+ return ((linuxInt10Priv*)pInt->private)->base + addr;
else if (addr < V_BIOS)
- return (pointer) addr;
+ return (pointer)addr;
else if (addr < SYS_BIOS)
- return (pointer)(((linuxInt10Priv*)pInt->private)->base_high
+ return (pointer)(((linuxInt10Priv*)pInt->private)->base_high
- V_BIOS + addr);
else
- return (pointer) addr;
+ return (pointer)addr;
}
#ifdef _VM86_LINUX
@@ -355,38 +382,200 @@ xf86Int10ExecSetup(xf86Int10InfoPtr pInt)
{
#define VM86S ((struct vm86_struct *)pInt->cpuRegs)
- pInt->cpuRegs = (pointer) xnfcalloc(1,sizeof(struct vm86_struct));
+ pInt->cpuRegs = (pointer)xnfcalloc(1, sizeof(struct vm86_struct));
VM86S->flags = 0;
VM86S->screen_bitmap = 0;
VM86S->cpu_type = CPU_586;
- memset(&VM86S->int_revectored, 0xff,sizeof(VM86S->int_revectored)) ;
- memset(&VM86S->int21_revectored, 0xff,sizeof(VM86S->int21_revectored)) ;
+ memset(&VM86S->int_revectored, 0xff, sizeof(VM86S->int_revectored));
+ memset(&VM86S->int21_revectored, 0xff, sizeof(VM86S->int21_revectored));
return TRUE;
}
-
+
+/* get the linear address */
+#define LIN_PREF_SI ((pref_seg << 4) + X86_SI)
+#define LWECX ((prefix66 ^ prefix67) ? X86_ECX : X86_CX)
+#define LWECX_ZERO {if (prefix66 ^ prefix67) X86_ECX = 0; else X86_CX = 0;}
+#define DF (1 << 10)
+
+/* vm86 fault handling */
+static Bool
+vm86_GP_fault(xf86Int10InfoPtr pInt)
+{
+ unsigned char *csp, *lina;
+ CARD32 org_eip;
+ int pref_seg;
+ int done, is_rep, prefix66, prefix67;
+
+ csp = lina = SEG_ADR((unsigned char *), X86_CS, IP);
+
+ is_rep = 0;
+ prefix66 = prefix67 = 0;
+ pref_seg = -1;
+
+ /* eat up prefixes */
+ done = 0;
+ do {
+ switch (MEM_RB(pInt, (int)csp++)) {
+ case 0x66: /* operand prefix */ prefix66=1; break;
+ case 0x67: /* address prefix */ prefix67=1; break;
+ case 0x2e: /* CS */ pref_seg=X86_CS; break;
+ case 0x3e: /* DS */ pref_seg=X86_DS; break;
+ case 0x26: /* ES */ pref_seg=X86_ES; break;
+ case 0x36: /* SS */ pref_seg=X86_SS; break;
+ case 0x65: /* GS */ pref_seg=X86_GS; break;
+ case 0x64: /* FS */ pref_seg=X86_FS; break;
+ case 0xf0: /* lock */ break;
+ case 0xf2: /* repnz */
+ case 0xf3: /* rep */ is_rep=1; break;
+ default: done=1;
+ }
+ } while (!done);
+ csp--; /* oops one too many */
+ org_eip = X86_EIP;
+ X86_IP += (csp - lina);
+
+ switch (MEM_RB(pInt, (int)csp)) {
+ case 0x6c: /* insb */
+ /* NOTE: ES can't be overwritten; prefixes 66,67 should use esi,edi,ecx
+ * but is anyone using extended regs in real mode? */
+ /* WARNING: no test for DI wrapping! */
+ X86_EDI += port_rep_inb(pInt, X86_DX, SEG_EADR((CARD32), X86_ES, DI),
+ X86_FLAGS & DF, is_rep ? LWECX : 1);
+ if (is_rep) LWECX_ZERO;
+ X86_IP++;
+ break;
+
+ case 0x6d: /* (rep) insw / insd */
+ /* NOTE: ES can't be overwritten */
+ /* WARNING: no test for _DI wrapping! */
+ if (prefix66) {
+ X86_DI += port_rep_inl(pInt, X86_DX, SEG_ADR((CARD32), X86_ES, DI),
+ X86_EFLAGS & DF, is_rep ? LWECX : 1);
+ }
+ else {
+ X86_DI += port_rep_inw(pInt, X86_DX, SEG_ADR((CARD32), X86_ES, DI),
+ X86_FLAGS & DF, is_rep ? LWECX : 1);
+ }
+ if (is_rep) LWECX_ZERO;
+ X86_IP++;
+ break;
+
+ case 0x6e: /* (rep) outsb */
+ if (pref_seg < 0) pref_seg = X86_DS;
+ /* WARNING: no test for _SI wrapping! */
+ X86_SI += port_rep_outb(pInt, X86_DX, (CARD32)LIN_PREF_SI,
+ X86_FLAGS & DF, is_rep ? LWECX : 1);
+ if (is_rep) LWECX_ZERO;
+ X86_IP++;
+ break;
+
+ case 0x6f: /* (rep) outsw / outsd */
+ if (pref_seg < 0) pref_seg = X86_DS;
+ /* WARNING: no test for _SI wrapping! */
+ if (prefix66) {
+ X86_SI += port_rep_outl(pInt, X86_DX, (CARD32)LIN_PREF_SI,
+ X86_EFLAGS & DF, is_rep ? LWECX : 1);
+ }
+ else {
+ X86_SI += port_rep_outw(pInt, X86_DX, (CARD32)LIN_PREF_SI,
+ X86_FLAGS & DF, is_rep ? LWECX : 1);
+ }
+ if (is_rep) LWECX_ZERO;
+ X86_IP++;
+ break;
+
+ case 0xe5: /* inw xx, inl xx */
+ if (prefix66) X86_EAX = x_inl(csp[1]);
+ else X86_AX = x_inw(csp[1]);
+ X86_IP += 2;
+ break;
+
+ case 0xe4: /* inb xx */
+ X86_AL = x_inb(csp[1]);
+ X86_IP += 2;
+ break;
+
+ case 0xed: /* inw dx, inl dx */
+ if (prefix66) X86_EAX = x_inl(X86_DX);
+ else X86_AX = x_inw(X86_DX);
+ X86_IP += 1;
+ break;
+
+ case 0xec: /* inb dx */
+ X86_AL = x_inb(X86_DX);
+ X86_IP += 1;
+ break;
+
+ case 0xe7: /* outw xx */
+ if (prefix66) x_outl(csp[1], X86_EAX);
+ else x_outw(csp[1], X86_AX);
+ X86_IP += 2;
+ break;
+
+ case 0xe6: /* outb xx */
+ x_outb(csp[1], X86_AL);
+ X86_IP += 2;
+ break;
+
+ case 0xef: /* outw dx */
+ if (prefix66) x_outl(X86_DX, X86_EAX);
+ else x_outw(X86_DX, X86_AX);
+ X86_IP += 1;
+ break;
+
+ case 0xee: /* outb dx */
+ x_outb(X86_DX, X86_AL);
+ X86_IP += 1;
+ break;
+
+ case 0xf4:
+#ifdef DEBUG
+ ErrorF("hlt at %p\n", lina);
+#endif
+ return FALSE;
+
+ case 0x0f:
+ xf86DrvMsg(pInt->scrnIndex, X_ERROR,
+ "CPU 0x0f Trap at CS:EIP=0x%4.4x:0x%8.8x\n", X86_CS, X86_EIP);
+ goto op0ferr;
+
+ default:
+ xf86DrvMsg(pInt->scrnIndex, X_ERROR, "unknown reason for exception\n");
+
+ op0ferr:
+ dump_registers(pInt);
+ stack_trace(pInt);
+ dump_code(pInt);
+ xf86DrvMsg(pInt->scrnIndex, X_ERROR, "cannot continue\n");
+ return FALSE;
+ } /* end of switch() */
+ return TRUE;
+}
+
static int
do_vm86(xf86Int10InfoPtr pInt)
{
int retval, signo;
-
+
xf86InterceptSignals(&signo);
retval = vm86_rep(VM86S);
xf86InterceptSignals(NULL);
if (signo >= 0) {
- xf86DrvMsg(pInt->scrnIndex, X_ERROR, "vm86() syscall generated signal %d.\n", signo);
+ xf86DrvMsg(pInt->scrnIndex, X_ERROR,
+ "vm86() syscall generated signal %d.\n", signo);
dump_registers(pInt);
dump_code(pInt);
stack_trace(pInt);
return 0;
}
-
+
switch (VM86_TYPE(retval)) {
case VM86_UNKNOWN:
if (!vm86_GP_fault(pInt)) return 0;
break;
case VM86_STI:
- xf86DrvMsg(pInt->scrnIndex,X_ERROR,"vm86_sti :-((\n");
+ xf86DrvMsg(pInt->scrnIndex, X_ERROR, "vm86_sti :-((\n");
dump_registers(pInt);
dump_code(pInt);
stack_trace(pInt);
@@ -394,8 +583,8 @@ do_vm86(xf86Int10InfoPtr pInt)
case VM86_INTx:
pInt->num = VM86_ARG(retval);
if (!int_handler(pInt)) {
- xf86DrvMsg(pInt->scrnIndex,
- X_ERROR,"Unknown vm86_int: 0x%X\n\n",VM86_ARG(retval));
+ xf86DrvMsg(pInt->scrnIndex, X_ERROR,
+ "Unknown vm86_int: 0x%X\n\n", VM86_ARG(retval));
dump_registers(pInt);
dump_code(pInt);
stack_trace(pInt);
@@ -409,17 +598,17 @@ do_vm86(xf86Int10InfoPtr pInt)
* we used to warn here and bail out - but now the sigio stuff
* always fires signals at us. So we just ignore them for now.
*/
- xf86DrvMsg(pInt->scrnIndex,X_WARNING,"received signal\n");
+ xf86DrvMsg(pInt->scrnIndex, X_WARNING, "received signal\n");
return 0;
default:
- xf86DrvMsg(pInt->scrnIndex,X_ERROR,"unknown type(0x%x)=0x%x\n",
- VM86_ARG(retval),VM86_TYPE(retval));
+ xf86DrvMsg(pInt->scrnIndex, X_ERROR, "unknown type(0x%x)=0x%x\n",
+ VM86_ARG(retval), VM86_TYPE(retval));
dump_registers(pInt);
dump_code(pInt);
stack_trace(pInt);
return 0;
}
-
+
return 1;
}
@@ -431,11 +620,11 @@ xf86ExecX86int10(xf86Int10InfoPtr pInt)
if (int_handler(pInt))
while(do_vm86(pInt)) {};
- finish_int(pInt,sig);
+ finish_int(pInt, sig);
}
static int
-vm86_rep(struct vm86_struct *ptr)
+vm86_rep(struct vm86_struct *ptr)
{
int __res;
@@ -455,9 +644,9 @@ vm86_rep(struct vm86_struct *ptr)
"b" ((struct vm86_struct *)ptr));
#endif
- if ((__res) < 0) {
+ if (__res < 0) {
errno = -__res;
- __res=-1;
+ __res = -1;
}
else errno = 0;
return __res;
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 5e783fcf2..fe34b6382 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.11 2000/10/17 16:53:20 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnxResource.c,v 3.15 2001/02/16 14:45:10 tsi Exp $ */
/* Resource information code */
@@ -21,10 +21,10 @@ xf86BusAccWindowsFromOS(void)
resPtr ret = NULL;
resRange range;
- RANGE(range,0,0xffffffff,ResExcMemBlock);
+ RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
ret = xf86AddResToList(ret, &range, -1);
- RANGE(range,0,0xffffffff,ResExcIoBlock);
+ RANGE(range, 0x00000000, 0xffffffff, ResExcIoBlock);
ret = xf86AddResToList(ret, &range, -1);
return ret;
}
@@ -39,76 +39,75 @@ xf86PciBusAccWindowsFromOS(void)
* sparse address space are an image of the ISA bus range
*/
if (_bus_base_sparse()) {
- RANGE(range,0,0x07ffffff,ResExcMemBlock);
+ RANGE(range, 0x00000000, 0x07ffffff, ResExcMemBlock);
ret = xf86AddResToList(ret, &range, -1);
- RANGE(range,0x09000000,0x0fffffff,ResExcMemBlock);
+ RANGE(range, 0x09000000, 0x0fffffff, ResExcMemBlock);
ret = xf86AddResToList(ret, &range, -1);
- RANGE(range,0x11000000,0x17ffffff,ResExcMemBlock);
+ RANGE(range, 0x11000000, 0x17ffffff, ResExcMemBlock);
ret = xf86AddResToList(ret, &range, -1);
- RANGE(range,0x19000000,0x1fffffff,ResExcMemBlock);
+ RANGE(range, 0x19000000, 0x1fffffff, ResExcMemBlock);
ret = xf86AddResToList(ret, &range, -1);
- RANGE(range,0x21000000,0x27ffffff,ResExcMemBlock);
+ RANGE(range, 0x21000000, 0x27ffffff, ResExcMemBlock);
ret = xf86AddResToList(ret, &range, -1);
- RANGE(range,0x29000000,0x2fffffff,ResExcMemBlock);
+ RANGE(range, 0x29000000, 0x2fffffff, ResExcMemBlock);
ret = xf86AddResToList(ret, &range, -1);
- RANGE(range,0x31000000,0x37ffffff,ResExcMemBlock);
+ RANGE(range, 0x31000000, 0x37ffffff, ResExcMemBlock);
ret = xf86AddResToList(ret, &range, -1);
- RANGE(range,0x39000000,0x3fffffff,ResExcMemBlock);
+ RANGE(range, 0x39000000, 0x3fffffff, ResExcMemBlock);
ret = xf86AddResToList(ret, &range, -1);
- RANGE(range,0x41000000,0x47ffffff,ResExcMemBlock);
+ RANGE(range, 0x41000000, 0x47ffffff, ResExcMemBlock);
ret = xf86AddResToList(ret, &range, -1);
- RANGE(range,0x49000000,0x4fffffff,ResExcMemBlock);
+ RANGE(range, 0x49000000, 0x4fffffff, ResExcMemBlock);
ret = xf86AddResToList(ret, &range, -1);
- RANGE(range,0x51000000,0x57ffffff,ResExcMemBlock);
+ RANGE(range, 0x51000000, 0x57ffffff, ResExcMemBlock);
ret = xf86AddResToList(ret, &range, -1);
- RANGE(range,0x59000000,0x5fffffff,ResExcMemBlock);
+ RANGE(range, 0x59000000, 0x5fffffff, ResExcMemBlock);
ret = xf86AddResToList(ret, &range, -1);
- RANGE(range,0x61000000,0x67ffffff,ResExcMemBlock);
+ RANGE(range, 0x61000000, 0x67ffffff, ResExcMemBlock);
ret = xf86AddResToList(ret, &range, -1);
- RANGE(range,0x69000000,0x6fffffff,ResExcMemBlock);
+ RANGE(range, 0x69000000, 0x6fffffff, ResExcMemBlock);
ret = xf86AddResToList(ret, &range, -1);
- RANGE(range,0x71000000,0x77ffffff,ResExcMemBlock);
+ RANGE(range, 0x71000000, 0x77ffffff, ResExcMemBlock);
ret = xf86AddResToList(ret, &range, -1);
- RANGE(range,0x79000000,0x7fffffff,ResExcMemBlock);
+ RANGE(range, 0x79000000, 0x7fffffff, ResExcMemBlock);
ret = xf86AddResToList(ret, &range, -1);
- RANGE(range,0x81000000,0x87ffffff,ResExcMemBlock);
+ RANGE(range, 0x81000000, 0x87ffffff, ResExcMemBlock);
ret = xf86AddResToList(ret, &range, -1);
- RANGE(range,0x89000000,0x8fffffff,ResExcMemBlock);
+ RANGE(range, 0x89000000, 0x8fffffff, ResExcMemBlock);
ret = xf86AddResToList(ret, &range, -1);
- RANGE(range,0x91000000,0x97ffffff,ResExcMemBlock);
+ RANGE(range, 0x91000000, 0x97ffffff, ResExcMemBlock);
ret = xf86AddResToList(ret, &range, -1);
- RANGE(range,0x99000000,0x9fffffff,ResExcMemBlock);
+ RANGE(range, 0x99000000, 0x9fffffff, ResExcMemBlock);
ret = xf86AddResToList(ret, &range, -1);
- RANGE(range,0xA1000000,0xa7ffffff,ResExcMemBlock);
+ RANGE(range, 0xa1000000, 0xa7ffffff, ResExcMemBlock);
ret = xf86AddResToList(ret, &range, -1);
- RANGE(range,0xA9000000,0xafffffff,ResExcMemBlock);
+ RANGE(range, 0xa9000000, 0xafffffff, ResExcMemBlock);
ret = xf86AddResToList(ret, &range, -1);
- RANGE(range,0xB1000000,0xb7ffffff,ResExcMemBlock);
+ RANGE(range, 0xb1000000, 0xb7ffffff, ResExcMemBlock);
ret = xf86AddResToList(ret, &range, -1);
- RANGE(range,0xB9000000,0xbfffffff,ResExcMemBlock);
+ RANGE(range, 0xb9000000, 0xbfffffff, ResExcMemBlock);
ret = xf86AddResToList(ret, &range, -1);
- RANGE(range,0xC1000000,0xc7ffffff,ResExcMemBlock);
+ RANGE(range, 0xc1000000, 0xc7ffffff, ResExcMemBlock);
ret = xf86AddResToList(ret, &range, -1);
- RANGE(range,0xC9000000,0xcfffffff,ResExcMemBlock);
+ RANGE(range, 0xc9000000, 0xcfffffff, ResExcMemBlock);
ret = xf86AddResToList(ret, &range, -1);
- RANGE(range,0xD1000000,0xd7ffffff,ResExcMemBlock);
+ RANGE(range, 0xd1000000, 0xd7ffffff, ResExcMemBlock);
ret = xf86AddResToList(ret, &range, -1);
- RANGE(range,0xD9000000,0xdfffffff,ResExcMemBlock);
+ RANGE(range, 0xd9000000, 0xdfffffff, ResExcMemBlock);
ret = xf86AddResToList(ret, &range, -1);
- RANGE(range,0xE1000000,0xe7ffffff,ResExcMemBlock);
+ RANGE(range, 0xe1000000, 0xe7ffffff, ResExcMemBlock);
ret = xf86AddResToList(ret, &range, -1);
- RANGE(range,0xE9000000,0xefffffff,ResExcMemBlock);
+ RANGE(range, 0xe9000000, 0xefffffff, ResExcMemBlock);
ret = xf86AddResToList(ret, &range, -1);
- RANGE(range,0xF1000000,0xf7ffffff,ResExcMemBlock);
+ RANGE(range, 0xf1000000, 0xf7ffffff, ResExcMemBlock);
ret = xf86AddResToList(ret, &range, -1);
- RANGE(range,0xF9000000,0xffffffff,ResExcMemBlock);
+ RANGE(range, 0xf9000000, 0xffffffff, ResExcMemBlock);
ret = xf86AddResToList(ret, &range, -1);
} else {
- /* Some drivers choke if a PCI base address is set to 0 */
- RANGE(range,1,0xffffffff,ResExcMemBlock);
+ RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
ret = xf86AddResToList(ret, &range, -1);
}
- RANGE(range,0,0xffffffff,ResExcIoBlock);
+ RANGE(range, 0x00000000, 0xffffffff, ResExcIoBlock);
ret = xf86AddResToList(ret, &range, -1);
return ret;
}
@@ -119,10 +118,10 @@ xf86IsaBusAccWindowsFromOS(void)
resPtr ret = NULL;
resRange range;
- RANGE(range,0,0xffffffff,ResExcMemBlock);
+ RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
ret = xf86AddResToList(ret, &range, -1);
- RANGE(range,0,0xffffffff,ResExcIoBlock);
+ RANGE(range, 0x00000000, 0xffffffff, ResExcIoBlock);
ret = xf86AddResToList(ret, &range, -1);
return ret;
}
@@ -135,17 +134,33 @@ xf86AccResFromOS(resPtr ret)
/*
* Fallback is to claim the following areas:
*
- * 0x000C0000 - 0x000EFFFF location of VGA and other extensions ROMS
+ * 0x000c0000 - 0x000effff location of VGA and other extensions ROMS
*/
- RANGE(range,0xc0000,0xeffff,ResExcMemBlock);
+ RANGE(range, 0x000c0000, 0x000effff, ResExcMemBlock);
ret = xf86AddResToList(ret, &range, -1);
- /* Fallback is to claim well known ports in the 0x0 - 0x3ff range */
- /* Possibly should claim some of them as sparse ranges */
+ /*
+ * Fallback would be to claim well known ports in the 0x0 - 0x3ff range
+ * along with their sparse I/O aliases, but that's too imprecise. Instead
+ * claim a bare minimum here.
+ */
+ RANGE(range, 0x00000000, 0x000000ff, ResExcIoBlock); /* For mainboard */
+ ret = xf86AddResToList(ret, &range, -1);
- RANGE(range,0,0x1ff,ResExcIoBlock | ResEstimated);
+ /*
+ * At minimum, the top and bottom resources must be claimed, so that
+ * resources that are (or appear to be) unallocated can be relocated.
+ */
+ RANGE(range, 0x00000000, 0x00000000, ResExcMemBlock);
ret = xf86AddResToList(ret, &range, -1);
+ RANGE(range, 0xffffffff, 0xffffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+/* RANGE(range, 0x00000000, 0x00000000, ResExcIoBlock);
+ ret = xf86AddResToList(ret, &range, -1); */
+ RANGE(range, 0xffffffff, 0xffffffff, ResExcIoBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+
/* XXX add others */
return ret;
}
@@ -168,13 +183,13 @@ xf86BusAccWindowsFromOS(void)
resPtr ret = NULL;
resRange range;
- RANGE(range,0,0xffffffff,ResExcMemBlock);
+ RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
ret = xf86AddResToList(ret, &range, -1);
#ifdef __sparc__
- RANGE(range,0,0x00ffffff,ResExcIoBlock);
+ RANGE(range, 0x00000000, 0x00ffffff, ResExcIoBlock);
#else
- RANGE(range,0,0x0000ffff,ResExcIoBlock);
+ RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock);
#endif
ret = xf86AddResToList(ret, &range, -1);
return ret;
@@ -186,13 +201,13 @@ xf86PciBusAccWindowsFromOS(void)
resPtr ret = NULL;
resRange range;
- RANGE(range,0,0xffffffff,ResExcMemBlock);
+ RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
ret = xf86AddResToList(ret, &range, -1);
#ifdef __sparc__
- RANGE(range,0,0x00ffffff,ResExcIoBlock);
+ RANGE(range, 0x00000000, 0x00ffffff, ResExcIoBlock);
#else
- RANGE(range,0,0x0000ffff,ResExcIoBlock);
+ RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock);
#endif
ret = xf86AddResToList(ret, &range, -1);
return ret;
@@ -204,13 +219,13 @@ xf86IsaBusAccWindowsFromOS(void)
resPtr ret = NULL;
resRange range;
- RANGE(range,0,0xffffffff,ResExcMemBlock);
+ RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
ret = xf86AddResToList(ret, &range, -1);
#ifdef __sparc__
- RANGE(range,0,0x00ffffff,ResExcIoBlock);
+ RANGE(range, 0x00000000, 0x00ffffff, ResExcIoBlock);
#else
- RANGE(range,0,0x0000ffff,ResExcIoBlock);
+ RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock);
#endif
ret = xf86AddResToList(ret, &range, -1);
return ret;
@@ -219,6 +234,25 @@ xf86IsaBusAccWindowsFromOS(void)
resPtr
xf86AccResFromOS(resPtr ret)
{
+ resRange range;
+
+ /*
+ * At minimum, the top and bottom resources must be claimed, so that
+ * resources that are (or appear to be) unallocated can be relocated.
+ */
+ RANGE(range, 0x00000000, 0x00000000, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ RANGE(range, 0xffffffff, 0xffffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ RANGE(range, 0x00000000, 0x00000000, ResExcIoBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+#ifdef __sparc__
+ RANGE(range, 0x00ffffff, 0x00ffffff, ResExcIoBlock);
+#else
+ RANGE(range, 0x0000ffff, 0x0000ffff, ResExcIoBlock);
+#endif
+ ret = xf86AddResToList(ret, &range, -1);
+
return ret;
}
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 b1a61e362..d11205b92 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.71 2000/12/06 20:39:54 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/libc_wrapper.c,v 1.72 2001/02/12 01:34:53 tsi Exp $ */
/*
* Copyright 1997 by The XFree86 Project, Inc.
*
@@ -25,6 +25,7 @@
#include <X.h>
#include <Xmd.h>
+#include <Xos.h>
#include <sys/types.h>
#include <sys/stat.h>
#if defined(__bsdi__)
@@ -1095,9 +1096,11 @@ xf86getsecs(long * secs, long * usecs)
{
struct timeval tv;
- gettimeofday(&tv, NULL);
- *secs = tv.tv_sec;
- *usecs= tv.tv_usec;
+ X_GETTIMEOFDAY(&tv);
+ if (secs)
+ *secs = tv.tv_sec;
+ if (usecs)
+ *usecs= tv.tv_usec;
return;
}
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/vbe/vbe.c b/xc/programs/Xserver/hw/xfree86/os-support/vbe/vbe.c
index 2559b2799..82eb25106 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/vbe/vbe.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/vbe/vbe.c
@@ -1,4 +1,14 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/vbe/vbe.c,v 1.14 2000/12/06 15:35:32 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/vbe/vbe.c,v 1.15 2001/02/15 20:00:08 eich Exp $ */
+
+/*
+ * XFree86 vbe module
+ * Copyright 2000 Egbert Eich
+ *
+ * The mode query/save/set/restore functions from the vesa driver
+ * have been moved here.
+ * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
+ * Authors: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
+ */
#include "xf86.h"
#include "xf86_ansic.h"
@@ -17,6 +27,8 @@
#endif
#define L_ADD(x) (B_O32(x) & 0xffff) + ((B_O32(x) >> 12) & 0xffff00)
+#define FARP(p) (((unsigned)(p & 0xffff0000) >> 12) | (p & 0xffff))
+
static unsigned char * vbeReadEDID(vbeInfoPtr pVbe);
static Bool vbeProbeDDC(vbeInfoPtr pVbe);
@@ -294,18 +306,590 @@ vbeDoEDID(vbeInfoPtr pVbe, pointer pDDCModule)
}
+VbeInfoBlock *
+VBEGetVBEInfo(vbeInfoPtr pVbe)
+{
+ VbeInfoBlock *block = NULL;
+ int i, pStr, pModes;
+ char *str;
+ CARD16 major, minor, *modes;
+
+ bzero(pVbe->memory, sizeof(VbeInfoBlock));
+
+ /*
+ Input:
+ AH := 4Fh Super VGA support
+ AL := 00h Return Super VGA information
+ ES:DI := Pointer to buffer
+
+ Output:
+ AX := status
+ (All other registers are preserved)
+ */
+
+ ((char*)pVbe->memory)[0] = 'V';
+ ((char*)pVbe->memory)[1] = 'B';
+ ((char*)pVbe->memory)[2] = 'E';
+ ((char*)pVbe->memory)[3] = '2';
+
+ pVbe->pInt10->num = 0x10;
+ pVbe->pInt10->ax = 0x4f00;
+ pVbe->pInt10->es = SEG_ADDR(pVbe->real_mode_base);
+ pVbe->pInt10->di = SEG_OFF(pVbe->real_mode_base);
+ xf86ExecX86int10(pVbe->pInt10);
+
+ if (pVbe->pInt10->ax != 0x4f)
+ return (NULL);
+
+ block = xcalloc(sizeof(VbeInfoBlock), 1);
+ block->VESASignature[0] = ((char*)pVbe->memory)[0];
+ block->VESASignature[1] = ((char*)pVbe->memory)[1];
+ block->VESASignature[2] = ((char*)pVbe->memory)[2];
+ block->VESASignature[3] = ((char*)pVbe->memory)[3];
+
+ block->VESAVersion = *(CARD16*)(((char*)pVbe->memory) + 4);
+ major = (unsigned)block->VESAVersion >> 8;
+ minor = block->VESAVersion & 0xff;
+
+ pStr = *(CARD32*)(((char*)pVbe->memory) + 6);
+ str = xf86int10Addr(pVbe->pInt10, FARP(pStr));
+ block->OEMStringPtr = strdup(str);
+
+ block->Capabilities[0] = ((char*)pVbe->memory)[10];
+ block->Capabilities[1] = ((char*)pVbe->memory)[11];
+ block->Capabilities[2] = ((char*)pVbe->memory)[12];
+ block->Capabilities[3] = ((char*)pVbe->memory)[13];
+
+ pModes = *(CARD32*)(((char*)pVbe->memory) + 14);
+ modes = xf86int10Addr(pVbe->pInt10, FARP(pModes));
+ i = 0;
+ while (modes[i] != 0xffff)
+ i++;
+ block->VideoModePtr = xalloc(sizeof(CARD16) * i + 1);
+ memcpy(block->VideoModePtr, modes, sizeof(CARD16) * i);
+ block->VideoModePtr[i] = 0xffff;
+
+ block->TotalMemory = *(CARD16*)(((char*)pVbe->memory) + 18);
+
+ if (major < 2)
+ memcpy(&block->OemSoftwareRev, ((char*)pVbe->memory) + 20, 236);
+ else {
+ block->OemSoftwareRev = *(CARD16*)(((char*)pVbe->memory) + 20);
+ pStr = *(CARD32*)(((char*)pVbe->memory) + 22);
+ str = xf86int10Addr(pVbe->pInt10, FARP(pStr));
+ block->OemVendorNamePtr = strdup(str);
+ pStr = *(CARD32*)(((char*)pVbe->memory) + 26);
+ str = xf86int10Addr(pVbe->pInt10, FARP(pStr));
+ block->OemProductNamePtr = strdup(str);
+ pStr = *(CARD32*)(((char*)pVbe->memory) + 30);
+ str = xf86int10Addr(pVbe->pInt10, FARP(pStr));
+ block->OemProductRevPtr = strdup(str);
+ memcpy(&block->Reserved, ((char*)pVbe->memory) + 34, 222);
+ memcpy(&block->OemData, ((char*)pVbe->memory) + 256, 256);
+ }
+
+ return (block);
+}
+
+void
+VBEFreeVBEInfo(VbeInfoBlock *block)
+{
+ xfree(block->OEMStringPtr);
+ xfree(block->VideoModePtr);
+ if (((unsigned)block->VESAVersion >> 8) >= 2) {
+ xfree(block->OemVendorNamePtr);
+ xfree(block->OemProductNamePtr);
+ xfree(block->OemProductRevPtr);
+ }
+ xfree(block);
+}
+
Bool
-vbeModeInit(vbeInfoPtr pVbe, int mode)
+VBESetVBEMode(vbeInfoPtr pVbe, int mode, VbeCRTCInfoBlock *block)
{
- pVbe->pInt10->ax = 0x4F02;
- pVbe->pInt10->bx = mode | (1 << 14);
+ /*
+ Input:
+ AH := 4Fh Super VGA support
+ AL := 02h Set Super VGA video mode
+ BX := Video mode
+ D0-D8 := Mode number
+ D9-D10 := Reserved (must be 0)
+ D11 := 0 Use current default refresh rate
+ := 1 Use user specified CRTC values for refresh rate
+ D12-13 Reserved for VBE/AF (must be 0)
+ D14 := 0 Use windowed frame buffer model
+ := 1 Use linear/flat frame buffer model
+ D15 := 0 Clear video memory
+ := 1 Don't clear video memory
+ ES:DI := Pointer to VbeCRTCInfoBlock structure
+
+ Output: AX = Status
+ (All other registers are preserved)
+ */
+ pVbe->pInt10->num = 0x10;
+ pVbe->pInt10->ax = 0x4f02;
+ pVbe->pInt10->bx = mode;
+ if (block) {
+ pVbe->pInt10->bx |= 1 << 11;
+ memcpy(pVbe->memory, block, sizeof(VbeCRTCInfoBlock));
+ pVbe->pInt10->es = SEG_ADDR(pVbe->real_mode_base);
+ pVbe->pInt10->di = SEG_OFF(pVbe->real_mode_base);
+ }
+
xf86ExecX86int10(pVbe->pInt10);
- if ((pVbe->pInt10->ax & 0xff) != 0x4f)
- return FALSE;
+ return (pVbe->pInt10->ax == 0x4f);
+}
+
+Bool
+VBEGetVBEMode(vbeInfoPtr pVbe, int *mode)
+{
+ /*
+ Input:
+ AH := 4Fh Super VGA support
+ AL := 03h Return current video mode
+
+ Output:
+ AX := Status
+ BX := Current video mode
+ (All other registers are preserved)
+ */
+ pVbe->pInt10->num = 0x10;
+ pVbe->pInt10->ax = 0x4f03;
+
+ xf86ExecX86int10(pVbe->pInt10);
+
+ if (pVbe->pInt10->ax == 0x4f) {
+ *mode = pVbe->pInt10->bx;
+ return (TRUE);
+ }
+
+ return (FALSE);
+}
+
+VbeModeInfoBlock *
+VBEGetModeInfo(vbeInfoPtr pVbe, int mode)
+{
+ VbeModeInfoBlock *block = NULL;
+
+ bzero(pVbe->memory, sizeof(VbeModeInfoBlock));
+
+ /*
+ Input:
+ AH := 4Fh Super VGA support
+ AL := 01h Return Super VGA mode information
+ CX := Super VGA video mode
+ (mode number must be one of those returned by Function 0)
+ ES:DI := Pointer to buffer
+
+ Output:
+ AX := status
+ (All other registers are preserved)
+ */
+ pVbe->pInt10->num = 0x10;
+ pVbe->pInt10->ax = 0x4f01;
+ pVbe->pInt10->cx = mode;
+ pVbe->pInt10->es = SEG_ADDR(pVbe->real_mode_base);
+ pVbe->pInt10->di = SEG_OFF(pVbe->real_mode_base);
+ xf86ExecX86int10(pVbe->pInt10);
+ if (pVbe->pInt10->ax != 0x4f)
+ return (NULL);
+
+ block = xcalloc(sizeof(VbeModeInfoBlock), 1);
+
+ block->ModeAttributes = *(CARD16*)pVbe->memory;
+ block->WinAAttributes = ((char*)pVbe->memory)[2];
+ block->WinBAttributes = ((char*)pVbe->memory)[3];
+ block->WinGranularity = *(CARD16*)(((char*)pVbe->memory) + 4);
+ block->WinSize = *(CARD16*)(((char*)pVbe->memory) + 6);
+ block->WinASegment = *(CARD16*)(((char*)pVbe->memory) + 8);
+ block->WinBSegment = *(CARD16*)(((char*)pVbe->memory) + 10);
+ block->WinFuncPtr = *(CARD32*)(((char*)pVbe->memory) + 12);
+ block->BytesPerScanline = *(CARD16*)(((char*)pVbe->memory) + 16);
+
+ /* mandatory information for VBE 1.2 and above */
+ block->XResolution = *(CARD16*)(((char*)pVbe->memory) + 18);
+ block->YResolution = *(CARD16*)(((char*)pVbe->memory) + 20);
+ block->XCharSize = ((char*)pVbe->memory)[22];
+ block->YCharSize = ((char*)pVbe->memory)[23];
+ block->NumberOfPlanes = ((char*)pVbe->memory)[24];
+ block->BitsPerPixel = ((char*)pVbe->memory)[25];
+ block->NumberOfBanks = ((char*)pVbe->memory)[26];
+ block->MemoryModel = ((char*)pVbe->memory)[27];
+ block->BankSize = ((char*)pVbe->memory)[28];
+ block->NumberOfImages = ((char*)pVbe->memory)[29];
+ block->Reserved = ((char*)pVbe->memory)[30];
+
+ /* Direct color fields (required for direct/6 and YUV/7 memory models) */
+ block->RedMaskSize = ((char*)pVbe->memory)[31];
+ block->RedFieldPosition = ((char*)pVbe->memory)[32];
+ block->GreenMaskSize = ((char*)pVbe->memory)[33];
+ block->GreenFieldPosition = ((char*)pVbe->memory)[34];
+ block->BlueMaskSize = ((char*)pVbe->memory)[35];
+ block->BlueFieldPosition = ((char*)pVbe->memory)[36];
+ block->RsvdMaskSize = ((char*)pVbe->memory)[37];
+ block->RsvdFieldPosition = ((char*)pVbe->memory)[38];
+ block->DirectColorModeInfo = ((char*)pVbe->memory)[39];
+
+ /* Mandatory information for VBE 2.0 and above */
+ if (pVbe->version >= 0x200) {
+ block->PhysBasePtr = *(CARD32*)(((char*)pVbe->memory) + 40);
+ block->Reserved32 = *(CARD32*)(((char*)pVbe->memory) + 44);
+ block->Reserved16 = *(CARD16*)(((char*)pVbe->memory) + 48);
+
+ /* Mandatory information for VBE 3.0 and above */
+ if (pVbe->version >= 0x300) {
+ block->LinBytesPerScanLine = *(CARD16*)(((char*)pVbe->memory) + 50);
+ block->BnkNumberOfImagePages = ((char*)pVbe->memory)[52];
+ block->LinNumberOfImagePages = ((char*)pVbe->memory)[53];
+ block->LinRedMaskSize = ((char*)pVbe->memory)[54];
+ block->LinRedFieldPosition = ((char*)pVbe->memory)[55];
+ block->LinGreenMaskSize = ((char*)pVbe->memory)[56];
+ block->LinGreenFieldPosition = ((char*)pVbe->memory)[57];
+ block->LinBlueMaskSize = ((char*)pVbe->memory)[58];
+ block->LinBlueFieldPosition = ((char*)pVbe->memory)[59];
+ block->LinRsvdMaskSize = ((char*)pVbe->memory)[60];
+ block->LinRsvdFieldPosition = ((char*)pVbe->memory)[61];
+ block->MaxPixelClock = *(CARD32*)(((char*)pVbe->memory) + 62);
+ memcpy(&block->Reserved2, ((char*)pVbe->memory) + 66, 188);
+ }
+ else
+ memcpy(&block->LinBytesPerScanLine, ((char*)pVbe->memory) + 50, 206);
+ }
+ else
+ memcpy(&block->PhysBasePtr, ((char*)pVbe->memory) + 40, 216);
+
+ return (block);
+}
+
+void
+VBEFreeModeInfo(VbeModeInfoBlock *block)
+{
+ xfree(block);
+}
+
+Bool
+VBESaveRestore(vbeInfoPtr pVbe, vbeSaveRestoreFunction function,
+ pointer *memory, int *size, int *real_mode_pages)
+{
+ /*
+ Input:
+ AH := 4Fh Super VGA support
+ AL := 04h Save/restore Super VGA video state
+ DL := 00h Return save/restore state buffer size
+ CX := Requested states
+ D0 = Save/restore video hardware state
+ D1 = Save/restore video BIOS data state
+ D2 = Save/restore video DAC state
+ D3 = Save/restore Super VGA state
+
+ Output:
+ AX = Status
+ BX = Number of 64-byte blocks to hold the state buffer
+ (All other registers are preserved)
+
+
+ Input:
+ AH := 4Fh Super VGA support
+ AL := 04h Save/restore Super VGA video state
+ DL := 01h Save Super VGA video state
+ CX := Requested states (see above)
+ ES:BX := Pointer to buffer
+
+ Output:
+ AX := Status
+ (All other registers are preserved)
+
+
+ Input:
+ AH := 4Fh Super VGA support
+ AL := 04h Save/restore Super VGA video state
+ DL := 02h Restore Super VGA video state
+ CX := Requested states (see above)
+ ES:BX := Pointer to buffer
+
+ Output:
+ AX := Status
+ (All other registers are preserved)
+ */
+
+ if ((pVbe->version & 0xff00) > 0x100) {
+ int screen = pVbe->pInt10->scrnIndex;
+ if (function == MODE_QUERY ||
+ (function == MODE_SAVE && !*memory)) {
+ /* Query amount of memory to save state */
+
+ pVbe->pInt10->num = 0x10;
+ pVbe->pInt10->ax = 0x4f04;
+ pVbe->pInt10->dx = 0;
+ pVbe->pInt10->cx = 0x000f;
+ xf86ExecX86int10(pVbe->pInt10);
+ if (pVbe->pInt10->ax != 0x4f)
+ return (FALSE);
+
+ if (function == MODE_SAVE) {
+ int npages = (pVbe->pInt10->bx * 64) / 4096 + 1;
+ if ((*memory = xf86Int10AllocPages(pVbe->pInt10, npages,
+ real_mode_pages)) == NULL) {
+ xf86DrvMsg(screen, X_ERROR,
+ "Cannot allocate memory to save SVGA state.\n");
+ return (FALSE);
+ }
+ }
+ *size = pVbe->pInt10->bx * 64;
+ }
+
+ /* Save/Restore Super VGA state */
+ if (function != MODE_QUERY) {
+
+ if (!*memory) return FALSE;
+ pVbe->pInt10->num = 0x10;
+ pVbe->pInt10->ax = 0x4f04;
+ switch (function) {
+ case MODE_SAVE:
+ pVbe->pInt10->dx = 1;
+ break;
+ case MODE_RESTORE:
+ pVbe->pInt10->dx = 2;
+ break;
+ case MODE_QUERY:
+ return FALSE;
+ }
+ pVbe->pInt10->cx = 0x000f;
+
+ pVbe->pInt10->es = SEG_ADDR(*real_mode_pages);
+ pVbe->pInt10->bx = SEG_OFF(*real_mode_pages);
+ xf86ExecX86int10(pVbe->pInt10);
+ return (pVbe->pInt10->ax == 0x4f);
+
+ }
+ }
return TRUE;
-
}
+Bool
+VBEBankSwitch(vbeInfoPtr pVbe, unsigned int iBank, int window)
+{
+ /*
+ Input:
+ AH := 4Fh Super VGA support
+ AL := 05h
+
+ Output:
+ */
+ pVbe->pInt10->num = 0x10;
+ pVbe->pInt10->ax = 0x4f05;
+ pVbe->pInt10->bx = window;
+ pVbe->pInt10->dx = iBank;
+ xf86ExecX86int10(pVbe->pInt10);
+
+ if (pVbe->pInt10->ax != 0x4f)
+ return (FALSE);
+
+ return (0);
+}
+
+Bool
+VBESetGetLogicalScanlineLength(vbeInfoPtr pVbe, vbeScanwidthCommand command,
+ int width, int *pixels, int *bytes, int *max)
+{
+ if (command < SCANWID_SET || command > SCANWID_GET_MAX)
+ return (FALSE);
+
+ /*
+ Input:
+ AX := 4F06h VBE Set/Get Logical Scan Line Length
+ BL := 00h Set Scan Line Length in Pixels
+ := 01h Get Scan Line Length
+ := 02h Set Scan Line Length in Bytes
+ := 03h Get Maximum Scan Line Length
+ CX := If BL=00h Desired Width in Pixels
+ If BL=02h Desired Width in Bytes
+ (Ignored for Get Functions)
+
+ Output:
+ AX := VBE Return Status
+ BX := Bytes Per Scan Line
+ CX := Actual Pixels Per Scan Line
+ (truncated to nearest complete pixel)
+ DX := Maximum Number of Scan Lines
+ */
+
+ pVbe->pInt10->num = 0x10;
+ pVbe->pInt10->ax = 0x4f06;
+ pVbe->pInt10->bx = command;
+ if (command == SCANWID_SET || command == SCANWID_SET_BYTES)
+ pVbe->pInt10->cx = width;
+ xf86ExecX86int10(pVbe->pInt10);
+
+ if (pVbe->pInt10->ax != 0x4f)
+ return (FALSE);
+
+ if (command == SCANWID_GET || command == SCANWID_GET_MAX) {
+ if (pixels)
+ *pixels = pVbe->pInt10->cx;
+ if (bytes)
+ *bytes = pVbe->pInt10->bx;
+ if (max)
+ *max = pVbe->pInt10->dx;
+ }
+
+ return (TRUE);
+}
+
+Bool
+VBESetDisplayStart(vbeInfoPtr pVbe, int x, int y, Bool wait_retrace)
+{
+ pVbe->pInt10->num = 0x10;
+ pVbe->pInt10->ax = 0x4f07;
+ pVbe->pInt10->bx = wait_retrace ? 0x80 : 0x00;
+ pVbe->pInt10->cx = x;
+ pVbe->pInt10->dx = y;
+ xf86ExecX86int10(pVbe->pInt10);
+
+ if (pVbe->pInt10->ax != 0x4f)
+ return (FALSE);
+
+ return (TRUE);
+}
+
+Bool
+VBEGetDisplayStart(vbeInfoPtr pVbe, int *x, int *y)
+{
+ pVbe->pInt10->num = 0x10;
+ pVbe->pInt10->ax = 0x4f07;
+ pVbe->pInt10->bx = 0x01;
+ xf86ExecX86int10(pVbe->pInt10);
+
+ if (pVbe->pInt10->ax != 0x4f)
+ return (FALSE);
+
+ *x = pVbe->pInt10->cx;
+ *y = pVbe->pInt10->dx;
+ return (TRUE);
+}
+
+int
+VBESetGetDACPaletteFormat(vbeInfoPtr pVbe, int bits)
+{
+ /*
+ Input:
+ AX := 4F08h VBE Set/Get Palette Format
+ BL := 00h Set DAC Palette Format
+ := 01h Get DAC Palette Format
+ BH := Desired bits of color per primary
+ (Set DAC Palette Format only)
+
+ Output:
+ AX := VBE Return Status
+ BH := Current number of bits of color per primary
+ */
+
+ pVbe->pInt10->num = 0x10;
+ pVbe->pInt10->ax = 0x4f08;
+ if (!bits)
+ pVbe->pInt10->bx = 0x01;
+ else
+ pVbe->pInt10->bx = (bits & 0x00ff) << 8;
+ xf86ExecX86int10(pVbe->pInt10);
+
+ if (pVbe->pInt10->ax != 0x4f)
+ return (0);
+
+ return (bits != 0 ? bits : (pVbe->pInt10->bx >> 8) & 0x00ff);
+}
+
+CARD32 *
+VBESetGetPaletteData(vbeInfoPtr pVbe, Bool set, int first, int num,
+ CARD32 *data, Bool secondary, Bool wait_retrace)
+{
+ /*
+ Input:
+ (16-bit)
+ AX := 4F09h VBE Load/Unload Palette Data
+ BL := 00h Set Palette Data
+ := 01h Get Palette Data
+ := 02h Set Secondary Palette Data
+ := 03h Get Secondary Palette Data
+ := 80h Set Palette Data during Vertical Retrace
+ CX := Number of palette registers to update (to a maximum of 256)
+ DX := First of the palette registers to update (start)
+ ES:DI := Table of palette values (see below for format)
+
+ Output:
+ AX := VBE Return Status
+
+
+ Input:
+ (32-bit)
+ BL := 00h Set Palette Data
+ := 80h Set Palette Data during Vertical Retrace
+ CX := Number of palette registers to update (to a maximum of 256)
+ DX := First of the palette registers to update (start)
+ ES:EDI := Table of palette values (see below for format)
+ DS := Selector for memory mapped registers
+ */
+
+ pVbe->pInt10->num = 0x10;
+ pVbe->pInt10->ax = 0x4f09;
+ if (!secondary)
+ pVbe->pInt10->bx = set && wait_retrace ? 0x80 : set ? 0 : 1;
+ else
+ pVbe->pInt10->bx = set ? 2 : 3;
+ pVbe->pInt10->cx = num;
+ pVbe->pInt10->dx = first;
+ pVbe->pInt10->es = SEG_ADDR(pVbe->real_mode_base);
+ pVbe->pInt10->di = SEG_OFF(pVbe->real_mode_base);
+ if (set)
+ memcpy(pVbe->memory, data, num * sizeof(CARD32));
+ xf86ExecX86int10(pVbe->pInt10);
+
+ if (pVbe->pInt10->ax != 0x4f)
+ return (NULL);
+
+ if (set)
+ return (data);
+
+ data = xalloc(num * sizeof(CARD32));
+ memcpy(data, pVbe->memory, num * sizeof(CARD32));
+
+ return (data);
+}
+
+VBEpmi *
+VBEGetVBEpmi(vbeInfoPtr pVbe)
+{
+ VBEpmi *pmi;
+
+ /*
+ Input:
+ AH := 4Fh Super VGA support
+ AL := 0Ah Protected Mode Interface
+ BL := 00h Return Protected Mode Table
+
+ Output:
+ AX := Status
+ ES := Real Mode Segment of Table
+ DI := Offset of Table
+ CX := Lenght of Table including protected mode code in bytes (for copying purposes)
+ (All other registers are preserved)
+ */
+
+ pVbe->pInt10->num = 0x10;
+ pVbe->pInt10->ax = 0x4f0a;
+ pVbe->pInt10->bx = 0;
+ pVbe->pInt10->di = 0;
+ xf86ExecX86int10(pVbe->pInt10);
+
+ if (pVbe->pInt10->ax != 0x4f)
+ return (NULL);
+
+ pmi = xalloc(sizeof(VBEpmi));
+ pmi->seg_tbl = pVbe->pInt10->es;
+ pmi->tbl_off = pVbe->pInt10->di;
+ pmi->tbl_len = pVbe->pInt10->cx;
+
+ return (pmi);
+}
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/vbe/vbe.h b/xc/programs/Xserver/hw/xfree86/os-support/vbe/vbe.h
index 2bdfb7952..9490bcd3f 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/vbe/vbe.h
+++ b/xc/programs/Xserver/hw/xfree86/os-support/vbe/vbe.h
@@ -1,4 +1,14 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/vbe/vbe.h,v 1.4 2000/04/20 21:28:50 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/vbe/vbe.h,v 1.5 2001/02/15 20:00:09 eich Exp $ */
+
+/*
+ * XFree86 vbe module
+ * Copyright 2000 Egbert Eich
+ *
+ * The mode query/save/set/restore functions from the vesa driver
+ * have been moved here.
+ * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
+ * Authors: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
+ */
#ifndef _VBE_H
#define _VBE_H
@@ -47,4 +57,237 @@ typedef struct vbeControllerInfoBlock {
} vbeControllerInfoRec, *vbeControllerInfoPtr;
#pragma pack()
+
+#ifndef __GNUC__
+#define __attribute__(a)
+#endif
+
+typedef struct _VbeInfoBlock VbeInfoBlock;
+typedef struct _VbeModeInfoBlock VbeModeInfoBlock;
+typedef struct _VbeCRTCInfoBlock VbeCRTCInfoBlock;
+
+/*
+ * INT 0
+ */
+
+struct _VbeInfoBlock {
+ /* VESA 1.2 fields */
+ CARD8 VESASignature[4]; /* VESA */
+ CARD16 VESAVersion; /* Higher byte major, lower byte minor */
+ /*CARD32*/char *OEMStringPtr; /* Pointer to OEM string */
+ CARD8 Capabilities[4]; /* Capabilities of the video environment */
+
+ /*CARD32*/CARD16 *VideoModePtr; /* pointer to supported Super VGA modes */
+
+ CARD16 TotalMemory; /* Number of 64kb memory blocks on board */
+ /* if not VESA 2, 236 scratch bytes follow (256 bytes total size) */
+
+ /* VESA 2 fields */
+ CARD16 OemSoftwareRev; /* VBE implementation Software revision */
+ /*CARD32*/char *OemVendorNamePtr; /* Pointer to Vendor Name String */
+ /*CARD32*/char *OemProductNamePtr; /* Pointer to Product Name String */
+ /*CARD32*/char *OemProductRevPtr; /* Pointer to Product Revision String */
+ CARD8 Reserved[222]; /* Reserved for VBE implementation */
+ CARD8 OemData[256]; /* Data Area for OEM Strings */
+} __attribute__((packed));
+
+/* Return Super VGA Information */
+VbeInfoBlock *VBEGetVBEInfo(vbeInfoPtr pVbe);
+void VBEFreeVBEInfo(VbeInfoBlock *block);
+
+/*
+ * INT 1
+ */
+
+struct _VbeModeInfoBlock {
+ CARD16 ModeAttributes; /* mode attributes */
+ CARD8 WinAAttributes; /* window A attributes */
+ CARD8 WinBAttributes; /* window B attributes */
+ CARD16 WinGranularity; /* window granularity */
+ CARD16 WinSize; /* window size */
+ CARD16 WinASegment; /* window A start segment */
+ CARD16 WinBSegment; /* window B start segment */
+ CARD32 WinFuncPtr; /* real mode pointer to window function */
+ CARD16 BytesPerScanline; /* bytes per scanline */
+
+ /* Mandatory information for VBE 1.2 and above */
+ CARD16 XResolution; /* horizontal resolution in pixels or characters */
+ CARD16 YResolution; /* vertical resolution in pixels or characters */
+ CARD8 XCharSize; /* character cell width in pixels */
+ CARD8 YCharSize; /* character cell height in pixels */
+ CARD8 NumberOfPlanes; /* number of memory planes */
+ CARD8 BitsPerPixel; /* bits per pixel */
+ CARD8 NumberOfBanks; /* number of banks */
+ CARD8 MemoryModel; /* memory model type */
+ CARD8 BankSize; /* bank size in KB */
+ CARD8 NumberOfImages; /* number of images */
+ CARD8 Reserved; /* 1 */ /* reserved for page function */
+
+ /* Direct color fields (required for direct/6 and YUV/7 memory models) */
+ CARD8 RedMaskSize; /* size of direct color red mask in bits */
+ CARD8 RedFieldPosition; /* bit position of lsb of red mask */
+ CARD8 GreenMaskSize; /* size of direct color green mask in bits */
+ CARD8 GreenFieldPosition; /* bit position of lsb of green mask */
+ CARD8 BlueMaskSize; /* size of direct color blue mask in bits */
+ CARD8 BlueFieldPosition; /* bit position of lsb of blue mask */
+ CARD8 RsvdMaskSize; /* size of direct color reserved mask in bits */
+ CARD8 RsvdFieldPosition; /* bit position of lsb of reserved mask */
+ CARD8 DirectColorModeInfo; /* direct color mode attributes */
+
+ /* Mandatory information for VBE 2.0 and above */
+ CARD32 PhysBasePtr; /* physical address for flat memory frame buffer */
+ CARD32 Reserved32; /* 0 */ /* Reserved - always set to 0 */
+ CARD16 Reserved16; /* 0 */ /* Reserved - always set to 0 */
+
+ /* Mandatory information for VBE 3.0 and above */
+ CARD16 LinBytesPerScanLine; /* bytes per scan line for linear modes */
+ CARD8 BnkNumberOfImagePages; /* number of images for banked modes */
+ CARD8 LinNumberOfImagePages; /* number of images for linear modes */
+ CARD8 LinRedMaskSize; /* size of direct color red mask (linear modes) */
+ CARD8 LinRedFieldPosition; /* bit position of lsb of red mask (linear modes) */
+ CARD8 LinGreenMaskSize; /* size of direct color green mask (linear modes) */
+ CARD8 LinGreenFieldPosition; /* bit position of lsb of green mask (linear modes) */
+ CARD8 LinBlueMaskSize; /* size of direct color blue mask (linear modes) */
+ CARD8 LinBlueFieldPosition; /* bit position of lsb of blue mask (linear modes) */
+ CARD8 LinRsvdMaskSize; /* size of direct color reserved mask (linear modes) */
+ CARD8 LinRsvdFieldPosition; /* bit position of lsb of reserved mask (linear modes) */
+ CARD32 MaxPixelClock; /* maximum pixel clock (in Hz) for graphics mode */
+ CARD8 Reserved2[189]; /* remainder of VbeModeInfoBlock */
+} __attribute__((packed));
+
+/* Return VBE Mode Information */
+VbeModeInfoBlock *VBEGetModeInfo(vbeInfoPtr pVbe, int mode);
+void VBEFreeModeInfo(VbeModeInfoBlock *block);
+
+/*
+ * INT2
+ */
+
+#define CRTC_DBLSCAN (1<<0)
+#define CRTC_INTERLACE (1<<1)
+#define CRTC_NHSYNC (1<<2)
+#define CRTC_NVSYNC (1<<3)
+
+struct _VbeCRTCInfoBlock {
+ CARD16 HorizontalTotal; /* Horizontal total in pixels */
+ CARD16 HorizontalSyncStart; /* Horizontal sync start in pixels */
+ CARD16 HorizontalSyncEnd; /* Horizontal sync end in pixels */
+ CARD16 VerticalTotal; /* Vertical total in lines */
+ CARD16 VerticalSyncStart; /* Vertical sync start in lines */
+ CARD16 VerticalSyncEnd; /* Vertical sync end in lines */
+ CARD8 Flags; /* Flags (Interlaced, Double Scan etc) */
+ CARD32 PixelClock; /* Pixel clock in units of Hz */
+ CARD16 RefreshRate; /* Refresh rate in units of 0.01 Hz */
+ CARD8 Reserved[40]; /* remainder of ModeInfoBlock */
+} __attribute__((packed));
+/* VbeCRTCInfoBlock is in the VESA 3.0 specs */
+
+Bool VBESetVBEMode(vbeInfoPtr pVbe, int mode, VbeCRTCInfoBlock *crtc);
+
+/*
+ * INT 3
+ */
+
+Bool VBEGetVBEMode(vbeInfoPtr pVbe, int *mode);
+
+/*
+ * INT 4
+ */
+
+/* Save/Restore Super VGA video state */
+/* function values are (values stored in VESAPtr):
+ * 0 := query & allocate amount of memory to save state
+ * 1 := save state
+ * 2 := restore state
+ *
+ * function 0 called automatically if function 1 called without
+ * a previous call to function 0.
+ */
+
+typedef enum {
+ MODE_QUERY,
+ MODE_SAVE,
+ MODE_RESTORE
+} vbeSaveRestoreFunction;
+
+Bool
+VBESaveRestore(vbeInfoPtr pVbe, vbeSaveRestoreFunction fuction,
+ pointer *memory, int *size, int *real_mode_pages);
+
+/*
+ * INT 5
+ */
+
+Bool
+VBEBankSwitch(vbeInfoPtr pVbe, unsigned int iBank, int window);
+
+/*
+ * INT 6
+ */
+
+typedef enum {
+ SCANWID_SET,
+ SCANWID_GET,
+ SCANWID_SET_BYTES,
+ SCANWID_GET_MAX
+} vbeScanwidthCommand;
+
+#define VBESetLogicalScanline(pVbe, width) \
+ VBESetGetLogicalScanlineLength(pVbe, SCANWID_SET, \
+ width, NULL, NULL, NULL)
+#define VBESetLogicalScanlineBytes(pVbe, width) \
+ VBESetGetLogicalScanlineLength(pVbe, width, SCANWID_SET_BYTES, \
+ NULL, NULL, NULL)
+#define VBEGetLogicalScanline(pVbe, pixels, bytes, max) \
+ VBESetGetLogicalScanlineLength(pVbe, SCANWID_GET, NULL, \
+ pixels, bytes, max)
+#define VBEGetMaxLogicalScanline(pVbe, pixels, bytes, max) \
+ VBESetGetLogicalScanlineLength(pVbe, SCANWID_GET_MAX, \
+ NULL, pixels, bytes, max)
+Bool VBESetGetLogicalScanlineLength(vbeInfoPtr pVbe,
+ vbeScanwidthCommand command, int width,
+ int *pixels, int *bytes, int *max);
+
+/*
+ * INT 7
+ */
+
+/* 16 bit code */
+Bool VBESetDisplayStart(vbeInfoPtr pVbe, int x, int y, Bool wait_retrace);
+Bool VBEGetDisplayStart(vbeInfoPtr pVbe, int *x, int *y);
+
+/*
+ * INT 8
+ */
+
+/* if bits is 0, then it is a GET */
+int VBESetGetDACPaletteFormat(vbeInfoPtr pVbe, int bits);
+
+/*
+ * INT 9
+ */
+
+/*
+ * If getting a palette, the data argument is not used. It will return
+ * the data.
+ * If setting a palette, it will return the pointer received on success,
+ * NULL on failure.
+ */
+CARD32 *VBESetGetPaletteData(vbeInfoPtr pVbe, Bool set, int first, int num,
+ CARD32 *data, Bool secondary, Bool wait_retrace);
+#define VBEFreePaletteData(data) xfree(data)
+
+/*
+ * INT A
+ */
+
+typedef struct _VBEpmi {
+ int seg_tbl;
+ int tbl_off;
+ int tbl_len;
+} VBEpmi;
+
+VBEpmi *VBEGetVBEpmi(vbeInfoPtr pVbe);
+#define VESAFreeVBEpmi(pmi) xfree(pmi)
+
#endif
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 8dda78810..c7c6fd2b3 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.49 2000/12/07 15:43:45 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86_OSproc.h,v 3.50 2001/02/15 11:03:54 alanh Exp $ */
#ifndef _XF86_OSPROC_H
#define _XF86_OSPROC_H
@@ -194,13 +194,6 @@ 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__)
-extern void xf86JensenMemToBus(char *, long, long, int);
-extern void xf86JensenBusToMem(char *, char *, unsigned long, int);
-extern void xf86SlowBCopyFromBus(unsigned char *, unsigned char *, int);
-extern void xf86SlowBCopyToBus(unsigned char *, unsigned char *, int);
-#endif /* __alpha__ */
-
/* These routines are in shared/sigio.c and are not loaded as part of the
module. These routines are small, and the code if very POSIX-signal (or
OS-signal) specific, so it seemed better to provide more complex
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/xf86drmR128.h b/xc/programs/Xserver/hw/xfree86/os-support/xf86drmR128.h
index 290f86f1a..5d332081b 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/xf86drmR128.h
+++ b/xc/programs/Xserver/hw/xfree86/os-support/xf86drmR128.h
@@ -27,7 +27,7 @@
* Gareth Hughes <gareth@valinux.com>
* Kevin E. Martin <martin@valinux.com>
*
- * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86drmR128.h,v 3.5 2000/12/12 17:17:13 dawes Exp $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86drmR128.h,v 3.7 2001/01/11 03:37:00 tsi Exp $
*
*/
diff --git a/xc/programs/Xserver/hw/xfree86/xaa/xaaPict.c b/xc/programs/Xserver/hw/xfree86/xaa/xaaPict.c
index b065aa35b..76441bfd6 100644
--- a/xc/programs/Xserver/hw/xfree86/xaa/xaaPict.c
+++ b/xc/programs/Xserver/hw/xfree86/xaa/xaaPict.c
@@ -1,5 +1,5 @@
/*
- * $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaPict.c,v 1.5 2000/10/22 20:54:30 mvojkovi Exp $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaPict.c,v 1.9 2001/02/04 03:19:28 mvojkovi Exp $
*
* Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
*
@@ -40,10 +40,54 @@
#include "xaa.h"
#include "xaalocal.h"
#include "xaawrap.h"
+#include "xaacexp.h"
#include "xf86fbman.h"
#include "servermd.h"
static Bool
+XAAGetPixelFromRGBA (
+ CARD32 *pixel,
+ CARD16 red,
+ CARD16 green,
+ CARD16 blue,
+ CARD16 alpha,
+ CARD32 format
+){
+ int rbits, bbits, gbits, abits;
+ int rshift, bshift, gshift, ashift;
+
+ *pixel = 0;
+
+ if(!PICT_FORMAT_COLOR(format))
+ return FALSE;
+
+ rbits = PICT_FORMAT_R(format);
+ gbits = PICT_FORMAT_G(format);
+ bbits = PICT_FORMAT_B(format);
+ abits = PICT_FORMAT_A(format);
+
+ if(PICT_FORMAT_TYPE(format) == PICT_TYPE_ARGB) {
+ bshift = 0;
+ gshift = bbits;
+ rshift = gshift + gbits;
+ ashift = rshift + rbits;
+ } else { /* PICT_TYPE_ABGR */
+ rshift = 0;
+ gshift = rbits;
+ bshift = gshift + gbits;
+ ashift = bshift + bbits;
+ }
+
+ *pixel |= ( blue >> (16 - bbits)) << bshift;
+ *pixel |= ( red >> (16 - rbits)) << rshift;
+ *pixel |= (green >> (16 - gbits)) << gshift;
+ *pixel |= (alpha >> (16 - abits)) << ashift;
+
+ return TRUE;
+}
+
+
+static Bool
XAAGetRGBAFromPixel(
CARD32 pixel,
CARD16 *red,
@@ -52,68 +96,56 @@ XAAGetRGBAFromPixel(
CARD16 *alpha,
CARD32 format
){
-
- *alpha = 0xffff;
-
- switch(PICT_FORMAT_BPP(format)) {
- case 32:
- switch(format) {
- case PICT_a8r8g8b8:
- *alpha = (pixel >> 24) & 0x000000ff;
- *alpha |= *alpha << 8;
- case PICT_x8r8g8b8:
- *blue = pixel & 0x000000ff;
- *blue |= *blue << 8;
- *green = pixel & 0x0000ff00;
- *green |= *green >> 8;
- *red = (pixel >> 16) & 0x000000ff;
- *red |= *red << 8;
- return TRUE;
- case PICT_a8b8g8r8:
- *alpha = (pixel >> 24) & 0x000000ff;
- *alpha |= *alpha << 8;
- case PICT_x8b8g8r8:
- *red = pixel & 0x000000ff;
- *red |= *red << 8;
- *green = pixel & 0x0000ff00;
- *green |= *green >> 8;
- *blue = (pixel >> 16) & 0x000000ff;
- *blue |= *blue << 8;
- return TRUE;
- default:
- break;
- }
- break;
- case 24:
- switch(format) {
- case PICT_r8g8b8:
- *blue = pixel & 0x000000ff;
- *blue |= *blue << 8;
- *green = pixel & 0x0000ff00;
- *green |= *green >> 8;
- *red = (pixel >> 16) & 0x000000ff;
- *red |= *red << 8;
- return TRUE;
- case PICT_b8g8r8:
- *red = pixel & 0x000000ff;
- *red |= *red << 8;
- *green = pixel & 0x0000ff00;
- *green |= *green >> 8;
- *blue = (pixel >> 16) & 0x000000ff;
- *blue |= *blue << 8;
- return TRUE;
- default:
- break;
- }
- break;
- case 16:
- case 8:
- case 4:
- default:
- return FALSE;
+ int rbits, bbits, gbits, abits;
+ int rshift, bshift, gshift, ashift;
+
+ if(!PICT_FORMAT_COLOR(format))
+ return FALSE;
+
+ rbits = PICT_FORMAT_R(format);
+ gbits = PICT_FORMAT_G(format);
+ bbits = PICT_FORMAT_B(format);
+ abits = PICT_FORMAT_A(format);
+
+ if(PICT_FORMAT_TYPE(format) == PICT_TYPE_ARGB) {
+ bshift = 0;
+ gshift = bbits;
+ rshift = gshift + gbits;
+ ashift = rshift + rbits;
+ } else { /* PICT_TYPE_ABGR */
+ rshift = 0;
+ gshift = rbits;
+ bshift = gshift + gbits;
+ ashift = bshift + bbits;
}
-
- return FALSE;
+
+ *red = ((pixel >> rshift ) & ((1 << rbits) - 1)) << (16 - rbits);
+ while(rbits < 16) {
+ *red |= *red >> rbits;
+ rbits <<= 1;
+ }
+
+ *green = ((pixel >> gshift ) & ((1 << gbits) - 1)) << (16 - gbits);
+ while(gbits < 16) {
+ *green |= *green >> gbits;
+ gbits <<= 1;
+ }
+
+ *blue = ((pixel >> bshift ) & ((1 << bbits) - 1)) << (16 - bbits);
+ while(bbits < 16) {
+ *blue |= *blue >> bbits;
+ bbits <<= 1;
+ }
+
+ if(abits) {
+ *alpha = ((pixel >> ashift ) & ((1 << abits) - 1)) << (16 - abits);
+ while(abits < 16) {
+ *alpha |= *alpha >> abits;
+ abits <<= 1;
+ }
+ } else *alpha = 0xffff;
+
+ return TRUE;
}
/* 8:8:8 + PICT_a8 -> 8:8:8:8 texture */
@@ -140,7 +172,6 @@ XAA_888_plus_PICT_a8_to_8888 (
}
}
-
Bool
XAADoComposite (
CARD8 op,
@@ -184,21 +215,65 @@ XAADoComposite (
if(!XAAGetRGBAFromPixel(pixel,&red,&green,&blue,&alpha,pSrc->format))
return FALSE;
- if((alpha != 0xffff) &&
+ xMask += pMask->pDrawable->x;
+ yMask += pMask->pDrawable->y;
+
+ /* pull out color expandable operations here */
+ if((pMask->format == PICT_a1) && (alpha == 0xffff) &&
+ (op == PictOpOver) && infoRec->WriteBitmap &&
+ !(infoRec->WriteBitmapFlags & NO_TRANSPARENCY) &&
+ (!(infoRec->WriteBitmapFlags & RGB_EQUAL) ||
+ (red == green == blue)))
+ {
+ PixmapPtr pPix = (PixmapPtr)(pMask->pDrawable);
+ int skipleft;
+
+ if (!miComputeCompositeRegion (&region, pSrc, pMask, pDst,
+ xSrc, ySrc, xMask, yMask, xDst, yDst,
+ width, height))
+ return TRUE;
+
+ nbox = REGION_NUM_RECTS(&region);
+ pbox = REGION_RECTS(&region);
+
+ if(!nbox)
+ return TRUE;
+
+ XAAGetPixelFromRGBA(&pixel, red, green, blue, 0, pDst->format);
+
+ xMask -= xDst;
+ yMask -= yDst;
+
+ while(nbox--) {
+ skipleft = pbox->x1 + xMask;
+
+ (*infoRec->WriteBitmap)(infoRec->pScrn,
+ pbox->x1, pbox->y1,
+ pbox->x2 - pbox->x1, pbox->y2 - pbox->y1,
+ (unsigned char*)(pPix->devPrivate.ptr) +
+ (pPix->devKind * (pbox->y1 + yMask)) +
+ ((skipleft >> 3) & ~3), pPix->devKind,
+ skipleft & 31, pixel, -1, GXcopy, ~0);
+ pbox++;
+ }
+
+ /* WriteBitmap sets the Sync flag */
+ REGION_UNINIT(pScreen, &region);
+ return TRUE;
+ }
+
+ if((alpha != 0xffff) &&
(infoRec->CPUToScreenAlphaTextureFlags & XAA_RENDER_NO_SRC_ALPHA))
return FALSE;
- formats = infoRec->CPUToScreenAlphaTextureFormats;
+ formats = infoRec->CPUToScreenAlphaTextureFormats;
- while(*formats != pMask->format) {
+ while(*formats != pMask->format) {
if(!(*formats)) return FALSE;
formats++;
- }
-
- xMask += pMask->pDrawable->x;
- yMask += pMask->pDrawable->y;
+ }
- if (!miComputeCompositeRegion (&region, pSrc, pMask, pDst,
+ if (!miComputeCompositeRegion (&region, pSrc, pMask, pDst,
xSrc, ySrc, xMask, yMask, xDst, yDst,
width, height))
return TRUE;
@@ -206,15 +281,20 @@ XAADoComposite (
nbox = REGION_NUM_RECTS(&region);
pbox = REGION_RECTS(&region);
- if(!nbox)
+ if(!nbox) {
+ REGION_UNINIT(pScreen, &region);
return TRUE;
+ }
if(!(infoRec->SetupForCPUToScreenAlphaTexture)(infoRec->pScrn,
op, red, green, blue, alpha, pMask->format,
((PixmapPtr)(pMask->pDrawable))->devPrivate.ptr,
((PixmapPtr)(pMask->pDrawable))->devKind,
pMask->pDrawable->width, pMask->pDrawable->height, 0))
+ {
+ REGION_UNINIT(pScreen, &region);
return FALSE;
+ }
xMask -= xDst;
yMask -= yDst;
@@ -247,15 +327,22 @@ XAADoComposite (
nbox = REGION_NUM_RECTS(&region);
pbox = REGION_RECTS(&region);
- if(!nbox)
- return TRUE;
+ if(!nbox) {
+ REGION_UNINIT(pScreen, &region);
+ return TRUE;
+ }
+
if(!(infoRec->SetupForCPUToScreenTexture)(infoRec->pScrn,
op, pSrc->format,
((PixmapPtr)(pSrc->pDrawable))->devPrivate.ptr,
((PixmapPtr)(pSrc->pDrawable))->devKind,
pSrc->pDrawable->width, pSrc->pDrawable->height, 0))
- return FALSE;
+ {
+ REGION_UNINIT(pScreen, &region);
+ return FALSE;
+ }
+
xSrc -= xDst;
ySrc -= yDst;
@@ -322,6 +409,173 @@ XAAComposite (CARD8 op,
XAA_RENDER_EPILOGUE(pScreen, Composite, XAAComposite);
}
+Bool
+XAADoGlyphs (CARD8 op,
+ PicturePtr pSrc,
+ PicturePtr pDst,
+ PictFormatPtr maskFormat,
+ INT16 xSrc,
+ INT16 ySrc,
+ int nlist,
+ GlyphListPtr list,
+ GlyphPtr *glyphs)
+{
+ ScreenPtr pScreen = pDst->pDrawable->pScreen;
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
+
+ if(!infoRec->pScrn->vtSema ||
+ ((pDst->pDrawable->type != DRAWABLE_WINDOW) &&
+ !IS_OFFSCREEN_PIXMAP(pDst->pDrawable)))
+ return FALSE;
+
+ if(maskFormat && (maskFormat->depth == 1) &&
+ (pSrc->pDrawable->width == 1) && (pSrc->pDrawable->height == 1) &&
+ (op == PictOpOver) && infoRec->WriteBitmap &&
+ !(infoRec->WriteBitmapFlags & NO_TRANSPARENCY))
+ {
+ CARD16 red, green, blue, alpha;
+ CARD32 pixel =
+ *((CARD32*)(((PixmapPtr)(pSrc->pDrawable))->devPrivate.ptr));
+ CARD32 *bits, *pntr, *pnt;
+ int x, y, i, n, left, top, right, bottom, width, height, pitch;
+ int L, T, R, B, X, Y, h, w, dwords, row, column, nbox;
+ int leftEdge, rightEdge, topLine, botLine;
+ BoxPtr pbox;
+ GlyphPtr glyph;
+
+ if(!XAAGetRGBAFromPixel(pixel,&red,&green,&blue,&alpha,pSrc->format))
+ return FALSE;
+
+ if(alpha != 0xffff) return FALSE;
+
+ XAAGetPixelFromRGBA(&pixel, red, green, blue, 0, pDst->format);
+
+ if((infoRec->WriteBitmapFlags & RGB_EQUAL) && !(red == green == blue))
+ return FALSE;
+
+ x = pDst->pDrawable->x;
+ y = pDst->pDrawable->y;
+
+ while(nlist--) {
+ x += list->xOff;
+ y += list->yOff;
+ left = right = X = x;
+ top = bottom = Y = y;
+ for(i = 0; i < list->len; i++) {
+ glyph = glyphs[i];
+
+ L = X - glyph->info.x;
+ if(L < left) left = L;
+ R = L + glyph->info.width;
+ if(R > right) right = R;
+
+ T = Y - glyph->info.y;
+ if(T < top) top = T;
+ B = T + glyph->info.height;
+ if(B > bottom) bottom = B;
+
+ X += glyph->info.xOff;
+ Y += glyph->info.yOff;
+ }
+
+ width = right - left;
+ height = bottom - top;
+
+ if(width && height) {
+ pitch = (((width + 31) & ~31) >> 5) + 1;
+ pntr = (CARD32*)xalloc(sizeof(CARD32) * pitch * height);
+ if(!pntr)
+ return TRUE;
+ bzero(pntr, sizeof(CARD32) * pitch * height);
+ n = list->len;
+
+ X = x; Y = y;
+ while(n--) {
+ glyph = *glyphs++;
+ h = glyph->info.height;
+ w = glyph->info.width;
+ if(h && w) {
+ row = y - top - glyph->info.y;
+ column = x - left - glyph->info.x;
+ pnt = pntr + (row * pitch) + (column >> 5);
+ column &= 31;
+ dwords = ((w + 31) >> 5) - 1;
+ bits = (CARD32*)(glyph + 1);
+ if(dwords) {
+ while(h--) {
+ for(i = 0; i <= dwords; i++) {
+ if(column) {
+ pnt[i] |= SHIFT_L(*bits, column);
+ pnt[i + 1] |= SHIFT_R(*bits, 32 - column);
+ } else
+ pnt[i] |= *bits;
+
+ if(i != dwords) bits++;
+ }
+ bits++;
+ pnt += pitch;
+ }
+ } else {
+ if(column) {
+ while(h--) {
+ pnt[0] |= SHIFT_L(*bits, column);
+ pnt[0 + 1] |= SHIFT_R(*bits, 32 - column);
+ bits++;
+ pnt += pitch;
+ }
+ } else {
+ while(h--) {
+ *pnt |= *bits++;
+ pnt += pitch;
+ }
+ }
+ }
+ }
+ x += glyph->info.xOff;
+ y += glyph->info.yOff;
+ }
+
+ nbox = REGION_NUM_RECTS(pDst->pCompositeClip);
+ pbox = REGION_RECTS(pDst->pCompositeClip);
+
+ while(nbox && (top >= pbox->y2)) {
+ pbox++; nbox--;
+ }
+
+ while(nbox && (bottom > pbox->y1)) {
+ leftEdge = max(left, pbox->x1);
+ rightEdge = min(right, pbox->x2);
+
+ if(rightEdge > leftEdge) {
+ column = leftEdge - left;
+ topLine = max(top, pbox->y1);
+ botLine = min(bottom, pbox->y2);
+ h = botLine - topLine;
+
+ if(h > 0) {
+ (*infoRec->WriteBitmap)(infoRec->pScrn,
+ leftEdge, topLine, rightEdge - leftEdge, h,
+ (unsigned char*)(pntr +
+ ((topLine - top) * pitch) + (column >> 5)),
+ pitch << 2, column & 31, pixel, -1, GXcopy, ~0);
+ }
+ }
+ nbox--; pbox++;
+ }
+ xfree(pntr);
+ } else {
+ x = X; y = Y;
+ }
+ list++;
+ }
+
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+
void
XAAGlyphs (CARD8 op,
PicturePtr pSrc,
diff --git a/xc/programs/Xserver/hw/xfree86/xf86cfg/Imakefile b/xc/programs/Xserver/hw/xfree86/xf86cfg/Imakefile
index 04af09f21..8071cdc15 100644
--- a/xc/programs/Xserver/hw/xfree86/xf86cfg/Imakefile
+++ b/xc/programs/Xserver/hw/xfree86/xf86cfg/Imakefile
@@ -1,4 +1,4 @@
-XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/Imakefile,v 1.13 2000/12/14 01:21:57 dawes Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/Imakefile,v 1.15 2001/01/24 00:06:39 dawes Exp $
XCOMM CDEBUGFLAGS=-g -Wall -ansi -pedantic
@@ -96,7 +96,7 @@ CURSESDEFINES = -DHAS_NCURSES
#endif
DEFINES = -DXF86CONFIG=\"XConfigFile\" $(MODULEDEFINES) \
- $(CURSESDEFINES)
+ $(CURSESDEFINES) -DPROJECT_ROOT=\"ProjectRoot\"
#if HasDlopen
DLLIB = DlLibrary
@@ -113,7 +113,6 @@ InstallMultipleFlags($(XBMPICS),$(INCDIR)/X11/bitmaps,$(INSTINCFLAGS))
InstallMultipleFlags($(XPMPICS),$(INCDIR)/X11/pixmaps,$(INSTINCFLAGS))
InstallAppDefaults(XF86Cfg)
-CppManTarget(xf86cfg,)
InstallManPage(xf86cfg,$(MANDIR))
NormalLibraryObjectRule()
diff --git a/xc/programs/Xserver/hw/xfree86/xf86cfg/XF86Cfg.ad b/xc/programs/Xserver/hw/xfree86/xf86cfg/XF86Cfg.ad
index 7a0bd2059..9e2cbc5db 100644
--- a/xc/programs/Xserver/hw/xfree86/xf86cfg/XF86Cfg.ad
+++ b/xc/programs/Xserver/hw/xfree86/xf86cfg/XF86Cfg.ad
@@ -26,7 +26,7 @@
!!
!! Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
!!
-!! $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/XF86Cfg.ad,v 1.6 2000/11/30 20:55:16 paulo Exp $
+!! $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/XF86Cfg.ad,v 1.7 2000/12/27 23:37:36 paulo Exp $
!!
*Form.background: gray85
@@ -1338,7 +1338,7 @@ Press in the <b>Enable ???</b> label to set specific options.\
<tt><b>Apply changes</b></tt> button there is no way to undo your changes.</font>
-*Expert.geometry: 800x600
+*Expert.geometry: 640x460
*Expert*vpane.min: 64
*Expert*vpane.max: 64
*Expert*vpane.showGrip: False
@@ -1767,3 +1767,4 @@ lines -1,0,0,0,0,-1
*expert*tree*buffers.flagsL.fromVert: size
*expert*tree*buffers.flags.fromVert: size
*expert*tree*buffers.flags.fromHoriz: flagsL
+*Expert*close.label: Close \ No newline at end of file
diff --git a/xc/programs/Xserver/hw/xfree86/xf86cfg/accessx.c b/xc/programs/Xserver/hw/xfree86/xf86cfg/accessx.c
index 3842ff230..79139309c 100644
--- a/xc/programs/Xserver/hw/xfree86/xf86cfg/accessx.c
+++ b/xc/programs/Xserver/hw/xfree86/xf86cfg/accessx.c
@@ -26,7 +26,7 @@
*
* Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
*
- * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/accessx.c,v 1.7 2000/10/20 14:59:05 alanh Exp $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/accessx.c,v 1.8 2001/01/26 21:17:40 paulo Exp $
*/
#include "config.h"
@@ -179,15 +179,12 @@ AccessXInitialize(void)
XtNstate,
(xkb_info->xkb->ctrls->enabled_ctrls &
(XkbAccessXKeysMask | XkbStickyKeysMask |
- XkbMouseKeysMask | XkbMouseKeysAccelMask |
- XkbRepeatKeysMask | XkbSlowKeysMask |
- XkbBounceKeysMask)) != 0, NULL, 0);
+ XkbSlowKeysMask | XkbBounceKeysMask)) != 0, NULL, 0);
apply = XtCreateManagedWidget("apply", commandWidgetClass, accessx, NULL, 0);
XtAddCallback(apply, XtNcallback, ApplyCallback, NULL);
form = XtCreateManagedWidget("Accessx", formWidgetClass, accessx, NULL, 0);
- XtAddCallback(enable, XtNcallback, EnableCallback, (XtPointer)form);
timeoutToggle = XtVaCreateManagedWidget("timeoutToggle", toggleWidgetClass,
form, XtNstate,
xkb_info->xkb->ctrls->ax_timeout > 60
@@ -450,7 +447,6 @@ AccessXInitialize(void)
XtSetArg(args[0], XtNstate, &state);
XtGetValues(enable, args, 1);
- EnableCallback(enable, (XtPointer)form, (XtPointer)(long)state);
}
void
@@ -471,7 +467,7 @@ AccessXConfigureEnd(void)
static void
EnableCallback(Widget w, XtPointer user_data, XtPointer call_data)
{
- XtSetSensitive(user_data, (long)call_data);
+ XtSetSensitive((Widget)user_data, (long)call_data);
}
/*ARGSUSED*/
@@ -534,162 +530,148 @@ ApplyCallback(Widget w, XtPointer user_data, XtPointer call_data)
XtSetArg(args[0], XtNstate, &state);
XtGetValues(enable, args, 1);
if (state) {
- xkb_info->xkb->ctrls->enabled_ctrls |= XkbAccessXKeysMask;
xkb_info->config.initial_ctrls |= XkbAccessXKeysMask;
+ xkb_info->xkb->ctrls->enabled_ctrls |= XkbAccessXKeysMask;
+ }
+ else {
+ xkb_info->config.initial_ctrls &= ~XkbAccessXKeysMask;
+ xkb_info->xkb->ctrls->enabled_ctrls &= ~XkbAccessXKeysMask;
+ }
+
+ /* Timeout */
+ XtSetArg(args[0], XtNstate, &state);
+ XtGetValues(timeoutToggle, args, 1);
+ if (state)
+ xkb_info->config.ax_timeout =
+ xkb_info->xkb->ctrls->ax_timeout = timeout->value * 60;
+ else
+ xkb_info->config.ax_timeout =
+ xkb_info->xkb->ctrls->ax_timeout = 65535;
+
+ /* Enable StickyKeys */
+ XtSetArg(args[0], XtNstate, &state);
+ XtGetValues(sticky, args, 1);
+ if (state) {
+ xkb_info->config.initial_ctrls |= XkbStickyKeysMask;
+ xkb_info->xkb->ctrls->enabled_ctrls |= XkbStickyKeysMask;
+ }
+ else {
+ xkb_info->config.initial_ctrls &= ~XkbStickyKeysMask;
+ xkb_info->xkb->ctrls->enabled_ctrls &= ~XkbStickyKeysMask;
+ }
+ XtSetArg(args[0], XtNstate, &state);
+ XtGetValues(stickyAuto, args, 1);
+ if (state) {
+ xkb_info->config.initial_opts &= ~XkbAX_TwoKeysMask;
+ xkb_info->config.initial_opts &= ~XkbAX_LatchToLockMask;
+ xkb_info->xkb->ctrls->ax_options &= ~XkbAX_TwoKeysMask;
+ xkb_info->xkb->ctrls->ax_options &= ~XkbAX_LatchToLockMask;
+ }
+ else {
+ xkb_info->config.initial_opts &= ~XkbAX_TwoKeysMask;
+ xkb_info->config.initial_opts |= XkbAX_LatchToLockMask;
+ xkb_info->xkb->ctrls->ax_options &= ~XkbAX_TwoKeysMask;
+ xkb_info->xkb->ctrls->ax_options |= XkbAX_LatchToLockMask;
+ }
+ XtSetArg(args[0], XtNstate, &state);
+ XtGetValues(stickyBeep, args, 1);
+ if (state) {
+ xkb_info->config.initial_opts |= XkbAX_StickyKeysFBMask;
+ xkb_info->xkb->ctrls->ax_options |= XkbAX_StickyKeysFBMask;
+ }
+ else {
+ xkb_info->config.initial_opts &= ~XkbAX_StickyKeysFBMask;
+ xkb_info->xkb->ctrls->ax_options &= ~XkbAX_StickyKeysFBMask;
+ }
+
+ /* Enable MouseKeys */
+ XtSetArg(args[0], XtNstate, &state);
+ XtGetValues(mouse, args, 1);
+ if (state) {
+ xkb_info->config.initial_ctrls |= XkbMouseKeysAccelMask;
+ xkb_info->xkb->ctrls->enabled_ctrls |= XkbMouseKeysMask |
+ XkbMouseKeysAccelMask;
+ xkb_info->config.mk_delay =
+ xkb_info->xkb->ctrls->mk_delay = mouseDelay->value * 100;
+ xkb_info->config.mk_interval =
+ xkb_info->xkb->ctrls->mk_interval = 40;
+ xkb_info->config.mk_time_to_max =
+ xkb_info->xkb->ctrls->mk_time_to_max =
+ (mouseTime->value * 1000) / xkb_info->xkb->ctrls->mk_interval;
+ xkb_info->config.mk_max_speed =
+ xkb_info->xkb->ctrls->mk_max_speed =
+ mouseSpeed->value * mouseTime->value;
+ xkb_info->config.mk_curve = xkb_info->xkb->ctrls->mk_curve = 0;
+ }
+ else {
+ xkb_info->config.initial_ctrls &= ~(XkbMouseKeysMask |
+ XkbMouseKeysAccelMask);
+ xkb_info->xkb->ctrls->enabled_ctrls &= ~(XkbMouseKeysMask |
+ XkbMouseKeysAccelMask);
+ }
+
+ /* Enable RepeatKeys */
+ XtSetArg(args[0], XtNstate, &state);
+ XtGetValues(repeat, args, 1);
+ if (state) {
+ xkb_info->config.initial_ctrls |= XkbRepeatKeysMask;
+ xkb_info->xkb->ctrls->enabled_ctrls |= XkbRepeatKeysMask;
+ xkb_info->config.repeat_interval =
+ xkb_info->xkb->ctrls->repeat_interval = repeatRate->value * 1000;
+ xkb_info->config.repeat_delay =
+ xkb_info->xkb->ctrls->repeat_delay = repeatDelay->value * 1000;
+ }
+ else {
+ xkb_info->config.initial_ctrls &= ~XkbRepeatKeysMask;
+ xkb_info->xkb->ctrls->enabled_ctrls &= ~XkbRepeatKeysMask;
+ }
+
+ /* Enable SlowKeys */
+ XtSetArg(args[0], XtNstate, &state);
+ XtGetValues(slowToggle, args, 1);
+ if (state) {
+ xkb_info->config.initial_ctrls |= XkbSlowKeysMask;
+ xkb_info->xkb->ctrls->enabled_ctrls |= XkbSlowKeysMask;
+ xkb_info->config.slow_keys_delay =
+ xkb_info->xkb->ctrls->slow_keys_delay = slow->value * 1000;
+ }
+ else {
+ xkb_info->config.initial_ctrls &= ~XkbSlowKeysMask;
+ xkb_info->xkb->ctrls->enabled_ctrls &= ~XkbSlowKeysMask;
+ }
+ XtSetArg(args[0], XtNstate, &state);
+ XtGetValues(slowPressed, args, 1);
+ if (state) {
+ xkb_info->config.initial_opts |= XkbAX_SKPressFBMask;
+ xkb_info->xkb->ctrls->ax_options |= XkbAX_SKPressFBMask;
+ }
+ else {
+ xkb_info->config.initial_opts &= ~XkbAX_SKPressFBMask;
+ xkb_info->xkb->ctrls->ax_options &= ~XkbAX_SKPressFBMask;
+ }
+ XtSetArg(args[0], XtNstate, &state);
+ XtGetValues(slowAccepted, args, 1);
+ if (state) {
+ xkb_info->config.initial_opts |= XkbAX_SKAcceptFBMask;
+ xkb_info->xkb->ctrls->ax_options |= XkbAX_SKAcceptFBMask;
+ }
+ else {
+ xkb_info->config.initial_opts &= ~XkbAX_SKAcceptFBMask;
+ xkb_info->xkb->ctrls->ax_options &= ~XkbAX_SKAcceptFBMask;
+ }
- /* Timeout */
- XtSetArg(args[0], XtNstate, &state);
- XtGetValues(timeoutToggle, args, 1);
- if (state)
- xkb_info->config.ax_timeout =
- xkb_info->xkb->ctrls->ax_timeout = timeout->value * 60;
- else
- xkb_info->config.ax_timeout =
- xkb_info->xkb->ctrls->ax_timeout = 65535;
-
- /* Enable StickyKeys */
- XtSetArg(args[0], XtNstate, &state);
- XtGetValues(sticky, args, 1);
- if (state) {
- xkb_info->config.initial_ctrls |= XkbStickyKeysMask;
- xkb_info->xkb->ctrls->enabled_ctrls |= XkbStickyKeysMask;
- }
- else {
- xkb_info->config.initial_ctrls &= ~XkbStickyKeysMask;
- xkb_info->xkb->ctrls->enabled_ctrls &= ~XkbStickyKeysMask;
- }
- XtSetArg(args[0], XtNstate, &state);
- XtGetValues(stickyAuto, args, 1);
- if (state) {
- xkb_info->config.initial_opts &= ~XkbAX_TwoKeysMask;
- xkb_info->config.initial_opts &= ~XkbAX_LatchToLockMask;
- xkb_info->xkb->ctrls->ax_options &= ~XkbAX_TwoKeysMask;
- xkb_info->xkb->ctrls->ax_options &= ~XkbAX_LatchToLockMask;
- }
- else {
- xkb_info->config.initial_opts &= ~XkbAX_TwoKeysMask;
- xkb_info->config.initial_opts |= XkbAX_LatchToLockMask;
- xkb_info->xkb->ctrls->ax_options &= ~XkbAX_TwoKeysMask;
- xkb_info->xkb->ctrls->ax_options |= XkbAX_LatchToLockMask;
- }
- XtSetArg(args[0], XtNstate, &state);
- XtGetValues(stickyBeep, args, 1);
- if (state) {
- xkb_info->config.initial_opts |= XkbAX_StickyKeysFBMask;
- xkb_info->xkb->ctrls->ax_options |= XkbAX_StickyKeysFBMask;
- }
- else {
- xkb_info->config.initial_opts &= ~XkbAX_StickyKeysFBMask;
- xkb_info->xkb->ctrls->ax_options &= ~XkbAX_StickyKeysFBMask;
- }
-
- /* Enable MouseKeys */
- XtSetArg(args[0], XtNstate, &state);
- XtGetValues(mouse, args, 1);
- if (state) {
- xkb_info->config.initial_ctrls |= XkbMouseKeysMask |
- XkbMouseKeysAccelMask;
- xkb_info->xkb->ctrls->enabled_ctrls |= XkbMouseKeysMask |
- XkbMouseKeysAccelMask;
- xkb_info->config.mk_delay =
- xkb_info->xkb->ctrls->mk_delay = mouseDelay->value * 100;
- xkb_info->config.mk_interval =
- xkb_info->xkb->ctrls->mk_interval = 40;
- xkb_info->config.mk_time_to_max =
- xkb_info->xkb->ctrls->mk_time_to_max =
- (mouseTime->value * 1000) / xkb_info->xkb->ctrls->mk_interval;
- xkb_info->config.mk_max_speed =
- xkb_info->xkb->ctrls->mk_max_speed =
- mouseSpeed->value * mouseTime->value;
- xkb_info->config.mk_curve = xkb_info->xkb->ctrls->mk_curve = 0;
- }
- else {
- xkb_info->config.initial_ctrls &= ~(XkbMouseKeysMask |
- XkbMouseKeysAccelMask);
- xkb_info->xkb->ctrls->enabled_ctrls &= ~(XkbMouseKeysMask |
- XkbMouseKeysAccelMask);
- }
-
- /* Enable RepeatKeys */
- XtSetArg(args[0], XtNstate, &state);
- XtGetValues(repeat, args, 1);
- if (state) {
- xkb_info->config.initial_ctrls |= XkbRepeatKeysMask;
- xkb_info->xkb->ctrls->enabled_ctrls |= XkbRepeatKeysMask;
- xkb_info->config.repeat_interval =
- xkb_info->xkb->ctrls->repeat_interval = repeatRate->value * 1000;
- xkb_info->config.repeat_delay =
- xkb_info->xkb->ctrls->repeat_delay = repeatDelay->value * 1000;
- }
- else {
- xkb_info->config.initial_ctrls &= ~XkbRepeatKeysMask;
- xkb_info->xkb->ctrls->enabled_ctrls &= ~XkbRepeatKeysMask;
- }
-
- /* Enable SlowKeys */
- XtSetArg(args[0], XtNstate, &state);
- XtGetValues(slowToggle, args, 1);
- if (state) {
- xkb_info->config.initial_ctrls |= XkbSlowKeysMask;
- xkb_info->xkb->ctrls->enabled_ctrls |= XkbSlowKeysMask;
- xkb_info->config.slow_keys_delay =
- xkb_info->xkb->ctrls->slow_keys_delay = slow->value * 1000;
- }
- else {
- xkb_info->config.initial_ctrls &= ~XkbSlowKeysMask;
- xkb_info->xkb->ctrls->enabled_ctrls &= ~XkbSlowKeysMask;
- }
- XtSetArg(args[0], XtNstate, &state);
- XtGetValues(slowPressed, args, 1);
- if (state) {
- xkb_info->config.initial_opts |= XkbAX_SKPressFBMask;
- xkb_info->xkb->ctrls->ax_options |= XkbAX_SKPressFBMask;
- }
- else {
- xkb_info->config.initial_opts &= ~XkbAX_SKPressFBMask;
- xkb_info->xkb->ctrls->ax_options &= ~XkbAX_SKPressFBMask;
- }
- XtSetArg(args[0], XtNstate, &state);
- XtGetValues(slowAccepted, args, 1);
- if (state) {
- xkb_info->config.initial_opts |= XkbAX_SKAcceptFBMask;
- xkb_info->xkb->ctrls->ax_options |= XkbAX_SKAcceptFBMask;
- }
- else {
- xkb_info->config.initial_opts &= ~XkbAX_SKAcceptFBMask;
- xkb_info->xkb->ctrls->ax_options &= ~XkbAX_SKAcceptFBMask;
- }
-
- /* Enable BounceKeys */
- XtSetArg(args[0], XtNstate, &state);
- XtGetValues(bounceToggle, args, 1);
- if (state) {
- xkb_info->config.initial_ctrls |= XkbBounceKeysMask;
- xkb_info->xkb->ctrls->enabled_ctrls |= XkbBounceKeysMask;
- xkb_info->config.debounce_delay =
- xkb_info->xkb->ctrls->debounce_delay = bounce->value * 1000;
- }
- else {
- xkb_info->config.initial_ctrls &= ~XkbBounceKeysMask;
- xkb_info->xkb->ctrls->enabled_ctrls &= ~XkbBounceKeysMask;
- }
+ /* Enable BounceKeys */
+ XtSetArg(args[0], XtNstate, &state);
+ XtGetValues(bounceToggle, args, 1);
+ if (state) {
+ xkb_info->config.initial_ctrls |= XkbBounceKeysMask;
+ xkb_info->xkb->ctrls->enabled_ctrls |= XkbBounceKeysMask;
+ xkb_info->config.debounce_delay =
+ xkb_info->xkb->ctrls->debounce_delay = bounce->value * 1000;
}
else {
- xkb_info->config.initial_ctrls &=
- ~(XkbAccessXKeysMask | XkbStickyKeysMask | XkbMouseKeysMask |
- XkbMouseKeysAccelMask | XkbRepeatKeysMask | XkbSlowKeysMask |
- XkbBounceKeysMask);
- xkb_info->config.initial_opts &=
- ~(XkbAX_TwoKeysMask | XkbAX_LatchToLockMask | XkbAX_StickyKeysFBMask |
- XkbAX_SKPressFBMask | XkbAX_SKAcceptFBMask);
-
- xkb_info->xkb->ctrls->enabled_ctrls &=
- ~(XkbAccessXKeysMask | XkbStickyKeysMask | XkbMouseKeysMask |
- XkbMouseKeysAccelMask | XkbRepeatKeysMask | XkbSlowKeysMask |
- XkbBounceKeysMask);
- xkb_info->xkb->ctrls->ax_options &=
- ~(XkbAX_TwoKeysMask | XkbAX_LatchToLockMask | XkbAX_StickyKeysFBMask |
- XkbAX_SKPressFBMask | XkbAX_SKAcceptFBMask);
+ xkb_info->config.initial_ctrls &= ~XkbBounceKeysMask;
+ xkb_info->xkb->ctrls->enabled_ctrls &= ~XkbBounceKeysMask;
}
XkbSetControls(DPY, XkbAllControlsMask, xkb_info->xkb);
diff --git a/xc/programs/Xserver/hw/xfree86/xf86cfg/interface.c b/xc/programs/Xserver/hw/xfree86/xf86cfg/interface.c
index 0661aecec..7ad6cfaa5 100644
--- a/xc/programs/Xserver/hw/xfree86/xf86cfg/interface.c
+++ b/xc/programs/Xserver/hw/xfree86/xf86cfg/interface.c
@@ -26,7 +26,7 @@
*
* Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
*
- * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/interface.c,v 1.13 2000/12/09 02:23:26 dawes Exp $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/interface.c,v 1.14 2000/12/29 20:09:52 paulo Exp $
*/
#include <X11/IntrinsicP.h>
@@ -61,7 +61,11 @@
#include "stubs.h"
#define randomize() srand((unsigned)time((time_t*)NULL))
+#ifdef PROJECT_ROOT
+#define DefaultXFree86Dir PROJECT_ROOT
+#else
#define DefaultXFree86Dir "/usr/X11R6"
+#endif
/*
* Prototypes
diff --git a/xc/programs/Xserver/hw/xfree86/xf86cfg/monitor-cfg.c b/xc/programs/Xserver/hw/xfree86/xf86cfg/monitor-cfg.c
index ddde6aace..7ab3e7f82 100644
--- a/xc/programs/Xserver/hw/xfree86/xf86cfg/monitor-cfg.c
+++ b/xc/programs/Xserver/hw/xfree86/xf86cfg/monitor-cfg.c
@@ -26,7 +26,7 @@
*
* Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
*
- * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/monitor-cfg.c,v 1.4 2000/11/30 20:55:18 paulo Exp $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/monitor-cfg.c,v 1.5 2001/01/31 20:52:19 paulo Exp $
*/
#include "xf86config.h"
@@ -275,6 +275,7 @@ string_to_parser_range(char *str, parser_range *range, int nrange)
range[i].lo = range[i].hi = val;
if (++i >= nrange || *str == '\0')
break;
+ continue;
}
else if (*str != '-')
return (0);
diff --git a/xc/programs/Xserver/hw/xfree86/xf86cfg/xf86cfg.cpp b/xc/programs/Xserver/hw/xfree86/xf86cfg/xf86cfg.man
index 97019cba0..103fc64d5 100644
--- a/xc/programs/Xserver/hw/xfree86/xf86cfg/xf86cfg.cpp
+++ b/xc/programs/Xserver/hw/xfree86/xf86cfg/xf86cfg.man
@@ -26,9 +26,9 @@
.\"
.\" Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
.\"
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/xf86cfg.cpp,v 1.1 2000/12/11 20:48:56 dawes Exp $
+.\" $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/xf86cfg.man,v 1.6 2001/01/27 18:20:59 dawes Exp $
.\"
-.TH xf86cfg 1 "Version 4.0.2" "XFree86"
+.TH xf86cfg 1 __vendorversion__
.SH NAME
xf86cfg - Graphical configuration tool for XFree86 4.0
.SH SYNOPSIS
diff --git a/xc/programs/Xserver/hw/xfree86/xf86config/xf86config.cpp b/xc/programs/Xserver/hw/xfree86/xf86config/xf86config.cpp
deleted file mode 100644
index 106ecc1d3..000000000
--- a/xc/programs/Xserver/hw/xfree86/xf86config/xf86config.cpp
+++ /dev/null
@@ -1,16 +0,0 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/xf86config/xf86config.cpp,v 1.1 2000/12/11 20:49:07 dawes Exp $
-.TH xf86config 1 "Version 4.0.2" "XFree86"
-.SH NAME
-xf86config \- generate an XF86Config file
-.SH SYNOPSIS
-.B xf86config
-.SH DESCRIPTION
-\fIxf86config\fP is an interactive program for generating an XF86Config file
-for use with XFree86 X servers.
-.SH FILES
-<xroot>/lib/X11/Cards Video cards database
-.SH "SEE ALSO"
-XFree86(1), XF86Config(__filemansuffix__), reconfig(1)
-.SH AUTHOR
-Harm Hanemaayer.
-.\" $TOG: xf86conf.man /main/9 1997/07/19 10:53:08 kaleb $
diff --git a/xc/programs/Xserver/hw/xwin/InitOutput.c b/xc/programs/Xserver/hw/xwin/InitOutput.c
index 46b5d07b0..61bb66d9b 100644
--- a/xc/programs/Xserver/hw/xwin/InitOutput.c
+++ b/xc/programs/Xserver/hw/xwin/InitOutput.c
@@ -22,7 +22,7 @@ other dealings in this Software without prior written authorization
from The Open Group.
*/
-/* $XFree86: xc/programs/Xserver/hw/xwin/InitOutput.c,v 1.2 2000/11/28 16:10:40 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/InitOutput.c,v 1.3 2001/02/13 19:19:17 dawes Exp $ */
#if defined(WIN32) && !defined(__CYGWIN__)
#include <X11/Xwinsock.h>
@@ -62,12 +62,28 @@ from The Open Group.
#include "dix.h"
#include "miline.h"
-extern char *display;
-extern void winfbBlockHandler ();
-extern int winfbWakeupHandler ();
+/*
+* modified 05/27/00 p. busch
+* peter.busch@dfki.de
+*
+* framebuffer is now mapped via the ntux_ddx library
+*/
+
+/*
+* added - pb
+*/
+
+/* implemented in ntux_xf.c */
+/* NOT REALLY NEEDED -- WORKS ONLY ON WINDOWS NT/2000, CAUSES PROBLEMS on WIN98/95/Me */
+//extern char * map_dx_fb( char *adr, unsigned long size );
+
-#define WIN_DEFAULT_WIDTH 1280
-#define WIN_DEFAULT_HEIGHT 1024
+
+
+extern char *display;
+
+#define WIN_DEFAULT_WIDTH 1024
+#define WIN_DEFAULT_HEIGHT 768
#define WIN_DEFAULT_DEPTH 16
#define WIN_DEFAULT_WHITEPIXEL 255
#define WIN_DEFAULT_BLACKPIXEL 0
@@ -76,32 +92,30 @@ extern int winfbWakeupHandler ();
typedef struct
{
- int scrnum;
- int width;
- int paddedWidth;
- int height;
- int depth;
- int bitsPerPixel;
- char *pfbMemory;
- XWDColor *pXWDCmap;
- XWDFileHeader *pXWDHeader;
- Pixel blackPixel;
- Pixel whitePixel;
- ScreenPtr pScreen ;
- unsigned int lineBias;
+ int scrnum;
+ int width;
+ int paddedWidth;
+ int height;
+ int depth;
+ int bitsPerPixel;
+ char *pfbMemory;
+ XWDColor *pXWDCmap;
+ XWDFileHeader *pXWDHeader;
+ Pixel blackPixel;
+ Pixel whitePixel;
+ ScreenPtr pScreen ;
+ unsigned int lineBias;
} winScreenInfo, *winScreenInfoPtr;
+static int winNumScreens;
+static winScreenInfo winScreens[MAXSCREENS];
+static Bool winPixmapDepths[33];
+static char *pfbdir = NULL;
typedef enum { NORMAL_MEMORY_FB, SHARED_MEMORY_FB, MMAPPED_FILE_FB } fbMemType;
-
-static int winNumScreens;
-static winScreenInfo winScreens[MAXSCREENS];
-static Bool winPixmapDepths[33];
-static char *pfbdir = NULL;
-static fbMemType fbmemtype = NORMAL_MEMORY_FB;
-static char needswap = 0;
-static int lastScreen = -1;
-static ColormapPtr InstalledMaps[MAXSCREENS];
+static fbMemType fbmemtype = NORMAL_MEMORY_FB;
+static char needswap = 0;
+static int lastScreen = -1;
#define swapcopy16(_dst, _src) \
if (needswap) { CARD16 _s = _src; cpswaps(_s, _dst); } \
@@ -111,129 +125,125 @@ static ColormapPtr InstalledMaps[MAXSCREENS];
if (needswap) { CARD32 _s = _src; cpswapl(_s, _dst); } \
else _dst = _src;
+
static void
winInitializePixmapDepths()
{
- int i;
- winPixmapDepths[1] = TRUE; /* always need bitmaps */
- for (i = 2; i <= 32; i++)
- winPixmapDepths[i] = FALSE;
+ int i;
+ winPixmapDepths[1] = TRUE; /* always need bitmaps */
+ for (i = 2; i <= 32; i++)
+ winPixmapDepths[i] = FALSE;
}
static Bool
winCreateDefColormap (ScreenPtr pScreen)
{
- int i;
- Pixel wp, bp;
- VisualPtr pVisual;
- ColormapPtr cmap;
- unsigned short zero = 0, ones = 0xFFFF;
-
- /*
- * these are the MS-Windows desktop colors, adjusted for X's 16-bit
- * color specifications.
- */
- static xColorItem citems[] = {
- { 0, 0, 0, 0, 0, 0 },
- { 1, 0x8000, 0, 0, 0, 0 },
- { 2, 0, 0x8000, 0, 0, 0 },
- { 3, 0x8000, 0x8000, 0, 0, 0 },
- { 4, 0, 0, 0x8000, 0, 0 },
- { 5, 0x8000, 0, 0x8000, 0, 0 },
- { 6, 0, 0x8000, 0x8000, 0, 0 },
- { 7, 0xc000, 0xc000, 0xc000, 0, 0 },
- { 8, 0xc000, 0xdc00, 0xc000, 0, 0 },
- { 9, 0xa600, 0xca00, 0xf000, 0, 0 },
- { 246, 0xff00, 0xfb00, 0xf000, 0, 0 },
- { 247, 0xa000, 0xa000, 0xa400, 0, 0 },
- { 248, 0x8000, 0x8000, 0x8000, 0, 0 },
- { 249, 0xff00, 0, 0, 0, 0 },
- { 250, 0, 0xff00, 0, 0, 0 },
- { 251, 0xff00, 0xff00, 0, 0, 0 },
- { 252, 0, 0, 0xff00, 0, 0 },
- { 253, 0xff00, 0, 0xff00, 0, 0 },
- { 254, 0, 0xff00, 0xff00, 0, 0 },
- { 255, 0xff00, 0xff00, 0xff00, 0, 0 }
- };
+ /*
+ * these are the MS-Windows desktop colors, adjusted for X's 16-bit
+ * color specifications.
+ */
+ static xColorItem citems[] = {
+ { 0, 0, 0, 0, 0, 0 },
+ { 1, 0x8000, 0, 0, 0, 0 },
+ { 2, 0, 0x8000, 0, 0, 0 },
+ { 3, 0x8000, 0x8000, 0, 0, 0 },
+ { 4, 0, 0, 0x8000, 0, 0 },
+ { 5, 0x8000, 0, 0x8000, 0, 0 },
+ { 6, 0, 0x8000, 0x8000, 0, 0 },
+ { 7, 0xc000, 0xc000, 0xc000, 0, 0 },
+ { 8, 0xc000, 0xdc00, 0xc000, 0, 0 },
+ { 9, 0xa600, 0xca00, 0xf000, 0, 0 },
+ { 246, 0xff00, 0xfb00, 0xf000, 0, 0 },
+ { 247, 0xa000, 0xa000, 0xa400, 0, 0 },
+ { 248, 0x8000, 0x8000, 0x8000, 0, 0 },
+ { 249, 0xff00, 0, 0, 0, 0 },
+ { 250, 0, 0xff00, 0, 0, 0 },
+ { 251, 0xff00, 0xff00, 0, 0, 0 },
+ { 252, 0, 0, 0xff00, 0, 0 },
+ { 253, 0xff00, 0, 0xff00, 0, 0 },
+ { 254, 0, 0xff00, 0xff00, 0, 0 },
+ { 255, 0xff00, 0xff00, 0xff00, 0, 0 }
+ };
#define NUM_DESKTOP_COLORS sizeof citems / sizeof citems[0]
-
- for (pVisual = pScreen->visuals;
- pVisual->vid != pScreen->rootVisual;
- pVisual++);
-
- if (CreateColormap (pScreen->defColormap, pScreen, pVisual, &cmap,
- (pVisual->class & DynamicClass) ? AllocNone : AllocAll,
- 0)
- != Success)
- return FALSE;
- if (pVisual->class == PseudoColor)
- {
- for (i = 0; i < NUM_DESKTOP_COLORS; i++)
- {
- if (AllocColor (cmap,
- &citems[i].red,
- &citems[i].green,
- &citems[i].blue,
- &citems[i].pixel,
- 0) != Success)
- return FALSE;
- }
- pScreen->whitePixel = 255;
- pScreen->blackPixel = 0;
- }
- else
- {
- if ((AllocColor (cmap, &ones, &ones, &ones, &wp, 0)
- != Success)
- || (AllocColor (cmap, &zero, &zero, &zero, &bp, 0)
- != Success))
- return FALSE;
- pScreen->whitePixel = wp;
- pScreen->blackPixel = bp;
- }
- (*pScreen->InstallColormap)(cmap);
- return TRUE;
+ int i;
+ Pixel wp, bp;
+ VisualPtr pVisual;
+ ColormapPtr cmap;
+ unsigned short zero = 0, ones = 0xFFFF;
+
+ for (pVisual = pScreen->visuals;
+ pVisual->vid != pScreen->rootVisual;
+ pVisual++)
+ ;
+
+ if (CreateColormap(pScreen->defColormap, pScreen, pVisual, &cmap,
+ (pVisual->class & DynamicClass) ? AllocNone : AllocAll,
+ 0)
+ != Success)
+ return FALSE;
+ if (pVisual->class == PseudoColor)
+ {
+ for (i = 0; i < NUM_DESKTOP_COLORS; i++) {
+ if (AllocColor (cmap,
+ &citems[i].red, &citems[i].green, &citems[i].blue,
+ &citems[i].pixel, 0) != Success)
+ return FALSE;
+ }
+ pScreen->whitePixel = 255 ;
+ pScreen->blackPixel = 0 ;
+ } else {
+ if ((AllocColor(cmap, &ones, &ones, &ones, &wp, 0) !=
+ Success) ||
+ (AllocColor(cmap, &zero, &zero, &zero, &bp, 0) !=
+ Success))
+ return FALSE;
+ pScreen->whitePixel = wp;
+ pScreen->blackPixel = bp;
+ }
+ (*pScreen->InstallColormap)(cmap);
+ return TRUE;
}
static void
winInitializeDefaultScreens()
{
- int i;
+ int i;
- for (i = 0; i < MAXSCREENS; i++)
+ for (i = 0; i < MAXSCREENS; i++)
{
- winScreens[i].scrnum = i;
- winScreens[i].width = WIN_DEFAULT_WIDTH;
- winScreens[i].height = WIN_DEFAULT_HEIGHT;
- winScreens[i].depth = WIN_DEFAULT_DEPTH;
- winScreens[i].blackPixel = WIN_DEFAULT_BLACKPIXEL;
- winScreens[i].whitePixel = WIN_DEFAULT_WHITEPIXEL;
- winScreens[i].lineBias = WIN_DEFAULT_LINEBIAS;
- winScreens[i].pfbMemory = NULL;
+ winScreens[i].scrnum = i;
+ winScreens[i].width = WIN_DEFAULT_WIDTH;
+ winScreens[i].height = WIN_DEFAULT_HEIGHT;
+ winScreens[i].depth = WIN_DEFAULT_DEPTH;
+ winScreens[i].blackPixel = WIN_DEFAULT_BLACKPIXEL;
+ winScreens[i].whitePixel = WIN_DEFAULT_WHITEPIXEL;
+ winScreens[i].lineBias = WIN_DEFAULT_LINEBIAS;
+ winScreens[i].pfbMemory = NULL;
}
- winNumScreens = 1;
+ winNumScreens = 1;
}
static int
-winBitsPerPixel (int depth)
+winBitsPerPixel(depth)
+ int depth;
{
- if (depth == 1) return 1;
- else if (depth <= 8) return 8;
- else if (depth <= 16) return 16;
- else if (depth <= 24) return 24;
- else return 32;
+ if (depth == 1) return 1;
+ else if (depth <= 8) return 8;
+ else if (depth <= 16) return 16;
+ else if (depth <= 24) return 24;
+ else return 32;
}
void
ddxGiveUp()
{
- return;
+ return ;
}
void
AbortDDX()
{
- ddxGiveUp();
+ ddxGiveUp();
}
void
@@ -244,152 +254,157 @@ OsVendorInit()
void
ddxUseMsg()
{
- ErrorF("-screen scrn WxHxD set screen's width, height, bit depth\n");
- ErrorF("-pixdepths list-of-int support given pixmap depths\n");
- ErrorF("-linebias n adjust thin line pixelization\n");
- ErrorF("-blackpixel n pixel value for black\n");
- ErrorF("-whitepixel n pixel value for white\n");
+ ErrorF("-screen scrn WxHxD set screen's width, height, depth\n");
+ ErrorF("-pixdepths list-of-int support given pixmap depths\n");
+ ErrorF("-linebias n adjust thin line pixelization\n");
+ ErrorF("-blackpixel n pixel value for black\n");
+ ErrorF("-whitepixel n pixel value for white\n");
}
int
-ddxProcessArgument (int argc, char *argv[], int i)
+ddxProcessArgument (argc, argv, i)
+ int argc;
+ char *argv[];
+ int i;
{
- static Bool firstTime = TRUE;
+ static Bool firstTime = TRUE;
- if (firstTime)
+ if (firstTime)
{
- winInitializeDefaultScreens();
- winInitializePixmapDepths();
- firstTime = FALSE;
+ winInitializeDefaultScreens();
+ winInitializePixmapDepths();
+ firstTime = FALSE;
}
- if (strcmp (argv[i], "-screen") == 0) /* -screen n WxHxD */
+ if (strcmp (argv[i], "-screen") == 0) /* -screen n WxHxD */
{
- int screenNum;
- if (i + 2 >= argc) UseMsg();
- screenNum = atoi(argv[i+1]);
- if (screenNum < 0 || screenNum >= MAXSCREENS)
- {
- ErrorF("Invalid screen number %d\n", screenNum);
- UseMsg();
- }
- if (3 != sscanf(argv[i+2], "%dx%dx%d",
- &winScreens[screenNum].width,
- &winScreens[screenNum].height,
- &winScreens[screenNum].depth))
- {
- ErrorF("Invalid screen configuration %s\n", argv[i+2]);
- UseMsg();
- }
-
- if (screenNum >= winNumScreens)
- winNumScreens = screenNum + 1;
- lastScreen = screenNum;
- return 3;
+ int screenNum;
+ if (i + 2 >= argc) UseMsg();
+ screenNum = atoi(argv[i+1]);
+ if (screenNum < 0 || screenNum >= MAXSCREENS)
+ {
+ ErrorF("Invalid screen number %d\n", screenNum);
+ UseMsg();
+ }
+ if (3 != sscanf(argv[i+2], "%dx%dx%d",
+ &winScreens[screenNum].width,
+ &winScreens[screenNum].height,
+ &winScreens[screenNum].depth))
+ {
+ ErrorF("Invalid screen configuration %s\n", argv[i+2]);
+ UseMsg();
+ }
+
+ if (screenNum >= winNumScreens)
+ winNumScreens = screenNum + 1;
+ lastScreen = screenNum;
+ return 3;
}
- if (strcmp (argv[i], "-pixdepths") == 0) /* -pixdepths list-of-depth */
+ if (strcmp (argv[i], "-pixdepths") == 0) /* -pixdepths list-of-depth */
{
- int depth, ret = 1;
-
- if (++i >= argc) UseMsg();
- while ((i < argc) && (depth = atoi(argv[i++])) != 0)
- {
- if (depth < 0 || depth > 32)
- {
- ErrorF("Invalid pixmap depth %d\n", depth);
- UseMsg();
- }
- winPixmapDepths[depth] = TRUE;
- ret++;
- }
- return ret;
+ int depth, ret = 1;
+
+ if (++i >= argc) UseMsg();
+ while ((i < argc) && (depth = atoi(argv[i++])) != 0)
+ {
+ if (depth < 0 || depth > 32)
+ {
+ ErrorF("Invalid pixmap depth %d\n", depth);
+ UseMsg();
+ }
+ winPixmapDepths[depth] = TRUE;
+ ret++;
+ }
+ return ret;
}
- if (strcmp (argv[i], "-blackpixel") == 0) /* -blackpixel n */
+ if (strcmp (argv[i], "-blackpixel") == 0) /* -blackpixel n */
{
- Pixel pix;
- if (++i >= argc) UseMsg();
- pix = atoi(argv[i]);
- if (-1 == lastScreen)
- {
- int i;
- for (i = 0; i < MAXSCREENS; i++)
- {
- winScreens[i].blackPixel = pix;
- }
- }
- else
- {
- winScreens[lastScreen].blackPixel = pix;
- }
- return 2;
+ Pixel pix;
+ if (++i >= argc) UseMsg();
+ pix = atoi(argv[i]);
+ if (-1 == lastScreen)
+ {
+ int i;
+ for (i = 0; i < MAXSCREENS; i++)
+ {
+ winScreens[i].blackPixel = pix;
+ }
+ }
+ else
+ {
+ winScreens[lastScreen].blackPixel = pix;
+ }
+ return 2;
}
- if (strcmp (argv[i], "-whitepixel") == 0) /* -whitepixel n */
+ if (strcmp (argv[i], "-whitepixel") == 0) /* -whitepixel n */
{
- Pixel pix;
- if (++i >= argc) UseMsg();
- pix = atoi(argv[i]);
- if (-1 == lastScreen)
- {
- int i;
- for (i = 0; i < MAXSCREENS; i++)
- {
- winScreens[i].whitePixel = pix;
- }
- }
- else
- {
- winScreens[lastScreen].whitePixel = pix;
- }
- return 2;
+ Pixel pix;
+ if (++i >= argc) UseMsg();
+ pix = atoi(argv[i]);
+ if (-1 == lastScreen)
+ {
+ int i;
+ for (i = 0; i < MAXSCREENS; i++)
+ {
+ winScreens[i].whitePixel = pix;
+ }
+ }
+ else
+ {
+ winScreens[lastScreen].whitePixel = pix;
+ }
+ return 2;
}
- if (strcmp (argv[i], "-linebias") == 0) /* -linebias n */
+ if (strcmp (argv[i], "-linebias") == 0) /* -linebias n */
{
- unsigned int linebias;
- if (++i >= argc) UseMsg();
- linebias = atoi(argv[i]);
- if (-1 == lastScreen)
- {
- int i;
- for (i = 0; i < MAXSCREENS; i++)
- {
- winScreens[i].lineBias = linebias;
- }
- }
- else
- {
- winScreens[lastScreen].lineBias = linebias;
- }
- return 2;
+ unsigned int linebias;
+ if (++i >= argc) UseMsg();
+ linebias = atoi(argv[i]);
+ if (-1 == lastScreen)
+ {
+ int i;
+ for (i = 0; i < MAXSCREENS; i++)
+ {
+ winScreens[i].lineBias = linebias;
+ }
+ }
+ else
+ {
+ winScreens[lastScreen].lineBias = linebias;
+ }
+ return 2;
}
- if (strcmp (argv[i], "-probe") == 0) /* -linebias n */
+ if (strcmp (argv[i], "-probe") == 0) /* -linebias n */
{
- ListModes ();
- return 1;
- }
+ ListModes () ;
+ return 1 ;
+ }
- return 0;
+ return 0;
}
#ifdef DDXTIME /* from ServerOSDefines */
CARD32
GetTimeInMillis()
{
- struct timeval tp;
+ struct timeval tp;
- X_GETTIMEOFDAY(&tp);
- return(tp.tv_sec * 1000) + (tp.tv_usec / 1000);
+ X_GETTIMEOFDAY(&tp);
+ return(tp.tv_sec * 1000) + (tp.tv_usec / 1000);
}
#endif
+
static Bool
-winMultiDepthCreateGC (GCPtr pGC)
+winMultiDepthCreateGC(pGC)
+ GCPtr pGC;
{
- switch (winBitsPerPixel(pGC->depth))
+ switch (winBitsPerPixel(pGC->depth))
{
case 1: return mfbCreateGC (pGC);
case 8: return cfbCreateGC (pGC);
@@ -401,59 +416,68 @@ winMultiDepthCreateGC (GCPtr pGC)
}
static void
-winMultiDepthGetSpans (DrawablePtr pDrawable, int wMax,
- register DDXPointPtr ppt,
- int *pwidth, int nspans, char *pdstStart)
+winMultiDepthGetSpans(pDrawable, wMax, ppt, pwidth, nspans, pdstStart)
+ DrawablePtr pDrawable; /* drawable from which to get bits */
+ int wMax; /* largest value of all *pwidths */
+ register DDXPointPtr ppt; /* points to start copying from */
+ int *pwidth; /* list of number of bits to copy */
+ int nspans; /* number of scanlines to copy */
+ char *pdstStart; /* where to put the bits */
{
- switch (pDrawable->bitsPerPixel)
- {
+ switch (pDrawable->bitsPerPixel) {
case 1:
- mfbGetSpans (pDrawable, wMax, ppt, pwidth, nspans, pdstStart);
- break;
+ mfbGetSpans(pDrawable, wMax, ppt, pwidth, nspans, pdstStart);
+ break;
case 8:
- cfbGetSpans (pDrawable, wMax, ppt, pwidth, nspans, pdstStart);
- break;
+ cfbGetSpans(pDrawable, wMax, ppt, pwidth, nspans, pdstStart);
+ break;
case 16:
- cfb16GetSpans (pDrawable, wMax, ppt, pwidth, nspans, pdstStart);
- break;
+ cfb16GetSpans(pDrawable, wMax, ppt, pwidth, nspans, pdstStart);
+ break;
case 24:
- cfb24GetSpans (pDrawable, wMax, ppt, pwidth, nspans, pdstStart);
- break;
+ cfb24GetSpans(pDrawable, wMax, ppt, pwidth, nspans, pdstStart);
+ break;
case 32:
- cfb32GetSpans (pDrawable, wMax, ppt, pwidth, nspans, pdstStart);
- break;
+ cfb32GetSpans(pDrawable, wMax, ppt, pwidth, nspans, pdstStart);
+ break;
}
- return;
+ return;
}
static void
-winMultiDepthGetImage (DrawablePtr pDrawable, int sx, int sy,
- int w, int h, unsigned int format,
- unsigned long planeMask,
- char *pdstLine)
+winMultiDepthGetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine)
+ DrawablePtr pDrawable;
+ int sx, sy, w, h;
+ unsigned int format;
+ unsigned long planeMask;
+ char *pdstLine;
{
- switch (pDrawable->bitsPerPixel)
+ switch (pDrawable->bitsPerPixel)
{
case 1:
- mfbGetImage (pDrawable, sx, sy, w, h, format, planeMask, pdstLine);
- break;
+ mfbGetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine);
+ break;
case 8:
- cfbGetImage (pDrawable, sx, sy, w, h, format, planeMask, pdstLine);
- break;
+ cfbGetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine);
+ break;
case 16:
- cfb16GetImage (pDrawable, sx, sy, w, h, format, planeMask, pdstLine);
- break;
+ cfb16GetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine);
+ break;
case 24:
- cfb24GetImage (pDrawable, sx, sy, w, h, format, planeMask, pdstLine);
- break;
+ cfb24GetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine);
+ break;
case 32:
- cfb32GetImage (pDrawable, sx, sy, w, h, format, planeMask, pdstLine);
- break;
+ cfb32GetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine);
+ break;
}
}
+static ColormapPtr InstalledMaps[MAXSCREENS];
+
static int
-winListInstalledColormaps (ScreenPtr pScreen, Colormap *pmaps)
+winListInstalledColormaps(pScreen, pmaps)
+ ScreenPtr pScreen;
+ Colormap *pmaps;
{
/* By the time we are processing requests, we can guarantee that there
* is always a colormap installed */
@@ -461,320 +485,328 @@ winListInstalledColormaps (ScreenPtr pScreen, Colormap *pmaps)
return (1);
}
+
static void
-winInstallColormap (ColormapPtr pmap)
+winInstallColormap(pmap)
+ ColormapPtr pmap;
{
- int index = pmap->pScreen->myNum;
- ColormapPtr oldpmap = InstalledMaps[index];
- int entries;
- VisualPtr pVisual;
- Pixel *ppix;
- xrgb *prgb;
- xColorItem *defs;
- int i;
-
- if (pmap != oldpmap)
+ int index = pmap->pScreen->myNum;
+ ColormapPtr oldpmap = InstalledMaps[index];
+
+ if (pmap != oldpmap)
{
- if(oldpmap != (ColormapPtr)None)
- {
- WalkTree (pmap->pScreen, TellLostMap, (char *)&oldpmap->mid);
- }
-
- /* Install pmap */
- InstalledMaps[index] = pmap;
- WalkTree (pmap->pScreen, TellGainedMap, (char *)&pmap->mid);
-
- entries = pmap->pVisual->ColormapEntries;
- pVisual = pmap->pVisual;
-
- ppix = (Pixel *)ALLOCATE_LOCAL(entries * sizeof(Pixel));
- prgb = (xrgb *)ALLOCATE_LOCAL(entries * sizeof(xrgb));
- defs = (xColorItem *)ALLOCATE_LOCAL(entries * sizeof(xColorItem));
-
- for (i = 0; i < entries; i++)
- {
- ppix[i] = i;
- }
-
- /* XXX truecolor */
- QueryColors(pmap, entries, ppix, prgb);
-
- /* convert xrgbs to xColorItems */
- for (i = 0; i < entries; i++)
- {
- defs[i].pixel = ppix[i] & 0xff; /* change pixel to index */
- defs[i].red = prgb[i].red;
- defs[i].green = prgb[i].green;
- defs[i].blue = prgb[i].blue;
- defs[i].flags = DoRed|DoGreen|DoBlue;
- }
- (*pmap->pScreen->StoreColors)(pmap, entries, defs);
-
- DEALLOCATE_LOCAL(ppix);
- DEALLOCATE_LOCAL(prgb);
- DEALLOCATE_LOCAL(defs);
+ int entries;
+ VisualPtr pVisual;
+ Pixel * ppix;
+ xrgb * prgb;
+ xColorItem *defs;
+ int i;
+
+ if(oldpmap != (ColormapPtr)None)
+ WalkTree(pmap->pScreen, TellLostMap, (char *)&oldpmap->mid);
+ /* Install pmap */
+ InstalledMaps[index] = pmap;
+ WalkTree(pmap->pScreen, TellGainedMap, (char *)&pmap->mid);
+
+ entries = pmap->pVisual->ColormapEntries;
+ pVisual = pmap->pVisual;
+
+ ppix = (Pixel *)ALLOCATE_LOCAL(entries * sizeof(Pixel));
+ prgb = (xrgb *)ALLOCATE_LOCAL(entries * sizeof(xrgb));
+ defs = (xColorItem *)ALLOCATE_LOCAL(entries * sizeof(xColorItem));
+
+ for (i = 0; i < entries; i++) ppix[i] = i;
+ /* XXX truecolor */
+ QueryColors(pmap, entries, ppix, prgb);
+
+ for (i = 0; i < entries; i++) { /* convert xrgbs to xColorItems */
+ defs[i].pixel = ppix[i] & 0xff; /* change pixel to index */
+ defs[i].red = prgb[i].red;
+ defs[i].green = prgb[i].green;
+ defs[i].blue = prgb[i].blue;
+ defs[i].flags = DoRed|DoGreen|DoBlue;
+ }
+ (*pmap->pScreen->StoreColors)(pmap, entries, defs);
+
+ DEALLOCATE_LOCAL(ppix);
+ DEALLOCATE_LOCAL(prgb);
+ DEALLOCATE_LOCAL(defs);
}
}
static void
-winUninstallColormap (ColormapPtr pmap)
+winUninstallColormap(pmap)
+ ColormapPtr pmap;
{
- ColormapPtr curpmap = InstalledMaps[pmap->pScreen->myNum];
+ ColormapPtr curpmap = InstalledMaps[pmap->pScreen->myNum];
- if (pmap == curpmap)
+ if(pmap == curpmap)
{
- if (pmap->mid != pmap->pScreen->defColormap)
- {
- curpmap = (ColormapPtr) LookupIDByType(pmap->pScreen->defColormap,
- RT_COLORMAP);
- (*pmap->pScreen->InstallColormap)(curpmap);
- }
+ if (pmap->mid != pmap->pScreen->defColormap)
+ {
+ curpmap = (ColormapPtr) LookupIDByType(pmap->pScreen->defColormap,
+ RT_COLORMAP);
+ (*pmap->pScreen->InstallColormap)(curpmap);
+ }
}
}
static void
-winStoreColors (ColormapPtr pmap, int ndef, xColorItem *pdefs)
+winStoreColors(pmap, ndef, pdefs)
+ ColormapPtr pmap;
+ int ndef;
+ xColorItem *pdefs;
{
- int i;
+ int i;
- if (pmap != InstalledMaps[pmap->pScreen->myNum]) return;
+ if (pmap != InstalledMaps[pmap->pScreen->myNum]) return;
- if ((pmap->pVisual->class | DynamicClass) == DirectColor)
- return;
+ if ((pmap->pVisual->class | DynamicClass) == DirectColor)
+ return;
- // TrueColor or Pseudo Color
- if (pmap->pVisual->class == PseudoColor)
- {
- for (i = 0; i < ndef; i++, pdefs++)
- {
- DXStoreColors (pdefs->pixel,
- pdefs->red,
- pdefs->green,
- pdefs->blue);
- }
- }
+ // TrueColor or Pseudo Color
+ if (pmap->pVisual->class == PseudoColor)
+ for (i = 0; i < ndef; i++, pdefs++)
+ DXStoreColors (pdefs->pixel, pdefs->red, pdefs->green, pdefs->blue) ;
}
static Bool
-winSaveScreen (ScreenPtr pScreen, int on)
+winSaveScreen(pScreen, on)
+ ScreenPtr pScreen;
+ int on;
{
return TRUE;
}
static char *
-winAllocateFramebufferMemory (winScreenInfoPtr pwin)
+winAllocateFramebufferMemory(pwin)
+ winScreenInfoPtr pwin;
{
- pwin->pfbMemory = winDXAllocateFramebufferMemory (&pwin->width,
- &pwin->height,
- &pwin->depth,
- &pwin->paddedWidth);
- return pwin->pfbMemory;
+ unsigned long size;
+ char *ntux_ddx_fb = NULL;
+
+
+ pwin->pfbMemory = winDXAllocateFramebufferMemory (&pwin->width,
+ &pwin->height, &pwin->depth, &pwin->paddedWidth);
+
+
+ size = pwin->width * pwin->height * ((pwin->depth + 7)/8);
+ /*
+ ntux_ddx_fb = map_dx_fb( pwin->pfbMemory, size );
+
+ if( ntux_ddx_fb )
+ {
+ pwin->pfbMemory = ntux_ddx_fb;
+ return ntux_ddx_fb;
+ }
+ */
+ return pwin->pfbMemory ;
}
static Bool
-winCursorOffScreen (ScreenPtr *ppScreen, int *x, int *y)
+winCursorOffScreen (ppScreen, x, y)
+ ScreenPtr *ppScreen;
+ int *x, *y;
{
- return FALSE;
+ return FALSE;
}
static void
-winCrossScreen (ScreenPtr pScreen, Bool entering)
+winCrossScreen (pScreen, entering)
+ ScreenPtr pScreen;
+ Bool entering;
{
}
static miPointerScreenFuncRec winPointerCursorFuncs =
{
- winCursorOffScreen,
- winCrossScreen,
- miPointerWarpCursor
+ winCursorOffScreen,
+ winCrossScreen,
+ miPointerWarpCursor
};
Bool miCreateScreenResources (ScreenPtr pScreen) ;
static Bool
-winScreenInit (int index, ScreenPtr pScreen, int argc, char *argv[])
+winScreenInit(index, pScreen, argc, argv)
+ int index;
+ ScreenPtr pScreen;
+
+
+ int argc;
+ char ** argv;
{
- winScreenInfoPtr pwin = &winScreens[index];
- PictFormatPtr formats = NULL;
- int nformats = 0;
- int dpix = 100, dpiy = 100;
- int ret = FALSE;
- char *pbits;
- BOOL fResult = FALSE;
- unsigned long stack_ptr;
+ winScreenInfoPtr pwin = &winScreens[index];
+ int dpix = 100, dpiy = 100;
+ int ret = FALSE;
+ char *pbits;
+ unsigned long stack_ptr;
- /* Initial display parameters */
- pwin->paddedWidth = PixmapBytePad(pwin->width, pwin->depth);
- pwin->bitsPerPixel = winBitsPerPixel(pwin->depth);
+ pwin->paddedWidth = PixmapBytePad(pwin->width, pwin->depth);
+ pwin->bitsPerPixel = winBitsPerPixel(pwin->depth);
- pbits = winAllocateFramebufferMemory (pwin);
+ fprintf( stderr, "pwin->width = %08x\n", pwin->width );
+ fprintf( stderr, "pwin->height = %08x\n", pwin->height );
+ fprintf( stderr, "pwin->paddedWidth = %08x\n", pwin->paddedWidth );
+ fprintf( stderr, "pwin->bitsPerPixel = %08x\n", pwin->bitsPerPixel );
- if (!pbits) return FALSE;
+ fprintf( stderr, "calling winAllocateFramebufferMemory\n" );
- fprintf (stderr, "Obtained Width: %d, Height: %d, Depth: %d\n",
- pwin->width, pwin->height, pwin->bitsPerPixel);
+
+ pbits = winAllocateFramebufferMemory( pwin );
- switch (pwin->bitsPerPixel)
+ if (!pbits)
+ return FALSE;
+
+
+ switch (pwin->bitsPerPixel)
{
case 1:
- ret = mfbScreenInit (pScreen, pbits, pwin->width, pwin->height,
- dpix, dpiy, pwin->paddedWidth * 8);
- break;
+ ret = mfbScreenInit(pScreen, pbits, pwin->width, pwin->height,
+ dpix, dpiy, pwin->paddedWidth * 8);
+ break;
case 8:
- fprintf( stderr, "Calling cfbScreenInit (%08x, %08x, %d, %d, %d, %d, %d)\n",
- pScreen, pbits, pwin->width, pwin->height,
- dpix, dpiy, pwin->paddedWidth);
+ fprintf( stderr, "calling cfbScreenInit( %08x, %08x, %08x, %08x, %08x, %08x, %08x )\n",
+ pScreen, pbits, pwin->width, pwin->height,
+ dpix, dpiy, pwin->paddedWidth);
- ret = cfbScreenInit (pScreen, pbits, pwin->width, pwin->height,
- dpix, dpiy, pwin->paddedWidth);
- break;
+ ret = cfbScreenInit(pScreen, pbits, pwin->width, pwin->height,
+ dpix, dpiy, pwin->paddedWidth);
+ break;
case 16:
- fprintf( stderr, "Calling cfb16ScreenInit (%08x, %08x, %d, %d, %d, %d, %d)\n",
- pScreen, pbits, pwin->width, pwin->height,
- dpix, dpiy, pwin->paddedWidth);
- ret = cfb16ScreenInit (pScreen, pbits, pwin->width, pwin->height,
- dpix, dpiy, pwin->paddedWidth);
- break;
+ fprintf( stderr, "calling cfb16ScreenInit( %08x, %08x, %08x, %08x, %08x, %08x, %08x )\n",
+ pScreen, pbits, pwin->width, pwin->height,
+ dpix, dpiy, pwin->paddedWidth);
+ ret = cfb16ScreenInit(pScreen, pbits, pwin->width, pwin->height,
+ dpix, dpiy, pwin->paddedWidth);
+
+ break;
case 24:
- fprintf( stderr, "Calling cfb24ScreenInit (%08x, %08x, %d, %d, %d, %d, %d)\n",
- pScreen, pbits, pwin->width, pwin->height,
- dpix, dpiy, pwin->paddedWidth);
- ret = cfb24ScreenInit (pScreen, pbits, pwin->width, pwin->height,
- dpix, dpiy, pwin->paddedWidth);
- break;
+ fprintf( stderr, "calling cfb24ScreenInit( %08x, %08x, %08x, %08x, %08x, %08x, %08x )\n",
+ pScreen, pbits, pwin->width, pwin->height,
+ dpix, dpiy, pwin->paddedWidth);
+ ret = cfb24ScreenInit(pScreen, pbits, pwin->width, pwin->height,
+ dpix, dpiy, pwin->paddedWidth);
+ break;
case 32:
- fprintf( stderr, "Calling cfb32ScreenInit (%08x, %08x, %d, %d, %d, %d, %d)\n",
- pScreen, pbits, pwin->width, pwin->height,
- dpix, dpiy, pwin->paddedWidth);
+ fprintf( stderr, "calling cfb32ScreenInit( %08x, %08x, %08x, %08x, %08x, %08x, %08x )\n",
+ pScreen, pbits, pwin->width, pwin->height,
+ dpix, dpiy, pwin->paddedWidth);
- ret = cfb32ScreenInit (pScreen, pbits, pwin->width, pwin->height,
- dpix, dpiy, pwin->paddedWidth);
- break;
+ ret = cfb32ScreenInit(pScreen, pbits, pwin->width, pwin->height,
+ dpix, dpiy, pwin->paddedWidth);
+ break;
default:
- return FALSE;
+ return FALSE;
}
- if (!ret) return FALSE;
+ if (!ret) return FALSE;
- pScreen->CreateGC = winMultiDepthCreateGC;
- pScreen->GetImage = winMultiDepthGetImage;
- pScreen->GetSpans = winMultiDepthGetSpans;
+ pScreen->CreateGC = winMultiDepthCreateGC;
+ pScreen->GetImage = winMultiDepthGetImage;
+ pScreen->GetSpans = winMultiDepthGetSpans;
- pScreen->InstallColormap = winInstallColormap;
- pScreen->UninstallColormap = winUninstallColormap;
- pScreen->ListInstalledColormaps = winListInstalledColormaps;
+ pScreen->InstallColormap = winInstallColormap;
+ pScreen->UninstallColormap = winUninstallColormap;
+ pScreen->ListInstalledColormaps = winListInstalledColormaps;
- pScreen->SaveScreen = winSaveScreen;
- pScreen->StoreColors = winStoreColors;
+ pScreen->SaveScreen = winSaveScreen;
+ pScreen->StoreColors = winStoreColors;
- miPictureInit(pScreen, formats, nformats);
- miDCInitialize (pScreen, &winPointerCursorFuncs);
+ miDCInitialize(pScreen, &winPointerCursorFuncs);
- pScreen->blackPixel = pwin->blackPixel;
- pScreen->whitePixel = pwin->whitePixel;
+ pScreen->blackPixel = pwin->blackPixel;
+ pScreen->whitePixel = pwin->whitePixel;
- if (pwin->bitsPerPixel == 1)
+ if (pwin->bitsPerPixel == 1)
{
- ret = mfbCreateDefColormap (pScreen);
+ ret = mfbCreateDefColormap(pScreen);
}
- else
+ else
{
- ret = winCreateDefColormap (pScreen);
+ ret = winCreateDefColormap(pScreen);
}
- miSetZeroLineBias (pScreen, pwin->lineBias);
+ miSetZeroLineBias(pScreen, pwin->lineBias);
- if (ret)
- {
- RegisterBlockAndWakeupHandlers (winfbBlockHandler,
- winfbWakeupHandler,
- NULL);
- }
- pwin->pScreen = pScreen ;
- ErrorF ("Successful addition of Screen %p %p\n",
- pScreen->devPrivate,
- pScreen);
- return ret;
-
-}
+ if (ret)
+ {
+ extern winfbBlockHandler (), winfbWakeupHandler () ;
-void
-InitOutput (ScreenInfo *screenInfo, int argc, char *argv[])
-{
- int i;
- int iNumFormats = 0;
- int *piDepth = 0, *piWidth = 0, *piHeight = 0;
- FILE *pf = stderr;
+ RegisterBlockAndWakeupHandlers (winfbBlockHandler, winfbWakeupHandler, NULL) ;
+ }
+ pwin->pScreen = pScreen ;
+ ErrorF ("Successful addition of Screen %p %p\n", pScreen->devPrivate, pScreen) ;
+ return ret;
- /* Initialize pixmap formats */
+} /* end winScreenInit */
- /* cfbLoad() ;*/
- /* Adjust bit depth for all screens */
- for (i = 0; i < winNumScreens; i++)
- {
- piWidth = &winScreens[i].width;
- piHeight = &winScreens[i].height;
- piDepth = &winScreens[i].depth;
+void
+InitOutput(screenInfo, argc, argv)
+ ScreenInfo *screenInfo;
+ int argc;
+ char **argv;
+{
+ int i;
+ int NumFormats = 0;
+ FILE *pf = stderr;
- fprintf (stderr, "Desired Width: %d, Height: %d, Depth: %d\n",
- *piWidth, *piHeight, *piDepth);
- /* Adjust bit depth and display size for hardware requirements */
- AdjustVideoMode (piWidth, piHeight, piDepth, TRUE);
- fprintf (stderr, "Adjusted Width: %d, Height: %d, Depth: %d\n",
- *piWidth, *piHeight, *piDepth);
- }
+ /* initialize pixmap formats */
- /* must have a pixmap depth to match every screen depth */
- for (i = 0; i < winNumScreens; i++)
+/* cfbLoad() ;*/
+ /* must have a pixmap depth to match every screen depth */
+ for (i = 0; i < winNumScreens; i++)
{
- winPixmapDepths[winScreens[i].depth] = TRUE;
+ winPixmapDepths[winScreens[i].depth] = TRUE;
}
- for (i = 1; i <= 32; i++)
+ for (i = 1; i <= 32; i++)
{
- if (winPixmapDepths[i])
+ if (winPixmapDepths[i])
{
- if (iNumFormats >= MAXFORMATS)
- FatalError ("MAXFORMATS is too small for this server\n");
- screenInfo->formats[iNumFormats].depth = i;
- screenInfo->formats[iNumFormats].bitsPerPixel = winBitsPerPixel(i);
- screenInfo->formats[iNumFormats].scanlinePad = BITMAP_SCANLINE_PAD;
- iNumFormats++;
+ if (NumFormats >= MAXFORMATS)
+ FatalError ("MAXFORMATS is too small for this server\n");
+ screenInfo->formats[NumFormats].depth = i;
+ screenInfo->formats[NumFormats].bitsPerPixel = winBitsPerPixel(i);
+ screenInfo->formats[NumFormats].scanlinePad = BITMAP_SCANLINE_PAD;
+ NumFormats++;
}
}
- screenInfo->imageByteOrder = IMAGE_BYTE_ORDER;
- screenInfo->bitmapScanlineUnit = BITMAP_SCANLINE_UNIT;
- screenInfo->bitmapScanlinePad = BITMAP_SCANLINE_PAD;
- screenInfo->bitmapBitOrder = BITMAP_BIT_ORDER;
- screenInfo->numPixmapFormats = iNumFormats;
+ screenInfo->imageByteOrder = IMAGE_BYTE_ORDER;
+ screenInfo->bitmapScanlineUnit = BITMAP_SCANLINE_UNIT;
+ screenInfo->bitmapScanlinePad = BITMAP_SCANLINE_PAD;
+ screenInfo->bitmapBitOrder = BITMAP_BIT_ORDER;
+ screenInfo->numPixmapFormats = NumFormats;
- /* initialize screens */
- for (i = 0; i < winNumScreens; i++)
+ /* initialize screens */
+
+ for (i = 0; i < winNumScreens; i++)
{
- if (-1 == AddScreen (winScreenInit, argc, argv))
+ if (-1 == AddScreen(winScreenInit, argc, argv))
{
- FatalError ("Couldn't add screen %d", i);
+ FatalError("Couldn't add screen %d", i);
}
}
-}
+
+} /* end InitOutput */
void
SwitchFramebuffer (pointer pbits)
{
- PixmapPtr pmap;
- ScreenPtr s = winScreens[0].pScreen;
-
- pmap = ((PixmapPtr) (s)->devPrivate);
- /*
- if (winScreens[0].depth == 8)
- pmap = ((PixmapPtr) (s)->devPrivate);
- else
- pmap = ((PixmapPtr) (s)->devPrivates[0].ptr);
- */
- /*ErrorF ("Switch: %p, %p\n", winScreens[0].pScreen, pmap);*/
- pmap->devPrivate.ptr = pbits;
+ PixmapPtr pmap ;
+ ScreenPtr s = winScreens[0].pScreen ;
+
+ pmap = ((PixmapPtr) (s)->devPrivate) ;
+ /*
+ if (winScreens[0].depth == 8)
+ pmap = ((PixmapPtr) (s)->devPrivate) ;
+ else
+ pmap = ((PixmapPtr) (s)->devPrivates[0].ptr) ;
+ */
+ ErrorF ("Switch: %p, %p\n", winScreens[0].pScreen, pmap) ;
+ pmap->devPrivate.ptr = pbits ;
}
diff --git a/xc/programs/Xserver/os/Imakefile b/xc/programs/Xserver/os/Imakefile
index 1854c7ecb..b0ab6d8ec 100644
--- a/xc/programs/Xserver/os/Imakefile
+++ b/xc/programs/Xserver/os/Imakefile
@@ -1,5 +1,10 @@
-XCOMM $TOG: Imakefile /main/85 1997/12/07 18:26:23 kaleb $
-XCOMM $XFree86: xc/programs/Xserver/os/Imakefile,v 3.28 2000/11/30 23:30:06 dawes Exp $
+XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:53:40 cpqbld Exp $
+
+
+
+
+XCOMM $XFree86: xc/programs/Xserver/os/Imakefile,v 3.29 2001/01/17 22:37:09 dawes Exp $
+
#include <Server.tmpl>
/*
diff --git a/xc/programs/Xserver/render/picturestr.h b/xc/programs/Xserver/render/picturestr.h
index a67397c77..784ce8715 100644
--- a/xc/programs/Xserver/render/picturestr.h
+++ b/xc/programs/Xserver/render/picturestr.h
@@ -1,5 +1,5 @@
/*
- * $XFree86: xc/programs/Xserver/render/picturestr.h,v 1.10 2000/12/05 03:13:33 keithp Exp $
+ * $XFree86: xc/programs/Xserver/render/picturestr.h,v 1.12 2001/01/21 21:19:39 tsi Exp $
*
* Copyright © 2000 SuSE, Inc.
*
@@ -26,9 +26,8 @@
#ifndef _PICTURESTR_H_
#define _PICTURESTR_H_
-#include "renderproto.h"
-#include "picture.h"
#include "glyphstr.h"
+#include "scrnintstr.h"
#include "resource.h"
typedef struct _DirectFormat {
@@ -270,4 +269,11 @@ CompositeRects (CARD8 op,
int nRect,
xRectangle *rects);
+void RenderExtensionInit (void);
+
+#ifdef PANORAMIX
+void PanoramiXRenderInit (void);
+void PanoramiXRenderReset (void);
+#endif
+
#endif /* _PICTURESTR_H_ */
diff --git a/xc/programs/Xserver/render/render.c b/xc/programs/Xserver/render/render.c
index e63ec714c..c9f288a80 100644
--- a/xc/programs/Xserver/render/render.c
+++ b/xc/programs/Xserver/render/render.c
@@ -1,5 +1,5 @@
/*
- * $XFree86: xc/programs/Xserver/render/render.c,v 1.8 2000/12/05 03:13:34 keithp Exp $
+ * $XFree86: xc/programs/Xserver/render/render.c,v 1.9 2001/01/03 02:54:17 keithp Exp $
*
* Copyright © 2000 SuSE, Inc.
*
@@ -69,8 +69,11 @@ static int ProcRenderFreeGlyphSet (ClientPtr pClient);
static int ProcRenderAddGlyphs (ClientPtr pClient);
static int ProcRenderAddGlyphsFromPicture (ClientPtr pClient);
static int ProcRenderFreeGlyphs (ClientPtr pClient);
-static int ProcRenderCompositeGlyphs (ClientPtr pClient, int size);
+static int ProcRenderCompositeGlyphs (ClientPtr pClient);
+static int ProcRenderFillRectangles (ClientPtr pClient);
+
static int ProcRenderDispatch (ClientPtr pClient);
+
static int SProcRenderQueryVersion (ClientPtr pClient);
static int SProcRenderQueryPictFormats (ClientPtr pClient);
static int SProcRenderQueryPictIndexValues (ClientPtr pClient);
@@ -94,13 +97,78 @@ static int SProcRenderFreeGlyphSet (ClientPtr pClient);
static int SProcRenderAddGlyphs (ClientPtr pClient);
static int SProcRenderAddGlyphsFromPicture (ClientPtr pClient);
static int SProcRenderFreeGlyphs (ClientPtr pClient);
+static int SProcRenderCompositeGlyphs (ClientPtr pClient);
+static int SProcRenderFillRectangles (ClientPtr pClient);
+
static int SProcRenderDispatch (ClientPtr pClient);
+#define RenderNumRequests (X_RenderFillRectangles+1)
+
+int (*ProcRenderVector[RenderNumRequests])(ClientPtr) = {
+ ProcRenderQueryVersion,
+ ProcRenderQueryPictFormats,
+ ProcRenderQueryPictIndexValues,
+ ProcRenderQueryDithers,
+ ProcRenderCreatePicture,
+ ProcRenderChangePicture,
+ ProcRenderSetPictureClipRectangles,
+ ProcRenderFreePicture,
+ ProcRenderComposite,
+ ProcRenderScale,
+ ProcRenderTrapezoids,
+ ProcRenderTriangles,
+ ProcRenderTriStrip,
+ ProcRenderTriFan,
+ ProcRenderColorTrapezoids,
+ ProcRenderColorTriangles,
+ ProcRenderTransform,
+ ProcRenderCreateGlyphSet,
+ ProcRenderReferenceGlyphSet,
+ ProcRenderFreeGlyphSet,
+ ProcRenderAddGlyphs,
+ ProcRenderAddGlyphsFromPicture,
+ ProcRenderFreeGlyphs,
+ ProcRenderCompositeGlyphs,
+ ProcRenderCompositeGlyphs,
+ ProcRenderCompositeGlyphs,
+ ProcRenderFillRectangles,
+};
+
+int (*SProcRenderVector[RenderNumRequests])(ClientPtr) = {
+ SProcRenderQueryVersion,
+ SProcRenderQueryPictFormats,
+ SProcRenderQueryPictIndexValues,
+ SProcRenderQueryDithers,
+ SProcRenderCreatePicture,
+ SProcRenderChangePicture,
+ SProcRenderSetPictureClipRectangles,
+ SProcRenderFreePicture,
+ SProcRenderComposite,
+ SProcRenderScale,
+ SProcRenderTrapezoids,
+ SProcRenderTriangles,
+ SProcRenderTriStrip,
+ SProcRenderTriFan,
+ SProcRenderColorTrapezoids,
+ SProcRenderColorTriangles,
+ SProcRenderTransform,
+ SProcRenderCreateGlyphSet,
+ SProcRenderReferenceGlyphSet,
+ SProcRenderFreeGlyphSet,
+ SProcRenderAddGlyphs,
+ SProcRenderAddGlyphsFromPicture,
+ SProcRenderFreeGlyphs,
+ SProcRenderCompositeGlyphs,
+ SProcRenderCompositeGlyphs,
+ SProcRenderCompositeGlyphs,
+ SProcRenderFillRectangles,
+};
+
static void
RenderResetProc (ExtensionEntry *extEntry);
static CARD8 RenderReqCode;
-static int RenderErrBase;
+int RenderErrBase;
void
RenderExtensionInit (void)
@@ -181,6 +249,8 @@ findVisual (ScreenPtr pScreen, VisualID vid)
return 0;
}
+extern char *ConnectionInfo;
+
static int
ProcRenderQueryPictFormats (ClientPtr client)
{
@@ -201,12 +271,19 @@ ProcRenderQueryPictFormats (ClientPtr client)
int rlength;
int s;
int n;
+ int numScreens;
/* REQUEST(xRenderQueryPictFormatsReq); */
REQUEST_SIZE_MATCH(xRenderQueryPictFormatsReq);
+#ifdef PANORAMIX
+ if (noPanoramiXExtension)
+ numScreens = screenInfo.numScreens;
+ else
+ numScreens = ((xConnSetup *)ConnectionInfo)->numRoots;
+#endif
ndepth = nformat = nvisual = 0;
- for (s = 0; s < screenInfo.numScreens; s++)
+ for (s = 0; s < numScreens; s++)
{
pScreen = screenInfo.screens[s];
for (d = 0; d < pScreen->numDepths; d++)
@@ -227,7 +304,7 @@ ProcRenderQueryPictFormats (ClientPtr client)
}
rlength = (sizeof (xRenderQueryPictFormatsReply) +
nformat * sizeof (xPictFormInfo) +
- screenInfo.numScreens * sizeof (xPictScreen) +
+ numScreens * sizeof (xPictScreen) +
ndepth * sizeof (xPictDepth) +
nvisual * sizeof (xPictVisual));
reply = (xRenderQueryPictFormatsReply *) xalloc (rlength);
@@ -237,13 +314,13 @@ ProcRenderQueryPictFormats (ClientPtr client)
reply->sequenceNumber = client->sequence;
reply->length = (rlength - sizeof(xGenericReply)) >> 2;
reply->numFormats = nformat;
- reply->numScreens = screenInfo.numScreens;
+ reply->numScreens = numScreens;
reply->numDepths = ndepth;
reply->numVisuals = nvisual;
pictForm = (xPictFormInfo *) (reply + 1);
- for (s = 0; s < screenInfo.numScreens; s++)
+ for (s = 0; s < numScreens; s++)
{
pScreen = screenInfo.screens[s];
ps = GetPictureScreenIfSet(pScreen);
@@ -287,7 +364,7 @@ ProcRenderQueryPictFormats (ClientPtr client)
}
pictScreen = (xPictScreen *) pictForm;
- for (s = 0; s < screenInfo.numScreens; s++)
+ for (s = 0; s < numScreens; s++)
{
pScreen = screenInfo.screens[s];
pictDepth = (xPictDepth *) (pictScreen + 1);
@@ -761,7 +838,7 @@ ProcRenderFreeGlyphs (ClientPtr client)
}
static int
-ProcRenderCompositeGlyphs (ClientPtr client, int size)
+ProcRenderCompositeGlyphs (ClientPtr client)
{
GlyphSetPtr glyphSet;
GlyphSet gs;
@@ -777,12 +854,19 @@ ProcRenderCompositeGlyphs (ClientPtr client, int size)
int nglyph;
int nlist;
int space;
+ int size;
int n;
REQUEST(xRenderCompositeGlyphsReq);
REQUEST_AT_LEAST_SIZE(xRenderCompositeGlyphsReq);
+ switch (stuff->renderReqType) {
+ default: size = 1; break;
+ case X_RenderCompositeGlyphs16: size = 2; break;
+ case X_RenderCompositeGlyphs32: size = 4; break;
+ }
+
VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess,
RenderErrBase + BadPicture);
VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess,
@@ -970,65 +1054,11 @@ static int
ProcRenderDispatch (ClientPtr client)
{
REQUEST(xReq);
- switch (stuff->data)
- {
- case X_RenderQueryVersion:
- return ProcRenderQueryVersion(client);
- case X_RenderQueryPictFormats:
- return ProcRenderQueryPictFormats(client);
- case X_RenderQueryPictIndexValues:
- return ProcRenderQueryPictIndexValues(client);
- case X_RenderQueryDithers:
- return ProcRenderQueryDithers(client);
- case X_RenderCreatePicture:
- return ProcRenderCreatePicture(client);
- case X_RenderChangePicture:
- return ProcRenderChangePicture(client);
- case X_RenderSetPictureClipRectangles:
- return ProcRenderSetPictureClipRectangles(client);
- case X_RenderFreePicture:
- return ProcRenderFreePicture(client);
- case X_RenderComposite:
- return ProcRenderComposite(client);
- case X_RenderScale:
- return ProcRenderScale(client);
- case X_RenderTrapezoids:
- return ProcRenderTrapezoids(client);
- case X_RenderTriangles:
- return ProcRenderTriangles(client);
- case X_RenderTriStrip:
- return ProcRenderTriStrip(client);
- case X_RenderTriFan:
- return ProcRenderTriFan(client);
- case X_RenderColorTrapezoids:
- return ProcRenderColorTrapezoids(client);
- case X_RenderColorTriangles:
- return ProcRenderColorTriangles(client);
- case X_RenderTransform:
- return ProcRenderTransform(client);
- case X_RenderCreateGlyphSet:
- return ProcRenderCreateGlyphSet(client);
- case X_RenderReferenceGlyphSet:
- return ProcRenderReferenceGlyphSet(client);
- case X_RenderFreeGlyphSet:
- return ProcRenderFreeGlyphSet(client);
- case X_RenderAddGlyphs:
- return ProcRenderAddGlyphs(client);
- case X_RenderAddGlyphsFromPicture:
- return ProcRenderAddGlyphsFromPicture(client);
- case X_RenderFreeGlyphs:
- return ProcRenderFreeGlyphs(client);
- case X_RenderCompositeGlyphs8:
- return ProcRenderCompositeGlyphs(client, 1);
- case X_RenderCompositeGlyphs16:
- return ProcRenderCompositeGlyphs(client, 2);
- case X_RenderCompositeGlyphs32:
- return ProcRenderCompositeGlyphs(client, 4);
- case X_RenderFillRectangles:
- return ProcRenderFillRectangles(client);
- default:
+
+ if (stuff->data < RenderNumRequests)
+ return (*ProcRenderVector[stuff->data]) (client);
+ else
return BadRequest;
- }
}
static int
@@ -1040,7 +1070,7 @@ SProcRenderQueryVersion (ClientPtr client)
swaps(&stuff->length, n);
swapl(&stuff->majorVersion, n);
swapl(&stuff->minorVersion, n);
- return ProcRenderQueryVersion(client);
+ return (*ProcRenderVector[stuff->renderReqType])(client);
}
static int
@@ -1049,7 +1079,7 @@ SProcRenderQueryPictFormats (ClientPtr client)
register int n;
REQUEST(xRenderQueryPictFormatsReq);
swaps(&stuff->length, n);
- return ProcRenderQueryPictFormats (client);
+ return (*ProcRenderVector[stuff->renderReqType]) (client);
}
static int
@@ -1075,7 +1105,7 @@ SProcRenderCreatePicture (ClientPtr client)
swapl(&stuff->format, n);
swapl(&stuff->mask, n);
SwapRestL(stuff);
- return ProcRenderCreatePicture (client);
+ return (*ProcRenderVector[stuff->renderReqType]) (client);
}
static int
@@ -1087,7 +1117,7 @@ SProcRenderChangePicture (ClientPtr client)
swapl(&stuff->picture, n);
swapl(&stuff->mask, n);
SwapRestL(stuff);
- return ProcRenderChangePicture (client);
+ return (*ProcRenderVector[stuff->renderReqType]) (client);
}
static int
@@ -1098,7 +1128,7 @@ SProcRenderSetPictureClipRectangles (ClientPtr client)
swaps(&stuff->length, n);
swapl(&stuff->picture, n);
SwapRestS(stuff);
- return ProcRenderSetPictureClipRectangles (client);
+ return (*ProcRenderVector[stuff->renderReqType]) (client);
}
static int
@@ -1108,7 +1138,7 @@ SProcRenderFreePicture (ClientPtr client)
REQUEST(xRenderFreePictureReq);
swaps(&stuff->length, n);
swapl(&stuff->picture, n);
- return ProcRenderFreePicture (client);
+ return (*ProcRenderVector[stuff->renderReqType]) (client);
}
static int
@@ -1128,7 +1158,7 @@ SProcRenderComposite (ClientPtr client)
swaps(&stuff->yDst, n);
swaps(&stuff->width, n);
swaps(&stuff->height, n);
- return ProcRenderComposite (client);
+ return (*ProcRenderVector[stuff->renderReqType]) (client);
}
static int
@@ -1147,7 +1177,7 @@ SProcRenderScale (ClientPtr client)
swaps(&stuff->yDst, n);
swaps(&stuff->width, n);
swaps(&stuff->height, n);
- return ProcRenderScale (client);
+ return (*ProcRenderVector[stuff->renderReqType]) (client);
}
static int
@@ -1200,7 +1230,7 @@ SProcRenderCreateGlyphSet (ClientPtr client)
swaps(&stuff->length, n);
swapl(&stuff->gsid, n);
swapl(&stuff->format, n);
- return ProcRenderCreateGlyphSet (client);
+ return (*ProcRenderVector[stuff->renderReqType]) (client);
}
static int
@@ -1211,7 +1241,7 @@ SProcRenderReferenceGlyphSet (ClientPtr client)
swaps(&stuff->length, n);
swapl(&stuff->gsid, n);
swapl(&stuff->existing, n);
- return ProcRenderReferenceGlyphSet (client);
+ return (*ProcRenderVector[stuff->renderReqType]) (client);
}
static int
@@ -1221,7 +1251,7 @@ SProcRenderFreeGlyphSet (ClientPtr client)
REQUEST(xRenderFreeGlyphSetReq);
swaps(&stuff->length, n);
swapl(&stuff->glyphset, n);
- return ProcRenderFreeGlyphSet (client);
+ return (*ProcRenderVector[stuff->renderReqType]) (client);
}
static int
@@ -1255,7 +1285,7 @@ SProcRenderAddGlyphs (ClientPtr client)
swaps (&gi[i].xOff, n);
swaps (&gi[i].yOff, n);
}
- return ProcRenderAddGlyphs (client);
+ return (*ProcRenderVector[stuff->renderReqType]) (client);
}
static int
@@ -1272,19 +1302,28 @@ SProcRenderFreeGlyphs (ClientPtr client)
swaps(&stuff->length, n);
swapl(&stuff->glyphset, n);
SwapRestL(stuff);
- return ProcRenderFreeGlyphs (client);
+ return (*ProcRenderVector[stuff->renderReqType]) (client);
}
static int
-SProcRenderCompositeGlyphs (ClientPtr client, int size)
+SProcRenderCompositeGlyphs (ClientPtr client)
{
register int n;
xGlyphElt *elt;
CARD8 *buffer;
CARD8 *end;
int space;
+ int i;
+ int size;
REQUEST(xRenderCompositeGlyphsReq);
+
+ switch (stuff->renderReqType) {
+ default: size = 1; break;
+ case X_RenderCompositeGlyphs16: size = 2; break;
+ case X_RenderCompositeGlyphs32: size = 4; break;
+ }
+
swaps(&stuff->length, n);
swapl(&stuff->src, n);
swapl(&stuff->dst, n);
@@ -1302,19 +1341,39 @@ SProcRenderCompositeGlyphs (ClientPtr client, int size)
swaps (&elt->deltax, n);
swaps (&elt->deltay, n);
- if (elt->len == 0xff)
+ i = elt->len;
+ if (i == 0xff)
{
+ swapl (buffer, n);
buffer += 4;
}
else
{
- space = size * elt->len;
+ space = size * i;
+ switch (size) {
+ case 1:
+ buffer += i;
+ break;
+ case 2:
+ while (i--)
+ {
+ swaps (buffer, n);
+ buffer += 2;
+ }
+ break;
+ case 4:
+ while (i--)
+ {
+ swapl (buffer, n);
+ buffer += 4;
+ }
+ break;
+ }
if (space & 3)
- space += 4 - (space & 3);
- buffer += space;
+ buffer += 4 - (space & 3);
}
}
- return ProcRenderCompositeGlyphs (client, size);
+ return (*ProcRenderVector[stuff->renderReqType]) (client);
}
static int
@@ -1330,70 +1389,321 @@ SProcRenderFillRectangles (ClientPtr client)
swaps(&stuff->color.blue, n);
swaps(&stuff->color.alpha, n);
SwapRestS(stuff);
- return ProcRenderFillRectangles (client);
+ return (*ProcRenderVector[stuff->renderReqType]) (client);
}
static int
SProcRenderDispatch (ClientPtr client)
{
REQUEST(xReq);
- switch (stuff->data)
- {
- case X_RenderQueryVersion:
- return SProcRenderQueryVersion(client);
- case X_RenderQueryPictFormats:
- return SProcRenderQueryPictFormats(client);
- case X_RenderQueryPictIndexValues:
- return SProcRenderQueryPictIndexValues(client);
- case X_RenderQueryDithers:
- return SProcRenderQueryDithers(client);
- case X_RenderCreatePicture:
- return SProcRenderCreatePicture(client);
- case X_RenderChangePicture:
- return SProcRenderChangePicture(client);
- case X_RenderSetPictureClipRectangles:
- return SProcRenderSetPictureClipRectangles(client);
- case X_RenderFreePicture:
- return SProcRenderFreePicture(client);
- case X_RenderComposite:
- return SProcRenderComposite(client);
- case X_RenderScale:
- return SProcRenderScale(client);
- case X_RenderTrapezoids:
- return SProcRenderTrapezoids(client);
- case X_RenderTriangles:
- return SProcRenderTriangles(client);
- case X_RenderTriStrip:
- return SProcRenderTriStrip(client);
- case X_RenderTriFan:
- return SProcRenderTriFan(client);
- case X_RenderColorTrapezoids:
- return SProcRenderColorTrapezoids(client);
- case X_RenderColorTriangles:
- return SProcRenderColorTriangles(client);
- case X_RenderTransform:
- return SProcRenderTransform(client);
- case X_RenderCreateGlyphSet:
- return SProcRenderCreateGlyphSet(client);
- case X_RenderReferenceGlyphSet:
- return SProcRenderReferenceGlyphSet(client);
- case X_RenderFreeGlyphSet:
- return SProcRenderFreeGlyphSet(client);
- case X_RenderAddGlyphs:
- return SProcRenderAddGlyphs(client);
- case X_RenderAddGlyphsFromPicture:
- return SProcRenderAddGlyphsFromPicture(client);
- case X_RenderFreeGlyphs:
- return SProcRenderFreeGlyphs(client);
- case X_RenderCompositeGlyphs8:
- return SProcRenderCompositeGlyphs(client, 1);
- case X_RenderCompositeGlyphs16:
- return SProcRenderCompositeGlyphs(client, 2);
- case X_RenderCompositeGlyphs32:
- return SProcRenderCompositeGlyphs(client, 4);
- case X_RenderFillRectangles:
- return SProcRenderFillRectangles(client);
- default:
+
+ if (stuff->data < RenderNumRequests)
+ return (*SProcRenderVector[stuff->data]) (client);
+ else
return BadRequest;
+}
+
+#ifdef PANORAMIX
+#include "panoramiX.h"
+#include "panoramiXsrv.h"
+
+#define VERIFY_XIN_PICTURE(pPicture, pid, client, mode, err) {\
+ pPicture = SecurityLookupIDByType(client, pid, XRT_PICTURE, mode);\
+ if (!pPicture) { \
+ client->errorValue = pid; \
+ return err; \
+ } \
+}
+
+#define VERIFY_XIN_ALPHA(pPicture, pid, client, mode, err) {\
+ if (pid == None) \
+ pPicture = 0; \
+ else { \
+ VERIFY_XIN_PICTURE(pPicture, pid, client, mode, err); \
+ } \
+} \
+
+int (*PanoramiXSaveRenderVector[RenderNumRequests])(ClientPtr);
+extern int XineramaDeleteResource(pointer data, XID id);
+
+unsigned long XRT_PICTURE;
+
+static int
+PanoramiXRenderCreatePicture (ClientPtr client)
+{
+ REQUEST(xRenderCreatePictureReq);
+ PanoramiXRes *refDraw, *newPict;
+ int result = Success, j;
+
+ REQUEST_AT_LEAST_SIZE(xRenderCreatePictureReq);
+ if(!(refDraw = (PanoramiXRes *)SecurityLookupIDByClass(
+ client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess)))
+ return BadDrawable;
+ if(!(newPict = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes))))
+ return BadAlloc;
+ newPict->type = XRT_PICTURE;
+ newPict->info[0].id = stuff->pid;
+
+ if (refDraw->type == XRT_WINDOW &&
+ stuff->drawable == WindowTable[0]->drawable.id)
+ {
+ newPict->u.pict.root = TRUE;
+ }
+ else
+ newPict->u.pict.root = FALSE;
+
+ for(j = 1; j < PanoramiXNumScreens; j++)
+ newPict->info[j].id = FakeClientID(client->index);
+
+ FOR_NSCREENS_BACKWARD(j) {
+ stuff->pid = newPict->info[j].id;
+ stuff->drawable = refDraw->info[j].id;
+ result = (*PanoramiXSaveRenderVector[X_RenderCreatePicture]) (client);
+ if(result != Success) break;
+ }
+
+ if (result == Success)
+ AddResource(newPict->info[0].id, XRT_PICTURE, newPict);
+ else
+ xfree(newPict);
+
+ return (result);
+}
+
+static int
+PanoramiXRenderChangePicture (ClientPtr client)
+{
+ PanoramiXRes *pict;
+ int result = Success, j;
+ REQUEST(xRenderChangePictureReq);
+
+ REQUEST_AT_LEAST_SIZE(xChangeWindowAttributesReq);
+
+ VERIFY_XIN_PICTURE(pict, stuff->picture, client, SecurityWriteAccess,
+ RenderErrBase + BadPicture);
+
+ FOR_NSCREENS_BACKWARD(j) {
+ stuff->picture = pict->info[j].id;
+ result = (*PanoramiXSaveRenderVector[X_RenderChangePicture]) (client);
+ if(result != Success) break;
+ }
+
+ return (result);
+}
+
+static int
+PanoramiXRenderSetPictureClipRectangles (ClientPtr client)
+{
+ REQUEST(xRenderSetPictureClipRectanglesReq);
+ int result = Success, j;
+ PanoramiXRes *pict;
+
+ REQUEST_AT_LEAST_SIZE(xRenderSetPictureClipRectanglesReq);
+
+ VERIFY_XIN_PICTURE(pict, stuff->picture, client, SecurityWriteAccess,
+ RenderErrBase + BadPicture);
+
+ FOR_NSCREENS_BACKWARD(j) {
+ stuff->picture = pict->info[j].id;
+ result = (*PanoramiXSaveRenderVector[X_RenderSetPictureClipRectangles]) (client);
+ if(result != Success) break;
+ }
+
+ return (result);
+}
+
+static int
+PanoramiXRenderFreePicture (ClientPtr client)
+{
+ PanoramiXRes *pict;
+ int result = Success, j;
+ REQUEST(xRenderFreePictureReq);
+
+ REQUEST_SIZE_MATCH(xRenderFreePictureReq);
+
+ client->errorValue = stuff->picture;
+
+ VERIFY_XIN_PICTURE(pict, stuff->picture, client, SecurityDestroyAccess,
+ RenderErrBase + BadPicture);
+
+
+ FOR_NSCREENS_BACKWARD(j) {
+ stuff->picture = pict->info[j].id;
+ result = (*PanoramiXSaveRenderVector[X_RenderFreePicture]) (client);
+ if(result != Success) break;
}
+
+ /* Since ProcRenderFreePicture is using FreeResource, it will free
+ our resource for us on the last pass through the loop above */
+
+ return (result);
}
+
+static int
+PanoramiXRenderComposite (ClientPtr client)
+{
+ PanoramiXRes *src, *msk, *dst;
+ int result = Success, j;
+ xRenderCompositeReq orig;
+ REQUEST(xRenderCompositeReq);
+
+ REQUEST_SIZE_MATCH(xRenderCompositeReq);
+
+ VERIFY_XIN_PICTURE (src, stuff->src, client, SecurityReadAccess,
+ RenderErrBase + BadPicture);
+ VERIFY_XIN_ALPHA (msk, stuff->mask, client, SecurityReadAccess,
+ RenderErrBase + BadPicture);
+ VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess,
+ RenderErrBase + BadPicture);
+
+ orig = *stuff;
+
+ FOR_NSCREENS_FORWARD(j) {
+ stuff->src = src->info[j].id;
+ if (src->u.pict.root)
+ {
+ stuff->xSrc = orig.xSrc - panoramiXdataPtr[j].x;
+ stuff->ySrc = orig.ySrc - panoramiXdataPtr[j].y;
+ }
+ stuff->dst = dst->info[j].id;
+ if (dst->u.pict.root)
+ {
+ stuff->xDst = orig.xDst - panoramiXdataPtr[j].x;
+ stuff->yDst = orig.yDst - panoramiXdataPtr[j].y;
+ }
+ if (msk)
+ {
+ stuff->mask = msk->info[j].id;
+ if (msk->u.pict.root)
+ {
+ stuff->xMask = orig.xMask - panoramiXdataPtr[j].x;
+ stuff->yMask = orig.yMask - panoramiXdataPtr[j].y;
+ }
+ }
+ result = (*PanoramiXSaveRenderVector[X_RenderComposite]) (client);
+ if(result != Success) break;
+ }
+
+ return result;
+}
+
+static int
+PanoramiXRenderCompositeGlyphs (ClientPtr client)
+{
+ PanoramiXRes *src, *dst;
+ int result = Success, j;
+ REQUEST(xRenderCompositeGlyphsReq);
+ xGlyphElt origElt, *elt;
+ INT16 xSrc, ySrc;
+
+ REQUEST_AT_LEAST_SIZE(xRenderCompositeGlyphsReq);
+ VERIFY_XIN_PICTURE (src, stuff->src, client, SecurityReadAccess,
+ RenderErrBase + BadPicture);
+ VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess,
+ RenderErrBase + BadPicture);
+
+ if (stuff->length << 2 >= (sizeof (xRenderCompositeGlyphsReq) +
+ sizeof (xGlyphElt)))
+ {
+ elt = (xGlyphElt *) (stuff + 1);
+ origElt = *elt;
+ xSrc = stuff->xSrc;
+ ySrc = stuff->ySrc;
+ FOR_NSCREENS_FORWARD(j) {
+ stuff->src = src->info[j].id;
+ if (src->u.pict.root)
+ {
+ stuff->xSrc = xSrc - panoramiXdataPtr[j].x;
+ stuff->ySrc = ySrc - panoramiXdataPtr[j].y;
+ }
+ stuff->dst = dst->info[j].id;
+ if (dst->u.pict.root)
+ {
+ elt->deltax = origElt.deltax - panoramiXdataPtr[j].x;
+ elt->deltay = origElt.deltay - panoramiXdataPtr[j].y;
+ }
+ result = (*PanoramiXSaveRenderVector[stuff->renderReqType]) (client);
+ if(result != Success) break;
+ }
+ }
+
+ return result;
+}
+
+static int
+PanoramiXRenderFillRectangles (ClientPtr client)
+{
+ PanoramiXRes *dst;
+ int result = Success, j;
+ REQUEST(xRenderFillRectanglesReq);
+ char *extra;
+ int extra_len;
+
+ REQUEST_AT_LEAST_SIZE (xRenderFillRectanglesReq);
+ VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess,
+ RenderErrBase + BadPicture);
+ extra_len = (stuff->length << 2) - sizeof (xRenderFillRectanglesReq);
+ if (extra_len &&
+ (extra = (char *) ALLOCATE_LOCAL (extra_len)))
+ {
+ memcpy (extra, stuff + 1, extra_len);
+ FOR_NSCREENS_FORWARD(j) {
+ if (j) memcpy (stuff + 1, extra, extra_len);
+ if (dst->u.pict.root)
+ {
+ int x_off = panoramiXdataPtr[j].x;
+ int y_off = panoramiXdataPtr[j].y;
+
+ if(x_off || y_off) {
+ xRectangle *rects = (xRectangle *) (stuff + 1);
+ int i = extra_len / sizeof (xRectangle);
+
+ while (i--)
+ {
+ rects->x -= x_off;
+ rects->y -= y_off;
+ rects++;
+ }
+ }
+ }
+ stuff->dst = dst->info[j].id;
+ result = (*PanoramiXSaveRenderVector[X_RenderFillRectangles]) (client);
+ if(result != Success) break;
+ }
+ DEALLOCATE_LOCAL(extra);
+ }
+
+ return result;
+}
+
+void
+PanoramiXRenderInit (void)
+{
+ int i;
+
+ XRT_PICTURE = CreateNewResourceType (XineramaDeleteResource);
+ for (i = 0; i < RenderNumRequests; i++)
+ PanoramiXSaveRenderVector[i] = ProcRenderVector[i];
+ /*
+ * Stuff in Xinerama aware request processing hooks
+ */
+ ProcRenderVector[X_RenderCreatePicture] = PanoramiXRenderCreatePicture;
+ ProcRenderVector[X_RenderChangePicture] = PanoramiXRenderChangePicture;
+ ProcRenderVector[X_RenderSetPictureClipRectangles] = PanoramiXRenderSetPictureClipRectangles;
+ ProcRenderVector[X_RenderFreePicture] = PanoramiXRenderFreePicture;
+ ProcRenderVector[X_RenderComposite] = PanoramiXRenderComposite;
+ ProcRenderVector[X_RenderCompositeGlyphs8] = PanoramiXRenderCompositeGlyphs;
+ ProcRenderVector[X_RenderCompositeGlyphs16] = PanoramiXRenderCompositeGlyphs;
+ ProcRenderVector[X_RenderCompositeGlyphs32] = PanoramiXRenderCompositeGlyphs;
+ ProcRenderVector[X_RenderFillRectangles] = PanoramiXRenderFillRectangles;
+}
+
+void
+PanoramiXRenderReset (void)
+{
+ int i;
+ for (i = 0; i < RenderNumRequests; i++)
+ ProcRenderVector[i] = PanoramiXSaveRenderVector[i];
+}
+
+#endif /* PANORAMIX */